\[\left(x \cdot y + x\right) + y
\]
↓
\[x \cdot y + \left(x + 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(Float64(x * 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[(N[(x * y), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + x\right) + y
↓
x \cdot y + \left(x + y\right)
Alternatives
| Alternative 1 |
|---|
| Error | 23.8 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-28}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-71}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-111}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.0 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := \left(y + 1\right) \cdot x\\
\mathbf{if}\;x \leq -8 \cdot 10^{+14}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 10.3 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+14}:\\
\;\;\;\;\left(y + 1\right) \cdot x\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-38}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot x + y\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 27.8 |
|---|
| Cost | 460 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{-28}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-73}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-111}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 14.0 |
|---|
| Cost | 324 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -4.5:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 36.6 |
|---|
| Cost | 64 |
|---|
\[x
\]