| 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 (* (+ t -1.0) 1.7e+308))
double code(double t) {
return (1.7e+308 * t) - 1.7e+308;
}
double code(double t) {
return (t + -1.0) * 1.7e+308;
}
real(8) function code(t)
real(8), intent (in) :: t
code = (1.7d+308 * t) - 1.7d+308
end function
real(8) function code(t)
real(8), intent (in) :: t
code = (t + (-1.0d0)) * 1.7d+308
end function
public static double code(double t) {
return (1.7e+308 * t) - 1.7e+308;
}
public static double code(double t) {
return (t + -1.0) * 1.7e+308;
}
def code(t): return (1.7e+308 * t) - 1.7e+308
def code(t): return (t + -1.0) * 1.7e+308
function code(t) return Float64(Float64(1.7e+308 * t) - 1.7e+308) end
function code(t) return Float64(Float64(t + -1.0) * 1.7e+308) end
function tmp = code(t) tmp = (1.7e+308 * t) - 1.7e+308; end
function tmp = code(t) tmp = (t + -1.0) * 1.7e+308; end
code[t_] := N[(N[(1.7e+308 * t), $MachinePrecision] - 1.7e+308), $MachinePrecision]
code[t_] := N[(N[(t + -1.0), $MachinePrecision] * 1.7e+308), $MachinePrecision]
1.7 \cdot 10^{+308} \cdot t - 1.7 \cdot 10^{+308}
\left(t + -1\right) \cdot 1.7 \cdot 10^{+308}
Results
| Original | 64.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 64.0
Applied egg-rr0.3
| Alternative 1 | |
|---|---|
| Error | 64.0 |
| Cost | 64 |
herbie shell --seed 2023010
(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))