Data.Approximate.Numerics:blog from approximate-0.2.2.1

Percentage Accurate: 99.7% → 99.7%
Time: 10.2s
Alternatives: 14
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \end{array} \]
(FPCore (x)
 :precision binary64
 (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))
double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (6.0d0 * (x - 1.0d0)) / ((x + 1.0d0) + (4.0d0 * sqrt(x)))
end function
public static double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * Math.sqrt(x)));
}
def code(x):
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * math.sqrt(x)))
function code(x)
	return Float64(Float64(6.0 * Float64(x - 1.0)) / Float64(Float64(x + 1.0) + Float64(4.0 * sqrt(x))))
end
function tmp = code(x)
	tmp = (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
end
code[x_] := N[(N[(6.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \end{array} \]
(FPCore (x)
 :precision binary64
 (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))
double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (6.0d0 * (x - 1.0d0)) / ((x + 1.0d0) + (4.0d0 * sqrt(x)))
end function
public static double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * Math.sqrt(x)));
}
def code(x):
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * math.sqrt(x)))
function code(x)
	return Float64(Float64(6.0 * Float64(x - 1.0)) / Float64(Float64(x + 1.0) + Float64(4.0 * sqrt(x))))
end
function tmp = code(x)
	tmp = (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
end
code[x_] := N[(N[(6.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}
\end{array}

Alternative 1: 99.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{6}{\frac{x + \frac{1 - x \cdot 16}{1 - 4 \cdot \sqrt{x}}}{x + -1}} \end{array} \]
(FPCore (x)
 :precision binary64
 (/ 6.0 (/ (+ x (/ (- 1.0 (* x 16.0)) (- 1.0 (* 4.0 (sqrt x))))) (+ x -1.0))))
double code(double x) {
	return 6.0 / ((x + ((1.0 - (x * 16.0)) / (1.0 - (4.0 * sqrt(x))))) / (x + -1.0));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 6.0d0 / ((x + ((1.0d0 - (x * 16.0d0)) / (1.0d0 - (4.0d0 * sqrt(x))))) / (x + (-1.0d0)))
end function
public static double code(double x) {
	return 6.0 / ((x + ((1.0 - (x * 16.0)) / (1.0 - (4.0 * Math.sqrt(x))))) / (x + -1.0));
}
def code(x):
	return 6.0 / ((x + ((1.0 - (x * 16.0)) / (1.0 - (4.0 * math.sqrt(x))))) / (x + -1.0))
function code(x)
	return Float64(6.0 / Float64(Float64(x + Float64(Float64(1.0 - Float64(x * 16.0)) / Float64(1.0 - Float64(4.0 * sqrt(x))))) / Float64(x + -1.0)))
end
function tmp = code(x)
	tmp = 6.0 / ((x + ((1.0 - (x * 16.0)) / (1.0 - (4.0 * sqrt(x))))) / (x + -1.0));
end
code[x_] := N[(6.0 / N[(N[(x + N[(N[(1.0 - N[(x * 16.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{6}{\frac{x + \frac{1 - x \cdot 16}{1 - 4 \cdot \sqrt{x}}}{x + -1}}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/l*N/A

      \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
    2. clear-numN/A

      \[\leadsto 6 \cdot \frac{1}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
    3. un-div-invN/A

      \[\leadsto \frac{6}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}\right)}\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right), \color{blue}{\left(x - 1\right)}\right)\right) \]
    6. associate-+l+N/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(x + \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
    8. +-lowering-+.f64N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x - 1\right)\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
    12. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
    13. metadata-eval99.9%

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
  5. Step-by-step derivation
    1. flip-+N/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\frac{1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)}{1 - 4 \cdot \sqrt{x}}\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    3. metadata-evalN/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot 4\right) \cdot \left(\sqrt{x} \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    7. swap-sqrN/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(4 \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot 16\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    10. rem-square-sqrtN/A

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

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    12. metadata-evalN/A

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

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

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    15. sqrt-lowering-sqrt.f6499.9%

      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \frac{6}{\frac{x + \color{blue}{\frac{1 - x \cdot 16}{1 - 4 \cdot \sqrt{x}}}}{x + -1}} \]
  7. Add Preprocessing

Alternative 2: 98.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 4 \cdot \sqrt{x}\\ \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{6}{\frac{1 + t\_0}{x + -1}}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x + -1}{x + t\_0}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* 4.0 (sqrt x))))
   (if (<= x 1.0)
     (/ 6.0 (/ (+ 1.0 t_0) (+ x -1.0)))
     (* 6.0 (/ (+ x -1.0) (+ x t_0))))))
double code(double x) {
	double t_0 = 4.0 * sqrt(x);
	double tmp;
	if (x <= 1.0) {
		tmp = 6.0 / ((1.0 + t_0) / (x + -1.0));
	} else {
		tmp = 6.0 * ((x + -1.0) / (x + t_0));
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 4.0d0 * sqrt(x)
    if (x <= 1.0d0) then
        tmp = 6.0d0 / ((1.0d0 + t_0) / (x + (-1.0d0)))
    else
        tmp = 6.0d0 * ((x + (-1.0d0)) / (x + t_0))
    end if
    code = tmp
end function
public static double code(double x) {
	double t_0 = 4.0 * Math.sqrt(x);
	double tmp;
	if (x <= 1.0) {
		tmp = 6.0 / ((1.0 + t_0) / (x + -1.0));
	} else {
		tmp = 6.0 * ((x + -1.0) / (x + t_0));
	}
	return tmp;
}
def code(x):
	t_0 = 4.0 * math.sqrt(x)
	tmp = 0
	if x <= 1.0:
		tmp = 6.0 / ((1.0 + t_0) / (x + -1.0))
	else:
		tmp = 6.0 * ((x + -1.0) / (x + t_0))
	return tmp
function code(x)
	t_0 = Float64(4.0 * sqrt(x))
	tmp = 0.0
	if (x <= 1.0)
		tmp = Float64(6.0 / Float64(Float64(1.0 + t_0) / Float64(x + -1.0)));
	else
		tmp = Float64(6.0 * Float64(Float64(x + -1.0) / Float64(x + t_0)));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = 4.0 * sqrt(x);
	tmp = 0.0;
	if (x <= 1.0)
		tmp = 6.0 / ((1.0 + t_0) / (x + -1.0));
	else
		tmp = 6.0 * ((x + -1.0) / (x + t_0));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(6.0 / N[(N[(1.0 + t$95$0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(N[(x + -1.0), $MachinePrecision] / N[(x + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 4 \cdot \sqrt{x}\\
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{6}{\frac{1 + t\_0}{x + -1}}\\

\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x + -1}{x + t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1

    1. Initial program 99.9%

      \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
      2. clear-numN/A

        \[\leadsto 6 \cdot \frac{1}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{6}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right), \color{blue}{\left(x - 1\right)}\right)\right) \]
      6. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(x + \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
      8. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x - 1\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
      13. metadata-eval99.9%

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    4. Applied egg-rr99.9%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f6499.3%

        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
    7. Simplified99.3%

      \[\leadsto \frac{6}{\frac{\color{blue}{1 + 4 \cdot \sqrt{x}}}{x + -1}} \]

    if 1 < x

    1. Initial program 99.7%

      \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
      5. sub-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
      8. associate-+l+N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
      12. sqrt-lowering-sqrt.f6499.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
    4. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)} \cdot 6} \]
    5. Taylor expanded in x around inf

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right), 6\right) \]
      2. sqrt-lowering-sqrt.f6498.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), 6\right) \]
    7. Simplified98.0%

      \[\leadsto \frac{x + -1}{x + \color{blue}{4 \cdot \sqrt{x}}} \cdot 6 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{6}{\frac{1 + 4 \cdot \sqrt{x}}{x + -1}}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x + -1}{x + 4 \cdot \sqrt{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 98.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + 4 \cdot \sqrt{x}\\ \mathbf{if}\;x \leq 0.29:\\ \;\;\;\;\frac{-6}{1 + t\_0}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x + -1}{t\_0}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (+ x (* 4.0 (sqrt x)))))
   (if (<= x 0.29) (/ -6.0 (+ 1.0 t_0)) (* 6.0 (/ (+ x -1.0) t_0)))))
