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 -2 \cdot 10^{+150} \lor \neg \left(z \leq 6.6 \cdot 10^{+90}\right):\\
\;\;\;\;x \cdot x + \left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot z - t, y \cdot -4, x \cdot x\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 (or (<= z -2e+150) (not (<= z 6.6e+90)))
(+ (* x x) (* (* z (* z y)) -4.0))
(fma (- (* z z) t) (* y -4.0) (* x x)))) 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 <= -2e+150) || !(z <= 6.6e+90)) {
tmp = (x * x) + ((z * (z * y)) * -4.0);
} else {
tmp = fma(((z * z) - t), (y * -4.0), (x * x));
}
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 <= -2e+150) || !(z <= 6.6e+90))
tmp = Float64(Float64(x * x) + Float64(Float64(z * Float64(z * y)) * -4.0));
else
tmp = fma(Float64(Float64(z * z) - t), Float64(y * -4.0), Float64(x * x));
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[Or[LessEqual[z, -2e+150], N[Not[LessEqual[z, 6.6e+90]], $MachinePrecision]], N[(N[(x * x), $MachinePrecision] + N[(N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
↓
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+150} \lor \neg \left(z \leq 6.6 \cdot 10^{+90}\right):\\
\;\;\;\;x \cdot x + \left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot z - t, y \cdot -4, x \cdot x\right)\\
\end{array}
Alternatives Alternative 1 Error 44.56% Cost 1768
\[\begin{array}{l}
t_1 := z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
t_2 := t \cdot \left(4 \cdot y\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+17}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-31}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.85 \cdot 10^{-300}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-223}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-178}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 2 Error 14.75% Cost 1236
\[\begin{array}{l}
t_1 := \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\\
t_2 := x \cdot x - t \cdot \left(y \cdot -4\right)\\
t_3 := z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+125}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+90}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
Alternative 3 Error 11.36% Cost 1100
\[\begin{array}{l}
t_1 := x \cdot x + \left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-96}:\\
\;\;\;\;4 \cdot \left(y \cdot t - y \cdot \left(z \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 8.3 \cdot 10^{+40}:\\
\;\;\;\;x \cdot x - t \cdot \left(y \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 0.55% Cost 1097
\[\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+150} \lor \neg \left(z \leq 6.6 \cdot 10^{+90}\right):\\
\;\;\;\;x \cdot x + \left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\\
\end{array}
\]
Alternative 5 Error 40.07% Cost 849
\[\begin{array}{l}
\mathbf{if}\;x \leq -38000000000000:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-9} \lor \neg \left(x \leq -4.8 \cdot 10^{-56}\right) \land x \leq 3.4:\\
\;\;\;\;t \cdot \left(4 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 6 Error 23.51% Cost 840
\[\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+17}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+48}:\\
\;\;\;\;\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 7 Error 64.7% Cost 192
\[x \cdot x
\]