\[ \begin{array}{c}[y, z] = \mathsf{sort}([y, z])\\ \end{array} \]
\[x \cdot \left(1 - y \cdot z\right)
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -\infty:\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+214}:\\
\;\;\;\;x - \left(y \cdot z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
↓
(FPCore (x y z)
:precision binary64
(if (<= (* y z) (- INFINITY))
(* z (* y (- x)))
(if (<= (* y z) 5e+214) (- x (* (* y z) x)) (* y (* z (- x))))))
double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
↓
double code(double x, double y, double z) {
double tmp;
if ((y * z) <= -((double) INFINITY)) {
tmp = z * (y * -x);
} else if ((y * z) <= 5e+214) {
tmp = x - ((y * z) * x);
} else {
tmp = y * (z * -x);
}
return tmp;
}
public static double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
↓
public static double code(double x, double y, double z) {
double tmp;
if ((y * z) <= -Double.POSITIVE_INFINITY) {
tmp = z * (y * -x);
} else if ((y * z) <= 5e+214) {
tmp = x - ((y * z) * x);
} else {
tmp = y * (z * -x);
}
return tmp;
}
def code(x, y, z):
return x * (1.0 - (y * z))
↓
def code(x, y, z):
tmp = 0
if (y * z) <= -math.inf:
tmp = z * (y * -x)
elif (y * z) <= 5e+214:
tmp = x - ((y * z) * x)
else:
tmp = y * (z * -x)
return tmp
function code(x, y, z)
return Float64(x * Float64(1.0 - Float64(y * z)))
end
↓
function code(x, y, z)
tmp = 0.0
if (Float64(y * z) <= Float64(-Inf))
tmp = Float64(z * Float64(y * Float64(-x)));
elseif (Float64(y * z) <= 5e+214)
tmp = Float64(x - Float64(Float64(y * z) * x));
else
tmp = Float64(y * Float64(z * Float64(-x)));
end
return tmp
end
function tmp = code(x, y, z)
tmp = x * (1.0 - (y * z));
end
↓
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((y * z) <= -Inf)
tmp = z * (y * -x);
elseif ((y * z) <= 5e+214)
tmp = x - ((y * z) * x);
else
tmp = y * (z * -x);
end
tmp_2 = tmp;
end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := If[LessEqual[N[(y * z), $MachinePrecision], (-Infinity)], N[(z * N[(y * (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y * z), $MachinePrecision], 5e+214], N[(x - N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * (-x)), $MachinePrecision]), $MachinePrecision]]]
x \cdot \left(1 - y \cdot z\right)
↓
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -\infty:\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+214}:\\
\;\;\;\;x - \left(y \cdot z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.9 |
|---|
| Cost | 2204 |
|---|
\[\begin{array}{l}
t_0 := \left(y \cdot z\right) \cdot \left(-x\right)\\
t_1 := x - z \cdot \left(y \cdot x\right)\\
t_2 := z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{if}\;y \cdot z \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \cdot z \leq -2 \cdot 10^{+18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \cdot z \leq -2 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \cdot z \leq 4 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \cdot z \leq 0.25:\\
\;\;\;\;x - y \cdot \left(z \cdot x\right)\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \cdot z \leq 10^{+271}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.9 |
|---|
| Cost | 1944 |
|---|
\[\begin{array}{l}
t_0 := \left(y \cdot z\right) \cdot \left(-x\right)\\
t_1 := x - y \cdot \left(z \cdot x\right)\\
\mathbf{if}\;y \cdot z \leq -\infty:\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \cdot z \leq -4000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \cdot z \leq -1 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \cdot z \leq 4 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+214}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 1.8 |
|---|
| Cost | 1424 |
|---|
\[\begin{array}{l}
t_0 := \left(y \cdot z\right) \cdot \left(-x\right)\\
\mathbf{if}\;y \cdot z \leq -\infty:\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \cdot z \leq -1000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \cdot z \leq 0.5:\\
\;\;\;\;x\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+214}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.2 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -\infty:\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+214}:\\
\;\;\;\;x \cdot \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 17.0 |
|---|
| Cost | 648 |
|---|
\[\begin{array}{l}
t_0 := z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{if}\;z \leq -4.4458117478069495 \cdot 10^{-55}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 25.1 |
|---|
| Cost | 64 |
|---|
\[x
\]