Bouland and Aaronson, Equation (24)

Percentage Accurate: 73.8% → 99.1%
Time: 13.1s
Alternatives: 14
Speedup: 8.0×

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 14 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.8% 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.1% accurate, 4.7× speedup?

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

\\
\begin{array}{l}
t_0 := a \cdot a + b \cdot b\\
\left(\frac{t\_0}{\frac{1}{t\_0}} + 4 \cdot \left(\left(b \cdot b\right) \cdot 3\right)\right) + -1
\end{array}
\end{array}
Derivation
  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. Add Preprocessing
  3. Step-by-step derivation
    1. unpow2N/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), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
    2. flip3-+N/A

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \frac{1}{\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}}\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
    4. un-div-invN/A

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(a \cdot a + b \cdot b\right), \left(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
    9. clear-numN/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(\frac{1}{\frac{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
    10. flip3-+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), \left(\frac{1}{a \cdot a + b \cdot b}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(1, \left(a \cdot a + b \cdot b\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
    12. +-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(1, \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
  4. Applied egg-rr76.1%

    \[\leadsto \left(\color{blue}{\frac{a \cdot a + b \cdot b}{\frac{1}{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) - 1 \]
  5. Taylor expanded in a around 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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(3 \cdot {b}^{2}\right)}\right)\right), 1\right) \]
  6. Step-by-step derivation
    1. *-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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \left({b}^{2} \cdot 3\right)\right)\right), 1\right) \]
    2. *-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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\left({b}^{2}\right), 3\right)\right)\right), 1\right) \]
    3. unpow2N/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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\left(b \cdot b\right), 3\right)\right)\right), 1\right) \]
    4. *-lowering-*.f6499.3%

      \[\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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 3\right)\right)\right), 1\right) \]
  7. Simplified99.3%

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

    \[\leadsto \left(\frac{a \cdot a + b \cdot b}{\frac{1}{a \cdot a + b \cdot b}} + 4 \cdot \left(\left(b \cdot b\right) \cdot 3\right)\right) + -1 \]
  9. Add Preprocessing

Alternative 2: 96.7% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(4 \cdot \left(\left(b \cdot b\right) \cdot 3\right) + \frac{1}{\frac{\frac{1}{a}}{a \cdot \left(a \cdot a\right)}}\right) + -1\\ \mathbf{if}\;a \leq -0.0034:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{+21}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 12\right) + -1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0
         (+
          (+ (* 4.0 (* (* b b) 3.0)) (/ 1.0 (/ (/ 1.0 a) (* a (* a a)))))
          -1.0)))
   (if (<= a -0.0034)
     t_0
     (if (<= a 8.5e+21) (+ (* (* b b) (+ (* b b) 12.0)) -1.0) t_0))))
