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

AArch64: Math.cos intrinsic gives incorrect results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 12
    • 12
    • hotspot
    • b12
    • aarch64
    • Verified

      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.

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

              Created:
              Updated:
              Resolved: