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}\;a \leq -5 \cdot 10^{-35} \lor \neg \left(a \leq 10^{-11}\right):\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\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 (<= a -5e-35) (not (<= a 1e-11)))
(fma a (+ t (* z b)) (fma y z x))
(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 ((a <= -5e-35) || !(a <= 1e-11)) {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
} 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 ((a <= -5e-35) || !(a <= 1e-11))
tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x));
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[a, -5e-35], N[Not[LessEqual[a, 1e-11]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $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}\;a \leq -5 \cdot 10^{-35} \lor \neg \left(a \leq 10^{-11}\right):\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\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 0.4 Cost 13640
\[\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;a \leq -3 \cdot 10^{+125}:\\
\;\;\;\;t_1 + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-7}:\\
\;\;\;\;b \cdot \left(a \cdot z\right) + \left(t_1 + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
\]
Alternative 2 Error 35.3 Cost 1776
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+149}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{+78}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{+19}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-72}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-144}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-184}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-268}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-261}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-234}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-207}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-155}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+82}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 3 Error 35.4 Cost 1776
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+149}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{+78}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{+19}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4.7 \cdot 10^{-69}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-147}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-194}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -4.7 \cdot 10^{-269}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-260}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-235}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-206}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-152}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+82}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 4 Error 22.0 Cost 1504
\[\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
t_2 := x + a \cdot t\\
t_3 := a \cdot t + z \cdot y\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{+149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.76 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-67}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-263}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-7}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+61}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+131}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 5 Error 35.1 Cost 1380
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+149}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.76 \cdot 10^{+78}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{+19}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-69}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -9.8 \cdot 10^{-144}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -4.3 \cdot 10^{-184}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-267}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-154}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+82}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 6 Error 2.4 Cost 1225
\[\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-235} \lor \neg \left(a \leq 1.12 \cdot 10^{-253}\right):\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\]
Alternative 7 Error 0.4 Cost 1225
\[\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;a \leq -1 \cdot 10^{+125} \lor \neg \left(a \leq 0.002\right):\\
\;\;\;\;t_1 + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot z\right) + \left(t_1 + a \cdot t\right)\\
\end{array}
\]
Alternative 8 Error 19.3 Cost 1109
\[\begin{array}{l}
t_1 := x + z \cdot y\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+73}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.85 \cdot 10^{-99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-62}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;z \leq 2450000000000 \lor \neg \left(z \leq 1.4 \cdot 10^{+140}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 9 Error 19.8 Cost 1108
\[\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -9.4 \cdot 10^{+169}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-118}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 520000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{+189}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 10 Error 14.0 Cost 1106
\[\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+112} \lor \neg \left(t \leq -4 \cdot 10^{+49}\right) \land \left(t \leq -1.9 \cdot 10^{-10} \lor \neg \left(t \leq 0.048\right)\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\]
Alternative 11 Error 7.4 Cost 969
\[\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-110} \lor \neg \left(t \leq 7.2 \cdot 10^{-117}\right):\\
\;\;\;\;t_1 + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1 + a \cdot \left(z \cdot b\right)\\
\end{array}
\]
Alternative 12 Error 7.8 Cost 841
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-109} \lor \neg \left(t \leq 7.8 \cdot 10^{-117}\right):\\
\;\;\;\;\left(x + z \cdot y\right) + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\]
Alternative 13 Error 35.2 Cost 720
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+149}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{+78}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-68}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+82}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 14 Error 26.5 Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+24} \lor \neg \left(y \leq 8 \cdot 10^{+79}\right):\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\]
Alternative 15 Error 19.9 Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -15600000000 \lor \neg \left(y \leq 8 \cdot 10^{+68}\right):\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\]
Alternative 16 Error 39.9 Cost 64
\[x
\]