Uploaded image for project: 'Commons Numbers'
  1. Commons Numbers
  2. NUMBERS-171

Update the InverseErfc function to support the full range of x in [0, 2]

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Implemented
    • 1.0
    • 1.1
    • gamma
    • None

    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

      STATISTICS-37

      Attachments

        Issue Links

          Activity

            People

              aherbert Alex Herbert
              aherbert Alex Herbert
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h