?

Average Error: 64.0 → 0.5
Time: 4.8s
Precision: binary64
Cost: 576

?

\[1.9 \leq t \land t \leq 2.1\]
\[1.7 \cdot 10^{+308} \cdot t - 1.7 \cdot 10^{+308} \]
\[\left(-1.7 \cdot 10^{+308} + t \cdot 8.5 \cdot 10^{+307}\right) + t \cdot 8.5 \cdot 10^{+307} \]
(FPCore (t) :precision binary64 (- (* 1.7e+308 t) 1.7e+308))
(FPCore (t)
 :precision binary64
 (+ (+ -1.7e+308 (* t 8.5e+307)) (* t 8.5e+307)))
double code(double t) {
	return (1.7e+308 * t) - 1.7e+308;
}
double code(double t) {
	return (-1.7e+308 + (t * 8.5e+307)) + (t * 8.5e+307);
}
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 = ((-1.7d+308) + (t * 8.5d+307)) + (t * 8.5d+307)
end function
public static double code(double t) {
	return (1.7e+308 * t) - 1.7e+308;
}
public static double code(double t) {
	return (-1.7e+308 + (t * 8.5e+307)) + (t * 8.5e+307);
}
def code(t):
	return (1.7e+308 * t) - 1.7e+308
def code(t):
	return (-1.7e+308 + (t * 8.5e+307)) + (t * 8.5e+307)
function code(t)
	return Float64(Float64(1.7e+308 * t) - 1.7e+308)
end
function code(t)
	return Float64(Float64(-1.7e+308 + Float64(t * 8.5e+307)) + Float64(t * 8.5e+307))
end
function tmp = code(t)
	tmp = (1.7e+308 * t) - 1.7e+308;
end
function tmp = code(t)
	tmp = (-1.7e+308 + (t * 8.5e+307)) + (t * 8.5e+307);
end
code[t_] := N[(N[(1.7e+308 * t), $MachinePrecision] - 1.7e+308), $MachinePrecision]
code[t_] := N[(N[(-1.7e+308 + N[(t * 8.5e+307), $MachinePrecision]), $MachinePrecision] + N[(t * 8.5e+307), $MachinePrecision]), $MachinePrecision]
1.7 \cdot 10^{+308} \cdot t - 1.7 \cdot 10^{+308}
\left(-1.7 \cdot 10^{+308} + t \cdot 8.5 \cdot 10^{+307}\right) + t \cdot 8.5 \cdot 10^{+307}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation?

  1. Initial program 64.0

    \[1.7 \cdot 10^{+308} \cdot t - 1.7 \cdot 10^{+308} \]
  2. Applied egg-rr0.5

    \[\leadsto \color{blue}{\left(-1.7 \cdot 10^{+308} + t \cdot 8.5 \cdot 10^{+307}\right) + t \cdot 8.5 \cdot 10^{+307}} \]
  3. Final simplification0.5

    \[\leadsto \left(-1.7 \cdot 10^{+308} + t \cdot 8.5 \cdot 10^{+307}\right) + t \cdot 8.5 \cdot 10^{+307} \]

Alternatives

Alternative 1
Error47.0
Cost192
\[8.5 \cdot 10^{+307} \cdot t \]
Alternative 2
Error64.0
Cost64
\[-1.7 \cdot 10^{+308} \]

Error

Reproduce?

herbie shell --seed 2023075 
(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))