Bouland and Aaronson, Equation (24)

Percentage Accurate: 73.2% → 99.9%
Time: 11.6s
Alternatives: 13
Speedup: 9.1×

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(3 + 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) (+ 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) * (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) * (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) * (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) * (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(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) * (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[(3.0 + a), $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(3 + 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 13 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: 73.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(3 + 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) (+ 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) * (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) * (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) * (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) * (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(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) * (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[(3.0 + a), $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(3 + a\right)\right)\right) - 1
\end{array}

Alternative 1: 99.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot a + b \cdot b\\ t_1 := \left(a \cdot a\right) \cdot \left(1 - a\right)\\ \mathbf{if}\;{t\_0}^{2} + 4 \cdot \left(t\_1 + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(t\_0, t\_0, 4 \cdot \left(t\_1 + b \cdot \left(b \cdot \left(a + 3\right)\right)\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) \cdot \left(1 + \frac{\frac{4 + \left(b \cdot b\right) \cdot 2}{a} - 4}{a}\right)\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0 (+ (* a a) (* b b))) (t_1 (* (* a a) (- 1.0 a))))
   (if (<= (+ (pow t_0 2.0) (* 4.0 (+ t_1 (* (* b b) (+ a 3.0))))) INFINITY)
     (+ (fma t_0 t_0 (* 4.0 (+ t_1 (* b (* b (+ a 3.0)))))) -1.0)
     (*
      (* a (* a (* a a)))
      (+ 1.0 (/ (- (/ (+ 4.0 (* (* b b) 2.0)) a) 4.0) a))))))
double code(double a, double b) {
	double t_0 = (a * a) + (b * b);
	double t_1 = (a * a) * (1.0 - a);
	double tmp;
	if ((pow(t_0, 2.0) + (4.0 * (t_1 + ((b * b) * (a + 3.0))))) <= ((double) INFINITY)) {
		tmp = fma(t_0, t_0, (4.0 * (t_1 + (b * (b * (a + 3.0)))))) + -1.0;
	} else {
		tmp = (a * (a * (a * a))) * (1.0 + ((((4.0 + ((b * b) * 2.0)) / a) - 4.0) / a));
	}
	return tmp;
}
function code(a, b)
	t_0 = Float64(Float64(a * a) + Float64(b * b))
	t_1 = Float64(Float64(a * a) * Float64(1.0 - a))
	tmp = 0.0
	if (Float64((t_0 ^ 2.0) + Float64(4.0 * Float64(t_1 + Float64(Float64(b * b) * Float64(a + 3.0))))) <= Inf)
		tmp = Float64(fma(t_0, t_0, Float64(4.0 * Float64(t_1 + Float64(b * Float64(b * Float64(a + 3.0)))))) + -1.0);
	else
		tmp = Float64(Float64(a * Float64(a * Float64(a * a))) * Float64(1.0 + Float64(Float64(Float64(Float64(4.0 + Float64(Float64(b * b) * 2.0)) / a) - 4.0) / a)));
	end
	return tmp
end
code[a_, b_] := Block[{t$95$0 = N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(4.0 * N[(t$95$1 + N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(t$95$0 * t$95$0 + N[(4.0 * N[(t$95$1 + N[(b * N[(b * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(N[(4.0 + N[(N[(b * b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] - 4.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot a + b \cdot b\\
t_1 := \left(a \cdot a\right) \cdot \left(1 - a\right)\\
\mathbf{if}\;{t\_0}^{2} + 4 \cdot \left(t\_1 + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, 4 \cdot \left(t\_1 + b \cdot \left(b \cdot \left(a + 3\right)\right)\right)\right) + -1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < +inf.0

    1. Initial program 99.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(3 + a\right)\right)\right) - 1 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), 1\right) \]
      2. fma-defineN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{fma}\left(a \cdot a + b \cdot b, a \cdot a + b \cdot b, 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right)\right), 1\right) \]
      3. fma-lowering-fma.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right)\right), 1\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right)\right), 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right)\right), 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right)\right), 1\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right)\right), 1\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right)\right), 1\right) \]
      10. distribute-rgt-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(\left(\left(a \cdot a\right) \cdot \left(1 - a\right)\right) \cdot 4 + \left(\left(b \cdot b\right) \cdot \left(3 + a\right)\right) \cdot 4\right)\right), 1\right) \]
      11. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(\left(a \cdot \left(a \cdot \left(1 - a\right)\right)\right) \cdot 4 + \left(\left(b \cdot b\right) \cdot \left(3 + a\right)\right) \cdot 4\right)\right), 1\right) \]
      12. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(\left(a \cdot \left(a \cdot \left(1 - a\right)\right)\right) \cdot 4 + \left(\left(b \cdot b\right) \cdot \left(a + 3\right)\right) \cdot 4\right)\right), 1\right) \]
      13. distribute-rgt-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\right)\right), 1\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{*.f64}\left(4, \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\right)\right), 1\right) \]
    4. Applied egg-rr99.9%

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

    if +inf.0 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a)))))

    1. Initial program 0.0%

      \[\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(3 + a\right)\right)\right) - 1 \]
    2. Step-by-step derivation
      1. associate--l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
    3. Simplified0.0%

      \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around -inf

      \[\leadsto \color{blue}{{a}^{4} \cdot \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({a}^{4}\right), \color{blue}{\left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)}\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({a}^{\left(3 + 1\right)}\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      3. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\left({a}^{3} \cdot a\right), \left(\color{blue}{1} + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a \cdot {a}^{3}\right), \left(\color{blue}{1} + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \left({a}^{3}\right)\right), \left(\color{blue}{1} + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot \left(a \cdot a\right)\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot {a}^{2}\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left({a}^{2}\right)\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot a\right)\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \left(1 + \left(\mathsf{neg}\left(\frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right)\right)\right) \]
      12. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \left(1 - \color{blue}{\frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}}\right)\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}\right), \color{blue}{a}\right)\right)\right) \]
    7. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{\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(a + 3\right)\right) \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(a \cdot a + b \cdot b, a \cdot a + b \cdot b, 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + b \cdot \left(b \cdot \left(a + 3\right)\right)\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) \cdot \left(1 + \frac{\frac{4 + \left(b \cdot b\right) \cdot 2}{a} - 4}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.3% accurate, 3.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) \cdot \left(1 + \frac{\frac{4 + \left(b \cdot b\right) \cdot 2}{a} - 4}{a}\right)\\ \mathbf{if}\;a \leq -0.68:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 29.5:\\ \;\;\;\;\left(b \cdot b\right) \cdot 12 + \left(-1 + b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0
         (*
          (* a (* a (* a a)))
          (+ 1.0 (/ (- (/ (+ 4.0 (* (* b b) 2.0)) a) 4.0) a)))))
   (if (<= a -0.68)
     t_0
     (if (<= a 29.5) (+ (* (* b b) 12.0) (+ -1.0 (* b (* b (* b b))))) t_0))))
