Average Error: 61.8 → 0.3
Time: 3.2s
Precision: binary64
Cost: 448
\[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)\]
\[2 \cdot 10^{-16} \cdot \left(t \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right)\]
\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 \cdot 10^{-16} \cdot \left(t \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right)
(FPCore (t)
 :precision binary64
 (+ (* (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16))) (- -1.0 (* 2.0 (* t 2e-16)))))
(FPCore (t) :precision binary64 (* 2e-16 (* t (* 2e-16 t))))
double code(double t) {
	return ((1.0 + (t * 2e-16)) * (1.0 + (t * 2e-16))) + (-1.0 - (2.0 * (t * 2e-16)));
}
double code(double t) {
	return 2e-16 * (t * (2e-16 * t));
}

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original61.8
Target50.6
Herbie0.3
\[\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)\]

Alternatives

Alternative 1
Error2.0
Cost20032
\[t \cdot \left(\sqrt[3]{t \cdot 3.9999999999999997 \cdot 10^{-32}} \cdot \left(\sqrt[3]{t \cdot 3.9999999999999997 \cdot 10^{-32}} \cdot \sqrt[3]{t \cdot 3.9999999999999997 \cdot 10^{-32}}\right)\right)\]
Alternative 2
Error1.3
Cost19776
\[\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \left(t \cdot \left(3.9999999999999997 \cdot 10^{-32} \cdot \sqrt[3]{t}\right)\right)\]
Alternative 3
Error1.3
Cost19776
\[t \cdot \left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \left(3.9999999999999997 \cdot 10^{-32} \cdot \sqrt[3]{t}\right)\right)\]
Alternative 4
Error0.6
Cost13632
\[2 \cdot 10^{-16} \cdot \left(\sqrt{t \cdot \left(t \cdot 2 \cdot 10^{-16}\right)} \cdot \sqrt{t \cdot \left(t \cdot 2 \cdot 10^{-16}\right)}\right)\]
Alternative 5
Error0.6
Cost13504
\[\sqrt{t \cdot \left(t \cdot 3.9999999999999997 \cdot 10^{-32}\right)} \cdot \sqrt{t \cdot \left(t \cdot 3.9999999999999997 \cdot 10^{-32}\right)}\]
Alternative 6
Error0.7
Cost13376
\[t \cdot \left(\left(\sqrt{t} \cdot 2 \cdot 10^{-16}\right) \cdot \left(\sqrt{t} \cdot 2 \cdot 10^{-16}\right)\right)\]
Alternative 7
Error0.6
Cost13376
\[t \cdot \left(\sqrt{t \cdot 3.9999999999999997 \cdot 10^{-32}} \cdot \sqrt{t \cdot 3.9999999999999997 \cdot 10^{-32}}\right)\]
Alternative 8
Error0.4
Cost13376
\[t \cdot \left(\sqrt{2 \cdot 10^{-16}} \cdot \left(\left(t \cdot 2 \cdot 10^{-16}\right) \cdot \sqrt{2 \cdot 10^{-16}}\right)\right)\]
Alternative 9
Error0.5
Cost13312
\[2 \cdot 10^{-16} \cdot \left(\sqrt{t} \cdot \left({t}^{1.5} \cdot 2 \cdot 10^{-16}\right)\right)\]
Alternative 10
Error0.6
Cost13248
\[t \cdot \left(\sqrt{t} \cdot \left(\sqrt{t} \cdot 3.9999999999999997 \cdot 10^{-32}\right)\right)\]
Alternative 11
Error0.5
Cost13184
\[\sqrt{t} \cdot \left(3.9999999999999997 \cdot 10^{-32} \cdot {t}^{1.5}\right)\]
Alternative 12
Error0.7
Cost13184
\[t \cdot \sqrt[3]{{\left(t \cdot 3.9999999999999997 \cdot 10^{-32}\right)}^{3}}\]
Alternative 13
Error0.6
Cost13184
\[2 \cdot 10^{-16} \cdot \sqrt[3]{{t}^{6} \cdot 8 \cdot 10^{-48}}\]
Alternative 14
Error4.3
Cost13120
\[t \cdot e^{\log \left(t \cdot 3.9999999999999997 \cdot 10^{-32}\right)}\]
Alternative 15
Error0.6
Cost13056
\[\sqrt[3]{6.4 \cdot 10^{-95} \cdot {t}^{6}}\]
Alternative 16
Error0.7
Cost13056
\[\sqrt[3]{{\left(t \cdot 2 \cdot 10^{-16}\right)}^{6}}\]
Alternative 17
Error61.8
Cost1216
\[\left(t \cdot 2 \cdot 10^{-16} + 1\right) \cdot \left(t \cdot 2 \cdot 10^{-16} + 1\right) + \left(-1 - \left(t \cdot 2 \cdot 10^{-16}\right) \cdot 2\right)\]
Alternative 18
Error0.3
Cost448
\[t \cdot \left(2 \cdot 10^{-16} \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)\]
Alternative 19
Error0.5
Cost448
\[\left(t \cdot 2 \cdot 10^{-16}\right) \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\]
Alternative 20
Error0.4
Cost448
\[2 \cdot 10^{-16} \cdot \left(2 \cdot 10^{-16} \cdot \left(t \cdot t\right)\right)\]
Alternative 21
Error0.3
Cost448
\[2 \cdot 10^{-16} \cdot \left(t \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)\]
Alternative 22
Error0.3
Cost320
\[t \cdot \left(t \cdot 3.9999999999999997 \cdot 10^{-32}\right)\]
Alternative 23
Error0.3
Cost320
\[3.9999999999999997 \cdot 10^{-32} \cdot \left(t \cdot t\right)\]
Alternative 24
Error58.7
Cost64
\[1\]
Alternative 25
Error61.8
Cost64
\[0\]
Alternative 26
Error62.9
Cost64
\[-1\]

Error

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.3

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

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

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

    \[\leadsto t \cdot \left(\color{blue}{\left(t \cdot 2 \cdot 10^{-16}\right)} \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right)\]
  7. Using strategy rm
  8. Applied associate-*r*_binary64_26750.3

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

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

    \[\leadsto 2 \cdot 10^{-16} \cdot \left(t \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right)\]

Reproduce

herbie shell --seed 2021042 
(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)))))