Automatic Differentiation
 
Loading...
Searching...
No Matches
bessel_first_kind.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_FWD_FUN_BESSEL_FIRST_KIND_HPP
2#define STAN_MATH_FWD_FUN_BESSEL_FIRST_KIND_HPP
3
7
8namespace stan {
9namespace math {
10
11template <typename T>
12inline fvar<T> bessel_first_kind(int v, const fvar<T>& z) {
13 T bessel_first_kind_z(bessel_first_kind(v, z.val_));
14 return fvar<T>(bessel_first_kind_z,
15 v * z.d_ * bessel_first_kind_z / z.val_
16 - z.d_ * bessel_first_kind(v + 1, z.val_));
17}
18} // namespace math
19} // namespace stan
20#endif
fvar< T > bessel_first_kind(int v, const fvar< T > &z)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Scalar val_
The value of this variable.
Definition fvar.hpp:49
Scalar d_
The tangent (derivative) of this variable.
Definition fvar.hpp:61
This template class represents scalars used in forward-mode automatic differentiation,...
Definition fvar.hpp:40