\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\]
↓
\[\frac{{x}^{-0.5}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \cdot \frac{{x}^{-0.5}}{x + 1}
\]
(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
↓
(FPCore (x)
:precision binary64
(*
(/ (pow x -0.5) (+ (pow x -0.5) (pow (+ x 1.0) -0.5)))
(/ (pow x -0.5) (+ x 1.0))))
double code(double x) {
return (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
}
↓
double code(double x) {
return (pow(x, -0.5) / (pow(x, -0.5) + pow((x + 1.0), -0.5))) * (pow(x, -0.5) / (x + 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / sqrt(x)) - (1.0d0 / sqrt((x + 1.0d0)))
end function
↓
real(8) function code(x)
real(8), intent (in) :: x
code = ((x ** (-0.5d0)) / ((x ** (-0.5d0)) + ((x + 1.0d0) ** (-0.5d0)))) * ((x ** (-0.5d0)) / (x + 1.0d0))
end function
public static double code(double x) {
return (1.0 / Math.sqrt(x)) - (1.0 / Math.sqrt((x + 1.0)));
}
↓
public static double code(double x) {
return (Math.pow(x, -0.5) / (Math.pow(x, -0.5) + Math.pow((x + 1.0), -0.5))) * (Math.pow(x, -0.5) / (x + 1.0));
}
def code(x):
return (1.0 / math.sqrt(x)) - (1.0 / math.sqrt((x + 1.0)))
↓
def code(x):
return (math.pow(x, -0.5) / (math.pow(x, -0.5) + math.pow((x + 1.0), -0.5))) * (math.pow(x, -0.5) / (x + 1.0))
function code(x)
return Float64(Float64(1.0 / sqrt(x)) - Float64(1.0 / sqrt(Float64(x + 1.0))))
end
↓
function code(x)
return Float64(Float64((x ^ -0.5) / Float64((x ^ -0.5) + (Float64(x + 1.0) ^ -0.5))) * Float64((x ^ -0.5) / Float64(x + 1.0)))
end
function tmp = code(x)
tmp = (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
end
↓
function tmp = code(x)
tmp = ((x ^ -0.5) / ((x ^ -0.5) + ((x + 1.0) ^ -0.5))) * ((x ^ -0.5) / (x + 1.0));
end
code[x_] := N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_] := N[(N[(N[Power[x, -0.5], $MachinePrecision] / N[(N[Power[x, -0.5], $MachinePrecision] + N[Power[N[(x + 1.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[x, -0.5], $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
↓
\frac{{x}^{-0.5}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \cdot \frac{{x}^{-0.5}}{x + 1}
Alternatives
| Alternative 1 |
|---|
| Error | 5.4 |
|---|
| Cost | 26692 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{x + 1}} \leq 2 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{\frac{1 + \left(x - x\right)}{x}}{x + 1}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - {\left(x + 1\right)}^{-0.5}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.4 |
|---|
| Cost | 20096 |
|---|
\[\frac{\frac{{x}^{-1}}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}}}{x + 1}
\]
| Alternative 3 |
|---|
| Error | 0.5 |
|---|
| Cost | 13888 |
|---|
\[\frac{1}{x} \cdot \frac{1}{\left(x + 1\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)}
\]
| Alternative 4 |
|---|
| Error | 6.0 |
|---|
| Cost | 7620 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.06588527500348274:\\
\;\;\;\;x \cdot 0.5 + \left({x}^{-0.5} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1 + \left(x - x\right)}{x}}{x + 1}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 6.5 |
|---|
| Cost | 7236 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.06588527500348274:\\
\;\;\;\;x \cdot 0.5 + \left({x}^{-0.5} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x \cdot x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 6.5 |
|---|
| Cost | 7172 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.06588527500348274:\\
\;\;\;\;x \cdot 0.5 + \left({x}^{-0.5} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot x} \cdot \frac{0.5}{{x}^{-0.5}}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 20.6 |
|---|
| Cost | 7044 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.06588527500348274:\\
\;\;\;\;x \cdot 0.5 + \left({x}^{-0.5} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x \cdot \left(x + 1\right)}}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 20.7 |
|---|
| Cost | 6980 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.06588527500348274:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x \cdot \left(x + 1\right)}}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 30.1 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.06588527500348274:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 30.4 |
|---|
| Cost | 6720 |
|---|
\[\frac{1}{x + \sqrt{x}}
\]
| Alternative 11 |
|---|
| Error | 31.7 |
|---|
| Cost | 6528 |
|---|
\[{x}^{-0.5}
\]
| Alternative 12 |
|---|
| Error | 59.3 |
|---|
| Cost | 192 |
|---|
\[\frac{1}{x}
\]
| Alternative 13 |
|---|
| Error | 62.8 |
|---|
| Cost | 64 |
|---|
\[-1
\]