2isqrt (example 3.6)

Percentage Accurate: 68.7% → 99.8%
Time: 11.9s
Alternatives: 13
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 13 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: 68.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.5× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. *-un-lft-identity67.9%

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

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

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

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

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

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

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

      \[\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-flip63.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-eval63.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/263.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-flip68.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. +-commutative68.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-eval68.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) \]
  3. Applied egg-rr68.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)} \]
  4. Step-by-step derivation
    1. +-commutative68.0%

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} + \left({x}^{-0.5} + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) \]
    4. distribute-lft1-in68.0%

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

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

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

      \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
    8. associate-+r+68.0%

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

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

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

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

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

    \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
  6. Step-by-step derivation
    1. metadata-eval68.0%

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

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

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

      \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
    5. flip--63.7%

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

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

      \[\leadsto \frac{{x}^{\color{blue}{-1}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    8. inv-pow58.2%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    14. +-commutative67.8%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    15. pow1/267.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{x + 1}} \leq 4 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{x + 1}}{2 \cdot \sqrt{\frac{1}{x}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 4.0000000000000001e-13

    1. Initial program 39.7%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff39.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-identity39.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-neg39.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-identity39.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/239.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-flip31.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-eval31.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/231.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-flip39.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. +-commutative39.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-eval39.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) \]
    3. Applied egg-rr39.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)} \]
    4. Step-by-step derivation
      1. +-commutative39.7%

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} + \left({x}^{-0.5} + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) \]
      4. distribute-lft1-in39.7%

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+39.7%

        \[\leadsto \color{blue}{\left(0 + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) + {x}^{-0.5}} \]
      9. sub-neg39.7%

        \[\leadsto \color{blue}{\left(0 - {\left(1 + x\right)}^{-0.5}\right)} + {x}^{-0.5} \]
      10. neg-sub039.7%

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

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

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

      \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. metadata-eval39.7%

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

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

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

        \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
      5. flip--31.7%

        \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot {x}^{-0.5} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}}} \]
      6. pow-prod-up21.7%

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      9. +-commutative21.7%

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      14. +-commutative39.8%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      15. pow1/239.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000001e-13 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1))))

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

        \[\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.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-eval99.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/299.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-flip99.6%

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

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

        \[\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) \]
    3. Applied egg-rr99.6%

      \[\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)} \]
    4. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+99.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{x + 1}} \leq 4 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{\frac{1}{x}}{x + 1}}{2 \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} - {\left(x + 1\right)}^{-0.5}\\ \end{array} \]

