Bouland and Aaronson, Equation (25)

Percentage Accurate: 74.2% → 97.6%
Time: 10.4s
Alternatives: 8
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \end{array} \]
(FPCore (a b)
 :precision binary64
 (-
  (+
   (pow (+ (* a a) (* b b)) 2.0)
   (* 4.0 (+ (* (* a a) (+ 1.0 a)) (* (* b b) (- 1.0 (* 3.0 a))))))
  1.0))
double code(double a, double b) {
	return (pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((((a * a) + (b * b)) ** 2.0d0) + (4.0d0 * (((a * a) * (1.0d0 + a)) + ((b * b) * (1.0d0 - (3.0d0 * a)))))) - 1.0d0
end function
public static double code(double a, double b) {
	return (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
}
def code(a, b):
	return (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0
function code(a, b)
	return Float64(Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 + a)) + Float64(Float64(b * b) * Float64(1.0 - Float64(3.0 * a)))))) - 1.0)
end
function tmp = code(a, b)
	tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
end
code[a_, b_] := N[(N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(1.0 - N[(3.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
\begin{array}{l}

\\
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 74.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \end{array} \]
(FPCore (a b)
 :precision binary64
 (-
  (+
   (pow (+ (* a a) (* b b)) 2.0)
   (* 4.0 (+ (* (* a a) (+ 1.0 a)) (* (* b b) (- 1.0 (* 3.0 a))))))
  1.0))
double code(double a, double b) {
	return (pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((((a * a) + (b * b)) ** 2.0d0) + (4.0d0 * (((a * a) * (1.0d0 + a)) + ((b * b) * (1.0d0 - (3.0d0 * a)))))) - 1.0d0
end function
public static double code(double a, double b) {
	return (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
}
def code(a, b):
	return (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0
function code(a, b)
	return Float64(Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 + a)) + Float64(Float64(b * b) * Float64(1.0 - Float64(3.0 * a)))))) - 1.0)
end
function tmp = code(a, b)
	tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
end
code[a_, b_] := N[(N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(1.0 - N[(3.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
\begin{array}{l}

\\
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1
\end{array}

Alternative 1: 97.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+150}:\\ \;\;\;\;\left({\left(b \cdot b + a \cdot a\right)}^{2} + 4 \cdot \left(b \cdot \left(b \cdot \left(a \cdot -3\right)\right)\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right) + -1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<= (* b b) 5e+150)
   (+ (+ (pow (+ (* b b) (* a a)) 2.0) (* 4.0 (* b (* b (* a -3.0))))) -1.0)
   (+ (* (* b b) (+ (* b b) 4.0)) -1.0)))
double code(double a, double b) {
	double tmp;
	if ((b * b) <= 5e+150) {
		tmp = (pow(((b * b) + (a * a)), 2.0) + (4.0 * (b * (b * (a * -3.0))))) + -1.0;
	} else {
		tmp = ((b * b) * ((b * b) + 4.0)) + -1.0;
	}
	return tmp;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((b * b) <= 5d+150) then
        tmp = ((((b * b) + (a * a)) ** 2.0d0) + (4.0d0 * (b * (b * (a * (-3.0d0)))))) + (-1.0d0)
    else
        tmp = ((b * b) * ((b * b) + 4.0d0)) + (-1.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double tmp;
	if ((b * b) <= 5e+150) {
		tmp = (Math.pow(((b * b) + (a * a)), 2.0) + (4.0 * (b * (b * (a * -3.0))))) + -1.0;
	} else {
		tmp = ((b * b) * ((b * b) + 4.0)) + -1.0;
	}
	return tmp;
}
def code(a, b):
	tmp = 0
	if (b * b) <= 5e+150:
		tmp = (math.pow(((b * b) + (a * a)), 2.0) + (4.0 * (b * (b * (a * -3.0))))) + -1.0
	else:
		tmp = ((b * b) * ((b * b) + 4.0)) + -1.0
	return tmp
function code(a, b)
	tmp = 0.0
	if (Float64(b * b) <= 5e+150)
		tmp = Float64(Float64((Float64(Float64(b * b) + Float64(a * a)) ^ 2.0) + Float64(4.0 * Float64(b * Float64(b * Float64(a * -3.0))))) + -1.0);
	else
		tmp = Float64(Float64(Float64(b * b) * Float64(Float64(b * b) + 4.0)) + -1.0);
	end
	return tmp
end
function tmp_2 = code(a, b)
	tmp = 0.0;
	if ((b * b) <= 5e+150)
		tmp = ((((b * b) + (a * a)) ^ 2.0) + (4.0 * (b * (b * (a * -3.0))))) + -1.0;
	else
		tmp = ((b * b) * ((b * b) + 4.0)) + -1.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 5e+150], N[(N[(N[Power[N[(N[(b * b), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(b * N[(b * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] + 4.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+150}:\\
\;\;\;\;\left({\left(b \cdot b + a \cdot a\right)}^{2} + 4 \cdot \left(b \cdot \left(b \cdot \left(a \cdot -3\right)\right)\right)\right) + -1\\

\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right) + -1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b b) < 5.00000000000000009e150

    1. Initial program 82.9%

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

      \[\leadsto \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \color{blue}{-3 \cdot \left(a \cdot {b}^{2}\right)}\right)\right) - 1 \]
    3. Step-by-step derivation
      1. *-commutative82.4%

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

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

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

      \[\leadsto \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \color{blue}{\left(\left(b \cdot b\right) \cdot a\right) \cdot -3}\right)\right) - 1 \]
    5. Taylor expanded in a around 0 98.5%

      \[\leadsto \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \color{blue}{\left(-3 \cdot \left(a \cdot {b}^{2}\right)\right)}\right) - 1 \]
    6. Step-by-step derivation
      1. *-commutative98.5%

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

        \[\leadsto \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot -3\right)\right) - 1 \]
      3. *-commutative98.5%

        \[\leadsto \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\color{blue}{\left(\left(b \cdot b\right) \cdot a\right)} \cdot -3\right)\right) - 1 \]
      4. associate-*r*98.5%

        \[\leadsto \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \color{blue}{\left(\left(b \cdot b\right) \cdot \left(a \cdot -3\right)\right)}\right) - 1 \]
      5. associate-*l*98.5%

        \[\leadsto \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(a \cdot -3\right)\right)\right)}\right) - 1 \]
    7. Simplified98.5%

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

    if 5.00000000000000009e150 < (*.f64 b b)

    1. Initial program 62.9%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Taylor expanded in a around 0 61.9%

      \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
    3. Step-by-step derivation
      1. associate-+r+61.9%

        \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
      2. +-commutative61.9%

        \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
      3. associate-*r*61.9%

        \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
      4. distribute-rgt-out82.5%

        \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
      5. unpow282.5%

        \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
      6. +-commutative82.5%

        \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
    4. Simplified82.5%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
    5. Taylor expanded in a around 0 100.0%

      \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{4}\right) - 1 \]
    6. Step-by-step derivation
      1. metadata-eval100.0%

        \[\leadsto \left({b}^{\color{blue}{\left(2 \cdot 2\right)}} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
      2. pow-sqr100.0%

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

        \[\leadsto \left(\color{blue}{\left(b \cdot b\right)} \cdot {b}^{2} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
      4. pow2100.0%

        \[\leadsto \left(\left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot b\right)} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
      5. distribute-lft-out100.0%

        \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right)} - 1 \]
    7. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right)} - 1 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.1%

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

