Average Error: 61.8 → 0.3
Time: 2.3s
Precision: 64
\[0.900000000000000022 \le t \le 1.1000000000000001\]
\[\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 {t}^{2}\]
\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 {t}^{2}
double f(double t) {
        double r65537 = 1.0;
        double r65538 = t;
        double r65539 = 2e-16;
        double r65540 = r65538 * r65539;
        double r65541 = r65537 + r65540;
        double r65542 = r65541 * r65541;
        double r65543 = -1.0;
        double r65544 = 2.0;
        double r65545 = r65544 * r65540;
        double r65546 = r65543 - r65545;
        double r65547 = r65542 + r65546;
        return r65547;
}

double f(double t) {
        double r65548 = 3.9999999999999997e-32;
        double r65549 = t;
        double r65550 = 2.0;
        double r65551 = pow(r65549, r65550);
        double r65552 = r65548 * r65551;
        return r65552;
}

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)\]

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

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

    \[\leadsto 3.9999999999999997 \cdot 10^{-32} \cdot {t}^{2}\]

Reproduce

herbie shell --seed 2020003 
(FPCore (t)
  :name "fma_test1"
  :precision binary64
  :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)))))