double code(double a, double b) {
	double t_0 = ((4.0 * ((b * b) * 3.0)) + (1.0 / ((1.0 / a) / (a * (a * a))))) + -1.0;
	double tmp;
	if (a <= -0.0034) {
		tmp = t_0;
	} else if (a <= 8.5e+21) {
		tmp = ((b * b) * ((b * b) + 12.0)) + -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 = ((4.0d0 * ((b * b) * 3.0d0)) + (1.0d0 / ((1.0d0 / a) / (a * (a * a))))) + (-1.0d0)
    if (a <= (-0.0034d0)) then
        tmp = t_0
    else if (a <= 8.5d+21) then
        tmp = ((b * b) * ((b * b) + 12.0d0)) + (-1.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double t_0 = ((4.0 * ((b * b) * 3.0)) + (1.0 / ((1.0 / a) / (a * (a * a))))) + -1.0;
	double tmp;
	if (a <= -0.0034) {
		tmp = t_0;
	} else if (a <= 8.5e+21) {
		tmp = ((b * b) * ((b * b) + 12.0)) + -1.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, b):
	t_0 = ((4.0 * ((b * b) * 3.0)) + (1.0 / ((1.0 / a) / (a * (a * a))))) + -1.0
	tmp = 0
	if a <= -0.0034:
		tmp = t_0
	elif a <= 8.5e+21:
		tmp = ((b * b) * ((b * b) + 12.0)) + -1.0
	else:
		tmp = t_0
	return tmp
function code(a, b)
	t_0 = Float64(Float64(Float64(4.0 * Float64(Float64(b * b) * 3.0)) + Float64(1.0 / Float64(Float64(1.0 / a) / Float64(a * Float64(a * a))))) + -1.0)
	tmp = 0.0
	if (a <= -0.0034)
		tmp = t_0;
	elseif (a <= 8.5e+21)
		tmp = Float64(Float64(Float64(b * b) * Float64(Float64(b * b) + 12.0)) + -1.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, b)
	t_0 = ((4.0 * ((b * b) * 3.0)) + (1.0 / ((1.0 / a) / (a * (a * a))))) + -1.0;
	tmp = 0.0;
	if (a <= -0.0034)
		tmp = t_0;
	elseif (a <= 8.5e+21)
		tmp = ((b * b) * ((b * b) + 12.0)) + -1.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := Block[{t$95$0 = N[(N[(N[(4.0 * N[(N[(b * b), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] / N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[a, -0.0034], t$95$0, If[LessEqual[a, 8.5e+21], N[(N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 8.5 \cdot 10^{+21}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 12\right) + -1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.00339999999999999981 or 8.5e21 < a

    1. Initial program 47.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. unpow2N/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), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      2. flip3-+N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \frac{1}{\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}}\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      4. un-div-invN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(a \cdot a + b \cdot b\right), \left(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      9. clear-numN/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(\frac{1}{\frac{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      10. flip3-+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), \left(\frac{1}{a \cdot a + b \cdot b}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(1, \left(a \cdot a + b \cdot b\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      12. +-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(1, \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
    4. Applied egg-rr47.8%

      \[\leadsto \left(\color{blue}{\frac{a \cdot a + b \cdot b}{\frac{1}{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) - 1 \]
    5. Taylor expanded in a around 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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(3 \cdot {b}^{2}\right)}\right)\right), 1\right) \]
    6. Step-by-step derivation
      1. *-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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \left({b}^{2} \cdot 3\right)\right)\right), 1\right) \]
      2. *-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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\left({b}^{2}\right), 3\right)\right)\right), 1\right) \]
      3. unpow2N/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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\left(b \cdot b\right), 3\right)\right)\right), 1\right) \]
      4. *-lowering-*.f6499.4%

        \[\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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 3\right)\right)\right), 1\right) \]
    7. Simplified99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, a\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 3\right)\right)\right), 1\right) \]
    12. Simplified97.8%

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

    if -0.00339999999999999981 < a < 8.5e21

    1. Initial program 99.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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.0% accurate, 4.3× speedup?

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

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

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


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

    1. Initial program 81.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. 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.9%

        \[\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.9%

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

    if 4.99999999999999999e-15 < (*.f64 b b)

    1. Initial program 69.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. unpow2N/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), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      2. flip3-+N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a + b \cdot b\right) \cdot \frac{1}{\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}}\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      4. un-div-invN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(a \cdot a + b \cdot b\right), \left(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(\frac{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      9. clear-numN/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(\frac{1}{\frac{{\left(a \cdot a\right)}^{3} + {\left(b \cdot b\right)}^{3}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      10. flip3-+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), \left(\frac{1}{a \cdot a + b \cdot b}\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\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(1, \left(a \cdot a + b \cdot b\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
      12. +-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(1, \mathsf{+.f64}\left(\left(a \cdot a\right), \left(b \cdot b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{\_.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(3, a\right)\right)\right)\right)\right), 1\right) \]
    4. Applied egg-rr69.8%

      \[\leadsto \left(\color{blue}{\frac{a \cdot a + b \cdot b}{\frac{1}{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) - 1 \]
    5. Taylor expanded in a around 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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(3 \cdot {b}^{2}\right)}\right)\right), 1\right) \]
    6. Step-by-step derivation
      1. *-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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \left({b}^{2} \cdot 3\right)\right)\right), 1\right) \]
      2. *-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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\left({b}^{2}\right), 3\right)\right)\right), 1\right) \]
      3. unpow2N/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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\left(b \cdot b\right), 3\right)\right)\right), 1\right) \]
      4. *-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(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 3\right)\right)\right), 1\right) \]
    7. Simplified99.9%

      \[\leadsto \left(\frac{a \cdot a + b \cdot b}{\frac{1}{a \cdot a + b \cdot b}} + 4 \cdot \color{blue}{\left(\left(b \cdot b\right) \cdot 3\right)}\right) - 1 \]
    8. Taylor expanded in a around 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), \color{blue}{\left(\frac{1}{{b}^{2}}\right)}\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 3\right)\right)\right), 1\right) \]
    9. Step-by-step derivation
      1. /-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(1, \left({b}^{2}\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 3\right)\right)\right), 1\right) \]
      2. unpow2N/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(1, \left(b \cdot b\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 3\right)\right)\right), 1\right) \]
      3. *-lowering-*.f6497.6%

        \[\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(1, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), 3\right)\right)\right), 1\right) \]
    10. Simplified97.6%

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

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

