2isqrt (example 3.6)

Percentage Accurate: 69.7% → 91.6%
Time: 12.7s
Alternatives: 14
Speedup: 1.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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: 69.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: 91.6% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1}{x \cdot \left(-1 - x\right)}}{2 \cdot \sqrt{\frac{1}{x}}}\\


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{x}^{-0.5} - \left({\left(1 + x\right)}^{-0.5} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p99.8%

        \[\leadsto {x}^{-0.5} - \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
      3. expm1-def99.7%

        \[\leadsto {x}^{-0.5} - \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - 1\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
      4. associate--l-99.7%

        \[\leadsto {x}^{-0.5} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)\right)} \]
      5. fma-udef99.7%

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

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

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

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0}\right)\right) \]
      9. metadata-eval99.7%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \color{blue}{1}\right) \]
      10. expm1-def99.8%

        \[\leadsto {x}^{-0.5} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} \]
      11. expm1-log1p99.8%

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

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

    if 6.2e7 < x

    1. Initial program 37.7%

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x} \cdot \sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
      4. add-sqr-sqrt16.1%

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

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1 \cdot 1}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
      6. metadata-eval21.4%

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
      9. pow1/237.7%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{\frac{1}{\color{blue}{{x}^{0.5}}} + \frac{1}{\sqrt{x + 1}}} \]
      10. pow-flip37.7%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{\color{blue}{-0.5}} + \frac{1}{\sqrt{x + 1}}} \]
      12. inv-pow37.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{-1}{x \cdot \left(-1 - x\right)}}{\color{blue}{2 \cdot \sqrt{\frac{1}{x}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.4%

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

Alternative 2: 92.2% accurate, 1.0× speedup?

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x} \cdot \sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    4. add-sqr-sqrt63.1%

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1 \cdot 1}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    6. metadata-eval65.4%

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    9. pow1/272.5%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{\frac{1}{\color{blue}{{x}^{0.5}}} + \frac{1}{\sqrt{x + 1}}} \]
    10. pow-flip72.5%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{\color{blue}{-0.5}} + \frac{1}{\sqrt{x + 1}}} \]
    12. inv-pow72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.6% accurate, 1.0× speedup?

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x} \cdot \sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    4. add-sqr-sqrt63.1%

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1 \cdot 1}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    6. metadata-eval65.4%

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    9. pow1/272.5%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{\frac{1}{\color{blue}{{x}^{0.5}}} + \frac{1}{\sqrt{x + 1}}} \]
    10. pow-flip72.5%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{\color{blue}{-0.5}} + \frac{1}{\sqrt{x + 1}}} \]
    12. inv-pow72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{-1}{x \cdot \left(-1 - x\right)}}{{x}^{-0.5} + {\left(1 + x\right)}^{-0.5}}\right)} - 1} \]
    3. associate-/l/68.9%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{-1}{\left({x}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right) \cdot \left(x \cdot \left(-1 - x\right)\right)}}\right)} - 1 \]
    4. *-commutative68.9%

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

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-1}{\left(x \cdot \left(-1 - x\right)\right) \cdot \left({x}^{-0.5} + {\color{blue}{\left(x + 1\right)}}^{-0.5}\right)}\right)} - 1 \]
  10. Applied egg-rr68.9%

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

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

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

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

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

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

