\[\left(x \cdot y + x\right) + y
\]
↓
\[x + \left(y + x \cdot y\right)
\]
(FPCore (x y) :precision binary64 (+ (+ (* x y) x) y))
↓
(FPCore (x y) :precision binary64 (+ x (+ y (* x y))))
double code(double x, double y) {
return ((x * y) + x) + y;
}
↓
double code(double x, double y) {
return x + (y + (x * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * y) + x) + y
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (y + (x * y))
end function
public static double code(double x, double y) {
return ((x * y) + x) + y;
}
↓
public static double code(double x, double y) {
return x + (y + (x * y));
}
def code(x, y):
return ((x * y) + x) + y
↓
def code(x, y):
return x + (y + (x * y))
function code(x, y)
return Float64(Float64(Float64(x * y) + x) + y)
end
↓
function code(x, y)
return Float64(x + Float64(y + Float64(x * y)))
end
function tmp = code(x, y)
tmp = ((x * y) + x) + y;
end
↓
function tmp = code(x, y)
tmp = x + (y + (x * y));
end
code[x_, y_] := N[(N[(N[(x * y), $MachinePrecision] + x), $MachinePrecision] + y), $MachinePrecision]
↓
code[x_, y_] := N[(x + N[(y + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + x\right) + y
↓
x + \left(y + x \cdot y\right)
Alternatives
| Alternative 1 |
|---|
| Error | 25.3 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.92 \cdot 10^{+174}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{+77}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-88}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 15.4 |
|---|
| Cost | 588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+174}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{+78}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq 1020000000000:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.9 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := \left(1 + x\right) \cdot y\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-8}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 12.7 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\left(1 + y\right) \cdot x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-150}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x\right) \cdot y\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 12.7 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\left(1 + y\right) \cdot x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-150}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y + y \cdot x\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 27.8 |
|---|
| Cost | 196 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-87}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 35.6 |
|---|
| Cost | 64 |
|---|
\[x
\]