\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\begin{array}{l}
\mathbf{if}\;a \cdot a \leq 4.456330607025755 \cdot 10^{-21}:\\
\;\;\;\;\left(\left({b}^{4} + 2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)\right) + \left(b \cdot b\right) \cdot 4\right) - 1\\
\mathbf{else}:\\
\;\;\;\;\left({a}^{4} + \left({b}^{4} + \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right) \cdot 2\right)\right) - 1\\
\end{array}(FPCore (a b) :precision binary64 (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0))
(FPCore (a b) :precision binary64 (if (<= (* a a) 4.456330607025755e-21) (- (+ (+ (pow b 4.0) (* 2.0 (* (* a a) (* b b)))) (* (* b b) 4.0)) 1.0) (- (+ (pow a 4.0) (+ (pow b 4.0) (* (* (* a a) (* b b)) 2.0))) 1.0)))
double code(double a, double b) {
return ((double) (((double) (((double) pow(((double) (((double) (a * a)) + ((double) (b * b)))), 2.0)) + ((double) (4.0 * ((double) (b * b)))))) - 1.0));
}
double code(double a, double b) {
double tmp;
if ((((double) (a * a)) <= 4.456330607025755e-21)) {
tmp = ((double) (((double) (((double) (((double) pow(b, 4.0)) + ((double) (2.0 * ((double) (((double) (a * a)) * ((double) (b * b)))))))) + ((double) (((double) (b * b)) * 4.0)))) - 1.0));
} else {
tmp = ((double) (((double) (((double) pow(a, 4.0)) + ((double) (((double) pow(b, 4.0)) + ((double) (((double) (((double) (a * a)) * ((double) (b * b)))) * 2.0)))))) - 1.0));
}
return tmp;
}



Bits error versus a



Bits error versus b
Results
if (*.f64 a a) < 4.4563306070257551e-21Initial program 0.1
Taylor expanded around 0 0.0
Simplified0.0
if 4.4563306070257551e-21 < (*.f64 a a) Initial program 0.5
Taylor expanded around inf 0.1
Simplified0.1
Final simplification0.0
herbie shell --seed 2020210
(FPCore (a b)
:name "Bouland and Aaronson, Equation (26)"
:precision binary64
(- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0))