2isqrt (example 3.6)

Percentage Accurate: 38.4% → 99.2%
Time: 17.5s
Alternatives: 12
Speedup: 2.0×

Specification

?
\[x > 1 \land x < 10^{+308}\]
\[\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 12 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: 38.4% 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.2% accurate, 0.5× speedup?

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

\\
\left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{0.125}{{x}^{2}} + \frac{0.0390625}{{x}^{4}}\right)\right)\right) \cdot {\left(x + 1\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 40.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\left(0.0625 \cdot \frac{1}{{x}^{3}} + 0.5 \cdot \frac{1}{x}\right) - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  8. Step-by-step derivation
    1. associate--l+98.9%

      \[\leadsto \color{blue}{\left(0.0625 \cdot \frac{1}{{x}^{3}} + \left(0.5 \cdot \frac{1}{x} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    2. associate-*r/98.9%

      \[\leadsto \left(\color{blue}{\frac{0.0625 \cdot 1}{{x}^{3}}} + \left(0.5 \cdot \frac{1}{x} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    3. metadata-eval98.9%

      \[\leadsto \left(\frac{\color{blue}{0.0625}}{{x}^{3}} + \left(0.5 \cdot \frac{1}{x} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    4. associate-*r/98.9%

      \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\color{blue}{\frac{0.5 \cdot 1}{x}} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    5. metadata-eval98.9%

      \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{\color{blue}{0.5}}{x} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    6. +-commutative98.9%

      \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \color{blue}{\left(0.125 \cdot \frac{1}{{x}^{2}} + 0.0390625 \cdot \frac{1}{{x}^{4}}\right)}\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    7. associate-*r/98.9%

      \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\color{blue}{\frac{0.125 \cdot 1}{{x}^{2}}} + 0.0390625 \cdot \frac{1}{{x}^{4}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    8. metadata-eval98.9%

      \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{\color{blue}{0.125}}{{x}^{2}} + 0.0390625 \cdot \frac{1}{{x}^{4}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    9. associate-*r/98.9%

      \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{0.125}{{x}^{2}} + \color{blue}{\frac{0.0390625 \cdot 1}{{x}^{4}}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    10. metadata-eval98.9%

      \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{0.125}{{x}^{2}} + \frac{\color{blue}{0.0390625}}{{x}^{4}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  9. Simplified98.9%

    \[\leadsto \color{blue}{\left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{0.125}{{x}^{2}} + \frac{0.0390625}{{x}^{4}}\right)\right)\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  10. Final simplification98.9%

    \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{0.125}{{x}^{2}} + \frac{0.0390625}{{x}^{4}}\right)\right)\right) \cdot {\left(x + 1\right)}^{-0.5} \]
  11. Add Preprocessing

Alternative 2: 99.1% accurate, 0.7× speedup?

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

\\
{\left(x + 1\right)}^{-0.5} \cdot \left(\left(\frac{0.0625}{{x}^{3}} + \frac{0.5}{x}\right) - \frac{0.125}{{x}^{2}}\right)
\end{array}
Derivation
  1. Initial program 40.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\color{blue}{\frac{0.5 \cdot 1}{x}} + 0.0625 \cdot \frac{1}{{x}^{3}}\right) - 0.125 \cdot \frac{1}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    3. metadata-eval98.7%

      \[\leadsto \left(\left(\frac{\color{blue}{0.5}}{x} + 0.0625 \cdot \frac{1}{{x}^{3}}\right) - 0.125 \cdot \frac{1}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    4. associate-*r/98.7%

      \[\leadsto \left(\left(\frac{0.5}{x} + \color{blue}{\frac{0.0625 \cdot 1}{{x}^{3}}}\right) - 0.125 \cdot \frac{1}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    5. metadata-eval98.7%

      \[\leadsto \left(\left(\frac{0.5}{x} + \frac{\color{blue}{0.0625}}{{x}^{3}}\right) - 0.125 \cdot \frac{1}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    6. associate-*r/98.7%

      \[\leadsto \left(\left(\frac{0.5}{x} + \frac{0.0625}{{x}^{3}}\right) - \color{blue}{\frac{0.125 \cdot 1}{{x}^{2}}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    7. metadata-eval98.7%

      \[\leadsto \left(\left(\frac{0.5}{x} + \frac{0.0625}{{x}^{3}}\right) - \frac{\color{blue}{0.125}}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  9. Simplified98.7%

    \[\leadsto \color{blue}{\left(\left(\frac{0.5}{x} + \frac{0.0625}{{x}^{3}}\right) - \frac{0.125}{{x}^{2}}\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  10. Final simplification98.7%

    \[\leadsto {\left(x + 1\right)}^{-0.5} \cdot \left(\left(\frac{0.0625}{{x}^{3}} + \frac{0.5}{x}\right) - \frac{0.125}{{x}^{2}}\right) \]
  11. Add Preprocessing

Alternative 3: 98.7% accurate, 1.0× speedup?

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

\\
\frac{\frac{0.125 \cdot {x}^{-2} + \frac{-0.5}{x}}{\sqrt{x + 1}}}{-1}
\end{array}
Derivation
  1. Initial program 40.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\frac{0.5}{x} - \frac{0.125}{{x}^{2}}\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  10. Step-by-step derivation
    1. /-rgt-identity98.3%

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

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

    \[\leadsto \color{blue}{\frac{-\frac{\frac{0.5}{x} + -0.125 \cdot {x}^{-2}}{\mathsf{hypot}\left(1, \sqrt{x}\right)}}{-1}} \]
  12. Step-by-step derivation
    1. distribute-neg-frac98.3%

      \[\leadsto \frac{\color{blue}{\frac{-\left(\frac{0.5}{x} + -0.125 \cdot {x}^{-2}\right)}{\mathsf{hypot}\left(1, \sqrt{x}\right)}}}{-1} \]
    2. +-commutative98.3%

      \[\leadsto \frac{\frac{-\color{blue}{\left(-0.125 \cdot {x}^{-2} + \frac{0.5}{x}\right)}}{\mathsf{hypot}\left(1, \sqrt{x}\right)}}{-1} \]
    3. distribute-neg-in98.3%

      \[\leadsto \frac{\frac{\color{blue}{\left(--0.125 \cdot {x}^{-2}\right) + \left(-\frac{0.5}{x}\right)}}{\mathsf{hypot}\left(1, \sqrt{x}\right)}}{-1} \]
    4. distribute-lft-neg-in98.3%

      \[\leadsto \frac{\frac{\color{blue}{\left(--0.125\right) \cdot {x}^{-2}} + \left(-\frac{0.5}{x}\right)}{\mathsf{hypot}\left(1, \sqrt{x}\right)}}{-1} \]
    5. metadata-eval98.3%

      \[\leadsto \frac{\frac{\color{blue}{0.125} \cdot {x}^{-2} + \left(-\frac{0.5}{x}\right)}{\mathsf{hypot}\left(1, \sqrt{x}\right)}}{-1} \]
    6. distribute-neg-frac98.3%

      \[\leadsto \frac{\frac{0.125 \cdot {x}^{-2} + \color{blue}{\frac{-0.5}{x}}}{\mathsf{hypot}\left(1, \sqrt{x}\right)}}{-1} \]
    7. metadata-eval98.3%

      \[\leadsto \frac{\frac{0.125 \cdot {x}^{-2} + \frac{\color{blue}{-0.5}}{x}}{\mathsf{hypot}\left(1, \sqrt{x}\right)}}{-1} \]
    8. hypot-undefine98.2%

      \[\leadsto \frac{\frac{0.125 \cdot {x}^{-2} + \frac{-0.5}{x}}{\color{blue}{\sqrt{1 \cdot 1 + \sqrt{x} \cdot \sqrt{x}}}}}{-1} \]
    9. metadata-eval98.2%

      \[\leadsto \frac{\frac{0.125 \cdot {x}^{-2} + \frac{-0.5}{x}}{\sqrt{\color{blue}{1} + \sqrt{x} \cdot \sqrt{x}}}}{-1} \]
    10. rem-square-sqrt98.2%

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

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

    \[\leadsto \color{blue}{\frac{\frac{0.125 \cdot {x}^{-2} + \frac{-0.5}{x}}{\sqrt{x + 1}}}{-1}} \]
  14. Final simplification98.2%

    \[\leadsto \frac{\frac{0.125 \cdot {x}^{-2} + \frac{-0.5}{x}}{\sqrt{x + 1}}}{-1} \]
  15. Add Preprocessing

Alternative 4: 98.7% accurate, 1.0× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\frac{0.5}{x} - \frac{0.125}{{x}^{2}}\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  10. Final simplification98.3%

    \[\leadsto {\left(x + 1\right)}^{-0.5} \cdot \left(\frac{0.5}{x} - \frac{0.125}{{x}^{2}}\right) \]
  11. Add Preprocessing

Alternative 5: 37.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{0.5}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{-0.0390625}{{x}^{4}}\\


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

    1. Initial program 11.8%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-sub11.8%

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

        \[\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-identity11.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.5}{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    8. Taylor expanded in x around 0 8.7%

      \[\leadsto \color{blue}{\frac{0.5}{x}} \]

    if 6.49999999999999972e153 < x

    1. Initial program 71.0%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-sub71.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
      2. div-inv71.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-identity71.0%

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

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

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

        \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
      7. frac-times71.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. associate-*l/71.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(0.0625 \cdot \frac{1}{{x}^{3}} + 0.5 \cdot \frac{1}{x}\right) - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    8. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(0.0625 \cdot \frac{1}{{x}^{3}} + \left(0.5 \cdot \frac{1}{x} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
      2. associate-*r/99.9%

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

        \[\leadsto \left(\frac{\color{blue}{0.0625}}{{x}^{3}} + \left(0.5 \cdot \frac{1}{x} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
      4. associate-*r/99.9%

        \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\color{blue}{\frac{0.5 \cdot 1}{x}} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
      5. metadata-eval99.9%

        \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{\color{blue}{0.5}}{x} - \left(0.0390625 \cdot \frac{1}{{x}^{4}} + 0.125 \cdot \frac{1}{{x}^{2}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
      6. +-commutative99.9%

        \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \color{blue}{\left(0.125 \cdot \frac{1}{{x}^{2}} + 0.0390625 \cdot \frac{1}{{x}^{4}}\right)}\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
      7. associate-*r/99.9%

        \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\color{blue}{\frac{0.125 \cdot 1}{{x}^{2}}} + 0.0390625 \cdot \frac{1}{{x}^{4}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
      8. metadata-eval99.9%

        \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{\color{blue}{0.125}}{{x}^{2}} + 0.0390625 \cdot \frac{1}{{x}^{4}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
      9. associate-*r/99.9%

        \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{0.125}{{x}^{2}} + \color{blue}{\frac{0.0390625 \cdot 1}{{x}^{4}}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
      10. metadata-eval99.9%

        \[\leadsto \left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{0.125}{{x}^{2}} + \frac{\color{blue}{0.0390625}}{{x}^{4}}\right)\right)\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    9. Simplified99.9%

      \[\leadsto \color{blue}{\left(\frac{0.0625}{{x}^{3}} + \left(\frac{0.5}{x} - \left(\frac{0.125}{{x}^{2}} + \frac{0.0390625}{{x}^{4}}\right)\right)\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    10. Taylor expanded in x around 0 71.0%

      \[\leadsto \color{blue}{\frac{-0.0390625}{{x}^{4}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 6.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{0.5}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.0390625}{{x}^{4}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 97.8% accurate, 1.9× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-0.5 \cdot {\left(x + 1\right)}^{-0.5}}{\left(-x\right) \cdot 1}} \]
  10. Step-by-step derivation
    1. times-frac97.1%

      \[\leadsto \color{blue}{\frac{-0.5}{-x} \cdot \frac{{\left(x + 1\right)}^{-0.5}}{1}} \]
    2. neg-mul-197.1%

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

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

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

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

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

    \[\leadsto \frac{0.5}{x} \cdot {\left(x + 1\right)}^{-0.5} \]
  13. Add Preprocessing

Alternative 7: 97.9% accurate, 1.9× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{{\left(x + 1\right)}^{-0.5}}{x \cdot 2} \]
  11. Add Preprocessing

Alternative 8: 96.6% accurate, 2.0× speedup?

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

\\
\frac{0.5}{x \cdot \sqrt{x + 1}}
\end{array}
Derivation
  1. Initial program 40.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-0.5 \cdot {\left(x + 1\right)}^{-0.5}}{\left(-x\right) \cdot 1}} \]
  10. Step-by-step derivation
    1. *-rgt-identity97.2%

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

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

    \[\leadsto \color{blue}{\frac{-0.5}{\frac{-x}{{\left(x + 1\right)}^{-0.5}}}} \]
  12. Step-by-step derivation
    1. *-un-lft-identity96.9%

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

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

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

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

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

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

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

      \[\leadsto 1 \cdot \color{blue}{\frac{\frac{0.5}{x}}{\sqrt{x + 1}}} \]
  13. Applied egg-rr97.0%

    \[\leadsto \color{blue}{1 \cdot \frac{\frac{0.5}{x}}{\sqrt{x + 1}}} \]
  14. Step-by-step derivation
    1. *-lft-identity97.0%

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

      \[\leadsto \color{blue}{\frac{0.5}{x \cdot \sqrt{x + 1}}} \]
  15. Simplified96.8%

    \[\leadsto \color{blue}{\frac{0.5}{x \cdot \sqrt{x + 1}}} \]
  16. Final simplification96.8%

    \[\leadsto \frac{0.5}{x \cdot \sqrt{x + 1}} \]
  17. Add Preprocessing

Alternative 9: 97.8% accurate, 2.0× speedup?

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

\\
\frac{\frac{0.5}{x}}{\sqrt{x + 1}}
\end{array}
Derivation
  1. Initial program 40.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{x} \cdot \frac{1}{{\left(1 + x\right)}^{\color{blue}{0.5}}} \]
    4. pow1/297.0%

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

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

      \[\leadsto \frac{\color{blue}{0.5}}{x \cdot \sqrt{1 + x}} \]
    7. add-sqr-sqrt96.8%

      \[\leadsto \frac{0.5}{x \cdot \sqrt{1 + \color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
    8. hypot-1-def96.8%

      \[\leadsto \frac{0.5}{x \cdot \color{blue}{\mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
  9. Applied egg-rr96.8%

    \[\leadsto \color{blue}{\frac{0.5}{x \cdot \mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
  10. Step-by-step derivation
    1. associate-/r*97.0%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{x}}{\mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
    2. hypot-undefine97.0%

      \[\leadsto \frac{\frac{0.5}{x}}{\color{blue}{\sqrt{1 \cdot 1 + \sqrt{x} \cdot \sqrt{x}}}} \]
    3. metadata-eval97.0%

      \[\leadsto \frac{\frac{0.5}{x}}{\sqrt{\color{blue}{1} + \sqrt{x} \cdot \sqrt{x}}} \]
    4. rem-square-sqrt97.0%

      \[\leadsto \frac{\frac{0.5}{x}}{\sqrt{1 + \color{blue}{x}}} \]
    5. +-commutative97.0%

      \[\leadsto \frac{\frac{0.5}{x}}{\sqrt{\color{blue}{x + 1}}} \]
  11. Simplified97.0%

    \[\leadsto \color{blue}{\frac{\frac{0.5}{x}}{\sqrt{x + 1}}} \]
  12. Final simplification97.0%

    \[\leadsto \frac{\frac{0.5}{x}}{\sqrt{x + 1}} \]
  13. Add Preprocessing

Alternative 10: 36.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{0.0625}{{x}^{3}} \end{array} \]
(FPCore (x) :precision binary64 (/ 0.0625 (pow x 3.0)))
double code(double x) {
	return 0.0625 / pow(x, 3.0);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 0.0625d0 / (x ** 3.0d0)
end function
public static double code(double x) {
	return 0.0625 / Math.pow(x, 3.0);
}
def code(x):
	return 0.0625 / math.pow(x, 3.0)
function code(x)
	return Float64(0.0625 / (x ^ 3.0))
end
function tmp = code(x)
	tmp = 0.0625 / (x ^ 3.0);
end
code[x_] := N[(0.0625 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{0.0625}{{x}^{3}}
\end{array}
Derivation
  1. Initial program 40.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\color{blue}{\frac{0.5 \cdot 1}{x}} + 0.0625 \cdot \frac{1}{{x}^{3}}\right) - 0.125 \cdot \frac{1}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    3. metadata-eval98.7%

      \[\leadsto \left(\left(\frac{\color{blue}{0.5}}{x} + 0.0625 \cdot \frac{1}{{x}^{3}}\right) - 0.125 \cdot \frac{1}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    4. associate-*r/98.7%

      \[\leadsto \left(\left(\frac{0.5}{x} + \color{blue}{\frac{0.0625 \cdot 1}{{x}^{3}}}\right) - 0.125 \cdot \frac{1}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    5. metadata-eval98.7%

      \[\leadsto \left(\left(\frac{0.5}{x} + \frac{\color{blue}{0.0625}}{{x}^{3}}\right) - 0.125 \cdot \frac{1}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    6. associate-*r/98.7%

      \[\leadsto \left(\left(\frac{0.5}{x} + \frac{0.0625}{{x}^{3}}\right) - \color{blue}{\frac{0.125 \cdot 1}{{x}^{2}}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
    7. metadata-eval98.7%

      \[\leadsto \left(\left(\frac{0.5}{x} + \frac{0.0625}{{x}^{3}}\right) - \frac{\color{blue}{0.125}}{{x}^{2}}\right) \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  9. Simplified98.7%

    \[\leadsto \color{blue}{\left(\left(\frac{0.5}{x} + \frac{0.0625}{{x}^{3}}\right) - \frac{0.125}{{x}^{2}}\right)} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  10. Taylor expanded in x around 0 38.2%

    \[\leadsto \color{blue}{\frac{0.0625}{{x}^{3}}} \]
  11. Final simplification38.2%

    \[\leadsto \frac{0.0625}{{x}^{3}} \]
  12. Add Preprocessing

Alternative 11: 7.9% accurate, 69.7× speedup?

\[\begin{array}{l} \\ \frac{0.5}{x} \end{array} \]
(FPCore (x) :precision binary64 (/ 0.5 x))
double code(double x) {
	return 0.5 / x;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 0.5d0 / x
end function
public static double code(double x) {
	return 0.5 / x;
}
def code(x):
	return 0.5 / x
function code(x)
	return Float64(0.5 / x)
end
function tmp = code(x)
	tmp = 0.5 / x;
end
code[x_] := N[(0.5 / x), $MachinePrecision]
\begin{array}{l}

\\
\frac{0.5}{x}
\end{array}
Derivation
  1. Initial program 40.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. frac-sub40.9%

      \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]
    2. div-inv40.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-identity40.9%

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    7. frac-times40.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. associate-*l/41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.5}{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1} \]
  8. Taylor expanded in x around 0 7.9%

    \[\leadsto \color{blue}{\frac{0.5}{x}} \]
  9. Final simplification7.9%

    \[\leadsto \frac{0.5}{x} \]
  10. Add Preprocessing

Alternative 12: 2.5% 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 40.9%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 2.5%

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

    \[\leadsto \color{blue}{-1} \]
  5. Final simplification2.5%

    \[\leadsto -1 \]
  6. Add Preprocessing

Developer target: 98.4% 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 2024044 
(FPCore (x)
  :name "2isqrt (example 3.6)"
  :precision binary64
  :pre (and (> x 1.0) (< x 1e+308))

  :herbie-target
  (/ 1.0 (+ (* (+ x 1.0) (sqrt x)) (* x (sqrt (+ x 1.0)))))

  (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))