2isqrt (example 3.6)

Percentage Accurate: 38.7% → 99.6%
Time: 9.4s
Alternatives: 9
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 9 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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-+38.8%

      \[\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. sqrt-undiv38.9%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1 + x}{x} - 1}{\sqrt{\frac{1 + x}{x}} - -1}} \cdot {\left(1 + x\right)}^{-0.5} \]
  9. Step-by-step derivation
    1. *-rgt-identity39.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} \]
    2. associate-*r/32.4%

      \[\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} \]
    3. *-commutative32.4%

      \[\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} \]
    4. distribute-rgt-in32.3%

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

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

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

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

      \[\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} \]
    9. log1p-undefine38.9%

      \[\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} \]
    10. expm1-define99.7%

      \[\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} \]
    11. sub-neg99.7%

      \[\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} \]
    12. *-lft-identity99.7%

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

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

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

      \[\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} \]
    16. distribute-rgt1-in99.7%

      \[\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} \]
    17. *-rgt-identity99.7%

      \[\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} \]
    18. *-rgt-identity99.7%

      \[\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} \]
    19. associate-*r/99.7%

      \[\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} \]
    20. *-commutative99.7%

      \[\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} \]
    21. distribute-rgt-in99.7%

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

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

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

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

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

Alternative 2: 99.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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-+38.8%

      \[\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. sqrt-undiv38.9%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1 + x}{x} - 1}{\sqrt{\frac{1 + x}{x}} - -1}} \cdot {\left(1 + x\right)}^{-0.5} \]
  9. Step-by-step derivation
    1. *-rgt-identity39.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} \]
    2. associate-*r/32.4%

      \[\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} \]
    3. *-commutative32.4%

      \[\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} \]
    4. distribute-rgt-in32.3%

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

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

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

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

      \[\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} \]
    9. log1p-undefine38.9%

      \[\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} \]
    10. expm1-define99.7%

      \[\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} \]
    11. sub-neg99.7%

      \[\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} \]
    12. *-lft-identity99.7%

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

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

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

      \[\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} \]
    16. distribute-rgt1-in99.7%

      \[\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} \]
    17. *-rgt-identity99.7%

      \[\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} \]
    18. *-rgt-identity99.7%

      \[\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} \]
    19. associate-*r/99.7%

      \[\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} \]
    20. *-commutative99.7%

      \[\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} \]
    21. distribute-rgt-in99.7%

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

    \[\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 0 99.7%

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

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

Alternative 3: 99.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ {\left(1 + x\right)}^{-0.5} \cdot \frac{\frac{\frac{0.0625 + 0.0390625 \cdot \frac{-1}{x}}{x} - 0.125}{x} + 0.5}{x} \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (pow (+ 1.0 x) -0.5)
  (/ (+ (/ (- (/ (+ 0.0625 (* 0.0390625 (/ -1.0 x))) x) 0.125) x) 0.5) x)))
double code(double x) {
	return pow((1.0 + x), -0.5) * ((((((0.0625 + (0.0390625 * (-1.0 / x))) / 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 + (0.0390625d0 * ((-1.0d0) / x))) / 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 + (0.0390625 * (-1.0 / x))) / x) - 0.125) / x) + 0.5) / x);
}
def code(x):
	return math.pow((1.0 + x), -0.5) * ((((((0.0625 + (0.0390625 * (-1.0 / x))) / 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(0.0390625 * Float64(-1.0 / x))) / x) - 0.125) / x) + 0.5) / x))
end
function tmp = code(x)
	tmp = ((1.0 + x) ^ -0.5) * ((((((0.0625 + (0.0390625 * (-1.0 / x))) / 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[(0.0390625 * N[(-1.0 / x), $MachinePrecision]), $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 + 0.0390625 \cdot \frac{-1}{x}}{x} - 0.125}{x} + 0.5}{x}
\end{array}
Derivation
  1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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-+38.8%

      \[\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. sqrt-undiv38.9%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1 + x}{x} - 1}{\sqrt{\frac{1 + x}{x}} - -1}} \cdot {\left(1 + x\right)}^{-0.5} \]
  9. Step-by-step derivation
    1. *-rgt-identity39.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} \]
    2. associate-*r/32.4%

      \[\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} \]
    3. *-commutative32.4%

      \[\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} \]
    4. distribute-rgt-in32.3%

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

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

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

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

      \[\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} \]
    9. log1p-undefine38.9%

      \[\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} \]
    10. expm1-define99.7%

      \[\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} \]
    11. sub-neg99.7%

      \[\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} \]
    12. *-lft-identity99.7%

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

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

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

      \[\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} \]
    16. distribute-rgt1-in99.7%

      \[\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} \]
    17. *-rgt-identity99.7%

      \[\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} \]
    18. *-rgt-identity99.7%

      \[\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} \]
    19. associate-*r/99.7%

      \[\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} \]
    20. *-commutative99.7%

      \[\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} \]
    21. distribute-rgt-in99.7%

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

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

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

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

