Average Error: 0.2 → 0.0
Time: 4.1s
Precision: binary64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\begin{array}{l} \mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right) \le 2.26003463209642231 \cdot 10^{28}:\\ \;\;\;\;\left(\sqrt[3]{{\left({\left(a \cdot a + b \cdot b\right)}^{2}\right)}^{3}} + 4 \cdot \left(b \cdot b\right)\right) - 1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4} + \left({b}^{4} + 2 \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)\\ \end{array}\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\begin{array}{l}
\mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right) \le 2.26003463209642231 \cdot 10^{28}:\\
\;\;\;\;\left(\sqrt[3]{{\left({\left(a \cdot a + b \cdot b\right)}^{2}\right)}^{3}} + 4 \cdot \left(b \cdot b\right)\right) - 1\\

\mathbf{else}:\\
\;\;\;\;{a}^{4} + \left({b}^{4} + 2 \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)\\

\end{array}
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 VAR;
	if ((((double) (((double) pow(((double) (((double) (a * a)) + ((double) (b * b)))), 2.0)) + ((double) (4.0 * ((double) (b * b)))))) <= 2.2600346320964223e+28)) {
		VAR = ((double) (((double) (((double) cbrt(((double) pow(((double) pow(((double) (((double) (a * a)) + ((double) (b * b)))), 2.0)), 3.0)))) + ((double) (4.0 * ((double) (b * b)))))) - 1.0));
	} else {
		VAR = ((double) (((double) pow(a, 4.0)) + ((double) (((double) pow(b, 4.0)) + ((double) (2.0 * ((double) (((double) pow(a, 2.0)) * ((double) pow(b, 2.0))))))))));
	}
	return VAR;
}

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) < 2.26003463209642231e28

    1. Initial program 0.0

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
    2. Using strategy rm
    3. Applied add-cbrt-cube0.0

      \[\leadsto \left(\color{blue}{\sqrt[3]{\left({\left(a \cdot a + b \cdot b\right)}^{2} \cdot {\left(a \cdot a + b \cdot b\right)}^{2}\right) \cdot {\left(a \cdot a + b \cdot b\right)}^{2}}} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
    4. Simplified0.0

      \[\leadsto \left(\sqrt[3]{\color{blue}{{\left({\left(a \cdot a + b \cdot b\right)}^{2}\right)}^{3}}} + 4 \cdot \left(b \cdot b\right)\right) - 1\]

    if 2.26003463209642231e28 < (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b)))

    1. Initial program 0.5

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
    2. Taylor expanded around inf 0.0

      \[\leadsto \color{blue}{{a}^{4} + \left({b}^{4} + 2 \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right) \le 2.26003463209642231 \cdot 10^{28}:\\ \;\;\;\;\left(\sqrt[3]{{\left({\left(a \cdot a + b \cdot b\right)}^{2}\right)}^{3}} + 4 \cdot \left(b \cdot b\right)\right) - 1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4} + \left({b}^{4} + 2 \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  :precision binary64
  (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0))