Math FPCore C Julia Wolfram TeX \[\left(x \cdot y + z \cdot t\right) + a \cdot b
\]
↓
\[\mathsf{fma}\left(x, y, z \cdot t\right) + a \cdot b
\]
(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 (* z t)) (* a b))) 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, (z * t)) + (a * b);
}
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 Float64(fma(x, y, Float64(z * t)) + Float64(a * b))
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[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + z \cdot t\right) + a \cdot b
↓
\mathsf{fma}\left(x, y, z \cdot t\right) + a \cdot b
Alternatives Alternative 1 Error 22.6 Cost 3053
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+20} \lor \neg \left(a \cdot b \leq -6.4 \cdot 10^{-43}\right) \land \left(a \cdot b \leq -3.2 \cdot 10^{-144} \lor \neg \left(a \cdot b \leq -5.8 \cdot 10^{-186} \lor \neg \left(a \cdot b \leq -5 \cdot 10^{-324}\right) \land \left(a \cdot b \leq 0 \lor \neg \left(a \cdot b \leq 1.85 \cdot 10^{-143}\right) \land \left(a \cdot b \leq 1.25 \cdot 10^{-81} \lor \neg \left(a \cdot b \leq 1.1 \cdot 10^{-6}\right) \land a \cdot b \leq 5.8 \cdot 10^{+20}\right)\right)\right)\right):\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\]
Alternative 2 Error 29.7 Cost 1752
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.95 \cdot 10^{+21}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.18 \cdot 10^{-222}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-324}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 7.5 \cdot 10^{-200}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.26 \cdot 10^{-154}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.7 \cdot 10^{+42}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 3 Error 15.6 Cost 978
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{-28} \lor \neg \left(t \leq 8 \cdot 10^{-145} \lor \neg \left(t \leq 9 \cdot 10^{-64}\right) \land t \leq 2.3 \cdot 10^{+134}\right):\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\]
Alternative 4 Error 9.1 Cost 968
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{-5}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.3 \cdot 10^{+24}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\]
Alternative 5 Error 30.3 Cost 712
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.9 \cdot 10^{+39}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 5.4 \cdot 10^{+57}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 6 Error 0.0 Cost 704
\[a \cdot b + \left(x \cdot y + z \cdot t\right)
\]
Alternative 7 Error 41.3 Cost 192
\[a \cdot b
\]