Average Error: 61.8 → 0.3
Time: 14.1s
Precision: 64
\[\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)\]
\[\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(\left(t \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right)\]

Error

Bits error versus t

Target

Original61.8
Target50.6
Herbie0.3
\[(\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right))_*\]

Derivation

  1. Initial program 61.8

    \[\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)\]
  2. Simplified0.4

    \[\leadsto \color{blue}{\left(2 \cdot 10^{-16} \cdot t\right) \cdot \left(2 \cdot 10^{-16} \cdot t\right)}\]
  3. Taylor expanded around 0 0.3

    \[\leadsto \color{blue}{3.9999999999999997 \cdot 10^{-32} \cdot {t}^{2}}\]
  4. Simplified0.3

    \[\leadsto \color{blue}{\left(t \cdot t\right) \cdot 3.9999999999999997 \cdot 10^{-32}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.3

    \[\leadsto \left(t \cdot t\right) \cdot \color{blue}{\left(\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right)}\]
  7. Applied associate-*r*0.3

    \[\leadsto \color{blue}{\left(\left(t \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}}\]
  8. Using strategy rm
  9. Applied *-commutative0.3

    \[\leadsto \color{blue}{\left(\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(t \cdot t\right)\right)} \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\]
  10. Final simplification0.3

    \[\leadsto \sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(\left(t \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right)\]

Reproduce

herbie shell --seed 2019100 
(FPCore (t)
  :name "fma_test1"
  :pre (<= 0.9 t 1.1)

  :herbie-target
  (fma (+ 1 (* t 2e-16)) (+ 1 (* t 2e-16)) (- -1 (* 2 (* t 2e-16))))

  (+ (* (+ 1 (* t 2e-16)) (+ 1 (* t 2e-16))) (- -1 (* 2 (* t 2e-16)))))