Alternative 2: 93.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+31}:\\ \;\;\;\;{a}^{4}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+38}:\\ \;\;\;\;\left({b}^{4} + \left(b \cdot b\right) \cdot 4\right) + -1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<= a -2.4e+31)
   (pow a 4.0)
   (if (<= a 4.5e+38) (+ (+ (pow b 4.0) (* (* b b) 4.0)) -1.0) (pow a 4.0))))
double code(double a, double b) {
	double tmp;
	if (a <= -2.4e+31) {
		tmp = pow(a, 4.0);
	} else if (a <= 4.5e+38) {
		tmp = (pow(b, 4.0) + ((b * b) * 4.0)) + -1.0;
	} else {
		tmp = pow(a, 4.0);
	}
	return tmp;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-2.4d+31)) then
        tmp = a ** 4.0d0
    else if (a <= 4.5d+38) then
        tmp = ((b ** 4.0d0) + ((b * b) * 4.0d0)) + (-1.0d0)
    else
        tmp = a ** 4.0d0
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double tmp;
	if (a <= -2.4e+31) {
		tmp = Math.pow(a, 4.0);
	} else if (a <= 4.5e+38) {
		tmp = (Math.pow(b, 4.0) + ((b * b) * 4.0)) + -1.0;
	} else {
		tmp = Math.pow(a, 4.0);
	}
	return tmp;
}
def code(a, b):
	tmp = 0
	if a <= -2.4e+31:
		tmp = math.pow(a, 4.0)
	elif a <= 4.5e+38:
		tmp = (math.pow(b, 4.0) + ((b * b) * 4.0)) + -1.0
	else:
		tmp = math.pow(a, 4.0)
	return tmp
