avoid another square root, and fix formula in the documentation

This commit is contained in:
Fredrik Johansson 2016-03-19 14:39:05 +01:00
parent 8dfba32d8c
commit 2ba3e36dbd
2 changed files with 3 additions and 4 deletions

View file

@ -142,10 +142,9 @@ acb_hypgeom_erf_asymp(acb_t res, const acb_t z, int complementary, slong prec, s
acb_exp(t, t, prec2);
acb_mul(u, u, t, prec2);
acb_const_pi(t, prec2);
acb_sqrt(t, t, prec2);
arb_const_sqrt_pi(acb_realref(t), prec2);
arb_zero(acb_imagref(t));
acb_mul(t, t, z, prec2);
acb_div(u, u, t, prec2);
/* branch cut term: -1 or 1 */

View file

@ -251,7 +251,7 @@ Error functions and Fresnel integrals
\operatorname{erf}(z) &= \frac{z}{\sqrt{z^2}}
\left(1 - \frac{e^{-z^2}}{\sqrt{\pi}}
U(\tfrac{1}{2}, \tfrac{1}{2}, z^2)\right) =
\frac{z}{\sqrt{z^2}} - \frac{z e^{-z^2}}{\sqrt{\pi}}
\frac{z}{\sqrt{z^2}} - \frac{e^{-z^2}}{z \sqrt{\pi}}
U^{*}(\tfrac{1}{2}, \tfrac{1}{2}, z^2).
The *asymp* version takes a second precision to use for the *U* term.