Average Error: 61.8 → 0.3
Time: 11.9s
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)\]
\[\left(2 \cdot 10^{-16} \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right) \cdot t\]
\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(2 \cdot 10^{-16} \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right) \cdot t
double f(double t) {
        double r11161069 = 1.0;
        double r11161070 = t;
        double r11161071 = 2e-16;
        double r11161072 = r11161070 * r11161071;
        double r11161073 = r11161069 + r11161072;
        double r11161074 = r11161073 * r11161073;
        double r11161075 = -1.0;
        double r11161076 = 2.0;
        double r11161077 = r11161076 * r11161072;
        double r11161078 = r11161075 - r11161077;
        double r11161079 = r11161074 + r11161078;
        return r11161079;
}

double f(double t) {
        double r11161080 = 2e-16;
        double r11161081 = t;
        double r11161082 = r11161080 * r11161081;
        double r11161083 = r11161080 * r11161082;
        double r11161084 = r11161083 * r11161081;
        return r11161084;
}

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. 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-*r*0.3

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

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

Reproduce

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