2isqrt (example 3.6)

Percentage Accurate: 38.9% → 99.7%
Time: 20.9s
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.9% 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.7% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\sqrt{\frac{1 + x}{x}} + \left(--1\right)}} \cdot {\left(1 + x\right)}^{-0.5} \]
    14. *-rgt-identity99.6%

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\sqrt{\frac{1 + x}{x}} \cdot 1 + \color{blue}{1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    16. distribute-lft1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\left(\sqrt{\frac{1 + x}{x}} + 1\right) \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    17. distribute-rgt1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{1 + \sqrt{\frac{1 + x}{x}} \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    18. *-rgt-identity99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{1 + \color{blue}{\sqrt{\frac{1 + x}{x}}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    19. *-rgt-identity99.6%

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

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

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

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

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

    \[\leadsto \color{blue}{{\left({\left(1 + x\right)}^{-0.5} \cdot \frac{1}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}\right)}^{1}} \]
  13. Step-by-step derivation
    1. unpow199.6%

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

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

      \[\leadsto \frac{\color{blue}{{\left(1 + x\right)}^{-0.5}}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)} \]
  14. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\left(1 + x\right)}^{-0.5}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}} \]
  15. Step-by-step derivation
    1. distribute-rgt-in99.7%

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

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

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

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

Alternative 2: 99.7% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\sqrt{\frac{1 + x}{x}} + \left(--1\right)}} \cdot {\left(1 + x\right)}^{-0.5} \]
    14. *-rgt-identity99.6%

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\sqrt{\frac{1 + x}{x}} \cdot 1 + \color{blue}{1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    16. distribute-lft1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\left(\sqrt{\frac{1 + x}{x}} + 1\right) \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    17. distribute-rgt1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{1 + \sqrt{\frac{1 + x}{x}} \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    18. *-rgt-identity99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{1 + \color{blue}{\sqrt{\frac{1 + x}{x}}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    19. *-rgt-identity99.6%

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

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

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

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

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

    \[\leadsto \color{blue}{{\left({\left(1 + x\right)}^{-0.5} \cdot \frac{1}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}\right)}^{1}} \]
  13. Step-by-step derivation
    1. unpow199.6%

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

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

      \[\leadsto \frac{\color{blue}{{\left(1 + x\right)}^{-0.5}}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)} \]
  14. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\left(1 + x\right)}^{-0.5}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}} \]
  15. Add Preprocessing

Alternative 3: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\sqrt{\frac{1 + x}{x}} + \left(--1\right)}} \cdot {\left(1 + x\right)}^{-0.5} \]
    14. *-rgt-identity99.6%

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\sqrt{\frac{1 + x}{x}} \cdot 1 + \color{blue}{1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    16. distribute-lft1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\left(\sqrt{\frac{1 + x}{x}} + 1\right) \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    17. distribute-rgt1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{1 + \sqrt{\frac{1 + x}{x}} \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    18. *-rgt-identity99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{1 + \color{blue}{\sqrt{\frac{1 + x}{x}}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    19. *-rgt-identity99.6%

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

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

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

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

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

    \[\leadsto \color{blue}{{\left({\left(1 + x\right)}^{-0.5} \cdot \frac{1}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}\right)}^{1}} \]
  13. Step-by-step derivation
    1. unpow199.6%

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

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

      \[\leadsto \frac{\color{blue}{{\left(1 + x\right)}^{-0.5}}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)} \]
  14. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\left(1 + x\right)}^{-0.5}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}} \]
  15. Step-by-step derivation
    1. hypot-undefine99.7%

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

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

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

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 1.7× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\sqrt{\frac{1 + x}{x}} + \left(--1\right)}} \cdot {\left(1 + x\right)}^{-0.5} \]
    14. *-rgt-identity99.6%

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\sqrt{\frac{1 + x}{x}} \cdot 1 + \color{blue}{1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    16. distribute-lft1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\left(\sqrt{\frac{1 + x}{x}} + 1\right) \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    17. distribute-rgt1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{1 + \sqrt{\frac{1 + x}{x}} \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    18. *-rgt-identity99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{1 + \color{blue}{\sqrt{\frac{1 + x}{x}}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    19. *-rgt-identity99.6%

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

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

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

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

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

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

Alternative 5: 99.0% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\sqrt{\frac{1 + x}{x}} + \left(--1\right)}} \cdot {\left(1 + x\right)}^{-0.5} \]
    14. *-rgt-identity99.6%

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\sqrt{\frac{1 + x}{x}} \cdot 1 + \color{blue}{1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    16. distribute-lft1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\left(\sqrt{\frac{1 + x}{x}} + 1\right) \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    17. distribute-rgt1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{1 + \sqrt{\frac{1 + x}{x}} \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    18. *-rgt-identity99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{1 + \color{blue}{\sqrt{\frac{1 + x}{x}}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    19. *-rgt-identity99.6%

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

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

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

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

    \[\leadsto \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{0.0625 \cdot \frac{1}{x} - 0.125}{x} - 0.5}{x}\right)} \cdot {\left(1 + x\right)}^{-0.5} \]
  12. Step-by-step derivation
    1. mul-1-neg99.1%

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

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

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

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

Alternative 6: 98.7% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\sqrt{\frac{1 + x}{x}} + \left(--1\right)}} \cdot {\left(1 + x\right)}^{-0.5} \]
    14. *-rgt-identity99.6%

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\sqrt{\frac{1 + x}{x}} \cdot 1 + \color{blue}{1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    16. distribute-lft1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\left(\sqrt{\frac{1 + x}{x}} + 1\right) \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    17. distribute-rgt1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{1 + \sqrt{\frac{1 + x}{x}} \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    18. *-rgt-identity99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{1 + \color{blue}{\sqrt{\frac{1 + x}{x}}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    19. *-rgt-identity99.6%

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

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

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

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

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

    \[\leadsto \color{blue}{{\left({\left(1 + x\right)}^{-0.5} \cdot \frac{1}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}\right)}^{1}} \]
  13. Step-by-step derivation
    1. unpow199.6%

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

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

      \[\leadsto \frac{\color{blue}{{\left(1 + x\right)}^{-0.5}}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)} \]
  14. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\left(1 + x\right)}^{-0.5}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}} \]
  15. Taylor expanded in x around inf 99.0%

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

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

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

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