Alternative 4: 99.2% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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{\left(0.5 + \frac{0.0625}{{x}^{2}}\right) - 0.125 \cdot \frac{1}{x}}{x}} \cdot {\left(1 + x\right)}^{-0.5} \]
  8. Step-by-step derivation
    1. associate--l+98.9%

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

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

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

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

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

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

      \[\leadsto e^{\color{blue}{\log \left({\left(1 + x\right)}^{-0.5}\right) + \log \left(\frac{0.5 + \left(\frac{0.0625}{{x}^{2}} - \frac{0.125}{x}\right)}{x}\right)}} \]
    4. log-pow92.9%

      \[\leadsto e^{\color{blue}{-0.5 \cdot \log \left(1 + x\right)} + \log \left(\frac{0.5 + \left(\frac{0.0625}{{x}^{2}} - \frac{0.125}{x}\right)}{x}\right)} \]
    5. log1p-define92.9%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(x\right)} + \log \left(\frac{0.5 + \left(\frac{0.0625}{{x}^{2}} - \frac{0.125}{x}\right)}{x}\right)} \]
    6. associate-+r-92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\color{blue}{\left(0.5 + \frac{0.0625}{{x}^{2}}\right) - \frac{0.125}{x}}}{x}\right)} \]
    7. add-sqr-sqrt92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + \color{blue}{\sqrt{\frac{0.0625}{{x}^{2}}} \cdot \sqrt{\frac{0.0625}{{x}^{2}}}}\right) - \frac{0.125}{x}}{x}\right)} \]
    8. pow292.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + \color{blue}{{\left(\sqrt{\frac{0.0625}{{x}^{2}}}\right)}^{2}}\right) - \frac{0.125}{x}}{x}\right)} \]
    9. sqrt-div92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\color{blue}{\left(\frac{\sqrt{0.0625}}{\sqrt{{x}^{2}}}\right)}}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    10. metadata-eval92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{\color{blue}{0.25}}{\sqrt{{x}^{2}}}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    11. sqrt-pow192.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{0.25}{\color{blue}{{x}^{\left(\frac{2}{2}\right)}}}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    12. metadata-eval92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{0.25}{{x}^{\color{blue}{1}}}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    13. pow192.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{0.25}{\color{blue}{x}}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
  11. Applied egg-rr92.9%

    \[\leadsto \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)}} \]
  12. Step-by-step derivation
    1. exp-sum93.4%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)} \cdot e^{\log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)}} \]
    2. *-commutative93.4%

      \[\leadsto e^{\color{blue}{\mathsf{log1p}\left(x\right) \cdot -0.5}} \cdot e^{\log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    3. log1p-undefine93.4%

      \[\leadsto e^{\color{blue}{\log \left(1 + x\right)} \cdot -0.5} \cdot e^{\log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    4. exp-to-pow93.8%

      \[\leadsto \color{blue}{{\left(1 + x\right)}^{-0.5}} \cdot e^{\log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    5. rem-exp-log98.9%

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

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

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

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

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

Alternative 5: 99.2% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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{\left(0.5 + \frac{0.0625}{{x}^{2}}\right) - 0.125 \cdot \frac{1}{x}}{x}} \cdot {\left(1 + x\right)}^{-0.5} \]
  8. Step-by-step derivation
    1. associate--l+98.9%

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

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

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

    \[\leadsto \color{blue}{\frac{0.5 + \left(\frac{0.0625}{{x}^{2}} - \frac{0.125}{x}\right)}{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 + \left(\frac{0.0625}{{x}^{2}} - \frac{0.125}{x}\right)\right) \cdot {\left(1 + x\right)}^{-0.5}}{x}} \]
    2. associate-+r-99.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 98.8% 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 38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 98.1% 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 38.8%

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

      \[\leadsto \color{blue}{\frac{-1}{-\sqrt{x}}} - \frac{1}{\sqrt{x + 1}} \]
    2. metadata-eval38.8%

      \[\leadsto \frac{\color{blue}{-1}}{-\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    3. div-inv38.8%

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

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

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

      \[\leadsto -1 \cdot \frac{1}{-\sqrt{x}} - \color{blue}{-1 \cdot \frac{1}{-\sqrt{x + 1}}} \]
    7. distribute-neg-frac238.8%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left({\left(1 + x\right)}^{-0.5}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right) + \color{blue}{\left(-1 \cdot \frac{1}{-\sqrt{x}} + \left(-\frac{-1}{\sqrt{1 + x}} \cdot -1\right)\right)} \]
    3. mul-1-neg30.0%

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

      \[\leadsto \mathsf{fma}\left({\left(1 + x\right)}^{-0.5}, -1, \frac{-1}{\sqrt{1 + x}} \cdot -1\right) + \color{blue}{\left(-\left(\frac{1}{-\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \cdot -1\right)\right)} \]
    5. unsub-neg30.0%

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{{x}^{3}}} \cdot 0.5} \]
  9. Simplified63.6%

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

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

      \[\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 \]
  11. Applied egg-rr98.1%

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

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

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

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

Alternative 8: 7.9% accurate, 19.0× speedup?

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

\\
\frac{0.5 + \frac{\frac{0.0625}{x} + -0.125}{x}}{x}
\end{array}
Derivation
  1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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{\left(0.5 + \frac{0.0625}{{x}^{2}}\right) - 0.125 \cdot \frac{1}{x}}{x}} \cdot {\left(1 + x\right)}^{-0.5} \]
  8. Step-by-step derivation
    1. associate--l+98.9%

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

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

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

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

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

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

      \[\leadsto e^{\color{blue}{\log \left({\left(1 + x\right)}^{-0.5}\right) + \log \left(\frac{0.5 + \left(\frac{0.0625}{{x}^{2}} - \frac{0.125}{x}\right)}{x}\right)}} \]
    4. log-pow92.9%

      \[\leadsto e^{\color{blue}{-0.5 \cdot \log \left(1 + x\right)} + \log \left(\frac{0.5 + \left(\frac{0.0625}{{x}^{2}} - \frac{0.125}{x}\right)}{x}\right)} \]
    5. log1p-define92.9%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(x\right)} + \log \left(\frac{0.5 + \left(\frac{0.0625}{{x}^{2}} - \frac{0.125}{x}\right)}{x}\right)} \]
    6. associate-+r-92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\color{blue}{\left(0.5 + \frac{0.0625}{{x}^{2}}\right) - \frac{0.125}{x}}}{x}\right)} \]
    7. add-sqr-sqrt92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + \color{blue}{\sqrt{\frac{0.0625}{{x}^{2}}} \cdot \sqrt{\frac{0.0625}{{x}^{2}}}}\right) - \frac{0.125}{x}}{x}\right)} \]
    8. pow292.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + \color{blue}{{\left(\sqrt{\frac{0.0625}{{x}^{2}}}\right)}^{2}}\right) - \frac{0.125}{x}}{x}\right)} \]
    9. sqrt-div92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\color{blue}{\left(\frac{\sqrt{0.0625}}{\sqrt{{x}^{2}}}\right)}}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    10. metadata-eval92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{\color{blue}{0.25}}{\sqrt{{x}^{2}}}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    11. sqrt-pow192.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{0.25}{\color{blue}{{x}^{\left(\frac{2}{2}\right)}}}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    12. metadata-eval92.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{0.25}{{x}^{\color{blue}{1}}}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    13. pow192.9%

      \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{0.25}{\color{blue}{x}}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
  11. Applied egg-rr92.9%

    \[\leadsto \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right) + \log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)}} \]
  12. Step-by-step derivation
    1. exp-sum93.4%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)} \cdot e^{\log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)}} \]
    2. *-commutative93.4%

      \[\leadsto e^{\color{blue}{\mathsf{log1p}\left(x\right) \cdot -0.5}} \cdot e^{\log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    3. log1p-undefine93.4%

      \[\leadsto e^{\color{blue}{\log \left(1 + x\right)} \cdot -0.5} \cdot e^{\log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    4. exp-to-pow93.8%

      \[\leadsto \color{blue}{{\left(1 + x\right)}^{-0.5}} \cdot e^{\log \left(\frac{\left(0.5 + {\left(\frac{0.25}{x}\right)}^{2}\right) - \frac{0.125}{x}}{x}\right)} \]
    5. rem-exp-log98.9%

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

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

    \[\leadsto \color{blue}{1} \cdot \frac{0.5 + \frac{\frac{0.0625}{x} + -0.125}{x}}{x} \]
  15. Final simplification7.8%

    \[\leadsto \frac{0.5 + \frac{\frac{0.0625}{x} + -0.125}{x}}{x} \]
  16. Add Preprocessing

Alternative 9: 7.9% accurate, 69.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 97.9%

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

    \[\leadsto \color{blue}{\frac{0.5}{x}} \]
  9. Add Preprocessing

Developer Target 1: 98.5% 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 2024141 
(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)))))