Average Error: 0.2 → 0.4
Time: 22.4s
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 \le -1.004642425211476 \lor \neg \left(a \le 1.013453287205224\right):\\ \;\;\;\;(2 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) + \left({a}^{4} + {b}^{4}\right))_*\\ \mathbf{else}:\\ \;\;\;\;(\left(b \cdot b\right) \cdot \left((a \cdot \left(2 \cdot a\right) + 4)_*\right) + \left(-1 + {b}^{4}\right))_*\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Derivation

  1. Split input into 2 regimes
  2. if a < -1.004642425211476 or 1.013453287205224 < 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.9

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

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

    if -1.004642425211476 < a < 1.013453287205224

    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 add-cbrt-cube3.9

      \[\leadsto (\left((b \cdot b + \left(a \cdot a\right))_*\right) \cdot \color{blue}{\left(\sqrt[3]{\left((b \cdot b + \left(a \cdot a\right))_* \cdot (b \cdot b + \left(a \cdot a\right))_*\right) \cdot (b \cdot b + \left(a \cdot a\right))_*}\right)} + \left((\left(4 \cdot b\right) \cdot b + -1)_*\right))_*\]
    5. Taylor expanded around -inf 0.3

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

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

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

Runtime

Time bar (total: 22.4s)Debug logProfile

herbie shell --seed 2018248 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b))) 1))