2isqrt (example 3.6)

Percentage Accurate: 38.7% → 99.4%
Time: 11.5s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 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.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{x + 1}\\
\frac{\frac{1}{x + t\_0 \cdot \sqrt{x}}}{t\_0}
\end{array}
\end{array}
Derivation
  1. Initial program 40.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \color{blue}{\frac{\left(1 + x\right) - x}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}}} \]
  9. Step-by-step derivation
    1. associate--l+85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1 + \color{blue}{0}}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} \]
    3. metadata-eval85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1}{\color{blue}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
    5. hypot-undefine85.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  12. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  13. Step-by-step derivation
    1. associate-/l/99.2%

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{x} + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}} \]
  14. Simplified99.4%

    \[\leadsto \color{blue}{\frac{\frac{1}{x + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}}} \]
  15. Final simplification99.4%

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

Alternative 2: 99.0% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \color{blue}{\frac{\left(1 + x\right) - x}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}}} \]
  9. Step-by-step derivation
    1. associate--l+85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1 + \color{blue}{0}}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} \]
    3. metadata-eval85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1}{\color{blue}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
    5. hypot-undefine85.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  12. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  13. Step-by-step derivation
    1. associate-/l/99.2%

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{x} + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}} \]
  14. Simplified99.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.0% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \color{blue}{\frac{\left(1 + x\right) - x}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}}} \]
  9. Step-by-step derivation
    1. associate--l+85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1 + \color{blue}{0}}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} \]
    3. metadata-eval85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1}{\color{blue}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
    5. hypot-undefine85.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  12. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  13. Step-by-step derivation
    1. associate-/l/99.2%

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{x} + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}} \]
  14. Simplified99.4%

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

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

    \[\leadsto \frac{\color{blue}{\frac{-0.5 - \frac{\frac{0.0625}{x} + -0.125}{x}}{-x}}}{\sqrt{1 + x}} \]
  17. Final simplification98.8%

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

Alternative 4: 98.7% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \color{blue}{\frac{\left(1 + x\right) - x}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}}} \]
  9. Step-by-step derivation
    1. associate--l+85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1 + \color{blue}{0}}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} \]
    3. metadata-eval85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1}{\color{blue}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
    5. hypot-undefine85.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  12. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  13. Step-by-step derivation
    1. associate-/l/99.2%

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{x} + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}} \]
  14. Simplified99.4%

    \[\leadsto \color{blue}{\frac{\frac{1}{x + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}}} \]
  15. Taylor expanded in x around inf 98.3%

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

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

      \[\leadsto \frac{\frac{1}{x + x \cdot \left(1 + \frac{\color{blue}{0.5}}{x}\right)}}{\sqrt{1 + x}} \]
  17. Simplified98.3%

    \[\leadsto \frac{\frac{1}{x + \color{blue}{x \cdot \left(1 + \frac{0.5}{x}\right)}}}{\sqrt{1 + x}} \]
  18. Final simplification98.3%

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

Alternative 5: 98.7% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \color{blue}{\frac{\left(1 + x\right) - x}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}}} \]
  9. Step-by-step derivation
    1. associate--l+85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1 + \color{blue}{0}}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} \]
    3. metadata-eval85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1}{\color{blue}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
    5. hypot-undefine85.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  12. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  13. Step-by-step derivation
    1. associate-/l/99.2%

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{x} + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}} \]
  14. Simplified99.4%

    \[\leadsto \color{blue}{\frac{\frac{1}{x + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}}} \]
  15. Taylor expanded in x around inf 98.2%

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

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

      \[\leadsto \frac{\frac{1}{x \cdot \left(2 + \frac{\color{blue}{0.5}}{x}\right)}}{\sqrt{1 + x}} \]
  17. Simplified98.2%

    \[\leadsto \frac{\frac{1}{\color{blue}{x \cdot \left(2 + \frac{0.5}{x}\right)}}}{\sqrt{1 + x}} \]
  18. Final simplification98.2%

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

