Description
The InverseErfc function computes the inverse complementary error function using the identity with the inverse error function:
inverse erfc(x) = inverse erf(1-x)
This suffers from loss of precision when x -> 0. The minimum supported value is 2^-53. Accuracy reduces as this value is approached. Beyond it the function returns infinity.
A dedicated implementation does not require use of 1 - x and can compute to the minimum supported 64-bit value. Example output from the matlab erfcinv function:
erfcinv(2^-53) = 5.863584748755168 erfcinv(5e-324) = 27.216482834230213
The Boost C++ library has an implementation for the inverse erf accurate to double min value. The license is compatible with the Apache license. I suggest an internal implementation of the Boost method to update the function to support the full range of the argument x.
See:
Boost error function inverses:
https://www.boost.org/doc/libs/1_77_0/libs/math/doc/html/math_toolkit/sf_erf/error_inv.html
Attachments
Issue Links
- fixes
-
STATISTICS-37 Better inverse Erfc function for the Normal distribution
- Closed
- relates to
-
NUMBERS-172 Update the Erf function to use the Boost rational function approximtion
- Closed
-
NUMBERS-174 Update Gamma functions using the Boost implementation
- Closed