2isqrt (example 3.6)

Percentage Accurate: 68.5% → 99.6%
Time: 12.0s
Alternatives: 18
Speedup: 1.9×

Specification

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

\\
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 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: 68.5% accurate, 1.0× speedup?

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

\\
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\end{array}

Alternative 1: 99.6% accurate, 0.5× speedup?

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

\\
{x}^{-0.5} \cdot \left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} \cdot {\left(x + 1\right)}^{-0.5}\right)
\end{array}
Derivation
  1. Initial program 70.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. frac-sub70.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv70.9%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    3. *-un-lft-identity70.9%

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

      \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    5. *-rgt-identity70.9%

      \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    6. metadata-eval70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
    8. un-div-inv70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
    9. pow1/271.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
    10. pow-flip71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
    11. metadata-eval71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
    12. +-commutative71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
  3. Applied egg-rr71.2%

    \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
  4. Step-by-step derivation
    1. associate-*r/71.2%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  5. Simplified71.2%

    \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  6. Step-by-step derivation
    1. flip--71.4%

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    2. div-inv71.4%

      \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    3. add-sqr-sqrt62.8%

      \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    4. add-sqr-sqrt72.0%

      \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    5. associate--l+99.6%

      \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  7. Applied egg-rr99.6%

    \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  8. Step-by-step derivation
    1. +-inverses99.6%

      \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    2. metadata-eval99.6%

      \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    3. *-lft-identity99.6%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  9. Simplified99.6%

    \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  10. Step-by-step derivation
    1. div-inv99.6%

      \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\sqrt{1 + x}}} \]
    2. pow1/299.6%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\color{blue}{{\left(1 + x\right)}^{0.5}}} \]
    3. pow-flip99.7%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}} \]
    4. metadata-eval99.7%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}} \]
    5. metadata-eval99.7%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
    6. pow-pow97.5%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
    7. pow1/399.5%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{\sqrt[3]{{\left(1 + x\right)}^{-1.5}}} \]
    8. metadata-eval99.5%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{\color{blue}{\left(-0.5\right)}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
    9. pow-flip99.3%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{\frac{1}{{x}^{0.5}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
    10. pow1/299.3%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\color{blue}{\sqrt{x}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
    11. *-commutative99.3%

      \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
    12. associate-*l*99.3%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right)} \]
    13. pow1/299.3%

      \[\leadsto \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
    14. pow-flip99.5%

      \[\leadsto \color{blue}{{x}^{\left(-0.5\right)}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
    15. metadata-eval99.5%

      \[\leadsto {x}^{\color{blue}{-0.5}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
    16. pow1/397.5%

      \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}}\right) \]
    17. pow-pow99.7%

      \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left(1 + x\right)}^{\left(-1.5 \cdot 0.3333333333333333\right)}}\right) \]
    18. metadata-eval99.7%

      \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) \]
  11. Applied egg-rr99.7%

    \[\leadsto \color{blue}{{x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{-0.5}\right)} \]
  12. Final simplification99.7%

    \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} \cdot {\left(x + 1\right)}^{-0.5}\right) \]

Alternative 2: 99.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{x + 1}\\
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{t_0} \leq 5 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{0.5}{x}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - {\left(x + 1\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 4.9999999999999999e-17

    1. Initial program 42.9%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub42.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv42.9%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity42.9%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity42.9%

        \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      6. metadata-eval42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/242.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr42.9%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/42.9%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified42.9%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--43.3%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv43.3%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt26.1%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt44.2%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.4%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.4%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.4%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.4%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.4%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Taylor expanded in x around inf 99.2%

      \[\leadsto \frac{\color{blue}{\frac{0.5}{x}}}{\sqrt{1 + x}} \]

    if 4.9999999999999999e-17 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1))))

    1. Initial program 98.9%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity98.9%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{\sqrt{x}}} - \frac{1}{\sqrt{x + 1}} \]
      2. clear-num98.9%

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\frac{\sqrt{x + 1}}{1}}} \]
      3. associate-/r/98.9%

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff98.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{1}{\sqrt{x}}, -1 \cdot \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      5. *-un-lft-identity98.9%

        \[\leadsto \mathsf{fma}\left(1, \frac{1}{\sqrt{x}}, -\color{blue}{\frac{1}{\sqrt{x + 1}}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      6. fma-neg98.9%

        \[\leadsto \color{blue}{\left(1 \cdot \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\right)} + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      7. *-un-lft-identity98.9%

        \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{x}}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      8. inv-pow98.9%

        \[\leadsto \left(\color{blue}{{\left(\sqrt{x}\right)}^{-1}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      9. sqrt-pow299.4%

        \[\leadsto \left(\color{blue}{{x}^{\left(\frac{-1}{2}\right)}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      10. metadata-eval99.4%

        \[\leadsto \left({x}^{\color{blue}{-0.5}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      11. pow1/299.4%

        \[\leadsto \left({x}^{-0.5} - \frac{1}{\color{blue}{{\left(x + 1\right)}^{0.5}}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      12. pow-flip99.4%

        \[\leadsto \left({x}^{-0.5} - \color{blue}{{\left(x + 1\right)}^{\left(-0.5\right)}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      13. +-commutative99.4%

        \[\leadsto \left({x}^{-0.5} - {\color{blue}{\left(1 + x\right)}}^{\left(-0.5\right)}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      14. metadata-eval99.4%

        \[\leadsto \left({x}^{-0.5} - {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
    3. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)} \]
    4. Step-by-step derivation
      1. fma-udef99.4%

        \[\leadsto \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} \]
      2. distribute-lft1-in99.4%

        \[\leadsto \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \color{blue}{\left(-1 + 1\right) \cdot {\left(1 + x\right)}^{-0.5}} \]
      3. metadata-eval99.4%

        \[\leadsto \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \color{blue}{0} \cdot {\left(1 + x\right)}^{-0.5} \]
      4. mul0-lft99.4%

        \[\leadsto \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \color{blue}{0} \]
      5. +-rgt-identity99.4%

        \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
    5. Simplified99.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{x + 1}} \leq 5 \cdot 10^{-17}:\\ \;\;\;\;\frac{\frac{0.5}{x}}{\sqrt{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} - {\left(x + 1\right)}^{-0.5}\\ \end{array} \]

Alternative 3: 99.7% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\


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

    1. Initial program 81.1%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub81.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv81.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity81.1%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity81.1%

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times81.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv81.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/281.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip81.5%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval81.5%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative81.5%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr81.5%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/81.5%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified81.5%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--81.8%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv81.8%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt82.4%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt82.9%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.7%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.7%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.7%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.7%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.7%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt99.1%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \cdot \sqrt{\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}{\sqrt{1 + x}}}} \]
      2. sqrt-unprod99.7%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}{\sqrt{1 + x}}}} \]
      3. frac-times99.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right)}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}} \]
    11. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{x} \cdot {\left(\sqrt{1 + x} + \sqrt{x}\right)}^{-2}}{1 + x}}} \]
    12. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto \sqrt{\frac{\color{blue}{\frac{1 \cdot {\left(\sqrt{1 + x} + \sqrt{x}\right)}^{-2}}{x}}}{1 + x}} \]
      2. *-lft-identity99.7%

        \[\leadsto \sqrt{\frac{\frac{\color{blue}{{\left(\sqrt{1 + x} + \sqrt{x}\right)}^{-2}}}{x}}{1 + x}} \]
      3. associate-/l/99.7%

        \[\leadsto \sqrt{\color{blue}{\frac{{\left(\sqrt{1 + x} + \sqrt{x}\right)}^{-2}}{\left(1 + x\right) \cdot x}}} \]
      4. +-commutative99.7%

        \[\leadsto \sqrt{\frac{{\left(\sqrt{\color{blue}{x + 1}} + \sqrt{x}\right)}^{-2}}{\left(1 + x\right) \cdot x}} \]
      5. *-commutative99.7%

        \[\leadsto \sqrt{\frac{{\left(\sqrt{x + 1} + \sqrt{x}\right)}^{-2}}{\color{blue}{x \cdot \left(1 + x\right)}}} \]
      6. +-commutative99.7%

        \[\leadsto \sqrt{\frac{{\left(\sqrt{x + 1} + \sqrt{x}\right)}^{-2}}{x \cdot \color{blue}{\left(x + 1\right)}}} \]
    13. Simplified99.7%

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

    if 4e80 < x

    1. Initial program 54.2%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub54.2%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv54.2%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity54.2%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity54.2%

        \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      6. metadata-eval54.2%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times54.2%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv54.2%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/254.2%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip54.2%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval54.2%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative54.2%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr54.2%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/54.2%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified54.2%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--54.2%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv54.2%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt30.6%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt54.2%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.5%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.5%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.5%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.5%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.5%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.5%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Step-by-step derivation
      1. div-inv99.5%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\sqrt{1 + x}}} \]
      2. pow1/299.5%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\color{blue}{{\left(1 + x\right)}^{0.5}}} \]
      3. pow-flip99.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}} \]
      4. metadata-eval99.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}} \]
      5. metadata-eval99.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
      6. pow-pow95.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
      7. pow1/399.3%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{\sqrt[3]{{\left(1 + x\right)}^{-1.5}}} \]
      8. metadata-eval99.3%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{\color{blue}{\left(-0.5\right)}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      9. pow-flip99.2%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{\frac{1}{{x}^{0.5}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      10. pow1/299.2%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\color{blue}{\sqrt{x}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      11. *-commutative99.2%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      12. associate-*l*99.2%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right)} \]
      13. pow1/299.2%

        \[\leadsto \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      14. pow-flip99.3%

        \[\leadsto \color{blue}{{x}^{\left(-0.5\right)}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      15. metadata-eval99.3%

        \[\leadsto {x}^{\color{blue}{-0.5}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      16. pow1/395.6%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}}\right) \]
      17. pow-pow99.6%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left(1 + x\right)}^{\left(-1.5 \cdot 0.3333333333333333\right)}}\right) \]
      18. metadata-eval99.6%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) \]
    11. Applied egg-rr99.6%

      \[\leadsto \color{blue}{{x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{-0.5}\right)} \]
    12. Taylor expanded in x around inf 99.7%

      \[\leadsto {x}^{-0.5} \cdot \color{blue}{\frac{0.5}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+80}:\\ \;\;\;\;\sqrt{\frac{{\left(\sqrt{x} + \sqrt{x + 1}\right)}^{-2}}{x \cdot \left(x + 1\right)}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\ \end{array} \]

Alternative 4: 99.7% accurate, 0.5× speedup?

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

\\
{\left(x + 1\right)}^{-0.5} \cdot \frac{{x}^{-0.5}}{\sqrt{x} + \sqrt{x + 1}}
\end{array}
Derivation
  1. Initial program 70.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. frac-sub70.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv70.9%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    3. *-un-lft-identity70.9%

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

      \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    5. *-rgt-identity70.9%

      \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    6. metadata-eval70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
    8. un-div-inv70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
    9. pow1/271.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
    10. pow-flip71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
    11. metadata-eval71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
    12. +-commutative71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
  3. Applied egg-rr71.2%

    \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
  4. Step-by-step derivation
    1. associate-*r/71.2%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  5. Simplified71.2%

    \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  6. Step-by-step derivation
    1. flip--71.4%

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    2. div-inv71.4%

      \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    3. add-sqr-sqrt62.8%

      \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    4. add-sqr-sqrt72.0%

      \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    5. associate--l+99.6%

      \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  7. Applied egg-rr99.6%

    \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  8. Step-by-step derivation
    1. +-inverses99.6%

      \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    2. metadata-eval99.6%

      \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    3. *-lft-identity99.6%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  9. Simplified99.6%

    \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  10. Step-by-step derivation
    1. clear-num98.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{1 + x}}{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}}} \]
    2. associate-/r/99.6%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + x}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right)} \]
    3. pow1/299.6%

      \[\leadsto \frac{1}{\color{blue}{{\left(1 + x\right)}^{0.5}}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \]
    4. pow-flip99.7%

      \[\leadsto \color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \]
    5. metadata-eval99.7%

      \[\leadsto {\left(1 + x\right)}^{\color{blue}{-0.5}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \]
    6. associate-*l/99.6%

      \[\leadsto {\left(1 + x\right)}^{-0.5} \cdot \color{blue}{\frac{1 \cdot {x}^{-0.5}}{\sqrt{1 + x} + \sqrt{x}}} \]
    7. *-un-lft-identity99.6%

      \[\leadsto {\left(1 + x\right)}^{-0.5} \cdot \frac{\color{blue}{{x}^{-0.5}}}{\sqrt{1 + x} + \sqrt{x}} \]
  11. Applied egg-rr99.6%

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

    \[\leadsto {\left(x + 1\right)}^{-0.5} \cdot \frac{{x}^{-0.5}}{\sqrt{x} + \sqrt{x + 1}} \]

Alternative 5: 99.6% accurate, 0.5× speedup?

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

\\
\frac{{\left(x + 1\right)}^{-0.5}}{\frac{\sqrt{x} + \sqrt{x + 1}}{{x}^{-0.5}}}
\end{array}
Derivation
  1. Initial program 70.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. frac-sub70.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv70.9%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    3. *-un-lft-identity70.9%

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

      \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    5. *-rgt-identity70.9%

      \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    6. metadata-eval70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
    8. un-div-inv70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
    9. pow1/271.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
    10. pow-flip71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
    11. metadata-eval71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
    12. +-commutative71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
  3. Applied egg-rr71.2%

    \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
  4. Step-by-step derivation
    1. associate-*r/71.2%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  5. Simplified71.2%

    \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  6. Step-by-step derivation
    1. flip--71.4%

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    2. div-inv71.4%

      \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    3. add-sqr-sqrt62.8%

      \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    4. add-sqr-sqrt72.0%

      \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    5. associate--l+99.6%

      \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  7. Applied egg-rr99.6%

    \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  8. Step-by-step derivation
    1. +-inverses99.6%

      \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    2. metadata-eval99.6%

      \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    3. *-lft-identity99.6%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  9. Simplified99.6%

    \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  10. Step-by-step derivation
    1. div-inv99.6%

      \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\sqrt{1 + x}}} \]
    2. pow1/299.6%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\color{blue}{{\left(1 + x\right)}^{0.5}}} \]
    3. pow-flip99.7%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}} \]
    4. metadata-eval99.7%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}} \]
    5. metadata-eval99.7%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
    6. pow-pow97.5%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
    7. pow1/399.5%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{\sqrt[3]{{\left(1 + x\right)}^{-1.5}}} \]
    8. metadata-eval99.5%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{\color{blue}{\left(-0.5\right)}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
    9. pow-flip99.3%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{\frac{1}{{x}^{0.5}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
    10. pow1/299.3%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\color{blue}{\sqrt{x}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
    11. *-commutative99.3%

      \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
    12. associate-*l*99.3%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right)} \]
    13. pow1/299.3%

      \[\leadsto \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
    14. pow-flip99.5%

      \[\leadsto \color{blue}{{x}^{\left(-0.5\right)}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
    15. metadata-eval99.5%

      \[\leadsto {x}^{\color{blue}{-0.5}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
    16. pow1/397.5%

      \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}}\right) \]
    17. pow-pow99.7%

      \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left(1 + x\right)}^{\left(-1.5 \cdot 0.3333333333333333\right)}}\right) \]
    18. metadata-eval99.7%

      \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) \]
  11. Applied egg-rr99.7%

    \[\leadsto \color{blue}{{x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{-0.5}\right)} \]
  12. Step-by-step derivation
    1. associate-*r*99.7%

      \[\leadsto \color{blue}{\left({x}^{-0.5} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {\left(1 + x\right)}^{-0.5}} \]
    2. div-inv99.6%

      \[\leadsto \color{blue}{\frac{{x}^{-0.5}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    3. *-commutative99.6%

      \[\leadsto \color{blue}{{\left(1 + x\right)}^{-0.5} \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x} + \sqrt{x}}} \]
    4. clear-num99.6%

      \[\leadsto {\left(1 + x\right)}^{-0.5} \cdot \color{blue}{\frac{1}{\frac{\sqrt{1 + x} + \sqrt{x}}{{x}^{-0.5}}}} \]
    5. un-div-inv99.6%

      \[\leadsto \color{blue}{\frac{{\left(1 + x\right)}^{-0.5}}{\frac{\sqrt{1 + x} + \sqrt{x}}{{x}^{-0.5}}}} \]
  13. Applied egg-rr99.6%

    \[\leadsto \color{blue}{\frac{{\left(1 + x\right)}^{-0.5}}{\frac{\sqrt{1 + x} + \sqrt{x}}{{x}^{-0.5}}}} \]
  14. Final simplification99.6%

    \[\leadsto \frac{{\left(x + 1\right)}^{-0.5}}{\frac{\sqrt{x} + \sqrt{x + 1}}{{x}^{-0.5}}} \]

Alternative 6: 99.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{x + 1}\\ \frac{{x}^{-0.5}}{t_0 \cdot \left(\sqrt{x} + t_0\right)} \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (sqrt (+ x 1.0)))) (/ (pow x -0.5) (* t_0 (+ (sqrt x) t_0)))))
double code(double x) {
	double t_0 = sqrt((x + 1.0));
	return pow(x, -0.5) / (t_0 * (sqrt(x) + t_0));
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    t_0 = sqrt((x + 1.0d0))
    code = (x ** (-0.5d0)) / (t_0 * (sqrt(x) + t_0))
end function
public static double code(double x) {
	double t_0 = Math.sqrt((x + 1.0));
	return Math.pow(x, -0.5) / (t_0 * (Math.sqrt(x) + t_0));
}
def code(x):
	t_0 = math.sqrt((x + 1.0))
	return math.pow(x, -0.5) / (t_0 * (math.sqrt(x) + t_0))
function code(x)
	t_0 = sqrt(Float64(x + 1.0))
	return Float64((x ^ -0.5) / Float64(t_0 * Float64(sqrt(x) + t_0)))
end
function tmp = code(x)
	t_0 = sqrt((x + 1.0));
	tmp = (x ^ -0.5) / (t_0 * (sqrt(x) + t_0));
end
code[x_] := Block[{t$95$0 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[x, -0.5], $MachinePrecision] / N[(t$95$0 * N[(N[Sqrt[x], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{x + 1}\\
\frac{{x}^{-0.5}}{t_0 \cdot \left(\sqrt{x} + t_0\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 70.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. frac-sub70.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv70.9%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    3. *-un-lft-identity70.9%

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

      \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    5. *-rgt-identity70.9%

      \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    6. metadata-eval70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
    8. un-div-inv70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
    9. pow1/271.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
    10. pow-flip71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
    11. metadata-eval71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
    12. +-commutative71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
  3. Applied egg-rr71.2%

    \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
  4. Step-by-step derivation
    1. associate-*r/71.2%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  5. Simplified71.2%

    \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  6. Step-by-step derivation
    1. flip--71.4%

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    2. div-inv71.4%

      \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    3. add-sqr-sqrt62.8%

      \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    4. add-sqr-sqrt72.0%

      \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    5. associate--l+99.6%

      \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  7. Applied egg-rr99.6%

    \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  8. Step-by-step derivation
    1. +-inverses99.6%

      \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    2. metadata-eval99.6%

      \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    3. *-lft-identity99.6%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  9. Simplified99.6%

    \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  10. Step-by-step derivation
    1. metadata-eval99.6%

      \[\leadsto \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{\color{blue}{\left(-0.5\right)}}}{\sqrt{1 + x}} \]
    2. pow-flip99.3%

      \[\leadsto \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{\frac{1}{{x}^{0.5}}}}{\sqrt{1 + x}} \]
    3. pow1/299.3%

      \[\leadsto \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\color{blue}{\sqrt{x}}}}{\sqrt{1 + x}} \]
    4. *-commutative99.3%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}}}{\sqrt{1 + x}} \]
    5. *-un-lft-identity99.3%

      \[\leadsto \frac{\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\color{blue}{1 \cdot \sqrt{1 + x}}} \]
    6. times-frac99.3%

      \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{x}}}{1} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{1 + x}}} \]
    7. pow1/299.3%

      \[\leadsto \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{1} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{1 + x}} \]
    8. pow-flip99.6%

      \[\leadsto \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{1} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{1 + x}} \]
    9. metadata-eval99.6%

      \[\leadsto \frac{{x}^{\color{blue}{-0.5}}}{1} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{1 + x}} \]
  11. Applied egg-rr99.6%

    \[\leadsto \color{blue}{\frac{{x}^{-0.5}}{1} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{1 + x}}} \]
  12. Step-by-step derivation
    1. /-rgt-identity99.6%

      \[\leadsto \color{blue}{{x}^{-0.5}} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{1 + x}} \]
    2. associate-/l/99.6%

      \[\leadsto {x}^{-0.5} \cdot \color{blue}{\frac{1}{\sqrt{1 + x} \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)}} \]
    3. associate-*r/99.6%

      \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot 1}{\sqrt{1 + x} \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)}} \]
    4. *-commutative99.6%

      \[\leadsto \frac{\color{blue}{1 \cdot {x}^{-0.5}}}{\sqrt{1 + x} \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} \]
    5. *-lft-identity99.6%

      \[\leadsto \frac{\color{blue}{{x}^{-0.5}}}{\sqrt{1 + x} \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} \]
    6. +-commutative99.6%

      \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{x + 1}} \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} \]
    7. +-commutative99.6%

      \[\leadsto \frac{{x}^{-0.5}}{\sqrt{x + 1} \cdot \left(\sqrt{\color{blue}{x + 1}} + \sqrt{x}\right)} \]
  13. Simplified99.6%

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

    \[\leadsto \frac{{x}^{-0.5}}{\sqrt{x + 1} \cdot \left(\sqrt{x} + \sqrt{x + 1}\right)} \]

Alternative 7: 99.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+116}:\\
\;\;\;\;\frac{1}{\left(\sqrt{x} + \sqrt{x + 1}\right) \cdot \sqrt{x \cdot \left(x + 1\right)}}\\

\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\


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

    1. Initial program 77.0%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub77.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv77.0%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity77.0%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity77.0%

        \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      6. metadata-eval77.0%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times77.0%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv77.0%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/277.0%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip77.4%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval77.4%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative77.4%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr77.4%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/77.4%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified77.4%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--77.7%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv77.7%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt78.2%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt78.7%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.7%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.7%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.7%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.7%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.7%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u94.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}{\sqrt{1 + x}}\right)\right)} \]
      2. expm1-udef71.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}{\sqrt{1 + x}}\right)} - 1} \]
    11. Applied egg-rr71.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{1}{\sqrt{\left(1 + x\right) \cdot x}}}{\sqrt{1 + x} + \sqrt{x}}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def94.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{1}{\sqrt{\left(1 + x\right) \cdot x}}}{\sqrt{1 + x} + \sqrt{x}}\right)\right)} \]
      2. expm1-log1p99.4%

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{\left(1 + x\right) \cdot x}}}{\sqrt{1 + x} + \sqrt{x}}} \]
      3. associate-/l/99.4%

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

        \[\leadsto \frac{1}{\color{blue}{e^{\log \left(\left(\sqrt{1 + x} + \sqrt{x}\right) \cdot \sqrt{\left(1 + x\right) \cdot x}\right)}}} \]
      5. rem-exp-log99.4%

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

        \[\leadsto \frac{1}{\left(\sqrt{\color{blue}{x + 1}} + \sqrt{x}\right) \cdot \sqrt{\left(1 + x\right) \cdot x}} \]
      7. *-commutative99.4%

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

        \[\leadsto \frac{1}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \sqrt{x \cdot \color{blue}{\left(x + 1\right)}}} \]
    13. Simplified99.4%

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

    if 5.00000000000000025e116 < x

    1. Initial program 59.3%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub59.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv59.3%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity59.3%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity59.3%

        \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      6. metadata-eval59.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times59.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv59.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/259.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip59.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval59.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative59.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr59.3%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/59.3%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified59.3%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--59.3%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv59.3%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt33.3%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt59.3%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.6%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.6%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.6%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.6%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.6%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.6%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Step-by-step derivation
      1. div-inv99.5%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\sqrt{1 + x}}} \]
      2. pow1/299.5%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\color{blue}{{\left(1 + x\right)}^{0.5}}} \]
      3. pow-flip99.7%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}} \]
      4. metadata-eval99.7%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}} \]
      5. metadata-eval99.7%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
      6. pow-pow96.1%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
      7. pow1/399.4%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{\sqrt[3]{{\left(1 + x\right)}^{-1.5}}} \]
      8. metadata-eval99.4%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{\color{blue}{\left(-0.5\right)}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      9. pow-flip99.3%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{\frac{1}{{x}^{0.5}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      10. pow1/299.3%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\color{blue}{\sqrt{x}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      11. *-commutative99.3%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      12. associate-*l*99.3%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right)} \]
      13. pow1/299.3%

        \[\leadsto \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      14. pow-flip99.5%

        \[\leadsto \color{blue}{{x}^{\left(-0.5\right)}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      15. metadata-eval99.5%

        \[\leadsto {x}^{\color{blue}{-0.5}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      16. pow1/396.0%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}}\right) \]
      17. pow-pow99.7%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left(1 + x\right)}^{\left(-1.5 \cdot 0.3333333333333333\right)}}\right) \]
      18. metadata-eval99.7%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) \]
    11. Applied egg-rr99.7%

      \[\leadsto \color{blue}{{x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{-0.5}\right)} \]
    12. Taylor expanded in x around inf 99.8%

      \[\leadsto {x}^{-0.5} \cdot \color{blue}{\frac{0.5}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+116}:\\ \;\;\;\;\frac{1}{\left(\sqrt{x} + \sqrt{x + 1}\right) \cdot \sqrt{x \cdot \left(x + 1\right)}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\ \end{array} \]

Alternative 8: 99.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+72}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{x \cdot \left(x + 1\right)}}}{\sqrt{x} + \sqrt{x + 1}}\\

