\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\]
Simplified100.0%
\[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)}
\]
Proof
[Start]100.0
\[ \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\]
+-commutative [=>]100.0
\[ \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)}
\]
fma-def [=>]100.0
\[ \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)}
\]
associate-+l+ [=>]100.0
\[ \mathsf{fma}\left(c, i, \color{blue}{x \cdot y + \left(z \cdot t + a \cdot b\right)}\right)
\]
fma-def [=>]100.0
\[ \mathsf{fma}\left(c, i, \color{blue}{\mathsf{fma}\left(x, y, z \cdot t + a \cdot b\right)}\right)
\]
fma-def [=>]100.0
\[ \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)}\right)\right)
\]
Final simplification100.0%
\[\leadsto \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\]
Alternatives
Alternative 1
Accuracy
100.0%
Cost
7232
\[\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)
\]
Alternative 2
Accuracy
64.8%
Cost
2268
\[\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;c \cdot i \leq -7.4 \cdot 10^{-60}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -3.2 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -8.5 \cdot 10^{-121}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq -7.2 \cdot 10^{-133}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -2.15 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 6 \cdot 10^{-229}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 85000000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\]
\[\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + x \cdot y\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+32}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 3.5 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 3 \cdot 10^{-42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 4.1 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 8 \cdot 10^{+99}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
Alternative 6
Accuracy
65.8%
Cost
1748
\[\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -5.8 \cdot 10^{+32}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -1.3 \cdot 10^{-213}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 3 \cdot 10^{-26}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 3.4 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 10^{+101}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 7
Accuracy
84.3%
Cost
1488
\[\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -3.9 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 1.8 \cdot 10^{+42}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \cdot i \leq 8 \cdot 10^{+135}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 5.7 \cdot 10^{+164}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
herbie shell --seed 2023151
(FPCore (x y z t a b c i)
:name "Linear.V4:$cdot from linear-1.19.1.3, C"
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))