Average Error: 0.2 → 0.2
Time: 4.0s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\begin{array}{l} \mathbf{if}\;b \cdot b \le 1.02084883596813497 \cdot 10^{-26}:\\ \;\;\;\;\left({a}^{4} + 4 \cdot {b}^{2}\right) - 1\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{\left(-{b}^{3}\right) \cdot b + {a}^{4}}{a \cdot a - b \cdot b}\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Derivation

  1. Split input into 2 regimes
  2. if (* b b) < 1.020848835968135e-26

    1. Initial program 0.1

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
    2. Taylor expanded around 0 0.0

      \[\leadsto \color{blue}{\left({a}^{4} + 4 \cdot {b}^{2}\right) - 1}\]

    if 1.020848835968135e-26 < (* b b)

    1. Initial program 0.4

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
    2. Using strategy rm
    3. Applied flip-+0.5

      \[\leadsto \left({\color{blue}{\left(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) - \left(b \cdot b\right) \cdot \left(b \cdot b\right)}{a \cdot a - b \cdot b}\right)}}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
    4. Simplified0.7

      \[\leadsto \left({\left(\frac{\color{blue}{\left(-{b}^{3}\right) \cdot b + {a}^{4}}}{a \cdot a - b \cdot b}\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot b \le 1.02084883596813497 \cdot 10^{-26}:\\ \;\;\;\;\left({a}^{4} + 4 \cdot {b}^{2}\right) - 1\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{\left(-{b}^{3}\right) \cdot b + {a}^{4}}{a \cdot a - b \cdot b}\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\\ \end{array}\]

Reproduce

herbie shell --seed 2020126 
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  :precision binary64
  (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0))