Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1283

Gamma function computation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0, 3.5
    • 4.0, 3.6
    • None
    • None
    • All

    Description

      In the gamma method, when handling the case "absX > 20", the computation of gammaAbs should replace "x" (see code below with x in bold) by "absX".
      For large negative values of x, the function returns with the wrong sign.

      final double gammaAbs = SQRT_TWO_PI / x *
      FastMath.pow(y, absX + 0.5) *
      FastMath.exp(-y) * lanczos(absX);

      Attachments

        Activity

          People

            Unassigned Unassigned
            jnd77 Jean Noel Delavalade
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: