Bouland and Aaronson, Equation (24)

Percentage Accurate: 74.4% → 100.0%
Time: 9.7s
Alternatives: 10
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 74.4% 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: 100.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq \infty:\\ \;\;\;\;{\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;\left({a}^{2} \cdot \left(2 \cdot {b}^{2} + a \cdot \left(a - 4\right)\right) + {b}^{4}\right) + -1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<=
      (+
       (pow (+ (* a a) (* b b)) 2.0)
       (* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))
      INFINITY)
   (+
    (pow (hypot b a) 4.0)
    (+ (* 4.0 (fma (* a a) (- 1.0 a) (* b (* b (+ a 3.0))))) -1.0))
   (+
    (+ (* (pow a 2.0) (+ (* 2.0 (pow b 2.0)) (* a (- a 4.0)))) (pow b 4.0))
    -1.0)))
double code(double a, double b) {
	double tmp;
	if ((pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) <= ((double) INFINITY)) {
		tmp = pow(hypot(b, a), 4.0) + ((4.0 * fma((a * a), (1.0 - a), (b * (b * (a + 3.0))))) + -1.0);
	} else {
		tmp = ((pow(a, 2.0) * ((2.0 * pow(b, 2.0)) + (a * (a - 4.0)))) + pow(b, 4.0)) + -1.0;
	}
	return tmp;
}
function code(a, b)
	tmp = 0.0
	if (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(a + 3.0))))) <= Inf)
		tmp = Float64((hypot(b, a) ^ 4.0) + Float64(Float64(4.0 * fma(Float64(a * a), Float64(1.0 - a), Float64(b * Float64(b * Float64(a + 3.0))))) + -1.0));
	else
		tmp = Float64(Float64(Float64((a ^ 2.0) * Float64(Float64(2.0 * (b ^ 2.0)) + Float64(a * Float64(a - 4.0)))) + (b ^ 4.0)) + -1.0);
	end
	return tmp
end
code[a_, b_] := If[LessEqual[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[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[Power[N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision], 4.0], $MachinePrecision] + N[(N[(4.0 * N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision] + N[(b * N[(b * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[(2.0 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] + N[(a * N[(a - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define99.8%

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

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

        \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \color{blue}{\left(b \cdot b + a \cdot a\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      4. distribute-lft-in92.0%

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. add-sqr-sqrt92.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      7. pow292.0%

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

        \[\leadsto \left({\left(\sqrt{\color{blue}{a \cdot a + b \cdot b}}\right)}^{2} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      9. hypot-define92.0%

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

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      12. add-sqr-sqrt92.0%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      13. pow292.0%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{2}} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      14. fma-define92.0%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\sqrt{\color{blue}{a \cdot a + b \cdot b}}\right)}^{2} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      15. hypot-define92.0%

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{{a}^{2}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    6. Applied egg-rr92.0%

      \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {a}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out99.8%

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

        \[\leadsto {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{\left({a}^{2} + {b}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      3. rem-square-sqrt99.8%

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

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

        \[\leadsto {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \left(\sqrt{a \cdot a + \color{blue}{b \cdot b}} \cdot \sqrt{{a}^{2} + {b}^{2}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. hypot-undefine99.8%

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

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

        \[\leadsto {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \left(\mathsf{hypot}\left(a, b\right) \cdot \sqrt{a \cdot a + \color{blue}{b \cdot b}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      9. hypot-undefine99.8%

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

        \[\leadsto {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{{\left(\mathsf{hypot}\left(a, b\right)\right)}^{2}} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      11. pow-sqr100.0%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{b \cdot b + \color{blue}{a \cdot a}}\right)}^{\left(2 \cdot 2\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      18. hypot-define100.0%

        \[\leadsto {\color{blue}{\left(\mathsf{hypot}\left(b, a\right)\right)}}^{\left(2 \cdot 2\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      19. metadata-eval100.0%

        \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{\color{blue}{4}} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    8. Simplified100.0%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define6.5%

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

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

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

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. add-sqr-sqrt6.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {a}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out6.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-1 \cdot {a}^{3}\right)} - 1\right) \]
    10. Step-by-step derivation
      1. mul-1-neg39.0%

        \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-{a}^{3}\right)} - 1\right) \]
    11. Simplified39.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq \infty:\\ \;\;\;\;{\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;\left({a}^{2} \cdot \left(2 \cdot {b}^{2} + a \cdot \left(a - 4\right)\right) + {b}^{4}\right) + -1\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\\ \mathbf{if}\;t\_0 \leq \infty:\\ \;\;\;\;t\_0 + -1\\ \mathbf{else}:\\ \;\;\;\;\left({a}^{2} \cdot \left(2 \cdot {b}^{2} + a \cdot \left(a - 4\right)\right) + {b}^{4}\right) + -1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0
         (+
          (pow (+ (* a a) (* b b)) 2.0)
          (* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))))
   (if (<= t_0 INFINITY)
     (+ t_0 -1.0)
     (+
      (+ (* (pow a 2.0) (+ (* 2.0 (pow b 2.0)) (* a (- a 4.0)))) (pow b 4.0))
      -1.0))))
double code(double a, double b) {
	double t_0 = pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
	double tmp;
	if (t_0 <= ((double) INFINITY)) {
		tmp = t_0 + -1.0;
	} else {
		tmp = ((pow(a, 2.0) * ((2.0 * pow(b, 2.0)) + (a * (a - 4.0)))) + pow(b, 4.0)) + -1.0;
	}
	return tmp;
}
public static double code(double a, double b) {
	double t_0 = Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
	double tmp;
	if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = t_0 + -1.0;
	} else {
		tmp = ((Math.pow(a, 2.0) * ((2.0 * Math.pow(b, 2.0)) + (a * (a - 4.0)))) + Math.pow(b, 4.0)) + -1.0;
	}
	return tmp;
}
def code(a, b):
	t_0 = math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))
	tmp = 0
	if t_0 <= math.inf:
		tmp = t_0 + -1.0
	else:
		tmp = ((math.pow(a, 2.0) * ((2.0 * math.pow(b, 2.0)) + (a * (a - 4.0)))) + math.pow(b, 4.0)) + -1.0
	return tmp
function code(a, b)
	t_0 = 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(a + 3.0)))))
	tmp = 0.0
	if (t_0 <= Inf)
		tmp = Float64(t_0 + -1.0);
	else
		tmp = Float64(Float64(Float64((a ^ 2.0) * Float64(Float64(2.0 * (b ^ 2.0)) + Float64(a * Float64(a - 4.0)))) + (b ^ 4.0)) + -1.0);
	end
	return tmp
end
function tmp_2 = code(a, b)
	t_0 = (((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
	tmp = 0.0;
	if (t_0 <= Inf)
		tmp = t_0 + -1.0;
	else
		tmp = (((a ^ 2.0) * ((2.0 * (b ^ 2.0)) + (a * (a - 4.0)))) + (b ^ 4.0)) + -1.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := Block[{t$95$0 = 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[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[(t$95$0 + -1.0), $MachinePrecision], N[(N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[(2.0 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] + N[(a * N[(a - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 99.8%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define6.5%

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

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

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

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. add-sqr-sqrt6.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {a}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out6.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-1 \cdot {a}^{3}\right)} - 1\right) \]
    10. Step-by-step derivation
      1. mul-1-neg39.0%

        \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-{a}^{3}\right)} - 1\right) \]
    11. Simplified39.0%

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

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

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

Alternative 3: 99.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+104}:\\ \;\;\;\;{a}^{4}\\ \mathbf{elif}\;a \leq -34000 \lor \neg \left(a \leq 2 \cdot 10^{+25}\right):\\ \;\;\;\;\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot {a}^{3}\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\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(a + 3\right)\right)\right) + -1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<= a -2e+104)
   (pow a 4.0)
   (if (or (<= a -34000.0) (not (<= a 2e+25)))
     (+ (+ (pow (hypot b a) 4.0) (* 4.0 (pow a 3.0))) -1.0)
     (+
      (+
       (pow (+ (* a a) (* b b)) 2.0)
       (* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))
      -1.0))))
double code(double a, double b) {
	double tmp;
	if (a <= -2e+104) {
		tmp = pow(a, 4.0);
	} else if ((a <= -34000.0) || !(a <= 2e+25)) {
		tmp = (pow(hypot(b, a), 4.0) + (4.0 * pow(a, 3.0))) + -1.0;
	} else {
		tmp = (pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) + -1.0;
	}
	return tmp;
}
public static double code(double a, double b) {
	double tmp;
	if (a <= -2e+104) {
		tmp = Math.pow(a, 4.0);
	} else if ((a <= -34000.0) || !(a <= 2e+25)) {
		tmp = (Math.pow(Math.hypot(b, a), 4.0) + (4.0 * Math.pow(a, 3.0))) + -1.0;
	} else {
		tmp = (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) + -1.0;
	}
	return tmp;
}
def code(a, b):
	tmp = 0
	if a <= -2e+104:
		tmp = math.pow(a, 4.0)
	elif (a <= -34000.0) or not (a <= 2e+25):
		tmp = (math.pow(math.hypot(b, a), 4.0) + (4.0 * math.pow(a, 3.0))) + -1.0
	else:
		tmp = (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) + -1.0
	return tmp
function code(a, b)
	tmp = 0.0
	if (a <= -2e+104)
		tmp = a ^ 4.0;
	elseif ((a <= -34000.0) || !(a <= 2e+25))
		tmp = Float64(Float64((hypot(b, a) ^ 4.0) + Float64(4.0 * (a ^ 3.0))) + -1.0);
	else
		tmp = 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(a + 3.0))))) + -1.0);
	end
	return tmp
end
function tmp_2 = code(a, b)
	tmp = 0.0;
	if (a <= -2e+104)
		tmp = a ^ 4.0;
	elseif ((a <= -34000.0) || ~((a <= 2e+25)))
		tmp = ((hypot(b, a) ^ 4.0) + (4.0 * (a ^ 3.0))) + -1.0;
	else
		tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) + -1.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := If[LessEqual[a, -2e+104], N[Power[a, 4.0], $MachinePrecision], If[Or[LessEqual[a, -34000.0], N[Not[LessEqual[a, 2e+25]], $MachinePrecision]], N[(N[(N[Power[N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision], 4.0], $MachinePrecision] + N[(4.0 * N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], 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[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -34000 \lor \neg \left(a \leq 2 \cdot 10^{+25}\right):\\
\;\;\;\;\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot {a}^{3}\right) + -1\\

\mathbf{else}:\\
\;\;\;\;\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(a + 3\right)\right)\right) + -1\\


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

    1. Initial program 56.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e104 < a < -34000 or 2.00000000000000018e25 < a

    1. Initial program 31.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define36.9%

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

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

        \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \color{blue}{\left(b \cdot b + a \cdot a\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      4. distribute-lft-in36.9%

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. add-sqr-sqrt36.9%

        \[\leadsto \left(\color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      7. pow236.9%

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

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

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

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      12. add-sqr-sqrt36.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      13. pow236.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{2}} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      14. fma-define36.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\sqrt{\color{blue}{a \cdot a + b \cdot b}}\right)}^{2} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      15. hypot-define36.9%

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{{a}^{2}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    6. Applied egg-rr36.9%

      \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {a}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out36.9%

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

        \[\leadsto {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{\left({a}^{2} + {b}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      3. rem-square-sqrt36.9%

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

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

        \[\leadsto {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \left(\sqrt{a \cdot a + \color{blue}{b \cdot b}} \cdot \sqrt{{a}^{2} + {b}^{2}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. hypot-undefine36.9%

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

        \[\leadsto {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \left(\mathsf{hypot}\left(a, b\right) \cdot \sqrt{\color{blue}{a \cdot a} + {b}^{2}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      8. unpow236.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-1 \cdot {a}^{3}\right)} - 1\right) \]
    10. Step-by-step derivation
      1. mul-1-neg47.2%

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

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

        \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \left(-{a}^{3}\right)\right) - 1} \]
      2. add-sqr-sqrt28.1%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \color{blue}{\left(\sqrt{-{a}^{3}} \cdot \sqrt{-{a}^{3}}\right)}\right) - 1 \]
      3. sqrt-unprod94.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \color{blue}{\sqrt{\left(-{a}^{3}\right) \cdot \left(-{a}^{3}\right)}}\right) - 1 \]
      4. sqr-neg94.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \sqrt{\color{blue}{{a}^{3} \cdot {a}^{3}}}\right) - 1 \]
      5. sqrt-unprod71.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \color{blue}{\left(\sqrt{{a}^{3}} \cdot \sqrt{{a}^{3}}\right)}\right) - 1 \]
      6. add-sqr-sqrt100.0%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \color{blue}{{a}^{3}}\right) - 1 \]
    13. Applied egg-rr100.0%

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

    if -34000 < a < 2.00000000000000018e25

    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. Recombined 3 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+104}:\\ \;\;\;\;{a}^{4}\\ \mathbf{elif}\;a \leq -34000 \lor \neg \left(a \leq 2 \cdot 10^{+25}\right):\\ \;\;\;\;\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot {a}^{3}\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\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(a + 3\right)\right)\right) + -1\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4}\\ t_1 := 4 \cdot {a}^{3}\\ \mathbf{if}\;a \leq 2 \cdot 10^{+25}:\\ \;\;\;\;t\_0 + \left(-1 - t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 + t\_1\right) + -1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0 (pow (hypot b a) 4.0)) (t_1 (* 4.0 (pow a 3.0))))
   (if (<= a 2e+25) (+ t_0 (- -1.0 t_1)) (+ (+ t_0 t_1) -1.0))))
double code(double a, double b) {
	double t_0 = pow(hypot(b, a), 4.0);
	double t_1 = 4.0 * pow(a, 3.0);
	double tmp;
	if (a <= 2e+25) {
		tmp = t_0 + (-1.0 - t_1);
	} else {
		tmp = (t_0 + t_1) + -1.0;
	}
	return tmp;
}
public static double code(double a, double b) {
	double t_0 = Math.pow(Math.hypot(b, a), 4.0);
	double t_1 = 4.0 * Math.pow(a, 3.0);
	double tmp;
	if (a <= 2e+25) {
		tmp = t_0 + (-1.0 - t_1);
	} else {
		tmp = (t_0 + t_1) + -1.0;
	}
	return tmp;
}
def code(a, b):
	t_0 = math.pow(math.hypot(b, a), 4.0)
	t_1 = 4.0 * math.pow(a, 3.0)
	tmp = 0
	if a <= 2e+25:
		tmp = t_0 + (-1.0 - t_1)
	else:
		tmp = (t_0 + t_1) + -1.0
	return tmp
function code(a, b)
	t_0 = hypot(b, a) ^ 4.0
	t_1 = Float64(4.0 * (a ^ 3.0))
	tmp = 0.0
	if (a <= 2e+25)
		tmp = Float64(t_0 + Float64(-1.0 - t_1));
	else
		tmp = Float64(Float64(t_0 + t_1) + -1.0);
	end
	return tmp
end
function tmp_2 = code(a, b)
	t_0 = hypot(b, a) ^ 4.0;
	t_1 = 4.0 * (a ^ 3.0);
	tmp = 0.0;
	if (a <= 2e+25)
		tmp = t_0 + (-1.0 - t_1);
	else
		tmp = (t_0 + t_1) + -1.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := Block[{t$95$0 = N[Power[N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision], 4.0], $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 2e+25], N[(t$95$0 + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 + t$95$1), $MachinePrecision] + -1.0), $MachinePrecision]]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.00000000000000018e25

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define84.3%

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

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

        \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \color{blue}{\left(b \cdot b + a \cdot a\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      4. distribute-lft-in77.0%

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. add-sqr-sqrt77.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      7. pow277.0%

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

        \[\leadsto \left({\left(\sqrt{\color{blue}{a \cdot a + b \cdot b}}\right)}^{2} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      9. hypot-define77.0%

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

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      12. add-sqr-sqrt76.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      13. pow276.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{2}} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      14. fma-define77.0%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\sqrt{\color{blue}{a \cdot a + b \cdot b}}\right)}^{2} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      15. hypot-define77.0%

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{{a}^{2}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    6. Applied egg-rr77.0%

      \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {a}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-1 \cdot {a}^{3}\right)} - 1\right) \]
    10. Step-by-step derivation
      1. mul-1-neg98.0%

        \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-{a}^{3}\right)} - 1\right) \]
    11. Simplified98.0%

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

    if 2.00000000000000018e25 < a

    1. Initial program 26.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. Step-by-step derivation
      1. associate--l+26.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define34.2%

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

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

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

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. add-sqr-sqrt34.2%

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

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

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

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

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      12. add-sqr-sqrt34.2%

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

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

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

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{{a}^{2}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    6. Applied egg-rr34.2%

      \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {a}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out34.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-1 \cdot {a}^{3}\right)} - 1\right) \]
    10. Step-by-step derivation
      1. mul-1-neg26.6%

        \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-{a}^{3}\right)} - 1\right) \]
    11. Simplified26.6%

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

        \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \left(-{a}^{3}\right)\right) - 1} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \color{blue}{\left(\sqrt{-{a}^{3}} \cdot \sqrt{-{a}^{3}}\right)}\right) - 1 \]
      3. sqrt-unprod94.4%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \color{blue}{\sqrt{\left(-{a}^{3}\right) \cdot \left(-{a}^{3}\right)}}\right) - 1 \]
      4. sqr-neg94.4%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \sqrt{\color{blue}{{a}^{3} \cdot {a}^{3}}}\right) - 1 \]
      5. sqrt-unprod100.0%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \color{blue}{\left(\sqrt{{a}^{3}} \cdot \sqrt{{a}^{3}}\right)}\right) - 1 \]
      6. add-sqr-sqrt100.0%

        \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \color{blue}{{a}^{3}}\right) - 1 \]
    13. Applied egg-rr100.0%

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

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

Alternative 5: 98.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\\ \mathbf{if}\;t\_0 \leq \infty:\\ \;\;\;\;t\_0 + -1\\ \mathbf{else}:\\ \;\;\;\;{a}^{4} \cdot \left(1 - \frac{4 + \frac{-4}{a}}{a}\right) + -1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0
         (+
          (pow (+ (* a a) (* b b)) 2.0)
          (* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))))
   (if (<= t_0 INFINITY)
     (+ t_0 -1.0)
     (+ (* (pow a 4.0) (- 1.0 (/ (+ 4.0 (/ -4.0 a)) a))) -1.0))))
double code(double a, double b) {
	double t_0 = pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
	double tmp;
	if (t_0 <= ((double) INFINITY)) {
		tmp = t_0 + -1.0;
	} else {
		tmp = (pow(a, 4.0) * (1.0 - ((4.0 + (-4.0 / a)) / a))) + -1.0;
	}
	return tmp;
}
public static double code(double a, double b) {
	double t_0 = Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
	double tmp;
	if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = t_0 + -1.0;
	} else {
		tmp = (Math.pow(a, 4.0) * (1.0 - ((4.0 + (-4.0 / a)) / a))) + -1.0;
	}
	return tmp;
}
def code(a, b):
	t_0 = math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))
	tmp = 0
	if t_0 <= math.inf:
		tmp = t_0 + -1.0
	else:
		tmp = (math.pow(a, 4.0) * (1.0 - ((4.0 + (-4.0 / a)) / a))) + -1.0
	return tmp
