| Alternative 1 | |
|---|---|
| Error | 17.4 |
| Cost | 456 |
\[\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-58}:\\
\;\;\;\;500 \cdot x\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{+86}:\\
\;\;\;\;-500 \cdot y\\
\mathbf{else}:\\
\;\;\;\;500 \cdot x\\
\end{array}
\]
(FPCore (x y) :precision binary64 (* 500.0 (- x y)))
(FPCore (x y) :precision binary64 (+ (* 500.0 x) (* -500.0 y)))
double code(double x, double y) {
return 500.0 * (x - y);
}
double code(double x, double y) {
return (500.0 * x) + (-500.0 * 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) + ((-500.0d0) * 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) + (-500.0 * y);
}
def code(x, y): return 500.0 * (x - y)
def code(x, y): return (500.0 * x) + (-500.0 * y)
function code(x, y) return Float64(500.0 * Float64(x - y)) end
function code(x, y) return Float64(Float64(500.0 * x) + Float64(-500.0 * y)) end
function tmp = code(x, y) tmp = 500.0 * (x - y); end
function tmp = code(x, y) tmp = (500.0 * x) + (-500.0 * y); end
code[x_, y_] := N[(500.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(500.0 * x), $MachinePrecision] + N[(-500.0 * y), $MachinePrecision]), $MachinePrecision]
500 \cdot \left(x - y\right)
500 \cdot x + -500 \cdot y
Results
Initial program 0.0
Taylor expanded in x around 0 0.0
Final simplification0.0
| Alternative 1 | |
|---|---|
| Error | 17.4 |
| Cost | 456 |
| Alternative 2 | |
|---|---|
| Error | 0.0 |
| Cost | 320 |
| Alternative 3 | |
|---|---|
| Error | 31.8 |
| Cost | 192 |
herbie shell --seed 2023075
(FPCore (x y)
:name "Data.Colour.CIE:cieLABView from colour-2.3.3, B"
:precision binary64
(* 500.0 (- x y)))