\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\


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

    1. Initial program 83.1%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub83.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv83.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity83.1%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity83.1%

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times83.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv83.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/283.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip83.5%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval83.5%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative83.5%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr83.5%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/83.5%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified83.5%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--83.8%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv83.8%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt84.4%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt84.9%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.7%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.7%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.7%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.7%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.7%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u94.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}{\sqrt{1 + x}}\right)\right)} \]
      2. expm1-udef76.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}}{\sqrt{1 + x}}\right)} - 1} \]
    11. Applied egg-rr76.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{1}{\sqrt{\left(1 + x\right) \cdot x}}}{\sqrt{1 + x} + \sqrt{x}}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def94.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{1}{\sqrt{\left(1 + x\right) \cdot x}}}{\sqrt{1 + x} + \sqrt{x}}\right)\right)} \]
      2. expm1-log1p99.4%

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{\left(1 + x\right) \cdot x}}}{\sqrt{1 + x} + \sqrt{x}}} \]
      3. *-commutative99.4%

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

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

        \[\leadsto \frac{\frac{1}{\sqrt{x \cdot \left(x + 1\right)}}}{\sqrt{\color{blue}{x + 1}} + \sqrt{x}} \]
    13. Simplified99.4%

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

    if 9.99999999999999944e71 < x

    1. Initial program 52.3%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub52.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv52.3%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity52.3%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity52.3%

        \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      6. metadata-eval52.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times52.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv52.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/252.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip52.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval52.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative52.3%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr52.3%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/52.3%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified52.3%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--52.3%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv52.3%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt29.5%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt52.3%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.5%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.5%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.5%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.5%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.5%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.5%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Step-by-step derivation
      1. div-inv99.5%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\sqrt{1 + x}}} \]
      2. pow1/299.5%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\color{blue}{{\left(1 + x\right)}^{0.5}}} \]
      3. pow-flip99.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}} \]
      4. metadata-eval99.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}} \]
      5. metadata-eval99.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
      6. pow-pow95.5%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
      7. pow1/399.3%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{\sqrt[3]{{\left(1 + x\right)}^{-1.5}}} \]
      8. metadata-eval99.3%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{\color{blue}{\left(-0.5\right)}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      9. pow-flip99.2%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{\frac{1}{{x}^{0.5}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      10. pow1/299.2%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\color{blue}{\sqrt{x}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      11. *-commutative99.2%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      12. associate-*l*99.2%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right)} \]
      13. pow1/299.2%

        \[\leadsto \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      14. pow-flip99.3%

        \[\leadsto \color{blue}{{x}^{\left(-0.5\right)}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      15. metadata-eval99.3%

        \[\leadsto {x}^{\color{blue}{-0.5}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      16. pow1/395.5%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}}\right) \]
      17. pow-pow99.6%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left(1 + x\right)}^{\left(-1.5 \cdot 0.3333333333333333\right)}}\right) \]
      18. metadata-eval99.6%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) \]
    11. Applied egg-rr99.6%

      \[\leadsto \color{blue}{{x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{-0.5}\right)} \]
    12. Taylor expanded in x around inf 99.7%

      \[\leadsto {x}^{-0.5} \cdot \color{blue}{\frac{0.5}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 10^{+72}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{x \cdot \left(x + 1\right)}}}{\sqrt{x} + \sqrt{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\ \end{array} \]

Alternative 9: 99.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 8 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}{\sqrt{x + x \cdot x}}\\

