Automatic Differentiation
 
Loading...
Searching...
No Matches
erfcx.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_FWD_FUN_ERFCX_HPP
2#define STAN_MATH_FWD_FUN_ERFCX_HPP
3
8#include <cmath>
9
10namespace stan {
11namespace math {
12
25template <typename T>
26inline fvar<T> erfcx(const fvar<T>& x) {
27 T v = erfcx(x.val_);
28 return fvar<T>(v, x.d_ * internal::erfcx_derivative(x.val_, v));
29}
30
31} // namespace math
32} // namespace stan
33#endif
T erfcx_derivative(const T &x, const T &value)
Derivative of erfcx, 2 * x * erfcx(x) - 2 / sqrt(pi).
Definition erfcx.hpp:128
fvar< T > erfcx(const fvar< T > &x)
Return the scaled complementary error function of the argument.
Definition erfcx.hpp:26
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