Data.Approximate.Numerics:blog from approximate-0.2.2.1

Percentage Accurate: 99.7% → 99.7%
Time: 10.3s
Alternatives: 11
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 11 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, 1.0× speedup?

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

\\
\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}
\end{array}
Derivation
  1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.0% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{\left(x + 1\right) + t\_0}\\


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.39999999999999991 < x

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{-6}{x + \left(1 - \sqrt{x} \cdot -4\right)}\\

\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{\left(x + 1\right) + \sqrt{x} \cdot 4}\\


\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. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1 < x

      1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{6 \cdot \frac{x}{4 \cdot \sqrt{x} + \left(x + 1\right)}} \]
    7. Recombined 2 regimes into one program.
    8. Final simplification97.2%

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

    Alternative 4: 98.0% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{x + \left(1 - \sqrt{x} \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{\frac{x + \sqrt{x} \cdot 4}{x}}\\ \end{array} \end{array} \]
    (FPCore (x)
     :precision binary64
     (if (<= x 1.0)
       (/ -6.0 (+ x (- 1.0 (* (sqrt x) -4.0))))
       (/ 6.0 (/ (+ x (* (sqrt x) 4.0)) x))))
    double code(double x) {
    	double tmp;
    	if (x <= 1.0) {
    		tmp = -6.0 / (x + (1.0 - (sqrt(x) * -4.0)));
    	} else {
    		tmp = 6.0 / ((x + (sqrt(x) * 4.0)) / x);
    	}
    	return tmp;
    }
    
    real(8) function code(x)
        real(8), intent (in) :: x
        real(8) :: tmp
        if (x <= 1.0d0) then
            tmp = (-6.0d0) / (x + (1.0d0 - (sqrt(x) * (-4.0d0))))
        else
            tmp = 6.0d0 / ((x + (sqrt(x) * 4.0d0)) / x)
        end if
        code = tmp
    end function
    
    public static double code(double x) {
    	double tmp;
    	if (x <= 1.0) {
    		tmp = -6.0 / (x + (1.0 - (Math.sqrt(x) * -4.0)));
    	} else {
    		tmp = 6.0 / ((x + (Math.sqrt(x) * 4.0)) / x);
    	}
    	return tmp;
    }
    
    def code(x):
    	tmp = 0
    	if x <= 1.0:
    		tmp = -6.0 / (x + (1.0 - (math.sqrt(x) * -4.0)))
    	else:
    		tmp = 6.0 / ((x + (math.sqrt(x) * 4.0)) / x)
    	return tmp
    
    function code(x)
    	tmp = 0.0
    	if (x <= 1.0)
    		tmp = Float64(-6.0 / Float64(x + Float64(1.0 - Float64(sqrt(x) * -4.0))));
    	else
    		tmp = Float64(6.0 / Float64(Float64(x + Float64(sqrt(x) * 4.0)) / x));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	tmp = 0.0;
    	if (x <= 1.0)
    		tmp = -6.0 / (x + (1.0 - (sqrt(x) * -4.0)));
    	else
    		tmp = 6.0 / ((x + (sqrt(x) * 4.0)) / x);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := If[LessEqual[x, 1.0], N[(-6.0 / N[(x + N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / N[(N[(x + N[(N[Sqrt[x], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq 1:\\
    \;\;\;\;\frac{-6}{x + \left(1 - \sqrt{x} \cdot -4\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{6}{\frac{x + \sqrt{x} \cdot 4}{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. Step-by-step derivation
        1. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1 < x

        1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right), x\right)\right) \]
        10. Simplified97.4%

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

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

      Alternative 5: 98.0% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{x + \left(1 - \sqrt{x} \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + \sqrt{x} \cdot 4}\\ \end{array} \end{array} \]
      (FPCore (x)
       :precision binary64
       (if (<= x 1.0)
         (/ -6.0 (+ x (- 1.0 (* (sqrt x) -4.0))))
         (* 6.0 (/ x (+ x (* (sqrt x) 4.0))))))
      double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = -6.0 / (x + (1.0 - (sqrt(x) * -4.0)));
      	} else {
      		tmp = 6.0 * (x / (x + (sqrt(x) * 4.0)));
      	}
      	return tmp;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          real(8) :: tmp
          if (x <= 1.0d0) then
              tmp = (-6.0d0) / (x + (1.0d0 - (sqrt(x) * (-4.0d0))))
          else
              tmp = 6.0d0 * (x / (x + (sqrt(x) * 4.0d0)))
          end if
          code = tmp
      end function
      
      public static double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = -6.0 / (x + (1.0 - (Math.sqrt(x) * -4.0)));
      	} else {
      		tmp = 6.0 * (x / (x + (Math.sqrt(x) * 4.0)));
      	}
      	return tmp;
      }
      
      def code(x):
      	tmp = 0
      	if x <= 1.0:
      		tmp = -6.0 / (x + (1.0 - (math.sqrt(x) * -4.0)))
      	else:
      		tmp = 6.0 * (x / (x + (math.sqrt(x) * 4.0)))
      	return tmp
      
      function code(x)
      	tmp = 0.0
      	if (x <= 1.0)
      		tmp = Float64(-6.0 / Float64(x + Float64(1.0 - Float64(sqrt(x) * -4.0))));
      	else
      		tmp = Float64(6.0 * Float64(x / Float64(x + Float64(sqrt(x) * 4.0))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x)
      	tmp = 0.0;
      	if (x <= 1.0)
      		tmp = -6.0 / (x + (1.0 - (sqrt(x) * -4.0)));
      	else
      		tmp = 6.0 * (x / (x + (sqrt(x) * 4.0)));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_] := If[LessEqual[x, 1.0], N[(-6.0 / N[(x + N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x / N[(x + N[(N[Sqrt[x], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 1:\\
      \;\;\;\;\frac{-6}{x + \left(1 - \sqrt{x} \cdot -4\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;6 \cdot \frac{x}{x + \sqrt{x} \cdot 4}\\
      
      
      \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. Step-by-step derivation
          1. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1 < x

          1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right), x\right)\right) \]
          10. Simplified97.4%

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

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

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

              \[\leadsto \frac{x}{x + 4 \cdot \sqrt{x}} \cdot 6 \]
            4. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

        Alternative 6: 97.9% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{x} \cdot 4\\ \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{1 + t\_0}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + t\_0}\\ \end{array} \end{array} \]
        (FPCore (x)
         :precision binary64
         (let* ((t_0 (* (sqrt x) 4.0)))
           (if (<= x 1.0) (/ -6.0 (+ 1.0 t_0)) (* 6.0 (/ x (+ x t_0))))))
        double code(double x) {
        	double t_0 = sqrt(x) * 4.0;
        	double tmp;
        	if (x <= 1.0) {
        		tmp = -6.0 / (1.0 + t_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 = sqrt(x) * 4.0d0
            if (x <= 1.0d0) then
                tmp = (-6.0d0) / (1.0d0 + t_0)
            else
                tmp = 6.0d0 * (x / (x + t_0))
            end if
            code = tmp
        end function
        
        public static double code(double x) {
        	double t_0 = Math.sqrt(x) * 4.0;
        	double tmp;
        	if (x <= 1.0) {
        		tmp = -6.0 / (1.0 + t_0);
        	} else {
        		tmp = 6.0 * (x / (x + t_0));
        	}
        	return tmp;
        }
        
        def code(x):
        	t_0 = math.sqrt(x) * 4.0
        	tmp = 0
        	if x <= 1.0:
        		tmp = -6.0 / (1.0 + t_0)
        	else:
        		tmp = 6.0 * (x / (x + t_0))
        	return tmp
        
        function code(x)
        	t_0 = Float64(sqrt(x) * 4.0)
        	tmp = 0.0
        	if (x <= 1.0)
        		tmp = Float64(-6.0 / Float64(1.0 + t_0));
        	else
        		tmp = Float64(6.0 * Float64(x / Float64(x + t_0)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x)
        	t_0 = sqrt(x) * 4.0;
        	tmp = 0.0;
        	if (x <= 1.0)
        		tmp = -6.0 / (1.0 + t_0);
        	else
        		tmp = 6.0 * (x / (x + t_0));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * 4.0), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(-6.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x / N[(x + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sqrt{x} \cdot 4\\
        \mathbf{if}\;x \leq 1:\\
        \;\;\;\;\frac{-6}{1 + t\_0}\\
        
        \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. Step-by-step derivation
            1. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(-6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
            3. +-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) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
            5. 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) \]
            6. metadata-evalN/A

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

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

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

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

          if 1 < x

          1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(6, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, \mathsf{*.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right)\right), x\right)\right) \]
          10. Simplified97.4%

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

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

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

              \[\leadsto \frac{x}{x + 4 \cdot \sqrt{x}} \cdot 6 \]
            4. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

        Alternative 7: 99.7% accurate, 1.0× speedup?

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

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Add Preprocessing
        3. Final simplification99.4%

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

        Alternative 8: 97.9% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{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 (* (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 + (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 + (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 + (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 + (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(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 + (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[(N[Sqrt[x], $MachinePrecision] * 4.0), $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{-6}{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. Step-by-step derivation
            1. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(-6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
            3. +-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) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
            5. 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) \]
            6. metadata-evalN/A

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

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

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

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

          if 1 < x

          1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(6, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(4 \cdot \frac{1}{\sqrt{x}}\right)\right)\right)\right) \]
            18. div-invN/A

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

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

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

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

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

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

        Alternative 9: 7.0% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-1.5}{\sqrt{x}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot 1.5\\ \end{array} \end{array} \]
        (FPCore (x)
         :precision binary64
         (if (<= x 1.0) (/ -1.5 (sqrt x)) (* (sqrt x) 1.5)))
        double code(double x) {
        	double tmp;
        	if (x <= 1.0) {
        		tmp = -1.5 / sqrt(x);
        	} else {
        		tmp = sqrt(x) * 1.5;
        	}
        	return tmp;
        }
        
        real(8) function code(x)
            real(8), intent (in) :: x
            real(8) :: tmp
            if (x <= 1.0d0) then
                tmp = (-1.5d0) / sqrt(x)
            else
                tmp = sqrt(x) * 1.5d0
            end if
            code = tmp
        end function
        
        public static double code(double x) {
        	double tmp;
        	if (x <= 1.0) {
        		tmp = -1.5 / Math.sqrt(x);
        	} else {
        		tmp = Math.sqrt(x) * 1.5;
        	}
        	return tmp;
        }
        
        def code(x):
        	tmp = 0
        	if x <= 1.0:
        		tmp = -1.5 / math.sqrt(x)
        	else:
        		tmp = math.sqrt(x) * 1.5
        	return tmp
        
        function code(x)
        	tmp = 0.0
        	if (x <= 1.0)
        		tmp = Float64(-1.5 / sqrt(x));
        	else
        		tmp = Float64(sqrt(x) * 1.5);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x)
        	tmp = 0.0;
        	if (x <= 1.0)
        		tmp = -1.5 / sqrt(x);
        	else
        		tmp = sqrt(x) * 1.5;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_] := If[LessEqual[x, 1.0], N[(-1.5 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * 1.5), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x \leq 1:\\
        \;\;\;\;\frac{-1.5}{\sqrt{x}}\\
        
        \mathbf{else}:\\
        \;\;\;\;\sqrt{x} \cdot 1.5\\
        
        
        \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. Step-by-step derivation
            1. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(-6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
            3. +-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) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
            5. 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) \]
            6. metadata-evalN/A

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

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

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

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

            \[\leadsto \color{blue}{\frac{-3}{2} \cdot \sqrt{\frac{1}{x}}} \]
          9. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

            \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} \cdot -1.5} \]
          11. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \frac{-3}{2} \cdot \color{blue}{\sqrt{\frac{1}{x}}} \]
            2. sqrt-divN/A

              \[\leadsto \frac{-3}{2} \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{x}}} \]
            3. metadata-evalN/A

              \[\leadsto \frac{-3}{2} \cdot \frac{1}{\sqrt{\color{blue}{x}}} \]
            4. un-div-invN/A

              \[\leadsto \frac{\frac{-3}{2}}{\color{blue}{\sqrt{x}}} \]
            5. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{/.f64}\left(\frac{-3}{2}, \mathsf{sqrt.f64}\left(x\right)\right) \]
          12. Applied egg-rr7.2%

            \[\leadsto \color{blue}{\frac{-1.5}{\sqrt{x}}} \]

          if 1 < x

          1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{3}{2} \cdot \sqrt{x}} \]
          9. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \sqrt{x} \cdot \color{blue}{\frac{3}{2}} \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{3}{2}}\right) \]
            3. sqrt-lowering-sqrt.f647.0%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{3}{2}\right) \]
          10. Simplified7.0%

            \[\leadsto \color{blue}{\sqrt{x} \cdot 1.5} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 10: 52.2% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(-6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          3. +-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) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
          5. 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) \]
          6. metadata-evalN/A

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

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

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

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

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

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

            \[\leadsto \frac{-6}{1 - \color{blue}{-4 \cdot \sqrt{x}}} \]
          4. *-commutativeN/A

            \[\leadsto \frac{-6}{1 - \sqrt{x} \cdot \color{blue}{-4}} \]
          5. *-commutativeN/A

            \[\leadsto \frac{-6}{1 - -4 \cdot \color{blue}{\sqrt{x}}} \]
          6. cancel-sign-sub-invN/A

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

            \[\leadsto \frac{-6}{1 + 4 \cdot \sqrt{\color{blue}{x}}} \]
          8. *-commutativeN/A

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

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

            \[\leadsto \frac{-6}{\frac{1 \cdot 1 - \left(\sqrt{x} \cdot 4\right) \cdot \left(\sqrt{x} \cdot 4\right)}{1 - 4 \cdot \color{blue}{\sqrt{x}}}} \]
          11. cancel-sign-sub-invN/A

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\frac{-6}{1 \cdot 1 - \left(\sqrt{x} \cdot 4\right) \cdot \left(\sqrt{x} \cdot 4\right)}\right), \color{blue}{\left(1 + \sqrt{x} \cdot -4\right)}\right) \]
        9. Applied egg-rr44.5%

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

          \[\leadsto \color{blue}{-6 \cdot \left(1 - 4 \cdot \sqrt{x}\right)} \]
        11. 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-lft-inN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(-6, \mathsf{*.f64}\left(24, \mathsf{sqrt.f64}\left(x\right)\right)\right) \]
        12. Simplified47.1%

          \[\leadsto \color{blue}{-6 + 24 \cdot \sqrt{x}} \]
        13. Final simplification47.1%

          \[\leadsto -6 + \sqrt{x} \cdot 24 \]
        14. Add Preprocessing

        Alternative 11: 4.4% accurate, 1.1× speedup?

        \[\begin{array}{l} \\ \sqrt{x} \cdot 1.5 \end{array} \]
        (FPCore (x) :precision binary64 (* (sqrt x) 1.5))
        double code(double x) {
        	return sqrt(x) * 1.5;
        }
        
        real(8) function code(x)
            real(8), intent (in) :: x
            code = sqrt(x) * 1.5d0
        end function
        
        public static double code(double x) {
        	return Math.sqrt(x) * 1.5;
        }
        
        def code(x):
        	return math.sqrt(x) * 1.5
        
        function code(x)
        	return Float64(sqrt(x) * 1.5)
        end
        
        function tmp = code(x)
        	tmp = sqrt(x) * 1.5;
        end
        
        code[x_] := N[(N[Sqrt[x], $MachinePrecision] * 1.5), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \sqrt{x} \cdot 1.5
        \end{array}
        
        Derivation
        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{3}{2} \cdot \sqrt{x}} \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \sqrt{x} \cdot \color{blue}{\frac{3}{2}} \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{3}{2}}\right) \]
          3. sqrt-lowering-sqrt.f644.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{3}{2}\right) \]
        10. Simplified4.7%

          \[\leadsto \color{blue}{\sqrt{x} \cdot 1.5} \]
        11. 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 2024145 
        (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)))))