![]() |
Stan Math Library
5.4.0
Automatic Differentiation
|
| double stan::math::opencl_kernels::erfcx_derivative | ( | double | x, |
| double | value | ||
| ) |
Derivative of erfcx, 2 * x * erfcx(x) - 2 / sqrt(pi).
That difference cancels for large x: both terms approach 2 / sqrt(pi) while the result decays like 1 / (sqrt(pi) * x^2). For x >= 4 the constant cancels analytically against the leading term of the tail rational, leaving 2 * u * C(u). Above 30 it comes from the asymptotic expansion of -sqrt(pi) * x^2 * erfcx'(x) in u, whose coefficients satisfy c_{n+1} = -(n + 3/2) * c_n.
Takes the value as an argument so the reverse pass does not evaluate erfcx twice.
| x | argument |
| value | erfcx(x) |