function code(a, b)
	tmp = 0.0
	if (a <= -2.4e+31)
		tmp = a ^ 4.0;
	elseif (a <= 4.5e+38)
		tmp = Float64(Float64((b ^ 4.0) + Float64(Float64(b * b) * 4.0)) + -1.0);
	else
		tmp = a ^ 4.0;
	end
	return tmp
end
function tmp_2 = code(a, b)
	tmp = 0.0;
	if (a <= -2.4e+31)
		tmp = a ^ 4.0;
	elseif (a <= 4.5e+38)
		tmp = ((b ^ 4.0) + ((b * b) * 4.0)) + -1.0;
	else
		tmp = a ^ 4.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := If[LessEqual[a, -2.4e+31], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, 4.5e+38], N[(N[(N[Power[b, 4.0], $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+31}:\\
\;\;\;\;{a}^{4}\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{+38}:\\
\;\;\;\;\left({b}^{4} + \left(b \cdot b\right) \cdot 4\right) + -1\\

\mathbf{else}:\\
\;\;\;\;{a}^{4}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.39999999999999982e31 or 4.4999999999999998e38 < a

    1. Initial program 43.7%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Step-by-step derivation
      1. associate--l+43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{2} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right)} \]
      2. sqr-pow43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(a \cdot a + b \cdot b\right)}^{\left(\frac{2}{2}\right)}} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      3. sqr-pow43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{2}} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      4. fma-def43.7%

        \[\leadsto {\color{blue}{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}}^{2} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      5. fma-neg43.7%

        \[\leadsto {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(4, \left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right), -1\right)} \]
    3. Simplified47.5%

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \mathsf{fma}\left(4, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -3, 1\right), a \cdot \mathsf{fma}\left(a, a, a\right)\right), -1\right)} \]
    4. Taylor expanded in a around inf 96.6%

      \[\leadsto \color{blue}{{a}^{4}} \]

    if -2.39999999999999982e31 < a < 4.4999999999999998e38

    1. Initial program 97.2%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Taylor expanded in a around 0 82.8%

      \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
    3. Step-by-step derivation
      1. associate-+r+82.8%

        \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
      2. +-commutative82.8%

        \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
      3. associate-*r*82.8%

        \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
      4. distribute-rgt-out96.0%

        \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
      5. unpow296.0%

        \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
      6. +-commutative96.0%

        \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
    4. Simplified96.0%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
    5. Taylor expanded in a around 0 98.7%

      \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{4}\right) - 1 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+31}:\\ \;\;\;\;{a}^{4}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+38}:\\ \;\;\;\;\left({b}^{4} + \left(b \cdot b\right) \cdot 4\right) + -1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4}\\ \end{array} \]

Alternative 3: 93.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -8 \cdot 10^{+25}:\\ \;\;\;\;{a}^{4}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+39}:\\ \;\;\;\;b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<= a -8e+25)
   (pow a 4.0)
   (if (<= a 1.5e+39) (+ (* b (* b (fma b b 4.0))) -1.0) (pow a 4.0))))
double code(double a, double b) {
	double tmp;
	if (a <= -8e+25) {
		tmp = pow(a, 4.0);
	} else if (a <= 1.5e+39) {
		tmp = (b * (b * fma(b, b, 4.0))) + -1.0;
	} else {
		tmp = pow(a, 4.0);
	}
	return tmp;
}
function code(a, b)
	tmp = 0.0
	if (a <= -8e+25)
		tmp = a ^ 4.0;
	elseif (a <= 1.5e+39)
		tmp = Float64(Float64(b * Float64(b * fma(b, b, 4.0))) + -1.0);
	else
		tmp = a ^ 4.0;
	end
	return tmp
