Math FPCore C Julia Wolfram TeX \[\left(x \cdot y + z \cdot t\right) + a \cdot b
\]
↓
\[\mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)
\]
(FPCore (x y z t a b) :precision binary64 (+ (+ (* x y) (* z t)) (* a b))) ↓
(FPCore (x y z t a b) :precision binary64 (fma b a (fma x y (* z t)))) double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * t)) + (a * b);
}
↓
double code(double x, double y, double z, double t, double a, double b) {
return fma(b, a, fma(x, y, (z * t)));
}
function code(x, y, z, t, a, b)
return Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b))
end
↓
function code(x, y, z, t, a, b)
return fma(b, a, fma(x, y, Float64(z * t)))
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_, a_, b_] := N[(b * a + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + z \cdot t\right) + a \cdot b
↓
\mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)
Alternatives Alternative 1 Error 0.0 Cost 6976
\[\mathsf{fma}\left(z, t, x \cdot y\right) + a \cdot b
\]
Alternative 2 Error 24.4 Cost 1504
\[\begin{array}{l}
t_1 := a \cdot b + t \cdot z\\
\mathbf{if}\;t \leq -1.85 \cdot 10^{+169}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{+119}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;t \leq -2.25 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-110}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;t \leq 5.7 \cdot 10^{-120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-84}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;t \leq 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+86}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 3 Error 30.0 Cost 972
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+23}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -8.6 \cdot 10^{-280}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.25 \cdot 10^{+17}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 4 Error 10.1 Cost 968
\[\begin{array}{l}
t_1 := a \cdot b + t \cdot z\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+41}:\\
\;\;\;\;a \cdot b + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 9.5 Cost 968
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{-45}:\\
\;\;\;\;a \cdot b + t \cdot z\\
\mathbf{elif}\;a \cdot b \leq 3.5 \cdot 10^{-31}:\\
\;\;\;\;y \cdot x + t \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + y \cdot x\\
\end{array}
\]
Alternative 6 Error 30.6 Cost 712
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.1 \cdot 10^{-62}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 1.22 \cdot 10^{+17}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 7 Error 0.0 Cost 704
\[\left(x \cdot y + z \cdot t\right) + a \cdot b
\]
Alternative 8 Error 41.7 Cost 192
\[a \cdot b
\]