function code(a, b)
	t_0 = 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(a + 3.0)))))
	tmp = 0.0
	if (t_0 <= Inf)
		tmp = Float64(t_0 + -1.0);
	else
		tmp = Float64(Float64((a ^ 4.0) * Float64(1.0 - Float64(Float64(4.0 + Float64(-4.0 / a)) / a))) + -1.0);
	end
	return tmp
end
function tmp_2 = code(a, b)
	t_0 = (((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
	tmp = 0.0;
	if (t_0 <= Inf)
		tmp = t_0 + -1.0;
	else
		tmp = ((a ^ 4.0) * (1.0 - ((4.0 + (-4.0 / a)) / a))) + -1.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := Block[{t$95$0 = 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[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[(t$95$0 + -1.0), $MachinePrecision], N[(N[(N[Power[a, 4.0], $MachinePrecision] * N[(1.0 - N[(N[(4.0 + N[(-4.0 / a), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 99.8%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{a}^{4} \cdot \left(1 + -1 \cdot \frac{4 - 4 \cdot \frac{1}{a}}{a}\right)} - 1 \]
    7. Step-by-step derivation
      1. mul-1-neg89.0%

        \[\leadsto {a}^{4} \cdot \left(1 + \color{blue}{\left(-\frac{4 - 4 \cdot \frac{1}{a}}{a}\right)}\right) - 1 \]
      2. unsub-neg89.0%

        \[\leadsto {a}^{4} \cdot \color{blue}{\left(1 - \frac{4 - 4 \cdot \frac{1}{a}}{a}\right)} - 1 \]
      3. sub-neg89.0%

        \[\leadsto {a}^{4} \cdot \left(1 - \frac{\color{blue}{4 + \left(-4 \cdot \frac{1}{a}\right)}}{a}\right) - 1 \]
      4. associate-*r/89.0%

        \[\leadsto {a}^{4} \cdot \left(1 - \frac{4 + \left(-\color{blue}{\frac{4 \cdot 1}{a}}\right)}{a}\right) - 1 \]
      5. metadata-eval89.0%

        \[\leadsto {a}^{4} \cdot \left(1 - \frac{4 + \left(-\frac{\color{blue}{4}}{a}\right)}{a}\right) - 1 \]
      6. distribute-neg-frac89.0%

        \[\leadsto {a}^{4} \cdot \left(1 - \frac{4 + \color{blue}{\frac{-4}{a}}}{a}\right) - 1 \]
      7. metadata-eval89.0%

        \[\leadsto {a}^{4} \cdot \left(1 - \frac{4 + \frac{\color{blue}{-4}}{a}}{a}\right) - 1 \]
    8. Simplified89.0%

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

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

Alternative 6: 57.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.85 \cdot 10^{-252}:\\
\;\;\;\;{a}^{4}\\

\mathbf{elif}\;b \leq 2.05 \cdot 10^{-179}:\\
\;\;\;\;-1\\

\mathbf{elif}\;b \leq 2.4 \cdot 10^{-96}:\\
\;\;\;\;{a}^{4}\\

\mathbf{elif}\;b \leq 3.2 \cdot 10^{-66}:\\
\;\;\;\;-1\\

\mathbf{elif}\;b \leq 2.4 \cdot 10^{+31}:\\
\;\;\;\;{a}^{4}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 1.8500000000000001e-252 or 2.05e-179 < b < 2.40000000000000019e-96 or 3.19999999999999982e-66 < b < 2.39999999999999982e31

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8500000000000001e-252 < b < 2.05e-179 or 2.40000000000000019e-96 < b < 3.19999999999999982e-66

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.39999999999999982e31 < b

    1. Initial program 51.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{b}^{4}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 82.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.9000000000000001e32

    1. Initial program 75.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. Step-by-step derivation
      1. associate--l+75.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9000000000000001e32 < b

    1. Initial program 51.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{b}^{4}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.5%

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

Alternative 8: 91.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{+82} \lor \neg \left(a \leq 9.9 \cdot 10^{+61}\right):\\ \;\;\;\;{a}^{4}\\ \mathbf{else}:\\ \;\;\;\;{b}^{4} + -1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (or (<= a -1.6e+82) (not (<= a 9.9e+61)))
   (pow a 4.0)
   (+ (pow b 4.0) -1.0)))
double code(double a, double b) {
	double tmp;
	if ((a <= -1.6e+82) || !(a <= 9.9e+61)) {
		tmp = pow(a, 4.0);
	} else {
		tmp = pow(b, 4.0) + -1.0;
	}
	return tmp;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((a <= (-1.6d+82)) .or. (.not. (a <= 9.9d+61))) then
        tmp = a ** 4.0d0
    else
        tmp = (b ** 4.0d0) + (-1.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double tmp;
	if ((a <= -1.6e+82) || !(a <= 9.9e+61)) {
		tmp = Math.pow(a, 4.0);
	} else {
		tmp = Math.pow(b, 4.0) + -1.0;
	}
	return tmp;
}
def code(a, b):
	tmp = 0
	if (a <= -1.6e+82) or not (a <= 9.9e+61):
		tmp = math.pow(a, 4.0)
	else:
		tmp = math.pow(b, 4.0) + -1.0
	return tmp
function code(a, b)
	tmp = 0.0
	if ((a <= -1.6e+82) || !(a <= 9.9e+61))
		tmp = a ^ 4.0;
	else
		tmp = Float64((b ^ 4.0) + -1.0);
	end
	return tmp
end
function tmp_2 = code(a, b)
	tmp = 0.0;
	if ((a <= -1.6e+82) || ~((a <= 9.9e+61)))
		tmp = a ^ 4.0;
	else
		tmp = (b ^ 4.0) + -1.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := If[Or[LessEqual[a, -1.6e+82], N[Not[LessEqual[a, 9.9e+61]], $MachinePrecision]], N[Power[a, 4.0], $MachinePrecision], N[(N[Power[b, 4.0], $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+82} \lor \neg \left(a \leq 9.9 \cdot 10^{+61}\right):\\
\;\;\;\;{a}^{4}\\

\mathbf{else}:\\
\;\;\;\;{b}^{4} + -1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.59999999999999987e82 or 9.9000000000000004e61 < a

    1. Initial program 33.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999987e82 < a < 9.9000000000000004e61

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define92.2%

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

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

        \[\leadsto \left(a \cdot a + b \cdot b\right) \cdot \color{blue}{\left(b \cdot b + a \cdot a\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      4. distribute-lft-in85.9%

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      6. add-sqr-sqrt85.9%

        \[\leadsto \left(\color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \left(b \cdot b\right) + \left(a \cdot a + b \cdot b\right) \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      7. pow285.9%

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

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

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

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      12. add-sqr-sqrt85.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      13. pow285.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + \color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{2}} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      14. fma-define85.9%

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\sqrt{\color{blue}{a \cdot a + b \cdot b}}\right)}^{2} \cdot \left(a \cdot a\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
      15. hypot-define85.9%

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

        \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{{a}^{2}}\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    6. Applied egg-rr85.9%

      \[\leadsto \color{blue}{\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {b}^{2} + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {a}^{2}\right)} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) - 1\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-1 \cdot {a}^{3}\right)} - 1\right) \]
    10. Step-by-step derivation
      1. mul-1-neg97.6%

        \[\leadsto {\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + \left(4 \cdot \color{blue}{\left(-{a}^{3}\right)} - 1\right) \]
    11. Simplified97.6%

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

      \[\leadsto \color{blue}{{b}^{4} - 1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.9%

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

Alternative 9: 68.9% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.05 \cdot 10^{-9} \lor \neg \left(a \leq 0.0078\right):\\ \;\;\;\;{a}^{4}\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (or (<= a -2.05e-9) (not (<= a 0.0078))) (pow a 4.0) -1.0))
double code(double a, double b) {
	double tmp;
	if ((a <= -2.05e-9) || !(a <= 0.0078)) {
		tmp = pow(a, 4.0);
	} else {
		tmp = -1.0;
	}
	return tmp;
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((a <= (-2.05d-9)) .or. (.not. (a <= 0.0078d0))) then
        tmp = a ** 4.0d0
    else
        tmp = -1.0d0
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double tmp;
	if ((a <= -2.05e-9) || !(a <= 0.0078)) {
		tmp = Math.pow(a, 4.0);
	} else {
		tmp = -1.0;
	}
	return tmp;
}
def code(a, b):
	tmp = 0
	if (a <= -2.05e-9) or not (a <= 0.0078):
		tmp = math.pow(a, 4.0)
	else:
		tmp = -1.0
	return tmp
function code(a, b)
	tmp = 0.0
	if ((a <= -2.05e-9) || !(a <= 0.0078))
		tmp = a ^ 4.0;
	else
		tmp = -1.0;
	end
	return tmp
end
function tmp_2 = code(a, b)
	tmp = 0.0;
	if ((a <= -2.05e-9) || ~((a <= 0.0078)))
		tmp = a ^ 4.0;
	else
		tmp = -1.0;
	end
	tmp_2 = tmp;
end
code[a_, b_] := If[Or[LessEqual[a, -2.05e-9], N[Not[LessEqual[a, 0.0078]], $MachinePrecision]], N[Power[a, 4.0], $MachinePrecision], -1.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{-9} \lor \neg \left(a \leq 0.0078\right):\\
\;\;\;\;{a}^{4}\\

\mathbf{else}:\\
\;\;\;\;-1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.0500000000000002e-9 or 0.0077999999999999996 < a

    1. Initial program 44.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0500000000000002e-9 < a < 0.0077999999999999996

    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. Step-by-step derivation
      1. associate--l+99.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.05 \cdot 10^{-9} \lor \neg \left(a \leq 0.0078\right):\\ \;\;\;\;{a}^{4}\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 25.5% 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 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. Step-by-step derivation
    1. associate--l+69.8%

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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