
(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:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (x) :precision binary64 (/ (* (+ 0.5 (/ (- (/ (+ 0.0625 (/ -0.0390625 x)) x) 0.125) x)) (pow (+ x 1.0) -0.5)) x))
double code(double x) {
return ((0.5 + ((((0.0625 + (-0.0390625 / x)) / x) - 0.125) / x)) * pow((x + 1.0), -0.5)) / x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((0.5d0 + ((((0.0625d0 + ((-0.0390625d0) / x)) / x) - 0.125d0) / x)) * ((x + 1.0d0) ** (-0.5d0))) / x
end function
public static double code(double x) {
return ((0.5 + ((((0.0625 + (-0.0390625 / x)) / x) - 0.125) / x)) * Math.pow((x + 1.0), -0.5)) / x;
}
def code(x): return ((0.5 + ((((0.0625 + (-0.0390625 / x)) / x) - 0.125) / x)) * math.pow((x + 1.0), -0.5)) / x
function code(x) return Float64(Float64(Float64(0.5 + Float64(Float64(Float64(Float64(0.0625 + Float64(-0.0390625 / x)) / x) - 0.125) / x)) * (Float64(x + 1.0) ^ -0.5)) / x) end
function tmp = code(x) tmp = ((0.5 + ((((0.0625 + (-0.0390625 / x)) / x) - 0.125) / x)) * ((x + 1.0) ^ -0.5)) / x; end
code[x_] := N[(N[(N[(0.5 + N[(N[(N[(N[(0.0625 + N[(-0.0390625 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.125), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * N[Power[N[(x + 1.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(0.5 + \frac{\frac{0.0625 + \frac{-0.0390625}{x}}{x} - 0.125}{x}\right) \cdot {\left(x + 1\right)}^{-0.5}}{x}
\end{array}
Initial program 40.3%
frac-sub40.4%
associate-/r*40.4%
*-un-lft-identity40.4%
*-rgt-identity40.4%
+-commutative40.4%
+-commutative40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 99.4%
associate--l+99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around -inf 99.4%
mul-1-neg99.4%
unsub-neg99.4%
mul-1-neg99.4%
unsub-neg99.4%
sub-neg99.4%
associate-*r/99.4%
metadata-eval99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
Simplified99.4%
div-inv99.4%
pow1/299.4%
pow-flip99.4%
+-commutative99.4%
metadata-eval99.4%
Applied egg-rr99.4%
associate-*l/99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x) :precision binary64 (/ (/ (+ 0.5 (/ (- (/ (+ 0.0625 (/ -0.0390625 x)) x) 0.125) x)) x) (sqrt (+ x 1.0))))
double code(double x) {
return ((0.5 + ((((0.0625 + (-0.0390625 / x)) / x) - 0.125) / x)) / x) / sqrt((x + 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((0.5d0 + ((((0.0625d0 + ((-0.0390625d0) / x)) / x) - 0.125d0) / x)) / x) / sqrt((x + 1.0d0))
end function
public static double code(double x) {
return ((0.5 + ((((0.0625 + (-0.0390625 / x)) / x) - 0.125) / x)) / x) / Math.sqrt((x + 1.0));
}
def code(x): return ((0.5 + ((((0.0625 + (-0.0390625 / x)) / x) - 0.125) / x)) / x) / math.sqrt((x + 1.0))
function code(x) return Float64(Float64(Float64(0.5 + Float64(Float64(Float64(Float64(0.0625 + Float64(-0.0390625 / x)) / x) - 0.125) / x)) / x) / sqrt(Float64(x + 1.0))) end
function tmp = code(x) tmp = ((0.5 + ((((0.0625 + (-0.0390625 / x)) / x) - 0.125) / x)) / x) / sqrt((x + 1.0)); end
code[x_] := N[(N[(N[(0.5 + N[(N[(N[(N[(0.0625 + N[(-0.0390625 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.125), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{0.5 + \frac{\frac{0.0625 + \frac{-0.0390625}{x}}{x} - 0.125}{x}}{x}}{\sqrt{x + 1}}
\end{array}
Initial program 40.3%
frac-sub40.4%
associate-/r*40.4%
*-un-lft-identity40.4%
*-rgt-identity40.4%
+-commutative40.4%
+-commutative40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 99.4%
associate--l+99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around -inf 99.4%
mul-1-neg99.4%
unsub-neg99.4%
mul-1-neg99.4%
unsub-neg99.4%
sub-neg99.4%
associate-*r/99.4%
metadata-eval99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x) :precision binary64 (/ (/ (- 0.5 (/ (+ 0.125 (/ -0.0625 x)) x)) x) (sqrt (+ x 1.0))))
double code(double x) {
return ((0.5 - ((0.125 + (-0.0625 / x)) / x)) / x) / sqrt((x + 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((0.5d0 - ((0.125d0 + ((-0.0625d0) / x)) / x)) / x) / sqrt((x + 1.0d0))
end function
public static double code(double x) {
return ((0.5 - ((0.125 + (-0.0625 / x)) / x)) / x) / Math.sqrt((x + 1.0));
}
def code(x): return ((0.5 - ((0.125 + (-0.0625 / x)) / x)) / x) / math.sqrt((x + 1.0))
function code(x) return Float64(Float64(Float64(0.5 - Float64(Float64(0.125 + Float64(-0.0625 / x)) / x)) / x) / sqrt(Float64(x + 1.0))) end
function tmp = code(x) tmp = ((0.5 - ((0.125 + (-0.0625 / x)) / x)) / x) / sqrt((x + 1.0)); end
code[x_] := N[(N[(N[(0.5 - N[(N[(0.125 + N[(-0.0625 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{0.5 - \frac{0.125 + \frac{-0.0625}{x}}{x}}{x}}{\sqrt{x + 1}}
\end{array}
Initial program 40.3%
frac-sub40.4%
associate-/r*40.4%
*-un-lft-identity40.4%
*-rgt-identity40.4%
+-commutative40.4%
+-commutative40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 99.4%
associate--l+99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around -inf 99.3%
mul-1-neg99.3%
unsub-neg99.3%
sub-neg99.3%
associate-*r/99.3%
metadata-eval99.3%
distribute-neg-frac99.3%
metadata-eval99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x) :precision binary64 (/ (/ 1.0 (/ x (+ 0.5 (/ -0.125 x)))) (sqrt (+ x 1.0))))
double code(double x) {
return (1.0 / (x / (0.5 + (-0.125 / x)))) / sqrt((x + 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / (x / (0.5d0 + ((-0.125d0) / x)))) / sqrt((x + 1.0d0))
end function
public static double code(double x) {
return (1.0 / (x / (0.5 + (-0.125 / x)))) / Math.sqrt((x + 1.0));
}
def code(x): return (1.0 / (x / (0.5 + (-0.125 / x)))) / math.sqrt((x + 1.0))
function code(x) return Float64(Float64(1.0 / Float64(x / Float64(0.5 + Float64(-0.125 / x)))) / sqrt(Float64(x + 1.0))) end
function tmp = code(x) tmp = (1.0 / (x / (0.5 + (-0.125 / x)))) / sqrt((x + 1.0)); end
code[x_] := N[(N[(1.0 / N[(x / N[(0.5 + N[(-0.125 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{\frac{x}{0.5 + \frac{-0.125}{x}}}}{\sqrt{x + 1}}
\end{array}
Initial program 40.3%
frac-sub40.4%
associate-/r*40.4%
*-un-lft-identity40.4%
*-rgt-identity40.4%
+-commutative40.4%
+-commutative40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
clear-num99.1%
inv-pow99.1%
Applied egg-rr99.1%
unpow-199.1%
sub-neg99.1%
distribute-neg-frac99.1%
metadata-eval99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x) :precision binary64 (/ (/ (- 0.5 (/ 0.125 x)) x) (sqrt (+ x 1.0))))
double code(double x) {
return ((0.5 - (0.125 / x)) / x) / sqrt((x + 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((0.5d0 - (0.125d0 / x)) / x) / sqrt((x + 1.0d0))
end function
public static double code(double x) {
return ((0.5 - (0.125 / x)) / x) / Math.sqrt((x + 1.0));
}
def code(x): return ((0.5 - (0.125 / x)) / x) / math.sqrt((x + 1.0))
function code(x) return Float64(Float64(Float64(0.5 - Float64(0.125 / x)) / x) / sqrt(Float64(x + 1.0))) end
function tmp = code(x) tmp = ((0.5 - (0.125 / x)) / x) / sqrt((x + 1.0)); end
code[x_] := N[(N[(N[(0.5 - N[(0.125 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{0.5 - \frac{0.125}{x}}{x}}{\sqrt{x + 1}}
\end{array}
Initial program 40.3%
frac-sub40.4%
associate-/r*40.4%
*-un-lft-identity40.4%
*-rgt-identity40.4%
+-commutative40.4%
+-commutative40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x) :precision binary64 (* 0.5 (pow x -1.5)))
double code(double x) {
return 0.5 * pow(x, -1.5);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 0.5d0 * (x ** (-1.5d0))
end function
public static double code(double x) {
return 0.5 * Math.pow(x, -1.5);
}
def code(x): return 0.5 * math.pow(x, -1.5)
function code(x) return Float64(0.5 * (x ^ -1.5)) end
function tmp = code(x) tmp = 0.5 * (x ^ -1.5); end
code[x_] := N[(0.5 * N[Power[x, -1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot {x}^{-1.5}
\end{array}
Initial program 40.3%
expm1-log1p-u40.3%
expm1-undefine4.9%
inv-pow4.9%
sqrt-pow24.9%
metadata-eval4.9%
Applied egg-rr4.9%
log1p-undefine4.9%
rem-exp-log4.9%
+-commutative4.9%
associate--l+31.9%
metadata-eval31.9%
+-rgt-identity31.9%
Simplified31.9%
Taylor expanded in x around inf 68.7%
*-commutative68.7%
Simplified68.7%
*-un-lft-identity68.7%
pow-flip70.3%
sqrt-pow198.4%
metadata-eval98.4%
metadata-eval98.4%
Applied egg-rr98.4%
*-lft-identity98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x) :precision binary64 (/ (/ (- (/ (- 0.125 (/ (+ 0.0625 (/ -0.0390625 x)) x)) x) 0.5) x) (- -1.0 (* 0.5 x))))
double code(double x) {
return ((((0.125 - ((0.0625 + (-0.0390625 / x)) / x)) / x) - 0.5) / x) / (-1.0 - (0.5 * x));
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((((0.125d0 - ((0.0625d0 + ((-0.0390625d0) / x)) / x)) / x) - 0.5d0) / x) / ((-1.0d0) - (0.5d0 * x))
end function
public static double code(double x) {
return ((((0.125 - ((0.0625 + (-0.0390625 / x)) / x)) / x) - 0.5) / x) / (-1.0 - (0.5 * x));
}
def code(x): return ((((0.125 - ((0.0625 + (-0.0390625 / x)) / x)) / x) - 0.5) / x) / (-1.0 - (0.5 * x))
function code(x) return Float64(Float64(Float64(Float64(Float64(0.125 - Float64(Float64(0.0625 + Float64(-0.0390625 / x)) / x)) / x) - 0.5) / x) / Float64(-1.0 - Float64(0.5 * x))) end
function tmp = code(x) tmp = ((((0.125 - ((0.0625 + (-0.0390625 / x)) / x)) / x) - 0.5) / x) / (-1.0 - (0.5 * x)); end
code[x_] := N[(N[(N[(N[(N[(0.125 - N[(N[(0.0625 + N[(-0.0390625 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision] / N[(-1.0 - N[(0.5 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{0.125 - \frac{0.0625 + \frac{-0.0390625}{x}}{x}}{x} - 0.5}{x}}{-1 - 0.5 \cdot x}
\end{array}
Initial program 40.3%
frac-sub40.4%
associate-/r*40.4%
*-un-lft-identity40.4%
*-rgt-identity40.4%
+-commutative40.4%
+-commutative40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 99.4%
associate--l+99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around -inf 99.4%
mul-1-neg99.4%
unsub-neg99.4%
mul-1-neg99.4%
unsub-neg99.4%
sub-neg99.4%
associate-*r/99.4%
metadata-eval99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 39.8%
*-commutative39.8%
Simplified39.8%
Final simplification39.8%
(FPCore (x) :precision binary64 (/ (/ (- (/ 0.125 x) 0.5) x) (- -1.0 (* 0.5 x))))
double code(double x) {
return (((0.125 / x) - 0.5) / x) / (-1.0 - (0.5 * x));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (((0.125d0 / x) - 0.5d0) / x) / ((-1.0d0) - (0.5d0 * x))
end function
public static double code(double x) {
return (((0.125 / x) - 0.5) / x) / (-1.0 - (0.5 * x));
}
def code(x): return (((0.125 / x) - 0.5) / x) / (-1.0 - (0.5 * x))
function code(x) return Float64(Float64(Float64(Float64(0.125 / x) - 0.5) / x) / Float64(-1.0 - Float64(0.5 * x))) end
function tmp = code(x) tmp = (((0.125 / x) - 0.5) / x) / (-1.0 - (0.5 * x)); end
code[x_] := N[(N[(N[(N[(0.125 / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision] / N[(-1.0 - N[(0.5 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{0.125}{x} - 0.5}{x}}{-1 - 0.5 \cdot x}
\end{array}
Initial program 40.3%
frac-sub40.4%
associate-/r*40.4%
*-un-lft-identity40.4%
*-rgt-identity40.4%
+-commutative40.4%
+-commutative40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 39.8%
*-commutative39.8%
Simplified39.8%
Final simplification39.8%
(FPCore (x) :precision binary64 0.0)
double code(double x) {
return 0.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 0.0d0
end function
public static double code(double x) {
return 0.0;
}
def code(x): return 0.0
function code(x) return 0.0 end
function tmp = code(x) tmp = 0.0; end
code[x_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 40.3%
add-exp-log6.7%
log-rec6.7%
pow1/26.7%
log-pow6.7%
+-commutative6.7%
log1p-define6.7%
Applied egg-rr6.7%
Taylor expanded in x around inf 4.6%
distribute-lft-neg-in4.6%
metadata-eval4.6%
*-commutative4.6%
exp-to-pow37.8%
unpow1/237.8%
+-inverses37.8%
Simplified37.8%
(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}
(FPCore (x) :precision binary64 (- (pow x -0.5) (pow (+ x 1.0) -0.5)))
double code(double x) {
return pow(x, -0.5) - pow((x + 1.0), -0.5);
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x ** (-0.5d0)) - ((x + 1.0d0) ** (-0.5d0))
end function
public static double code(double x) {
return Math.pow(x, -0.5) - Math.pow((x + 1.0), -0.5);
}
def code(x): return math.pow(x, -0.5) - math.pow((x + 1.0), -0.5)
function code(x) return Float64((x ^ -0.5) - (Float64(x + 1.0) ^ -0.5)) end
function tmp = code(x) tmp = (x ^ -0.5) - ((x + 1.0) ^ -0.5); end
code[x_] := N[(N[Power[x, -0.5], $MachinePrecision] - N[Power[N[(x + 1.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{x}^{-0.5} - {\left(x + 1\right)}^{-0.5}
\end{array}
herbie shell --seed 2024182
(FPCore (x)
:name "2isqrt (example 3.6)"
:precision binary64
:pre (and (> x 1.0) (< x 1e+308))
:alt
(! :herbie-platform default (/ 1 (+ (* (+ x 1) (sqrt x)) (* x (sqrt (+ x 1))))))
:alt
(! :herbie-platform default (- (pow x -1/2) (pow (+ x 1) -1/2)))
(- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))