Alternative 6: 98.6% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \color{blue}{\frac{\left(1 + x\right) - x}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}}} \]
  9. Step-by-step derivation
    1. associate--l+85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1 + \color{blue}{0}}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} \]
    3. metadata-eval85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1}{\color{blue}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
    5. hypot-undefine85.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  12. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  13. Step-by-step derivation
    1. associate-/l/99.2%

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{x} + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}} \]
  14. Simplified99.4%

    \[\leadsto \color{blue}{\frac{\frac{1}{x + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}}} \]
  15. Taylor expanded in x around inf 98.2%

    \[\leadsto \frac{\color{blue}{\frac{0.5 - 0.125 \cdot \frac{1}{x}}{x}}}{\sqrt{1 + x}} \]
  16. Step-by-step derivation
    1. associate-*r/98.2%

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

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

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

    \[\leadsto \frac{\frac{0.5 - \frac{0.125}{x}}{x}}{\sqrt{x + 1}} \]
  19. Add Preprocessing

Alternative 7: 98.5% accurate, 1.9× speedup?

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

\\
\frac{\frac{0.5 - \frac{0.375}{x}}{x}}{\sqrt{x}}
\end{array}
Derivation
  1. Initial program 40.4%

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

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

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

      \[\leadsto \frac{\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}} \]
    4. *-rgt-identity40.5%

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

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x \cdot \left(1 + x\right)}}} \]
  5. Step-by-step derivation
    1. add-cube-cbrt40.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{1 + x}}{\sqrt{1 + x}} - \frac{\sqrt{x}}{\sqrt{1 + x}}}}{\sqrt{x}} \]
    6. *-inverses40.5%

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

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

    \[\leadsto \frac{\color{blue}{\frac{0.5 - 0.375 \cdot \frac{1}{x}}{x}}}{\sqrt{x}} \]
  10. Step-by-step derivation
    1. associate-*r/98.0%

      \[\leadsto \frac{\frac{0.5 - \color{blue}{\frac{0.375 \cdot 1}{x}}}{x}}{\sqrt{x}} \]
    2. metadata-eval98.0%

      \[\leadsto \frac{\frac{0.5 - \frac{\color{blue}{0.375}}{x}}{x}}{\sqrt{x}} \]
  11. Simplified98.0%

    \[\leadsto \frac{\color{blue}{\frac{0.5 - \frac{0.375}{x}}{x}}}{\sqrt{x}} \]
  12. Add Preprocessing

Alternative 8: 37.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{+122}:\\
\;\;\;\;{x}^{-0.5}\\

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


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

    1. Initial program 17.4%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}}} \]
    4. Step-by-step derivation
      1. inv-pow7.8%

        \[\leadsto \sqrt{\color{blue}{{x}^{-1}}} \]
      2. sqrt-pow17.8%

        \[\leadsto \color{blue}{{x}^{\left(\frac{-1}{2}\right)}} \]
      3. metadata-eval7.8%

        \[\leadsto {x}^{\color{blue}{-0.5}} \]
      4. *-un-lft-identity7.8%

        \[\leadsto \color{blue}{1 \cdot {x}^{-0.5}} \]
    5. Applied egg-rr7.8%

      \[\leadsto \color{blue}{1 \cdot {x}^{-0.5}} \]
    6. Step-by-step derivation
      1. *-lft-identity7.8%

        \[\leadsto \color{blue}{{x}^{-0.5}} \]
    7. Simplified7.8%

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

    if 8.50000000000000003e122 < x

    1. Initial program 56.9%

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

        \[\leadsto \color{blue}{{\left(\sqrt{x}\right)}^{-1}} - \frac{1}{\sqrt{x + 1}} \]
      2. add-cube-cbrt21.6%

        \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{x}}\right) \cdot \sqrt[3]{\sqrt{x}}\right)}}^{-1} - \frac{1}{\sqrt{x + 1}} \]
      3. unpow-prod-down15.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{x}}\right)}^{-1}, {\left(\sqrt[3]{\sqrt{x}}\right)}^{-1}, -\frac{1}{\sqrt{x + 1}}\right)} \]
      5. cbrt-prod4.2%

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

        \[\leadsto \mathsf{fma}\left({\left(\sqrt[3]{\color{blue}{x}}\right)}^{-1}, {\left(\sqrt[3]{\sqrt{x}}\right)}^{-1}, -\frac{1}{\sqrt{x + 1}}\right) \]
      7. distribute-neg-frac4.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{x}\right)}^{-1}, {\left(\sqrt[3]{\sqrt{x}}\right)}^{-1}, \frac{-1}{\sqrt{1 + x}}\right)} \]
    5. Taylor expanded in x around inf 56.9%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} + -1 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in56.9%

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

        \[\leadsto \color{blue}{0} \cdot \sqrt{\frac{1}{x}} \]
      3. mul0-lft56.9%

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

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 97.6% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \color{blue}{\frac{\left(1 + x\right) - x}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}}} \]
  9. Step-by-step derivation
    1. associate--l+85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1 + \color{blue}{0}}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} \]
    3. metadata-eval85.2%

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

      \[\leadsto \frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \cdot \frac{1}{\color{blue}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}} \]
    5. hypot-undefine85.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  12. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x}}}{\sqrt{1 + x}}} \]
  13. Step-by-step derivation
    1. associate-/l/99.2%

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{x} + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}} \]
  14. Simplified99.4%

    \[\leadsto \color{blue}{\frac{\frac{1}{x + \sqrt{1 + x} \cdot \sqrt{x}}}{\sqrt{1 + x}}} \]
  15. Taylor expanded in x around inf 95.9%

    \[\leadsto \frac{\color{blue}{\frac{0.5}{x}}}{\sqrt{1 + x}} \]
  16. Final simplification95.9%

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

Alternative 10: 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 40.4%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{x}}\right)}^{-1}, {\left(\sqrt[3]{\sqrt{x}}\right)}^{-1}, -\frac{1}{\sqrt{x + 1}}\right)} \]
    5. cbrt-prod9.6%

      \[\leadsto \mathsf{fma}\left({\color{blue}{\left(\sqrt[3]{\sqrt{x} \cdot \sqrt{x}}\right)}}^{-1}, {\left(\sqrt[3]{\sqrt{x}}\right)}^{-1}, -\frac{1}{\sqrt{x + 1}}\right) \]
    6. add-sqr-sqrt9.4%

      \[\leadsto \mathsf{fma}\left({\left(\sqrt[3]{\color{blue}{x}}\right)}^{-1}, {\left(\sqrt[3]{\sqrt{x}}\right)}^{-1}, -\frac{1}{\sqrt{x + 1}}\right) \]
    7. distribute-neg-frac9.4%

      \[\leadsto \mathsf{fma}\left({\left(\sqrt[3]{x}\right)}^{-1}, {\left(\sqrt[3]{\sqrt{x}}\right)}^{-1}, \color{blue}{\frac{-1}{\sqrt{x + 1}}}\right) \]
    8. metadata-eval9.4%

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{x}\right)}^{-1}, {\left(\sqrt[3]{\sqrt{x}}\right)}^{-1}, \frac{-1}{\sqrt{1 + x}}\right)} \]
  5. Taylor expanded in x around inf 34.8%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} + -1 \cdot \sqrt{\frac{1}{x}}} \]
  6. Step-by-step derivation
    1. distribute-rgt1-in34.8%

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

      \[\leadsto \color{blue}{0} \cdot \sqrt{\frac{1}{x}} \]
    3. mul0-lft34.8%

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

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

Developer target: 98.4% accurate, 1.0× speedup?

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

\\
\frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}}
\end{array}

Reproduce

?
herbie shell --seed 2024106 
(FPCore (x)
  :name "2isqrt (example 3.6)"
  :precision binary64
  :pre (and (> x 1.0) (< x 1e+308))

  :alt
  (/ 1.0 (+ (* (+ x 1.0) (sqrt x)) (* x (sqrt (+ x 1.0)))))

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