\[\left(x + y\right) \cdot \left(z + 1\right)
\]
↓
\[\left(x + y\right) \cdot \left(z + 1\right)
\]
(FPCore (x y z) :precision binary64 (* (+ x y) (+ z 1.0)))
↓
(FPCore (x y z) :precision binary64 (* (+ x y) (+ z 1.0)))
double code(double x, double y, double z) {
return (x + y) * (z + 1.0);
}
↓
double code(double x, double y, double z) {
return (x + y) * (z + 1.0);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + y) * (z + 1.0d0)
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + y) * (z + 1.0d0)
end function
public static double code(double x, double y, double z) {
return (x + y) * (z + 1.0);
}
↓
public static double code(double x, double y, double z) {
return (x + y) * (z + 1.0);
}
def code(x, y, z):
return (x + y) * (z + 1.0)
↓
def code(x, y, z):
return (x + y) * (z + 1.0)
function code(x, y, z)
return Float64(Float64(x + y) * Float64(z + 1.0))
end
↓
function code(x, y, z)
return Float64(Float64(x + y) * Float64(z + 1.0))
end
function tmp = code(x, y, z)
tmp = (x + y) * (z + 1.0);
end
↓
function tmp = code(x, y, z)
tmp = (x + y) * (z + 1.0);
end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\left(x + y\right) \cdot \left(z + 1\right)
↓
\left(x + y\right) \cdot \left(z + 1\right)
Alternatives
| Alternative 1 |
|---|
| Error | 12.1 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
t_0 := y \cdot \left(z - -1\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-6}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+21}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+95}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 32.4 |
|---|
| Cost | 588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq 205000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+94}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 12.7 |
|---|
| Cost | 588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq 205000000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+95}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.6 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := \left(y + x\right) \cdot z\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 32.7 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 205000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 42.9 |
|---|
| Cost | 64 |
|---|
\[x
\]