\[\left(x \cdot 2 + x \cdot x\right) + y \cdot y
\]
↓
\[y \cdot y + x \cdot \left(x + 2\right)
\]
(FPCore (x y) :precision binary64 (+ (+ (* x 2.0) (* x x)) (* y y)))
↓
(FPCore (x y) :precision binary64 (+ (* y y) (* x (+ x 2.0))))
double code(double x, double y) {
return ((x * 2.0) + (x * x)) + (y * y);
}
↓
double code(double x, double y) {
return (y * y) + (x * (x + 2.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * 2.0d0) + (x * x)) + (y * y)
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * y) + (x * (x + 2.0d0))
end function
public static double code(double x, double y) {
return ((x * 2.0) + (x * x)) + (y * y);
}
↓
public static double code(double x, double y) {
return (y * y) + (x * (x + 2.0));
}
def code(x, y):
return ((x * 2.0) + (x * x)) + (y * y)
↓
def code(x, y):
return (y * y) + (x * (x + 2.0))
function code(x, y)
return Float64(Float64(Float64(x * 2.0) + Float64(x * x)) + Float64(y * y))
end
↓
function code(x, y)
return Float64(Float64(y * y) + Float64(x * Float64(x + 2.0)))
end
function tmp = code(x, y)
tmp = ((x * 2.0) + (x * x)) + (y * y);
end
↓
function tmp = code(x, y)
tmp = (y * y) + (x * (x + 2.0));
end
code[x_, y_] := N[(N[(N[(x * 2.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := N[(N[(y * y), $MachinePrecision] + N[(x * N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot 2 + x \cdot x\right) + y \cdot y
↓
y \cdot y + x \cdot \left(x + 2\right)
Alternatives
| Alternative 1 |
|---|
| Error | 23.3 |
|---|
| Cost | 1512 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -8.090415211560587 \cdot 10^{-60}:\\
\;\;\;\;y \cdot y\\
\mathbf{elif}\;y \leq -2.7418161779546055 \cdot 10^{-103}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;y \leq 6.020938185527993 \cdot 10^{-280}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 4.3215576700986393 \cdot 10^{-246}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;y \leq 2.8592466077075347 \cdot 10^{-101}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 3.0336423605415836 \cdot 10^{-82}:\\
\;\;\;\;y \cdot y\\
\mathbf{elif}\;y \leq 6.472843817006802 \cdot 10^{-71}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 1.3072718881620541 \cdot 10^{-45}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;y \leq 5.2579804179458313 \cdot 10^{-14}:\\
\;\;\;\;y \cdot y\\
\mathbf{elif}\;y \leq 3821255.528034045:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot y\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 10.3 |
|---|
| Cost | 1100 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(x + 2\right)\\
\mathbf{if}\;y \cdot y \leq 1.0230518381963677 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \cdot y \leq 2.764635807550182 \cdot 10^{-27}:\\
\;\;\;\;y \cdot y\\
\mathbf{elif}\;y \cdot y \leq 128881898965185.98:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot y\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 4.3 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(x + 2\right)\\
\mathbf{if}\;x \leq -2.0627567669706132 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.4678579052086466 \cdot 10^{-28}:\\
\;\;\;\;y \cdot y + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.3 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_0 := y \cdot y + x \cdot x\\
\mathbf{if}\;x \leq -280338.6794393384:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.11673240549718435:\\
\;\;\;\;y \cdot y + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 21.5 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.7094079459717318 \cdot 10^{-74}:\\
\;\;\;\;y \cdot y\\
\mathbf{elif}\;y \leq 2.8592466077075347 \cdot 10^{-101}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;y \cdot y\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 42.4 |
|---|
| Cost | 192 |
|---|
\[x \cdot 2
\]