\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\


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

    1. Initial program 70.1%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub70.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. clear-num70.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{x} \cdot \sqrt{x + 1}}{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}}} \]
      3. sqrt-unprod70.1%

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

        \[\leadsto \frac{1}{\frac{\sqrt{x \cdot \color{blue}{\left(1 + x\right)}}}{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}} \]
      5. *-un-lft-identity70.1%

        \[\leadsto \frac{1}{\frac{\sqrt{x \cdot \left(1 + x\right)}}{\color{blue}{\sqrt{x + 1}} - \sqrt{x} \cdot 1}} \]
      6. *-rgt-identity70.1%

        \[\leadsto \frac{1}{\frac{\sqrt{x \cdot \left(1 + x\right)}}{\sqrt{x + 1} - \color{blue}{\sqrt{x}}}} \]
      7. +-commutative70.1%

        \[\leadsto \frac{1}{\frac{\sqrt{x \cdot \left(1 + x\right)}}{\sqrt{\color{blue}{1 + x}} - \sqrt{x}}} \]
    3. Applied egg-rr70.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{x \cdot \left(1 + x\right)}}{\sqrt{1 + x} - \sqrt{x}}}} \]
    4. Step-by-step derivation
      1. associate-/r/70.1%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\sqrt{1 + x} - \sqrt{x}\right)}{\sqrt{x \cdot \left(1 + x\right)}}} \]
      3. *-lft-identity70.1%

        \[\leadsto \frac{\color{blue}{\sqrt{1 + x} - \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]
      4. distribute-rgt-in70.1%

        \[\leadsto \frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{\color{blue}{1 \cdot x + x \cdot x}}} \]
      5. *-lft-identity70.1%

        \[\leadsto \frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{\color{blue}{x} + x \cdot x}} \]
    5. Simplified70.1%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x + x \cdot x}}} \]
    6. Step-by-step derivation
      1. flip--70.7%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv70.7%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt71.1%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt71.6%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.6%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.4%

      \[\leadsto \frac{\color{blue}{\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}}}{\sqrt{x + x \cdot x}} \]
    8. Step-by-step derivation
      1. +-inverses99.6%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.6%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.6%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.4%

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

    if 8e153 < x

    1. Initial program 73.1%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub73.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv73.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity73.1%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity73.1%

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times73.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv73.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/273.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip73.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval73.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative73.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr73.1%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/73.1%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified73.1%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--73.1%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv73.1%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt40.6%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt73.1%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.7%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.7%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.7%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.7%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.7%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Step-by-step derivation
      1. div-inv99.7%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\sqrt{1 + x}}} \]
      2. pow1/299.7%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\color{blue}{{\left(1 + x\right)}^{0.5}}} \]
      3. pow-flip99.9%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}} \]
      4. metadata-eval99.9%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}} \]
      5. metadata-eval99.9%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
      6. pow-pow97.4%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
      7. pow1/399.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{\sqrt[3]{{\left(1 + x\right)}^{-1.5}}} \]
      8. metadata-eval99.6%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{\color{blue}{\left(-0.5\right)}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      9. pow-flip99.5%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{\frac{1}{{x}^{0.5}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      10. pow1/299.5%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\color{blue}{\sqrt{x}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      11. *-commutative99.5%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      12. associate-*l*99.5%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right)} \]
      13. pow1/299.5%

        \[\leadsto \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      14. pow-flip99.6%

        \[\leadsto \color{blue}{{x}^{\left(-0.5\right)}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      15. metadata-eval99.6%

        \[\leadsto {x}^{\color{blue}{-0.5}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      16. pow1/397.4%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}}\right) \]
      17. pow-pow99.9%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left(1 + x\right)}^{\left(-1.5 \cdot 0.3333333333333333\right)}}\right) \]
      18. metadata-eval99.9%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) \]
    11. Applied egg-rr99.9%

      \[\leadsto \color{blue}{{x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{-0.5}\right)} \]
    12. Taylor expanded in x around inf 99.9%

      \[\leadsto {x}^{-0.5} \cdot \color{blue}{\frac{0.5}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 8 \cdot 10^{+153}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}{\sqrt{x + x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\ \end{array} \]

Alternative 10: 99.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{x + 1}\\
\mathbf{if}\;x \leq 44000000:\\
\;\;\;\;{x}^{-0.5} \cdot \left(1 - \frac{\sqrt{x}}{t_0}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.5}{x}}{t_0}\\


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

    1. Initial program 98.9%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub99.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv99.0%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity99.0%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity99.0%

        \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      6. metadata-eval99.0%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times99.0%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv99.0%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/299.0%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip99.4%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval99.4%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative99.4%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/99.5%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
      2. *-rgt-identity99.5%

        \[\leadsto \frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\color{blue}{\sqrt{1 + x} \cdot 1}} \]
      3. times-frac99.4%

        \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{1 + x}} \cdot \frac{{x}^{-0.5}}{1}} \]
      4. div-sub99.4%

        \[\leadsto \color{blue}{\left(\frac{\sqrt{1 + x}}{\sqrt{1 + x}} - \frac{\sqrt{x}}{\sqrt{1 + x}}\right)} \cdot \frac{{x}^{-0.5}}{1} \]
      5. *-inverses99.4%

        \[\leadsto \left(\color{blue}{1} - \frac{\sqrt{x}}{\sqrt{1 + x}}\right) \cdot \frac{{x}^{-0.5}}{1} \]
      6. /-rgt-identity99.4%

        \[\leadsto \left(1 - \frac{\sqrt{x}}{\sqrt{1 + x}}\right) \cdot \color{blue}{{x}^{-0.5}} \]
    5. Simplified99.4%

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

    if 4.4e7 < x

    1. Initial program 42.9%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub42.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv42.9%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity42.9%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity42.9%

        \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      6. metadata-eval42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/242.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative42.9%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr42.9%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/42.9%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified42.9%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--43.3%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv43.3%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt26.1%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt44.2%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.4%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.4%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.4%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.4%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.4%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Taylor expanded in x around inf 99.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 44000000:\\ \;\;\;\;{x}^{-0.5} \cdot \left(1 - \frac{\sqrt{x}}{\sqrt{x + 1}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{x}}{\sqrt{x + 1}}\\ \end{array} \]