Alternative 3: 99.3% accurate, 1.0× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. *-un-lft-identity67.9%

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

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

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

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

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

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

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

      \[\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-flip63.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-eval63.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/263.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-flip68.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. +-commutative68.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-eval68.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) \]
  3. Applied egg-rr68.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)} \]
  4. Step-by-step derivation
    1. +-commutative68.0%

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} + \left({x}^{-0.5} + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) \]
    4. distribute-lft1-in68.0%

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

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

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

      \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
    8. associate-+r+68.0%

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

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

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

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

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

    \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
  6. Step-by-step derivation
    1. metadata-eval68.0%

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

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

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

      \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
    5. flip--63.7%

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

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

      \[\leadsto \frac{{x}^{\color{blue}{-1}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    8. inv-pow58.2%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    14. +-commutative67.8%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    15. pow1/267.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 91.6% accurate, 1.0× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. *-un-lft-identity67.9%

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

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

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

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

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

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

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

      \[\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-flip63.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-eval63.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/263.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-flip68.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. +-commutative68.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-eval68.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) \]
  3. Applied egg-rr68.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)} \]
  4. Step-by-step derivation
    1. +-commutative68.0%

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} + \left({x}^{-0.5} + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) \]
    4. distribute-lft1-in68.0%

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

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

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

      \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
    8. associate-+r+68.0%

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

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

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

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

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

    \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
  6. Step-by-step derivation
    1. metadata-eval68.0%

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

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

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

      \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
    5. flip--63.7%

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

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

      \[\leadsto \frac{{x}^{\color{blue}{-1}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    8. inv-pow58.2%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    14. +-commutative67.8%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    15. pow1/267.8%

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

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

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

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

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

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

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

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

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

Alternative 5: 92.2% accurate, 1.0× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. *-un-lft-identity67.9%

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

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

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

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

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

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

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

      \[\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-flip63.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-eval63.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/263.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-flip68.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. +-commutative68.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-eval68.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) \]
  3. Applied egg-rr68.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)} \]
  4. Step-by-step derivation
    1. +-commutative68.0%

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} + \left({x}^{-0.5} + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) \]
    4. distribute-lft1-in68.0%

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

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

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

      \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
    8. associate-+r+68.0%

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

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

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

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

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

    \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
  6. Step-by-step derivation
    1. metadata-eval68.0%

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

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

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

      \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
    5. flip--63.7%

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

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

      \[\leadsto \frac{{x}^{\color{blue}{-1}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    8. inv-pow58.2%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    14. +-commutative67.8%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    15. pow1/267.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.2% accurate, 1.8× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{x + 1}}{2 \cdot \sqrt{\frac{1}{x}}}\\


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

    1. Initial program 99.7%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Taylor expanded in x around 0 99.2%

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

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

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

        \[\leadsto \frac{1}{\sqrt{x}} - \left(1 + \left(x \cdot -0.5 + \color{blue}{\left(x \cdot x\right)} \cdot 0.375\right)\right) \]
      4. associate-*l*99.2%

        \[\leadsto \frac{1}{\sqrt{x}} - \left(1 + \left(x \cdot -0.5 + \color{blue}{x \cdot \left(x \cdot 0.375\right)}\right)\right) \]
      5. distribute-lft-out99.2%

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

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

    if 0.71999999999999997 < x

    1. Initial program 40.6%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff40.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-identity40.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-neg40.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-identity40.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/240.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-flip32.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-eval32.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/232.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-flip40.6%

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

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

        \[\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) \]
    3. Applied egg-rr40.6%

      \[\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)} \]
    4. Step-by-step derivation
      1. +-commutative40.6%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+40.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
      5. flip--32.8%

        \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot {x}^{-0.5} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}}} \]
      6. pow-prod-up23.2%

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

        \[\leadsto \frac{{x}^{\color{blue}{-1}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      8. inv-pow23.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      14. +-commutative40.8%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      15. pow1/240.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\frac{1}{x}}{1 + x}}{\color{blue}{2 \cdot \sqrt{\frac{1}{x}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.72:\\ \;\;\;\;\frac{1}{\sqrt{x}} - \left(1 + x \cdot \left(-0.5 + x \cdot 0.375\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{x}}{x + 1}}{2 \cdot \sqrt{\frac{1}{x}}}\\ \end{array} \]

Alternative 7: 67.4% accurate, 1.9× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. *-un-lft-identity67.9%

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

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

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

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

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

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

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

      \[\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-flip63.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-eval63.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/263.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-flip68.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. +-commutative68.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-eval68.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) \]
  3. Applied egg-rr68.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)} \]
  4. Step-by-step derivation
    1. +-commutative68.0%

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} + \left({x}^{-0.5} + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) \]
    4. distribute-lft1-in68.0%

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

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

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

      \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
    8. associate-+r+68.0%

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

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

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

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

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

    \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
  6. Step-by-step derivation
    1. metadata-eval68.0%

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

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

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

      \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
    5. flip--63.7%

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

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

      \[\leadsto \frac{{x}^{\color{blue}{-1}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    8. inv-pow58.2%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    14. +-commutative67.8%

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
    15. pow1/267.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{\frac{1}{x}}{1 + x}}{\color{blue}{1 + {x}^{-0.5}}} \]
  13. Final simplification66.1%

    \[\leadsto \frac{\frac{\frac{1}{x}}{x + 1}}{{x}^{-0.5} + 1} \]

Alternative 8: 67.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 79.6%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff79.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-identity79.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-neg79.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-identity79.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/279.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-flip80.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-eval80.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/280.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-flip79.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. +-commutative79.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-eval79.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) \]
    3. Applied egg-rr79.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)} \]
    4. Step-by-step derivation
      1. +-commutative79.8%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+79.8%

        \[\leadsto \color{blue}{\left(0 + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) + {x}^{-0.5}} \]
      9. sub-neg79.8%

        \[\leadsto \color{blue}{\left(0 - {\left(1 + x\right)}^{-0.5}\right)} + {x}^{-0.5} \]
      10. neg-sub079.8%

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

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

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

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

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

    if 8.0000000000000004e76 < x

    1. Initial program 49.8%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity49.8%

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

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

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

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

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

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

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

        \[\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-flip38.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-eval38.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/238.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-flip49.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. +-commutative49.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-eval49.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) \]
    3. Applied egg-rr49.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)} \]
    4. Step-by-step derivation
      1. +-commutative49.8%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+49.8%

        \[\leadsto \color{blue}{\left(0 + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) + {x}^{-0.5}} \]
      9. sub-neg49.8%

        \[\leadsto \color{blue}{\left(0 - {\left(1 + x\right)}^{-0.5}\right)} + {x}^{-0.5} \]
      10. neg-sub049.8%

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

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

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

      \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. sqr-pow27.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\frac{1}{{\color{blue}{\left(1 + x\right)}}^{0.5}}\right) \]
      11. pow-flip4.4%

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}}\right) \]
      12. +-commutative4.4%

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\color{blue}{\left(x + 1\right)}}^{\left(-0.5\right)}\right) \]
      13. metadata-eval4.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\left(x + 1\right)}^{-0.5}\right)} \]
    8. Taylor expanded in x around inf 49.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} - {\left(\frac{1}{x}\right)}^{0.5}} \]
    9. Step-by-step derivation
      1. unpow1/249.8%

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

        \[\leadsto \color{blue}{0} \]
    10. Simplified49.8%

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

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

Alternative 9: 68.1% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff99.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-identity99.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-neg99.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-identity99.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/299.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-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) \]
    3. 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)} \]
    4. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+100.0%

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

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

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

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

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

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

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

    if 1 < x

    1. Initial program 40.6%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff40.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-identity40.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-neg40.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-identity40.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/240.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-flip32.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-eval32.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/232.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-flip40.6%

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

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

        \[\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) \]
    3. Applied egg-rr40.6%

      \[\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)} \]
    4. Step-by-step derivation
      1. +-commutative40.6%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+40.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
      5. flip--32.8%

        \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot {x}^{-0.5} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}}} \]
      6. pow-prod-up23.2%

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

        \[\leadsto \frac{{x}^{\color{blue}{-1}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      8. inv-pow23.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      14. +-commutative40.8%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      15. pow1/240.8%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x \cdot \left(\color{blue}{x} + \sqrt{\frac{1}{x}} \cdot x\right)} \]
      6. unpow1/239.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 67.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.6 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{x + \sqrt{x}}\\

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


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

    1. Initial program 69.6%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff69.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-identity69.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-neg69.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-identity69.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/269.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-flip69.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-eval69.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/269.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-flip69.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. +-commutative69.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-eval69.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) \]
    3. Applied egg-rr69.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)} \]
    4. Step-by-step derivation
      1. +-commutative69.8%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+69.8%

        \[\leadsto \color{blue}{\left(0 + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) + {x}^{-0.5}} \]
      9. sub-neg69.8%

        \[\leadsto \color{blue}{\left(0 - {\left(1 + x\right)}^{-0.5}\right)} + {x}^{-0.5} \]
      10. neg-sub069.8%

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

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

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

      \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. metadata-eval69.8%

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

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

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

        \[\leadsto {x}^{-0.5} - \frac{1}{\color{blue}{\sqrt{x + 1}}} \]
      5. flip--69.8%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      9. +-commutative69.6%

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{\color{blue}{1}}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      13. add-sqr-sqrt69.5%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      14. +-commutative69.5%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{x + 1}}}{{x}^{-0.5} + \frac{1}{\sqrt{x + 1}}} \]
      15. pow1/269.5%

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

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

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

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

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

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

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

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

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

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

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

    if 4.6000000000000003e153 < x

    1. Initial program 63.8%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity63.8%

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

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

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

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

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

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

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

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

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

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

        \[\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-flip63.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. +-commutative63.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-eval63.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) \]
    3. Applied egg-rr63.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)} \]
    4. Step-by-step derivation
      1. +-commutative63.8%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+63.8%

        \[\leadsto \color{blue}{\left(0 + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) + {x}^{-0.5}} \]
      9. sub-neg63.8%

        \[\leadsto \color{blue}{\left(0 - {\left(1 + x\right)}^{-0.5}\right)} + {x}^{-0.5} \]
      10. neg-sub063.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\frac{1}{{\color{blue}{\left(1 + x\right)}}^{0.5}}\right) \]
      11. pow-flip4.4%

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}}\right) \]
      12. +-commutative4.4%

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\color{blue}{\left(x + 1\right)}}^{\left(-0.5\right)}\right) \]
      13. metadata-eval4.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\left(x + 1\right)}^{-0.5}\right)} \]
    8. Taylor expanded in x around inf 63.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} - {\left(\frac{1}{x}\right)}^{0.5}} \]
    9. Step-by-step derivation
      1. unpow1/263.8%

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

        \[\leadsto \color{blue}{0} \]
    10. Simplified63.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.6 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{x + \sqrt{x}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]