Alternative 4: 70.2% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{if}\;a \leq -2.6 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-308}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-64}:\\ \;\;\;\;-1\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+34}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0 (* a (* a (* a a)))))
   (if (<= a -2.6e+18)
     t_0
     (if (<= a 4.2e-308)
       (* (* b b) (* b b))
       (if (<= a 5e-64) -1.0 (if (<= a 3.5e+34) (* b (* b (* b b))) t_0))))))
double code(double a, double b) {
	double t_0 = a * (a * (a * a));
	double tmp;
	if (a <= -2.6e+18) {
		tmp = t_0;
	} else if (a <= 4.2e-308) {
		tmp = (b * b) * (b * b);
	} else if (a <= 5e-64) {
		tmp = -1.0;
	} else if (a <= 3.5e+34) {
		tmp = 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))
    if (a <= (-2.6d+18)) then
        tmp = t_0
    else if (a <= 4.2d-308) then
        tmp = (b * b) * (b * b)
    else if (a <= 5d-64) then
        tmp = -1.0d0
    else if (a <= 3.5d+34) then
        tmp = 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));
	double tmp;
	if (a <= -2.6e+18) {
		tmp = t_0;
	} else if (a <= 4.2e-308) {
		tmp = (b * b) * (b * b);
	} else if (a <= 5e-64) {
		tmp = -1.0;
	} else if (a <= 3.5e+34) {
		tmp = b * (b * (b * b));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, b):
	t_0 = a * (a * (a * a))
	tmp = 0
	if a <= -2.6e+18:
		tmp = t_0
	elif a <= 4.2e-308:
		tmp = (b * b) * (b * b)
	elif a <= 5e-64:
		tmp = -1.0
	elif a <= 3.5e+34:
		tmp = b * (b * (b * b))
	else:
		tmp = t_0
	return tmp
function code(a, b)
	t_0 = Float64(a * Float64(a * Float64(a * a)))
	tmp = 0.0
	if (a <= -2.6e+18)
		tmp = t_0;
	elseif (a <= 4.2e-308)
		tmp = Float64(Float64(b * b) * Float64(b * b));
	elseif (a <= 5e-64)
		tmp = -1.0;
	elseif (a <= 3.5e+34)
		tmp = 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));
	tmp = 0.0;
	if (a <= -2.6e+18)
		tmp = t_0;
	elseif (a <= 4.2e-308)
		tmp = (b * b) * (b * b);
	elseif (a <= 5e-64)
		tmp = -1.0;
	elseif (a <= 3.5e+34)
		tmp = b * (b * (b * b));
	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, -2.6e+18], t$95$0, If[LessEqual[a, 4.2e-308], N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e-64], -1.0, If[LessEqual[a, 3.5e+34], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 -2.6 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-308}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b\right)\\

\mathbf{elif}\;a \leq 5 \cdot 10^{-64}:\\
\;\;\;\;-1\\

