![]() |
Stan Math Library
5.4.0
Automatic Differentiation
|
|
inline |
Returns the elementwise erfcx() of a var_value<matrix_cl<double>>.
The derivative 2 * x * erfcx(x) - 2 / sqrt(pi) reuses the function value, so no second exp or erfc evaluation is needed. That difference cancels for x >= 4, where both terms approach 2 / sqrt(pi) while the result decays like 1 / (sqrt(pi) * x^2); the device function erfcx_derivative takes the derivative from the tail rational there instead. Without that the error reaches 2.55e+11 ulp at x = 1e6. The CPU implementation branches at the same point.
| A | argument |
erfcx() of the input.