Math FPCore C Julia Wolfram TeX \[\left(x \cdot y + z \cdot t\right) + a \cdot b
\]
↓
\[\mathsf{fma}\left(x, y, \mathsf{fma}\left(a, b, 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 x y (fma a b (* 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(x, y, fma(a, b, (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(x, y, fma(a, b, 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[(x * y + N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + z \cdot t\right) + a \cdot b
↓
\mathsf{fma}\left(x, y, \mathsf{fma}\left(a, b, 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 22.4 Cost 1504
\[\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;b \leq -2.020234640387892 \cdot 10^{-231}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -4.450827205969025 \cdot 10^{-268}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;b \leq 2.7715263207150344 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 4.020718972946929 \cdot 10^{-258}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;b \leq 1.2377854063556653 \cdot 10^{-151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.0389466000793845 \cdot 10^{-102}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;b \leq 1.3054603904243763 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 0.42791705817466535:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 3 Error 29.5 Cost 1492
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -0.015427151452313654:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -2.977730114538763 \cdot 10^{-282}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 10^{-322}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.9832583628183144 \cdot 10^{-223}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 3.279320049443658 \cdot 10^{+63}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 4 Error 8.7 Cost 968
\[\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -4868435.0340189105:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 4.697526833461144 \cdot 10^{+54}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 8.7 Cost 968
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4868435.0340189105:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 4.697526833461144 \cdot 10^{+54}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\]
Alternative 6 Error 29.9 Cost 712
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -0.015427151452313654:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 3.527494712121361 \cdot 10^{+66}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 7 Error 0.0 Cost 704
\[a \cdot b + \left(z \cdot t + x \cdot y\right)
\]
Alternative 8 Error 42.1 Cost 192
\[a \cdot b
\]