end
code[a_, b_] := If[LessEqual[a, -8e+25], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, 1.5e+39], N[(N[(b * N[(b * N[(b * b + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{+25}:\\
\;\;\;\;{a}^{4}\\

\mathbf{elif}\;a \leq 1.5 \cdot 10^{+39}:\\
\;\;\;\;b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right) + -1\\

\mathbf{else}:\\
\;\;\;\;{a}^{4}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.00000000000000072e25 or 1.5e39 < a

    1. Initial program 43.7%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Step-by-step derivation
      1. associate--l+43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{2} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right)} \]
      2. sqr-pow43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(a \cdot a + b \cdot b\right)}^{\left(\frac{2}{2}\right)}} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      3. sqr-pow43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{2}} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      4. fma-def43.7%

        \[\leadsto {\color{blue}{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}}^{2} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      5. fma-neg43.7%

        \[\leadsto {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(4, \left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right), -1\right)} \]
    3. Simplified47.5%

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \mathsf{fma}\left(4, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -3, 1\right), a \cdot \mathsf{fma}\left(a, a, a\right)\right), -1\right)} \]
    4. Taylor expanded in a around inf 96.6%

      \[\leadsto \color{blue}{{a}^{4}} \]

    if -8.00000000000000072e25 < a < 1.5e39

    1. Initial program 97.2%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Taylor expanded in a around 0 82.8%

      \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
    3. Step-by-step derivation
      1. associate-+r+82.8%

        \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
      2. +-commutative82.8%

        \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
      3. associate-*r*82.8%

        \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
      4. distribute-rgt-out96.0%

        \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
      5. unpow296.0%

        \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
      6. +-commutative96.0%

        \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
    4. Simplified96.0%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
    5. Taylor expanded in a around 0 98.7%

      \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{4}\right) - 1 \]
    6. Taylor expanded in b around 0 98.7%

      \[\leadsto \color{blue}{\left(4 \cdot {b}^{2} + {b}^{4}\right)} - 1 \]
    7. Step-by-step derivation
      1. unpow298.7%

        \[\leadsto \left(4 \cdot \color{blue}{\left(b \cdot b\right)} + {b}^{4}\right) - 1 \]
      2. metadata-eval98.7%

        \[\leadsto \left(4 \cdot \left(b \cdot b\right) + {b}^{\color{blue}{\left(2 \cdot 2\right)}}\right) - 1 \]
      3. pow-sqr98.6%

        \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \color{blue}{{b}^{2} \cdot {b}^{2}}\right) - 1 \]
      4. unpow298.6%

        \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \color{blue}{\left(b \cdot b\right)} \cdot {b}^{2}\right) - 1 \]
      5. unpow298.6%

        \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot b\right)}\right) - 1 \]
      6. distribute-rgt-in98.6%

        \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)} - 1 \]
      7. associate-*l*98.6%

        \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(4 + b \cdot b\right)\right)} - 1 \]
      8. +-commutative98.6%

        \[\leadsto b \cdot \left(b \cdot \color{blue}{\left(b \cdot b + 4\right)}\right) - 1 \]
      9. fma-def98.6%

        \[\leadsto b \cdot \left(b \cdot \color{blue}{\mathsf{fma}\left(b, b, 4\right)}\right) - 1 \]
    8. Simplified98.6%

      \[\leadsto \color{blue}{b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right)} - 1 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8 \cdot 10^{+25}:\\ \;\;\;\;{a}^{4}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+39}:\\ \;\;\;\;b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4}\\ \end{array} \]

Alternative 4: 93.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -56000000000:\\ \;\;\;\;{a}^{4}\\ \mathbf{elif}\;a \leq 2.15 \cdot 10^{+40}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right) + -1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<= a -56000000000.0)
   (pow a 4.0)
   (if (<= a 2.15e+40) (+ (* (* b b) (+ (* b b) 4.0)) -1.0) (pow a 4.0))))
double code(double a, double b) {
	double tmp;
	if (a <= -56000000000.0) {
		tmp = pow(a, 4.0);
	} else if (a <= 2.15e+40) {
		tmp = ((b * b) * ((b * b) + 4.0)) + -1.0;
	} else {
		tmp = pow(a, 4.0);
	}
	return tmp;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-56000000000.0d0)) then
        tmp = a ** 4.0d0
    else if (a <= 2.15d+40) then
        tmp = ((b * b) * ((b * b) + 4.0d0)) + (-1.0d0)
    else
        tmp = a ** 4.0d0
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double tmp;
	if (a <= -56000000000.0) {
		tmp = Math.pow(a, 4.0);
	} else if (a <= 2.15e+40) {
		tmp = ((b * b) * ((b * b) + 4.0)) + -1.0;
	} else {
		tmp = Math.pow(a, 4.0);
	}
	return tmp;
}
def code(a, b):
	tmp = 0
	if a <= -56000000000.0:
		tmp = math.pow(a, 4.0)
	elif a <= 2.15e+40:
		tmp = ((b * b) * ((b * b) + 4.0)) + -1.0
	else:
		tmp = math.pow(a, 4.0)
	return tmp
