Math FPCore C Julia Wolfram TeX \[\left(x \cdot y + z \cdot t\right) + a \cdot b
\]
↓
\[\mathsf{fma}\left(a, b, \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 a b (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(a, b, 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(a, b, 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[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + z \cdot t\right) + a \cdot b
↓
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)
Alternatives Alternative 1 Error 0.0 Cost 6976
\[\mathsf{fma}\left(x, y, z \cdot t\right) + a \cdot b
\]
Alternative 2 Error 30.5 Cost 2272
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8.5 \cdot 10^{+29}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -3.9 \cdot 10^{-59}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -1.85 \cdot 10^{-68}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.8 \cdot 10^{-95}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -7.2 \cdot 10^{-161}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 4.4 \cdot 10^{-306}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 7.1 \cdot 10^{-248}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.9 \cdot 10^{-58}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 3 Error 20.8 Cost 976
\[\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+149}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{+61}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\]
Alternative 4 Error 9.7 Cost 968
\[\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -13:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 2.7 \cdot 10^{-60}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 30.7 Cost 712
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.45 \cdot 10^{+30}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 8.5 \cdot 10^{-53}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 6 Error 14.0 Cost 712
\[\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{-80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 21.5:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 7 Error 0.0 Cost 704
\[a \cdot b + \left(z \cdot t + x \cdot y\right)
\]
Alternative 8 Error 41.6 Cost 192
\[a \cdot b
\]