Alternative 7: 98.7% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\sqrt{\frac{1 + x}{x}} + \left(--1\right)}} \cdot {\left(1 + x\right)}^{-0.5} \]
    14. *-rgt-identity99.6%

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\sqrt{\frac{1 + x}{x}} \cdot 1 + \color{blue}{1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    16. distribute-lft1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\left(\sqrt{\frac{1 + x}{x}} + 1\right) \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    17. distribute-rgt1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{1 + \sqrt{\frac{1 + x}{x}} \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    18. *-rgt-identity99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{1 + \color{blue}{\sqrt{\frac{1 + x}{x}}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    19. *-rgt-identity99.6%

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

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

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

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

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

    \[\leadsto \color{blue}{{\left({\left(1 + x\right)}^{-0.5} \cdot \frac{1}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}\right)}^{1}} \]
  13. Step-by-step derivation
    1. unpow199.6%

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

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

      \[\leadsto \frac{\color{blue}{{\left(1 + x\right)}^{-0.5}}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)} \]
  14. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\left(1 + x\right)}^{-0.5}}{x \cdot \left(1 + \mathsf{hypot}\left(1, {x}^{-0.5}\right)\right)}} \]
  15. Taylor expanded in x around inf 99.0%

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

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

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

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

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

Alternative 8: 98.7% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 98.6% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

Alternative 10: 97.8% accurate, 2.0× speedup?

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