Alternative 4: 91.6% accurate, 1.0× speedup?

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x} \cdot \sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    4. add-sqr-sqrt63.1%

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1 \cdot 1}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    6. metadata-eval65.4%

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    9. pow1/272.5%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{\frac{1}{\color{blue}{{x}^{0.5}}} + \frac{1}{\sqrt{x + 1}}} \]
    10. pow-flip72.5%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{\color{blue}{-0.5}} + \frac{1}{\sqrt{x + 1}}} \]
    12. inv-pow72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 90.7% accurate, 1.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1}{x \cdot \left(-1 - x\right)}}{2 \cdot \sqrt{\frac{1}{x}}}\\


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

    1. Initial program 99.6%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {x}^{-0.5} - \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
      3. expm1-def100.0%

        \[\leadsto {x}^{-0.5} - \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - 1\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
      4. associate--l-100.0%

        \[\leadsto {x}^{-0.5} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)\right)} \]
      5. fma-udef100.0%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)}\right)\right) \]
      6. distribute-lft1-in100.0%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{\left(-1 + 1\right) \cdot {\left(1 + x\right)}^{-0.5}}\right)\right) \]
      7. metadata-eval100.0%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0} \cdot {\left(1 + x\right)}^{-0.5}\right)\right) \]
      8. mul0-lft100.0%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0}\right)\right) \]
      9. metadata-eval100.0%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \color{blue}{1}\right) \]
      10. expm1-def100.0%

        \[\leadsto {x}^{-0.5} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} \]
      11. expm1-log1p100.0%

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

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

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

    if 0.680000000000000049 < x

    1. Initial program 38.6%

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x} \cdot \sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
      4. add-sqr-sqrt17.3%

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
      9. pow1/238.6%

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{\color{blue}{-0.5}} + \frac{1}{\sqrt{x + 1}}} \]
      12. inv-pow38.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{-1}{x \cdot \left(-1 - x\right)}}{\color{blue}{2 \cdot \sqrt{\frac{1}{x}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.8%

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

Alternative 6: 68.6% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 81.8%

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

      \[\leadsto \frac{1}{\sqrt{x}} - \frac{1}{\color{blue}{1 + 0.5 \cdot x}} \]
    4. Step-by-step derivation
      1. *-commutative81.2%

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

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

    if 8.50000000000000003e122 < x

    1. Initial program 51.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. mul-1-neg3.8%

        \[\leadsto \color{blue}{-\sqrt{\frac{1}{x}}} \]
    7. Simplified3.8%

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

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

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

        \[\leadsto -{x}^{\color{blue}{-0.5}} \]
      4. expm1-log1p-u3.8%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      5. expm1-udef51.9%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
    9. Applied egg-rr51.9%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def3.8%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      2. expm1-log1p3.8%

        \[\leadsto -\color{blue}{{x}^{-0.5}} \]
    11. Simplified3.8%

      \[\leadsto -\color{blue}{{x}^{-0.5}} \]
    12. Step-by-step derivation
      1. expm1-log1p-u3.8%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      2. expm1-udef51.9%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
      3. log1p-udef51.9%

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

        \[\leadsto -\left(e^{\log \color{blue}{\left({x}^{-0.5} + 1\right)}} - 1\right) \]
      5. add-exp-log51.9%

        \[\leadsto -\left(\color{blue}{\left({x}^{-0.5} + 1\right)} - 1\right) \]
    13. Applied egg-rr51.9%

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

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

Alternative 7: 68.5% accurate, 1.9× speedup?

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x} \cdot \sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    4. add-sqr-sqrt63.1%

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1 \cdot 1}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    6. metadata-eval65.4%

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    9. pow1/272.5%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{\frac{1}{\color{blue}{{x}^{0.5}}} + \frac{1}{\sqrt{x + 1}}} \]
    10. pow-flip72.5%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{\color{blue}{-0.5}} + \frac{1}{\sqrt{x + 1}}} \]
    12. inv-pow72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.4% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{x}^{-0.5} - \left({\left(1 + x\right)}^{-0.5} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p89.7%

        \[\leadsto {x}^{-0.5} - \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
      3. expm1-def89.9%

        \[\leadsto {x}^{-0.5} - \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - 1\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
      4. associate--l-89.9%

        \[\leadsto {x}^{-0.5} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)\right)} \]
      5. fma-udef89.9%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)}\right)\right) \]
      6. distribute-lft1-in89.9%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{\left(-1 + 1\right) \cdot {\left(1 + x\right)}^{-0.5}}\right)\right) \]
      7. metadata-eval89.9%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0} \cdot {\left(1 + x\right)}^{-0.5}\right)\right) \]
      8. mul0-lft89.9%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0}\right)\right) \]
      9. metadata-eval89.9%

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

        \[\leadsto {x}^{-0.5} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} \]
      11. expm1-log1p89.7%

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

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

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

    if 8.1999999999999997e76 < x

    1. Initial program 43.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{1}{x}}} \]
    7. Simplified3.6%

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

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

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

        \[\leadsto -{x}^{\color{blue}{-0.5}} \]
      4. expm1-log1p-u3.6%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      5. expm1-udef43.9%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
    9. Applied egg-rr43.9%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def3.6%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      2. expm1-log1p3.6%

        \[\leadsto -\color{blue}{{x}^{-0.5}} \]
    11. Simplified3.6%

      \[\leadsto -\color{blue}{{x}^{-0.5}} \]
    12. Step-by-step derivation
      1. expm1-log1p-u3.6%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      2. expm1-udef43.9%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
      3. log1p-udef43.9%

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

        \[\leadsto -\left(e^{\log \color{blue}{\left({x}^{-0.5} + 1\right)}} - 1\right) \]
      5. add-exp-log43.9%

        \[\leadsto -\left(\color{blue}{\left({x}^{-0.5} + 1\right)} - 1\right) \]
    13. Applied egg-rr43.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 8.2 \cdot 10^{+76}:\\ \;\;\;\;-1 + \left({x}^{-0.5} + x \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;1 + \left(-1 - {x}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 67.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.6%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{x}^{-0.5} - \left({\left(1 + x\right)}^{-0.5} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p99.9%

        \[\leadsto {x}^{-0.5} - \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
      3. expm1-def99.9%

        \[\leadsto {x}^{-0.5} - \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - 1\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
      4. associate--l-99.9%

        \[\leadsto {x}^{-0.5} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)\right)} \]
      5. fma-udef99.9%

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

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

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

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0}\right)\right) \]
      9. metadata-eval99.9%

        \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \color{blue}{1}\right) \]
      10. expm1-def99.9%

        \[\leadsto {x}^{-0.5} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} \]
      11. expm1-log1p99.9%

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

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

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

    if 4 < x

    1. Initial program 38.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. mul-1-neg3.3%

        \[\leadsto \color{blue}{-\sqrt{\frac{1}{x}}} \]
    7. Simplified3.3%

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

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

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

        \[\leadsto -{x}^{\color{blue}{-0.5}} \]
      4. expm1-log1p-u3.3%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      5. expm1-udef37.4%

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

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def3.3%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      2. expm1-log1p3.3%

        \[\leadsto -\color{blue}{{x}^{-0.5}} \]
    11. Simplified3.3%

      \[\leadsto -\color{blue}{{x}^{-0.5}} \]
    12. Step-by-step derivation
      1. expm1-log1p-u3.3%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
      2. expm1-udef37.4%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
      3. log1p-udef37.4%

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

        \[\leadsto -\left(e^{\log \color{blue}{\left({x}^{-0.5} + 1\right)}} - 1\right) \]
      5. add-exp-log37.4%

        \[\leadsto -\left(\color{blue}{\left({x}^{-0.5} + 1\right)} - 1\right) \]
    13. Applied egg-rr37.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4:\\ \;\;\;\;-1 + {x}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(-1 - {x}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 53.8% accurate, 2.0× speedup?

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x} \cdot \sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    4. add-sqr-sqrt63.1%

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1 \cdot 1}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    6. metadata-eval65.4%

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \]
    9. pow1/272.5%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{\frac{1}{\color{blue}{{x}^{0.5}}} + \frac{1}{\sqrt{x + 1}}} \]
    10. pow-flip72.5%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{\color{blue}{-0.5}} + \frac{1}{\sqrt{x + 1}}} \]
    12. inv-pow72.5%

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{x \cdot {x}^{-0.5} + x \cdot 1}} \]
    3. pow157.9%

      \[\leadsto \frac{1}{\color{blue}{{x}^{1}} \cdot {x}^{-0.5} + x \cdot 1} \]
    4. pow-prod-up58.0%

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

      \[\leadsto \frac{1}{{x}^{\color{blue}{0.5}} + x \cdot 1} \]
    6. pow1/258.0%

      \[\leadsto \frac{1}{\color{blue}{\sqrt{x}} + x \cdot 1} \]
    7. *-rgt-identity58.0%

      \[\leadsto \frac{1}{\sqrt{x} + \color{blue}{x}} \]
  7. Applied egg-rr58.0%

    \[\leadsto \frac{1}{\color{blue}{\sqrt{x} + x}} \]
  8. Final simplification58.0%

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

Alternative 11: 51.7% accurate, 2.0× speedup?

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

\\
-1 + {x}^{-0.5}
\end{array}
Derivation
  1. Initial program 72.7%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-un-lft-identity72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{x}^{-0.5} - \left({\left(1 + x\right)}^{-0.5} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)} \]
    2. expm1-log1p72.9%

      \[\leadsto {x}^{-0.5} - \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
    3. expm1-def58.6%

      \[\leadsto {x}^{-0.5} - \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - 1\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
    4. associate--l-58.6%

      \[\leadsto {x}^{-0.5} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)\right)} \]
    5. fma-udef58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)}\right)\right) \]
    6. distribute-lft1-in58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{\left(-1 + 1\right) \cdot {\left(1 + x\right)}^{-0.5}}\right)\right) \]
    7. metadata-eval58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0} \cdot {\left(1 + x\right)}^{-0.5}\right)\right) \]
    8. mul0-lft58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0}\right)\right) \]
    9. metadata-eval58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \color{blue}{1}\right) \]
    10. expm1-def72.9%

      \[\leadsto {x}^{-0.5} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} \]
    11. expm1-log1p72.9%

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

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

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

    \[\leadsto -1 + {x}^{-0.5} \]
  9. Add Preprocessing

Alternative 12: 2.1% accurate, 2.0× speedup?

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