\mathbf{elif}\;a \leq 3.5 \cdot 10^{+34}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.6e18 or 3.49999999999999998e34 < a

    1. Initial program 46.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 a around inf

      \[\leadsto \color{blue}{{a}^{4}} \]
    4. 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.9%

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

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

    if -2.6e18 < a < 4.2e-308

    1. Initial program 96.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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(b \cdot b + 12\right)} - 1 \]
    6. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot {b}^{4} + \color{blue}{\left(12 \cdot \frac{1}{{b}^{2}}\right) \cdot {b}^{4}} \]
      2. *-lft-identityN/A

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

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

        \[\leadsto {b}^{4} + 12 \cdot \left(\frac{1}{{b}^{2}} \cdot {b}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
      5. pow-sqrN/A

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

        \[\leadsto {b}^{4} + 12 \cdot \left(\left(\frac{1}{{b}^{2}} \cdot {b}^{2}\right) \cdot \color{blue}{{b}^{2}}\right) \]
      7. lft-mult-inverseN/A

        \[\leadsto {b}^{4} + 12 \cdot \left(1 \cdot {\color{blue}{b}}^{2}\right) \]
      8. *-lft-identityN/A

        \[\leadsto {b}^{4} + 12 \cdot {b}^{\color{blue}{2}} \]
      9. metadata-evalN/A

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

        \[\leadsto {b}^{2} \cdot {b}^{2} + \color{blue}{12} \cdot {b}^{2} \]
      11. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2e-308 < a < 5.00000000000000033e-64

    1. Initial program 99.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. 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-*.f6463.7%

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

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

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

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

      if 5.00000000000000033e-64 < a < 3.49999999999999998e34

      1. Initial program 100.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 \color{blue}{{b}^{4}} \]
      4. 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-*.f6484.7%

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

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

    Alternative 5: 70.2% accurate, 4.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ t_1 := b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{if}\;a \leq -1.42 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq -3.35 \cdot 10^{-307}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-64}:\\ \;\;\;\;-1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+34}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (let* ((t_0 (* a (* a (* a a)))) (t_1 (* b (* b (* b b)))))
       (if (<= a -1.42e+18)
         t_0
         (if (<= a -3.35e-307)
           t_1
           (if (<= a 4.8e-64) -1.0 (if (<= a 3.2e+34) t_1 t_0))))))
    double code(double a, double b) {
    	double t_0 = a * (a * (a * a));
    	double t_1 = b * (b * (b * b));
    	double tmp;
    	if (a <= -1.42e+18) {
    		tmp = t_0;
    	} else if (a <= -3.35e-307) {
    		tmp = t_1;
    	} else if (a <= 4.8e-64) {
    		tmp = -1.0;
    	} else if (a <= 3.2e+34) {
    		tmp = t_1;
    	} 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) :: t_1
        real(8) :: tmp
        t_0 = a * (a * (a * a))
        t_1 = b * (b * (b * b))
        if (a <= (-1.42d+18)) then
            tmp = t_0
        else if (a <= (-3.35d-307)) then
            tmp = t_1
        else if (a <= 4.8d-64) then
            tmp = -1.0d0
        else if (a <= 3.2d+34) then
            tmp = t_1
        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 t_1 = b * (b * (b * b));
    	double tmp;
    	if (a <= -1.42e+18) {
    		tmp = t_0;
    	} else if (a <= -3.35e-307) {
    		tmp = t_1;
    	} else if (a <= 4.8e-64) {
    		tmp = -1.0;
    	} else if (a <= 3.2e+34) {
    		tmp = t_1;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(a, b):
    	t_0 = a * (a * (a * a))
    	t_1 = b * (b * (b * b))
    	tmp = 0
    	if a <= -1.42e+18:
    		tmp = t_0
    	elif a <= -3.35e-307:
    		tmp = t_1
    	elif a <= 4.8e-64:
    		tmp = -1.0
    	elif a <= 3.2e+34:
    		tmp = t_1
    	else:
    		tmp = t_0
    	return tmp
    
    function code(a, b)
    	t_0 = Float64(a * Float64(a * Float64(a * a)))
    	t_1 = Float64(b * Float64(b * Float64(b * b)))
    	tmp = 0.0
    	if (a <= -1.42e+18)
    		tmp = t_0;
    	elseif (a <= -3.35e-307)
    		tmp = t_1;
    	elseif (a <= 4.8e-64)
    		tmp = -1.0;
    	elseif (a <= 3.2e+34)
    		tmp = t_1;
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b)
    	t_0 = a * (a * (a * a));
    	t_1 = b * (b * (b * b));
    	tmp = 0.0;
    	if (a <= -1.42e+18)
    		tmp = t_0;
    	elseif (a <= -3.35e-307)
    		tmp = t_1;
    	elseif (a <= 4.8e-64)
    		tmp = -1.0;
    	elseif (a <= 3.2e+34)
    		tmp = t_1;
    	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]}, Block[{t$95$1 = N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.42e+18], t$95$0, If[LessEqual[a, -3.35e-307], t$95$1, If[LessEqual[a, 4.8e-64], -1.0, If[LessEqual[a, 3.2e+34], t$95$1, t$95$0]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
    t_1 := b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
    \mathbf{if}\;a \leq -1.42 \cdot 10^{+18}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;a \leq -3.35 \cdot 10^{-307}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;a \leq 4.8 \cdot 10^{-64}:\\
    \;\;\;\;-1\\
    
    \mathbf{elif}\;a \leq 3.2 \cdot 10^{+34}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if a < -1.42e18 or 3.1999999999999998e34 < a

      1. Initial program 46.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 a around inf

        \[\leadsto \color{blue}{{a}^{4}} \]
      4. 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.9%

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

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

      if -1.42e18 < a < -3.3499999999999999e-307 or 4.79999999999999997e-64 < a < 3.1999999999999998e34

      1. Initial program 97.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 \color{blue}{{b}^{4}} \]
      4. 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-*.f6467.1%

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

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

      if -3.3499999999999999e-307 < a < 4.79999999999999997e-64

      1. Initial program 99.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. 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-*.f6463.7%

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

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

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

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

      Alternative 6: 63.3% accurate, 4.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ t_1 := b \cdot \left(b \cdot 12\right)\\ \mathbf{if}\;a \leq -1.3 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{-267}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{-63}:\\ \;\;\;\;-1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+34}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (a b)
       :precision binary64
       (let* ((t_0 (* a (* a (* a a)))) (t_1 (* b (* b 12.0))))
         (if (<= a -1.3e+18)
           t_0
           (if (<= a -2.3e-267)
             t_1
             (if (<= a 2.2e-63) -1.0 (if (<= a 3.2e+34) t_1 t_0))))))
      double code(double a, double b) {
      	double t_0 = a * (a * (a * a));
      	double t_1 = b * (b * 12.0);
      	double tmp;
      	if (a <= -1.3e+18) {
      		tmp = t_0;
      	} else if (a <= -2.3e-267) {
      		tmp = t_1;
      	} else if (a <= 2.2e-63) {
      		tmp = -1.0;
      	} else if (a <= 3.2e+34) {
      		tmp = t_1;
      	} 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) :: t_1
          real(8) :: tmp
          t_0 = a * (a * (a * a))
          t_1 = b * (b * 12.0d0)
          if (a <= (-1.3d+18)) then
              tmp = t_0
          else if (a <= (-2.3d-267)) then
              tmp = t_1
          else if (a <= 2.2d-63) then
              tmp = -1.0d0
          else if (a <= 3.2d+34) then
              tmp = t_1
          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 t_1 = b * (b * 12.0);
      	double tmp;
      	if (a <= -1.3e+18) {
      		tmp = t_0;
      	} else if (a <= -2.3e-267) {
      		tmp = t_1;
      	} else if (a <= 2.2e-63) {
      		tmp = -1.0;
      	} else if (a <= 3.2e+34) {
      		tmp = t_1;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(a, b):
      	t_0 = a * (a * (a * a))
      	t_1 = b * (b * 12.0)
      	tmp = 0
      	if a <= -1.3e+18:
      		tmp = t_0
      	elif a <= -2.3e-267:
      		tmp = t_1
      	elif a <= 2.2e-63:
      		tmp = -1.0
      	elif a <= 3.2e+34:
      		tmp = t_1
      	else:
      		tmp = t_0
      	return tmp
      
      function code(a, b)
      	t_0 = Float64(a * Float64(a * Float64(a * a)))
      	t_1 = Float64(b * Float64(b * 12.0))
      	tmp = 0.0
      	if (a <= -1.3e+18)
      		tmp = t_0;
      	elseif (a <= -2.3e-267)
      		tmp = t_1;
      	elseif (a <= 2.2e-63)
      		tmp = -1.0;
      	elseif (a <= 3.2e+34)
      		tmp = t_1;
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b)
      	t_0 = a * (a * (a * a));
      	t_1 = b * (b * 12.0);
      	tmp = 0.0;
      	if (a <= -1.3e+18)
      		tmp = t_0;
      	elseif (a <= -2.3e-267)
      		tmp = t_1;
      	elseif (a <= 2.2e-63)
      		tmp = -1.0;
      	elseif (a <= 3.2e+34)
      		tmp = t_1;
      	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]}, Block[{t$95$1 = N[(b * N[(b * 12.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.3e+18], t$95$0, If[LessEqual[a, -2.3e-267], t$95$1, If[LessEqual[a, 2.2e-63], -1.0, If[LessEqual[a, 3.2e+34], t$95$1, t$95$0]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
      t_1 := b \cdot \left(b \cdot 12\right)\\
      \mathbf{if}\;a \leq -1.3 \cdot 10^{+18}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;a \leq -2.3 \cdot 10^{-267}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;a \leq 2.2 \cdot 10^{-63}:\\
      \;\;\;\;-1\\
      
      \mathbf{elif}\;a \leq 3.2 \cdot 10^{+34}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if a < -1.3e18 or 3.1999999999999998e34 < a

        1. Initial program 46.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 a around inf

          \[\leadsto \color{blue}{{a}^{4}} \]
        4. 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.9%

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

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

        if -1.3e18 < a < -2.30000000000000005e-267 or 2.2e-63 < a < 3.1999999999999998e34

        1. Initial program 97.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 a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), 12\right), 1\right) \]
          4. *-lowering-*.f6476.9%

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

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

          \[\leadsto \color{blue}{12 \cdot {b}^{2}} \]
        10. 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-*.f6448.8%

            \[\leadsto \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{12}\right)\right) \]
        11. Simplified48.8%

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

        if -2.30000000000000005e-267 < a < 2.2e-63

        1. Initial program 99.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. 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-*.f6461.9%

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

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

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

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

        Alternative 7: 94.3% accurate, 6.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{if}\;a \leq -2.5 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+34}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 12\right) + -1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (let* ((t_0 (* a (* a (* a a)))))
           (if (<= a -2.5e+18)
             t_0
             (if (<= a 3.3e+34) (+ (* (* b b) (+ (* b b) 12.0)) -1.0) t_0))))
        double code(double a, double b) {
        	double t_0 = a * (a * (a * a));
        	double tmp;
        	if (a <= -2.5e+18) {
        		tmp = t_0;
        	} else if (a <= 3.3e+34) {
        		tmp = ((b * b) * ((b * b) + 12.0)) + -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 <= (-2.5d+18)) then
                tmp = t_0
            else if (a <= 3.3d+34) then
                tmp = ((b * b) * ((b * b) + 12.0d0)) + (-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 <= -2.5e+18) {
        		tmp = t_0;
        	} else if (a <= 3.3e+34) {
        		tmp = ((b * b) * ((b * b) + 12.0)) + -1.0;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(a, b):
        	t_0 = a * (a * (a * a))
        	tmp = 0
        	if a <= -2.5e+18:
        		tmp = t_0
        	elif a <= 3.3e+34:
        		tmp = ((b * b) * ((b * b) + 12.0)) + -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 <= -2.5e+18)
        		tmp = t_0;
        	elseif (a <= 3.3e+34)
        		tmp = Float64(Float64(Float64(b * b) * Float64(Float64(b * b) + 12.0)) + -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 <= -2.5e+18)
        		tmp = t_0;
        	elseif (a <= 3.3e+34)
        		tmp = ((b * b) * ((b * b) + 12.0)) + -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, -2.5e+18], t$95$0, If[LessEqual[a, 3.3e+34], N[(N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], 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 -2.5 \cdot 10^{+18}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;a \leq 3.3 \cdot 10^{+34}:\\
        \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 12\right) + -1\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -2.5e18 or 3.29999999999999988e34 < a

          1. Initial program 46.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 a around inf

            \[\leadsto \color{blue}{{a}^{4}} \]
          4. 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.9%

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

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

          if -2.5e18 < a < 3.29999999999999988e34

          1. Initial program 98.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 a around 0

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(\left(b \cdot b\right), 12\right)\right), 1\right) \]
            10. *-lowering-*.f6499.0%

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

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

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

        Alternative 8: 81.0% accurate, 6.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-68}:\\ \;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\ \mathbf{elif}\;b \cdot b \leq 2 \cdot 10^{+115}:\\ \;\;\;\;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 b) 2e-68)
           (+ (* (* a a) 4.0) -1.0)
           (if (<= (* b b) 2e+115) (* a (* a (* a a))) (* b (* b (* b b))))))
        double code(double a, double b) {
        	double tmp;
        	if ((b * b) <= 2e-68) {
        		tmp = ((a * a) * 4.0) + -1.0;
        	} else if ((b * b) <= 2e+115) {
        		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 * b) <= 2d-68) then
                tmp = ((a * a) * 4.0d0) + (-1.0d0)
            else if ((b * b) <= 2d+115) 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 * b) <= 2e-68) {
        		tmp = ((a * a) * 4.0) + -1.0;
        	} else if ((b * b) <= 2e+115) {
        		tmp = a * (a * (a * a));
        	} else {
        		tmp = b * (b * (b * b));
        	}
        	return tmp;
        }
        
        def code(a, b):
        	tmp = 0
        	if (b * b) <= 2e-68:
        		tmp = ((a * a) * 4.0) + -1.0
        	elif (b * b) <= 2e+115:
        		tmp = a * (a * (a * a))
        	else:
        		tmp = b * (b * (b * b))
        	return tmp
        
        function code(a, b)
        	tmp = 0.0
        	if (Float64(b * b) <= 2e-68)
        		tmp = Float64(Float64(Float64(a * a) * 4.0) + -1.0);
        	elseif (Float64(b * b) <= 2e+115)
        		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 * b) <= 2e-68)
        		tmp = ((a * a) * 4.0) + -1.0;
        	elseif ((b * b) <= 2e+115)
        		tmp = a * (a * (a * a));
        	else
        		tmp = b * (b * (b * b));
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 2e-68], N[(N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[(b * b), $MachinePrecision], 2e+115], 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 \cdot b \leq 2 \cdot 10^{-68}:\\
        \;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\
        
        \mathbf{elif}\;b \cdot b \leq 2 \cdot 10^{+115}:\\
        \;\;\;\;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 (*.f64 b b) < 2.00000000000000013e-68

          1. Initial program 82.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 0

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\color{blue}{b \cdot \left(b \cdot \left(b \cdot b\right)\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 \]
          6. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 2.00000000000000013e-68 < (*.f64 b b) < 2e115

          1. Initial program 69.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 a around inf

            \[\leadsto \color{blue}{{a}^{4}} \]
          4. 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-*.f6465.1%

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

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

          if 2e115 < (*.f64 b b)

          1. Initial program 71.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 inf

            \[\leadsto \color{blue}{{b}^{4}} \]
          4. 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-*.f6499.0%

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-68}:\\ \;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\ \mathbf{elif}\;b \cdot b \leq 2 \cdot 10^{+115}:\\ \;\;\;\;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} \]
        5. Add Preprocessing

        Alternative 9: 93.7% accurate, 6.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{if}\;a \leq -1.9 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+34}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b\right) + -1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (let* ((t_0 (* a (* a (* a a)))))
           (if (<= a -1.9e+18)
             t_0
             (if (<= a 3.3e+34) (+ (* (* b b) (* b b)) -1.0) t_0))))
        double code(double a, double b) {
        	double t_0 = a * (a * (a * a));
        	double tmp;
        	if (a <= -1.9e+18) {
        		tmp = t_0;
        	} else if (a <= 3.3e+34) {
        		tmp = ((b * b) * (b * b)) + -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 <= (-1.9d+18)) then
                tmp = t_0
            else if (a <= 3.3d+34) then
                tmp = ((b * b) * (b * b)) + (-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 <= -1.9e+18) {
        		tmp = t_0;
        	} else if (a <= 3.3e+34) {
        		tmp = ((b * b) * (b * b)) + -1.0;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(a, b):
        	t_0 = a * (a * (a * a))
        	tmp = 0
        	if a <= -1.9e+18:
        		tmp = t_0
        	elif a <= 3.3e+34:
        		tmp = ((b * b) * (b * b)) + -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 <= -1.9e+18)
        		tmp = t_0;
        	elseif (a <= 3.3e+34)
        		tmp = Float64(Float64(Float64(b * b) * Float64(b * b)) + -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 <= -1.9e+18)
        		tmp = t_0;
        	elseif (a <= 3.3e+34)
        		tmp = ((b * b) * (b * b)) + -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, -1.9e+18], t$95$0, If[LessEqual[a, 3.3e+34], N[(N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], 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 -1.9 \cdot 10^{+18}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;a \leq 3.3 \cdot 10^{+34}:\\
        \;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b\right) + -1\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -1.9e18 or 3.29999999999999988e34 < a

          1. Initial program 46.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 a around inf

            \[\leadsto \color{blue}{{a}^{4}} \]
          4. 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.9%

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

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

          if -1.9e18 < a < 3.29999999999999988e34

          1. Initial program 98.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 a around 0

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(\left(b \cdot b\right), 12\right)\right), 1\right) \]
            10. *-lowering-*.f6499.0%

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

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

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

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

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

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

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

        Alternative 10: 93.7% accurate, 6.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{if}\;a \leq -1.5 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 3.55 \cdot 10^{+34}:\\ \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (let* ((t_0 (* a (* a (* a a)))))
           (if (<= a -1.5e+18)
             t_0
             (if (<= a 3.55e+34) (+ (* b (* b (* b b))) -1.0) t_0))))
        double code(double a, double b) {
        	double t_0 = a * (a * (a * a));
        	double tmp;
        	if (a <= -1.5e+18) {
        		tmp = t_0;
        	} else if (a <= 3.55e+34) {
        		tmp = (b * (b * (b * b))) + -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 <= (-1.5d+18)) then
                tmp = t_0
            else if (a <= 3.55d+34) then
                tmp = (b * (b * (b * b))) + (-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 <= -1.5e+18) {
        		tmp = t_0;
        	} else if (a <= 3.55e+34) {
        		tmp = (b * (b * (b * b))) + -1.0;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(a, b):
        	t_0 = a * (a * (a * a))
        	tmp = 0
        	if a <= -1.5e+18:
        		tmp = t_0
        	elif a <= 3.55e+34:
        		tmp = (b * (b * (b * b))) + -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 <= -1.5e+18)
        		tmp = t_0;
        	elseif (a <= 3.55e+34)
        		tmp = Float64(Float64(b * Float64(b * Float64(b * b))) + -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 <= -1.5e+18)
        		tmp = t_0;
        	elseif (a <= 3.55e+34)
        		tmp = (b * (b * (b * b))) + -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, -1.5e+18], t$95$0, If[LessEqual[a, 3.55e+34], N[(N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], 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 -1.5 \cdot 10^{+18}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;a \leq 3.55 \cdot 10^{+34}:\\
        \;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right) + -1\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -1.5e18 or 3.54999999999999978e34 < a

          1. Initial program 46.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 a around inf

            \[\leadsto \color{blue}{{a}^{4}} \]
          4. 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.9%

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

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

          if -1.5e18 < a < 3.54999999999999978e34

          1. Initial program 98.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-*.f6498.1%

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

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

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

        Alternative 11: 81.6% accurate, 7.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\ \mathbf{if}\;a \leq -1.25 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 3.25 \cdot 10^{+34}:\\ \;\;\;\;\left(b \cdot b\right) \cdot 12 + -1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (let* ((t_0 (* a (* a (* a a)))))
           (if (<= a -1.25e+18)
             t_0
             (if (<= a 3.25e+34) (+ (* (* b b) 12.0) -1.0) t_0))))
        double code(double a, double b) {
        	double t_0 = a * (a * (a * a));
        	double tmp;
        	if (a <= -1.25e+18) {
        		tmp = t_0;
        	} else if (a <= 3.25e+34) {
        		tmp = ((b * b) * 12.0) + -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 <= (-1.25d+18)) then
                tmp = t_0
            else if (a <= 3.25d+34) then
                tmp = ((b * b) * 12.0d0) + (-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 <= -1.25e+18) {
        		tmp = t_0;
        	} else if (a <= 3.25e+34) {
        		tmp = ((b * b) * 12.0) + -1.0;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(a, b):
        	t_0 = a * (a * (a * a))
        	tmp = 0
        	if a <= -1.25e+18:
        		tmp = t_0
        	elif a <= 3.25e+34:
        		tmp = ((b * b) * 12.0) + -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 <= -1.25e+18)
        		tmp = t_0;
        	elseif (a <= 3.25e+34)
        		tmp = Float64(Float64(Float64(b * b) * 12.0) + -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 <= -1.25e+18)
        		tmp = t_0;
        	elseif (a <= 3.25e+34)
        		tmp = ((b * b) * 12.0) + -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, -1.25e+18], t$95$0, If[LessEqual[a, 3.25e+34], N[(N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision] + -1.0), $MachinePrecision], 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 -1.25 \cdot 10^{+18}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;a \leq 3.25 \cdot 10^{+34}:\\
        \;\;\;\;\left(b \cdot b\right) \cdot 12 + -1\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -1.25e18 or 3.25000000000000008e34 < a

          1. Initial program 46.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 a around inf

            \[\leadsto \color{blue}{{a}^{4}} \]
          4. 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.9%

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

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

          if -1.25e18 < a < 3.25000000000000008e34

          1. Initial program 98.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 a around 0

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(\left(b \cdot b\right), 12\right)\right), 1\right) \]
            10. *-lowering-*.f6499.0%

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

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), 12\right), 1\right) \]
            4. *-lowering-*.f6479.7%

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

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

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

        Alternative 12: 93.0% accurate, 8.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot b \leq 2 \cdot 10^{+115}:\\ \;\;\;\;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 b) 2e+115) (+ (* a (* a (* a a))) -1.0) (* b (* b (* b b)))))
        double code(double a, double b) {
        	double tmp;
        	if ((b * b) <= 2e+115) {
        		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 * b) <= 2d+115) 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 * b) <= 2e+115) {
        		tmp = (a * (a * (a * a))) + -1.0;
        	} else {
        		tmp = b * (b * (b * b));
        	}
        	return tmp;
        }
        
        def code(a, b):
        	tmp = 0
        	if (b * b) <= 2e+115:
        		tmp = (a * (a * (a * a))) + -1.0
        	else:
        		tmp = b * (b * (b * b))
        	return tmp
        
        function code(a, b)
        	tmp = 0.0
        	if (Float64(b * b) <= 2e+115)
        		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 * b) <= 2e+115)
        		tmp = (a * (a * (a * a))) + -1.0;
        	else
        		tmp = b * (b * (b * b));
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 2e+115], 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 \cdot b \leq 2 \cdot 10^{+115}:\\
        \;\;\;\;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 (*.f64 b b) < 2e115

          1. Initial program 79.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 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-*.f6491.6%

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

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

          if 2e115 < (*.f64 b b)

          1. Initial program 71.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 inf

            \[\leadsto \color{blue}{{b}^{4}} \]
          4. 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-*.f6499.0%

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot b \leq 2 \cdot 10^{+115}:\\ \;\;\;\;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 13: 37.7% 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 78.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.4%

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

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

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

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

            if 0.28999999999999998 < b

            1. Initial program 69.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. Add Preprocessing
            3. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(\left(b \cdot b\right), 12\right)\right), 1\right) \]
              10. *-lowering-*.f6490.7%

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), 12\right)\right), 1\right) \]
            5. Simplified90.7%

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{12 \cdot {b}^{2}} \]
            10. 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-*.f6459.1%

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

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

          Alternative 14: 24.3% 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 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. 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-*.f6467.1%

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

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

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

              \[\leadsto \color{blue}{-1} \]
            2. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2024194 
            (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))