function code(a, b)
	tmp = 0.0
	if (a <= -56000000000.0)
		tmp = a ^ 4.0;
	elseif (a <= 2.15e+40)
		tmp = Float64(Float64(Float64(b * b) * Float64(Float64(b * b) + 4.0)) + -1.0);
	else
		tmp = a ^ 4.0;
	end
	return tmp
end
function tmp_2 = code(a, b)
	tmp = 0.0;
	if (a <= -56000000000.0)
		tmp = a ^ 4.0;
	elseif (a <= 2.15e+40)
		tmp = ((b * b) * ((b * b) + 4.0)) + -1.0;
	else
		tmp = a ^ 4.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := If[LessEqual[a, -56000000000.0], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, 2.15e+40], N[(N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] + 4.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -56000000000:\\
\;\;\;\;{a}^{4}\\

\mathbf{elif}\;a \leq 2.15 \cdot 10^{+40}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right) + -1\\

\mathbf{else}:\\
\;\;\;\;{a}^{4}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.6e10 or 2.1500000000000001e40 < a

    1. Initial program 43.7%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Step-by-step derivation
      1. associate--l+43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{2} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right)} \]
      2. sqr-pow43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(a \cdot a + b \cdot b\right)}^{\left(\frac{2}{2}\right)}} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      3. sqr-pow43.7%

        \[\leadsto \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{2}} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      4. fma-def43.7%

        \[\leadsto {\color{blue}{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}}^{2} + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right) - 1\right) \]
      5. fma-neg43.7%

        \[\leadsto {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(4, \left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right), -1\right)} \]
    3. Simplified47.5%

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \mathsf{fma}\left(4, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -3, 1\right), a \cdot \mathsf{fma}\left(a, a, a\right)\right), -1\right)} \]
    4. Taylor expanded in a around inf 96.6%

      \[\leadsto \color{blue}{{a}^{4}} \]

    if -5.6e10 < a < 2.1500000000000001e40

    1. Initial program 97.2%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Taylor expanded in a around 0 82.8%

      \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
    3. Step-by-step derivation
      1. associate-+r+82.8%

        \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
      2. +-commutative82.8%

        \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
      3. associate-*r*82.8%

        \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
      4. distribute-rgt-out96.0%

        \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
      5. unpow296.0%

        \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
      6. +-commutative96.0%

        \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
    4. Simplified96.0%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
    5. Taylor expanded in a around 0 98.7%

      \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{4}\right) - 1 \]
    6. Step-by-step derivation
      1. metadata-eval98.7%

        \[\leadsto \left({b}^{\color{blue}{\left(2 \cdot 2\right)}} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
      2. pow-sqr98.6%

        \[\leadsto \left(\color{blue}{{b}^{2} \cdot {b}^{2}} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
      3. pow298.6%

        \[\leadsto \left(\color{blue}{\left(b \cdot b\right)} \cdot {b}^{2} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
      4. pow298.6%

        \[\leadsto \left(\left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot b\right)} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
      5. distribute-lft-out98.6%

        \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right)} - 1 \]
    7. Applied egg-rr98.6%

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right)} - 1 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -56000000000:\\ \;\;\;\;{a}^{4}\\ \mathbf{elif}\;a \leq 2.15 \cdot 10^{+40}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right) + -1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4}\\ \end{array} \]

Alternative 5: 53.9% accurate, 11.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5000000000:\\ \;\;\;\;-12 \cdot \left(\left(b \cdot b\right) \cdot a\right) + -1\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot 4\right) + -1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<= a -5000000000.0)
   (+ (* -12.0 (* (* b b) a)) -1.0)
   (+ (* b (* b 4.0)) -1.0)))
double code(double a, double b) {
	double tmp;
	if (a <= -5000000000.0) {
		tmp = (-12.0 * ((b * b) * a)) + -1.0;
	} else {
		tmp = (b * (b * 4.0)) + -1.0;
	}
	return tmp;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-5000000000.0d0)) then
        tmp = ((-12.0d0) * ((b * b) * a)) + (-1.0d0)
    else
        tmp = (b * (b * 4.0d0)) + (-1.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double tmp;
	if (a <= -5000000000.0) {
		tmp = (-12.0 * ((b * b) * a)) + -1.0;
	} else {
		tmp = (b * (b * 4.0)) + -1.0;
	}
	return tmp;
}
def code(a, b):
	tmp = 0
	if a <= -5000000000.0:
		tmp = (-12.0 * ((b * b) * a)) + -1.0
	else:
		tmp = (b * (b * 4.0)) + -1.0
	return tmp
function code(a, b)
	tmp = 0.0
	if (a <= -5000000000.0)
		tmp = Float64(Float64(-12.0 * Float64(Float64(b * b) * a)) + -1.0);
	else
		tmp = Float64(Float64(b * Float64(b * 4.0)) + -1.0);
	end
	return tmp
end
function tmp_2 = code(a, b)
	tmp = 0.0;
	if (a <= -5000000000.0)
		tmp = (-12.0 * ((b * b) * a)) + -1.0;
	else
		tmp = (b * (b * 4.0)) + -1.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := If[LessEqual[a, -5000000000.0], N[(N[(-12.0 * N[(N[(b * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(b * N[(b * 4.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5000000000:\\
\;\;\;\;-12 \cdot \left(\left(b \cdot b\right) \cdot a\right) + -1\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot 4\right) + -1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5e9

    1. Initial program 23.6%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Taylor expanded in a around 0 47.2%

      \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
    3. Step-by-step derivation
      1. associate-+r+47.2%

        \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
      2. +-commutative47.2%

        \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
      3. associate-*r*47.2%

        \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
      4. distribute-rgt-out47.2%

        \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
      5. unpow247.2%

        \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
      6. +-commutative47.2%

        \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
    4. Simplified47.2%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
    5. Taylor expanded in a around inf 42.5%

      \[\leadsto \color{blue}{-12 \cdot \left(a \cdot {b}^{2}\right)} - 1 \]
    6. Step-by-step derivation
      1. unpow242.5%

        \[\leadsto -12 \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right) - 1 \]
    7. Simplified42.5%

      \[\leadsto \color{blue}{-12 \cdot \left(a \cdot \left(b \cdot b\right)\right)} - 1 \]

    if -5e9 < a

    1. Initial program 90.8%

      \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    2. Taylor expanded in a around 0 63.5%

      \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
    3. Step-by-step derivation
      1. associate-+r+63.5%

        \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
      2. +-commutative63.5%

        \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
      3. associate-*r*63.5%

        \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
      4. distribute-rgt-out73.7%

        \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
      5. unpow273.7%

        \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
      6. +-commutative73.7%

        \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
    4. Simplified73.7%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
    5. Taylor expanded in a around 0 82.5%

      \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{4}\right) - 1 \]
    6. Taylor expanded in b around 0 82.5%

      \[\leadsto \color{blue}{\left(4 \cdot {b}^{2} + {b}^{4}\right)} - 1 \]
    7. Step-by-step derivation
      1. unpow282.5%

        \[\leadsto \left(4 \cdot \color{blue}{\left(b \cdot b\right)} + {b}^{4}\right) - 1 \]
      2. metadata-eval82.5%

        \[\leadsto \left(4 \cdot \left(b \cdot b\right) + {b}^{\color{blue}{\left(2 \cdot 2\right)}}\right) - 1 \]
      3. pow-sqr82.4%

        \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \color{blue}{{b}^{2} \cdot {b}^{2}}\right) - 1 \]
      4. unpow282.4%

        \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \color{blue}{\left(b \cdot b\right)} \cdot {b}^{2}\right) - 1 \]
      5. unpow282.4%

        \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot b\right)}\right) - 1 \]
      6. distribute-rgt-in82.4%

        \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)} - 1 \]
      7. associate-*l*82.4%

        \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(4 + b \cdot b\right)\right)} - 1 \]
      8. +-commutative82.4%

        \[\leadsto b \cdot \left(b \cdot \color{blue}{\left(b \cdot b + 4\right)}\right) - 1 \]
      9. fma-def82.4%

        \[\leadsto b \cdot \left(b \cdot \color{blue}{\mathsf{fma}\left(b, b, 4\right)}\right) - 1 \]
    8. Simplified82.4%

      \[\leadsto \color{blue}{b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right)} - 1 \]
    9. Taylor expanded in b around 0 59.8%

      \[\leadsto \color{blue}{4 \cdot {b}^{2}} - 1 \]
    10. Step-by-step derivation
      1. unpow259.8%

        \[\leadsto 4 \cdot \color{blue}{\left(b \cdot b\right)} - 1 \]
      2. *-commutative59.8%

        \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot 4} - 1 \]
      3. associate-*r*59.8%

        \[\leadsto \color{blue}{b \cdot \left(b \cdot 4\right)} - 1 \]
    11. Simplified59.8%

      \[\leadsto \color{blue}{b \cdot \left(b \cdot 4\right)} - 1 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5000000000:\\ \;\;\;\;-12 \cdot \left(\left(b \cdot b\right) \cdot a\right) + -1\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot 4\right) + -1\\ \end{array} \]

Alternative 6: 69.4% accurate, 11.8× speedup?

\[\begin{array}{l} \\ \left(b \cdot b\right) \cdot \left(b \cdot b + 4\right) + -1 \end{array} \]
(FPCore (a b) :precision binary64 (+ (* (* b b) (+ (* b b) 4.0)) -1.0))
double code(double a, double b) {
	return ((b * b) * ((b * b) + 4.0)) + -1.0;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((b * b) * ((b * b) + 4.0d0)) + (-1.0d0)
end function
public static double code(double a, double b) {
	return ((b * b) * ((b * b) + 4.0)) + -1.0;
}
def code(a, b):
	return ((b * b) * ((b * b) + 4.0)) + -1.0
function code(a, b)
	return Float64(Float64(Float64(b * b) * Float64(Float64(b * b) + 4.0)) + -1.0)
end
function tmp = code(a, b)
	tmp = ((b * b) * ((b * b) + 4.0)) + -1.0;
end
code[a_, b_] := N[(N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] + 4.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}

\\
\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right) + -1
\end{array}
Derivation
  1. Initial program 75.3%

    \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
  2. Taylor expanded in a around 0 59.8%

    \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
  3. Step-by-step derivation
    1. associate-+r+59.8%

      \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
    2. +-commutative59.8%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
    3. associate-*r*59.8%

      \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
    4. distribute-rgt-out67.6%

      \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
    5. unpow267.6%

      \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
    6. +-commutative67.6%

      \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
  4. Simplified67.6%

    \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
  5. Taylor expanded in a around 0 73.5%

    \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{4}\right) - 1 \]
  6. Step-by-step derivation
    1. metadata-eval73.5%

      \[\leadsto \left({b}^{\color{blue}{\left(2 \cdot 2\right)}} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
    2. pow-sqr73.4%

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

      \[\leadsto \left(\color{blue}{\left(b \cdot b\right)} \cdot {b}^{2} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
    4. pow273.4%

      \[\leadsto \left(\left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot b\right)} + \left(b \cdot b\right) \cdot 4\right) - 1 \]
    5. distribute-lft-out73.4%

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right)} - 1 \]
  7. Applied egg-rr73.4%

    \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(b \cdot b + 4\right)} - 1 \]
  8. Final simplification73.4%

    \[\leadsto \left(b \cdot b\right) \cdot \left(b \cdot b + 4\right) + -1 \]

Alternative 7: 50.7% accurate, 18.6× speedup?

