Average Error: 64.0 → 0
Time: 1.1s
Precision: binary64
\[1.8999999999999999 \le t \le 2.10000000000000009\]
\[1.6999999999999999 \cdot 10^{308} \cdot t - 1.6999999999999999 \cdot 10^{308}\]
\[1.6999999999999999 \cdot 10^{308} \cdot \left(t + -1\right)\]
1.6999999999999999 \cdot 10^{308} \cdot t - 1.6999999999999999 \cdot 10^{308}
1.6999999999999999 \cdot 10^{308} \cdot \left(t + -1\right)
double code(double t) {
	return ((double) (((double) (1.7e+308 * t)) - 1.7e+308));
}
double code(double t) {
	return ((double) (1.7e+308 * ((double) (t + -1.0))));
}

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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 flip--51.4

    \[\leadsto \color{blue}{\frac{\left(1.6999999999999999 \cdot 10^{308} \cdot t\right) \cdot \left(1.6999999999999999 \cdot 10^{308} \cdot t\right) - 1.6999999999999999 \cdot 10^{308} \cdot 1.6999999999999999 \cdot 10^{308}}{1.6999999999999999 \cdot 10^{308} \cdot t + 1.6999999999999999 \cdot 10^{308}}}\]
  4. Simplified51.4

    \[\leadsto \frac{\color{blue}{1.6999999999999999 \cdot 10^{308} \cdot \left(1.6999999999999999 \cdot 10^{308} \cdot \left(t \cdot t\right) - 1.6999999999999999 \cdot 10^{308}\right)}}{1.6999999999999999 \cdot 10^{308} \cdot t + 1.6999999999999999 \cdot 10^{308}}\]
  5. Simplified51.4

    \[\leadsto \frac{1.6999999999999999 \cdot 10^{308} \cdot \left(1.6999999999999999 \cdot 10^{308} \cdot \left(t \cdot t\right) - 1.6999999999999999 \cdot 10^{308}\right)}{\color{blue}{1.6999999999999999 \cdot 10^{308} + 1.6999999999999999 \cdot 10^{308} \cdot t}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity51.4

    \[\leadsto \frac{1.6999999999999999 \cdot 10^{308} \cdot \left(1.6999999999999999 \cdot 10^{308} \cdot \left(t \cdot t\right) - 1.6999999999999999 \cdot 10^{308}\right)}{\color{blue}{1 \cdot \left(1.6999999999999999 \cdot 10^{308} + 1.6999999999999999 \cdot 10^{308} \cdot t\right)}}\]
  8. Applied times-frac51.4

    \[\leadsto \color{blue}{\frac{1.6999999999999999 \cdot 10^{308}}{1} \cdot \frac{1.6999999999999999 \cdot 10^{308} \cdot \left(t \cdot t\right) - 1.6999999999999999 \cdot 10^{308}}{1.6999999999999999 \cdot 10^{308} + 1.6999999999999999 \cdot 10^{308} \cdot t}}\]
  9. Simplified51.4

    \[\leadsto \color{blue}{1.6999999999999999 \cdot 10^{308}} \cdot \frac{1.6999999999999999 \cdot 10^{308} \cdot \left(t \cdot t\right) - 1.6999999999999999 \cdot 10^{308}}{1.6999999999999999 \cdot 10^{308} + 1.6999999999999999 \cdot 10^{308} \cdot t}\]
  10. Simplified0.5

    \[\leadsto 1.6999999999999999 \cdot 10^{308} \cdot \color{blue}{\left(\frac{1}{t + 1} \cdot \left(t \cdot t + -1\right)\right)}\]
  11. Taylor expanded around 0 0

    \[\leadsto 1.6999999999999999 \cdot 10^{308} \cdot \color{blue}{\left(t - 1\right)}\]
  12. Simplified0

    \[\leadsto 1.6999999999999999 \cdot 10^{308} \cdot \color{blue}{\left(t + -1\right)}\]
  13. Final simplification0

    \[\leadsto 1.6999999999999999 \cdot 10^{308} \cdot \left(t + -1\right)\]

Reproduce

herbie shell --seed 2020184 
(FPCore (t)
  :name "fma_test2"
  :precision binary64
  :pre (<= 1.9 t 2.1)

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

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