\\
-{x}^{-0.5}
\end{array}
Derivation
  1. Initial program 72.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{1}{x}}} \]
  7. Simplified2.1%

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

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

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

      \[\leadsto -{x}^{\color{blue}{-0.5}} \]
    4. expm1-log1p-u2.1%

      \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
    5. expm1-udef17.0%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
  9. Applied egg-rr17.0%

    \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-0.5}\right)} - 1\right)} \]
  10. Step-by-step derivation
    1. expm1-def2.1%

      \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-0.5}\right)\right)} \]
    2. expm1-log1p2.1%

      \[\leadsto -\color{blue}{{x}^{-0.5}} \]
  11. Simplified2.1%

    \[\leadsto -\color{blue}{{x}^{-0.5}} \]
  12. Final simplification2.1%

    \[\leadsto -{x}^{-0.5} \]
  13. Add Preprocessing

Alternative 13: 51.7% accurate, 2.0× speedup?

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

\\
\sqrt{\frac{1}{x}}
\end{array}
Derivation
  1. Initial program 72.7%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-un-lft-identity72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{x}^{-0.5} - \left({\left(1 + x\right)}^{-0.5} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)} \]
    2. expm1-log1p72.9%

      \[\leadsto {x}^{-0.5} - \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
    3. expm1-def58.6%

      \[\leadsto {x}^{-0.5} - \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - 1\right)} - \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right) \]
    4. associate--l-58.6%

      \[\leadsto {x}^{-0.5} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)\right)\right)} \]
    5. fma-udef58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)}\right)\right) \]
    6. distribute-lft1-in58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{\left(-1 + 1\right) \cdot {\left(1 + x\right)}^{-0.5}}\right)\right) \]
    7. metadata-eval58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0} \cdot {\left(1 + x\right)}^{-0.5}\right)\right) \]
    8. mul0-lft58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \left(1 + \color{blue}{0}\right)\right) \]
    9. metadata-eval58.6%

      \[\leadsto {x}^{-0.5} - \left(e^{\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)} - \color{blue}{1}\right) \]
    10. expm1-def72.9%

      \[\leadsto {x}^{-0.5} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(1 + x\right)}^{-0.5}\right)\right)} \]
    11. expm1-log1p72.9%

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

    \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
  7. Applied egg-rr56.8%

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{\frac{1}{x}}} \]
  11. Final simplification56.1%

    \[\leadsto \sqrt{\frac{1}{x}} \]
  12. Add Preprocessing

Alternative 14: 1.9% accurate, 209.0× speedup?

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

\\
-1
\end{array}
Derivation
  1. Initial program 72.7%

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

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

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

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

Developer target: 98.9% 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 2024010 
(FPCore (x)
  :name "2isqrt (example 3.6)"
  :precision binary64

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

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