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}\;b \leq -1 \cdot 10^{-229} \lor \neg \left(b \leq 2 \cdot 10^{+51}\right):\\
\;\;\;\;\left(t \cdot a + \left(x + y \cdot z\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, 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 (<= b -1e-229) (not (<= b 2e+51)))
(+ (+ (* t a) (+ x (* y z))) (* b (* z a)))
(fma z (fma a b y) (fma t a 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 ((b <= -1e-229) || !(b <= 2e+51)) {
tmp = ((t * a) + (x + (y * z))) + (b * (z * a));
} else {
tmp = fma(z, fma(a, b, y), fma(t, a, 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 ((b <= -1e-229) || !(b <= 2e+51))
tmp = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(b * Float64(z * a)));
else
tmp = fma(z, fma(a, b, y), fma(t, a, 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[b, -1e-229], N[Not[LessEqual[b, 2e+51]], $MachinePrecision]], N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + 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}\;b \leq -1 \cdot 10^{-229} \lor \neg \left(b \leq 2 \cdot 10^{+51}\right):\\
\;\;\;\;\left(t \cdot a + \left(x + y \cdot z\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 2.2 Cost 13508
\[\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-31}:\\
\;\;\;\;\left(t \cdot a + \left(x + y \cdot z\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t + b \cdot z, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
\]
Alternative 2 Error 2.2 Cost 7364
\[\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;t \leq -5 \cdot 10^{-31}:\\
\;\;\;\;\left(t \cdot a + t_1\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, a, a \cdot \left(b \cdot z\right)\right) + t_1\\
\end{array}
\]
Alternative 3 Error 38.8 Cost 1512
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+261}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{+185}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -0.000155:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-125}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-152}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq -1.02 \cdot 10^{-216}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-234}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-225}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-169}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 820000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\]
Alternative 4 Error 21.8 Cost 1376
\[\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := a \cdot \left(t + b \cdot z\right)\\
t_3 := x + t \cdot a\\
\mathbf{if}\;a \leq -4.6 \cdot 10^{+17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -2.05 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-143}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq 8.8 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+163}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{+245}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot z\right)\\
\end{array}
\]
Alternative 5 Error 3.2 Cost 1225
\[\begin{array}{l}
\mathbf{if}\;a \leq -1.26 \cdot 10^{-114} \lor \neg \left(a \leq -1.2 \cdot 10^{-299}\right):\\
\;\;\;\;\left(a \cdot \left(b \cdot z\right) + t \cdot a\right) + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + b \cdot a\right)\\
\end{array}
\]
Alternative 6 Error 25.9 Cost 1115
\[\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-80} \lor \neg \left(x \leq -1.35 \cdot 10^{-93}\right) \land \left(x \leq -3.85 \cdot 10^{-199} \lor \neg \left(x \leq 1.8 \cdot 10^{-274} \lor \neg \left(x \leq 7.6 \cdot 10^{-169}\right) \land x \leq 2.45 \cdot 10^{-138}\right)\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\]
Alternative 7 Error 2.2 Cost 1092
\[\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;t \leq -8 \cdot 10^{-31}:\\
\;\;\;\;\left(t \cdot a + t_1\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(b \cdot z\right) + t \cdot a\right) + t_1\\
\end{array}
\]
Alternative 8 Error 8.5 Cost 972
\[\begin{array}{l}
t_1 := x + z \cdot \left(y + b \cdot a\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-265}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-21}:\\
\;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 9 Error 7.6 Cost 969
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.52 \cdot 10^{-18} \lor \neg \left(t \leq 1.2\right):\\
\;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot z\right) + \left(x + y \cdot z\right)\\
\end{array}
\]
Alternative 10 Error 19.7 Cost 848
\[\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := x + t \cdot a\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{-18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-299}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-245}:\\
\;\;\;\;x + a \cdot \left(b \cdot z\right)\\
\mathbf{elif}\;t \leq 20:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 11 Error 13.5 Cost 841
\[\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-31} \lor \neg \left(y \leq 1.45 \cdot 10^{+52}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\end{array}
\]
Alternative 12 Error 9.6 Cost 841
\[\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{-12} \lor \neg \left(b \leq 3.8 \cdot 10^{+175}\right):\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\
\end{array}
\]
Alternative 13 Error 38.4 Cost 588
\[\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-50}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 2.85 \cdot 10^{+116}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+189}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 14 Error 19.6 Cost 585
\[\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-18} \lor \neg \left(t \leq 27.5\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\]
Alternative 15 Error 40.0 Cost 64
\[x
\]