Alex Herbert created NUMBERS-177:
------------------------------------

             Summary: Scaled complementary error function
                 Key: NUMBERS-177
                 URL: https://issues.apache.org/jira/browse/NUMBERS-177
             Project: Commons Numbers
          Issue Type: New Feature
          Components: gamma
    Affects Versions: 1.1
            Reporter: Alex Herbert
             Fix For: 1.1


Add a scaled complementary error function:
{noformat}
erfcx(x) = exp(x^2) * erfc(x)
{noformat}
For small x this can use the current rational function approximations for erf 
or erfc and remove the scaling down by exp(-x^2). For large x this can use the 
[continued fraction expansion of 
erfc|https://en.wikipedia.org/wiki/Error_function#Continued_fraction_expansion] 
and remove the scaling by e^-z:
{noformat}
             z                    1
erfc z = -------- e^-z^2 -----------------------------
         sqrt(pi)        z^2 +           1/2
                               -----------------------
                               1 +         1
                                   -------------------
                                   z^2 +      3/2
                                         -------------
                                         1 +     2
                                             ---------
                                             z^2 + ...
{noformat}
At very large x the rational function cannot be evaluated as {{z^2 + 0.5 ~ 
z^2}} and the following approximation can be used:
{noformat}
              1      1
erfcx z = -------- * -
          sqrt(pi)   z
{noformat}
This occurs at 2^26 or approximately 6.71e7.




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to