Math FPCore C Julia Wolfram TeX \[\left(x \cdot y + z \cdot t\right) + a \cdot b
\]
↓
\[\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\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 z t (fma x y (* 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(z, t, fma(x, y, (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 fma(z, t, fma(x, y, 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[(z * t + N[(x * y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + z \cdot t\right) + a \cdot b
↓
\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)
Alternatives Alternative 1 Error 35.8 Cost 984
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.0201145473395068 \cdot 10^{+24}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;z \leq -1.200758376922514 \cdot 10^{-10}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;z \leq -5.361178057740946 \cdot 10^{-171}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;z \leq -1.4819277209410694 \cdot 10^{-258}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;z \leq 3.356917097551678 \cdot 10^{-239}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;z \leq 6.408032260502808 \cdot 10^{-132}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\]
Alternative 2 Error 23.4 Cost 976
\[\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;z \leq -3.815971493270716 \cdot 10^{-181}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.4819277209410694 \cdot 10^{-258}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;z \leq 3.356917097551678 \cdot 10^{-239}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.5565521991916636 \cdot 10^{-135}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 3 Error 9.5 Cost 968
\[\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -184983751208433.6:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 3.646899597085883 \cdot 10^{-32}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 31.2 Cost 712
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.235730224231274 \cdot 10^{-78}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 5.377245207412535 \cdot 10^{+27}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 5 Error 0.0 Cost 704
\[a \cdot b + \left(z \cdot t + x \cdot y\right)
\]
Alternative 6 Error 42.1 Cost 192
\[a \cdot b
\]