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.7 \cdot 10^{+121} \lor \neg \left(b \leq 2 \cdot 10^{-185}\right):\\
\;\;\;\;\left(t \cdot a + \left(x + y \cdot z\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot z, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\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 -1.7e+121) (not (<= b 2e-185)))
(+ (+ (* t a) (+ x (* y z))) (* b (* z a)))
(fma a (* b z) (fma t a (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 <= -1.7e+121) || !(b <= 2e-185)) {
tmp = ((t * a) + (x + (y * z))) + (b * (z * a));
} else {
tmp = fma(a, (b * z), fma(t, a, 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 <= -1.7e+121) || !(b <= 2e-185))
tmp = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(b * Float64(z * a)));
else
tmp = fma(a, Float64(b * z), fma(t, a, 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, -1.7e+121], N[Not[LessEqual[b, 2e-185]], $MachinePrecision]], N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * z), $MachinePrecision] + N[(t * a + N[(y * z + x), $MachinePrecision]), $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.7 \cdot 10^{+121} \lor \neg \left(b \leq 2 \cdot 10^{-185}\right):\\
\;\;\;\;\left(t \cdot a + \left(x + y \cdot z\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot z, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 0.98% Cost 13641
\[\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{+54} \lor \neg \left(b \leq 2 \cdot 10^{-186}\right):\\
\;\;\;\;\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 31.99% Cost 1373
\[\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := z \cdot \left(y + b \cdot a\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+147}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-213}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-30}:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+96} \lor \neg \left(z \leq 1.55 \cdot 10^{+144}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 3 Error 53.36% Cost 1248
\[\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-18}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-202}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-145}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-66}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+65}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 4 Error 17.96% Cost 1237
\[\begin{array}{l}
t_1 := \left(x + t \cdot a\right) + y \cdot z\\
t_2 := z \cdot \left(y + b \cdot a\right)\\
\mathbf{if}\;z \leq -1.08 \cdot 10^{+147}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-91}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-240}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+96} \lor \neg \left(z \leq 5.8 \cdot 10^{+127}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 5 Error 26.13% Cost 1236
\[\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := x + a \cdot \left(t + b \cdot z\right)\\
t_3 := z \cdot \left(y + b \cdot a\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+146}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-91}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-158}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+52}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
Alternative 6 Error 1.05% Cost 1225
\[\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;b \leq -4 \cdot 10^{-80} \lor \neg \left(b \leq 2 \cdot 10^{-186}\right):\\
\;\;\;\;\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 7 Error 43% Cost 1115
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.22 \cdot 10^{-150} \lor \neg \left(x \leq 8.8 \cdot 10^{-213}\right) \land \left(x \leq 4.7 \cdot 10^{-150} \lor \neg \left(x \leq 1.62 \cdot 10^{-77}\right) \land \left(x \leq 1.22 \cdot 10^{-10} \lor \neg \left(x \leq 3.8 \cdot 10^{+65}\right)\right)\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\]
Alternative 8 Error 31.63% Cost 1109
\[\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := z \cdot \left(y + b \cdot a\right)\\
\mathbf{if}\;z \leq -6.1 \cdot 10^{+144}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-213}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+96} \lor \neg \left(z \leq 1.5 \cdot 10^{+143}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 9 Error 14.1% Cost 1105
\[\begin{array}{l}
t_1 := a \cdot \left(t + b \cdot z\right)\\
t_2 := \left(x + t \cdot a\right) + y \cdot z\\
\mathbf{if}\;y \leq -4.7 \cdot 10^{-59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-114}:\\
\;\;\;\;t_1 + y \cdot z\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-149} \lor \neg \left(y \leq 10^{-176}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\]
Alternative 10 Error 12.76% Cost 1100
\[\begin{array}{l}
t_1 := \left(x + t \cdot a\right) + y \cdot z\\
\mathbf{if}\;y \leq -9.4 \cdot 10^{-58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-114}:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right) + y \cdot z\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-62}:\\
\;\;\;\;t \cdot a + \left(x + b \cdot \left(z \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 11 Error 4.92% Cost 960
\[\left(a \cdot \left(b \cdot z\right) + t \cdot a\right) + \left(x + y \cdot z\right)
\]
Alternative 12 Error 32.19% Cost 585
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-131} \lor \neg \left(z \leq 3.4 \cdot 10^{-213}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\]
Alternative 13 Error 52.22% Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.18 \cdot 10^{-36}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 14 Error 62.56% Cost 64
\[x
\]