2isqrt (example 3.6)

Percentage Accurate: 69.9% → 99.7%
Time: 11.2s
Alternatives: 15
Speedup: 1.9×

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 15 alternatives:

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

Initial Program: 69.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: 99.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ {x}^{-0.5} \cdot \frac{{x}^{-0.5}}{\mathsf{fma}\left({x}^{-0.5}, x + 1, \sqrt{x + 1}\right)} \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (pow x -0.5)
  (/ (pow x -0.5) (fma (pow x -0.5) (+ x 1.0) (sqrt (+ x 1.0))))))
double code(double x) {
	return pow(x, -0.5) * (pow(x, -0.5) / fma(pow(x, -0.5), (x + 1.0), sqrt((x + 1.0))));
}
function code(x)
	return Float64((x ^ -0.5) * Float64((x ^ -0.5) / fma((x ^ -0.5), Float64(x + 1.0), sqrt(Float64(x + 1.0)))))
end
code[x_] := N[(N[Power[x, -0.5], $MachinePrecision] * N[(N[Power[x, -0.5], $MachinePrecision] / N[(N[Power[x, -0.5], $MachinePrecision] * N[(x + 1.0), $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. add-exp-log52.0%

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{\log \left(\frac{1}{\sqrt{x + 1}}\right)}} \]
    2. inv-pow52.0%

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
  4. Step-by-step derivation
    1. exp-prod52.3%

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\log \left(1 + x\right)} \cdot \log \left(e^{-0.5}\right)}\right)} - 1\right) \]
    6. add-log-exp51.9%

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(x + 1\right)}^{-0.5}} \]
  10. Step-by-step derivation
    1. flip--63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(x, x, x\right)}{x + \left(1 - x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}}} \]
    2. associate-/r/68.8%

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

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    4. associate-*r/68.8%

      \[\leadsto \frac{\color{blue}{\frac{\left(x + \left(1 - x\right)\right) \cdot 1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    5. *-rgt-identity68.8%

      \[\leadsto \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\mathsf{fma}\left(x, x, x\right)}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    6. associate-/r*68.8%

      \[\leadsto \color{blue}{\frac{x + \left(1 - x\right)}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)}} \]
    7. *-rgt-identity68.8%

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot 1}}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)} \]
    8. associate-/l*68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \frac{\frac{1}{x}}{\mathsf{fma}\left({x}^{-0.5}, x + 1, \sqrt{x + 1}\right)} \end{array} \]
(FPCore (x)
 :precision binary64
 (/ (/ 1.0 x) (fma (pow x -0.5) (+ x 1.0) (sqrt (+ x 1.0)))))
double code(double x) {
	return (1.0 / x) / fma(pow(x, -0.5), (x + 1.0), sqrt((x + 1.0)));
}
function code(x)
	return Float64(Float64(1.0 / x) / fma((x ^ -0.5), Float64(x + 1.0), sqrt(Float64(x + 1.0))))
end
code[x_] := N[(N[(1.0 / x), $MachinePrecision] / N[(N[Power[x, -0.5], $MachinePrecision] * N[(x + 1.0), $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. add-exp-log52.0%

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{\log \left(\frac{1}{\sqrt{x + 1}}\right)}} \]
    2. inv-pow52.0%

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
  4. Step-by-step derivation
    1. exp-prod52.3%

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\log \left(1 + x\right)} \cdot \log \left(e^{-0.5}\right)}\right)} - 1\right) \]
    6. add-log-exp51.9%

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(x + 1\right)}^{-0.5}} \]
  10. Step-by-step derivation
    1. flip--63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(x, x, x\right)}{x + \left(1 - x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}}} \]
    2. associate-/r/68.8%

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

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    4. associate-*r/68.8%

      \[\leadsto \frac{\color{blue}{\frac{\left(x + \left(1 - x\right)\right) \cdot 1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    5. *-rgt-identity68.8%

      \[\leadsto \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\mathsf{fma}\left(x, x, x\right)}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    6. associate-/r*68.8%

      \[\leadsto \color{blue}{\frac{x + \left(1 - x\right)}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)}} \]
    7. *-rgt-identity68.8%

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot 1}}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)} \]
    8. associate-/l*68.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{1 + x \cdot 0}{x}}{\mathsf{fma}\left({x}^{-0.5}, 1 + x, {\left(1 + x\right)}^{0.5}\right)}\right)} - 1} \]
    3. clear-num63.9%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1}{\frac{\mathsf{fma}\left({x}^{-0.5}, 1 + x, {\left(1 + x\right)}^{0.5}\right)}{\frac{1 + x \cdot 0}{x}}}}\right)} - 1 \]
    4. mul0-rgt63.9%

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

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

      \[\leadsto e^{\mathsf{log1p}\left(\frac{1}{\color{blue}{\mathsf{fma}\left({x}^{-0.5}, 1 + x, {\left(1 + x\right)}^{0.5}\right) \cdot \frac{1}{\frac{1}{x}}}}\right)} - 1 \]
    7. unpow1/263.9%

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

      \[\leadsto e^{\mathsf{log1p}\left(\frac{1}{\mathsf{fma}\left({x}^{-0.5}, 1 + x, \sqrt{1 + x}\right) \cdot \color{blue}{\frac{x}{1}}}\right)} - 1 \]
    9. /-rgt-identity63.9%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{fma}\left({x}^{-0.5}, 1 + x, \sqrt{1 + x}\right)}} \]
  18. Final simplification99.4%

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

Alternative 3: 99.4% accurate, 1.0× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. add-exp-log52.0%

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{\log \left(\frac{1}{\sqrt{x + 1}}\right)}} \]
    2. inv-pow52.0%

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
  4. Step-by-step derivation
    1. exp-prod52.3%

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\log \left(1 + x\right)} \cdot \log \left(e^{-0.5}\right)}\right)} - 1\right) \]
    6. add-log-exp51.9%

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(x + 1\right)}^{-0.5}} \]
  10. Step-by-step derivation
    1. flip--63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(x, x, x\right)}{x + \left(1 - x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}}} \]
    2. associate-/r/68.8%

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

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    4. associate-*r/68.8%

      \[\leadsto \frac{\color{blue}{\frac{\left(x + \left(1 - x\right)\right) \cdot 1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    5. *-rgt-identity68.8%

      \[\leadsto \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\mathsf{fma}\left(x, x, x\right)}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
    6. associate-/r*68.8%

      \[\leadsto \color{blue}{\frac{x + \left(1 - x\right)}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)}} \]
    7. *-rgt-identity68.8%

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot 1}}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)} \]
    8. associate-/l*68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 91.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{x + 1}\\
\mathbf{if}\;x \leq 80000000:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x \cdot x}}{{x}^{-0.5} + \frac{1}{t_0}}\\


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

    1. Initial program 99.4%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-log-exp6.4%

        \[\leadsto \color{blue}{\log \left(e^{\frac{1}{\sqrt{x}}}\right)} - \frac{1}{\sqrt{x + 1}} \]
      2. *-un-lft-identity6.4%

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

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

        \[\leadsto \left(\color{blue}{0} + \log \left(e^{\frac{1}{\sqrt{x}}}\right)\right) - \frac{1}{\sqrt{x + 1}} \]
      5. add-log-exp99.4%

        \[\leadsto \left(0 + \color{blue}{\frac{1}{\sqrt{x}}}\right) - \frac{1}{\sqrt{x + 1}} \]
      6. pow1/299.4%

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

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

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

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

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

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

    if 8e7 < x

    1. Initial program 36.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 91.6% accurate, 1.0× speedup?

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

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

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

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

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

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

      \[\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-sqrt56.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-frac56.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-eval56.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. +-commutative56.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-frac56.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-eval56.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. +-commutative56.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/256.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-flip56.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 85.0% 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.8 \cdot 10^{+102}:\\ \;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + x \cdot 0}{x}}{\sqrt{x}}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 1.0)
   (+ (+ (pow x -0.5) (* x 0.5)) -1.0)
   (if (<= x 5.8e+102)
     (* 0.5 (sqrt (/ 1.0 (pow x 3.0))))
     (/ (/ (+ 1.0 (* x 0.0)) x) (sqrt x)))))
double code(double x) {
	double tmp;
	if (x <= 1.0) {
		tmp = (pow(x, -0.5) + (x * 0.5)) + -1.0;
	} else if (x <= 5.8e+102) {
		tmp = 0.5 * sqrt((1.0 / pow(x, 3.0)));
	} else {
		tmp = ((1.0 + (x * 0.0)) / x) / sqrt(x);
	}
	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.8d+102) then
        tmp = 0.5d0 * sqrt((1.0d0 / (x ** 3.0d0)))
    else
        tmp = ((1.0d0 + (x * 0.0d0)) / x) / sqrt(x)
    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.8e+102) {
		tmp = 0.5 * Math.sqrt((1.0 / Math.pow(x, 3.0)));
	} else {
		tmp = ((1.0 + (x * 0.0)) / x) / Math.sqrt(x);
	}
	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.8e+102:
		tmp = 0.5 * math.sqrt((1.0 / math.pow(x, 3.0)))
	else:
		tmp = ((1.0 + (x * 0.0)) / x) / math.sqrt(x)
	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.8e+102)
		tmp = Float64(0.5 * sqrt(Float64(1.0 / (x ^ 3.0))));
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(x * 0.0)) / x) / sqrt(x));
	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.8e+102)
		tmp = 0.5 * sqrt((1.0 / (x ^ 3.0)));
	else
		tmp = ((1.0 + (x * 0.0)) / x) / sqrt(x);
	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.8e+102], N[(0.5 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x * 0.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[x], $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.8 \cdot 10^{+102}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{{x}^{\left(\frac{-1}{2}\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. fma-udef100.0%

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

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

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

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

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

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

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

    if 1 < x < 5.8000000000000005e102

    1. Initial program 13.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{{x}^{\left(\frac{-1}{2}\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.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/213.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-flip13.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. +-commutative13.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-eval13.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-rr13.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. fma-udef13.1%

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

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

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

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

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

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

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

    if 5.8000000000000005e102 < x

    1. Initial program 48.7%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-exp-log4.4%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
    4. Step-by-step derivation
      1. exp-prod5.4%

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

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

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)\right)} \]
      2. expm1-udef4.5%

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)} - 1\right)} \]
      3. add-exp-log4.5%

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

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

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\log \left(1 + x\right)} \cdot \log \left(e^{-0.5}\right)}\right)} - 1\right) \]
      6. add-log-exp4.5%

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\log \left(1 + x\right) \cdot \color{blue}{-0.5}}\right)} - 1\right) \]
      7. pow-to-exp4.5%

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(x + 1\right)}^{-0.5}} \]
    10. Step-by-step derivation
      1. flip--35.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(x, x, x\right)}{x + \left(1 - x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}}} \]
      2. associate-/r/48.7%

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

        \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      4. associate-*r/48.7%

        \[\leadsto \frac{\color{blue}{\frac{\left(x + \left(1 - x\right)\right) \cdot 1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      5. *-rgt-identity48.7%

        \[\leadsto \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\mathsf{fma}\left(x, x, x\right)}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      6. associate-/r*48.7%

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

        \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot 1}}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)} \]
      8. associate-/l*48.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1 + x \cdot 0}{x}}{\mathsf{fma}\left({x}^{-0.5}, 1 + x, {\left(1 + x\right)}^{0.5}\right)}} \]
    14. Taylor expanded in x around inf 54.9%

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

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

Alternative 7: 85.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35e8 < x < 5.8000000000000005e102

    1. Initial program 7.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{{x}^{\left(\frac{-1}{2}\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-eval7.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)} \]
    4. Step-by-step derivation
      1. fma-udef7.3%

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

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

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

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

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

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

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

    if 5.8000000000000005e102 < x

    1. Initial program 48.7%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-exp-log4.4%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
    4. Step-by-step derivation
      1. exp-prod5.4%

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

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

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)\right)} \]
      2. expm1-udef4.5%

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)} - 1\right)} \]
      3. add-exp-log4.5%

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

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

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\log \left(1 + x\right)} \cdot \log \left(e^{-0.5}\right)}\right)} - 1\right) \]
      6. add-log-exp4.5%

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\log \left(1 + x\right) \cdot \color{blue}{-0.5}}\right)} - 1\right) \]
      7. pow-to-exp4.5%

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(x + 1\right)}^{-0.5}} \]
    10. Step-by-step derivation
      1. flip--35.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(x, x, x\right)}{x + \left(1 - x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}}} \]
      2. associate-/r/48.7%

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

        \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      4. associate-*r/48.7%

        \[\leadsto \frac{\color{blue}{\frac{\left(x + \left(1 - x\right)\right) \cdot 1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      5. *-rgt-identity48.7%

        \[\leadsto \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\mathsf{fma}\left(x, x, x\right)}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      6. associate-/r*48.7%

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

        \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot 1}}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)} \]
      8. associate-/l*48.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1 + x \cdot 0}{x}}{\mathsf{fma}\left({x}^{-0.5}, 1 + x, {\left(1 + x\right)}^{0.5}\right)}} \]
    14. Taylor expanded in x around inf 54.9%

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

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

Alternative 8: 85.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.4%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-log-exp6.4%

        \[\leadsto \color{blue}{\log \left(e^{\frac{1}{\sqrt{x}}}\right)} - \frac{1}{\sqrt{x + 1}} \]
      2. *-un-lft-identity6.4%

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

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

        \[\leadsto \left(\color{blue}{0} + \log \left(e^{\frac{1}{\sqrt{x}}}\right)\right) - \frac{1}{\sqrt{x + 1}} \]
      5. add-log-exp99.4%

        \[\leadsto \left(0 + \color{blue}{\frac{1}{\sqrt{x}}}\right) - \frac{1}{\sqrt{x + 1}} \]
      6. pow1/299.4%

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

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

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

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

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

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

    if 4.8e7 < x < 5.8000000000000005e102

    1. Initial program 7.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{{x}^{\left(\frac{-1}{2}\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-eval7.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)} \]
    4. Step-by-step derivation
      1. fma-udef7.3%

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

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

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

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

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

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

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

    if 5.8000000000000005e102 < x

    1. Initial program 48.7%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-exp-log4.4%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
    4. Step-by-step derivation
      1. exp-prod5.4%

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

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

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)\right)} \]
      2. expm1-udef4.5%

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)} - 1\right)} \]
      3. add-exp-log4.5%

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

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

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\log \left(1 + x\right)} \cdot \log \left(e^{-0.5}\right)}\right)} - 1\right) \]
      6. add-log-exp4.5%

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\log \left(1 + x\right) \cdot \color{blue}{-0.5}}\right)} - 1\right) \]
      7. pow-to-exp4.5%

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(x + 1\right)}^{-0.5}} \]
    10. Step-by-step derivation
      1. flip--35.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(x, x, x\right)}{x + \left(1 - x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}}} \]
      2. associate-/r/48.7%

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

        \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      4. associate-*r/48.7%

        \[\leadsto \frac{\color{blue}{\frac{\left(x + \left(1 - x\right)\right) \cdot 1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      5. *-rgt-identity48.7%

        \[\leadsto \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\mathsf{fma}\left(x, x, x\right)}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      6. associate-/r*48.7%

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

        \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot 1}}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)} \]
      8. associate-/l*48.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1 + x \cdot 0}{x}}{\mathsf{fma}\left({x}^{-0.5}, 1 + x, {\left(1 + x\right)}^{0.5}\right)}} \]
    14. Taylor expanded in x around inf 54.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 48000000:\\ \;\;\;\;{x}^{-0.5} + \frac{-1}{\sqrt{x + 1}}\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{+102}:\\ \;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + x \cdot 0}{x}}{\sqrt{x}}\\ \end{array} \]

Alternative 9: 72.7% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{{x}^{\left(\frac{-1}{2}\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. fma-udef100.0%

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

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

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

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

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

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

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

    if 1.5 < x

    1. Initial program 37.9%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-exp-log7.1%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
    4. Step-by-step derivation
      1. exp-prod7.9%

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

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

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)\right)} \]
      2. expm1-udef7.0%

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)} - 1\right)} \]
      3. add-exp-log7.0%

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

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\mathsf{log1p}\left(x\right) \cdot \log \left(e^{-0.5}\right)}}\right)} - 1\right) \]
      5. log1p-udef7.0%

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\log \left(1 + x\right)} \cdot \log \left(e^{-0.5}\right)}\right)} - 1\right) \]
      6. add-log-exp7.0%

        \[\leadsto \frac{1}{\sqrt{x}} - \left(e^{\mathsf{log1p}\left(e^{\log \left(1 + x\right) \cdot \color{blue}{-0.5}}\right)} - 1\right) \]
      7. pow-to-exp7.0%

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(x + 1\right)}^{-0.5}} \]
    10. Step-by-step derivation
      1. flip--28.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(x, x, x\right)}{x + \left(1 - x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}}} \]
      2. associate-/r/40.2%

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

        \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      4. associate-*r/40.2%

        \[\leadsto \frac{\color{blue}{\frac{\left(x + \left(1 - x\right)\right) \cdot 1}{\mathsf{fma}\left(x, x, x\right)}}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      5. *-rgt-identity40.2%

        \[\leadsto \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\mathsf{fma}\left(x, x, x\right)}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \]
      6. associate-/r*40.2%

        \[\leadsto \color{blue}{\frac{x + \left(1 - x\right)}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)}} \]
      7. *-rgt-identity40.2%

        \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot 1}}{\mathsf{fma}\left(x, x, x\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)} \]
      8. associate-/l*40.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1 + x \cdot 0}{x}}{\mathsf{fma}\left({x}^{-0.5}, 1 + x, {\left(1 + x\right)}^{0.5}\right)}} \]
    14. Taylor expanded in x around inf 43.9%

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

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

Alternative 10: 69.0% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x + {x}^{\color{blue}{0.5}}}}{1 + x} \]
    11. unpow1/266.9%

      \[\leadsto \frac{\frac{1}{x + \color{blue}{\sqrt{x}}}}{1 + x} \]
  11. Simplified66.9%

    \[\leadsto \color{blue}{\frac{\frac{1}{x + \sqrt{x}}}{1 + x}} \]
  12. Final simplification66.9%

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

Alternative 11: 67.2% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-{\left(x \cdot x\right)}^{-0.25}\\


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

    1. Initial program 69.6%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-log-exp5.4%

        \[\leadsto \color{blue}{\log \left(e^{\frac{1}{\sqrt{x}}}\right)} - \frac{1}{\sqrt{x + 1}} \]
      2. *-un-lft-identity5.4%

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

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

        \[\leadsto \left(\color{blue}{0} + \log \left(e^{\frac{1}{\sqrt{x}}}\right)\right) - \frac{1}{\sqrt{x + 1}} \]
      5. add-log-exp69.6%

        \[\leadsto \left(0 + \color{blue}{\frac{1}{\sqrt{x}}}\right) - \frac{1}{\sqrt{x + 1}} \]
      6. pow1/269.6%

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < x

    1. Initial program 63.1%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-exp-log4.4%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
    4. Step-by-step derivation
      1. exp-prod5.8%

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}} \]
    5. Simplified5.8%

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

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

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

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

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

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

        \[\leadsto -{x}^{\color{blue}{-0.5}} \]
      4. sqr-pow4.0%

        \[\leadsto -\color{blue}{{x}^{\left(\frac{-0.5}{2}\right)} \cdot {x}^{\left(\frac{-0.5}{2}\right)}} \]
      5. pow-prod-down63.1%

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

        \[\leadsto -{\left(x \cdot x\right)}^{\color{blue}{-0.25}} \]
    10. Applied egg-rr63.1%

      \[\leadsto -\color{blue}{{\left(x \cdot x\right)}^{-0.25}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.9%

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

Alternative 12: 68.6% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-{\left(x \cdot x\right)}^{-0.25}\\


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

    1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{x} + {x}^{-0.5} \cdot x} \]
      5. pow-plus68.2%

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

        \[\leadsto \frac{1}{x + {x}^{\color{blue}{0.5}}} \]
      7. unpow1/268.2%

        \[\leadsto \frac{1}{x + \color{blue}{\sqrt{x}}} \]
    10. Simplified68.2%

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

    if 1.35000000000000003e154 < x

    1. Initial program 63.1%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Step-by-step derivation
      1. add-exp-log4.4%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-0.5 \cdot \mathsf{log1p}\left(x\right)}} \]
    4. Step-by-step derivation
      1. exp-prod5.8%

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{{\left(e^{-0.5}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}} \]
    5. Simplified5.8%

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

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

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

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

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

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

        \[\leadsto -{x}^{\color{blue}{-0.5}} \]
      4. sqr-pow4.0%

        \[\leadsto -\color{blue}{{x}^{\left(\frac{-0.5}{2}\right)} \cdot {x}^{\left(\frac{-0.5}{2}\right)}} \]
      5. pow-prod-down63.1%

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

        \[\leadsto -{\left(x \cdot x\right)}^{\color{blue}{-0.25}} \]
    10. Applied egg-rr63.1%

      \[\leadsto -\color{blue}{{\left(x \cdot x\right)}^{-0.25}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.8%

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

Alternative 13: 50.7% accurate, 2.0× speedup?

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

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

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Step-by-step derivation
    1. add-log-exp5.0%

      \[\leadsto \color{blue}{\log \left(e^{\frac{1}{\sqrt{x}}}\right)} - \frac{1}{\sqrt{x + 1}} \]
    2. *-un-lft-identity5.0%

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

      \[\leadsto \color{blue}{\left(\log 1 + \log \left(e^{\frac{1}{\sqrt{x}}}\right)\right)} - \frac{1}{\sqrt{x + 1}} \]
    4. metadata-eval5.0%

      \[\leadsto \left(\color{blue}{0} + \log \left(e^{\frac{1}{\sqrt{x}}}\right)\right) - \frac{1}{\sqrt{x + 1}} \]
    5. add-log-exp67.9%

      \[\leadsto \left(0 + \color{blue}{\frac{1}{\sqrt{x}}}\right) - \frac{1}{\sqrt{x + 1}} \]
    6. pow1/267.9%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{\frac{1}{x}}} \]
  7. Final simplification50.0%

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

Alternative 14: 3.9% accurate, 69.7× speedup?

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

\\
x \cdot 0.5
\end{array}
Derivation
  1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot 0.5} \]
  9. Simplified3.8%

    \[\leadsto \color{blue}{x \cdot 0.5} \]
  10. Final simplification3.8%

    \[\leadsto x \cdot 0.5 \]

Alternative 15: 1.9% accurate, 209.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-1} \]
  4. Final simplification2.0%

    \[\leadsto -1 \]

Developer target: 99.1% 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 2023268 
(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)))))