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 -3 \cdot 10^{+118} \lor \neg \left(z \leq 4 \cdot 10^{-77}\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(a, t + z \cdot b, \mathsf{fma}\left(y, z, 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 -3e+118) (not (<= z 4e-77)))
(fma z (fma a b y) (fma t a x))
(fma a (+ t (* z b)) (fma y z 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 <= -3e+118) || !(z <= 4e-77)) {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
} else {
tmp = fma(a, (t + (z * b)), fma(y, z, 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 <= -3e+118) || !(z <= 4e-77))
tmp = fma(z, fma(a, b, y), fma(t, a, x));
else
tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, 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, -3e+118], N[Not[LessEqual[z, 4e-77]], $MachinePrecision]], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + 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 -3 \cdot 10^{+118} \lor \neg \left(z \leq 4 \cdot 10^{-77}\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(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 0.3 Cost 13641
\[\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+22} \lor \neg \left(b \leq 10^{-78}\right):\\
\;\;\;\;\left(a \cdot t + \left(x + z \cdot y\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
\]
Alternative 2 Error 20.3 Cost 1504
\[\begin{array}{l}
t_1 := a \cdot t + z \cdot y\\
t_2 := x + a \cdot t\\
t_3 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;x \leq -17500000000:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-90}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -2.06 \cdot 10^{-109}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-207}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;x \leq 1.255 \cdot 10^{-290}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-34}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 3 Error 26.6 Cost 1247
\[\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+108} \lor \neg \left(z \leq -3.5 \cdot 10^{+36}\right) \land \left(z \leq -1.8 \cdot 10^{-63} \lor \neg \left(z \leq 1.7 \cdot 10^{+34}\right) \land \left(z \leq 5.2 \cdot 10^{+64} \lor \neg \left(z \leq 2 \cdot 10^{+128}\right) \land z \leq 1.8 \cdot 10^{+261}\right)\right):\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\]
Alternative 4 Error 21.3 Cost 1241
\[\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+101}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+123} \lor \neg \left(z \leq 4.9 \cdot 10^{+249}\right):\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 5 Error 15.4 Cost 1241
\[\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
t_3 := x + z \cdot y\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+107}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-62}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+123} \lor \neg \left(z \leq 10^{+251}\right):\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 6 Error 2.9 Cost 1225
\[\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-85} \lor \neg \left(a \leq 4 \cdot 10^{-171}\right):\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + \left(x + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\end{array}
\]
Alternative 7 Error 0.3 Cost 1225
\[\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;b \leq -10000000000 \lor \neg \left(b \leq 10^{-78}\right):\\
\;\;\;\;\left(a \cdot t + t_1\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + t_1\\
\end{array}
\]
Alternative 8 Error 8.0 Cost 969
\[\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-48} \lor \neg \left(x \leq 3.5 \cdot 10^{-140}\right):\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot t + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\]
Alternative 9 Error 32.6 Cost 852
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+16}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.02 \cdot 10^{-208}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-293}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-249}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-34}:\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 10 Error 21.0 Cost 850
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+116} \lor \neg \left(y \leq -3.1 \cdot 10^{-37}\right) \land \left(y \leq -7.6 \cdot 10^{-125} \lor \neg \left(y \leq 4.1 \cdot 10^{-26}\right)\right):\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\]
Alternative 11 Error 8.7 Cost 841
\[\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-135} \lor \neg \left(y \leq 3.8 \cdot 10^{-160}\right):\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\]
Alternative 12 Error 32.6 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+16}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+14}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 13 Error 39.7 Cost 64
\[x
\]