\[\begin{array}{l} \\ b \cdot \left(b \cdot 4\right) + -1 \end{array} \]
(FPCore (a b) :precision binary64 (+ (* b (* b 4.0)) -1.0))
double code(double a, double b) {
	return (b * (b * 4.0)) + -1.0;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (b * (b * 4.0d0)) + (-1.0d0)
end function
public static double code(double a, double b) {
	return (b * (b * 4.0)) + -1.0;
}
def code(a, b):
	return (b * (b * 4.0)) + -1.0
function code(a, b)
	return Float64(Float64(b * Float64(b * 4.0)) + -1.0)
end
function tmp = code(a, b)
	tmp = (b * (b * 4.0)) + -1.0;
end
code[a_, b_] := N[(N[(b * N[(b * 4.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}

\\
b \cdot \left(b \cdot 4\right) + -1
\end{array}
Derivation
  1. Initial program 75.3%

    \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
  2. Taylor expanded in a around 0 59.8%

    \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
  3. Step-by-step derivation
    1. associate-+r+59.8%

      \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
    2. +-commutative59.8%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
    3. associate-*r*59.8%

      \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
    4. distribute-rgt-out67.6%

      \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
    5. unpow267.6%

      \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
    6. +-commutative67.6%

      \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
  4. Simplified67.6%

    \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
  5. Taylor expanded in a around 0 73.5%

    \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{4}\right) - 1 \]
  6. Taylor expanded in b around 0 73.5%

    \[\leadsto \color{blue}{\left(4 \cdot {b}^{2} + {b}^{4}\right)} - 1 \]
  7. Step-by-step derivation
    1. unpow273.5%

      \[\leadsto \left(4 \cdot \color{blue}{\left(b \cdot b\right)} + {b}^{4}\right) - 1 \]
    2. metadata-eval73.5%

      \[\leadsto \left(4 \cdot \left(b \cdot b\right) + {b}^{\color{blue}{\left(2 \cdot 2\right)}}\right) - 1 \]
    3. pow-sqr73.4%

      \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \color{blue}{{b}^{2} \cdot {b}^{2}}\right) - 1 \]
    4. unpow273.4%

      \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \color{blue}{\left(b \cdot b\right)} \cdot {b}^{2}\right) - 1 \]
    5. unpow273.4%

      \[\leadsto \left(4 \cdot \left(b \cdot b\right) + \left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot b\right)}\right) - 1 \]
    6. distribute-rgt-in73.4%

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)} - 1 \]
    7. associate-*l*73.5%

      \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(4 + b \cdot b\right)\right)} - 1 \]
    8. +-commutative73.5%

      \[\leadsto b \cdot \left(b \cdot \color{blue}{\left(b \cdot b + 4\right)}\right) - 1 \]
    9. fma-def73.5%

      \[\leadsto b \cdot \left(b \cdot \color{blue}{\mathsf{fma}\left(b, b, 4\right)}\right) - 1 \]
  8. Simplified73.5%

    \[\leadsto \color{blue}{b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right)} - 1 \]
  9. Taylor expanded in b around 0 51.6%

    \[\leadsto \color{blue}{4 \cdot {b}^{2}} - 1 \]
  10. Step-by-step derivation
    1. unpow251.6%

      \[\leadsto 4 \cdot \color{blue}{\left(b \cdot b\right)} - 1 \]
    2. *-commutative51.6%

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot 4} - 1 \]
    3. associate-*r*51.6%

      \[\leadsto \color{blue}{b \cdot \left(b \cdot 4\right)} - 1 \]
  11. Simplified51.6%

    \[\leadsto \color{blue}{b \cdot \left(b \cdot 4\right)} - 1 \]
  12. Final simplification51.6%

    \[\leadsto b \cdot \left(b \cdot 4\right) + -1 \]

Alternative 8: 24.9% accurate, 130.0× speedup?

\[\begin{array}{l} \\ -1 \end{array} \]
(FPCore (a b) :precision binary64 -1.0)
double code(double a, double b) {
	return -1.0;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = -1.0d0
end function
public static double code(double a, double b) {
	return -1.0;
}
def code(a, b):
	return -1.0
function code(a, b)
	return -1.0
end
function tmp = code(a, b)
	tmp = -1.0;
end
code[a_, b_] := -1.0
\begin{array}{l}

\\
-1
\end{array}
Derivation
  1. Initial program 75.3%

    \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
  2. Taylor expanded in a around 0 59.8%

    \[\leadsto \color{blue}{\left(-12 \cdot \left(a \cdot {b}^{2}\right) + \left(4 \cdot {b}^{2} + {b}^{4}\right)\right)} - 1 \]
  3. Step-by-step derivation
    1. associate-+r+59.8%

      \[\leadsto \color{blue}{\left(\left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right) + {b}^{4}\right)} - 1 \]
    2. +-commutative59.8%

      \[\leadsto \color{blue}{\left({b}^{4} + \left(-12 \cdot \left(a \cdot {b}^{2}\right) + 4 \cdot {b}^{2}\right)\right)} - 1 \]
    3. associate-*r*59.8%

      \[\leadsto \left({b}^{4} + \left(\color{blue}{\left(-12 \cdot a\right) \cdot {b}^{2}} + 4 \cdot {b}^{2}\right)\right) - 1 \]
    4. distribute-rgt-out67.6%

      \[\leadsto \left({b}^{4} + \color{blue}{{b}^{2} \cdot \left(-12 \cdot a + 4\right)}\right) - 1 \]
    5. unpow267.6%

      \[\leadsto \left({b}^{4} + \color{blue}{\left(b \cdot b\right)} \cdot \left(-12 \cdot a + 4\right)\right) - 1 \]
    6. +-commutative67.6%

      \[\leadsto \left({b}^{4} + \left(b \cdot b\right) \cdot \color{blue}{\left(4 + -12 \cdot a\right)}\right) - 1 \]
  4. Simplified67.6%

    \[\leadsto \color{blue}{\left({b}^{4} + \left(b \cdot b\right) \cdot \left(4 + -12 \cdot a\right)\right)} - 1 \]
  5. Taylor expanded in b around 0 27.5%

    \[\leadsto \color{blue}{-1} \]
  6. Final simplification27.5%

    \[\leadsto -1 \]

Reproduce

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