| Alternative 1 | |
|---|---|
| Error | 64.0 |
| Cost | 64 |
\[-1.7 \cdot 10^{+308}
\]
(FPCore (t) :precision binary64 (- (* 1.7e+308 t) 1.7e+308))
(FPCore (t) :precision binary64 (fma 1.7e+308 t -1.7e+308))
double code(double t) {
return (1.7e+308 * t) - 1.7e+308;
}
double code(double t) {
return fma(1.7e+308, t, -1.7e+308);
}
function code(t) return Float64(Float64(1.7e+308 * t) - 1.7e+308) end
function code(t) return fma(1.7e+308, t, -1.7e+308) end
code[t_] := N[(N[(1.7e+308 * t), $MachinePrecision] - 1.7e+308), $MachinePrecision]
code[t_] := N[(1.7e+308 * t + -1.7e+308), $MachinePrecision]
1.7 \cdot 10^{+308} \cdot t - 1.7 \cdot 10^{+308}
\mathsf{fma}\left(1.7 \cdot 10^{+308}, t, -1.7 \cdot 10^{+308}\right)
| Original | 64.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 64.0
Simplified0.3
[Start]64.0 | \[ 1.7 \cdot 10^{+308} \cdot t - 1.7 \cdot 10^{+308}
\] |
|---|---|
fma-neg [=>]0.3 | \[ \color{blue}{\mathsf{fma}\left(1.7 \cdot 10^{+308}, t, -1.7 \cdot 10^{+308}\right)}
\] |
metadata-eval [=>]0.3 | \[ \mathsf{fma}\left(1.7 \cdot 10^{+308}, t, \color{blue}{-1.7 \cdot 10^{+308}}\right)
\] |
Final simplification0.3
| Alternative 1 | |
|---|---|
| Error | 64.0 |
| Cost | 64 |
herbie shell --seed 2023046
(FPCore (t)
:name "fma_test2"
:precision binary64
:pre (and (<= 1.9 t) (<= t 2.1))
:herbie-target
(fma 1.7e+308 t (- 1.7e+308))
(- (* 1.7e+308 t) 1.7e+308))