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

Refine Netwon iteration termination conditions for BigDecimal.sqrt

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 14
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:
      None

      Description

      As discussed during the code review of JDK-8233452, it should be possible to refine the loop termination conditions of the Newton iteration used to implement BigDecimal.sqrt. In particular, for the directed rounding conditions, it should be possible to knowingly keep the approximate solution on one side of the root or the other, avoiding the need for a fix-up check at the end. G. W. Stewart's "Afternotes on Numerical Analysis" has a discussion on the convergence of the square root iteration. Different alterations might be possible for the round-to-nearest cases to avoid doing a full 2p+2 precision calculation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              darcy Joe Darcy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: