Math FPCore C Julia Wolfram TeX \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\]
↓
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+86} \lor \neg \left(z \leq 5 \cdot 10^{+141}\right):\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\end{array}
\]
(FPCore (x y z t a b)
:precision binary64
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b))) ↓
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -1.35e+86) (not (<= z 5e+141)))
(fma z (fma a b y) (fma t a x))
(fma y z (fma a (fma z b t) x)))) double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
↓
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.35e+86) || !(z <= 5e+141)) {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
} else {
tmp = fma(y, z, fma(a, fma(z, b, t), x));
}
return tmp;
}
function code(x, y, z, t, a, b)
return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b))
end
↓
function code(x, y, z, t, a, b)
tmp = 0.0
if ((z <= -1.35e+86) || !(z <= 5e+141))
tmp = fma(z, fma(a, b, y), fma(t, a, x));
else
tmp = fma(y, z, fma(a, fma(z, b, t), x));
end
return tmp
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.35e+86], N[Not[LessEqual[z, 5e+141]], $MachinePrecision]], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision], N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
↓
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+86} \lor \neg \left(z \leq 5 \cdot 10^{+141}\right):\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 2.14% Cost 19780
\[\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-131}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot t + \left(x + z \cdot y\right)\right) + b \cdot \left(z \cdot a\right)\\
\end{array}
\]
Alternative 2 Error 2.12% Cost 13508
\[\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-128}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot t + \left(x + z \cdot y\right)\right) + b \cdot \left(z \cdot a\right)\\
\end{array}
\]
Alternative 3 Error 65.51% Cost 1644
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+126}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{+72}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1 \cdot 10^{+19}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-53}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq -5.3 \cdot 10^{-68}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-111}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-186}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-289}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-186}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-122}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+40}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\]
Alternative 4 Error 34.03% Cost 1376
\[\begin{array}{l}
t_1 := x + b \cdot \left(z \cdot a\right)\\
t_2 := x + a \cdot t\\
t_3 := z \cdot y + a \cdot t\\
t_4 := x + z \cdot y\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+148}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -310000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-85}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-141}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 10^{-127}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-53}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\]
Alternative 5 Error 34.2% Cost 1245
\[\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
t_3 := x + z \cdot y\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+48}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-66}:\\
\;\;\;\;x + b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-113}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.22 \cdot 10^{-141} \lor \neg \left(z \leq 1350000\right):\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 6 Error 35.26% Cost 1240
\[\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
t_2 := x + z \cdot y\\
\mathbf{if}\;x \leq -2300000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-69}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.3 \cdot 10^{-245}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-54}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 7 Error 2.12% Cost 1092
\[\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;a \leq -1 \cdot 10^{-128}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot t + t_1\right) + b \cdot \left(z \cdot a\right)\\
\end{array}
\]
Alternative 8 Error 41.75% Cost 981
\[\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+161}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{+19}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+37} \lor \neg \left(z \leq 1.4 \cdot 10^{+95}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\]
Alternative 9 Error 3.96% Cost 960
\[\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + \left(x + z \cdot y\right)
\]
Alternative 10 Error 15.39% Cost 841
\[\begin{array}{l}
\mathbf{if}\;b \leq -3.4 \cdot 10^{+180} \lor \neg \left(b \leq 6.5 \cdot 10^{+170}\right):\\
\;\;\;\;x + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot y + \left(x + a \cdot t\right)\\
\end{array}
\]
Alternative 11 Error 12.62% Cost 841
\[\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+32} \lor \neg \left(t \leq 8.6 \cdot 10^{-93}\right):\\
\;\;\;\;z \cdot y + \left(x + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\]
Alternative 12 Error 32.79% Cost 716
\[\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{+19}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq 85000:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 13 Error 31.4% Cost 584
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+19}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;z \leq 6500:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\]
Alternative 14 Error 51.95% Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -3000000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-42}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 15 Error 62.61% Cost 64
\[x
\]