\[\left(x + 1\right) \cdot y - x
\]
↓
\[\left(y - x\right) + y \cdot x
\]
(FPCore (x y) :precision binary64 (- (* (+ x 1.0) y) x))
↓
(FPCore (x y) :precision binary64 (+ (- y x) (* y x)))
double code(double x, double y) {
return ((x + 1.0) * y) - x;
}
↓
double code(double x, double y) {
return (y - x) + (y * x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x + 1.0d0) * y) - x
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y - x) + (y * x)
end function
public static double code(double x, double y) {
return ((x + 1.0) * y) - x;
}
↓
public static double code(double x, double y) {
return (y - x) + (y * x);
}
def code(x, y):
return ((x + 1.0) * y) - x
↓
def code(x, y):
return (y - x) + (y * x)
function code(x, y)
return Float64(Float64(Float64(x + 1.0) * y) - x)
end
↓
function code(x, y)
return Float64(Float64(y - x) + Float64(y * x))
end
function tmp = code(x, y)
tmp = ((x + 1.0) * y) - x;
end
↓
function tmp = code(x, y)
tmp = (y - x) + (y * x);
end
code[x_, y_] := N[(N[(N[(x + 1.0), $MachinePrecision] * y), $MachinePrecision] - x), $MachinePrecision]
↓
code[x_, y_] := N[(N[(y - x), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]
\left(x + 1\right) \cdot y - x
↓
\left(y - x\right) + y \cdot x
Alternatives
| Alternative 1 |
|---|
| Error | 20.3 |
|---|
| Cost | 984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -8.6 \cdot 10^{+107}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{+22}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-47}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-21}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+34}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+116}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 11.0 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{+108}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq -8.6 \cdot 10^{+22}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+31}:\\
\;\;\;\;y - x\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+117}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 1.3 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := \left(1 + x\right) \cdot y\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-21}:\\
\;\;\;\;y - x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.2 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;y \cdot x + y\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-21}:\\
\;\;\;\;y - x\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x\right) \cdot y\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 18.9 |
|---|
| Cost | 392 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -6.4 \cdot 10^{-47}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-18}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 36.6 |
|---|
| Cost | 64 |
|---|
\[y
\]