
(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 10 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 (/ (/ 1.0 x) (* (+ 1.0 x) (+ (pow x -0.5) (pow (+ 1.0 x) -0.5)))))
double code(double x) {
return (1.0 / x) / ((1.0 + x) * (pow(x, -0.5) + pow((1.0 + x), -0.5)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / x) / ((1.0d0 + x) * ((x ** (-0.5d0)) + ((1.0d0 + x) ** (-0.5d0))))
end function
public static double code(double x) {
return (1.0 / x) / ((1.0 + x) * (Math.pow(x, -0.5) + Math.pow((1.0 + x), -0.5)));
}
def code(x): return (1.0 / x) / ((1.0 + x) * (math.pow(x, -0.5) + math.pow((1.0 + x), -0.5)))
function code(x) return Float64(Float64(1.0 / x) / Float64(Float64(1.0 + x) * Float64((x ^ -0.5) + (Float64(1.0 + x) ^ -0.5)))) end
function tmp = code(x) tmp = (1.0 / x) / ((1.0 + x) * ((x ^ -0.5) + ((1.0 + x) ^ -0.5))); end
code[x_] := N[(N[(1.0 / x), $MachinePrecision] / N[(N[(1.0 + x), $MachinePrecision] * N[(N[Power[x, -0.5], $MachinePrecision] + N[Power[N[(1.0 + x), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{\left(1 + x\right) \cdot \left({x}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)}
\end{array}
(FPCore (x)
:precision binary64
(if (<= x 1.7)
(+ (pow x -0.5) (/ -1.0 (+ 1.0 (* x 0.5))))
(if (<= x 5.6e+102)
(* 0.5 (sqrt (/ 1.0 (pow x 3.0))))
(/ 1.0 (pow x 1.5)))))
double code(double x) {
double tmp;
if (x <= 1.7) {
tmp = pow(x, -0.5) + (-1.0 / (1.0 + (x * 0.5)));
} else if (x <= 5.6e+102) {
tmp = 0.5 * sqrt((1.0 / pow(x, 3.0)));
} else {
tmp = 1.0 / pow(x, 1.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.7d0) then
tmp = (x ** (-0.5d0)) + ((-1.0d0) / (1.0d0 + (x * 0.5d0)))
else if (x <= 5.6d+102) then
tmp = 0.5d0 * sqrt((1.0d0 / (x ** 3.0d0)))
else
tmp = 1.0d0 / (x ** 1.5d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 1.7) {
tmp = Math.pow(x, -0.5) + (-1.0 / (1.0 + (x * 0.5)));
} else if (x <= 5.6e+102) {
tmp = 0.5 * Math.sqrt((1.0 / Math.pow(x, 3.0)));
} else {
tmp = 1.0 / Math.pow(x, 1.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.7: tmp = math.pow(x, -0.5) + (-1.0 / (1.0 + (x * 0.5))) elif x <= 5.6e+102: tmp = 0.5 * math.sqrt((1.0 / math.pow(x, 3.0))) else: tmp = 1.0 / math.pow(x, 1.5) return tmp
function code(x) tmp = 0.0 if (x <= 1.7) tmp = Float64((x ^ -0.5) + Float64(-1.0 / Float64(1.0 + Float64(x * 0.5)))); elseif (x <= 5.6e+102) tmp = Float64(0.5 * sqrt(Float64(1.0 / (x ^ 3.0)))); else tmp = Float64(1.0 / (x ^ 1.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.7) tmp = (x ^ -0.5) + (-1.0 / (1.0 + (x * 0.5))); elseif (x <= 5.6e+102) tmp = 0.5 * sqrt((1.0 / (x ^ 3.0))); else tmp = 1.0 / (x ^ 1.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.7], N[(N[Power[x, -0.5], $MachinePrecision] + N[(-1.0 / N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.6e+102], N[(0.5 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[x, 1.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{1 + x \cdot 0.5}\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+102}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(if (<= x 150000000.0)
(- (pow x -0.5) (pow (+ 1.0 x) -0.5))
(if (<= x 5.6e+102)
(* 0.5 (sqrt (/ 1.0 (pow x 3.0))))
(/ 1.0 (pow x 1.5)))))
double code(double x) {
double tmp;
if (x <= 150000000.0) {
tmp = pow(x, -0.5) - pow((1.0 + x), -0.5);
} else if (x <= 5.6e+102) {
tmp = 0.5 * sqrt((1.0 / pow(x, 3.0)));
} else {
tmp = 1.0 / pow(x, 1.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 150000000.0d0) then
tmp = (x ** (-0.5d0)) - ((1.0d0 + x) ** (-0.5d0))
else if (x <= 5.6d+102) then
tmp = 0.5d0 * sqrt((1.0d0 / (x ** 3.0d0)))
else
tmp = 1.0d0 / (x ** 1.5d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 150000000.0) {
tmp = Math.pow(x, -0.5) - Math.pow((1.0 + x), -0.5);
} else if (x <= 5.6e+102) {
tmp = 0.5 * Math.sqrt((1.0 / Math.pow(x, 3.0)));
} else {
tmp = 1.0 / Math.pow(x, 1.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 150000000.0: tmp = math.pow(x, -0.5) - math.pow((1.0 + x), -0.5) elif x <= 5.6e+102: tmp = 0.5 * math.sqrt((1.0 / math.pow(x, 3.0))) else: tmp = 1.0 / math.pow(x, 1.5) return tmp
function code(x) tmp = 0.0 if (x <= 150000000.0) tmp = Float64((x ^ -0.5) - (Float64(1.0 + x) ^ -0.5)); elseif (x <= 5.6e+102) tmp = Float64(0.5 * sqrt(Float64(1.0 / (x ^ 3.0)))); else tmp = Float64(1.0 / (x ^ 1.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 150000000.0) tmp = (x ^ -0.5) - ((1.0 + x) ^ -0.5); elseif (x <= 5.6e+102) tmp = 0.5 * sqrt((1.0 / (x ^ 3.0))); else tmp = 1.0 / (x ^ 1.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 150000000.0], N[(N[Power[x, -0.5], $MachinePrecision] - N[Power[N[(1.0 + x), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.6e+102], N[(0.5 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[x, 1.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 150000000:\\
\;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+102}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (if (<= x 3.2) (+ (pow x -0.5) (/ -1.0 (+ 1.0 (* x 0.5)))) (/ 1.0 (pow x 1.5))))
double code(double x) {
double tmp;
if (x <= 3.2) {
tmp = pow(x, -0.5) + (-1.0 / (1.0 + (x * 0.5)));
} else {
tmp = 1.0 / pow(x, 1.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 3.2d0) then
tmp = (x ** (-0.5d0)) + ((-1.0d0) / (1.0d0 + (x * 0.5d0)))
else
tmp = 1.0d0 / (x ** 1.5d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 3.2) {
tmp = Math.pow(x, -0.5) + (-1.0 / (1.0 + (x * 0.5)));
} else {
tmp = 1.0 / Math.pow(x, 1.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 3.2: tmp = math.pow(x, -0.5) + (-1.0 / (1.0 + (x * 0.5))) else: tmp = 1.0 / math.pow(x, 1.5) return tmp
function code(x) tmp = 0.0 if (x <= 3.2) tmp = Float64((x ^ -0.5) + Float64(-1.0 / Float64(1.0 + Float64(x * 0.5)))); else tmp = Float64(1.0 / (x ^ 1.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 3.2) tmp = (x ^ -0.5) + (-1.0 / (1.0 + (x * 0.5))); else tmp = 1.0 / (x ^ 1.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 3.2], N[(N[Power[x, -0.5], $MachinePrecision] + N[(-1.0 / N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[x, 1.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.2:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (if (<= x 1.45) (- (pow x -0.5) (+ 1.0 (* x -0.5))) (/ 1.0 (pow x 1.5))))
double code(double x) {
double tmp;
if (x <= 1.45) {
tmp = pow(x, -0.5) - (1.0 + (x * -0.5));
} else {
tmp = 1.0 / pow(x, 1.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.45d0) then
tmp = (x ** (-0.5d0)) - (1.0d0 + (x * (-0.5d0)))
else
tmp = 1.0d0 / (x ** 1.5d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 1.45) {
tmp = Math.pow(x, -0.5) - (1.0 + (x * -0.5));
} else {
tmp = 1.0 / Math.pow(x, 1.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.45: tmp = math.pow(x, -0.5) - (1.0 + (x * -0.5)) else: tmp = 1.0 / math.pow(x, 1.5) return tmp
function code(x) tmp = 0.0 if (x <= 1.45) tmp = Float64((x ^ -0.5) - Float64(1.0 + Float64(x * -0.5))); else tmp = Float64(1.0 / (x ^ 1.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.45) tmp = (x ^ -0.5) - (1.0 + (x * -0.5)); else tmp = 1.0 / (x ^ 1.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.45], N[(N[Power[x, -0.5], $MachinePrecision] - N[(1.0 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[x, 1.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.45:\\
\;\;\;\;{x}^{-0.5} - \left(1 + x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (if (<= x 0.85) (+ (pow x -0.5) -1.0) (pow x -1.5)))
double code(double x) {
double tmp;
if (x <= 0.85) {
tmp = pow(x, -0.5) + -1.0;
} else {
tmp = pow(x, -1.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 0.85d0) then
tmp = (x ** (-0.5d0)) + (-1.0d0)
else
tmp = x ** (-1.5d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 0.85) {
tmp = Math.pow(x, -0.5) + -1.0;
} else {
tmp = Math.pow(x, -1.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 0.85: tmp = math.pow(x, -0.5) + -1.0 else: tmp = math.pow(x, -1.5) return tmp
function code(x) tmp = 0.0 if (x <= 0.85) tmp = Float64((x ^ -0.5) + -1.0); else tmp = x ^ -1.5; end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 0.85) tmp = (x ^ -0.5) + -1.0; else tmp = x ^ -1.5; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 0.85], N[(N[Power[x, -0.5], $MachinePrecision] + -1.0), $MachinePrecision], N[Power[x, -1.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.85:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;{x}^{-1.5}\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (if (<= x 0.85) (+ (pow x -0.5) -1.0) (/ 1.0 (pow x 1.5))))
double code(double x) {
double tmp;
if (x <= 0.85) {
tmp = pow(x, -0.5) + -1.0;
} else {
tmp = 1.0 / pow(x, 1.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 0.85d0) then
tmp = (x ** (-0.5d0)) + (-1.0d0)
else
tmp = 1.0d0 / (x ** 1.5d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 0.85) {
tmp = Math.pow(x, -0.5) + -1.0;
} else {
tmp = 1.0 / Math.pow(x, 1.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 0.85: tmp = math.pow(x, -0.5) + -1.0 else: tmp = 1.0 / math.pow(x, 1.5) return tmp
function code(x) tmp = 0.0 if (x <= 0.85) tmp = Float64((x ^ -0.5) + -1.0); else tmp = Float64(1.0 / (x ^ 1.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 0.85) tmp = (x ^ -0.5) + -1.0; else tmp = 1.0 / (x ^ 1.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 0.85], N[(N[Power[x, -0.5], $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 / N[Power[x, 1.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.85:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{1.5}}\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (if (<= x 1.0) (pow x -0.5) (pow x -1.5)))
double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = pow(x, -0.5);
} else {
tmp = pow(x, -1.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.0d0) then
tmp = x ** (-0.5d0)
else
tmp = x ** (-1.5d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = Math.pow(x, -0.5);
} else {
tmp = Math.pow(x, -1.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.0: tmp = math.pow(x, -0.5) else: tmp = math.pow(x, -1.5) return tmp
function code(x) tmp = 0.0 if (x <= 1.0) tmp = x ^ -0.5; else tmp = x ^ -1.5; end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.0) tmp = x ^ -0.5; else tmp = x ^ -1.5; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.0], N[Power[x, -0.5], $MachinePrecision], N[Power[x, -1.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;{x}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-1.5}\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (pow x -1.5))
double code(double x) {
return pow(x, -1.5);
}
real(8) function code(x)
real(8), intent (in) :: x
code = x ** (-1.5d0)
end function
public static double code(double x) {
return Math.pow(x, -1.5);
}
def code(x): return math.pow(x, -1.5)
function code(x) return x ^ -1.5 end
function tmp = code(x) tmp = x ^ -1.5; end
code[x_] := N[Power[x, -1.5], $MachinePrecision]
\begin{array}{l}
\\
{x}^{-1.5}
\end{array}
(FPCore (x) :precision binary64 (+ (* x 0.5) -1.0))
double code(double x) {
return (x * 0.5) + -1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x * 0.5d0) + (-1.0d0)
end function
public static double code(double x) {
return (x * 0.5) + -1.0;
}
def code(x): return (x * 0.5) + -1.0
function code(x) return Float64(Float64(x * 0.5) + -1.0) end
function tmp = code(x) tmp = (x * 0.5) + -1.0; end
code[x_] := N[(N[(x * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.5 + -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}
herbie shell --seed 2023343
(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)))))