Alternative 11: 98.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.72:\\
\;\;\;\;\left({x}^{-0.5} + x \cdot 0.5\right) + -1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.5}{x}}{\sqrt{x + 1}}\\


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

    1. Initial program 99.5%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. inv-pow99.5%

        \[\leadsto \color{blue}{{\left(\sqrt{x}\right)}^{-1}} - \frac{1}{\sqrt{x + 1}} \]
      2. pow1/299.5%

        \[\leadsto {\color{blue}{\left({x}^{0.5}\right)}}^{-1} - \frac{1}{\sqrt{x + 1}} \]
      3. pow-pow100.0%

        \[\leadsto \color{blue}{{x}^{\left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
      4. add-exp-log92.8%

        \[\leadsto {\color{blue}{\left(e^{\log x}\right)}}^{\left(0.5 \cdot -1\right)} - \frac{1}{\sqrt{x + 1}} \]
      5. pow-exp92.8%

        \[\leadsto \color{blue}{e^{\log x \cdot \left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
      6. metadata-eval92.8%

        \[\leadsto e^{\log x \cdot \color{blue}{-0.5}} - \frac{1}{\sqrt{x + 1}} \]
    3. Applied egg-rr92.8%

      \[\leadsto \color{blue}{e^{\log x \cdot -0.5}} - \frac{1}{\sqrt{x + 1}} \]
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto \color{blue}{\left(0.5 \cdot x + {x}^{-0.5}\right) - 1} \]

    if 0.71999999999999997 < x

    1. Initial program 44.0%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub44.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv44.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity44.1%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity44.1%

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/244.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr44.1%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/44.1%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified44.1%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--44.6%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv44.6%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt27.9%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt45.9%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.4%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.4%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.4%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.4%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.4%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Taylor expanded in x around inf 97.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.72:\\ \;\;\;\;\left({x}^{-0.5} + x \cdot 0.5\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{x}}{\sqrt{x + 1}}\\ \end{array} \]

Alternative 12: 98.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.72:\\
\;\;\;\;{x}^{-0.5} + \left(-1 - x \cdot -0.5\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.5}{x}}{\sqrt{x + 1}}\\


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

    1. Initial program 99.5%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Taylor expanded in x around 0 99.1%

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\left(-0.5 \cdot x + 1\right)} \]
    3. Step-by-step derivation
      1. add-log-exp4.8%

        \[\leadsto \color{blue}{\log \left(e^{\frac{1}{\sqrt{x}}}\right)} - \left(-0.5 \cdot x + 1\right) \]
      2. *-un-lft-identity4.8%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{1}{\sqrt{x}}}\right)} - \left(-0.5 \cdot x + 1\right) \]
      3. log-prod4.8%

        \[\leadsto \color{blue}{\left(\log 1 + \log \left(e^{\frac{1}{\sqrt{x}}}\right)\right)} - \left(-0.5 \cdot x + 1\right) \]
      4. metadata-eval4.8%

        \[\leadsto \left(\color{blue}{0} + \log \left(e^{\frac{1}{\sqrt{x}}}\right)\right) - \left(-0.5 \cdot x + 1\right) \]
      5. add-log-exp99.1%

        \[\leadsto \left(0 + \color{blue}{\frac{1}{\sqrt{x}}}\right) - \left(-0.5 \cdot x + 1\right) \]
      6. pow1/299.1%

        \[\leadsto \left(0 + \frac{1}{\color{blue}{{x}^{0.5}}}\right) - \left(-0.5 \cdot x + 1\right) \]
      7. pow-flip99.5%

        \[\leadsto \left(0 + \color{blue}{{x}^{\left(-0.5\right)}}\right) - \left(-0.5 \cdot x + 1\right) \]
      8. metadata-eval99.5%

        \[\leadsto \left(0 + {x}^{\color{blue}{-0.5}}\right) - \left(-0.5 \cdot x + 1\right) \]
    4. Applied egg-rr99.5%

      \[\leadsto \color{blue}{\left(0 + {x}^{-0.5}\right)} - \left(-0.5 \cdot x + 1\right) \]
    5. Step-by-step derivation
      1. +-lft-identity99.5%

        \[\leadsto \color{blue}{{x}^{-0.5}} - \left(-0.5 \cdot x + 1\right) \]
    6. Simplified99.5%

      \[\leadsto \color{blue}{{x}^{-0.5}} - \left(-0.5 \cdot x + 1\right) \]

    if 0.71999999999999997 < x

    1. Initial program 44.0%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub44.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv44.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity44.1%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity44.1%

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/244.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr44.1%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/44.1%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified44.1%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--44.6%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv44.6%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt27.9%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt45.9%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.4%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.4%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.4%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.4%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.4%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Taylor expanded in x around inf 97.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.72:\\ \;\;\;\;{x}^{-0.5} + \left(-1 - x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{x}}{\sqrt{x + 1}}\\ \end{array} \]

Alternative 13: 98.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.48:\\
\;\;\;\;{x}^{-0.5} + -1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.5}{x}}{\sqrt{x + 1}}\\


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

    1. Initial program 99.5%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. inv-pow99.5%

        \[\leadsto \color{blue}{{\left(\sqrt{x}\right)}^{-1}} - \frac{1}{\sqrt{x + 1}} \]
      2. pow1/299.5%

        \[\leadsto {\color{blue}{\left({x}^{0.5}\right)}}^{-1} - \frac{1}{\sqrt{x + 1}} \]
      3. pow-pow100.0%

        \[\leadsto \color{blue}{{x}^{\left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
      4. add-exp-log92.8%

        \[\leadsto {\color{blue}{\left(e^{\log x}\right)}}^{\left(0.5 \cdot -1\right)} - \frac{1}{\sqrt{x + 1}} \]
      5. pow-exp92.8%

        \[\leadsto \color{blue}{e^{\log x \cdot \left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
      6. metadata-eval92.8%

        \[\leadsto e^{\log x \cdot \color{blue}{-0.5}} - \frac{1}{\sqrt{x + 1}} \]
    3. Applied egg-rr92.8%

      \[\leadsto \color{blue}{e^{\log x \cdot -0.5}} - \frac{1}{\sqrt{x + 1}} \]
    4. Taylor expanded in x around 0 98.2%

      \[\leadsto \color{blue}{{x}^{-0.5} - 1} \]

    if 0.47999999999999998 < x

    1. Initial program 44.0%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub44.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv44.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity44.1%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity44.1%

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/244.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr44.1%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/44.1%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified44.1%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--44.6%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv44.6%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt27.9%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt45.9%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.4%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.4%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.4%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.4%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.4%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Taylor expanded in x around inf 97.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.48:\\ \;\;\;\;{x}^{-0.5} + -1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{x}}{\sqrt{x + 1}}\\ \end{array} \]

Alternative 14: 98.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.7:\\
\;\;\;\;{x}^{-0.5} + -1\\

\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\


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

    1. Initial program 99.5%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. inv-pow99.5%

        \[\leadsto \color{blue}{{\left(\sqrt{x}\right)}^{-1}} - \frac{1}{\sqrt{x + 1}} \]
      2. pow1/299.5%

        \[\leadsto {\color{blue}{\left({x}^{0.5}\right)}}^{-1} - \frac{1}{\sqrt{x + 1}} \]
      3. pow-pow100.0%

        \[\leadsto \color{blue}{{x}^{\left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
      4. add-exp-log92.8%

        \[\leadsto {\color{blue}{\left(e^{\log x}\right)}}^{\left(0.5 \cdot -1\right)} - \frac{1}{\sqrt{x + 1}} \]
      5. pow-exp92.8%

        \[\leadsto \color{blue}{e^{\log x \cdot \left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
      6. metadata-eval92.8%

        \[\leadsto e^{\log x \cdot \color{blue}{-0.5}} - \frac{1}{\sqrt{x + 1}} \]
    3. Applied egg-rr92.8%

      \[\leadsto \color{blue}{e^{\log x \cdot -0.5}} - \frac{1}{\sqrt{x + 1}} \]
    4. Taylor expanded in x around 0 98.2%

      \[\leadsto \color{blue}{{x}^{-0.5} - 1} \]

    if 0.69999999999999996 < x

    1. Initial program 44.0%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub44.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv44.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity44.1%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity44.1%

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/244.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr44.1%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/44.1%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified44.1%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    6. Step-by-step derivation
      1. flip--44.6%

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. div-inv44.6%

        \[\leadsto \frac{\color{blue}{\left(\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. add-sqr-sqrt27.9%

        \[\leadsto \frac{\left(\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      4. add-sqr-sqrt45.9%

        \[\leadsto \frac{\left(\left(\left(1 + x\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      5. associate--l+99.4%

        \[\leadsto \frac{\left(\color{blue}{\left(1 + \left(x - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Applied egg-rr99.4%

      \[\leadsto \frac{\color{blue}{\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    8. Step-by-step derivation
      1. +-inverses99.4%

        \[\leadsto \frac{\left(\left(1 + \color{blue}{0}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      2. metadata-eval99.4%

        \[\leadsto \frac{\left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
      3. *-lft-identity99.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    9. Simplified99.4%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    10. Step-by-step derivation
      1. div-inv99.3%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\sqrt{1 + x}}} \]
      2. pow1/299.3%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \frac{1}{\color{blue}{{\left(1 + x\right)}^{0.5}}} \]
      3. pow-flip99.4%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}} \]
      4. metadata-eval99.4%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}} \]
      5. metadata-eval99.4%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot {\left(1 + x\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
      6. pow-pow95.2%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
      7. pow1/399.2%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{-0.5}\right) \cdot \color{blue}{\sqrt[3]{{\left(1 + x\right)}^{-1.5}}} \]
      8. metadata-eval99.2%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {x}^{\color{blue}{\left(-0.5\right)}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      9. pow-flip99.1%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{\frac{1}{{x}^{0.5}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      10. pow1/299.1%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\color{blue}{\sqrt{x}}}\right) \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      11. *-commutative99.1%

        \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}} \]
      12. associate-*l*99.0%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right)} \]
      13. pow1/299.0%

        \[\leadsto \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      14. pow-flip99.2%

        \[\leadsto \color{blue}{{x}^{\left(-0.5\right)}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      15. metadata-eval99.2%

        \[\leadsto {x}^{\color{blue}{-0.5}} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt[3]{{\left(1 + x\right)}^{-1.5}}\right) \]
      16. pow1/395.2%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left({\left(1 + x\right)}^{-1.5}\right)}^{0.3333333333333333}}\right) \]
      17. pow-pow99.4%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left(1 + x\right)}^{\left(-1.5 \cdot 0.3333333333333333\right)}}\right) \]
      18. metadata-eval99.4%

        \[\leadsto {x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) \]
    11. Applied egg-rr99.4%

      \[\leadsto \color{blue}{{x}^{-0.5} \cdot \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot {\left(1 + x\right)}^{-0.5}\right)} \]
    12. Taylor expanded in x around inf 97.3%

      \[\leadsto {x}^{-0.5} \cdot \color{blue}{\frac{0.5}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.7:\\ \;\;\;\;{x}^{-0.5} + -1\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} \cdot \frac{0.5}{x}\\ \end{array} \]

Alternative 15: 52.9% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.6:\\
\;\;\;\;{x}^{-0.5} + -1\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{x} - \frac{0.5}{x \cdot x}\\


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

    1. Initial program 99.5%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. inv-pow99.5%

        \[\leadsto \color{blue}{{\left(\sqrt{x}\right)}^{-1}} - \frac{1}{\sqrt{x + 1}} \]
      2. pow1/299.5%

        \[\leadsto {\color{blue}{\left({x}^{0.5}\right)}}^{-1} - \frac{1}{\sqrt{x + 1}} \]
      3. pow-pow100.0%

        \[\leadsto \color{blue}{{x}^{\left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
      4. add-exp-log92.8%

        \[\leadsto {\color{blue}{\left(e^{\log x}\right)}}^{\left(0.5 \cdot -1\right)} - \frac{1}{\sqrt{x + 1}} \]
      5. pow-exp92.8%

        \[\leadsto \color{blue}{e^{\log x \cdot \left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
      6. metadata-eval92.8%

        \[\leadsto e^{\log x \cdot \color{blue}{-0.5}} - \frac{1}{\sqrt{x + 1}} \]
    3. Applied egg-rr92.8%

      \[\leadsto \color{blue}{e^{\log x \cdot -0.5}} - \frac{1}{\sqrt{x + 1}} \]
    4. Taylor expanded in x around 0 98.2%

      \[\leadsto \color{blue}{{x}^{-0.5} - 1} \]

    if 0.599999999999999978 < x

    1. Initial program 44.0%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. frac-sub44.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv44.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      3. *-un-lft-identity44.1%

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

        \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      5. *-rgt-identity44.1%

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
      8. un-div-inv44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
      9. pow1/244.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
      10. pow-flip44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
      11. metadata-eval44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
      12. +-commutative44.1%

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
    3. Applied egg-rr44.1%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
    4. Step-by-step derivation
      1. associate-*r/44.1%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
    5. Simplified44.1%

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

      \[\leadsto \frac{\color{blue}{1} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
    7. Taylor expanded in x around inf 7.9%

      \[\leadsto \color{blue}{\frac{1}{x} - 0.5 \cdot \frac{1}{{x}^{2}}} \]
    8. Step-by-step derivation
      1. associate-*r/7.9%

        \[\leadsto \frac{1}{x} - \color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}} \]
      2. metadata-eval7.9%

        \[\leadsto \frac{1}{x} - \frac{\color{blue}{0.5}}{{x}^{2}} \]
      3. unpow27.9%

        \[\leadsto \frac{1}{x} - \frac{0.5}{\color{blue}{x \cdot x}} \]
    9. Simplified7.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.6:\\ \;\;\;\;{x}^{-0.5} + -1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x} - \frac{0.5}{x \cdot x}\\ \end{array} \]

Alternative 16: 50.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ {x}^{-0.5} \end{array} \]
(FPCore (x) :precision binary64 (pow x -0.5))
double code(double x) {
	return pow(x, -0.5);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = x ** (-0.5d0)
end function
public static double code(double x) {
	return Math.pow(x, -0.5);
}
def code(x):
	return math.pow(x, -0.5)
function code(x)
	return x ^ -0.5
end
function tmp = code(x)
	tmp = x ^ -0.5;
end
code[x_] := N[Power[x, -0.5], $MachinePrecision]
\begin{array}{l}

\\
{x}^{-0.5}
\end{array}
Derivation
  1. Initial program 70.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. inv-pow70.9%

      \[\leadsto \color{blue}{{\left(\sqrt{x}\right)}^{-1}} - \frac{1}{\sqrt{x + 1}} \]
    2. pow1/270.9%

      \[\leadsto {\color{blue}{\left({x}^{0.5}\right)}}^{-1} - \frac{1}{\sqrt{x + 1}} \]
    3. pow-pow65.8%

      \[\leadsto \color{blue}{{x}^{\left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
    4. add-exp-log48.8%

      \[\leadsto {\color{blue}{\left(e^{\log x}\right)}}^{\left(0.5 \cdot -1\right)} - \frac{1}{\sqrt{x + 1}} \]
    5. pow-exp48.8%

      \[\leadsto \color{blue}{e^{\log x \cdot \left(0.5 \cdot -1\right)}} - \frac{1}{\sqrt{x + 1}} \]
    6. metadata-eval48.8%

      \[\leadsto e^{\log x \cdot \color{blue}{-0.5}} - \frac{1}{\sqrt{x + 1}} \]
  3. Applied egg-rr48.8%

    \[\leadsto \color{blue}{e^{\log x \cdot -0.5}} - \frac{1}{\sqrt{x + 1}} \]
  4. Taylor expanded in x around inf 48.6%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{x}}} \]
  5. Step-by-step derivation
    1. unpow-148.6%

      \[\leadsto \sqrt{\color{blue}{{x}^{-1}}} \]
    2. metadata-eval48.6%

      \[\leadsto \sqrt{{x}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
    3. pow-sqr48.6%

      \[\leadsto \sqrt{\color{blue}{{x}^{-0.5} \cdot {x}^{-0.5}}} \]
    4. rem-sqrt-square48.6%

      \[\leadsto \color{blue}{\left|{x}^{-0.5}\right|} \]
    5. unpow148.6%

      \[\leadsto \left|\color{blue}{{\left({x}^{-0.5}\right)}^{1}}\right| \]
    6. sqr-pow48.3%

      \[\leadsto \left|\color{blue}{{\left({x}^{-0.5}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left({x}^{-0.5}\right)}^{\left(\frac{1}{2}\right)}}\right| \]
    7. fabs-sqr48.3%

      \[\leadsto \color{blue}{{\left({x}^{-0.5}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left({x}^{-0.5}\right)}^{\left(\frac{1}{2}\right)}} \]
    8. sqr-pow48.6%

      \[\leadsto \color{blue}{{\left({x}^{-0.5}\right)}^{1}} \]
    9. unpow148.6%

      \[\leadsto \color{blue}{{x}^{-0.5}} \]
  6. Simplified48.6%

    \[\leadsto \color{blue}{{x}^{-0.5}} \]
  7. Final simplification48.6%

    \[\leadsto {x}^{-0.5} \]

Alternative 17: 7.4% accurate, 69.7× speedup?

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

\\
\frac{1}{x}
\end{array}
Derivation
  1. Initial program 70.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. frac-sub70.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv70.9%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    3. *-un-lft-identity70.9%

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

      \[\leadsto \left(\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    5. *-rgt-identity70.9%

      \[\leadsto \left(\sqrt{1 + x} - \color{blue}{\sqrt{x}}\right) \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    6. metadata-eval70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x + 1}}\right)} \]
    8. un-div-inv70.9%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{x}}}{\sqrt{x + 1}}} \]
    9. pow1/271.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\frac{1}{\color{blue}{{x}^{0.5}}}}{\sqrt{x + 1}} \]
    10. pow-flip71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{x}^{\left(-0.5\right)}}}{\sqrt{x + 1}} \]
    11. metadata-eval71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{x + 1}} \]
    12. +-commutative71.2%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + x}}} \]
  3. Applied egg-rr71.2%

    \[\leadsto \color{blue}{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{x}^{-0.5}}{\sqrt{1 + x}}} \]
  4. Step-by-step derivation
    1. associate-*r/71.2%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {x}^{-0.5}}{\sqrt{1 + x}}} \]
  5. Simplified71.2%

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

    \[\leadsto \frac{\color{blue}{1} \cdot {x}^{-0.5}}{\sqrt{1 + x}} \]
  7. Taylor expanded in x around inf 7.6%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  8. Final simplification7.6%

    \[\leadsto \frac{1}{x} \]

Alternative 18: 1.9% accurate, 209.0× speedup?

\[\begin{array}{l} \\ -1 \end{array} \]
(FPCore (x) :precision binary64 -1.0)
double code(double x) {
	return -1.0;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = -1.0d0
end function
public static double code(double x) {
	return -1.0;
}
def code(x):
	return -1.0
function code(x)
	return -1.0
end
function tmp = code(x)
	tmp = -1.0;
end
code[x_] := -1.0
\begin{array}{l}

\\
-1
\end{array}
Derivation
  1. Initial program 70.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. add-cube-cbrt52.8%

      \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right) \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}} - \frac{1}{\sqrt{x + 1}} \]
    2. associate-*l*52.8%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right)} - \frac{1}{\sqrt{x + 1}} \]
    3. frac-2neg52.8%

      \[\leadsto \sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right) - \color{blue}{\frac{-1}{-\sqrt{x + 1}}} \]
    4. metadata-eval52.8%

      \[\leadsto \sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right) - \frac{\color{blue}{-1}}{-\sqrt{x + 1}} \]
    5. div-inv52.8%

      \[\leadsto \sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right) - \color{blue}{-1 \cdot \frac{1}{-\sqrt{x + 1}}} \]
    6. metadata-eval52.8%

      \[\leadsto \sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right) - -1 \cdot \frac{\color{blue}{--1}}{-\sqrt{x + 1}} \]
    7. distribute-neg-frac52.8%

      \[\leadsto \sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right) - -1 \cdot \color{blue}{\left(-\frac{-1}{-\sqrt{x + 1}}\right)} \]
    8. metadata-eval52.8%

      \[\leadsto \sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right) - -1 \cdot \left(-\frac{\color{blue}{-1}}{-\sqrt{x + 1}}\right) \]
    9. frac-2neg52.8%

      \[\leadsto \sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}\right) - -1 \cdot \left(-\color{blue}{\frac{1}{\sqrt{x + 1}}}\right) \]
    10. prod-diff51.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{1}{\sqrt{x}}}, \sqrt[3]{\frac{1}{\sqrt{x}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}}}, -\left(-\frac{1}{\sqrt{x + 1}}\right) \cdot -1\right) + \mathsf{fma}\left(-\left(-\frac{1}{\sqrt{x + 1}}\right), -1, \left(-\frac{1}{\sqrt{x + 1}}\right) \cdot -1\right)} \]
  3. Applied egg-rr51.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{{x}^{-0.5}}, \sqrt[3]{\frac{1}{x}}, -\frac{-1}{\sqrt{1 + x}} \cdot -1\right) + \mathsf{fma}\left(-\frac{-1}{\sqrt{1 + x}}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right)} \]
  4. Step-by-step derivation
    1. fma-udef58.1%

      \[\leadsto \color{blue}{\left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt[3]{\frac{1}{x}} + \left(-\frac{-1}{\sqrt{1 + x}} \cdot -1\right)\right)} + \mathsf{fma}\left(-\frac{-1}{\sqrt{1 + x}}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right) \]
    2. distribute-rgt-neg-in58.1%

      \[\leadsto \left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt[3]{\frac{1}{x}} + \color{blue}{\frac{-1}{\sqrt{1 + x}} \cdot \left(--1\right)}\right) + \mathsf{fma}\left(-\frac{-1}{\sqrt{1 + x}}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right) \]
    3. metadata-eval58.1%

      \[\leadsto \left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt[3]{\frac{1}{x}} + \frac{-1}{\sqrt{1 + x}} \cdot \color{blue}{1}\right) + \mathsf{fma}\left(-\frac{-1}{\sqrt{1 + x}}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right) \]
    4. *-rgt-identity58.1%

      \[\leadsto \left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt[3]{\frac{1}{x}} + \color{blue}{\frac{-1}{\sqrt{1 + x}}}\right) + \mathsf{fma}\left(-\frac{-1}{\sqrt{1 + x}}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right) \]
    5. *-commutative58.1%

      \[\leadsto \left(\color{blue}{\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{{x}^{-0.5}}} + \frac{-1}{\sqrt{1 + x}}\right) + \mathsf{fma}\left(-\frac{-1}{\sqrt{1 + x}}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right) \]
    6. associate-+l+58.1%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{{x}^{-0.5}} + \left(\frac{-1}{\sqrt{1 + x}} + \mathsf{fma}\left(-\frac{-1}{\sqrt{1 + x}}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right)\right)} \]
    7. *-commutative58.1%

      \[\leadsto \color{blue}{\sqrt[3]{{x}^{-0.5}} \cdot \sqrt[3]{\frac{1}{x}}} + \left(\frac{-1}{\sqrt{1 + x}} + \mathsf{fma}\left(-\frac{-1}{\sqrt{1 + x}}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right)\right) \]
    8. fma-udef58.1%

      \[\leadsto \sqrt[3]{{x}^{-0.5}} \cdot \sqrt[3]{\frac{1}{x}} + \left(\frac{-1}{\sqrt{1 + x}} + \color{blue}{\left(\left(-\frac{-1}{\sqrt{1 + x}}\right) \cdot -1 + \frac{-1}{\sqrt{1 + x}} \cdot -1\right)}\right) \]
  5. Simplified51.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{{x}^{-0.5}}, \sqrt[3]{\frac{1}{x}}, \frac{-1}{\sqrt{1 + x}}\right)} \]
  6. Taylor expanded in x around 0 2.0%

    \[\leadsto \color{blue}{-1} \]
  7. Final simplification2.0%

    \[\leadsto -1 \]

Developer target: 99.0% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023217 
(FPCore (x)
  :name "2isqrt (example 3.6)"
  :precision binary64

  :herbie-target
  (/ 1.0 (+ (* (+ x 1.0) (sqrt x)) (* x (sqrt (+ x 1.0)))))

  (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))