Average Error: 61.8 → 0.4
Time: 27.4s
Precision: 64
\[0.9 \le t \le 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)\]
\[\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(\left(t \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\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)
\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(\left(t \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right)
double f(double t) {
        double r2135624 = 1.0;
        double r2135625 = t;
        double r2135626 = 2e-16;
        double r2135627 = r2135625 * r2135626;
        double r2135628 = r2135624 + r2135627;
        double r2135629 = r2135628 * r2135628;
        double r2135630 = -1.0;
        double r2135631 = 2.0;
        double r2135632 = r2135631 * r2135627;
        double r2135633 = r2135630 - r2135632;
        double r2135634 = r2135629 + r2135633;
        return r2135634;
}

double f(double t) {
        double r2135635 = 3.9999999999999997e-32;
        double r2135636 = sqrt(r2135635);
        double r2135637 = t;
        double r2135638 = r2135637 * r2135637;
        double r2135639 = r2135638 * r2135636;
        double r2135640 = r2135636 * r2135639;
        return r2135640;
}

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.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. Simplified0.4

    \[\leadsto \color{blue}{\left(2 \cdot 10^{-16} \cdot t\right) \cdot \left(2 \cdot 10^{-16} \cdot t\right)}\]
  3. Using strategy rm
  4. Applied associate-*l*0.3

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

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

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

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

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

    \[\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 2019135 
(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)))))