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

FastMath acos fails when input abs value is less than about 5.7851920321187236E-300 - returns NaN

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2, 3.0
    • Fix Version/s: 2.2, 3.0
    • Labels:
      None

      Description

      FastMath acos fails when input absolute value is less than about 5.7851920321187236E-300

      It returns NaN instead of an expected value close to PI/2.0

      This appears to be due to the following code:

      // Compute ratio r = y/x
      double r = y/x;
      temp = r * 1073741824.0;
      

      r and temp can become infinite or Nan.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: