<commit_before>#ifndef STAN_MATH_FWD_FUN_FMOD_HPP
#define STAN_MATH_FWD_FUN_FMOD_HPP

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/fun/is_any_nan.hpp>
#include <stan/math/prim/fun/value_of.hpp>
#include <cmath>

namespace stan {
namespace math {

template <typename T>
inline fvar<T> fmod(const fvar<T>& x1, const fvar<T>& x2) {
  using std::trunc;
  using std::fmod;
  return fvar<T>(fmod(x1.val_, x2.val_),
                 x1.d_ - x2.d_ * trunc(x1.val_ / x2.val_));
}

template <typename T>
inline fvar<T> fmod(const fvar<T>& x1, double x2) {
  using std::fmod;
  if (unlikely(is_any_nan(value_of(x1.val_), x2))) {
    return fvar<T>(fmod(x1.val_, x2), NOT_A_NUMBER);
  } else {
    return fvar<T>(fmod(x1.val_, x2), x1.d_);
  }
}

template <typename T>
inline fvar<T> fmod(double x1, const fvar<T>& x2) {
  using std::trunc;
  using std::fmod;
  return fvar<T>(fmod(x1, x2.val_), -x2.d_ * trunc(x1 / x2.val_));
}

}  // namespace math
}  // namespace stan
#endif<commit_msg>[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)<commit_after>#ifndef STAN_MATH_FWD_FUN_FMOD_HPP
#define STAN_MATH_FWD_FUN_FMOD_HPP

#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/fun/is_any_nan.hpp>
#include <stan/math/prim/fun/value_of.hpp>
#include <cmath>

namespace stan {
namespace math {

template <typename T>
inline fvar<T> fmod(const fvar<T>& x1, const fvar<T>& x2) {
  using std::fmod;
  using std::trunc;
  return fvar<T>(fmod(x1.val_, x2.val_),
                 x1.d_ - x2.d_ * trunc(x1.val_ / x2.val_));
}

template <typename T>
inline fvar<T> fmod(const fvar<T>& x1, double x2) {
  using std::fmod;
  if (unlikely(is_any_nan(value_of(x1.val_), x2))) {
    return fvar<T>(fmod(x1.val_, x2), NOT_A_NUMBER);
  } else {
    return fvar<T>(fmod(x1.val_, x2), x1.d_);
  }
}

template <typename T>
inline fvar<T> fmod(double x1, const fvar<T>& x2) {
  using std::fmod;
  using std::trunc;
  return fvar<T>(fmod(x1, x2.val_), -x2.d_ * trunc(x1 / x2.val_));
}

}  // namespace math
}  // namespace stan
#endif
{'fraction_non_alphanumeric': 0.16906474820143885, 'fraction_numerical': 0.027428057553956834, 'mean_word_length': 4.150462962962963, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '6784930', 'n_tokens_mistral': 1001, 'n_tokens_neox': 989, 'n_words': 187}