Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8210461

AArch64: Math.cos intrinsic gives incorrect results

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b12
    • CPU:
      aarch64
    • Verification:
      Verified

      Description

      Range reduction for trig functions on AArch64 is broken. The smallest case is

      Math.cos(1647100)
      which should return 0.7833030468809974 but returns -0.2745634094819721.

      The problem is that __kernel_rem_pio2 is supposed to reduce its argument to the range [-pi/4, pi/4], pi/4 ~ 0.785398164 but it does not: it returns 1.8489319595787654, which is outside the range of the polynomial cosine approximation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dpochepk Dmitrij Pochepko
              Reporter:
              aph Andrew Haley
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: