2isqrt (example 3.6)

Percentage Accurate: 68.9% → 94.7%
Time: 11.3s
Alternatives: 11
Speedup: 2.0×

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 11 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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 94.7% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)\\
\frac{1}{t_0} \cdot \frac{\frac{1}{x}}{t_0 \cdot \left(1 + x\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
    12. pow1/260.1%

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    2. associate-*l/61.1%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    4. associate-/l/61.2%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    6. sub-neg67.5%

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

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

      \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    9. sub-neg67.5%

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \frac{1}{\sqrt{1 + x}}}} \]
  6. Step-by-step derivation
    1. frac-add68.5%

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{\left(1 + \left(x + x \cdot -1\right)\right) \cdot \frac{\frac{1}{x}}{1 + x}}}{{x}^{-0.5} + \frac{1}{\sqrt{1 + x}}} \]
  8. Step-by-step derivation
    1. *-un-lft-identity90.4%

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

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

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

    \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \cdot \frac{\frac{1 + x \cdot 0}{\left(1 + x\right) \cdot x}}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)}} \]
  10. Step-by-step derivation
    1. mul0-rgt89.4%

      \[\leadsto \frac{1}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \cdot \frac{\frac{1 + \color{blue}{0}}{\left(1 + x\right) \cdot x}}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \]
    2. metadata-eval89.4%

      \[\leadsto \frac{1}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \cdot \frac{\frac{\color{blue}{1}}{\left(1 + x\right) \cdot x}}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \]
    3. associate-/l/90.2%

      \[\leadsto \frac{1}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \cdot \frac{\color{blue}{\frac{\frac{1}{x}}{1 + x}}}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \]
    4. associate-/l/92.3%

      \[\leadsto \frac{1}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \cdot \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right) \cdot \left(1 + x\right)}} \]
  11. Simplified92.3%

    \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \cdot \frac{\frac{1}{x}}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right) \cdot \left(1 + x\right)}} \]
  12. Final simplification92.3%

    \[\leadsto \frac{1}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right)} \cdot \frac{\frac{1}{x}}{\mathsf{hypot}\left({\left(\mathsf{hypot}\left(1, \sqrt{x}\right)\right)}^{-0.5}, {x}^{-0.25}\right) \cdot \left(1 + x\right)} \]

Alternative 2: 91.8% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
    12. pow1/260.1%

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    2. associate-*l/61.1%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    4. associate-/l/61.2%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    6. sub-neg67.5%

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

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

      \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    9. sub-neg67.5%

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \frac{1}{\sqrt{1 + x}}}} \]
  6. Step-by-step derivation
    1. frac-add68.5%

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

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

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

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

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

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

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

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

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

Alternative 3: 91.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
    12. pow1/260.1%

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    2. associate-*l/61.1%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    4. associate-/l/61.2%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    6. sub-neg67.5%

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

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

      \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    9. sub-neg67.5%

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \frac{1}{\sqrt{1 + x}}}} \]
  6. Step-by-step derivation
    1. frac-add68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\left({x}^{-0.5} + x \cdot 0.5\right) + -1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+102}:\\ \;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{1.5}}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 1.0)
   (+ (+ (pow x -0.5) (* x 0.5)) -1.0)
   (if (<= x 5.5e+102)
     (* 0.5 (sqrt (/ 1.0 (pow x 3.0))))
     (/ 1.0 (pow x 1.5)))))
double code(double x) {
	double tmp;
	if (x <= 1.0) {
		tmp = (pow(x, -0.5) + (x * 0.5)) + -1.0;
	} else if (x <= 5.5e+102) {
		tmp = 0.5 * sqrt((1.0 / pow(x, 3.0)));
	} else {
		tmp = 1.0 / pow(x, 1.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 if (x <= 5.5d+102) then
        tmp = 0.5d0 * sqrt((1.0d0 / (x ** 3.0d0)))
    else
        tmp = 1.0d0 / (x ** 1.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 if (x <= 5.5e+102) {
		tmp = 0.5 * Math.sqrt((1.0 / Math.pow(x, 3.0)));
	} else {
		tmp = 1.0 / Math.pow(x, 1.5);
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 1.0:
		tmp = (math.pow(x, -0.5) + (x * 0.5)) + -1.0
	elif x <= 5.5e+102:
		tmp = 0.5 * math.sqrt((1.0 / math.pow(x, 3.0)))
	else:
		tmp = 1.0 / math.pow(x, 1.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);
	elseif (x <= 5.5e+102)
		tmp = Float64(0.5 * sqrt(Float64(1.0 / (x ^ 3.0))));
	else
		tmp = Float64(1.0 / (x ^ 1.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;
	elseif (x <= 5.5e+102)
		tmp = 0.5 * sqrt((1.0 / (x ^ 3.0)));
	else
		tmp = 1.0 / (x ^ 1.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], If[LessEqual[x, 5.5e+102], N[(0.5 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[x, 1.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\


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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

        \[\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. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < x < 5.49999999999999981e102

    1. Initial program 13.7%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff13.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-identity13.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-neg13.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-identity13.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/213.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-flip13.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-eval13.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/213.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-flip14.1%

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

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

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

      \[\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. associate-+l-14.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}} \]

    if 5.49999999999999981e102 < x

    1. Initial program 47.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{\color{blue}{1 + x}}} \cdot \left(-\frac{1}{\sqrt{x + 1}}\right)}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      9. distribute-neg-frac25.0%

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      12. pow1/225.0%

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      2. associate-*l/28.0%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      4. associate-/l/28.5%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      6. sub-neg47.1%

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

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

        \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      9. sub-neg47.1%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{\color{blue}{{x}^{-0.5} + \left(-\frac{-1}{\sqrt{1 + x}}\right)}} \]
      10. distribute-neg-frac47.1%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \color{blue}{\frac{--1}{\sqrt{1 + x}}}} \]
      11. metadata-eval47.1%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{{x}^{3}}}} \]
    7. Step-by-step derivation
      1. sqrt-div47.1%

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

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

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

        \[\leadsto \frac{1}{{x}^{\color{blue}{1.5}}} \]
    8. Applied egg-rr53.2%

      \[\leadsto \color{blue}{\frac{1}{{x}^{1.5}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.7%

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

Alternative 5: 85.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\


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

    1. Initial program 98.6%

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

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

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

        \[\leadsto 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]
      4. prod-diff98.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-identity98.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-neg98.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-identity98.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/298.6%

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

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

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

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

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

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

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

      \[\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. associate-+l-99.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.42e8 < x < 5.49999999999999981e102

    1. Initial program 5.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{\color{blue}{{x}^{0.5}}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
      9. pow-flip5.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-eval5.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/25.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-flip5.4%

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

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

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

      \[\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. associate-+l-5.4%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}} \]

    if 5.49999999999999981e102 < x

    1. Initial program 47.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{\color{blue}{1 + x}}} \cdot \left(-\frac{1}{\sqrt{x + 1}}\right)}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      9. distribute-neg-frac25.0%

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      12. pow1/225.0%

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      2. associate-*l/28.0%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      4. associate-/l/28.5%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      6. sub-neg47.1%

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

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

        \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      9. sub-neg47.1%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{\color{blue}{{x}^{-0.5} + \left(-\frac{-1}{\sqrt{1 + x}}\right)}} \]
      10. distribute-neg-frac47.1%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \color{blue}{\frac{--1}{\sqrt{1 + x}}}} \]
      11. metadata-eval47.1%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{{x}^{3}}}} \]
    7. Step-by-step derivation
      1. sqrt-div47.1%

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

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

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

        \[\leadsto \frac{1}{{x}^{\color{blue}{1.5}}} \]
    8. Applied egg-rr53.2%

      \[\leadsto \color{blue}{\frac{1}{{x}^{1.5}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 142000000:\\ \;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+102}:\\ \;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{1.5}}\\ \end{array} \]

