<commit_before>#ifndef STAN_MATH_REV_SCAL_FUN_GRAD_INC_BETA_HPP
#define STAN_MATH_REV_SCAL_FUN_GRAD_INC_BETA_HPP

#include <stan/math/prim/scal/fun/grad_2F1.hpp>
#include <stan/math/rev/core.hpp>
#include <stan/math/rev/scal/fun/exp.hpp>
#include <stan/math/rev/scal/fun/fabs.hpp>
#include <stan/math/prim/scal/fun/lbeta.hpp>
#include <stan/math/rev/scal/fun/lgamma.hpp>
#include <stan/math/rev/scal/fun/log.hpp>
#include <stan/math/rev/scal/fun/log1m.hpp>
#include <stan/math/rev/scal/fun/value_of.hpp>
#include <stan/math/prim/scal/fun/value_of.hpp>
#include <stan/math/rev/scal/fun/inc_beta.hpp>
#include <cmath>

namespace stan {
  namespace math {

    /**
     * Gradient of the incomplete beta function beta(a, b, z) with
     * respect to the first two arguments.
     *
     * Uses the equivalence to a hypergeometric function. See
     * http://dlmf.nist.gov/8.17#ii
     *
     * @param[out] g1 d/da
     * @param[out] g2 d/db
     * @param[in] a a
     * @param[in] b b
     * @param[in] z z
     */
    inline void grad_inc_beta(var& g1, var& g2,
                              const var& a, const var& b, const var& z) {<commit_msg>Had to add the rev specific is_nan<commit_after>#ifndef STAN_MATH_REV_SCAL_FUN_GRAD_INC_BETA_HPP
#define STAN_MATH_REV_SCAL_FUN_GRAD_INC_BETA_HPP

#include <stan/math/rev/core.hpp>
#include <stan/math/prim/scal/fun/lbeta.hpp>
#include <stan/math/prim/scal/fun/grad_2F1.hpp>
#include <stan/math/prim/scal/fun/value_of.hpp>
#include <stan/math/rev/scal/fun/exp.hpp>
#include <stan/math/rev/scal/fun/fabs.hpp>
#include <stan/math/rev/scal/fun/inc_beta.hpp>
#include <stan/math/rev/scal/fun/is_nan.hpp>
#include <stan/math/rev/scal/fun/lgamma.hpp>
#include <stan/math/rev/scal/fun/log.hpp>
#include <stan/math/rev/scal/fun/log1m.hpp>
#include <stan/math/rev/scal/fun/value_of.hpp>
#include <cmath>

namespace stan {
  namespace math {

    /**
     * Gradient of the incomplete beta function beta(a, b, z) with
     * respect to the first two arguments.
     *
     * Uses the equivalence to a hypergeometric function. See
     * http://dlmf.nist.gov/8.17#ii
     *
     * @param[out] g1 d/da
     * @param[out] g2 d/db
     * @param[in] a a
     * @param[in] b b
     * @param[in] z z
     */
    inline void grad_inc_beta(var& g1, var& g2,
                              const var& a, const var& b, const var& z) {
{'fraction_non_alphanumeric': 0.14473684210526316, 'fraction_numerical': 0.008488964346349746, 'mean_word_length': 3.0849220103986137, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2126518', 'n_tokens_mistral': 960, 'n_tokens_neox': 942, 'n_words': 182}