double code(double a, double b) {
	double t_0 = (a * (a * (a * a))) * (1.0 + ((((4.0 + ((b * b) * 2.0)) / a) - 4.0) / a));
	double tmp;
	if (a <= -0.68) {
		tmp = t_0;
	} else if (a <= 29.5) {
		tmp = ((b * b) * 12.0) + (-1.0 + (b * (b * (b * b))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (a * (a * (a * a))) * (1.0d0 + ((((4.0d0 + ((b * b) * 2.0d0)) / a) - 4.0d0) / a))
    if (a <= (-0.68d0)) then
        tmp = t_0
    else if (a <= 29.5d0) then
        tmp = ((b * b) * 12.0d0) + ((-1.0d0) + (b * (b * (b * b))))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double t_0 = (a * (a * (a * a))) * (1.0 + ((((4.0 + ((b * b) * 2.0)) / a) - 4.0) / a));
	double tmp;
	if (a <= -0.68) {
		tmp = t_0;
	} else if (a <= 29.5) {
		tmp = ((b * b) * 12.0) + (-1.0 + (b * (b * (b * b))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, b):
	t_0 = (a * (a * (a * a))) * (1.0 + ((((4.0 + ((b * b) * 2.0)) / a) - 4.0) / a))
	tmp = 0
	if a <= -0.68:
		tmp = t_0
	elif a <= 29.5:
		tmp = ((b * b) * 12.0) + (-1.0 + (b * (b * (b * b))))
	else:
		tmp = t_0
	return tmp
function code(a, b)
	t_0 = Float64(Float64(a * Float64(a * Float64(a * a))) * Float64(1.0 + Float64(Float64(Float64(Float64(4.0 + Float64(Float64(b * b) * 2.0)) / a) - 4.0) / a)))
	tmp = 0.0
	if (a <= -0.68)
		tmp = t_0;
	elseif (a <= 29.5)
		tmp = Float64(Float64(Float64(b * b) * 12.0) + Float64(-1.0 + Float64(b * Float64(b * Float64(b * b)))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, b)
	t_0 = (a * (a * (a * a))) * (1.0 + ((((4.0 + ((b * b) * 2.0)) / a) - 4.0) / a));
	tmp = 0.0;
	if (a <= -0.68)
		tmp = t_0;
	elseif (a <= 29.5)
		tmp = ((b * b) * 12.0) + (-1.0 + (b * (b * (b * b))));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := Block[{t$95$0 = N[(N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(N[(4.0 + N[(N[(b * b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] - 4.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.68], t$95$0, If[LessEqual[a, 29.5], N[(N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision] + N[(-1.0 + N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) \cdot \left(1 + \frac{\frac{4 + \left(b \cdot b\right) \cdot 2}{a} - 4}{a}\right)\\
\mathbf{if}\;a \leq -0.68:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;a \leq 29.5:\\
\;\;\;\;\left(b \cdot b\right) \cdot 12 + \left(-1 + b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.680000000000000049 or 29.5 < a

    1. Initial program 46.0%

      \[\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(3 + a\right)\right)\right) - 1 \]
    2. Step-by-step derivation
      1. associate--l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
    3. Simplified46.0%

      \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around -inf

      \[\leadsto \color{blue}{{a}^{4} \cdot \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({a}^{4}\right), \color{blue}{\left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)}\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({a}^{\left(3 + 1\right)}\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      3. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\left({a}^{3} \cdot a\right), \left(\color{blue}{1} + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a \cdot {a}^{3}\right), \left(\color{blue}{1} + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \left({a}^{3}\right)\right), \left(\color{blue}{1} + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot \left(a \cdot a\right)\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot {a}^{2}\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left({a}^{2}\right)\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot a\right)\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \left(1 + -1 \cdot \frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \left(1 + \left(\mathsf{neg}\left(\frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)\right)\right)\right) \]
      12. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \left(1 - \color{blue}{\frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}}\right)\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}}{a}\right)}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(4 + -1 \cdot \frac{4 + 2 \cdot {b}^{2}}{a}\right), \color{blue}{a}\right)\right)\right) \]
    7. Simplified97.8%

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

    if -0.680000000000000049 < a < 29.5

    1. Initial program 99.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(3 + a\right)\right)\right) - 1 \]
    2. Step-by-step derivation
      1. associate--l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{\left(3 \cdot {b}^{2}\right)}\right), -1\right)\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(3 \cdot \left(b \cdot b\right)\right)\right), -1\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(\left(3 \cdot b\right) \cdot b\right)\right), -1\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(b \cdot \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(b \cdot 3\right)\right)\right), -1\right)\right) \]
      6. *-lowering-*.f6498.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, 3\right)\right)\right), -1\right)\right) \]
    7. Simplified98.8%

      \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \color{blue}{\left(b \cdot \left(b \cdot 3\right)\right)} + -1\right) \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(-1 + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)}\right) \]
      2. associate-+r+N/A

        \[\leadsto \left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right) + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right), \color{blue}{\left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)}\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(\color{blue}{4} \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot \left(b \cdot 3\right)\right) \cdot \color{blue}{4}\right)\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(\left(b \cdot b\right) \cdot 3\right) \cdot 4\right)\right) \]
      14. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot \color{blue}{\left(3 \cdot 4\right)}\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot 12\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\left(b \cdot b\right), \color{blue}{12}\right)\right) \]
      17. *-lowering-*.f6498.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
    9. Applied egg-rr98.8%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({b}^{4} - 1\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
    11. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\left({b}^{4} + \left(\mathsf{neg}\left(1\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(\left({b}^{4} + -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \color{blue}{b}\right), 12\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left({b}^{4}\right), -1\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
      5. pow-sqrN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{b}, b\right), 12\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{b}, b\right), 12\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{b}, b\right), 12\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
      11. *-lowering-*.f6498.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
    12. Simplified98.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.68:\\ \;\;\;\;\left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) \cdot \left(1 + \frac{\frac{4 + \left(b \cdot b\right) \cdot 2}{a} - 4}{a}\right)\\ \mathbf{elif}\;a \leq 29.5:\\ \;\;\;\;\left(b \cdot b\right) \cdot 12 + \left(-1 + b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) \cdot \left(1 + \frac{\frac{4 + \left(b \cdot b\right) \cdot 2}{a} - 4}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.8% accurate, 4.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b b) < 5.00000000000000031e-10

    1. Initial program 83.4%

      \[\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(3 + a\right)\right)\right) - 1 \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right) + {a}^{4}\right)}, 1\right) \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left({a}^{4} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left({a}^{\left(2 \cdot 2\right)} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
      3. pow-sqrN/A

        \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left(\left(1 - a\right) \cdot {a}^{2}\right)\right), 1\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + \left(4 \cdot \left(1 - a\right)\right) \cdot {a}^{2}\right), 1\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left({a}^{2}\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left({a}^{2}\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \left(1 - a\right)\right)\right)\right), 1\right) \]
      14. --lowering--.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(1, a\right)\right)\right)\right), 1\right) \]
    5. Simplified99.8%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \color{blue}{\left(4 + a \cdot \left(a - 4\right)\right)}\right), 1\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \left(a \cdot \left(a - 4\right)\right)\right)\right), 1\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a - 4\right)\right)\right)\right), 1\right) \]
      3. sub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a + \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), 1\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a + -4\right)\right)\right)\right), 1\right) \]
      5. +-lowering-+.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right)\right), 1\right) \]
    8. Simplified99.8%

      \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(4 + a \cdot \left(a + -4\right)\right)} - 1 \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(4 \cdot \left(a \cdot a\right) + \left(a \cdot \left(a + -4\right)\right) \cdot \left(a \cdot a\right)\right), 1\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(4 \cdot \left(a \cdot a\right) + \left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right), 1\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(4 \cdot \left(a \cdot a\right)\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right), 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a\right) \cdot 4\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right), 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a\right), 4\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right), 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right), 1\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \left(a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \mathsf{*.f64}\left(a, \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right)\right), 1\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \left(a + -4\right)\right)\right)\right)\right), 1\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a + -4\right)\right)\right)\right)\right), 1\right) \]
      11. +-lowering-+.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right)\right)\right), 1\right) \]
    10. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\left(\left(a \cdot a\right) \cdot 4 + a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right)} - 1 \]
    11. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right) + \left(a \cdot a\right) \cdot 4\right), 1\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right) + a \cdot \left(a \cdot 4\right)\right), 1\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right) + a \cdot 4\right)\right), 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot \left(a \cdot \left(a + -4\right)\right) + a \cdot 4\right)\right), 1\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right), \left(a \cdot 4\right)\right)\right), 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot \left(a + -4\right)\right)\right), \left(a \cdot 4\right)\right)\right), 1\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a + -4\right)\right)\right), \left(a \cdot 4\right)\right)\right), 1\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right), \left(a \cdot 4\right)\right)\right), 1\right) \]
      9. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right), \mathsf{*.f64}\left(a, 4\right)\right)\right), 1\right) \]
    12. Applied egg-rr99.9%

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

    if 5.00000000000000031e-10 < (*.f64 b b)

    1. Initial program 61.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(3 + a\right)\right)\right) - 1 \]
    2. Step-by-step derivation
      1. associate--l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
    3. Simplified61.6%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{\left(3 \cdot {b}^{2}\right)}\right), -1\right)\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(3 \cdot \left(b \cdot b\right)\right)\right), -1\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(\left(3 \cdot b\right) \cdot b\right)\right), -1\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(b \cdot \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(b \cdot 3\right)\right)\right), -1\right)\right) \]
      6. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, 3\right)\right)\right), -1\right)\right) \]
    7. Simplified99.9%

      \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \color{blue}{\left(b \cdot \left(b \cdot 3\right)\right)} + -1\right) \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(-1 + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)}\right) \]
      2. associate-+r+N/A

        \[\leadsto \left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right) + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right), \color{blue}{\left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)}\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(\color{blue}{4} \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot \left(b \cdot 3\right)\right) \cdot \color{blue}{4}\right)\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(\left(b \cdot b\right) \cdot 3\right) \cdot 4\right)\right) \]
      14. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot \color{blue}{\left(3 \cdot 4\right)}\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot 12\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\left(b \cdot b\right), \color{blue}{12}\right)\right) \]
      17. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
    9. Applied egg-rr99.9%

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

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

Alternative 4: 69.1% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{if}\;b \cdot b \leq 10^{-308}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \cdot b \leq 2 \cdot 10^{-46}:\\ \;\;\;\;-1\\ \mathbf{elif}\;b \cdot b \leq 5 \cdot 10^{+46}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0 (* a (* a (* a a)))))
   (if (<= (* b b) 1e-308)
     t_0
     (if (<= (* b b) 2e-46)
       -1.0
       (if (<= (* b b) 5e+46) t_0 (* b (* b (* b b))))))))
double code(double a, double b) {
	double t_0 = a * (a * (a * a));
	double tmp;
	if ((b * b) <= 1e-308) {
		tmp = t_0;
	} else if ((b * b) <= 2e-46) {
		tmp = -1.0;
	} else if ((b * b) <= 5e+46) {
		tmp = t_0;
	} else {
		tmp = b * (b * (b * b));
	}
	return tmp;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a * (a * (a * a))
    if ((b * b) <= 1d-308) then
        tmp = t_0
    else if ((b * b) <= 2d-46) then
        tmp = -1.0d0
    else if ((b * b) <= 5d+46) then
        tmp = t_0
    else
        tmp = b * (b * (b * b))
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double t_0 = a * (a * (a * a));
	double tmp;
	if ((b * b) <= 1e-308) {
		tmp = t_0;
	} else if ((b * b) <= 2e-46) {
		tmp = -1.0;
	} else if ((b * b) <= 5e+46) {
		tmp = t_0;
	} else {
		tmp = b * (b * (b * b));
	}
	return tmp;
}
def code(a, b):
	t_0 = a * (a * (a * a))
	tmp = 0
	if (b * b) <= 1e-308:
		tmp = t_0
	elif (b * b) <= 2e-46:
		tmp = -1.0
	elif (b * b) <= 5e+46:
		tmp = t_0
	else:
		tmp = b * (b * (b * b))
	return tmp
