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 -5 \cdot 10^{-111} \lor \neg \left(b \leq 2 \cdot 10^{-164}\right):\\
\;\;\;\;\left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\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 (<= b -5e-111) (not (<= b 2e-164)))
(+ (+ (* t a) (+ x (* y z))) (* (* z a) b))
(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 ((b <= -5e-111) || !(b <= 2e-164)) {
tmp = ((t * a) + (x + (y * z))) + ((z * a) * b);
} 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 ((b <= -5e-111) || !(b <= 2e-164))
tmp = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b));
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[b, -5e-111], N[Not[LessEqual[b, 2e-164]], $MachinePrecision]], N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $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}\;b \leq -5 \cdot 10^{-111} \lor \neg \left(b \leq 2 \cdot 10^{-164}\right):\\
\;\;\;\;\left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\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.4 Cost 21704
\[\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := \left(t \cdot a + t_1\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + t_1\\
\mathbf{elif}\;t_2 \leq 10^{+284}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\end{array}
\]
Alternative 2 Error 22.2 Cost 1772
\[\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := x + z \cdot \left(a \cdot b\right)\\
t_3 := x + y \cdot z\\
t_4 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+146}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-6}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{-24}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y \leq -2.65 \cdot 10^{-61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-224}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-298}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-296}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-238}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-157}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
Alternative 3 Error 20.8 Cost 1241
\[\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -8 \cdot 10^{+143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -2.75 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-156}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-77} \lor \neg \left(a \leq 1.46 \cdot 10^{-15}\right) \land a \leq 70000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 4 Error 0.6 Cost 1225
\[\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;b \leq -2 \cdot 10^{+31} \lor \neg \left(b \leq 10^{-161}\right):\\
\;\;\;\;\left(t \cdot a + t_1\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + t_1\\
\end{array}
\]
Alternative 5 Error 22.0 Cost 1113
\[\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+141}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{+61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+54} \lor \neg \left(z \leq -2.1 \cdot 10^{-96}\right) \land z \leq 5.1 \cdot 10^{-92}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 6 Error 2.2 Cost 1092
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+132}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right)\\
\end{array}
\]
Alternative 7 Error 33.4 Cost 984
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{+64}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-14}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-214}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-265}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-224}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-22}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 8 Error 33.4 Cost 984
\[\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+64}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-19}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-214}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -9.1 \cdot 10^{-265}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-224}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-21}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 9 Error 9.1 Cost 968
\[\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;x \leq -14500000000:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{-48}:\\
\;\;\;\;t_1 + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\
\end{array}
\]
Alternative 10 Error 32.7 Cost 852
\[\begin{array}{l}
\mathbf{if}\;x \leq -35000000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-214}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -9.1 \cdot 10^{-265}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 10^{-224}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-19}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 11 Error 19.0 Cost 844
\[\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+65}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-11}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-27}:\\
\;\;\;\;t \cdot a + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\]
Alternative 12 Error 11.7 Cost 841
\[\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-156} \lor \neg \left(a \leq 1.06 \cdot 10^{-82}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\]
Alternative 13 Error 8.4 Cost 841
\[\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{+127} \lor \neg \left(a \leq 3.5 \cdot 10^{-85}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\
\end{array}
\]
Alternative 14 Error 7.6 Cost 841
\[\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-53} \lor \neg \left(t \leq 4.6 \cdot 10^{-59}\right):\\
\;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\]
Alternative 15 Error 19.8 Cost 717
\[\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+60}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-97} \lor \neg \left(z \leq 1.18 \cdot 10^{-89}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\]
Alternative 16 Error 26.2 Cost 584
\[\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+125}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-16}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\]
Alternative 17 Error 32.7 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -26000000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-80}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 18 Error 39.4 Cost 64
\[x
\]