| Alternative 1 | |
|---|---|
| Error | 14.29% |
| Cost | 456 |
\[\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+61}:\\
\;\;\;\;-y\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+76}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\]
(FPCore (x y) :precision binary64 (- (- 1.0 x) y))
(FPCore (x y) :precision binary64 (- (- 1.0 x) y))
double code(double x, double y) {
return (1.0 - x) - y;
}
double code(double x, double y) {
return (1.0 - x) - y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) - y
end function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) - y
end function
public static double code(double x, double y) {
return (1.0 - x) - y;
}
public static double code(double x, double y) {
return (1.0 - x) - y;
}
def code(x, y): return (1.0 - x) - y
def code(x, y): return (1.0 - x) - y
function code(x, y) return Float64(Float64(1.0 - x) - y) end
function code(x, y) return Float64(Float64(1.0 - x) - y) end
function tmp = code(x, y) tmp = (1.0 - x) - y; end
function tmp = code(x, y) tmp = (1.0 - x) - y; end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] - y), $MachinePrecision]
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] - y), $MachinePrecision]
\left(1 - x\right) - y
\left(1 - x\right) - y
Results
Initial program 0
Final simplification0
| Alternative 1 | |
|---|---|
| Error | 14.29% |
| Cost | 456 |
| Alternative 2 | |
|---|---|
| Error | 38.95% |
| Cost | 392 |
| Alternative 3 | |
|---|---|
| Error | 61.53% |
| Cost | 128 |
herbie shell --seed 2023121
(FPCore (x y)
:name "Data.Colour.CIE.Chromaticity:chromaCoords from colour-2.3.3"
:precision binary64
(- (- 1.0 x) y))