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 -2 \cdot 10^{+54} \lor \neg \left(b \leq 5 \cdot 10^{-62}\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}
\]
(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 -2e+54) (not (<= b 5e-62)))
(+ (+ (* t a) (+ x (* y z))) (* b (* z a)))
(fma a (+ t (* b z)) (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 <= -2e+54) || !(b <= 5e-62)) {
tmp = ((t * a) + (x + (y * z))) + (b * (z * a));
} else {
tmp = fma(a, (t + (b * z)), 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 <= -2e+54) || !(b <= 5e-62))
tmp = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(b * Float64(z * a)));
else
tmp = fma(a, Float64(t + Float64(b * z)), 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, -2e+54], N[Not[LessEqual[b, 5e-62]], $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[(t + N[(b * z), $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 -2 \cdot 10^{+54} \lor \neg \left(b \leq 5 \cdot 10^{-62}\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}
Alternatives Alternative 1 Error 69.71% Cost 1904
\[\begin{array}{l}
t_1 := a \cdot \left(b \cdot z\right)\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{+249}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq -1.9 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -5.5 \cdot 10^{+109}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq -9.2 \cdot 10^{+76}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq -1.5 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq -3.6 \cdot 10^{-191}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq -1.4 \cdot 10^{-269}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq -1.75 \cdot 10^{-300}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{-232}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{-136}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+51}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.65 \cdot 10^{+260}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 2 Error 62.75% Cost 1380
\[\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+126}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{+17}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-47}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-57}:\\
\;\;\;\;a \cdot \left(b \cdot z\right)\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-172}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{-301}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-277}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-222}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 13000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\]
Alternative 3 Error 32.88% Cost 1372
\[\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := x + y \cdot z\\
\mathbf{if}\;a \leq -3.6 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{-36}:\\
\;\;\;\;z \cdot \left(y + b \cdot a\right)\\
\mathbf{elif}\;a \leq -3.2 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-85}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-43}:\\
\;\;\;\;x + b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\end{array}
\]
Alternative 4 Error 62.46% Cost 1248
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+127}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{+17}:\\
\;\;\;\;z \cdot \left(b \cdot a\right)\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-69}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-175}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-302}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-278}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-222}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 300000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\]
Alternative 5 Error 34.41% Cost 1113
\[\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -3.35 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.1 \cdot 10^{-35}:\\
\;\;\;\;z \cdot \left(y + b \cdot a\right)\\
\mathbf{elif}\;a \leq -1.85 \cdot 10^{-86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{+47}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+174} \lor \neg \left(a \leq 4.3 \cdot 10^{+271}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot z\right)\\
\end{array}
\]
Alternative 6 Error 32.68% Cost 1108
\[\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -8.3 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-36}:\\
\;\;\;\;z \cdot \left(y + b \cdot a\right)\\
\mathbf{elif}\;a \leq -1.35 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{+46}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+172}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\end{array}
\]
Alternative 7 Error 24.86% Cost 1105
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-16}:\\
\;\;\;\;z \cdot \left(y + b \cdot a\right)\\
\mathbf{elif}\;z \leq 290 \lor \neg \left(z \leq 8.5 \cdot 10^{+98}\right) \land z \leq 3 \cdot 10^{+189}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\]
Alternative 8 Error 42.2% Cost 981
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+128}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -7 \cdot 10^{+15}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-16} \lor \neg \left(z \leq 300000000\right) \land z \leq 1.9 \cdot 10^{+87}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\]
Alternative 9 Error 4.45% Cost 960
\[\left(a \cdot \left(b \cdot z\right) + t \cdot a\right) + \left(x + y \cdot z\right)
\]
Alternative 10 Error 3.06% Cost 960
\[\left(t \cdot a + \left(x + y \cdot z\right)\right) + b \cdot \left(z \cdot a\right)
\]
Alternative 11 Error 32.79% Cost 849
\[\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -3 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.05 \cdot 10^{+46}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+174} \lor \neg \left(a \leq 1.65 \cdot 10^{+271}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot z\right)\\
\end{array}
\]
Alternative 12 Error 15.3% Cost 840
\[\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{+45}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{elif}\;b \leq 1.32 \cdot 10^{+92}:\\
\;\;\;\;t \cdot a + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(z \cdot a\right)\\
\end{array}
\]
Alternative 13 Error 15.25% Cost 840
\[\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+45}:\\
\;\;\;\;a \cdot \left(b \cdot z\right) + \left(x + t \cdot a\right)\\
\mathbf{elif}\;b \leq 3.15 \cdot 10^{+94}:\\
\;\;\;\;t \cdot a + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(z \cdot a\right)\\
\end{array}
\]
Alternative 14 Error 51.7% Cost 588
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-175}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+36}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 15 Error 51.27% Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-9}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 16 Error 62.02% Cost 64
\[x
\]