Data.Approximate.Numerics:blog from approximate-0.2.2.1

Percentage Accurate: 99.6% → 99.9%
Time: 10.5s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 99.6% 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.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{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(x + Float64(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[(x + N[(1.0 + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < x

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < x

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

      if 0.28999999999999998 < x

      1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 97.7% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{4 \cdot \sqrt{x} + \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\ \end{array} \end{array} \]
    (FPCore (x)
     :precision binary64
     (if (<= x 1.0)
       (/ -6.0 (+ (* 4.0 (sqrt x)) (+ x 1.0)))
       (/ 6.0 (+ 1.0 (/ 4.0 (sqrt x))))))
    double code(double x) {
    	double tmp;
    	if (x <= 1.0) {
    		tmp = -6.0 / ((4.0 * sqrt(x)) + (x + 1.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) / ((4.0d0 * sqrt(x)) + (x + 1.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 / ((4.0 * Math.sqrt(x)) + (x + 1.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 / ((4.0 * math.sqrt(x)) + (x + 1.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(Float64(4.0 * sqrt(x)) + Float64(x + 1.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 / ((4.0 * sqrt(x)) + (x + 1.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[(N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(x + 1.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}{4 \cdot \sqrt{x} + \left(x + 1\right)}\\
    
    \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 100.0%

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

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

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

        if 1 < x

        1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
        5. Taylor expanded in x around 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. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 97.7% 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 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1 < x

        1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
        5. Taylor expanded in x around 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. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \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} \]
      5. Add Preprocessing

      Alternative 8: 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 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{-3}{2} \cdot \sqrt{\frac{1}{x}}} \]
        7. 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-/.f646.8%

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

          \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} \cdot -1.5} \]
        9. 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.f646.8%

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

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

        if 1 < x

        1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{6}{\frac{x + \left(1 + 4 \cdot \sqrt{x}\right)}{x + -1}}} \]
        5. Taylor expanded in x around 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. +-lowering-+.f64N/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{6}{1 + 4 \cdot \sqrt{\frac{1}{x}}}} \]
        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.3%

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

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

      Alternative 9: 51.6% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{6}{-1 + \sqrt{x} \cdot -4}} \]
      6. Step-by-step derivation
        1. 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}}} \]
        2. 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)} \]
        3. *-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) \]
      7. Applied egg-rr51.8%

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 10: 4.5% 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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{6}{1 + 4 \cdot \sqrt{\frac{1}{x}}}} \]
      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.5%

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

        \[\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 2024152 
      (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)))))