\\
0.5 \cdot {x}^{-1.5}
\end{array}
Derivation
  1. Initial program 30.0%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{\color{blue}{{\left(\sqrt{x + 1}\right)}^{-1}}}{\sqrt{x}} \]
    11. sqrt-pow230.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. +-commutative30.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-eval30.0%

      \[\leadsto \left(\sqrt{1 + x} - \sqrt{x}\right) \cdot \frac{{\left(1 + x\right)}^{\color{blue}{-0.5}}}{\sqrt{x}} \]
  4. Applied egg-rr30.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/30.0%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{1 + x} - \sqrt{x}\right) \cdot {\left(1 + x\right)}^{-0.5}}{\sqrt{x}}} \]
    2. *-rgt-identity30.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-frac30.0%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x}} \cdot \frac{{\left(1 + x\right)}^{-0.5}}{1}} \]
    4. div-sub30.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-neg30.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. *-inverses30.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-eval30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\sqrt{\frac{1 + x}{x}} + \left(--1\right)}} \cdot {\left(1 + x\right)}^{-0.5} \]
    14. *-rgt-identity99.6%

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

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\sqrt{\frac{1 + x}{x}} \cdot 1 + \color{blue}{1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    16. distribute-lft1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{\left(\sqrt{\frac{1 + x}{x}} + 1\right) \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    17. distribute-rgt1-in99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{\color{blue}{1 + \sqrt{\frac{1 + x}{x}} \cdot 1}} \cdot {\left(1 + x\right)}^{-0.5} \]
    18. *-rgt-identity99.6%

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x}\right)\right)}{1 + \color{blue}{\sqrt{\frac{1 + x}{x}}}} \cdot {\left(1 + x\right)}^{-0.5} \]
    19. *-rgt-identity99.6%

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

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

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

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

    \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}} \]
  12. Step-by-step derivation
    1. *-commutative61.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{{x}^{3}}} \cdot 0.5} \]
  13. Simplified61.4%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{{x}^{3}}} \cdot 0.5} \]
  14. Step-by-step derivation
    1. *-un-lft-identity61.4%

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

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

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

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

      \[\leadsto \left(1 \cdot {x}^{\color{blue}{-1.5}}\right) \cdot 0.5 \]
  15. Applied egg-rr98.1%

    \[\leadsto \color{blue}{\left(1 \cdot {x}^{-1.5}\right)} \cdot 0.5 \]
  16. Step-by-step derivation
    1. *-lft-identity98.1%

      \[\leadsto \color{blue}{{x}^{-1.5}} \cdot 0.5 \]
  17. Simplified98.1%

    \[\leadsto \color{blue}{{x}^{-1.5}} \cdot 0.5 \]
  18. Final simplification98.1%

    \[\leadsto 0.5 \cdot {x}^{-1.5} \]
  19. Add Preprocessing

Alternative 11: 37.8% accurate, 17.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 9.3%

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

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

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

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

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

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

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

        \[\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/9.4%

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

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

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

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

        \[\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-eval9.4%

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

      \[\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/9.4%

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

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

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

        \[\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-neg9.3%

        \[\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. *-inverses9.3%

        \[\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-eval9.3%

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

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

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

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

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

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

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

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

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

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

    if 6.3000000000000001e153 < x

    1. Initial program 53.0%

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

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{\log \left(\frac{1}{\sqrt{x + 1}}\right)}} \]
      2. log-rec5.1%

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
    5. Taylor expanded in x around inf 5.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} - e^{--0.5 \cdot \log \left(\frac{1}{x}\right)}} \]
    6. Step-by-step derivation
      1. distribute-lft-neg-in5.1%

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

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

        \[\leadsto \sqrt{\frac{1}{x}} - e^{\color{blue}{\log \left(\frac{1}{x}\right) \cdot 0.5}} \]
      4. exp-to-pow53.0%

        \[\leadsto \sqrt{\frac{1}{x}} - \color{blue}{{\left(\frac{1}{x}\right)}^{0.5}} \]
      5. unpow1/253.0%

        \[\leadsto \sqrt{\frac{1}{x}} - \color{blue}{\sqrt{\frac{1}{x}}} \]
      6. +-inverses53.0%

        \[\leadsto \color{blue}{0} \]
    7. Simplified53.0%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification29.5%

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

Alternative 12: 35.7% accurate, 209.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (x) :precision binary64 0.0)
double code(double x) {
	return 0.0;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 0.0d0
end function
public static double code(double x) {
	return 0.0;
}
def code(x):
	return 0.0
function code(x)
	return 0.0
end
function tmp = code(x)
	tmp = 0.0;
end
code[x_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 30.0%

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{\log \left(\frac{1}{\sqrt{x + 1}}\right)}} \]
    2. log-rec7.4%

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
  5. Taylor expanded in x around inf 4.9%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} - e^{--0.5 \cdot \log \left(\frac{1}{x}\right)}} \]
  6. Step-by-step derivation
    1. distribute-lft-neg-in4.9%

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

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

      \[\leadsto \sqrt{\frac{1}{x}} - e^{\color{blue}{\log \left(\frac{1}{x}\right) \cdot 0.5}} \]
    4. exp-to-pow27.3%

      \[\leadsto \sqrt{\frac{1}{x}} - \color{blue}{{\left(\frac{1}{x}\right)}^{0.5}} \]
    5. unpow1/227.3%

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

      \[\leadsto \color{blue}{0} \]
  7. Simplified27.3%

    \[\leadsto \color{blue}{0} \]
  8. Add Preprocessing

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

  :alt
  (! :herbie-platform default (/ 1 (+ (* (+ x 1) (sqrt x)) (* x (sqrt (+ x 1))))))

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