\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \leq 0:\\
\;\;\;\;0.5 \cdot {x}^{-1.5}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \frac{1}{x + \left(1 + \sqrt{x + x \cdot x}\right)}\\
\end{array}
\]
(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
↓
(FPCore (x)
:precision binary64
(if (<= (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))) 0.0)
(* 0.5 (pow x -1.5))
(* (pow x -0.5) (/ 1.0 (+ x (+ 1.0 (sqrt (+ x (* x x)))))))))
double code(double x) {
return (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
}
↓
double code(double x) {
double tmp;
if (((1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)))) <= 0.0) {
tmp = 0.5 * pow(x, -1.5);
} else {
tmp = pow(x, -0.5) * (1.0 / (x + (1.0 + sqrt((x + (x * x))))));
}
return tmp;
}
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
real(8) :: tmp
if (((1.0d0 / sqrt(x)) - (1.0d0 / sqrt((x + 1.0d0)))) <= 0.0d0) then
tmp = 0.5d0 * (x ** (-1.5d0))
else
tmp = (x ** (-0.5d0)) * (1.0d0 / (x + (1.0d0 + sqrt((x + (x * x))))))
end if
code = tmp
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) {
double tmp;
if (((1.0 / Math.sqrt(x)) - (1.0 / Math.sqrt((x + 1.0)))) <= 0.0) {
tmp = 0.5 * Math.pow(x, -1.5);
} else {
tmp = Math.pow(x, -0.5) * (1.0 / (x + (1.0 + Math.sqrt((x + (x * x))))));
}
return tmp;
}
def code(x):
return (1.0 / math.sqrt(x)) - (1.0 / math.sqrt((x + 1.0)))
↓
def code(x):
tmp = 0
if ((1.0 / math.sqrt(x)) - (1.0 / math.sqrt((x + 1.0)))) <= 0.0:
tmp = 0.5 * math.pow(x, -1.5)
else:
tmp = math.pow(x, -0.5) * (1.0 / (x + (1.0 + math.sqrt((x + (x * x))))))
return tmp
function code(x)
return Float64(Float64(1.0 / sqrt(x)) - Float64(1.0 / sqrt(Float64(x + 1.0))))
end
↓
function code(x)
tmp = 0.0
if (Float64(Float64(1.0 / sqrt(x)) - Float64(1.0 / sqrt(Float64(x + 1.0)))) <= 0.0)
tmp = Float64(0.5 * (x ^ -1.5));
else
tmp = Float64((x ^ -0.5) * Float64(1.0 / Float64(x + Float64(1.0 + sqrt(Float64(x + Float64(x * x)))))));
end
return tmp
end
function tmp = code(x)
tmp = (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
end
↓
function tmp_2 = code(x)
tmp = 0.0;
if (((1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)))) <= 0.0)
tmp = 0.5 * (x ^ -1.5);
else
tmp = (x ^ -0.5) * (1.0 / (x + (1.0 + sqrt((x + (x * x))))));
end
tmp_2 = tmp;
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_] := If[LessEqual[N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(0.5 * N[Power[x, -1.5], $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.5], $MachinePrecision] * N[(1.0 / N[(x + N[(1.0 + N[Sqrt[N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
↓
\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \leq 0:\\
\;\;\;\;0.5 \cdot {x}^{-1.5}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \frac{1}{x + \left(1 + \sqrt{x + x \cdot x}\right)}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.0 |
|---|
| Cost | 27012 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \leq 0:\\
\;\;\;\;0.5 \cdot {x}^{-1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{-0.5}}{1 + \left(x + \sqrt{x + x \cdot x}\right)}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.2 |
|---|
| Cost | 26756 |
|---|
\[\begin{array}{l}
t_0 := \sqrt{x + 1}\\
\mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{t_0} \leq 5 \cdot 10^{-11}:\\
\;\;\;\;\frac{{x}^{-0.5}}{1 + \left(x + \left(x + \left(0.5 - \frac{0.125}{x}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{t_0}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.2 |
|---|
| Cost | 26368 |
|---|
\[\begin{array}{l}
t_0 := \sqrt{x + 1}\\
\frac{{x}^{-0.5}}{t_0 \cdot \left(\sqrt{x} + t_0\right)}
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.4 |
|---|
| Cost | 13760 |
|---|
\[\frac{\frac{1}{x}}{\left(x + 1\right) \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)}
\]
| Alternative 5 |
|---|
| Error | 0.1 |
|---|
| Cost | 13380 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 5000:\\
\;\;\;\;{x}^{-0.5} - {\left(x + 1\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{-0.5}}{1 + \left(x + \left(x + \left(0.5 - \frac{0.125}{x}\right)\right)\right)}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.5 |
|---|
| Cost | 7812 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.43:\\
\;\;\;\;{x}^{-0.5} - \left(1 + x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{-0.5}}{1 + \left(x + \left(\left(0.5 - \frac{0.125}{x}\right) + \left(x + \frac{0.0625}{x \cdot x}\right)\right)\right)}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 0.5 |
|---|
| Cost | 7428 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.42:\\
\;\;\;\;{x}^{-0.5} - \left(1 + x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{-0.5}}{1 + \left(x + \left(x + \left(0.5 - \frac{0.125}{x}\right)\right)\right)}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 0.6 |
|---|
| Cost | 7172 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.41:\\
\;\;\;\;{x}^{-0.5} - \left(1 + x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{-0.5}}{1 + \left(0.5 + x \cdot 2\right)}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 1.0 |
|---|
| Cost | 7044 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;{x}^{-0.5} - \left(1 + x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-1.5}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 2.2 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.5:\\
\;\;\;\;{x}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-1.5}\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 1.2 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.66:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-1.5}\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 31.6 |
|---|
| Cost | 6528 |
|---|
\[{x}^{-0.5}
\]
| Alternative 13 |
|---|
| Error | 61.5 |
|---|
| Cost | 192 |
|---|
\[x \cdot 0.5
\]
| Alternative 14 |
|---|
| Error | 62.8 |
|---|
| Cost | 64 |
|---|
\[-1
\]