Automatic Differentiation
 
Loading...
Searching...
No Matches
hypergeometric_1F0.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_FWD_FUN_HYPERGEOMETRIC_1F0_HPP
2#define STAN_MATH_FWD_FUN_HYPERGEOMETRIC_1F0_HPP
3
7
8namespace stan {
9namespace math {
10
28template <typename Ta, typename Tz, typename FvarT = return_type_t<Ta, Tz>,
29 require_all_stan_scalar_t<Ta, Tz>* = nullptr,
30 require_any_fvar_t<Ta, Tz>* = nullptr>
31FvarT hypergeometric_1f0(const Ta& a, const Tz& z) {
34 FvarT rtn = FvarT(hypergeometric_1f0(a_val, z_val), 0.0);
36 rtn.d_ += forward_as<FvarT>(a).d() * -rtn.val() * log1m(z_val);
37 }
39 rtn.d_ += forward_as<FvarT>(z).d() * rtn.val() * a_val * inv(1 - z_val);
40 }
41 return rtn;
42}
43
44} // namespace math
45} // namespace stan
46#endif
typename partials_type< T >::type partials_type_t
Helper alias for accessing the partial type.
FvarT hypergeometric_1f0(const Ta &a, const Tz &z)
Returns the Hypergeometric 1F0 function applied to the input arguments: .
T value_of(const fvar< T > &v)
Return the value of the specified variable.
Definition value_of.hpp:18
fvar< T > log1m(const fvar< T > &x)
Definition log1m.hpp:12
fvar< T > inv(const fvar< T > &x)
Definition inv.hpp:12
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Extends std::true_type when instantiated with zero or more template parameters, all of which extend t...