Average Error: 0.0 → 0.0
Time: 2.5s
Precision: binary64
Cost: 6720
\[500 \cdot \left(x - y\right) \]
\[\mathsf{fma}\left(x, 500, -500 \cdot y\right) \]
(FPCore (x y) :precision binary64 (* 500.0 (- x y)))
(FPCore (x y) :precision binary64 (fma x 500.0 (* -500.0 y)))
double code(double x, double y) {
	return 500.0 * (x - y);
}
double code(double x, double y) {
	return fma(x, 500.0, (-500.0 * y));
}
function code(x, y)
	return Float64(500.0 * Float64(x - y))
end
function code(x, y)
	return fma(x, 500.0, Float64(-500.0 * y))
end
code[x_, y_] := N[(500.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(x * 500.0 + N[(-500.0 * y), $MachinePrecision]), $MachinePrecision]
500 \cdot \left(x - y\right)
\mathsf{fma}\left(x, 500, -500 \cdot y\right)

Error

Derivation

  1. Initial program 0.0

    \[500 \cdot \left(x - y\right) \]
  2. Applied egg-rr0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, 500, -500 \cdot y\right)} \]

Alternatives

Alternative 1
Error17.4
Cost720
\[\begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+94}:\\ \;\;\;\;-500 \cdot y\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{+41}:\\ \;\;\;\;500 \cdot x\\ \mathbf{elif}\;y \leq -1.36 \cdot 10^{-6}:\\ \;\;\;\;-500 \cdot y\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+103}:\\ \;\;\;\;500 \cdot x\\ \mathbf{else}:\\ \;\;\;\;-500 \cdot y\\ \end{array} \]
Alternative 2
Error0.0
Cost320
\[500 \cdot \left(x - y\right) \]
Alternative 3
Error31.5
Cost192
\[-500 \cdot y \]

Error

Reproduce

herbie shell --seed 2023010 
(FPCore (x y)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, B"
  :precision binary64
  (* 500.0 (- x y)))