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

Scaled complementary error function

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • 1.1
    • 1.1
    • gamma
    • None

    Description

      Add a scaled complementary error function:

      erfcx(x) = exp(x^2) * erfc(x)
      

      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 and remove the scaling by e^-z:

                   z                    1
      erfc z = -------- e^-z^2 -----------------------------
               sqrt(pi)        z^2 +           1/2
                                     -----------------------
                                     1 +         1
                                         -------------------
                                         z^2 +      3/2
                                               -------------
                                               1 +     2
                                                   ---------
                                                   z^2 + ...
      

      At very large x the rational function cannot be evaluated as z^2 + 0.5 ~ z^2 and the following approximation can be used:

                    1      1
      erfcx z = -------- * -
                sqrt(pi)   z
      

      This occurs at 2^26 or approximately 6.71e7.

      Attachments

        1. erfc.png
          169 kB
          Alex Herbert
        2. erfcx.large.png
          123 kB
          Alex Herbert
        3. erfcx.medium.png
          87 kB
          Alex Herbert
        4. erfcx.small.png
          32 kB
          Alex Herbert
        5. expn.png
          60 kB
          Alex Herbert

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: