Average Error: 0.2 → 1.0
Time: 17.6s
Precision: 64
Internal Precision: 576
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\begin{array}{l} \mathbf{if}\;a \cdot a \le 2141226.142085088:\\ \;\;\;\;(e^{\log_* (1 + (\left((b \cdot b + \left(a \cdot a\right))_*\right) \cdot \left((b \cdot b + \left(a \cdot a\right))_*\right) + \left((\left(4 \cdot b\right) \cdot b + -1)_*\right))_*)} - 1)^*\\ \mathbf{else}:\\ \;\;\;\;(2 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) + \left({b}^{4} + {a}^{4}\right))_*\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Derivation

  1. Split input into 2 regimes
  2. if (* a a) < 2141226.142085088

    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. Initial simplification0.1

      \[\leadsto (\left((b \cdot b + \left(a \cdot a\right))_*\right) \cdot \left((b \cdot b + \left(a \cdot a\right))_*\right) + \left((\left(4 \cdot b\right) \cdot b + -1)_*\right))_*\]
    3. Using strategy rm
    4. Applied expm1-log1p-u1.2

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

    if 2141226.142085088 < (* a a)

    1. Initial program 0.5

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
    2. Initial simplification0.5

      \[\leadsto (\left((b \cdot b + \left(a \cdot a\right))_*\right) \cdot \left((b \cdot b + \left(a \cdot a\right))_*\right) + \left((\left(4 \cdot b\right) \cdot b + -1)_*\right))_*\]
    3. Taylor expanded around inf 0.1

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

      \[\leadsto \color{blue}{(2 \cdot \left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right) + \left({a}^{4} + {b}^{4}\right))_*}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot a \le 2141226.142085088:\\ \;\;\;\;(e^{\log_* (1 + (\left((b \cdot b + \left(a \cdot a\right))_*\right) \cdot \left((b \cdot b + \left(a \cdot a\right))_*\right) + \left((\left(4 \cdot b\right) \cdot b + -1)_*\right))_*)} - 1)^*\\ \mathbf{else}:\\ \;\;\;\;(2 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) + \left({b}^{4} + {a}^{4}\right))_*\\ \end{array}\]

Runtime

Time bar (total: 17.6s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes2.11.00.02.155.5%
herbie shell --seed 2018263 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b))) 1))