Average Error: 0.2 → 0.0
Time: 1.2m
Precision: 64
Internal Precision: 128
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1\]
\[\left(b \cdot \left(b \cdot \left(1 - a \cdot 3\right)\right) + a \cdot \left(a \cdot a + a\right)\right) \cdot 4 - \left(1 - {\left(\sqrt{a \cdot a + b \cdot b}\right)}^{4}\right)\]

Error

Bits error versus a

Bits error versus b

Derivation

  1. Initial program 0.2

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

    \[\leadsto \color{blue}{\left(a \cdot \left(a \cdot a + a\right) + \left(b \cdot \left(1 - 3 \cdot a\right)\right) \cdot b\right) \cdot 4 - \left(1 - \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right)}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.2

    \[\leadsto \left(a \cdot \left(a \cdot a + a\right) + \left(b \cdot \left(1 - 3 \cdot a\right)\right) \cdot b\right) \cdot 4 - \left(1 - \left(a \cdot a + b \cdot b\right) \cdot \color{blue}{\left(\sqrt{a \cdot a + b \cdot b} \cdot \sqrt{a \cdot a + b \cdot b}\right)}\right)\]
  5. Applied associate-*r*0.1

    \[\leadsto \left(a \cdot \left(a \cdot a + a\right) + \left(b \cdot \left(1 - 3 \cdot a\right)\right) \cdot b\right) \cdot 4 - \left(1 - \color{blue}{\left(\left(a \cdot a + b \cdot b\right) \cdot \sqrt{a \cdot a + b \cdot b}\right) \cdot \sqrt{a \cdot a + b \cdot b}}\right)\]
  6. Using strategy rm
  7. Applied pow10.1

    \[\leadsto \left(a \cdot \left(a \cdot a + a\right) + \left(b \cdot \left(1 - 3 \cdot a\right)\right) \cdot b\right) \cdot 4 - \left(1 - \left(\left(a \cdot a + b \cdot b\right) \cdot \sqrt{a \cdot a + b \cdot b}\right) \cdot \color{blue}{{\left(\sqrt{a \cdot a + b \cdot b}\right)}^{1}}\right)\]
  8. Applied add-sqr-sqrt0.1

    \[\leadsto \left(a \cdot \left(a \cdot a + a\right) + \left(b \cdot \left(1 - 3 \cdot a\right)\right) \cdot b\right) \cdot 4 - \left(1 - \left(\color{blue}{\left(\sqrt{a \cdot a + b \cdot b} \cdot \sqrt{a \cdot a + b \cdot b}\right)} \cdot \sqrt{a \cdot a + b \cdot b}\right) \cdot {\left(\sqrt{a \cdot a + b \cdot b}\right)}^{1}\right)\]
  9. Applied pow30.1

    \[\leadsto \left(a \cdot \left(a \cdot a + a\right) + \left(b \cdot \left(1 - 3 \cdot a\right)\right) \cdot b\right) \cdot 4 - \left(1 - \color{blue}{{\left(\sqrt{a \cdot a + b \cdot b}\right)}^{3}} \cdot {\left(\sqrt{a \cdot a + b \cdot b}\right)}^{1}\right)\]
  10. Applied pow-prod-up0.0

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

    \[\leadsto \left(a \cdot \left(a \cdot a + a\right) + \left(b \cdot \left(1 - 3 \cdot a\right)\right) \cdot b\right) \cdot 4 - \left(1 - {\left(\sqrt{a \cdot a + b \cdot b}\right)}^{\color{blue}{4}}\right)\]
  12. Final simplification0.0

    \[\leadsto \left(b \cdot \left(b \cdot \left(1 - a \cdot 3\right)\right) + a \cdot \left(a \cdot a + a\right)\right) \cdot 4 - \left(1 - {\left(\sqrt{a \cdot a + b \cdot b}\right)}^{4}\right)\]

Reproduce

herbie shell --seed 2019091 
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (25)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))) 1))