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 \cdot z \leq 10^{+222}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot z - t, y \cdot -4, x \cdot x\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 z) 1e+222)
(fma (- (* z z) t) (* y -4.0) (* x x))
(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 * z) <= 1e+222) {
tmp = fma(((z * z) - t), (y * -4.0), (x * x));
} 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 (Float64(z * z) <= 1e+222)
tmp = fma(Float64(Float64(z * z) - t), Float64(y * -4.0), Float64(x * x));
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[N[(z * z), $MachinePrecision], 1e+222], N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision] + N[(x * x), $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 \cdot z \leq 10^{+222}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot z - t, y \cdot -4, x \cdot x\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 Accuracy 99.5% Cost 7236
\[\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+222}:\\
\;\;\;\;x \cdot x - \left(\left(z \cdot z\right) \cdot \left(y \cdot 4\right) + t \cdot \left(y \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\right)\\
\end{array}
\]
Alternative 2 Accuracy 85.7% Cost 1368
\[\begin{array}{l}
t_1 := \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
t_2 := z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
t_3 := x \cdot x + t \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+135}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-69}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+96}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+117}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 3 Accuracy 85.7% Cost 1368
\[\begin{array}{l}
t_1 := \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
t_2 := z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
t_3 := x \cdot x + t \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+135}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-8}:\\
\;\;\;\;-4 \cdot \left(\left(z \cdot z\right) \cdot y - t \cdot y\right)\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-69}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+96}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+117}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 4 Accuracy 99.5% Cost 1348
\[\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+222}:\\
\;\;\;\;x \cdot x - \left(\left(z \cdot z\right) \cdot \left(y \cdot 4\right) + t \cdot \left(y \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + z \cdot \left(-4 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\]
Alternative 5 Accuracy 55.9% Cost 1241
\[\begin{array}{l}
t_1 := 4 \cdot \left(t \cdot y\right)\\
t_2 := z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-294}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-180}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+65} \lor \neg \left(z \leq 1.4 \cdot 10^{+98}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 6 Accuracy 55.9% Cost 1240
\[\begin{array}{l}
t_1 := 4 \cdot \left(t \cdot y\right)\\
t_2 := z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{-9}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-294}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.82 \cdot 10^{-182}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+64}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(y \cdot -4\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+98}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 7 Accuracy 89.6% Cost 1100
\[\begin{array}{l}
t_1 := x \cdot x + z \cdot \left(-4 \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-69}:\\
\;\;\;\;x \cdot x + t \cdot \left(y \cdot 4\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+64}:\\
\;\;\;\;\left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 8 Accuracy 99.5% Cost 1092
\[\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+222}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + z \cdot \left(-4 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\]
Alternative 9 Accuracy 76.9% Cost 841
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{-33} \lor \neg \left(x \leq 3.7 \cdot 10^{+27}\right):\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\end{array}
\]
Alternative 10 Accuracy 60.1% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-33}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-67}:\\
\;\;\;\;4 \cdot \left(t \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 11 Accuracy 35.5% Cost 192
\[x \cdot x
\]