Average Error: 61.8 → 0.3
Time: 10.1s
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)\]
\[3.9999999999999997 \cdot 10^{-32} \cdot \left(t \cdot t\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)
3.9999999999999997 \cdot 10^{-32} \cdot \left(t \cdot t\right)
double f(double t) {
        double r2132853 = 1.0;
        double r2132854 = t;
        double r2132855 = 2e-16;
        double r2132856 = r2132854 * r2132855;
        double r2132857 = r2132853 + r2132856;
        double r2132858 = r2132857 * r2132857;
        double r2132859 = -1.0;
        double r2132860 = 2.0;
        double r2132861 = r2132860 * r2132856;
        double r2132862 = r2132859 - r2132861;
        double r2132863 = r2132858 + r2132862;
        return r2132863;
}

double f(double t) {
        double r2132864 = 3.9999999999999997e-32;
        double r2132865 = t;
        double r2132866 = r2132865 * r2132865;
        double r2132867 = r2132864 * r2132866;
        return r2132867;
}

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
\[(\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. Simplified50.3

    \[\leadsto \color{blue}{(\left(2 \cdot 10^{-16} \cdot t\right) \cdot -2 + \left((\left(2 \cdot 10^{-16} \cdot t\right) \cdot \left(2 \cdot 10^{-16} \cdot t\right) + \left(2 \cdot 10^{-16} \cdot t\right))_*\right))_* + 2 \cdot 10^{-16} \cdot t}\]
  3. Taylor expanded around inf 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. Final simplification0.3

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

Reproduce

herbie shell --seed 2019104 +o rules:numerics
(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)))))