double code(double x) {
	double t_0 = x + (4.0 * sqrt(x));
	double tmp;
	if (x <= 0.29) {
		tmp = -6.0 / (1.0 + t_0);
	} else {
		tmp = 6.0 * ((x + -1.0) / t_0);
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x + (4.0d0 * sqrt(x))
    if (x <= 0.29d0) then
        tmp = (-6.0d0) / (1.0d0 + t_0)
    else
        tmp = 6.0d0 * ((x + (-1.0d0)) / t_0)
    end if
    code = tmp
end function
public static double code(double x) {
	double t_0 = x + (4.0 * Math.sqrt(x));
	double tmp;
	if (x <= 0.29) {
		tmp = -6.0 / (1.0 + t_0);
	} else {
		tmp = 6.0 * ((x + -1.0) / t_0);
	}
	return tmp;
}
def code(x):
	t_0 = x + (4.0 * math.sqrt(x))
	tmp = 0
	if x <= 0.29:
		tmp = -6.0 / (1.0 + t_0)
	else:
		tmp = 6.0 * ((x + -1.0) / t_0)
	return tmp
function code(x)
	t_0 = Float64(x + Float64(4.0 * sqrt(x)))
	tmp = 0.0
	if (x <= 0.29)
		tmp = Float64(-6.0 / Float64(1.0 + t_0));
	else
		tmp = Float64(6.0 * Float64(Float64(x + -1.0) / t_0));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = x + (4.0 * sqrt(x));
	tmp = 0.0;
	if (x <= 0.29)
		tmp = -6.0 / (1.0 + t_0);
	else
		tmp = 6.0 * ((x + -1.0) / t_0);
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(x + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.29], N[(-6.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(N[(x + -1.0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x + 4 \cdot \sqrt{x}\\
\mathbf{if}\;x \leq 0.29:\\
\;\;\;\;\frac{-6}{1 + t\_0}\\

\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x + -1}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 0.28999999999999998

    1. Initial program 99.9%

      \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(6, \mathsf{\_.f64}\left(x, 1\right)\right), \left(4 \cdot \sqrt{x} + \color{blue}{\left(x + 1\right)}\right)\right) \]
      2. associate-+r+N/A

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{-6}, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right), x\right), 1\right)\right) \]
    6. Step-by-step derivation
      1. Simplified99.3%

        \[\leadsto \frac{\color{blue}{-6}}{\left(4 \cdot \sqrt{x} + x\right) + 1} \]

      if 0.28999999999999998 < x

      1. Initial program 99.7%

        \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
        3. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
        5. sub-negN/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
        8. associate-+l+N/A

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
        12. sqrt-lowering-sqrt.f6499.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
      4. Applied egg-rr99.9%

        \[\leadsto \color{blue}{\frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)} \cdot 6} \]
      5. Taylor expanded in x around inf

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right), 6\right) \]
        2. sqrt-lowering-sqrt.f6498.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), 6\right) \]
      7. Simplified98.0%

        \[\leadsto \frac{x + -1}{x + \color{blue}{4 \cdot \sqrt{x}}} \cdot 6 \]
    7. Recombined 2 regimes into one program.
    8. Final simplification98.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.29:\\ \;\;\;\;\frac{-6}{1 + \left(x + 4 \cdot \sqrt{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x + -1}{x + 4 \cdot \sqrt{x}}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 4: 98.0% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + 4 \cdot \sqrt{x}\\ \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{1 + t\_0}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{t\_0}\\ \end{array} \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (+ x (* 4.0 (sqrt x)))))
       (if (<= x 1.0) (/ -6.0 (+ 1.0 t_0)) (* 6.0 (/ x t_0)))))
    double code(double x) {
    	double t_0 = x + (4.0 * sqrt(x));
    	double tmp;
    	if (x <= 1.0) {
    		tmp = -6.0 / (1.0 + t_0);
    	} else {
    		tmp = 6.0 * (x / t_0);
    	}
    	return tmp;
    }
    
    real(8) function code(x)
        real(8), intent (in) :: x
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x + (4.0d0 * sqrt(x))
        if (x <= 1.0d0) then
            tmp = (-6.0d0) / (1.0d0 + t_0)
        else
            tmp = 6.0d0 * (x / t_0)
        end if
        code = tmp
    end function
    
    public static double code(double x) {
    	double t_0 = x + (4.0 * Math.sqrt(x));
    	double tmp;
    	if (x <= 1.0) {
    		tmp = -6.0 / (1.0 + t_0);
    	} else {
    		tmp = 6.0 * (x / t_0);
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = x + (4.0 * math.sqrt(x))
    	tmp = 0
    	if x <= 1.0:
    		tmp = -6.0 / (1.0 + t_0)
    	else:
    		tmp = 6.0 * (x / t_0)
    	return tmp
    
    function code(x)
    	t_0 = Float64(x + Float64(4.0 * sqrt(x)))
    	tmp = 0.0
    	if (x <= 1.0)
    		tmp = Float64(-6.0 / Float64(1.0 + t_0));
    	else
    		tmp = Float64(6.0 * Float64(x / t_0));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = x + (4.0 * sqrt(x));
    	tmp = 0.0;
    	if (x <= 1.0)
    		tmp = -6.0 / (1.0 + t_0);
    	else
    		tmp = 6.0 * (x / t_0);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := Block[{t$95$0 = N[(x + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(-6.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x / t$95$0), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x + 4 \cdot \sqrt{x}\\
    \mathbf{if}\;x \leq 1:\\
    \;\;\;\;\frac{-6}{1 + t\_0}\\
    
    \mathbf{else}:\\
    \;\;\;\;6 \cdot \frac{x}{t\_0}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 1

      1. Initial program 99.9%

        \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(6, \mathsf{\_.f64}\left(x, 1\right)\right), \left(4 \cdot \sqrt{x} + \color{blue}{\left(x + 1\right)}\right)\right) \]
        2. associate-+r+N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{-6}, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right), x\right), 1\right)\right) \]
      6. Step-by-step derivation
        1. Simplified99.3%

          \[\leadsto \frac{\color{blue}{-6}}{\left(4 \cdot \sqrt{x} + x\right) + 1} \]

        if 1 < x

        1. Initial program 99.7%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. associate-/l*N/A

            \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
          2. *-commutativeN/A

            \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
          3. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
          5. sub-negN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
          8. associate-+l+N/A

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
          12. sqrt-lowering-sqrt.f6499.9%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
        4. Applied egg-rr99.9%

          \[\leadsto \color{blue}{\frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)} \cdot 6} \]
        5. Taylor expanded in x around inf

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right), 6\right) \]
          2. sqrt-lowering-sqrt.f6498.0%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), 6\right) \]
        7. Simplified98.0%

          \[\leadsto \frac{x + -1}{x + \color{blue}{4 \cdot \sqrt{x}}} \cdot 6 \]
        8. Taylor expanded in x around inf

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{x}, \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), 6\right) \]
        9. Step-by-step derivation
          1. Simplified97.8%

            \[\leadsto \frac{\color{blue}{x}}{x + 4 \cdot \sqrt{x}} \cdot 6 \]
        10. Recombined 2 regimes into one program.
        11. Final simplification98.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{1 + \left(x + 4 \cdot \sqrt{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + 4 \cdot \sqrt{x}}\\ \end{array} \]
        12. Add Preprocessing

        Alternative 5: 98.0% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 4 \cdot \sqrt{x}\\ \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{t\_0 + \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + t\_0}\\ \end{array} \end{array} \]
        (FPCore (x)
         :precision binary64
         (let* ((t_0 (* 4.0 (sqrt x))))
           (if (<= x 1.0) (/ -6.0 (+ t_0 (+ x 1.0))) (* 6.0 (/ x (+ x t_0))))))
        double code(double x) {
        	double t_0 = 4.0 * sqrt(x);
        	double tmp;
        	if (x <= 1.0) {
        		tmp = -6.0 / (t_0 + (x + 1.0));
        	} else {
        		tmp = 6.0 * (x / (x + t_0));
        	}
        	return tmp;
        }
        
        real(8) function code(x)
            real(8), intent (in) :: x
            real(8) :: t_0
            real(8) :: tmp
            t_0 = 4.0d0 * sqrt(x)
            if (x <= 1.0d0) then
                tmp = (-6.0d0) / (t_0 + (x + 1.0d0))
            else
                tmp = 6.0d0 * (x / (x + t_0))
            end if
            code = tmp
        end function
        
        public static double code(double x) {
        	double t_0 = 4.0 * Math.sqrt(x);
        	double tmp;
        	if (x <= 1.0) {
        		tmp = -6.0 / (t_0 + (x + 1.0));
        	} else {
        		tmp = 6.0 * (x / (x + t_0));
        	}
        	return tmp;
        }
        
        def code(x):
        	t_0 = 4.0 * math.sqrt(x)
        	tmp = 0
        	if x <= 1.0:
        		tmp = -6.0 / (t_0 + (x + 1.0))
        	else:
        		tmp = 6.0 * (x / (x + t_0))
        	return tmp
        
        function code(x)
        	t_0 = Float64(4.0 * sqrt(x))
        	tmp = 0.0
        	if (x <= 1.0)
        		tmp = Float64(-6.0 / Float64(t_0 + Float64(x + 1.0)));
        	else
        		tmp = Float64(6.0 * Float64(x / Float64(x + t_0)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x)
        	t_0 = 4.0 * sqrt(x);
        	tmp = 0.0;
        	if (x <= 1.0)
        		tmp = -6.0 / (t_0 + (x + 1.0));
        	else
        		tmp = 6.0 * (x / (x + t_0));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_] := Block[{t$95$0 = N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(-6.0 / N[(t$95$0 + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x / N[(x + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := 4 \cdot \sqrt{x}\\
        \mathbf{if}\;x \leq 1:\\
        \;\;\;\;\frac{-6}{t\_0 + \left(x + 1\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;6 \cdot \frac{x}{x + t\_0}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < 1

          1. Initial program 99.9%

            \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \mathsf{/.f64}\left(\color{blue}{-6}, \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right) \]
          4. Step-by-step derivation
            1. Simplified99.3%

              \[\leadsto \frac{\color{blue}{-6}}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]

            if 1 < x

            1. Initial program 99.7%

              \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. associate-/l*N/A

                \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
              2. *-commutativeN/A

                \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
              3. *-lowering-*.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
              5. sub-negN/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
              7. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
              8. associate-+l+N/A

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
              12. sqrt-lowering-sqrt.f6499.9%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
            4. Applied egg-rr99.9%

              \[\leadsto \color{blue}{\frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)} \cdot 6} \]
            5. Taylor expanded in x around inf

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right), 6\right) \]
              2. sqrt-lowering-sqrt.f6498.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), 6\right) \]
            7. Simplified98.0%

              \[\leadsto \frac{x + -1}{x + \color{blue}{4 \cdot \sqrt{x}}} \cdot 6 \]
            8. Taylor expanded in x around inf

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{x}, \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), 6\right) \]
            9. Step-by-step derivation
              1. Simplified97.8%

                \[\leadsto \frac{\color{blue}{x}}{x + 4 \cdot \sqrt{x}} \cdot 6 \]
            10. Recombined 2 regimes into one program.
            11. Final simplification98.4%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{4 \cdot \sqrt{x} + \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + 4 \cdot \sqrt{x}}\\ \end{array} \]
            12. Add Preprocessing

            Alternative 6: 98.0% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + 4 \cdot \sqrt{x}}\\ \end{array} \end{array} \]
            (FPCore (x)
             :precision binary64
             (if (<= x 1.0)
               (* 6.0 (/ 1.0 (+ -1.0 (* (sqrt x) -4.0))))
               (* 6.0 (/ x (+ x (* 4.0 (sqrt x)))))))
            double code(double x) {
            	double tmp;
            	if (x <= 1.0) {
            		tmp = 6.0 * (1.0 / (-1.0 + (sqrt(x) * -4.0)));
            	} else {
            		tmp = 6.0 * (x / (x + (4.0 * sqrt(x))));
            	}
            	return tmp;
            }
            
            real(8) function code(x)
                real(8), intent (in) :: x
                real(8) :: tmp
                if (x <= 1.0d0) then
                    tmp = 6.0d0 * (1.0d0 / ((-1.0d0) + (sqrt(x) * (-4.0d0))))
                else
                    tmp = 6.0d0 * (x / (x + (4.0d0 * sqrt(x))))
                end if
                code = tmp
            end function
            
            public static double code(double x) {
            	double tmp;
            	if (x <= 1.0) {
            		tmp = 6.0 * (1.0 / (-1.0 + (Math.sqrt(x) * -4.0)));
            	} else {
            		tmp = 6.0 * (x / (x + (4.0 * Math.sqrt(x))));
            	}
            	return tmp;
            }
            
            def code(x):
            	tmp = 0
            	if x <= 1.0:
            		tmp = 6.0 * (1.0 / (-1.0 + (math.sqrt(x) * -4.0)))
            	else:
            		tmp = 6.0 * (x / (x + (4.0 * math.sqrt(x))))
            	return tmp
            
            function code(x)
            	tmp = 0.0
            	if (x <= 1.0)
            		tmp = Float64(6.0 * Float64(1.0 / Float64(-1.0 + Float64(sqrt(x) * -4.0))));
            	else
            		tmp = Float64(6.0 * Float64(x / Float64(x + Float64(4.0 * sqrt(x)))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x)
            	tmp = 0.0;
            	if (x <= 1.0)
            		tmp = 6.0 * (1.0 / (-1.0 + (sqrt(x) * -4.0)));
            	else
            		tmp = 6.0 * (x / (x + (4.0 * sqrt(x))));
            	end
            	tmp_2 = tmp;
            end
            
            code[x_] := If[LessEqual[x, 1.0], N[(6.0 * N[(1.0 / N[(-1.0 + N[(N[Sqrt[x], $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x / N[(x + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq 1:\\
            \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\
            
            \mathbf{else}:\\
            \;\;\;\;6 \cdot \frac{x}{x + 4 \cdot \sqrt{x}}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < 1

              1. Initial program 99.9%

                \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. associate-/l*N/A

                  \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                2. *-commutativeN/A

                  \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
                3. *-lowering-*.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                5. sub-negN/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                7. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                8. associate-+l+N/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
                12. sqrt-lowering-sqrt.f6499.9%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
              4. Applied egg-rr99.9%

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

                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{-1}{1 + 4 \cdot \sqrt{x}}\right)}, 6\right) \]
              6. Step-by-step derivation
                1. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{1 + 4 \cdot \sqrt{x}}\right), 6\right) \]
                2. distribute-neg-fracN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\frac{1}{1 + 4 \cdot \sqrt{x}}\right)\right), 6\right) \]
                3. distribute-neg-frac2N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(\mathsf{neg}\left(\left(1 + 4 \cdot \sqrt{x}\right)\right)\right)\right), 6\right) \]
                5. distribute-neg-inN/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + \left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right), 6\right) \]
                7. distribute-rgt-neg-outN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + 4 \cdot \left(\mathsf{neg}\left(\sqrt{x}\right)\right)\right)\right), 6\right) \]
                8. mul-1-negN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + 4 \cdot \left(-1 \cdot \sqrt{x}\right)\right)\right), 6\right) \]
                9. associate-*r*N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + \left(4 \cdot -1\right) \cdot \sqrt{x}\right)\right), 6\right) \]
                10. metadata-evalN/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), -4\right)\right)\right), 6\right) \]
                14. sqrt-lowering-sqrt.f6499.3%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right), 6\right) \]
              7. Simplified99.3%

                \[\leadsto \color{blue}{\frac{1}{-1 + \sqrt{x} \cdot -4}} \cdot 6 \]

              if 1 < x

              1. Initial program 99.7%

                \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. associate-/l*N/A

                  \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                2. *-commutativeN/A

                  \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
                3. *-lowering-*.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                5. sub-negN/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                7. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                8. associate-+l+N/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
                12. sqrt-lowering-sqrt.f6499.9%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
              4. Applied egg-rr99.9%

                \[\leadsto \color{blue}{\frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)} \cdot 6} \]
              5. Taylor expanded in x around inf

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right), 6\right) \]
                2. sqrt-lowering-sqrt.f6498.0%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), 6\right) \]
              7. Simplified98.0%

                \[\leadsto \frac{x + -1}{x + \color{blue}{4 \cdot \sqrt{x}}} \cdot 6 \]
              8. Taylor expanded in x around inf

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{x}, \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), 6\right) \]
              9. Step-by-step derivation
                1. Simplified97.8%

                  \[\leadsto \frac{\color{blue}{x}}{x + 4 \cdot \sqrt{x}} \cdot 6 \]
              10. Recombined 2 regimes into one program.
              11. Final simplification98.4%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + 4 \cdot \sqrt{x}}\\ \end{array} \]
              12. Add Preprocessing

              Alternative 7: 98.0% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \frac{1}{-1 + \frac{-4}{\sqrt{x}}}\\ \end{array} \end{array} \]
              (FPCore (x)
               :precision binary64
               (if (<= x 1.0)
                 (* 6.0 (/ 1.0 (+ -1.0 (* (sqrt x) -4.0))))
                 (* -6.0 (/ 1.0 (+ -1.0 (/ -4.0 (sqrt x)))))))
              double code(double x) {
              	double tmp;
              	if (x <= 1.0) {
              		tmp = 6.0 * (1.0 / (-1.0 + (sqrt(x) * -4.0)));
              	} else {
              		tmp = -6.0 * (1.0 / (-1.0 + (-4.0 / sqrt(x))));
              	}
              	return tmp;
              }
              
              real(8) function code(x)
                  real(8), intent (in) :: x
                  real(8) :: tmp
                  if (x <= 1.0d0) then
                      tmp = 6.0d0 * (1.0d0 / ((-1.0d0) + (sqrt(x) * (-4.0d0))))
                  else
                      tmp = (-6.0d0) * (1.0d0 / ((-1.0d0) + ((-4.0d0) / sqrt(x))))
                  end if
                  code = tmp
              end function
              
              public static double code(double x) {
              	double tmp;
              	if (x <= 1.0) {
              		tmp = 6.0 * (1.0 / (-1.0 + (Math.sqrt(x) * -4.0)));
              	} else {
              		tmp = -6.0 * (1.0 / (-1.0 + (-4.0 / Math.sqrt(x))));
              	}
              	return tmp;
              }
              
              def code(x):
              	tmp = 0
              	if x <= 1.0:
              		tmp = 6.0 * (1.0 / (-1.0 + (math.sqrt(x) * -4.0)))
              	else:
              		tmp = -6.0 * (1.0 / (-1.0 + (-4.0 / math.sqrt(x))))
              	return tmp
              
              function code(x)
              	tmp = 0.0
              	if (x <= 1.0)
              		tmp = Float64(6.0 * Float64(1.0 / Float64(-1.0 + Float64(sqrt(x) * -4.0))));
              	else
              		tmp = Float64(-6.0 * Float64(1.0 / Float64(-1.0 + Float64(-4.0 / sqrt(x)))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x)
              	tmp = 0.0;
              	if (x <= 1.0)
              		tmp = 6.0 * (1.0 / (-1.0 + (sqrt(x) * -4.0)));
              	else
              		tmp = -6.0 * (1.0 / (-1.0 + (-4.0 / sqrt(x))));
              	end
              	tmp_2 = tmp;
              end
              
              code[x_] := If[LessEqual[x, 1.0], N[(6.0 * N[(1.0 / N[(-1.0 + N[(N[Sqrt[x], $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(1.0 / N[(-1.0 + N[(-4.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq 1:\\
              \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\
              
              \mathbf{else}:\\
              \;\;\;\;-6 \cdot \frac{1}{-1 + \frac{-4}{\sqrt{x}}}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < 1

                1. Initial program 99.9%

                  \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. associate-/l*N/A

                    \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                  2. *-commutativeN/A

                    \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
                  3. *-lowering-*.f64N/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                  5. sub-negN/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                  7. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                  8. associate-+l+N/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
                  12. sqrt-lowering-sqrt.f6499.9%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
                4. Applied egg-rr99.9%

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

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{-1}{1 + 4 \cdot \sqrt{x}}\right)}, 6\right) \]
                6. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{1 + 4 \cdot \sqrt{x}}\right), 6\right) \]
                  2. distribute-neg-fracN/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\frac{1}{1 + 4 \cdot \sqrt{x}}\right)\right), 6\right) \]
                  3. distribute-neg-frac2N/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(\mathsf{neg}\left(\left(1 + 4 \cdot \sqrt{x}\right)\right)\right)\right), 6\right) \]
                  5. distribute-neg-inN/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + \left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right), 6\right) \]
                  7. distribute-rgt-neg-outN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + 4 \cdot \left(\mathsf{neg}\left(\sqrt{x}\right)\right)\right)\right), 6\right) \]
                  8. mul-1-negN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + 4 \cdot \left(-1 \cdot \sqrt{x}\right)\right)\right), 6\right) \]
                  9. associate-*r*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + \left(4 \cdot -1\right) \cdot \sqrt{x}\right)\right), 6\right) \]
                  10. metadata-evalN/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), -4\right)\right)\right), 6\right) \]
                  14. sqrt-lowering-sqrt.f6499.3%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right), 6\right) \]
                7. Simplified99.3%

                  \[\leadsto \color{blue}{\frac{1}{-1 + \sqrt{x} \cdot -4}} \cdot 6 \]

                if 1 < x

                1. Initial program 99.7%

                  \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                2. Add Preprocessing
                3. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{\frac{6}{1 + 4 \cdot \sqrt{\frac{1}{x}}}} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \frac{6}{4 \cdot \sqrt{\frac{1}{x}} + \color{blue}{1}} \]
                  2. remove-double-negN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{\frac{1}{x}}\right)\right)\right)\right) + 1} \]
                  3. distribute-rgt-neg-inN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}}\right)\right)\right)\right) + 1} \]
                  4. mul-1-negN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(-1 \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  5. rem-square-sqrtN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  6. unpow2N/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  7. *-commutativeN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right) + 1} \]
                  8. metadata-evalN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right) + \left(\mathsf{neg}\left(-1\right)\right)} \]
                  9. distribute-neg-inN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) + -1\right)\right)} \]
                  10. metadata-evalN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
                  11. sub-negN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1\right)\right)} \]
                  12. distribute-neg-frac2N/A

                    \[\leadsto \mathsf{neg}\left(\frac{6}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1}\right) \]
                  13. distribute-neg-fracN/A

                    \[\leadsto \frac{\mathsf{neg}\left(6\right)}{\color{blue}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1}} \]
                  14. metadata-evalN/A

                    \[\leadsto \frac{-6}{\color{blue}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)} - 1} \]
                  15. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(-6, \color{blue}{\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1\right)}\right) \]
                5. Simplified97.8%

                  \[\leadsto \color{blue}{\frac{-6}{-1 + \sqrt{\frac{1}{x}} \cdot -4}} \]
                6. Step-by-step derivation
                  1. clear-numN/A

                    \[\leadsto \frac{1}{\color{blue}{\frac{-1 + \sqrt{\frac{1}{x}} \cdot -4}{-6}}} \]
                  2. associate-/r/N/A

                    \[\leadsto \frac{1}{-1 + \sqrt{\frac{1}{x}} \cdot -4} \cdot \color{blue}{-6} \]
                  3. flip3-+N/A

                    \[\leadsto \frac{1}{\frac{{-1}^{3} + {\left(\sqrt{\frac{1}{x}} \cdot -4\right)}^{3}}{-1 \cdot -1 + \left(\left(\sqrt{\frac{1}{x}} \cdot -4\right) \cdot \left(\sqrt{\frac{1}{x}} \cdot -4\right) - -1 \cdot \left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)}} \cdot -6 \]
                  4. clear-numN/A

                    \[\leadsto \frac{-1 \cdot -1 + \left(\left(\sqrt{\frac{1}{x}} \cdot -4\right) \cdot \left(\sqrt{\frac{1}{x}} \cdot -4\right) - -1 \cdot \left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)}{{-1}^{3} + {\left(\sqrt{\frac{1}{x}} \cdot -4\right)}^{3}} \cdot -6 \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1 \cdot -1 + \left(\left(\sqrt{\frac{1}{x}} \cdot -4\right) \cdot \left(\sqrt{\frac{1}{x}} \cdot -4\right) - -1 \cdot \left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)}{{-1}^{3} + {\left(\sqrt{\frac{1}{x}} \cdot -4\right)}^{3}}\right), \color{blue}{-6}\right) \]
                7. Applied egg-rr97.8%

                  \[\leadsto \color{blue}{\frac{1}{-1 + \frac{-4}{\sqrt{x}}} \cdot -6} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification98.4%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \frac{1}{-1 + \frac{-4}{\sqrt{x}}}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 8: 98.0% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\ \end{array} \end{array} \]
              (FPCore (x)
               :precision binary64
               (if (<= x 1.0)
                 (* 6.0 (/ 1.0 (+ -1.0 (* (sqrt x) -4.0))))
                 (/ 6.0 (+ 1.0 (/ 4.0 (sqrt x))))))
              double code(double x) {
              	double tmp;
              	if (x <= 1.0) {
              		tmp = 6.0 * (1.0 / (-1.0 + (sqrt(x) * -4.0)));
              	} else {
              		tmp = 6.0 / (1.0 + (4.0 / sqrt(x)));
              	}
              	return tmp;
              }
              
              real(8) function code(x)
                  real(8), intent (in) :: x
                  real(8) :: tmp
                  if (x <= 1.0d0) then
                      tmp = 6.0d0 * (1.0d0 / ((-1.0d0) + (sqrt(x) * (-4.0d0))))
                  else
                      tmp = 6.0d0 / (1.0d0 + (4.0d0 / sqrt(x)))
                  end if
                  code = tmp
              end function
              
              public static double code(double x) {
              	double tmp;
              	if (x <= 1.0) {
              		tmp = 6.0 * (1.0 / (-1.0 + (Math.sqrt(x) * -4.0)));
              	} else {
              		tmp = 6.0 / (1.0 + (4.0 / Math.sqrt(x)));
              	}
              	return tmp;
              }
              
              def code(x):
              	tmp = 0
              	if x <= 1.0:
              		tmp = 6.0 * (1.0 / (-1.0 + (math.sqrt(x) * -4.0)))
              	else:
              		tmp = 6.0 / (1.0 + (4.0 / math.sqrt(x)))
              	return tmp
              
              function code(x)
              	tmp = 0.0
              	if (x <= 1.0)
              		tmp = Float64(6.0 * Float64(1.0 / Float64(-1.0 + Float64(sqrt(x) * -4.0))));
              	else
              		tmp = Float64(6.0 / Float64(1.0 + Float64(4.0 / sqrt(x))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x)
              	tmp = 0.0;
              	if (x <= 1.0)
              		tmp = 6.0 * (1.0 / (-1.0 + (sqrt(x) * -4.0)));
              	else
              		tmp = 6.0 / (1.0 + (4.0 / sqrt(x)));
              	end
              	tmp_2 = tmp;
              end
              
              code[x_] := If[LessEqual[x, 1.0], N[(6.0 * N[(1.0 / N[(-1.0 + N[(N[Sqrt[x], $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / N[(1.0 + N[(4.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq 1:\\
              \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < 1

                1. Initial program 99.9%

                  \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. associate-/l*N/A

                    \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                  2. *-commutativeN/A

                    \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
                  3. *-lowering-*.f64N/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                  5. sub-negN/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                  7. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                  8. associate-+l+N/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
                  12. sqrt-lowering-sqrt.f6499.9%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
                4. Applied egg-rr99.9%

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

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{-1}{1 + 4 \cdot \sqrt{x}}\right)}, 6\right) \]
                6. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{1 + 4 \cdot \sqrt{x}}\right), 6\right) \]
                  2. distribute-neg-fracN/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\frac{1}{1 + 4 \cdot \sqrt{x}}\right)\right), 6\right) \]
                  3. distribute-neg-frac2N/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(\mathsf{neg}\left(\left(1 + 4 \cdot \sqrt{x}\right)\right)\right)\right), 6\right) \]
                  5. distribute-neg-inN/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + \left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right), 6\right) \]
                  7. distribute-rgt-neg-outN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + 4 \cdot \left(\mathsf{neg}\left(\sqrt{x}\right)\right)\right)\right), 6\right) \]
                  8. mul-1-negN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + 4 \cdot \left(-1 \cdot \sqrt{x}\right)\right)\right), 6\right) \]
                  9. associate-*r*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(-1 + \left(4 \cdot -1\right) \cdot \sqrt{x}\right)\right), 6\right) \]
                  10. metadata-evalN/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), -4\right)\right)\right), 6\right) \]
                  14. sqrt-lowering-sqrt.f6499.3%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right), 6\right) \]
                7. Simplified99.3%

                  \[\leadsto \color{blue}{\frac{1}{-1 + \sqrt{x} \cdot -4}} \cdot 6 \]

                if 1 < x

                1. Initial program 99.7%

                  \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                2. Add Preprocessing
                3. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{\frac{6}{1 + 4 \cdot \sqrt{\frac{1}{x}}}} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \frac{6}{4 \cdot \sqrt{\frac{1}{x}} + \color{blue}{1}} \]
                  2. remove-double-negN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{\frac{1}{x}}\right)\right)\right)\right) + 1} \]
                  3. distribute-rgt-neg-inN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}}\right)\right)\right)\right) + 1} \]
                  4. mul-1-negN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(-1 \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  5. rem-square-sqrtN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  6. unpow2N/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  7. *-commutativeN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right) + 1} \]
                  8. metadata-evalN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right) + \left(\mathsf{neg}\left(-1\right)\right)} \]
                  9. distribute-neg-inN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) + -1\right)\right)} \]
                  10. metadata-evalN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
                  11. sub-negN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1\right)\right)} \]
                  12. distribute-neg-frac2N/A

                    \[\leadsto \mathsf{neg}\left(\frac{6}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1}\right) \]
                  13. distribute-neg-fracN/A

                    \[\leadsto \frac{\mathsf{neg}\left(6\right)}{\color{blue}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1}} \]
                  14. metadata-evalN/A

                    \[\leadsto \frac{-6}{\color{blue}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)} - 1} \]
                  15. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(-6, \color{blue}{\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1\right)}\right) \]
                5. Simplified97.8%

                  \[\leadsto \color{blue}{\frac{-6}{-1 + \sqrt{\frac{1}{x}} \cdot -4}} \]
                6. Step-by-step derivation
                  1. frac-2negN/A

                    \[\leadsto \frac{\mathsf{neg}\left(-6\right)}{\color{blue}{\mathsf{neg}\left(\left(-1 + \sqrt{\frac{1}{x}} \cdot -4\right)\right)}} \]
                  2. metadata-evalN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\color{blue}{\left(-1 + \sqrt{\frac{1}{x}} \cdot -4\right)}\right)} \]
                  3. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\mathsf{neg}\left(\left(-1 + \sqrt{\frac{1}{x}} \cdot -4\right)\right)\right)}\right) \]
                  4. distribute-neg-inN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(\left(\mathsf{neg}\left(-1\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)}\right)\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(1 + \left(\mathsf{neg}\left(\color{blue}{\sqrt{\frac{1}{x}} \cdot -4}\right)\right)\right)\right) \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(1 + -1 \cdot \color{blue}{\left(\sqrt{\frac{1}{x}} \cdot -4\right)}\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \color{blue}{\left(-1 \cdot \left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)}\right)\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(-1 \cdot \left(-4 \cdot \color{blue}{\sqrt{\frac{1}{x}}}\right)\right)\right)\right) \]
                  9. associate-*r*N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\left(-1 \cdot -4\right) \cdot \color{blue}{\sqrt{\frac{1}{x}}}\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(4 \cdot \sqrt{\color{blue}{\frac{1}{x}}}\right)\right)\right) \]
                  11. sqrt-divN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(4 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{x}}}\right)\right)\right) \]
                  12. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(4 \cdot \frac{1}{\sqrt{\color{blue}{x}}}\right)\right)\right) \]
                  13. un-div-invN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\frac{4}{\color{blue}{\sqrt{x}}}\right)\right)\right) \]
                  14. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(4, \color{blue}{\left(\sqrt{x}\right)}\right)\right)\right) \]
                  15. sqrt-lowering-sqrt.f6497.8%

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right) \]
                7. Applied egg-rr97.8%

                  \[\leadsto \color{blue}{\frac{6}{1 + \frac{4}{\sqrt{x}}}} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification98.4%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;6 \cdot \frac{1}{-1 + \sqrt{x} \cdot -4}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 9: 99.9% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ 6 \cdot \frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)} \end{array} \]
              (FPCore (x)
               :precision binary64
               (* 6.0 (/ (+ x -1.0) (+ x (+ 1.0 (* 4.0 (sqrt x)))))))
              double code(double x) {
              	return 6.0 * ((x + -1.0) / (x + (1.0 + (4.0 * sqrt(x)))));
              }
              
              real(8) function code(x)
                  real(8), intent (in) :: x
                  code = 6.0d0 * ((x + (-1.0d0)) / (x + (1.0d0 + (4.0d0 * sqrt(x)))))
              end function
              
              public static double code(double x) {
              	return 6.0 * ((x + -1.0) / (x + (1.0 + (4.0 * Math.sqrt(x)))));
              }
              
              def code(x):
              	return 6.0 * ((x + -1.0) / (x + (1.0 + (4.0 * math.sqrt(x)))))
              
              function code(x)
              	return Float64(6.0 * Float64(Float64(x + -1.0) / Float64(x + Float64(1.0 + Float64(4.0 * sqrt(x))))))
              end
              
              function tmp = code(x)
              	tmp = 6.0 * ((x + -1.0) / (x + (1.0 + (4.0 * sqrt(x)))));
              end
              
              code[x_] := N[(6.0 * N[(N[(x + -1.0), $MachinePrecision] / N[(x + N[(1.0 + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              6 \cdot \frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)}
              \end{array}
              
              Derivation
              1. Initial program 99.8%

                \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. associate-/l*N/A

                  \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                2. *-commutativeN/A

                  \[\leadsto \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \cdot \color{blue}{6} \]
                3. *-lowering-*.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                5. sub-negN/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(1\right)\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                7. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right), 6\right) \]
                8. associate-+l+N/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), 6\right) \]
                12. sqrt-lowering-sqrt.f6499.9%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), 6\right) \]
              4. Applied egg-rr99.9%

                \[\leadsto \color{blue}{\frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)} \cdot 6} \]
              5. Final simplification99.9%

                \[\leadsto 6 \cdot \frac{x + -1}{x + \left(1 + 4 \cdot \sqrt{x}\right)} \]
              6. Add Preprocessing

              Alternative 10: 98.0% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{1}{-0.16666666666666666 + \sqrt{x} \cdot -0.6666666666666666}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\ \end{array} \end{array} \]
              (FPCore (x)
               :precision binary64
               (if (<= x 1.0)
                 (/ 1.0 (+ -0.16666666666666666 (* (sqrt x) -0.6666666666666666)))
                 (/ 6.0 (+ 1.0 (/ 4.0 (sqrt x))))))
              double code(double x) {
              	double tmp;
              	if (x <= 1.0) {
              		tmp = 1.0 / (-0.16666666666666666 + (sqrt(x) * -0.6666666666666666));
              	} else {
              		tmp = 6.0 / (1.0 + (4.0 / sqrt(x)));
              	}
              	return tmp;
              }
              
              real(8) function code(x)
                  real(8), intent (in) :: x
                  real(8) :: tmp
                  if (x <= 1.0d0) then
                      tmp = 1.0d0 / ((-0.16666666666666666d0) + (sqrt(x) * (-0.6666666666666666d0)))
                  else
                      tmp = 6.0d0 / (1.0d0 + (4.0d0 / sqrt(x)))
                  end if
                  code = tmp
              end function
              
              public static double code(double x) {
              	double tmp;
              	if (x <= 1.0) {
              		tmp = 1.0 / (-0.16666666666666666 + (Math.sqrt(x) * -0.6666666666666666));
              	} else {
              		tmp = 6.0 / (1.0 + (4.0 / Math.sqrt(x)));
              	}
              	return tmp;
              }
              
              def code(x):
              	tmp = 0
              	if x <= 1.0:
              		tmp = 1.0 / (-0.16666666666666666 + (math.sqrt(x) * -0.6666666666666666))
              	else:
              		tmp = 6.0 / (1.0 + (4.0 / math.sqrt(x)))
              	return tmp
              
              function code(x)
              	tmp = 0.0
              	if (x <= 1.0)
              		tmp = Float64(1.0 / Float64(-0.16666666666666666 + Float64(sqrt(x) * -0.6666666666666666)));
              	else
              		tmp = Float64(6.0 / Float64(1.0 + Float64(4.0 / sqrt(x))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x)
              	tmp = 0.0;
              	if (x <= 1.0)
              		tmp = 1.0 / (-0.16666666666666666 + (sqrt(x) * -0.6666666666666666));
              	else
              		tmp = 6.0 / (1.0 + (4.0 / sqrt(x)));
              	end
              	tmp_2 = tmp;
              end
              
              code[x_] := If[LessEqual[x, 1.0], N[(1.0 / N[(-0.16666666666666666 + N[(N[Sqrt[x], $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / N[(1.0 + N[(4.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq 1:\\
              \;\;\;\;\frac{1}{-0.16666666666666666 + \sqrt{x} \cdot -0.6666666666666666}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < 1

                1. Initial program 99.9%

                  \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                2. Add Preprocessing
                3. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\frac{-6}{1 + 4 \cdot \sqrt{x}}} \]
                4. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \frac{\mathsf{neg}\left(6\right)}{\color{blue}{1} + 4 \cdot \sqrt{x}} \]
                  2. distribute-neg-fracN/A

                    \[\leadsto \mathsf{neg}\left(\frac{6}{1 + 4 \cdot \sqrt{x}}\right) \]
                  3. distribute-neg-frac2N/A

                    \[\leadsto \frac{6}{\color{blue}{\mathsf{neg}\left(\left(1 + 4 \cdot \sqrt{x}\right)\right)}} \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\mathsf{neg}\left(\left(1 + 4 \cdot \sqrt{x}\right)\right)\right)}\right) \]
                  5. distribute-neg-inN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(\left(\mathsf{neg}\left(1\right)\right) + \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
                  6. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(-1 + \left(\mathsf{neg}\left(\color{blue}{4 \cdot \sqrt{x}}\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right) \]
                  9. distribute-rgt-neg-inN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \left(\sqrt{x} \cdot -4\right)\right)\right) \]
                  11. metadata-evalN/A

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

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

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\color{blue}{4} \cdot -1\right)\right)\right)\right) \]
                  14. metadata-eval99.2%

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right) \]
                5. Simplified99.2%

                  \[\leadsto \color{blue}{\frac{6}{-1 + \sqrt{x} \cdot -4}} \]
                6. Step-by-step derivation
                  1. clear-numN/A

                    \[\leadsto \frac{1}{\color{blue}{\frac{-1 + \sqrt{x} \cdot -4}{6}}} \]
                  2. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1 + \sqrt{x} \cdot -4}{6}\right)}\right) \]
                  3. frac-2negN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(-1 + \sqrt{x} \cdot -4\right)\right)}{\color{blue}{\mathsf{neg}\left(6\right)}}\right)\right) \]
                  4. distribute-neg-inN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)}{\mathsf{neg}\left(\color{blue}{6}\right)}\right)\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + -1 \cdot \left(\sqrt{x} \cdot -4\right)}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + -1 \cdot \left(-4 \cdot \sqrt{x}\right)}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  8. associate-*r*N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + \left(-1 \cdot -4\right) \cdot \sqrt{x}}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + 4 \cdot \sqrt{x}}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + 4 \cdot \sqrt{x}}{-6}\right)\right) \]
                  11. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 + 4 \cdot \sqrt{x}\right), \color{blue}{-6}\right)\right) \]
                  12. +-lowering-+.f64N/A

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

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right), -6\right)\right) \]
                  14. sqrt-lowering-sqrt.f6499.3%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right), -6\right)\right) \]
                7. Applied egg-rr99.3%

                  \[\leadsto \color{blue}{\frac{1}{\frac{1 + 4 \cdot \sqrt{x}}{-6}}} \]
                8. Taylor expanded in x around 0

                  \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{6} \cdot \left(1 + 4 \cdot \sqrt{x}\right)\right)}\right) \]
                9. Step-by-step derivation
                  1. distribute-rgt-inN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(1 \cdot \frac{-1}{6} + \color{blue}{\left(4 \cdot \sqrt{x}\right) \cdot \frac{-1}{6}}\right)\right) \]
                  2. metadata-evalN/A

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

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \color{blue}{\left(\left(4 \cdot \sqrt{x}\right) \cdot \frac{-1}{6}\right)}\right)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\left(\sqrt{x} \cdot 4\right) \cdot \frac{-1}{6}\right)\right)\right) \]
                  5. associate-*l*N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\sqrt{x} \cdot \color{blue}{\left(4 \cdot \frac{-1}{6}\right)}\right)\right)\right) \]
                  6. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\sqrt{x} \cdot \frac{-2}{3}\right)\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{-2}{3}}\right)\right)\right) \]
                  8. sqrt-lowering-sqrt.f6499.2%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{-2}{3}\right)\right)\right) \]
                10. Simplified99.2%

                  \[\leadsto \frac{1}{\color{blue}{-0.16666666666666666 + \sqrt{x} \cdot -0.6666666666666666}} \]

                if 1 < x

                1. Initial program 99.7%

                  \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                2. Add Preprocessing
                3. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{\frac{6}{1 + 4 \cdot \sqrt{\frac{1}{x}}}} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \frac{6}{4 \cdot \sqrt{\frac{1}{x}} + \color{blue}{1}} \]
                  2. remove-double-negN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{\frac{1}{x}}\right)\right)\right)\right) + 1} \]
                  3. distribute-rgt-neg-inN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}}\right)\right)\right)\right) + 1} \]
                  4. mul-1-negN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(-1 \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  5. rem-square-sqrtN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  6. unpow2N/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{x}}\right)\right)\right) + 1} \]
                  7. *-commutativeN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right) + 1} \]
                  8. metadata-evalN/A

                    \[\leadsto \frac{6}{\left(\mathsf{neg}\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right) + \left(\mathsf{neg}\left(-1\right)\right)} \]
                  9. distribute-neg-inN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) + -1\right)\right)} \]
                  10. metadata-evalN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
                  11. sub-negN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1\right)\right)} \]
                  12. distribute-neg-frac2N/A

                    \[\leadsto \mathsf{neg}\left(\frac{6}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1}\right) \]
                  13. distribute-neg-fracN/A

                    \[\leadsto \frac{\mathsf{neg}\left(6\right)}{\color{blue}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1}} \]
                  14. metadata-evalN/A

                    \[\leadsto \frac{-6}{\color{blue}{4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)} - 1} \]
                  15. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(-6, \color{blue}{\left(4 \cdot \left(\sqrt{\frac{1}{x}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) - 1\right)}\right) \]
                5. Simplified97.8%

                  \[\leadsto \color{blue}{\frac{-6}{-1 + \sqrt{\frac{1}{x}} \cdot -4}} \]
                6. Step-by-step derivation
                  1. frac-2negN/A

                    \[\leadsto \frac{\mathsf{neg}\left(-6\right)}{\color{blue}{\mathsf{neg}\left(\left(-1 + \sqrt{\frac{1}{x}} \cdot -4\right)\right)}} \]
                  2. metadata-evalN/A

                    \[\leadsto \frac{6}{\mathsf{neg}\left(\color{blue}{\left(-1 + \sqrt{\frac{1}{x}} \cdot -4\right)}\right)} \]
                  3. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\mathsf{neg}\left(\left(-1 + \sqrt{\frac{1}{x}} \cdot -4\right)\right)\right)}\right) \]
                  4. distribute-neg-inN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(\left(\mathsf{neg}\left(-1\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)}\right)\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(1 + \left(\mathsf{neg}\left(\color{blue}{\sqrt{\frac{1}{x}} \cdot -4}\right)\right)\right)\right) \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(1 + -1 \cdot \color{blue}{\left(\sqrt{\frac{1}{x}} \cdot -4\right)}\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \color{blue}{\left(-1 \cdot \left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)}\right)\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(-1 \cdot \left(-4 \cdot \color{blue}{\sqrt{\frac{1}{x}}}\right)\right)\right)\right) \]
                  9. associate-*r*N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\left(-1 \cdot -4\right) \cdot \color{blue}{\sqrt{\frac{1}{x}}}\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(4 \cdot \sqrt{\color{blue}{\frac{1}{x}}}\right)\right)\right) \]
                  11. sqrt-divN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(4 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{x}}}\right)\right)\right) \]
                  12. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(4 \cdot \frac{1}{\sqrt{\color{blue}{x}}}\right)\right)\right) \]
                  13. un-div-invN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\frac{4}{\color{blue}{\sqrt{x}}}\right)\right)\right) \]
                  14. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(4, \color{blue}{\left(\sqrt{x}\right)}\right)\right)\right) \]
                  15. sqrt-lowering-sqrt.f6497.8%

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right) \]
                7. Applied egg-rr97.8%

                  \[\leadsto \color{blue}{\frac{6}{1 + \frac{4}{\sqrt{x}}}} \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 11: 96.8% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.83:\\ \;\;\;\;\frac{1}{-0.16666666666666666 + \sqrt{x} \cdot -0.6666666666666666}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{\frac{x}{x + -1}}\\ \end{array} \end{array} \]
              (FPCore (x)
               :precision binary64
               (if (<= x 0.83)
                 (/ 1.0 (+ -0.16666666666666666 (* (sqrt x) -0.6666666666666666)))
                 (/ 6.0 (/ x (+ x -1.0)))))
              double code(double x) {
              	double tmp;
              	if (x <= 0.83) {
              		tmp = 1.0 / (-0.16666666666666666 + (sqrt(x) * -0.6666666666666666));
              	} else {
              		tmp = 6.0 / (x / (x + -1.0));
              	}
              	return tmp;
              }
              
              real(8) function code(x)
                  real(8), intent (in) :: x
                  real(8) :: tmp
                  if (x <= 0.83d0) then
                      tmp = 1.0d0 / ((-0.16666666666666666d0) + (sqrt(x) * (-0.6666666666666666d0)))
                  else
                      tmp = 6.0d0 / (x / (x + (-1.0d0)))
                  end if
                  code = tmp
              end function
              
              public static double code(double x) {
              	double tmp;
              	if (x <= 0.83) {
              		tmp = 1.0 / (-0.16666666666666666 + (Math.sqrt(x) * -0.6666666666666666));
              	} else {
              		tmp = 6.0 / (x / (x + -1.0));
              	}
              	return tmp;
              }
              
              def code(x):
              	tmp = 0
              	if x <= 0.83:
              		tmp = 1.0 / (-0.16666666666666666 + (math.sqrt(x) * -0.6666666666666666))
              	else:
              		tmp = 6.0 / (x / (x + -1.0))
              	return tmp
              
              function code(x)
              	tmp = 0.0
              	if (x <= 0.83)
              		tmp = Float64(1.0 / Float64(-0.16666666666666666 + Float64(sqrt(x) * -0.6666666666666666)));
              	else
              		tmp = Float64(6.0 / Float64(x / Float64(x + -1.0)));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x)
              	tmp = 0.0;
              	if (x <= 0.83)
              		tmp = 1.0 / (-0.16666666666666666 + (sqrt(x) * -0.6666666666666666));
              	else
              		tmp = 6.0 / (x / (x + -1.0));
              	end
              	tmp_2 = tmp;
              end
              
              code[x_] := If[LessEqual[x, 0.83], N[(1.0 / N[(-0.16666666666666666 + N[(N[Sqrt[x], $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / N[(x / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq 0.83:\\
              \;\;\;\;\frac{1}{-0.16666666666666666 + \sqrt{x} \cdot -0.6666666666666666}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{6}{\frac{x}{x + -1}}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < 0.82999999999999996

                1. Initial program 99.9%

                  \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                2. Add Preprocessing
                3. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\frac{-6}{1 + 4 \cdot \sqrt{x}}} \]
                4. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \frac{\mathsf{neg}\left(6\right)}{\color{blue}{1} + 4 \cdot \sqrt{x}} \]
                  2. distribute-neg-fracN/A

                    \[\leadsto \mathsf{neg}\left(\frac{6}{1 + 4 \cdot \sqrt{x}}\right) \]
                  3. distribute-neg-frac2N/A

                    \[\leadsto \frac{6}{\color{blue}{\mathsf{neg}\left(\left(1 + 4 \cdot \sqrt{x}\right)\right)}} \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\mathsf{neg}\left(\left(1 + 4 \cdot \sqrt{x}\right)\right)\right)}\right) \]
                  5. distribute-neg-inN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(\left(\mathsf{neg}\left(1\right)\right) + \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
                  6. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \left(-1 + \left(\mathsf{neg}\left(\color{blue}{4 \cdot \sqrt{x}}\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right) \]
                  9. distribute-rgt-neg-inN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \left(\sqrt{x} \cdot -4\right)\right)\right) \]
                  11. metadata-evalN/A

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

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

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\color{blue}{4} \cdot -1\right)\right)\right)\right) \]
                  14. metadata-eval99.2%

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right) \]
                5. Simplified99.2%

                  \[\leadsto \color{blue}{\frac{6}{-1 + \sqrt{x} \cdot -4}} \]
                6. Step-by-step derivation
                  1. clear-numN/A

                    \[\leadsto \frac{1}{\color{blue}{\frac{-1 + \sqrt{x} \cdot -4}{6}}} \]
                  2. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1 + \sqrt{x} \cdot -4}{6}\right)}\right) \]
                  3. frac-2negN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(-1 + \sqrt{x} \cdot -4\right)\right)}{\color{blue}{\mathsf{neg}\left(6\right)}}\right)\right) \]
                  4. distribute-neg-inN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)}{\mathsf{neg}\left(\color{blue}{6}\right)}\right)\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + -1 \cdot \left(\sqrt{x} \cdot -4\right)}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + -1 \cdot \left(-4 \cdot \sqrt{x}\right)}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  8. associate-*r*N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + \left(-1 \cdot -4\right) \cdot \sqrt{x}}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + 4 \cdot \sqrt{x}}{\mathsf{neg}\left(6\right)}\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1 + 4 \cdot \sqrt{x}}{-6}\right)\right) \]
                  11. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 + 4 \cdot \sqrt{x}\right), \color{blue}{-6}\right)\right) \]
                  12. +-lowering-+.f64N/A

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

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right), -6\right)\right) \]
                  14. sqrt-lowering-sqrt.f6499.3%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right), -6\right)\right) \]
                7. Applied egg-rr99.3%

                  \[\leadsto \color{blue}{\frac{1}{\frac{1 + 4 \cdot \sqrt{x}}{-6}}} \]
                8. Taylor expanded in x around 0

                  \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{6} \cdot \left(1 + 4 \cdot \sqrt{x}\right)\right)}\right) \]
                9. Step-by-step derivation
                  1. distribute-rgt-inN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(1 \cdot \frac{-1}{6} + \color{blue}{\left(4 \cdot \sqrt{x}\right) \cdot \frac{-1}{6}}\right)\right) \]
                  2. metadata-evalN/A

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

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \color{blue}{\left(\left(4 \cdot \sqrt{x}\right) \cdot \frac{-1}{6}\right)}\right)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\left(\sqrt{x} \cdot 4\right) \cdot \frac{-1}{6}\right)\right)\right) \]
                  5. associate-*l*N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\sqrt{x} \cdot \color{blue}{\left(4 \cdot \frac{-1}{6}\right)}\right)\right)\right) \]
                  6. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\sqrt{x} \cdot \frac{-2}{3}\right)\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{-2}{3}}\right)\right)\right) \]
                  8. sqrt-lowering-sqrt.f6499.2%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{-2}{3}\right)\right)\right) \]
                10. Simplified99.2%

                  \[\leadsto \frac{1}{\color{blue}{-0.16666666666666666 + \sqrt{x} \cdot -0.6666666666666666}} \]

                if 0.82999999999999996 < x

                1. Initial program 99.7%

                  \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. associate-/l*N/A

                    \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                  2. clear-numN/A

                    \[\leadsto 6 \cdot \frac{1}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                  3. un-div-invN/A

                    \[\leadsto \frac{6}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}\right)}\right) \]
                  5. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right), \color{blue}{\left(x - 1\right)}\right)\right) \]
                  6. associate-+l+N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(x + \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                  8. +-lowering-+.f64N/A

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

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

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x - 1\right)\right)\right) \]
                  11. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                  12. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                  13. metadata-eval99.9%

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                4. Applied egg-rr99.9%

                  \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
                5. Step-by-step derivation
                  1. flip-+N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\frac{1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)}{1 - 4 \cdot \sqrt{x}}\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  2. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  3. metadata-evalN/A

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot 4\right) \cdot \left(\sqrt{x} \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  7. swap-sqrN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(4 \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  8. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot 16\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  10. rem-square-sqrtN/A

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

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  12. metadata-evalN/A

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

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

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  15. sqrt-lowering-sqrt.f6499.9%

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                6. Applied egg-rr99.9%

                  \[\leadsto \frac{6}{\frac{x + \color{blue}{\frac{1 - x \cdot 16}{1 - 4 \cdot \sqrt{x}}}}{x + -1}} \]
                7. Taylor expanded in x around inf

                  \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                8. Step-by-step derivation
                  1. Simplified94.6%

                    \[\leadsto \frac{6}{\frac{\color{blue}{x}}{x + -1}} \]
                9. Recombined 2 regimes into one program.
                10. Add Preprocessing

                Alternative 12: 96.7% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.061:\\ \;\;\;\;-6 + -6 \cdot \left(\sqrt{x} \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{\frac{x}{x + -1}}\\ \end{array} \end{array} \]
                (FPCore (x)
                 :precision binary64
                 (if (<= x 0.061)
                   (+ -6.0 (* -6.0 (* (sqrt x) -4.0)))
                   (/ 6.0 (/ x (+ x -1.0)))))
                double code(double x) {
                	double tmp;
                	if (x <= 0.061) {
                		tmp = -6.0 + (-6.0 * (sqrt(x) * -4.0));
                	} else {
                		tmp = 6.0 / (x / (x + -1.0));
                	}
                	return tmp;
                }
                
                real(8) function code(x)
                    real(8), intent (in) :: x
                    real(8) :: tmp
                    if (x <= 0.061d0) then
                        tmp = (-6.0d0) + ((-6.0d0) * (sqrt(x) * (-4.0d0)))
                    else
                        tmp = 6.0d0 / (x / (x + (-1.0d0)))
                    end if
                    code = tmp
                end function
                
                public static double code(double x) {
                	double tmp;
                	if (x <= 0.061) {
                		tmp = -6.0 + (-6.0 * (Math.sqrt(x) * -4.0));
                	} else {
                		tmp = 6.0 / (x / (x + -1.0));
                	}
                	return tmp;
                }
                
                def code(x):
                	tmp = 0
                	if x <= 0.061:
                		tmp = -6.0 + (-6.0 * (math.sqrt(x) * -4.0))
                	else:
                		tmp = 6.0 / (x / (x + -1.0))
                	return tmp
                
                function code(x)
                	tmp = 0.0
                	if (x <= 0.061)
                		tmp = Float64(-6.0 + Float64(-6.0 * Float64(sqrt(x) * -4.0)));
                	else
                		tmp = Float64(6.0 / Float64(x / Float64(x + -1.0)));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x)
                	tmp = 0.0;
                	if (x <= 0.061)
                		tmp = -6.0 + (-6.0 * (sqrt(x) * -4.0));
                	else
                		tmp = 6.0 / (x / (x + -1.0));
                	end
                	tmp_2 = tmp;
                end
                
                code[x_] := If[LessEqual[x, 0.061], N[(-6.0 + N[(-6.0 * N[(N[Sqrt[x], $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / N[(x / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \leq 0.061:\\
                \;\;\;\;-6 + -6 \cdot \left(\sqrt{x} \cdot -4\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{6}{\frac{x}{x + -1}}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < 0.060999999999999999

                  1. Initial program 99.9%

                    \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. associate-/l*N/A

                      \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                    2. clear-numN/A

                      \[\leadsto 6 \cdot \frac{1}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                    3. un-div-invN/A

                      \[\leadsto \frac{6}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}\right)}\right) \]
                    5. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right), \color{blue}{\left(x - 1\right)}\right)\right) \]
                    6. associate-+l+N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(x + \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                    7. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                    8. +-lowering-+.f64N/A

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x - 1\right)\right)\right) \]
                    11. sub-negN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                    12. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                    13. metadata-eval99.9%

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  4. Applied egg-rr99.9%

                    \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
                  5. Step-by-step derivation
                    1. flip-+N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\frac{1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)}{1 - 4 \cdot \sqrt{x}}\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    2. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    3. metadata-evalN/A

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

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot 4\right) \cdot \left(\sqrt{x} \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    7. swap-sqrN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(4 \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    8. metadata-evalN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot 16\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    10. rem-square-sqrtN/A

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    12. metadata-evalN/A

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    15. sqrt-lowering-sqrt.f6499.9%

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  6. Applied egg-rr99.9%

                    \[\leadsto \frac{6}{\frac{x + \color{blue}{\frac{1 - x \cdot 16}{1 - 4 \cdot \sqrt{x}}}}{x + -1}} \]
                  7. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{-6 \cdot \left(1 - 4 \cdot \sqrt{x}\right)} \]
                  8. Step-by-step derivation
                    1. cancel-sign-sub-invN/A

                      \[\leadsto -6 \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \sqrt{x}}\right) \]
                    2. metadata-evalN/A

                      \[\leadsto -6 \cdot \left(1 + -4 \cdot \sqrt{\color{blue}{x}}\right) \]
                    3. distribute-rgt-inN/A

                      \[\leadsto 1 \cdot -6 + \color{blue}{\left(-4 \cdot \sqrt{x}\right) \cdot -6} \]
                    4. metadata-evalN/A

                      \[\leadsto -6 + \color{blue}{\left(-4 \cdot \sqrt{x}\right)} \cdot -6 \]
                    5. +-lowering-+.f64N/A

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

                      \[\leadsto \mathsf{+.f64}\left(-6, \mathsf{*.f64}\left(\left(-4 \cdot \sqrt{x}\right), \color{blue}{-6}\right)\right) \]
                    7. *-commutativeN/A

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

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

                      \[\leadsto \mathsf{+.f64}\left(-6, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right), -6\right)\right) \]
                  9. Simplified99.1%

                    \[\leadsto \color{blue}{-6 + \left(\sqrt{x} \cdot -4\right) \cdot -6} \]

                  if 0.060999999999999999 < x

                  1. Initial program 99.7%

                    \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. associate-/l*N/A

                      \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                    2. clear-numN/A

                      \[\leadsto 6 \cdot \frac{1}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                    3. un-div-invN/A

                      \[\leadsto \frac{6}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}\right)}\right) \]
                    5. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right), \color{blue}{\left(x - 1\right)}\right)\right) \]
                    6. associate-+l+N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(x + \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                    7. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                    8. +-lowering-+.f64N/A

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x - 1\right)\right)\right) \]
                    11. sub-negN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                    12. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                    13. metadata-eval99.9%

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  4. Applied egg-rr99.9%

                    \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
                  5. Step-by-step derivation
                    1. flip-+N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\frac{1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)}{1 - 4 \cdot \sqrt{x}}\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    2. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    3. metadata-evalN/A

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

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot 4\right) \cdot \left(\sqrt{x} \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    7. swap-sqrN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(4 \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    8. metadata-evalN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot 16\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    10. rem-square-sqrtN/A

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    12. metadata-evalN/A

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    15. sqrt-lowering-sqrt.f6499.9%

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  6. Applied egg-rr99.9%

                    \[\leadsto \frac{6}{\frac{x + \color{blue}{\frac{1 - x \cdot 16}{1 - 4 \cdot \sqrt{x}}}}{x + -1}} \]
                  7. Taylor expanded in x around inf

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  8. Step-by-step derivation
                    1. Simplified94.6%

                      \[\leadsto \frac{6}{\frac{\color{blue}{x}}{x + -1}} \]
                  9. Recombined 2 regimes into one program.
                  10. Final simplification96.5%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.061:\\ \;\;\;\;-6 + -6 \cdot \left(\sqrt{x} \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{\frac{x}{x + -1}}\\ \end{array} \]
                  11. Add Preprocessing

                  Alternative 13: 50.1% accurate, 16.1× speedup?

                  \[\begin{array}{l} \\ \frac{6}{\frac{x}{x + -1}} \end{array} \]
                  (FPCore (x) :precision binary64 (/ 6.0 (/ x (+ x -1.0))))
                  double code(double x) {
                  	return 6.0 / (x / (x + -1.0));
                  }
                  
                  real(8) function code(x)
                      real(8), intent (in) :: x
                      code = 6.0d0 / (x / (x + (-1.0d0)))
                  end function
                  
                  public static double code(double x) {
                  	return 6.0 / (x / (x + -1.0));
                  }
                  
                  def code(x):
                  	return 6.0 / (x / (x + -1.0))
                  
                  function code(x)
                  	return Float64(6.0 / Float64(x / Float64(x + -1.0)))
                  end
                  
                  function tmp = code(x)
                  	tmp = 6.0 / (x / (x + -1.0));
                  end
                  
                  code[x_] := N[(6.0 / N[(x / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \frac{6}{\frac{x}{x + -1}}
                  \end{array}
                  
                  Derivation
                  1. Initial program 99.8%

                    \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. associate-/l*N/A

                      \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                    2. clear-numN/A

                      \[\leadsto 6 \cdot \frac{1}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                    3. un-div-invN/A

                      \[\leadsto \frac{6}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}\right)}\right) \]
                    5. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right), \color{blue}{\left(x - 1\right)}\right)\right) \]
                    6. associate-+l+N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(x + \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                    7. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                    8. +-lowering-+.f64N/A

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x - 1\right)\right)\right) \]
                    11. sub-negN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                    12. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                    13. metadata-eval99.9%

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  4. Applied egg-rr99.9%

                    \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
                  5. Step-by-step derivation
                    1. flip-+N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\frac{1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)}{1 - 4 \cdot \sqrt{x}}\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    2. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    3. metadata-evalN/A

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

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot 4\right) \cdot \left(\sqrt{x} \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    7. swap-sqrN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(4 \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    8. metadata-evalN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot 16\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    10. rem-square-sqrtN/A

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    12. metadata-evalN/A

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

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

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    15. sqrt-lowering-sqrt.f6499.9%

                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  6. Applied egg-rr99.9%

                    \[\leadsto \frac{6}{\frac{x + \color{blue}{\frac{1 - x \cdot 16}{1 - 4 \cdot \sqrt{x}}}}{x + -1}} \]
                  7. Taylor expanded in x around inf

                    \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                  8. Step-by-step derivation
                    1. Simplified56.9%

                      \[\leadsto \frac{6}{\frac{\color{blue}{x}}{x + -1}} \]
                    2. Add Preprocessing

                    Alternative 14: 48.1% accurate, 113.0× speedup?

                    \[\begin{array}{l} \\ 6 \end{array} \]
                    (FPCore (x) :precision binary64 6.0)
                    double code(double x) {
                    	return 6.0;
                    }
                    
                    real(8) function code(x)
                        real(8), intent (in) :: x
                        code = 6.0d0
                    end function
                    
                    public static double code(double x) {
                    	return 6.0;
                    }
                    
                    def code(x):
                    	return 6.0
                    
                    function code(x)
                    	return 6.0
                    end
                    
                    function tmp = code(x)
                    	tmp = 6.0;
                    end
                    
                    code[x_] := 6.0
                    
                    \begin{array}{l}
                    
                    \\
                    6
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. associate-/l*N/A

                        \[\leadsto 6 \cdot \color{blue}{\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}} \]
                      2. clear-numN/A

                        \[\leadsto 6 \cdot \frac{1}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                      3. un-div-invN/A

                        \[\leadsto \frac{6}{\color{blue}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}} \]
                      4. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}\right)}\right) \]
                      5. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right), \color{blue}{\left(x - 1\right)}\right)\right) \]
                      6. associate-+l+N/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\left(x + \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                      7. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(1 + 4 \cdot \sqrt{x}\right)\right), \left(\color{blue}{x} - 1\right)\right)\right) \]
                      8. +-lowering-+.f64N/A

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

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

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x - 1\right)\right)\right) \]
                      11. sub-negN/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \left(x + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                      12. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
                      13. metadata-eval99.9%

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    4. Applied egg-rr99.9%

                      \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
                    5. Step-by-step derivation
                      1. flip-+N/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \left(\frac{1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)}{1 - 4 \cdot \sqrt{x}}\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                      2. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(4 \cdot \sqrt{x}\right) \cdot \left(4 \cdot \sqrt{x}\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                      3. metadata-evalN/A

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

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

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

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot 4\right) \cdot \left(\sqrt{x} \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                      7. swap-sqrN/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(4 \cdot 4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                      8. metadata-evalN/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot 16\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                      9. metadata-evalN/A

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                      10. rem-square-sqrtN/A

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

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(-4 \cdot -4\right)\right)\right), \left(1 - 4 \cdot \sqrt{x}\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                      12. metadata-evalN/A

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

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

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \left(\sqrt{x}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                      15. sqrt-lowering-sqrt.f6499.9%

                        \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, 16\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right)\right)\right), \mathsf{+.f64}\left(x, -1\right)\right)\right) \]
                    6. Applied egg-rr99.9%

                      \[\leadsto \frac{6}{\frac{x + \color{blue}{\frac{1 - x \cdot 16}{1 - 4 \cdot \sqrt{x}}}}{x + -1}} \]
                    7. Taylor expanded in x around inf

                      \[\leadsto \color{blue}{6} \]
                    8. Step-by-step derivation
                      1. Simplified55.4%

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

                      Developer Target 1: 99.9% accurate, 1.0× speedup?

                      \[\begin{array}{l} \\ \frac{6}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}} \end{array} \]
                      (FPCore (x)
                       :precision binary64
                       (/ 6.0 (/ (+ (+ x 1.0) (* 4.0 (sqrt x))) (- x 1.0))))
                      double code(double x) {
                      	return 6.0 / (((x + 1.0) + (4.0 * sqrt(x))) / (x - 1.0));
                      }
                      
                      real(8) function code(x)
                          real(8), intent (in) :: x
                          code = 6.0d0 / (((x + 1.0d0) + (4.0d0 * sqrt(x))) / (x - 1.0d0))
                      end function
                      
                      public static double code(double x) {
                      	return 6.0 / (((x + 1.0) + (4.0 * Math.sqrt(x))) / (x - 1.0));
                      }
                      
                      def code(x):
                      	return 6.0 / (((x + 1.0) + (4.0 * math.sqrt(x))) / (x - 1.0))
                      
                      function code(x)
                      	return Float64(6.0 / Float64(Float64(Float64(x + 1.0) + Float64(4.0 * sqrt(x))) / Float64(x - 1.0)))
                      end
                      
                      function tmp = code(x)
                      	tmp = 6.0 / (((x + 1.0) + (4.0 * sqrt(x))) / (x - 1.0));
                      end
                      
                      code[x_] := N[(6.0 / N[(N[(N[(x + 1.0), $MachinePrecision] + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \frac{6}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}
                      \end{array}
                      

                      Reproduce

                      ?
                      herbie shell --seed 2024160 
                      (FPCore (x)
                        :name "Data.Approximate.Numerics:blog from approximate-0.2.2.1"
                        :precision binary64
                      
                        :alt
                        (! :herbie-platform default (/ 6 (/ (+ (+ x 1) (* 4 (sqrt x))) (- x 1))))
                      
                        (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))