Math FPCore C Julia Wolfram TeX \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\]
↓
\[\mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, z \cdot t\right)\right)\right)
\]
(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 x y (fma c i (fma a b (* z t))))) 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(x, y, fma(c, i, fma(a, b, (z * t))));
}
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 fma(x, y, fma(c, i, fma(a, b, Float64(z * t))))
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[(x * y + N[(c * i + N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
↓
\mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, z \cdot t\right)\right)\right)
Alternatives Alternative 1 Error 0.0 Cost 7232
\[\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)
\]
Alternative 2 Error 21.3 Cost 2788
\[\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := a \cdot b + x \cdot y\\
t_3 := c \cdot i + z \cdot t\\
t_4 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -3 \cdot 10^{+39}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \cdot i \leq -1.24 \cdot 10^{-119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 1.95 \cdot 10^{-171}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;c \cdot i \leq 1.9 \cdot 10^{-137}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 3.6 \cdot 10^{-39}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;c \cdot i \leq 4500:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 4.3 \cdot 10^{+39}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \cdot i \leq 1.22 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 1.65 \cdot 10^{+179}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\]
Alternative 3 Error 17.9 Cost 2026
\[\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
t_3 := c \cdot i + x \cdot y\\
t_4 := a \cdot b + t_3\\
\mathbf{if}\;b \leq -3.25 \cdot 10^{-223}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \leq -1.9 \cdot 10^{-277}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -8.2 \cdot 10^{-308}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \leq 8.3 \cdot 10^{-255}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-182}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{-135}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-41} \lor \neg \left(b \leq 2.6 \cdot 10^{-8} \lor \neg \left(b \leq 6 \cdot 10^{+94}\right) \land b \leq 3.2 \cdot 10^{+124}\right):\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 27.0 Cost 1900
\[\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := c \cdot i + z \cdot t\\
t_3 := a \cdot b + z \cdot t\\
t_4 := c \cdot i + x \cdot y\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+106}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{+101}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -5 \cdot 10^{+92}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{+41}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -3050000000:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-9}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-36}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-71}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.86 \cdot 10^{-106}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.46 \cdot 10^{-180}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 22.0 Cost 1490
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3 \cdot 10^{+39} \lor \neg \left(c \cdot i \leq 190 \lor \neg \left(c \cdot i \leq 8.5 \cdot 10^{+38}\right) \land c \cdot i \leq 7 \cdot 10^{+67}\right):\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\]
Alternative 6 Error 38.7 Cost 1232
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6.2 \cdot 10^{+45}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 3.05 \cdot 10^{-207}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.25 \cdot 10^{-129}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.8 \cdot 10^{-65}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\]
Alternative 7 Error 36.7 Cost 1232
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5.5 \cdot 10^{+42}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 7.2 \cdot 10^{-172}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 1.95 \cdot 10^{-137}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 1.4 \cdot 10^{+25}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\]
Alternative 8 Error 7.3 Cost 1224
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+70}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 3.5 \cdot 10^{+28}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\right)\\
\end{array}
\]
Alternative 9 Error 6.0 Cost 1224
\[\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -2.55 \cdot 10^{+33}:\\
\;\;\;\;c \cdot i + t_1\\
\mathbf{elif}\;c \cdot i \leq 1.6 \cdot 10^{+28}:\\
\;\;\;\;a \cdot b + t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\right)\\
\end{array}
\]
Alternative 10 Error 6.2 Cost 1224
\[\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.12 \cdot 10^{+36}:\\
\;\;\;\;c \cdot i + t_1\\
\mathbf{elif}\;c \cdot i \leq 1.8 \cdot 10^{+23}:\\
\;\;\;\;a \cdot b + t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot t + \left(a \cdot b + c \cdot i\right)\\
\end{array}
\]
Alternative 11 Error 24.4 Cost 969
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4.6 \cdot 10^{+61} \lor \neg \left(c \cdot i \leq 1.2 \cdot 10^{+67}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\]
Alternative 12 Error 21.7 Cost 969
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -7.6 \cdot 10^{+41} \lor \neg \left(c \cdot i \leq 2.75 \cdot 10^{+26}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\]
Alternative 13 Error 0.0 Cost 960
\[c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)
\]
Alternative 14 Error 37.7 Cost 712
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.1 \cdot 10^{+64}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 170:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\]
Alternative 15 Error 47.8 Cost 192
\[a \cdot b
\]