Average Error: 61.8 → 0.4
Time: 2.3s
Precision: binary64
\[0.9 \leq t \land t \leq 1.1\]
\[\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)\]
\[\left(t \cdot \left(t \cdot {\left(\sqrt{3.9999999999999997 \cdot 10^{-32}}\right)}^{1.5}\right)\right) \cdot \sqrt{\sqrt{3.9999999999999997 \cdot 10^{-32}}}\]
\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)
\left(t \cdot \left(t \cdot {\left(\sqrt{3.9999999999999997 \cdot 10^{-32}}\right)}^{1.5}\right)\right) \cdot \sqrt{\sqrt{3.9999999999999997 \cdot 10^{-32}}}
double code(double t) {
	return ((double) (((double) (((double) (1.0 + ((double) (t * 2e-16)))) * ((double) (1.0 + ((double) (t * 2e-16)))))) + ((double) (-1.0 - ((double) (2.0 * ((double) (t * 2e-16))))))));
}
double code(double t) {
	return ((double) (((double) (t * ((double) (t * ((double) pow(((double) sqrt(3.9999999999999997e-32)), 1.5)))))) * ((double) sqrt(((double) sqrt(3.9999999999999997e-32))))));
}

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original61.8
Target50.5
Herbie0.4
\[\mathsf{fma}\left(1 + t \cdot 2 \cdot 10^{-16}, 1 + t \cdot 2 \cdot 10^{-16}, -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. Taylor expanded around 0 0.4

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

    \[\leadsto \color{blue}{t \cdot \left(t \cdot 3.9999999999999997 \cdot 10^{-32}\right)}\]
  4. Using strategy rm
  5. Applied associate-*r*0.4

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\left(t \cdot \left(t \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right)\right) \cdot \sqrt{\sqrt{3.9999999999999997 \cdot 10^{-32}}}\right) \cdot \sqrt{\sqrt{3.9999999999999997 \cdot 10^{-32}}}}\]
  14. Simplified0.4

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

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

Reproduce

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

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

  (+ (* (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16))) (- -1.0 (* 2.0 (* t 2e-16)))))