Average Error: 0.0 → 0.0
Time: 1.7s
Precision: binary64
Cost: 320
\[500 \cdot \left(x - y\right) \]
\[500 \cdot \left(x - y\right) \]
(FPCore (x y) :precision binary64 (* 500.0 (- x y)))
(FPCore (x y) :precision binary64 (* 500.0 (- x y)))
double code(double x, double y) {
	return 500.0 * (x - y);
}
double code(double x, double y) {
	return 500.0 * (x - y);
}
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 = 500.0d0 * (x - y)
end function
public static double code(double x, double y) {
	return 500.0 * (x - y);
}
public static double code(double x, double y) {
	return 500.0 * (x - y);
}
def code(x, y):
	return 500.0 * (x - y)
def code(x, y):
	return 500.0 * (x - y)
function code(x, y)
	return Float64(500.0 * Float64(x - y))
end
function code(x, y)
	return Float64(500.0 * Float64(x - y))
end
function tmp = code(x, y)
	tmp = 500.0 * (x - y);
end
function tmp = code(x, y)
	tmp = 500.0 * (x - y);
end
code[x_, y_] := N[(500.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(500.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]
500 \cdot \left(x - y\right)
500 \cdot \left(x - y\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. Final simplification0.0

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

Alternatives

Alternative 1
Error17.3
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{+74}:\\ \;\;\;\;y \cdot -500\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+94}:\\ \;\;\;\;500 \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot -500\\ \end{array} \]
Alternative 2
Error32.0
Cost192
\[y \cdot -500 \]

Error

Reproduce

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