Alternative 6: 71.7% accurate, 1.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\


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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

        \[\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. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.44999999999999996 < x

    1. Initial program 36.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      12. pow1/221.6%

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      2. associate-*l/23.6%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      4. associate-/l/23.8%

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      5. rem-square-sqrt36.4%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      6. sub-neg36.4%

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

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

        \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      9. sub-neg36.4%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{\color{blue}{{x}^{-0.5} + \left(-\frac{-1}{\sqrt{1 + x}}\right)}} \]
      10. distribute-neg-frac36.4%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \color{blue}{\frac{--1}{\sqrt{1 + x}}}} \]
      11. metadata-eval36.4%

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{{x}^{3}}}} \]
      2. metadata-eval37.8%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{{x}^{3}}} \]
      3. sqrt-pow142.0%

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

        \[\leadsto \frac{1}{{x}^{\color{blue}{1.5}}} \]
    8. Applied egg-rr42.0%

      \[\leadsto \color{blue}{\frac{1}{{x}^{1.5}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.6%

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

Alternative 7: 71.5% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{x}^{-1.5}\\


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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

        \[\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. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.839999999999999969 < x

    1. Initial program 36.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      12. pow1/221.6%

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      2. associate-*l/23.6%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      4. associate-/l/23.8%

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      5. rem-square-sqrt36.4%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      6. sub-neg36.4%

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

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

        \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      9. sub-neg36.4%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{\color{blue}{{x}^{-0.5} + \left(-\frac{-1}{\sqrt{1 + x}}\right)}} \]
      10. distribute-neg-frac36.4%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \color{blue}{\frac{--1}{\sqrt{1 + x}}}} \]
      11. metadata-eval36.4%

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

      \[\leadsto \color{blue}{\frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \frac{1}{\sqrt{1 + x}}}} \]
    6. Step-by-step derivation
      1. frac-add38.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{{x}^{3}}}} \]
    9. Step-by-step derivation
      1. unpow-137.8%

        \[\leadsto \sqrt{\color{blue}{{\left({x}^{3}\right)}^{-1}}} \]
      2. exp-to-pow37.8%

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

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

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

        \[\leadsto \sqrt{e^{\color{blue}{\left(\log x \cdot 3\right)} \cdot -1}} \]
      6. associate-*l*37.9%

        \[\leadsto \sqrt{e^{\color{blue}{\log x \cdot \left(3 \cdot -1\right)}}} \]
      7. metadata-eval37.9%

        \[\leadsto \sqrt{e^{\log x \cdot \color{blue}{-3}}} \]
      8. exp-to-pow37.9%

        \[\leadsto \sqrt{\color{blue}{{x}^{-3}}} \]
      9. metadata-eval37.9%

        \[\leadsto \sqrt{{x}^{\color{blue}{\left(2 \cdot -1.5\right)}}} \]
      10. pow-sqr37.9%

        \[\leadsto \sqrt{\color{blue}{{x}^{-1.5} \cdot {x}^{-1.5}}} \]
      11. rem-sqrt-square42.0%

        \[\leadsto \color{blue}{\left|{x}^{-1.5}\right|} \]
      12. rem-square-sqrt42.0%

        \[\leadsto \left|\color{blue}{\sqrt{{x}^{-1.5}} \cdot \sqrt{{x}^{-1.5}}}\right| \]
      13. fabs-sqr42.0%

        \[\leadsto \color{blue}{\sqrt{{x}^{-1.5}} \cdot \sqrt{{x}^{-1.5}}} \]
      14. rem-square-sqrt42.0%

        \[\leadsto \color{blue}{{x}^{-1.5}} \]
    10. Simplified42.0%

      \[\leadsto \color{blue}{{x}^{-1.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.4%

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

Alternative 8: 71.5% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\


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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

        \[\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. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.839999999999999969 < x

    1. Initial program 36.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      12. pow1/221.6%

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      2. associate-*l/23.6%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      4. associate-/l/23.8%

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      5. rem-square-sqrt36.4%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      6. sub-neg36.4%

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

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

        \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      9. sub-neg36.4%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{\color{blue}{{x}^{-0.5} + \left(-\frac{-1}{\sqrt{1 + x}}\right)}} \]
      10. distribute-neg-frac36.4%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \color{blue}{\frac{--1}{\sqrt{1 + x}}}} \]
      11. metadata-eval36.4%

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{{x}^{3}}}} \]
      2. metadata-eval37.8%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{{x}^{3}}} \]
      3. sqrt-pow142.0%

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

        \[\leadsto \frac{1}{{x}^{\color{blue}{1.5}}} \]
    8. Applied egg-rr42.0%

      \[\leadsto \color{blue}{\frac{1}{{x}^{1.5}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.4%

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

Alternative 9: 70.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;{x}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-1.5}\\ \end{array} \end{array} \]
(FPCore (x) :precision binary64 (if (<= x 1.0) (pow x -0.5) (pow x -1.5)))
double code(double x) {
	double tmp;
	if (x <= 1.0) {
		tmp = pow(x, -0.5);
	} else {
		tmp = pow(x, -1.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)
    else
        tmp = x ** (-1.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);
	} else {
		tmp = Math.pow(x, -1.5);
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 1.0:
		tmp = math.pow(x, -0.5)
	else:
		tmp = math.pow(x, -1.5)
	return tmp
function code(x)
	tmp = 0.0
	if (x <= 1.0)
		tmp = x ^ -0.5;
	else
		tmp = x ^ -1.5;
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 1.0)
		tmp = x ^ -0.5;
	else
		tmp = x ^ -1.5;
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, 1.0], N[Power[x, -0.5], $MachinePrecision], N[Power[x, -1.5], $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;{x}^{-1.5}\\


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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({x}^{0.25}\right)}^{-2}} - \frac{1}{\sqrt{x + 1}} \]
    6. Taylor expanded in x around inf 95.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{x}^{-0.5}} \]
    10. Simplified96.0%

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

    if 1 < x

    1. Initial program 36.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
      12. pow1/221.6%

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

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

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

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

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      2. associate-*l/23.6%

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

        \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      4. associate-/l/23.8%

        \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{1}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      5. rem-square-sqrt36.4%

        \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      6. sub-neg36.4%

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

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

        \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
      9. sub-neg36.4%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{\color{blue}{{x}^{-0.5} + \left(-\frac{-1}{\sqrt{1 + x}}\right)}} \]
      10. distribute-neg-frac36.4%

        \[\leadsto \frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \color{blue}{\frac{--1}{\sqrt{1 + x}}}} \]
      11. metadata-eval36.4%

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

      \[\leadsto \color{blue}{\frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \frac{1}{\sqrt{1 + x}}}} \]
    6. Step-by-step derivation
      1. frac-add38.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{{x}^{3}}}} \]
    9. Step-by-step derivation
      1. unpow-137.8%

        \[\leadsto \sqrt{\color{blue}{{\left({x}^{3}\right)}^{-1}}} \]
      2. exp-to-pow37.8%

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

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

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

        \[\leadsto \sqrt{e^{\color{blue}{\left(\log x \cdot 3\right)} \cdot -1}} \]
      6. associate-*l*37.9%

        \[\leadsto \sqrt{e^{\color{blue}{\log x \cdot \left(3 \cdot -1\right)}}} \]
      7. metadata-eval37.9%

        \[\leadsto \sqrt{e^{\log x \cdot \color{blue}{-3}}} \]
      8. exp-to-pow37.9%

        \[\leadsto \sqrt{\color{blue}{{x}^{-3}}} \]
      9. metadata-eval37.9%

        \[\leadsto \sqrt{{x}^{\color{blue}{\left(2 \cdot -1.5\right)}}} \]
      10. pow-sqr37.9%

        \[\leadsto \sqrt{\color{blue}{{x}^{-1.5} \cdot {x}^{-1.5}}} \]
      11. rem-sqrt-square42.0%

        \[\leadsto \color{blue}{\left|{x}^{-1.5}\right|} \]
      12. rem-square-sqrt42.0%

        \[\leadsto \left|\color{blue}{\sqrt{{x}^{-1.5}} \cdot \sqrt{{x}^{-1.5}}}\right| \]
      13. fabs-sqr42.0%

        \[\leadsto \color{blue}{\sqrt{{x}^{-1.5}} \cdot \sqrt{{x}^{-1.5}}} \]
      14. rem-square-sqrt42.0%

        \[\leadsto \color{blue}{{x}^{-1.5}} \]
    10. Simplified42.0%

      \[\leadsto \color{blue}{{x}^{-1.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.8%

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

Alternative 10: 25.1% accurate, 2.0× speedup?

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

\\
{x}^{-1.5}
\end{array}
Derivation
  1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
    12. pow1/260.1%

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    2. associate-*l/61.1%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    4. associate-/l/61.2%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    6. sub-neg67.5%

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

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

      \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    9. sub-neg67.5%

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \frac{1}{\sqrt{1 + x}}}} \]
  6. Step-by-step derivation
    1. frac-add68.5%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{\frac{1}{{x}^{3}}}} \]
  9. Step-by-step derivation
    1. unpow-121.7%

      \[\leadsto \sqrt{\color{blue}{{\left({x}^{3}\right)}^{-1}}} \]
    2. exp-to-pow21.7%

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

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

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

      \[\leadsto \sqrt{e^{\color{blue}{\left(\log x \cdot 3\right)} \cdot -1}} \]
    6. associate-*l*21.8%

      \[\leadsto \sqrt{e^{\color{blue}{\log x \cdot \left(3 \cdot -1\right)}}} \]
    7. metadata-eval21.8%

      \[\leadsto \sqrt{e^{\log x \cdot \color{blue}{-3}}} \]
    8. exp-to-pow21.8%

      \[\leadsto \sqrt{\color{blue}{{x}^{-3}}} \]
    9. metadata-eval21.8%

      \[\leadsto \sqrt{{x}^{\color{blue}{\left(2 \cdot -1.5\right)}}} \]
    10. pow-sqr21.8%

      \[\leadsto \sqrt{\color{blue}{{x}^{-1.5} \cdot {x}^{-1.5}}} \]
    11. rem-sqrt-square23.9%

      \[\leadsto \color{blue}{\left|{x}^{-1.5}\right|} \]
    12. rem-square-sqrt23.9%

      \[\leadsto \left|\color{blue}{\sqrt{{x}^{-1.5}} \cdot \sqrt{{x}^{-1.5}}}\right| \]
    13. fabs-sqr23.9%

      \[\leadsto \color{blue}{\sqrt{{x}^{-1.5}} \cdot \sqrt{{x}^{-1.5}}} \]
    14. rem-square-sqrt23.9%

      \[\leadsto \color{blue}{{x}^{-1.5}} \]
  10. Simplified23.9%

    \[\leadsto \color{blue}{{x}^{-1.5}} \]
  11. Final simplification23.9%

    \[\leadsto {x}^{-1.5} \]

Alternative 11: 7.4% accurate, 69.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \frac{-1}{\sqrt{1 + x}} \cdot \frac{-1}{\sqrt{\color{blue}{1 + x}}}}{\frac{1}{\sqrt{x}} - \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
    12. pow1/260.1%

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

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

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

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

      \[\leadsto \frac{\frac{1}{x} - \color{blue}{\frac{\frac{-1}{\sqrt{1 + x}} \cdot -1}{\sqrt{1 + x}}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    2. associate-*l/61.1%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{\frac{\color{blue}{1}}{\sqrt{1 + x}}}{\sqrt{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    4. associate-/l/61.2%

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

      \[\leadsto \frac{\frac{1}{x} - \frac{1}{\color{blue}{1 + x}}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    6. sub-neg67.5%

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

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

      \[\leadsto \frac{\frac{1}{x} + \frac{\color{blue}{-1}}{1 + x}}{{x}^{-0.5} - \frac{-1}{\sqrt{1 + x}}} \]
    9. sub-neg67.5%

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x} + \frac{-1}{1 + x}}{{x}^{-0.5} + \frac{1}{\sqrt{1 + x}}}} \]
  6. Taylor expanded in x around 0 52.2%

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

      \[\leadsto \frac{1}{\color{blue}{1 \cdot x + {x}^{-0.5} \cdot x}} \]
    2. *-lft-identity52.2%

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

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

      \[\leadsto \frac{1}{x + {x}^{\color{blue}{0.5}}} \]
  8. Simplified52.4%

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

    \[\leadsto \frac{1}{\color{blue}{x}} \]
  10. Final simplification7.3%

    \[\leadsto \frac{1}{x} \]

Developer target: 98.9% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023320 
(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)))))