?

Average Error: 0.0 → 0.0
Time: 15.3s
Precision: binary64
Cost: 576

?

\[500 \cdot \left(x - y\right) \]
\[y \cdot -1000 - -500 \cdot \left(y + x\right) \]
(FPCore (x y) :precision binary64 (* 500.0 (- x y)))
(FPCore (x y) :precision binary64 (- (* y -1000.0) (* -500.0 (+ y x))))
double code(double x, double y) {
	return 500.0 * (x - y);
}
double code(double x, double y) {
	return (y * -1000.0) - (-500.0 * (y + x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 500.0d0 * (x - y)
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (y * (-1000.0d0)) - ((-500.0d0) * (y + x))
end function
public static double code(double x, double y) {
	return 500.0 * (x - y);
}
public static double code(double x, double y) {
	return (y * -1000.0) - (-500.0 * (y + x));
}
def code(x, y):
	return 500.0 * (x - y)
def code(x, y):
	return (y * -1000.0) - (-500.0 * (y + x))
function code(x, y)
	return Float64(500.0 * Float64(x - y))
end
function code(x, y)
	return Float64(Float64(y * -1000.0) - Float64(-500.0 * Float64(y + x)))
end
function tmp = code(x, y)
	tmp = 500.0 * (x - y);
end
function tmp = code(x, y)
	tmp = (y * -1000.0) - (-500.0 * (y + x));
end
code[x_, y_] := N[(500.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(y * -1000.0), $MachinePrecision] - N[(-500.0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
500 \cdot \left(x - y\right)
y \cdot -1000 - -500 \cdot \left(y + x\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.0

    \[500 \cdot \left(x - y\right) \]
  2. Taylor expanded in x around 0 0.0

    \[\leadsto \color{blue}{500 \cdot x + -500 \cdot y} \]
  3. Applied egg-rr0.0

    \[\leadsto \color{blue}{y \cdot -1000 - -500 \cdot \left(y + x\right)} \]
  4. Final simplification0.0

    \[\leadsto y \cdot -1000 - -500 \cdot \left(y + x\right) \]

Alternatives

Alternative 1
Error16.9
Cost720
\[\begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-22}:\\ \;\;\;\;-500 \cdot y\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-28}:\\ \;\;\;\;500 \cdot x\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+119}:\\ \;\;\;\;-500 \cdot y\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+159}:\\ \;\;\;\;500 \cdot x\\ \mathbf{else}:\\ \;\;\;\;-500 \cdot y\\ \end{array} \]
Alternative 2
Error0.0
Cost320
\[500 \cdot \left(x - y\right) \]
Alternative 3
Error31.9
Cost192
\[-500 \cdot y \]

Error

Reproduce?

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