Math FPCore C Julia Wolfram TeX \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\]
↓
\[\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+130}:\\
\;\;\;\;x \cdot x + z \cdot \frac{y \cdot 4}{\frac{-1}{z}}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\right)\\
\end{array}
\]
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t)))) ↓
(FPCore (x y z t)
:precision binary64
(if (<= z -7.8e+130)
(+ (* x x) (* z (/ (* y 4.0) (/ -1.0 z))))
(if (<= z 2.7e+93)
(fma x x (* (* y -4.0) (- (* z z) t)))
(fma x x (* z (* z (* y -4.0))))))) double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
↓
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.8e+130) {
tmp = (x * x) + (z * ((y * 4.0) / (-1.0 / z)));
} else if (z <= 2.7e+93) {
tmp = fma(x, x, ((y * -4.0) * ((z * z) - t)));
} else {
tmp = fma(x, x, (z * (z * (y * -4.0))));
}
return tmp;
}
function code(x, y, z, t)
return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t)))
end
↓
function code(x, y, z, t)
tmp = 0.0
if (z <= -7.8e+130)
tmp = Float64(Float64(x * x) + Float64(z * Float64(Float64(y * 4.0) / Float64(-1.0 / z))));
elseif (z <= 2.7e+93)
tmp = fma(x, x, Float64(Float64(y * -4.0) * Float64(Float64(z * z) - t)));
else
tmp = fma(x, x, Float64(z * Float64(z * Float64(y * -4.0))));
end
return tmp
end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_] := If[LessEqual[z, -7.8e+130], N[(N[(x * x), $MachinePrecision] + N[(z * N[(N[(y * 4.0), $MachinePrecision] / N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+93], N[(x * x + N[(N[(y * -4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
↓
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+130}:\\
\;\;\;\;x \cdot x + z \cdot \frac{y \cdot 4}{\frac{-1}{z}}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 0.4 Cost 7240
\[\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+130}:\\
\;\;\;\;x \cdot x + z \cdot \frac{y \cdot 4}{\frac{-1}{z}}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+93}:\\
\;\;\;\;x \cdot x + \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\right)\\
\end{array}
\]
Alternative 2 Error 8.5 Cost 1616
\[\begin{array}{l}
t_1 := \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\\
t_2 := x \cdot x + t \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;z \cdot z \leq 10^{-55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \cdot z \leq 7 \cdot 10^{+135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \cdot z \leq 10^{+170}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \cdot z \leq 5 \cdot 10^{+260}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\]
Alternative 3 Error 27.7 Cost 1376
\[\begin{array}{l}
t_1 := z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
t_2 := t \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{-65}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-212}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-273}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-302}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-262}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.65 \cdot 10^{-176}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-23}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 4 Error 6.5 Cost 1224
\[\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{-55}:\\
\;\;\;\;x \cdot x + t \cdot \left(y \cdot 4\right)\\
\mathbf{elif}\;z \cdot z \leq 2 \cdot 10^{+111}:\\
\;\;\;\;\left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + -4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\\
\end{array}
\]
Alternative 5 Error 0.4 Cost 1097
\[\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+130} \lor \neg \left(z \leq 2.7 \cdot 10^{+93}\right):\\
\;\;\;\;x \cdot x + -4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\\
\end{array}
\]
Alternative 6 Error 0.4 Cost 1096
\[\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+130}:\\
\;\;\;\;x \cdot x + z \cdot \frac{y \cdot 4}{\frac{-1}{z}}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+93}:\\
\;\;\;\;x \cdot x + \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + -4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\\
\end{array}
\]
Alternative 7 Error 14.3 Cost 841
\[\begin{array}{l}
\mathbf{if}\;x \leq -115000 \lor \neg \left(x \leq 0.13\right):\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\\
\end{array}
\]
Alternative 8 Error 24.8 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{-64}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-23}:\\
\;\;\;\;t \cdot \left(y \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 9 Error 41.3 Cost 192
\[x \cdot x
\]