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^{-6} \lor \neg \left(b \leq 1.4 \cdot 10^{+40}\right):\\
\;\;\;\;b \cdot \left(z \cdot a\right) + \left(\left(x + y \cdot z\right) + t \cdot a\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 (<= b -5e-6) (not (<= b 1.4e+40)))
(+ (* b (* z a)) (+ (+ x (* y z)) (* t a)))
(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 ((b <= -5e-6) || !(b <= 1.4e+40)) {
tmp = (b * (z * a)) + ((x + (y * z)) + (t * a));
} 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 ((b <= -5e-6) || !(b <= 1.4e+40))
tmp = Float64(Float64(b * Float64(z * a)) + Float64(Float64(x + Float64(y * z)) + Float64(t * a)));
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[b, -5e-6], N[Not[LessEqual[b, 1.4e+40]], $MachinePrecision]], N[(N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision] + N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $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}\;b \leq -5 \cdot 10^{-6} \lor \neg \left(b \leq 1.4 \cdot 10^{+40}\right):\\
\;\;\;\;b \cdot \left(z \cdot a\right) + \left(\left(x + y \cdot z\right) + t \cdot a\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 2.5 Cost 1092
\[\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;x \leq -5 \cdot 10^{-83}:\\
\;\;\;\;b \cdot \left(z \cdot a\right) + \left(t_1 + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(a \cdot \left(b \cdot z\right) + t \cdot a\right)\\
\end{array}
\]
Alternative 2 Error 36.4 Cost 984
\[\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+171}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-154}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-216}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-119}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-8}:\\
\;\;\;\;a \cdot \left(b \cdot z\right)\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+38}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 3 Error 19.4 Cost 976
\[\begin{array}{l}
t_1 := t \cdot a + y \cdot z\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+34}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-8}:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\]
Alternative 4 Error 18.8 Cost 976
\[\begin{array}{l}
t_1 := t \cdot a + y \cdot z\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{+38}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;x \leq 3.45 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-8}:\\
\;\;\;\;b \cdot \left(z \cdot a\right) + y \cdot z\\
\mathbf{elif}\;x \leq 14600000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\]
Alternative 5 Error 2.7 Cost 960
\[\left(x + y \cdot z\right) + \left(a \cdot \left(b \cdot z\right) + t \cdot a\right)
\]
Alternative 6 Error 11.6 Cost 841
\[\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-129} \lor \neg \left(t \leq -5.6 \cdot 10^{-189}\right):\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(z \cdot a\right)\\
\end{array}
\]
Alternative 7 Error 35.5 Cost 588
\[\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+171}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.95 \cdot 10^{-148}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+37}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 8 Error 19.7 Cost 585
\[\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{-25} \lor \neg \left(a \leq 1.4 \cdot 10^{-70}\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\]
Alternative 9 Error 20.1 Cost 584
\[\begin{array}{l}
\mathbf{if}\;a \leq -75:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-70}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\]
Alternative 10 Error 33.2 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+41}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 10^{+36}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 11 Error 25.1 Cost 452
\[\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{+127}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\]
Alternative 12 Error 40.2 Cost 64
\[x
\]