\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
↓
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, a, b \cdot b\right)\\
\mathsf{fma}\left(t_0, t_0, 4 \cdot \left(b \cdot b\right)\right) - 1
\end{array}
Error
Derivation
Initial program 0.2
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\]
Applied egg-rr0.2
\[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), 4 \cdot \left(b \cdot b\right)\right)} - 1
\]
Alternatives
Alternative 1
Error
0.2
Cost
19968
\[{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \mathsf{fma}\left(4 \cdot b, b, -1\right)
\]
herbie shell --seed 2023010
(FPCore (a b)
:name "Bouland and Aaronson, Equation (26)"
:precision binary64
(- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0))