Average Error: 64.0 → 0
Time: 543.0ms
Precision: 64
\[1.8999999999999999 \le t \le 2.10000000000000009\]
\[1.6999999999999999 \cdot 10^{308} \cdot t - 1.6999999999999999 \cdot 10^{308}\]
\[\mathsf{fma}\left(1.6999999999999999 \cdot 10^{308}, t, -1.6999999999999999 \cdot 10^{308}\right)\]
1.6999999999999999 \cdot 10^{308} \cdot t - 1.6999999999999999 \cdot 10^{308}
\mathsf{fma}\left(1.6999999999999999 \cdot 10^{308}, t, -1.6999999999999999 \cdot 10^{308}\right)
double f(double t) {
        double r66178 = 1.7e+308;
        double r66179 = t;
        double r66180 = r66178 * r66179;
        double r66181 = r66180 - r66178;
        return r66181;
}

double f(double t) {
        double r66182 = 1.7e+308;
        double r66183 = t;
        double r66184 = -r66182;
        double r66185 = fma(r66182, r66183, r66184);
        return r66185;
}

Error

Bits error versus t

Target

Original64.0
Target0
Herbie0
\[\mathsf{fma}\left(1.6999999999999999 \cdot 10^{308}, t, -1.6999999999999999 \cdot 10^{308}\right)\]

Derivation

  1. Initial program 64.0

    \[1.6999999999999999 \cdot 10^{308} \cdot t - 1.6999999999999999 \cdot 10^{308}\]
  2. Using strategy rm
  3. Applied fma-neg0

    \[\leadsto \color{blue}{\mathsf{fma}\left(1.6999999999999999 \cdot 10^{308}, t, -1.6999999999999999 \cdot 10^{308}\right)}\]
  4. Final simplification0

    \[\leadsto \mathsf{fma}\left(1.6999999999999999 \cdot 10^{308}, t, -1.6999999999999999 \cdot 10^{308}\right)\]

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (t)
  :name "fma_test2"
  :precision binary64
  :pre (<= 1.9 t 2.1)

  :herbie-target
  (fma 1.7e+308 t (- 1.7e+308))

  (- (* 1.7e+308 t) 1.7e+308))