Alternative 11: 66.7% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff99.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-identity99.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-neg99.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-identity99.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/299.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-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) \]
    3. 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)} \]
    4. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+100.0%

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

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

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

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

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

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

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

    if 1 < x

    1. Initial program 40.6%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff40.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-identity40.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-neg40.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-identity40.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/240.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-flip32.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-eval32.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/232.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-flip40.6%

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

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

        \[\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) \]
    3. Applied egg-rr40.6%

      \[\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)} \]
    4. Step-by-step derivation
      1. +-commutative40.6%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+40.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\frac{1}{{\color{blue}{\left(1 + x\right)}}^{0.5}}\right) \]
      11. pow-flip7.6%

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\color{blue}{{\left(1 + x\right)}^{\left(-0.5\right)}}\right) \]
      12. +-commutative7.6%

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\color{blue}{\left(x + 1\right)}}^{\left(-0.5\right)}\right) \]
      13. metadata-eval7.6%

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\left(x + 1\right)}^{\color{blue}{-0.5}}\right) \]
    7. Applied egg-rr7.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\left(x + 1\right)}^{-0.5}\right)} \]
    8. Taylor expanded in x around inf 37.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} - {\left(\frac{1}{x}\right)}^{0.5}} \]
    9. Step-by-step derivation
      1. unpow1/237.4%

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

        \[\leadsto \color{blue}{0} \]
    10. Simplified37.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;{x}^{-0.5} + -1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]