function code(a, b)
	t_0 = Float64(a * Float64(a * Float64(a * a)))
	tmp = 0.0
	if (Float64(b * b) <= 1e-308)
		tmp = t_0;
	elseif (Float64(b * b) <= 2e-46)
		tmp = -1.0;
	elseif (Float64(b * b) <= 5e+46)
		tmp = t_0;
	else
		tmp = Float64(b * Float64(b * Float64(b * b)));
	end
	return tmp
end
function tmp_2 = code(a, b)
	t_0 = a * (a * (a * a));
	tmp = 0.0;
	if ((b * b) <= 1e-308)
		tmp = t_0;
	elseif ((b * b) <= 2e-46)
		tmp = -1.0;
	elseif ((b * b) <= 5e+46)
		tmp = t_0;
	else
		tmp = b * (b * (b * b));
	end
	tmp_2 = tmp;
end
code[a_, b_] := Block[{t$95$0 = N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * b), $MachinePrecision], 1e-308], t$95$0, If[LessEqual[N[(b * b), $MachinePrecision], 2e-46], -1.0, If[LessEqual[N[(b * b), $MachinePrecision], 5e+46], t$95$0, N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
\mathbf{if}\;b \cdot b \leq 10^{-308}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \cdot b \leq 2 \cdot 10^{-46}:\\
\;\;\;\;-1\\

\mathbf{elif}\;b \cdot b \leq 5 \cdot 10^{+46}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b b) < 9.9999999999999991e-309 or 2.00000000000000005e-46 < (*.f64 b b) < 5.0000000000000002e46

    1. Initial program 76.1%

      \[\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(3 + a\right)\right)\right) - 1 \]
    2. Step-by-step derivation
      1. associate--l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
    3. Simplified76.1%

      \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{{a}^{4}} \]
    6. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto {a}^{\left(3 + \color{blue}{1}\right)} \]
      2. pow-plusN/A

        \[\leadsto {a}^{3} \cdot \color{blue}{a} \]
      3. *-commutativeN/A

        \[\leadsto a \cdot \color{blue}{{a}^{3}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{3}\right)}\right) \]
      5. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(a, \left(a \cdot {a}^{\color{blue}{2}}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{2}\right)}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{a}\right)\right)\right) \]
      9. *-lowering-*.f6459.5%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right) \]
    7. Simplified59.5%

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(a \cdot a\right)\right)} \]

    if 9.9999999999999991e-309 < (*.f64 b b) < 2.00000000000000005e-46

    1. Initial program 88.1%

      \[\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(3 + a\right)\right)\right) - 1 \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left({b}^{4}\right)}, 1\right) \]
    4. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), 1\right) \]
      2. pow-sqrN/A

        \[\leadsto \mathsf{\_.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), 1\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), 1\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), 1\right) \]
      8. *-lowering-*.f6460.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), 1\right) \]
    5. Simplified60.2%

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

      \[\leadsto \color{blue}{-1} \]
    7. Step-by-step derivation
      1. Simplified60.2%

        \[\leadsto \color{blue}{-1} \]

      if 5.0000000000000002e46 < (*.f64 b b)

      1. Initial program 62.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(3 + a\right)\right)\right) - 1 \]
      2. Step-by-step derivation
        1. associate--l+N/A

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

          \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
        12. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      3. Simplified62.8%

        \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in b around inf

        \[\leadsto \color{blue}{{b}^{4}} \]
      6. Step-by-step derivation
        1. metadata-evalN/A

          \[\leadsto {b}^{\left(2 \cdot \color{blue}{2}\right)} \]
        2. pow-sqrN/A

          \[\leadsto {b}^{2} \cdot \color{blue}{{b}^{2}} \]
        3. unpow2N/A

          \[\leadsto \left(b \cdot b\right) \cdot {\color{blue}{b}}^{2} \]
        4. associate-*l*N/A

          \[\leadsto b \cdot \color{blue}{\left(b \cdot {b}^{2}\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot {b}^{2}\right)}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
        8. *-lowering-*.f6492.7%

          \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
      7. Simplified92.7%

        \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]
    8. Recombined 3 regimes into one program.
    9. Add Preprocessing

    Alternative 5: 66.1% accurate, 5.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{if}\;a \leq -8.5 \cdot 10^{+54}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq -9.5 \cdot 10^{-133}:\\ \;\;\;\;b \cdot \left(b \cdot 12\right)\\ \mathbf{elif}\;a \leq 2.45:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (let* ((t_0 (* a (* a (* a a)))))
       (if (<= a -8.5e+54)
         t_0
         (if (<= a -9.5e-133) (* b (* b 12.0)) (if (<= a 2.45) -1.0 t_0)))))
    double code(double a, double b) {
    	double t_0 = a * (a * (a * a));
    	double tmp;
    	if (a <= -8.5e+54) {
    		tmp = t_0;
    	} else if (a <= -9.5e-133) {
    		tmp = b * (b * 12.0);
    	} else if (a <= 2.45) {
    		tmp = -1.0;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(a, b)
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8) :: t_0
        real(8) :: tmp
        t_0 = a * (a * (a * a))
        if (a <= (-8.5d+54)) then
            tmp = t_0
        else if (a <= (-9.5d-133)) then
            tmp = b * (b * 12.0d0)
        else if (a <= 2.45d0) then
            tmp = -1.0d0
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double a, double b) {
    	double t_0 = a * (a * (a * a));
    	double tmp;
    	if (a <= -8.5e+54) {
    		tmp = t_0;
    	} else if (a <= -9.5e-133) {
    		tmp = b * (b * 12.0);
    	} else if (a <= 2.45) {
    		tmp = -1.0;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(a, b):
    	t_0 = a * (a * (a * a))
    	tmp = 0
    	if a <= -8.5e+54:
    		tmp = t_0
    	elif a <= -9.5e-133:
    		tmp = b * (b * 12.0)
    	elif a <= 2.45:
    		tmp = -1.0
    	else:
    		tmp = t_0
    	return tmp
    
    function code(a, b)
    	t_0 = Float64(a * Float64(a * Float64(a * a)))
    	tmp = 0.0
    	if (a <= -8.5e+54)
    		tmp = t_0;
    	elseif (a <= -9.5e-133)
    		tmp = Float64(b * Float64(b * 12.0));
    	elseif (a <= 2.45)
    		tmp = -1.0;
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b)
    	t_0 = a * (a * (a * a));
    	tmp = 0.0;
    	if (a <= -8.5e+54)
    		tmp = t_0;
    	elseif (a <= -9.5e-133)
    		tmp = b * (b * 12.0);
    	elseif (a <= 2.45)
    		tmp = -1.0;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_] := Block[{t$95$0 = N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.5e+54], t$95$0, If[LessEqual[a, -9.5e-133], N[(b * N[(b * 12.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.45], -1.0, t$95$0]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
    \mathbf{if}\;a \leq -8.5 \cdot 10^{+54}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;a \leq -9.5 \cdot 10^{-133}:\\
    \;\;\;\;b \cdot \left(b \cdot 12\right)\\
    
    \mathbf{elif}\;a \leq 2.45:\\
    \;\;\;\;-1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if a < -8.4999999999999995e54 or 2.4500000000000002 < a

      1. Initial program 44.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(3 + a\right)\right)\right) - 1 \]
      2. Step-by-step derivation
        1. associate--l+N/A

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

          \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
        12. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      3. Simplified44.7%

        \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in a around inf

        \[\leadsto \color{blue}{{a}^{4}} \]
      6. Step-by-step derivation
        1. metadata-evalN/A

          \[\leadsto {a}^{\left(3 + \color{blue}{1}\right)} \]
        2. pow-plusN/A

          \[\leadsto {a}^{3} \cdot \color{blue}{a} \]
        3. *-commutativeN/A

          \[\leadsto a \cdot \color{blue}{{a}^{3}} \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{3}\right)}\right) \]
        5. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(a, \left(a \cdot {a}^{\color{blue}{2}}\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{2}\right)}\right)\right) \]
        8. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{a}\right)\right)\right) \]
        9. *-lowering-*.f6494.1%

          \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right) \]
      7. Simplified94.1%

        \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(a \cdot a\right)\right)} \]

      if -8.4999999999999995e54 < a < -9.4999999999999992e-133

      1. Initial program 85.5%

        \[\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(3 + a\right)\right)\right) - 1 \]
      2. Step-by-step derivation
        1. associate--l+N/A

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

          \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
        12. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      3. Simplified85.5%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{\left(3 \cdot {b}^{2}\right)}\right), -1\right)\right) \]
      6. Step-by-step derivation
        1. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(3 \cdot \left(b \cdot b\right)\right)\right), -1\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(\left(3 \cdot b\right) \cdot b\right)\right), -1\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(b \cdot \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(b \cdot 3\right)\right)\right), -1\right)\right) \]
        6. *-lowering-*.f6495.0%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, 3\right)\right)\right), -1\right)\right) \]
      7. Simplified95.0%

        \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \color{blue}{\left(b \cdot \left(b \cdot 3\right)\right)} + -1\right) \]
      8. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(-1 + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)}\right) \]
        2. associate-+r+N/A

          \[\leadsto \left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right) + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)} \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right), \color{blue}{\left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)}\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(\color{blue}{4} \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
        9. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot \left(b \cdot 3\right)\right) \cdot \color{blue}{4}\right)\right) \]
        13. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(\left(b \cdot b\right) \cdot 3\right) \cdot 4\right)\right) \]
        14. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot \color{blue}{\left(3 \cdot 4\right)}\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot 12\right)\right) \]
        16. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\left(b \cdot b\right), \color{blue}{12}\right)\right) \]
        17. *-lowering-*.f6495.0%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
      9. Applied egg-rr95.0%

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

        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({b}^{4}\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
      11. Step-by-step derivation
        1. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \color{blue}{b}\right), 12\right)\right) \]
        2. pow-sqrN/A

          \[\leadsto \mathsf{+.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{b}, b\right), 12\right)\right) \]
        4. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \color{blue}{b}\right), 12\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
        8. *-lowering-*.f6465.3%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
      12. Simplified65.3%

        \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \left(b \cdot b\right) \cdot 12 \]
      13. Taylor expanded in b around 0

        \[\leadsto \color{blue}{12 \cdot {b}^{2}} \]
      14. Step-by-step derivation
        1. unpow2N/A

          \[\leadsto 12 \cdot \left(b \cdot \color{blue}{b}\right) \]
        2. associate-*r*N/A

          \[\leadsto \left(12 \cdot b\right) \cdot \color{blue}{b} \]
        3. *-commutativeN/A

          \[\leadsto b \cdot \color{blue}{\left(12 \cdot b\right)} \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(12 \cdot b\right)}\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{12}\right)\right) \]
        6. *-lowering-*.f6443.5%

          \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{12}\right)\right) \]
      15. Simplified43.5%

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

      if -9.4999999999999992e-133 < a < 2.4500000000000002

      1. Initial program 99.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(3 + a\right)\right)\right) - 1 \]
      2. Add Preprocessing
      3. Taylor expanded in b around inf

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left({b}^{4}\right)}, 1\right) \]
      4. Step-by-step derivation
        1. metadata-evalN/A

          \[\leadsto \mathsf{\_.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), 1\right) \]
        2. pow-sqrN/A

          \[\leadsto \mathsf{\_.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), 1\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{\_.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), 1\right) \]
        4. associate-*l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), 1\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), 1\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), 1\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), 1\right) \]
        8. *-lowering-*.f6497.3%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), 1\right) \]
      5. Simplified97.3%

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

        \[\leadsto \color{blue}{-1} \]
      7. Step-by-step derivation
        1. Simplified52.8%

          \[\leadsto \color{blue}{-1} \]
      8. Recombined 3 regimes into one program.
      9. Add Preprocessing

      Alternative 6: 93.6% accurate, 5.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+46}:\\ \;\;\;\;a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right) + a \cdot 4\right) + -1\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \end{array} \end{array} \]
      (FPCore (a b)
       :precision binary64
       (if (<= (* b b) 5e+46)
         (+ (* a (+ (* a (* a (+ a -4.0))) (* a 4.0))) -1.0)
         (* b (* b (* b b)))))
      double code(double a, double b) {
      	double tmp;
      	if ((b * b) <= 5e+46) {
      		tmp = (a * ((a * (a * (a + -4.0))) + (a * 4.0))) + -1.0;
      	} else {
      		tmp = b * (b * (b * b));
      	}
      	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+46) then
              tmp = (a * ((a * (a * (a + (-4.0d0)))) + (a * 4.0d0))) + (-1.0d0)
          else
              tmp = b * (b * (b * b))
          end if
          code = tmp
      end function
      
      public static double code(double a, double b) {
      	double tmp;
      	if ((b * b) <= 5e+46) {
      		tmp = (a * ((a * (a * (a + -4.0))) + (a * 4.0))) + -1.0;
      	} else {
      		tmp = b * (b * (b * b));
      	}
      	return tmp;
      }
      
      def code(a, b):
      	tmp = 0
      	if (b * b) <= 5e+46:
      		tmp = (a * ((a * (a * (a + -4.0))) + (a * 4.0))) + -1.0
      	else:
      		tmp = b * (b * (b * b))
      	return tmp
      
      function code(a, b)
      	tmp = 0.0
      	if (Float64(b * b) <= 5e+46)
      		tmp = Float64(Float64(a * Float64(Float64(a * Float64(a * Float64(a + -4.0))) + Float64(a * 4.0))) + -1.0);
      	else
      		tmp = Float64(b * Float64(b * Float64(b * b)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b)
      	tmp = 0.0;
      	if ((b * b) <= 5e+46)
      		tmp = (a * ((a * (a * (a + -4.0))) + (a * 4.0))) + -1.0;
      	else
      		tmp = b * (b * (b * b));
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 5e+46], N[(N[(a * N[(N[(a * N[(a * N[(a + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+46}:\\
      \;\;\;\;a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right) + a \cdot 4\right) + -1\\
      
      \mathbf{else}:\\
      \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 b b) < 5.0000000000000002e46

        1. Initial program 80.5%

          \[\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(3 + a\right)\right)\right) - 1 \]
        2. Add Preprocessing
        3. Taylor expanded in b around 0

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right) + {a}^{4}\right)}, 1\right) \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{4} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          2. metadata-evalN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{\left(2 \cdot 2\right)} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          3. pow-sqrN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left(\left(1 - a\right) \cdot {a}^{2}\right)\right), 1\right) \]
          5. associate-*r*N/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + \left(4 \cdot \left(1 - a\right)\right) \cdot {a}^{2}\right), 1\right) \]
          6. distribute-rgt-outN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left({a}^{2}\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left({a}^{2}\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          11. unpow2N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \left(1 - a\right)\right)\right)\right), 1\right) \]
          14. --lowering--.f6497.5%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(1, a\right)\right)\right)\right), 1\right) \]
        5. Simplified97.5%

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

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \color{blue}{\left(4 + a \cdot \left(a - 4\right)\right)}\right), 1\right) \]
        7. Step-by-step derivation
          1. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \left(a \cdot \left(a - 4\right)\right)\right)\right), 1\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a - 4\right)\right)\right)\right), 1\right) \]
          3. sub-negN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a + \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), 1\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a + -4\right)\right)\right)\right), 1\right) \]
          5. +-lowering-+.f6497.5%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right)\right), 1\right) \]
        8. Simplified97.5%

          \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(4 + a \cdot \left(a + -4\right)\right)} - 1 \]
        9. Step-by-step derivation
          1. distribute-rgt-inN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(4 \cdot \left(a \cdot a\right) + \left(a \cdot \left(a + -4\right)\right) \cdot \left(a \cdot a\right)\right), 1\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(4 \cdot \left(a \cdot a\right) + \left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right), 1\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(4 \cdot \left(a \cdot a\right)\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right), 1\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a\right) \cdot 4\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right), 1\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a\right), 4\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right), 1\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right), 1\right) \]
          7. associate-*l*N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \left(a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right)\right), 1\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \mathsf{*.f64}\left(a, \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right)\right), 1\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \left(a + -4\right)\right)\right)\right)\right), 1\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a + -4\right)\right)\right)\right)\right), 1\right) \]
          11. +-lowering-+.f6497.5%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), 4\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right)\right)\right), 1\right) \]
        10. Applied egg-rr97.5%

          \[\leadsto \color{blue}{\left(\left(a \cdot a\right) \cdot 4 + a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right)\right)} - 1 \]
        11. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right) + \left(a \cdot a\right) \cdot 4\right), 1\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right) + a \cdot \left(a \cdot 4\right)\right), 1\right) \]
          3. distribute-lft-outN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot \left(a \cdot \left(a \cdot \left(a + -4\right)\right) + a \cdot 4\right)\right), 1\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot \left(a \cdot \left(a + -4\right)\right) + a \cdot 4\right)\right), 1\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(a \cdot \left(a \cdot \left(a + -4\right)\right)\right), \left(a \cdot 4\right)\right)\right), 1\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot \left(a + -4\right)\right)\right), \left(a \cdot 4\right)\right)\right), 1\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a + -4\right)\right)\right), \left(a \cdot 4\right)\right)\right), 1\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right), \left(a \cdot 4\right)\right)\right), 1\right) \]
          9. *-lowering-*.f6497.6%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right), \mathsf{*.f64}\left(a, 4\right)\right)\right), 1\right) \]
        12. Applied egg-rr97.6%

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

        if 5.0000000000000002e46 < (*.f64 b b)

        1. Initial program 62.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(3 + a\right)\right)\right) - 1 \]
        2. Step-by-step derivation
          1. associate--l+N/A

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

            \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
          3. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
          12. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
        3. Simplified62.8%

          \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in b around inf

          \[\leadsto \color{blue}{{b}^{4}} \]
        6. Step-by-step derivation
          1. metadata-evalN/A

            \[\leadsto {b}^{\left(2 \cdot \color{blue}{2}\right)} \]
          2. pow-sqrN/A

            \[\leadsto {b}^{2} \cdot \color{blue}{{b}^{2}} \]
          3. unpow2N/A

            \[\leadsto \left(b \cdot b\right) \cdot {\color{blue}{b}}^{2} \]
          4. associate-*l*N/A

            \[\leadsto b \cdot \color{blue}{\left(b \cdot {b}^{2}\right)} \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot {b}^{2}\right)}\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
          7. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
          8. *-lowering-*.f6492.7%

            \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
        7. Simplified92.7%

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

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

      Alternative 7: 93.6% accurate, 6.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+46}:\\ \;\;\;\;-1 + \left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \end{array} \end{array} \]
      (FPCore (a b)
       :precision binary64
       (if (<= (* b b) 5e+46)
         (+ -1.0 (* (* a a) (+ 4.0 (* a (+ a -4.0)))))
         (* b (* b (* b b)))))
      double code(double a, double b) {
      	double tmp;
      	if ((b * b) <= 5e+46) {
      		tmp = -1.0 + ((a * a) * (4.0 + (a * (a + -4.0))));
      	} else {
      		tmp = b * (b * (b * b));
      	}
      	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+46) then
              tmp = (-1.0d0) + ((a * a) * (4.0d0 + (a * (a + (-4.0d0)))))
          else
              tmp = b * (b * (b * b))
          end if
          code = tmp
      end function
      
      public static double code(double a, double b) {
      	double tmp;
      	if ((b * b) <= 5e+46) {
      		tmp = -1.0 + ((a * a) * (4.0 + (a * (a + -4.0))));
      	} else {
      		tmp = b * (b * (b * b));
      	}
      	return tmp;
      }
      
      def code(a, b):
      	tmp = 0
      	if (b * b) <= 5e+46:
      		tmp = -1.0 + ((a * a) * (4.0 + (a * (a + -4.0))))
      	else:
      		tmp = b * (b * (b * b))
      	return tmp
      
      function code(a, b)
      	tmp = 0.0
      	if (Float64(b * b) <= 5e+46)
      		tmp = Float64(-1.0 + Float64(Float64(a * a) * Float64(4.0 + Float64(a * Float64(a + -4.0)))));
      	else
      		tmp = Float64(b * Float64(b * Float64(b * b)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b)
      	tmp = 0.0;
      	if ((b * b) <= 5e+46)
      		tmp = -1.0 + ((a * a) * (4.0 + (a * (a + -4.0))));
      	else
      		tmp = b * (b * (b * b));
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 5e+46], N[(-1.0 + N[(N[(a * a), $MachinePrecision] * N[(4.0 + N[(a * N[(a + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+46}:\\
      \;\;\;\;-1 + \left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 b b) < 5.0000000000000002e46

        1. Initial program 80.5%

          \[\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(3 + a\right)\right)\right) - 1 \]
        2. Add Preprocessing
        3. Taylor expanded in b around 0

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right) + {a}^{4}\right)}, 1\right) \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{4} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          2. metadata-evalN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{\left(2 \cdot 2\right)} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          3. pow-sqrN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left(\left(1 - a\right) \cdot {a}^{2}\right)\right), 1\right) \]
          5. associate-*r*N/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + \left(4 \cdot \left(1 - a\right)\right) \cdot {a}^{2}\right), 1\right) \]
          6. distribute-rgt-outN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left({a}^{2}\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left({a}^{2}\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          11. unpow2N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \left(1 - a\right)\right)\right)\right), 1\right) \]
          14. --lowering--.f6497.5%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(1, a\right)\right)\right)\right), 1\right) \]
        5. Simplified97.5%

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

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \color{blue}{\left(4 + a \cdot \left(a - 4\right)\right)}\right), 1\right) \]
        7. Step-by-step derivation
          1. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \left(a \cdot \left(a - 4\right)\right)\right)\right), 1\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a - 4\right)\right)\right)\right), 1\right) \]
          3. sub-negN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a + \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), 1\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \left(a + -4\right)\right)\right)\right), 1\right) \]
          5. +-lowering-+.f6497.5%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(a, -4\right)\right)\right)\right), 1\right) \]
        8. Simplified97.5%

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

        if 5.0000000000000002e46 < (*.f64 b b)

        1. Initial program 62.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(3 + a\right)\right)\right) - 1 \]
        2. Step-by-step derivation
          1. associate--l+N/A

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

            \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
          3. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
          12. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
        3. Simplified62.8%

          \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in b around inf

          \[\leadsto \color{blue}{{b}^{4}} \]
        6. Step-by-step derivation
          1. metadata-evalN/A

            \[\leadsto {b}^{\left(2 \cdot \color{blue}{2}\right)} \]
          2. pow-sqrN/A

            \[\leadsto {b}^{2} \cdot \color{blue}{{b}^{2}} \]
          3. unpow2N/A

            \[\leadsto \left(b \cdot b\right) \cdot {\color{blue}{b}}^{2} \]
          4. associate-*l*N/A

            \[\leadsto b \cdot \color{blue}{\left(b \cdot {b}^{2}\right)} \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot {b}^{2}\right)}\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
          7. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
          8. *-lowering-*.f6492.7%

            \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
        7. Simplified92.7%

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

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

      Alternative 8: 92.8% accurate, 7.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+46}:\\ \;\;\;\;-1 + \left(a \cdot a\right) \cdot \left(a \cdot a + 4\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \end{array} \end{array} \]
      (FPCore (a b)
       :precision binary64
       (if (<= (* b b) 5e+46)
         (+ -1.0 (* (* a a) (+ (* a a) 4.0)))
         (* b (* b (* b b)))))
      double code(double a, double b) {
      	double tmp;
      	if ((b * b) <= 5e+46) {
      		tmp = -1.0 + ((a * a) * ((a * a) + 4.0));
      	} else {
      		tmp = b * (b * (b * b));
      	}
      	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+46) then
              tmp = (-1.0d0) + ((a * a) * ((a * a) + 4.0d0))
          else
              tmp = b * (b * (b * b))
          end if
          code = tmp
      end function
      
      public static double code(double a, double b) {
      	double tmp;
      	if ((b * b) <= 5e+46) {
      		tmp = -1.0 + ((a * a) * ((a * a) + 4.0));
      	} else {
      		tmp = b * (b * (b * b));
      	}
      	return tmp;
      }
      
      def code(a, b):
      	tmp = 0
      	if (b * b) <= 5e+46:
      		tmp = -1.0 + ((a * a) * ((a * a) + 4.0))
      	else:
      		tmp = b * (b * (b * b))
      	return tmp
      
      function code(a, b)
      	tmp = 0.0
      	if (Float64(b * b) <= 5e+46)
      		tmp = Float64(-1.0 + Float64(Float64(a * a) * Float64(Float64(a * a) + 4.0)));
      	else
      		tmp = Float64(b * Float64(b * Float64(b * b)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b)
      	tmp = 0.0;
      	if ((b * b) <= 5e+46)
      		tmp = -1.0 + ((a * a) * ((a * a) + 4.0));
      	else
      		tmp = b * (b * (b * b));
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 5e+46], N[(-1.0 + N[(N[(a * a), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+46}:\\
      \;\;\;\;-1 + \left(a \cdot a\right) \cdot \left(a \cdot a + 4\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 b b) < 5.0000000000000002e46

        1. Initial program 80.5%

          \[\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(3 + a\right)\right)\right) - 1 \]
        2. Add Preprocessing
        3. Taylor expanded in b around 0

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right) + {a}^{4}\right)}, 1\right) \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{4} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          2. metadata-evalN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{\left(2 \cdot 2\right)} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          3. pow-sqrN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left(\left(1 - a\right) \cdot {a}^{2}\right)\right), 1\right) \]
          5. associate-*r*N/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + \left(4 \cdot \left(1 - a\right)\right) \cdot {a}^{2}\right), 1\right) \]
          6. distribute-rgt-outN/A

            \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left({a}^{2}\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left({a}^{2}\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          11. unpow2N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \left(1 - a\right)\right)\right)\right), 1\right) \]
          14. --lowering--.f6497.5%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(1, a\right)\right)\right)\right), 1\right) \]
        5. Simplified97.5%

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

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \color{blue}{4}\right)\right), 1\right) \]
        7. Step-by-step derivation
          1. Simplified94.6%

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

          if 5.0000000000000002e46 < (*.f64 b b)

          1. Initial program 62.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(3 + a\right)\right)\right) - 1 \]
          2. Step-by-step derivation
            1. associate--l+N/A

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

              \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
            3. unpow2N/A

              \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
            4. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
            5. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
            6. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
            8. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
            9. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
            10. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
            12. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
          3. Simplified62.8%

            \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
          4. Add Preprocessing
          5. Taylor expanded in b around inf

            \[\leadsto \color{blue}{{b}^{4}} \]
          6. Step-by-step derivation
            1. metadata-evalN/A

              \[\leadsto {b}^{\left(2 \cdot \color{blue}{2}\right)} \]
            2. pow-sqrN/A

              \[\leadsto {b}^{2} \cdot \color{blue}{{b}^{2}} \]
            3. unpow2N/A

              \[\leadsto \left(b \cdot b\right) \cdot {\color{blue}{b}}^{2} \]
            4. associate-*l*N/A

              \[\leadsto b \cdot \color{blue}{\left(b \cdot {b}^{2}\right)} \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot {b}^{2}\right)}\right) \]
            6. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
            7. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
            8. *-lowering-*.f6492.7%

              \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
          7. Simplified92.7%

            \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification93.7%

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

        Alternative 9: 66.2% accurate, 7.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.9 \cdot 10^{-21}:\\ \;\;\;\;-1 + \left(a \cdot a\right) \cdot 4\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+23}:\\ \;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (if (<= b 1.9e-21)
           (+ -1.0 (* (* a a) 4.0))
           (if (<= b 4.8e+23) (* a (* a (* a a))) (* b (* b (* b b))))))
        double code(double a, double b) {
        	double tmp;
        	if (b <= 1.9e-21) {
        		tmp = -1.0 + ((a * a) * 4.0);
        	} else if (b <= 4.8e+23) {
        		tmp = a * (a * (a * a));
        	} else {
        		tmp = b * (b * (b * b));
        	}
        	return tmp;
        }
        
        real(8) function code(a, b)
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8) :: tmp
            if (b <= 1.9d-21) then
                tmp = (-1.0d0) + ((a * a) * 4.0d0)
            else if (b <= 4.8d+23) then
                tmp = a * (a * (a * a))
            else
                tmp = b * (b * (b * b))
            end if
            code = tmp
        end function
        
        public static double code(double a, double b) {
        	double tmp;
        	if (b <= 1.9e-21) {
        		tmp = -1.0 + ((a * a) * 4.0);
        	} else if (b <= 4.8e+23) {
        		tmp = a * (a * (a * a));
        	} else {
        		tmp = b * (b * (b * b));
        	}
        	return tmp;
        }
        
        def code(a, b):
        	tmp = 0
        	if b <= 1.9e-21:
        		tmp = -1.0 + ((a * a) * 4.0)
        	elif b <= 4.8e+23:
        		tmp = a * (a * (a * a))
        	else:
        		tmp = b * (b * (b * b))
        	return tmp
        
        function code(a, b)
        	tmp = 0.0
        	if (b <= 1.9e-21)
        		tmp = Float64(-1.0 + Float64(Float64(a * a) * 4.0));
        	elseif (b <= 4.8e+23)
        		tmp = Float64(a * Float64(a * Float64(a * a)));
        	else
        		tmp = Float64(b * Float64(b * Float64(b * b)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(a, b)
        	tmp = 0.0;
        	if (b <= 1.9e-21)
        		tmp = -1.0 + ((a * a) * 4.0);
        	elseif (b <= 4.8e+23)
        		tmp = a * (a * (a * a));
        	else
        		tmp = b * (b * (b * b));
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_] := If[LessEqual[b, 1.9e-21], N[(-1.0 + N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.8e+23], N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b \leq 1.9 \cdot 10^{-21}:\\
        \;\;\;\;-1 + \left(a \cdot a\right) \cdot 4\\
        
        \mathbf{elif}\;b \leq 4.8 \cdot 10^{+23}:\\
        \;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if b < 1.8999999999999999e-21

          1. Initial program 76.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(3 + a\right)\right)\right) - 1 \]
          2. Add Preprocessing
          3. Taylor expanded in b around 0

            \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right) + {a}^{4}\right)}, 1\right) \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\left({a}^{4} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
            2. metadata-evalN/A

              \[\leadsto \mathsf{\_.f64}\left(\left({a}^{\left(2 \cdot 2\right)} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
            3. pow-sqrN/A

              \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left(\left(1 - a\right) \cdot {a}^{2}\right)\right), 1\right) \]
            5. associate-*r*N/A

              \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + \left(4 \cdot \left(1 - a\right)\right) \cdot {a}^{2}\right), 1\right) \]
            6. distribute-rgt-outN/A

              \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left({a}^{2}\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
            8. unpow2N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
            9. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
            10. +-lowering-+.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left({a}^{2}\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
            11. unpow2N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
            12. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
            13. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \left(1 - a\right)\right)\right)\right), 1\right) \]
            14. --lowering--.f6480.0%

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(1, a\right)\right)\right)\right), 1\right) \]
          5. Simplified80.0%

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \color{blue}{4}\right), 1\right) \]
          7. Step-by-step derivation
            1. Simplified56.6%

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

            if 1.8999999999999999e-21 < b < 4.8e23

            1. Initial program 44.1%

              \[\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(3 + a\right)\right)\right) - 1 \]
            2. Step-by-step derivation
              1. associate--l+N/A

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

                \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
              3. unpow2N/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
              5. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
              8. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
              9. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
              10. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
              11. sub-negN/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
              12. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
            3. Simplified44.3%

              \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
            4. Add Preprocessing
            5. Taylor expanded in a around inf

              \[\leadsto \color{blue}{{a}^{4}} \]
            6. Step-by-step derivation
              1. metadata-evalN/A

                \[\leadsto {a}^{\left(3 + \color{blue}{1}\right)} \]
              2. pow-plusN/A

                \[\leadsto {a}^{3} \cdot \color{blue}{a} \]
              3. *-commutativeN/A

                \[\leadsto a \cdot \color{blue}{{a}^{3}} \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{3}\right)}\right) \]
              5. cube-multN/A

                \[\leadsto \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \]
              6. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(a, \left(a \cdot {a}^{\color{blue}{2}}\right)\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{2}\right)}\right)\right) \]
              8. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{a}\right)\right)\right) \]
              9. *-lowering-*.f6478.5%

                \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right) \]
            7. Simplified78.5%

              \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(a \cdot a\right)\right)} \]

            if 4.8e23 < b

            1. Initial program 63.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(3 + a\right)\right)\right) - 1 \]
            2. Step-by-step derivation
              1. associate--l+N/A

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

                \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
              3. unpow2N/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
              5. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
              8. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
              9. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
              10. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
              11. sub-negN/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
              12. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
            3. Simplified63.3%

              \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
            4. Add Preprocessing
            5. Taylor expanded in b around inf

              \[\leadsto \color{blue}{{b}^{4}} \]
            6. Step-by-step derivation
              1. metadata-evalN/A

                \[\leadsto {b}^{\left(2 \cdot \color{blue}{2}\right)} \]
              2. pow-sqrN/A

                \[\leadsto {b}^{2} \cdot \color{blue}{{b}^{2}} \]
              3. unpow2N/A

                \[\leadsto \left(b \cdot b\right) \cdot {\color{blue}{b}}^{2} \]
              4. associate-*l*N/A

                \[\leadsto b \cdot \color{blue}{\left(b \cdot {b}^{2}\right)} \]
              5. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot {b}^{2}\right)}\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
              7. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
              8. *-lowering-*.f6492.1%

                \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
            7. Simplified92.1%

              \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification65.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.9 \cdot 10^{-21}:\\ \;\;\;\;-1 + \left(a \cdot a\right) \cdot 4\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+23}:\\ \;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 10: 38.6% accurate, 7.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 232:\\ \;\;\;\;-1\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{+146}:\\ \;\;\;\;a \cdot \left(a \cdot \left(a \cdot -4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot 12\right)\\ \end{array} \end{array} \]
          (FPCore (a b)
           :precision binary64
           (if (<= b 232.0)
             -1.0
             (if (<= b 2.2e+146) (* a (* a (* a -4.0))) (* b (* b 12.0)))))
          double code(double a, double b) {
          	double tmp;
          	if (b <= 232.0) {
          		tmp = -1.0;
          	} else if (b <= 2.2e+146) {
          		tmp = a * (a * (a * -4.0));
          	} else {
          		tmp = b * (b * 12.0);
          	}
          	return tmp;
          }
          
          real(8) function code(a, b)
              real(8), intent (in) :: a
              real(8), intent (in) :: b
              real(8) :: tmp
              if (b <= 232.0d0) then
                  tmp = -1.0d0
              else if (b <= 2.2d+146) then
                  tmp = a * (a * (a * (-4.0d0)))
              else
                  tmp = b * (b * 12.0d0)
              end if
              code = tmp
          end function
          
          public static double code(double a, double b) {
          	double tmp;
          	if (b <= 232.0) {
          		tmp = -1.0;
          	} else if (b <= 2.2e+146) {
          		tmp = a * (a * (a * -4.0));
          	} else {
          		tmp = b * (b * 12.0);
          	}
          	return tmp;
          }
          
          def code(a, b):
          	tmp = 0
          	if b <= 232.0:
          		tmp = -1.0
          	elif b <= 2.2e+146:
          		tmp = a * (a * (a * -4.0))
          	else:
          		tmp = b * (b * 12.0)
          	return tmp
          
          function code(a, b)
          	tmp = 0.0
          	if (b <= 232.0)
          		tmp = -1.0;
          	elseif (b <= 2.2e+146)
          		tmp = Float64(a * Float64(a * Float64(a * -4.0)));
          	else
          		tmp = Float64(b * Float64(b * 12.0));
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, b)
          	tmp = 0.0;
          	if (b <= 232.0)
          		tmp = -1.0;
          	elseif (b <= 2.2e+146)
          		tmp = a * (a * (a * -4.0));
          	else
          		tmp = b * (b * 12.0);
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, b_] := If[LessEqual[b, 232.0], -1.0, If[LessEqual[b, 2.2e+146], N[(a * N[(a * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * 12.0), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \leq 232:\\
          \;\;\;\;-1\\
          
          \mathbf{elif}\;b \leq 2.2 \cdot 10^{+146}:\\
          \;\;\;\;a \cdot \left(a \cdot \left(a \cdot -4\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;b \cdot \left(b \cdot 12\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if b < 232

            1. Initial program 76.0%

              \[\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(3 + a\right)\right)\right) - 1 \]
            2. Add Preprocessing
            3. Taylor expanded in b around inf

              \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left({b}^{4}\right)}, 1\right) \]
            4. Step-by-step derivation
              1. metadata-evalN/A

                \[\leadsto \mathsf{\_.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), 1\right) \]
              2. pow-sqrN/A

                \[\leadsto \mathsf{\_.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), 1\right) \]
              3. unpow2N/A

                \[\leadsto \mathsf{\_.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), 1\right) \]
              4. associate-*l*N/A

                \[\leadsto \mathsf{\_.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), 1\right) \]
              5. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), 1\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), 1\right) \]
              7. unpow2N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), 1\right) \]
              8. *-lowering-*.f6459.8%

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), 1\right) \]
            5. Simplified59.8%

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

              \[\leadsto \color{blue}{-1} \]
            7. Step-by-step derivation
              1. Simplified31.8%

                \[\leadsto \color{blue}{-1} \]

              if 232 < b < 2.1999999999999998e146

              1. Initial program 48.0%

                \[\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(3 + a\right)\right)\right) - 1 \]
              2. Add Preprocessing
              3. Taylor expanded in b around 0

                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right) + {a}^{4}\right)}, 1\right) \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({a}^{4} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
                2. metadata-evalN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({a}^{\left(2 \cdot 2\right)} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
                3. pow-sqrN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left({a}^{2} \cdot \left(1 - a\right)\right)\right), 1\right) \]
                4. *-commutativeN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + 4 \cdot \left(\left(1 - a\right) \cdot {a}^{2}\right)\right), 1\right) \]
                5. associate-*r*N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot {a}^{2} + \left(4 \cdot \left(1 - a\right)\right) \cdot {a}^{2}\right), 1\right) \]
                6. distribute-rgt-outN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({a}^{2} \cdot \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left({a}^{2}\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
                8. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
                9. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({a}^{2} + 4 \cdot \left(1 - a\right)\right)\right), 1\right) \]
                10. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left({a}^{2}\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
                11. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
                12. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(4 \cdot \left(1 - a\right)\right)\right)\right), 1\right) \]
                13. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \left(1 - a\right)\right)\right)\right), 1\right) \]
                14. --lowering--.f6459.7%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(1, a\right)\right)\right)\right), 1\right) \]
              5. Simplified59.7%

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

                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left({a}^{2} \cdot \left(4 + -4 \cdot a\right)\right)}, 1\right) \]
              7. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\left(a \cdot a\right) \cdot \left(4 + -4 \cdot a\right)\right), 1\right) \]
                2. associate-*l*N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot \left(a \cdot \left(4 + -4 \cdot a\right)\right)\right), 1\right) \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot \left(4 + -4 \cdot a\right)\right)\right), 1\right) \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(4 + -4 \cdot a\right)\right)\right), 1\right) \]
                5. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(4, \left(-4 \cdot a\right)\right)\right)\right), 1\right) \]
                6. *-commutativeN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(4, \left(a \cdot -4\right)\right)\right)\right), 1\right) \]
                7. *-lowering-*.f6422.7%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(a, -4\right)\right)\right)\right), 1\right) \]
              8. Simplified22.7%

                \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(4 + a \cdot -4\right)\right)} - 1 \]
              9. Taylor expanded in a around inf

                \[\leadsto \color{blue}{-4 \cdot {a}^{3}} \]
              10. Step-by-step derivation
                1. unpow3N/A

                  \[\leadsto -4 \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{a}\right) \]
                2. unpow2N/A

                  \[\leadsto -4 \cdot \left({a}^{2} \cdot a\right) \]
                3. associate-*r*N/A

                  \[\leadsto \left(-4 \cdot {a}^{2}\right) \cdot \color{blue}{a} \]
                4. *-commutativeN/A

                  \[\leadsto a \cdot \color{blue}{\left(-4 \cdot {a}^{2}\right)} \]
                5. metadata-evalN/A

                  \[\leadsto a \cdot \left(\left(\mathsf{neg}\left(4\right)\right) \cdot {\color{blue}{a}}^{2}\right) \]
                6. distribute-lft-neg-inN/A

                  \[\leadsto a \cdot \left(\mathsf{neg}\left(4 \cdot {a}^{2}\right)\right) \]
                7. *-commutativeN/A

                  \[\leadsto a \cdot \left(\mathsf{neg}\left({a}^{2} \cdot 4\right)\right) \]
                8. distribute-lft-neg-inN/A

                  \[\leadsto a \cdot \left(\left(\mathsf{neg}\left({a}^{2}\right)\right) \cdot \color{blue}{4}\right) \]
                9. metadata-evalN/A

                  \[\leadsto a \cdot \left(\left(\mathsf{neg}\left({a}^{2}\right)\right) \cdot \left(1 \cdot \color{blue}{4}\right)\right) \]
                10. rgt-mult-inverseN/A

                  \[\leadsto a \cdot \left(\left(\mathsf{neg}\left({a}^{2}\right)\right) \cdot \left(\left(a \cdot \frac{1}{a}\right) \cdot 4\right)\right) \]
                11. associate-*r*N/A

                  \[\leadsto a \cdot \left(\left(\mathsf{neg}\left({a}^{2}\right)\right) \cdot \left(a \cdot \color{blue}{\left(\frac{1}{a} \cdot 4\right)}\right)\right) \]
                12. *-commutativeN/A

                  \[\leadsto a \cdot \left(\left(\mathsf{neg}\left({a}^{2}\right)\right) \cdot \left(a \cdot \left(4 \cdot \color{blue}{\frac{1}{a}}\right)\right)\right) \]
                13. distribute-lft-neg-inN/A

                  \[\leadsto a \cdot \left(\mathsf{neg}\left({a}^{2} \cdot \left(a \cdot \left(4 \cdot \frac{1}{a}\right)\right)\right)\right) \]
                14. associate-*l*N/A

                  \[\leadsto a \cdot \left(\mathsf{neg}\left(\left({a}^{2} \cdot a\right) \cdot \left(4 \cdot \frac{1}{a}\right)\right)\right) \]
                15. unpow2N/A

                  \[\leadsto a \cdot \left(\mathsf{neg}\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(4 \cdot \frac{1}{a}\right)\right)\right) \]
                16. unpow3N/A

                  \[\leadsto a \cdot \left(\mathsf{neg}\left({a}^{3} \cdot \left(4 \cdot \frac{1}{a}\right)\right)\right) \]
                17. distribute-rgt-neg-outN/A

                  \[\leadsto a \cdot \left({a}^{3} \cdot \color{blue}{\left(\mathsf{neg}\left(4 \cdot \frac{1}{a}\right)\right)}\right) \]
                18. *-commutativeN/A

                  \[\leadsto a \cdot \left(\left(\mathsf{neg}\left(4 \cdot \frac{1}{a}\right)\right) \cdot \color{blue}{{a}^{3}}\right) \]
                19. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(\left(\mathsf{neg}\left(4 \cdot \frac{1}{a}\right)\right) \cdot {a}^{3}\right)}\right) \]
                20. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(a, \left({a}^{3} \cdot \color{blue}{\left(\mathsf{neg}\left(4 \cdot \frac{1}{a}\right)\right)}\right)\right) \]
              11. Simplified23.0%

                \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(a \cdot -4\right)\right)} \]

              if 2.1999999999999998e146 < b

              1. Initial program 72.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(3 + a\right)\right)\right) - 1 \]
              2. Step-by-step derivation
                1. associate--l+N/A

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

                  \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
                3. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                5. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                8. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                9. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
                11. sub-negN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
                12. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
              3. Simplified72.2%

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{\left(3 \cdot {b}^{2}\right)}\right), -1\right)\right) \]
              6. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(3 \cdot \left(b \cdot b\right)\right)\right), -1\right)\right) \]
                2. associate-*r*N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(\left(3 \cdot b\right) \cdot b\right)\right), -1\right)\right) \]
                3. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(b \cdot \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
                5. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(b \cdot 3\right)\right)\right), -1\right)\right) \]
                6. *-lowering-*.f64100.0%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, 3\right)\right)\right), -1\right)\right) \]
              7. Simplified100.0%

                \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \color{blue}{\left(b \cdot \left(b \cdot 3\right)\right)} + -1\right) \]
              8. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(-1 + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)}\right) \]
                2. associate-+r+N/A

                  \[\leadsto \left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right) + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)} \]
                3. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right), \color{blue}{\left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)}\right) \]
                4. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(\color{blue}{4} \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                6. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                8. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                9. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                11. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                12. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot \left(b \cdot 3\right)\right) \cdot \color{blue}{4}\right)\right) \]
                13. associate-*r*N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(\left(b \cdot b\right) \cdot 3\right) \cdot 4\right)\right) \]
                14. associate-*l*N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot \color{blue}{\left(3 \cdot 4\right)}\right)\right) \]
                15. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot 12\right)\right) \]
                16. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\left(b \cdot b\right), \color{blue}{12}\right)\right) \]
                17. *-lowering-*.f64100.0%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
              9. Applied egg-rr100.0%

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

                \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({b}^{4}\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
              11. Step-by-step derivation
                1. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \color{blue}{b}\right), 12\right)\right) \]
                2. pow-sqrN/A

                  \[\leadsto \mathsf{+.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
                3. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{b}, b\right), 12\right)\right) \]
                4. associate-*l*N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \color{blue}{b}\right), 12\right)\right) \]
                7. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
                8. *-lowering-*.f64100.0%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
              12. Simplified100.0%

                \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \left(b \cdot b\right) \cdot 12 \]
              13. Taylor expanded in b around 0

                \[\leadsto \color{blue}{12 \cdot {b}^{2}} \]
              14. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto 12 \cdot \left(b \cdot \color{blue}{b}\right) \]
                2. associate-*r*N/A

                  \[\leadsto \left(12 \cdot b\right) \cdot \color{blue}{b} \]
                3. *-commutativeN/A

                  \[\leadsto b \cdot \color{blue}{\left(12 \cdot b\right)} \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(12 \cdot b\right)}\right) \]
                5. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{12}\right)\right) \]
                6. *-lowering-*.f6490.6%

                  \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{12}\right)\right) \]
              15. Simplified90.6%

                \[\leadsto \color{blue}{b \cdot \left(b \cdot 12\right)} \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 11: 80.9% accurate, 9.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{+23}:\\ \;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \end{array} \end{array} \]
            (FPCore (a b)
             :precision binary64
             (if (<= b 6.6e+23) (+ (* a (* a (* a a))) -1.0) (* b (* b (* b b)))))
            double code(double a, double b) {
            	double tmp;
            	if (b <= 6.6e+23) {
            		tmp = (a * (a * (a * a))) + -1.0;
            	} else {
            		tmp = b * (b * (b * b));
            	}
            	return tmp;
            }
            
            real(8) function code(a, b)
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8) :: tmp
                if (b <= 6.6d+23) then
                    tmp = (a * (a * (a * a))) + (-1.0d0)
                else
                    tmp = b * (b * (b * b))
                end if
                code = tmp
            end function
            
            public static double code(double a, double b) {
            	double tmp;
            	if (b <= 6.6e+23) {
            		tmp = (a * (a * (a * a))) + -1.0;
            	} else {
            		tmp = b * (b * (b * b));
            	}
            	return tmp;
            }
            
            def code(a, b):
            	tmp = 0
            	if b <= 6.6e+23:
            		tmp = (a * (a * (a * a))) + -1.0
            	else:
            		tmp = b * (b * (b * b))
            	return tmp
            
            function code(a, b)
            	tmp = 0.0
            	if (b <= 6.6e+23)
            		tmp = Float64(Float64(a * Float64(a * Float64(a * a))) + -1.0);
            	else
            		tmp = Float64(b * Float64(b * Float64(b * b)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b)
            	tmp = 0.0;
            	if (b <= 6.6e+23)
            		tmp = (a * (a * (a * a))) + -1.0;
            	else
            		tmp = b * (b * (b * b));
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_] := If[LessEqual[b, 6.6e+23], N[(N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;b \leq 6.6 \cdot 10^{+23}:\\
            \;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right) + -1\\
            
            \mathbf{else}:\\
            \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if b < 6.60000000000000059e23

              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(3 + a\right)\right)\right) - 1 \]
              2. Add Preprocessing
              3. Taylor expanded in a around inf

                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left({a}^{4}\right)}, 1\right) \]
              4. Step-by-step derivation
                1. metadata-evalN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({a}^{\left(3 + 1\right)}\right), 1\right) \]
                2. pow-plusN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({a}^{3} \cdot a\right), 1\right) \]
                3. *-commutativeN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot {a}^{3}\right), 1\right) \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left({a}^{3}\right)\right), 1\right) \]
                5. cube-multN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot \left(a \cdot a\right)\right)\right), 1\right) \]
                6. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(a \cdot {a}^{2}\right)\right), 1\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left({a}^{2}\right)\right)\right), 1\right) \]
                8. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot a\right)\right)\right), 1\right) \]
                9. *-lowering-*.f6478.0%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right), 1\right) \]
              5. Simplified78.0%

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

              if 6.60000000000000059e23 < b

              1. Initial program 63.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(3 + a\right)\right)\right) - 1 \]
              2. Step-by-step derivation
                1. associate--l+N/A

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

                  \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
                3. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                5. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                8. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                9. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
                11. sub-negN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
                12. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
              3. Simplified63.3%

                \[\leadsto \color{blue}{\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + -1\right)} \]
              4. Add Preprocessing
              5. Taylor expanded in b around inf

                \[\leadsto \color{blue}{{b}^{4}} \]
              6. Step-by-step derivation
                1. metadata-evalN/A

                  \[\leadsto {b}^{\left(2 \cdot \color{blue}{2}\right)} \]
                2. pow-sqrN/A

                  \[\leadsto {b}^{2} \cdot \color{blue}{{b}^{2}} \]
                3. unpow2N/A

                  \[\leadsto \left(b \cdot b\right) \cdot {\color{blue}{b}}^{2} \]
                4. associate-*l*N/A

                  \[\leadsto b \cdot \color{blue}{\left(b \cdot {b}^{2}\right)} \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot {b}^{2}\right)}\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                7. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                8. *-lowering-*.f6492.1%

                  \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
              7. Simplified92.1%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{+23}:\\ \;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 12: 37.2% accurate, 12.8× speedup?

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

              1. Initial program 76.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(3 + a\right)\right)\right) - 1 \]
              2. Add Preprocessing
              3. Taylor expanded in b around inf

                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left({b}^{4}\right)}, 1\right) \]
              4. Step-by-step derivation
                1. metadata-evalN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), 1\right) \]
                2. pow-sqrN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), 1\right) \]
                3. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), 1\right) \]
                4. associate-*l*N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), 1\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), 1\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), 1\right) \]
                7. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), 1\right) \]
                8. *-lowering-*.f6460.4%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), 1\right) \]
              5. Simplified60.4%

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

                \[\leadsto \color{blue}{-1} \]
              7. Step-by-step derivation
                1. Simplified32.2%

                  \[\leadsto \color{blue}{-1} \]

                if 0.28999999999999998 < b

                1. Initial program 59.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(3 + a\right)\right)\right) - 1 \]
                2. Step-by-step derivation
                  1. associate--l+N/A

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

                    \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot a + b \cdot b\right)}^{2}\right), \color{blue}{\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)}\right) \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(\color{blue}{4} \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                  8. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)} - 1\right)\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), \left(4 \cdot \left(\color{blue}{\left(a \cdot a\right) \cdot \left(1 - a\right)} + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) - 1\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \color{blue}{\left(b \cdot b\right) \cdot \left(3 + a\right)}\right) - 1\right)\right) \]
                  11. sub-negN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
                  12. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
                3. Simplified59.9%

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{\left(3 \cdot {b}^{2}\right)}\right), -1\right)\right) \]
                6. Step-by-step derivation
                  1. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(3 \cdot \left(b \cdot b\right)\right)\right), -1\right)\right) \]
                  2. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(\left(3 \cdot b\right) \cdot b\right)\right), -1\right)\right) \]
                  3. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \left(b \cdot \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(3 \cdot b\right)\right)\right), -1\right)\right) \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \left(b \cdot 3\right)\right)\right), -1\right)\right) \]
                  6. *-lowering-*.f6499.9%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, 3\right)\right)\right), -1\right)\right) \]
                7. Simplified99.9%

                  \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(4 \cdot \color{blue}{\left(b \cdot \left(b \cdot 3\right)\right)} + -1\right) \]
                8. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + \left(-1 + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)}\right) \]
                  2. associate-+r+N/A

                    \[\leadsto \left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right) + \color{blue}{4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)} \]
                  3. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right) + -1\right), \color{blue}{\left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)}\right) \]
                  4. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(\color{blue}{4} \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(a \cdot a + b \cdot b\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \left(a \cdot a + b \cdot b\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                  9. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(b \cdot b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                  11. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(4 \cdot \left(b \cdot \left(b \cdot 3\right)\right)\right)\right) \]
                  12. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot \left(b \cdot 3\right)\right) \cdot \color{blue}{4}\right)\right) \]
                  13. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(\left(b \cdot b\right) \cdot 3\right) \cdot 4\right)\right) \]
                  14. associate-*l*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot \color{blue}{\left(3 \cdot 4\right)}\right)\right) \]
                  15. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \left(\left(b \cdot b\right) \cdot 12\right)\right) \]
                  16. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\left(b \cdot b\right), \color{blue}{12}\right)\right) \]
                  17. *-lowering-*.f6499.9%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right), -1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
                9. Applied egg-rr99.9%

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

                  \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({b}^{4}\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
                11. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \color{blue}{b}\right), 12\right)\right) \]
                  2. pow-sqrN/A

                    \[\leadsto \mathsf{+.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{b}, b\right), 12\right)\right) \]
                  4. associate-*l*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, b\right)}, 12\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \color{blue}{b}\right), 12\right)\right) \]
                  7. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
                  8. *-lowering-*.f6485.3%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right) \]
                12. Simplified85.3%

                  \[\leadsto \color{blue}{b \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \left(b \cdot b\right) \cdot 12 \]
                13. Taylor expanded in b around 0

                  \[\leadsto \color{blue}{12 \cdot {b}^{2}} \]
                14. Step-by-step derivation
                  1. unpow2N/A

                    \[\leadsto 12 \cdot \left(b \cdot \color{blue}{b}\right) \]
                  2. associate-*r*N/A

                    \[\leadsto \left(12 \cdot b\right) \cdot \color{blue}{b} \]
                  3. *-commutativeN/A

                    \[\leadsto b \cdot \color{blue}{\left(12 \cdot b\right)} \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(12 \cdot b\right)}\right) \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{12}\right)\right) \]
                  6. *-lowering-*.f6452.6%

                    \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{12}\right)\right) \]
                15. Simplified52.6%

                  \[\leadsto \color{blue}{b \cdot \left(b \cdot 12\right)} \]
              8. Recombined 2 regimes into one program.
              9. Add Preprocessing

              Alternative 13: 24.2% accurate, 128.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 72.5%

                \[\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(3 + a\right)\right)\right) - 1 \]
              2. Add Preprocessing
              3. Taylor expanded in b around inf

                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left({b}^{4}\right)}, 1\right) \]
              4. Step-by-step derivation
                1. metadata-evalN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({b}^{\left(2 \cdot 2\right)}\right), 1\right) \]
                2. pow-sqrN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left({b}^{2} \cdot {b}^{2}\right), 1\right) \]
                3. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\left(b \cdot b\right) \cdot {b}^{2}\right), 1\right) \]
                4. associate-*l*N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(b \cdot \left(b \cdot {b}^{2}\right)\right), 1\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot {b}^{2}\right)\right), 1\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right), 1\right) \]
                7. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(b \cdot b\right)\right)\right), 1\right) \]
                8. *-lowering-*.f6466.7%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right), 1\right) \]
              5. Simplified66.7%

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

                \[\leadsto \color{blue}{-1} \]
              7. Step-by-step derivation
                1. Simplified24.2%

                  \[\leadsto \color{blue}{-1} \]
                2. Add Preprocessing

                Reproduce

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