Math FPCore C Julia Wolfram TeX \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\]
↓
\[\left(\mathsf{fma}\left(z, t, x \cdot y\right) + a \cdot b\right) + c \cdot i
\]
(FPCore (x y z t a b c i)
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i))) ↓
(FPCore (x y z t a b c i)
:precision binary64
(+ (+ (fma z t (* x y)) (* a b)) (* c i))) double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
↓
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (fma(z, t, (x * y)) + (a * b)) + (c * i);
}
function code(x, y, z, t, a, b, c, i)
return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i))
end
↓
function code(x, y, z, t, a, b, c, i)
return Float64(Float64(fma(z, t, Float64(x * y)) + Float64(a * b)) + Float64(c * i))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(z * t + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
↓
\left(\mathsf{fma}\left(z, t, x \cdot y\right) + a \cdot b\right) + c \cdot i
Alternatives Alternative 1 Error 22.6 Cost 2528
\[\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := x \cdot y + z \cdot t\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -4.9 \cdot 10^{+44}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq -1.05 \cdot 10^{-62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 1.55 \cdot 10^{-83}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 4.5 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 1.9 \cdot 10^{-18}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2.2 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 3.95 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 1.14 \cdot 10^{+220}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
Alternative 2 Error 38.3 Cost 2272
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{+44}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -2.2 \cdot 10^{-18}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -2.4 \cdot 10^{-128}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -7.6 \cdot 10^{-238}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 9.5 \cdot 10^{-182}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3.4 \cdot 10^{-127}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.1 \cdot 10^{-86}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.08 \cdot 10^{+114}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 3 Error 22.6 Cost 2269
\[\begin{array}{l}
t_1 := c \cdot i + x \cdot y\\
t_2 := a \cdot b + x \cdot y\\
t_3 := c \cdot i + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -4.8 \cdot 10^{+45}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -1.95 \cdot 10^{-8}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -1.38 \cdot 10^{-127}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq -4.2 \cdot 10^{-205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 1.12 \cdot 10^{-82}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 7.2 \cdot 10^{-37} \lor \neg \left(a \cdot b \leq 215\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 10.2 Cost 1746
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.5 \cdot 10^{+16} \lor \neg \left(c \cdot i \leq 3100000000 \lor \neg \left(c \cdot i \leq 3.3 \cdot 10^{+68}\right) \land c \cdot i \leq 9 \cdot 10^{+119}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\]
Alternative 5 Error 27.7 Cost 1372
\[\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
t_3 := a \cdot b + x \cdot y\\
\mathbf{if}\;i \leq -2.5 \cdot 10^{-127}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq 6.8 \cdot 10^{-194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 9 \cdot 10^{-147}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;i \leq 1.28 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 3.8 \cdot 10^{+115}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;i \leq 6.2 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 3.3 \cdot 10^{+164}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 6 Error 37.3 Cost 1232
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.6 \cdot 10^{+15}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -8.8 \cdot 10^{-147}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq -3.05 \cdot 10^{-267}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 1.4 \cdot 10^{-17}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\]
Alternative 7 Error 22.7 Cost 1229
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.6 \cdot 10^{+45}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -3.4 \cdot 10^{-13} \lor \neg \left(a \cdot b \leq 2.15 \cdot 10^{-83}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\]
Alternative 8 Error 6.7 Cost 1225
\[\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -2.9 \cdot 10^{-56} \lor \neg \left(a \cdot b \leq 5.8 \cdot 10^{+54}\right):\\
\;\;\;\;a \cdot b + t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t_1\\
\end{array}
\]
Alternative 9 Error 21.8 Cost 969
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.3 \cdot 10^{+15} \lor \neg \left(c \cdot i \leq 1450000000\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\]
Alternative 10 Error 0.0 Cost 960
\[c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)
\]
Alternative 11 Error 38.0 Cost 712
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3 \cdot 10^{-56}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 5.6 \cdot 10^{+56}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 12 Error 33.0 Cost 712
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+144}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-125}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\]
Alternative 13 Error 46.9 Cost 192
\[a \cdot b
\]