Alternative 12: 27.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3 \cdot 10^{+123}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\

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


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

    1. Initial program 72.6%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. sub-neg72.6%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} + \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      2. flip3-+49.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{{\left(\sqrt{x}\right)}^{-3} + {\left(\frac{-1}{\sqrt{1 + x}}\right)}^{3}}{\frac{1}{x} + \left(\frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{1 + x}} - {x}^{-0.5} \cdot \frac{-1}{\sqrt{1 + x}}\right)}} \]
    4. Step-by-step derivation
      1. cube-div49.0%

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

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

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

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

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

        \[\leadsto \frac{{\left(\sqrt{x}\right)}^{-3} + \frac{-1}{{\left(\sqrt{1 + x}\right)}^{3}}}{\frac{1}{x} + \left(\frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}} + \left(-{x}^{-0.5}\right) \cdot \frac{-1}{\sqrt{1 + x}}\right)} \]
      7. associate-/l/49.0%

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

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

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

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

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

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

        \[\leadsto \frac{\left(e^{\mathsf{log1p}\left(\color{blue}{{x}^{\left(\frac{-3}{2}\right)}}\right)} - 1\right) + \frac{-1}{{\left(\sqrt{1 + x}\right)}^{3}}}{\frac{1}{x} + \left(\frac{1}{1 + x} + \frac{{x}^{-0.5}}{\sqrt{1 + x}}\right)} \]
      4. metadata-eval43.4%

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

      \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{log1p}\left({x}^{-1.5}\right)} - 1\right)} + \frac{-1}{{\left(\sqrt{1 + x}\right)}^{3}}}{\frac{1}{x} + \left(\frac{1}{1 + x} + \frac{{x}^{-0.5}}{\sqrt{1 + x}}\right)} \]
    8. Step-by-step derivation
      1. expm1-def45.7%

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

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

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
    11. Step-by-step derivation
      1. *-commutative14.6%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} \cdot 0.3333333333333333} \]
    12. Simplified14.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} \cdot 0.3333333333333333} \]
    13. Step-by-step derivation
      1. add-sqr-sqrt14.6%

        \[\leadsto \color{blue}{\sqrt{\sqrt{\frac{1}{x}} \cdot 0.3333333333333333} \cdot \sqrt{\sqrt{\frac{1}{x}} \cdot 0.3333333333333333}} \]
      2. sqrt-unprod14.6%

        \[\leadsto \color{blue}{\sqrt{\left(\sqrt{\frac{1}{x}} \cdot 0.3333333333333333\right) \cdot \left(\sqrt{\frac{1}{x}} \cdot 0.3333333333333333\right)}} \]
      3. inv-pow14.6%

        \[\leadsto \sqrt{\left(\sqrt{\color{blue}{{x}^{-1}}} \cdot 0.3333333333333333\right) \cdot \left(\sqrt{\frac{1}{x}} \cdot 0.3333333333333333\right)} \]
      4. sqrt-pow114.6%

        \[\leadsto \sqrt{\left(\color{blue}{{x}^{\left(\frac{-1}{2}\right)}} \cdot 0.3333333333333333\right) \cdot \left(\sqrt{\frac{1}{x}} \cdot 0.3333333333333333\right)} \]
      5. metadata-eval14.6%

        \[\leadsto \sqrt{\left({x}^{\color{blue}{-0.5}} \cdot 0.3333333333333333\right) \cdot \left(\sqrt{\frac{1}{x}} \cdot 0.3333333333333333\right)} \]
      6. inv-pow14.6%

        \[\leadsto \sqrt{\left({x}^{-0.5} \cdot 0.3333333333333333\right) \cdot \left(\sqrt{\color{blue}{{x}^{-1}}} \cdot 0.3333333333333333\right)} \]
      7. sqrt-pow114.6%

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

        \[\leadsto \sqrt{\left({x}^{-0.5} \cdot 0.3333333333333333\right) \cdot \left({x}^{\color{blue}{-0.5}} \cdot 0.3333333333333333\right)} \]
      9. swap-sqr14.6%

        \[\leadsto \sqrt{\color{blue}{\left({x}^{-0.5} \cdot {x}^{-0.5}\right) \cdot \left(0.3333333333333333 \cdot 0.3333333333333333\right)}} \]
      10. pow-prod-up14.6%

        \[\leadsto \sqrt{\color{blue}{{x}^{\left(-0.5 + -0.5\right)}} \cdot \left(0.3333333333333333 \cdot 0.3333333333333333\right)} \]
      11. metadata-eval14.6%

        \[\leadsto \sqrt{{x}^{\color{blue}{-1}} \cdot \left(0.3333333333333333 \cdot 0.3333333333333333\right)} \]
      12. inv-pow14.6%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{x}} \cdot \left(0.3333333333333333 \cdot 0.3333333333333333\right)} \]
      13. metadata-eval14.6%

        \[\leadsto \sqrt{\frac{1}{x} \cdot \color{blue}{0.1111111111111111}} \]
    14. Applied egg-rr14.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x} \cdot 0.1111111111111111}} \]
    15. Step-by-step derivation
      1. associate-*l/14.6%

        \[\leadsto \sqrt{\color{blue}{\frac{1 \cdot 0.1111111111111111}{x}}} \]
      2. metadata-eval14.6%

        \[\leadsto \sqrt{\frac{\color{blue}{0.1111111111111111}}{x}} \]
    16. Simplified14.6%

      \[\leadsto \color{blue}{\sqrt{\frac{0.1111111111111111}{x}}} \]

    if 1.29999999999999993e123 < x

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    3. Applied egg-rr58.3%

      \[\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)} \]
    4. Step-by-step derivation
      1. +-commutative58.3%

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

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

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

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

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

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

        \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
      8. associate-+r+58.3%

        \[\leadsto \color{blue}{\left(0 + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) + {x}^{-0.5}} \]
      9. sub-neg58.3%

        \[\leadsto \color{blue}{\left(0 - {\left(1 + x\right)}^{-0.5}\right)} + {x}^{-0.5} \]
      10. neg-sub058.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\frac{1}{\color{blue}{{\left(x + 1\right)}^{0.5}}}\right) \]
      10. +-commutative4.2%

        \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\frac{1}{{\color{blue}{\left(1 + x\right)}}^{0.5}}\right) \]
      11. pow-flip4.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\left(x + 1\right)}^{-0.5}\right)} \]
    8. Taylor expanded in x around inf 58.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} - {\left(\frac{1}{x}\right)}^{0.5}} \]
    9. Step-by-step derivation
      1. unpow1/258.3%

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

        \[\leadsto \color{blue}{0} \]
    10. Simplified58.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.3 \cdot 10^{+123}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]

Alternative 13: 19.0% accurate, 209.0× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. *-un-lft-identity67.9%

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

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

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

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

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

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

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

      \[\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-flip63.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-eval63.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/263.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-flip68.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. +-commutative68.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-eval68.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) \]
  3. Applied egg-rr68.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)} \]
  4. Step-by-step derivation
    1. +-commutative68.0%

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} + \left({x}^{-0.5} + \left(-{\left(1 + x\right)}^{-0.5}\right)\right) \]
    4. distribute-lft1-in68.0%

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

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

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

      \[\leadsto 0 + \color{blue}{\left(\left(-{\left(1 + x\right)}^{-0.5}\right) + {x}^{-0.5}\right)} \]
    8. associate-+r+68.0%

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

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

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

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

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

    \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
  6. Step-by-step derivation
    1. sqr-pow58.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -\frac{1}{{\color{blue}{\left(1 + x\right)}}^{0.5}}\right) \]
    11. pow-flip49.8%

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

      \[\leadsto \mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\color{blue}{\left(x + 1\right)}}^{\left(-0.5\right)}\right) \]
    13. metadata-eval49.8%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{-0.25}, {x}^{-0.25}, -{\left(x + 1\right)}^{-0.5}\right)} \]
  8. Taylor expanded in x around inf 21.4%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} - {\left(\frac{1}{x}\right)}^{0.5}} \]
  9. Step-by-step derivation
    1. unpow1/221.4%

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

      \[\leadsto \color{blue}{0} \]
  10. Simplified21.4%

    \[\leadsto \color{blue}{0} \]
  11. Final simplification21.4%

    \[\leadsto 0 \]

Developer target: 99.0% 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 2023319 
(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)))))