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

Refine Netwon iteration termination conditions for BigDecimal.sqrt

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 14
    • core-libs
    • None

      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.

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

              Created:
              Updated: