
(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 11 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
(let* ((t_0 (sqrt (pow (+ 1.0 x) -0.5))))
(if (<= (+ (/ 1.0 (sqrt x)) (/ -1.0 (sqrt (+ 1.0 x)))) 2e-6)
(*
(-
(+ (/ 0.5 x) (/ 0.3125 (pow x 3.0)))
(+ (/ 0.375 (* x x)) (/ 0.2734375 (pow x 4.0))))
(pow x -0.5))
(fma t_0 (- t_0) (pow x -0.5)))))
double code(double x) {
double t_0 = sqrt(pow((1.0 + x), -0.5));
double tmp;
if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-6) {
tmp = (((0.5 / x) + (0.3125 / pow(x, 3.0))) - ((0.375 / (x * x)) + (0.2734375 / pow(x, 4.0)))) * pow(x, -0.5);
} else {
tmp = fma(t_0, -t_0, pow(x, -0.5));
}
return tmp;
}
function code(x) t_0 = sqrt((Float64(1.0 + x) ^ -0.5)) tmp = 0.0 if (Float64(Float64(1.0 / sqrt(x)) + Float64(-1.0 / sqrt(Float64(1.0 + x)))) <= 2e-6) tmp = Float64(Float64(Float64(Float64(0.5 / x) + Float64(0.3125 / (x ^ 3.0))) - Float64(Float64(0.375 / Float64(x * x)) + Float64(0.2734375 / (x ^ 4.0)))) * (x ^ -0.5)); else tmp = fma(t_0, Float64(-t_0), (x ^ -0.5)); end return tmp end
code[x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(1.0 + x), $MachinePrecision], -0.5], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-6], N[(N[(N[(N[(0.5 / x), $MachinePrecision] + N[(0.3125 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(0.375 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(0.2734375 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * (-t$95$0) + N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(1 + x\right)}^{-0.5}}\\
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\left(\left(\frac{0.5}{x} + \frac{0.3125}{{x}^{3}}\right) - \left(\frac{0.375}{x \cdot x} + \frac{0.2734375}{{x}^{4}}\right)\right) \cdot {x}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_0, -t_0, {x}^{-0.5}\right)\\
\end{array}
\end{array}
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 1.99999999999999991e-6Initial program 35.6%
frac-sub35.7%
div-inv35.7%
*-un-lft-identity35.7%
+-commutative35.7%
*-rgt-identity35.7%
metadata-eval35.7%
frac-times35.7%
un-div-inv35.7%
pow1/235.7%
pow-flip35.7%
metadata-eval35.7%
+-commutative35.7%
Applied egg-rr35.7%
associate-*r/35.7%
*-rgt-identity35.7%
times-frac35.7%
div-sub35.6%
*-inverses35.6%
/-rgt-identity35.6%
Simplified35.6%
Taylor expanded in x around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
+-commutative99.6%
associate-*r/99.6%
metadata-eval99.6%
unpow299.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
if 1.99999999999999991e-6 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
add-sqr-sqrt99.6%
distribute-rgt-neg-in99.6%
fma-def99.6%
inv-pow99.6%
sqrt-pow299.6%
+-commutative99.6%
metadata-eval99.6%
inv-pow99.6%
sqrt-pow299.6%
+-commutative99.6%
metadata-eval99.6%
pow1/299.6%
pow-flip100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x)
:precision binary64
(if (<= (+ (/ 1.0 (sqrt x)) (/ -1.0 (sqrt (+ 1.0 x)))) 2e-6)
(*
(-
(+ (/ 0.5 x) (/ 0.3125 (pow x 3.0)))
(+ (/ 0.375 (* x x)) (/ 0.2734375 (pow x 4.0))))
(pow x -0.5))
(- (pow x -0.5) (pow (+ 1.0 x) -0.5))))
double code(double x) {
double tmp;
if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-6) {
tmp = (((0.5 / x) + (0.3125 / pow(x, 3.0))) - ((0.375 / (x * x)) + (0.2734375 / pow(x, 4.0)))) * pow(x, -0.5);
} else {
tmp = pow(x, -0.5) - pow((1.0 + x), -0.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (((1.0d0 / sqrt(x)) + ((-1.0d0) / sqrt((1.0d0 + x)))) <= 2d-6) then
tmp = (((0.5d0 / x) + (0.3125d0 / (x ** 3.0d0))) - ((0.375d0 / (x * x)) + (0.2734375d0 / (x ** 4.0d0)))) * (x ** (-0.5d0))
else
tmp = (x ** (-0.5d0)) - ((1.0d0 + x) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((1.0 / Math.sqrt(x)) + (-1.0 / Math.sqrt((1.0 + x)))) <= 2e-6) {
tmp = (((0.5 / x) + (0.3125 / Math.pow(x, 3.0))) - ((0.375 / (x * x)) + (0.2734375 / Math.pow(x, 4.0)))) * Math.pow(x, -0.5);
} else {
tmp = Math.pow(x, -0.5) - Math.pow((1.0 + x), -0.5);
}
return tmp;
}
def code(x): tmp = 0 if ((1.0 / math.sqrt(x)) + (-1.0 / math.sqrt((1.0 + x)))) <= 2e-6: tmp = (((0.5 / x) + (0.3125 / math.pow(x, 3.0))) - ((0.375 / (x * x)) + (0.2734375 / math.pow(x, 4.0)))) * math.pow(x, -0.5) else: tmp = math.pow(x, -0.5) - math.pow((1.0 + x), -0.5) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(1.0 / sqrt(x)) + Float64(-1.0 / sqrt(Float64(1.0 + x)))) <= 2e-6) tmp = Float64(Float64(Float64(Float64(0.5 / x) + Float64(0.3125 / (x ^ 3.0))) - Float64(Float64(0.375 / Float64(x * x)) + Float64(0.2734375 / (x ^ 4.0)))) * (x ^ -0.5)); else tmp = Float64((x ^ -0.5) - (Float64(1.0 + x) ^ -0.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-6) tmp = (((0.5 / x) + (0.3125 / (x ^ 3.0))) - ((0.375 / (x * x)) + (0.2734375 / (x ^ 4.0)))) * (x ^ -0.5); else tmp = (x ^ -0.5) - ((1.0 + x) ^ -0.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-6], N[(N[(N[(N[(0.5 / x), $MachinePrecision] + N[(0.3125 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(0.375 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(0.2734375 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.5], $MachinePrecision] - N[Power[N[(1.0 + x), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\left(\left(\frac{0.5}{x} + \frac{0.3125}{{x}^{3}}\right) - \left(\frac{0.375}{x \cdot x} + \frac{0.2734375}{{x}^{4}}\right)\right) \cdot {x}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\
\end{array}
\end{array}
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 1.99999999999999991e-6Initial program 35.6%
frac-sub35.7%
div-inv35.7%
*-un-lft-identity35.7%
+-commutative35.7%
*-rgt-identity35.7%
metadata-eval35.7%
frac-times35.7%
un-div-inv35.7%
pow1/235.7%
pow-flip35.7%
metadata-eval35.7%
+-commutative35.7%
Applied egg-rr35.7%
associate-*r/35.7%
*-rgt-identity35.7%
times-frac35.7%
div-sub35.6%
*-inverses35.6%
/-rgt-identity35.6%
Simplified35.6%
Taylor expanded in x around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
+-commutative99.6%
associate-*r/99.6%
metadata-eval99.6%
unpow299.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
if 1.99999999999999991e-6 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.6%
*-un-lft-identity99.6%
clear-num99.6%
associate-/r/99.6%
prod-diff99.6%
*-un-lft-identity99.6%
fma-neg99.6%
*-un-lft-identity99.6%
inv-pow99.6%
sqrt-pow2100.0%
metadata-eval100.0%
pow1/2100.0%
pow-flip100.0%
+-commutative100.0%
metadata-eval100.0%
Applied egg-rr100.0%
fma-udef100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
mul0-lft100.0%
+-rgt-identity100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (x) :precision binary64 (if (<= (+ (/ 1.0 (sqrt x)) (/ -1.0 (sqrt (+ 1.0 x)))) 2e-8) (* (pow x -0.5) (- (+ (/ 0.5 x) (/ 0.3125 (pow x 3.0))) (/ 0.375 (* x x)))) (* (pow x -0.5) (- 1.0 (sqrt (/ x (+ 1.0 x)))))))
double code(double x) {
double tmp;
if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-8) {
tmp = pow(x, -0.5) * (((0.5 / x) + (0.3125 / pow(x, 3.0))) - (0.375 / (x * x)));
} else {
tmp = pow(x, -0.5) * (1.0 - sqrt((x / (1.0 + x))));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (((1.0d0 / sqrt(x)) + ((-1.0d0) / sqrt((1.0d0 + x)))) <= 2d-8) then
tmp = (x ** (-0.5d0)) * (((0.5d0 / x) + (0.3125d0 / (x ** 3.0d0))) - (0.375d0 / (x * x)))
else
tmp = (x ** (-0.5d0)) * (1.0d0 - sqrt((x / (1.0d0 + x))))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((1.0 / Math.sqrt(x)) + (-1.0 / Math.sqrt((1.0 + x)))) <= 2e-8) {
tmp = Math.pow(x, -0.5) * (((0.5 / x) + (0.3125 / Math.pow(x, 3.0))) - (0.375 / (x * x)));
} else {
tmp = Math.pow(x, -0.5) * (1.0 - Math.sqrt((x / (1.0 + x))));
}
return tmp;
}
def code(x): tmp = 0 if ((1.0 / math.sqrt(x)) + (-1.0 / math.sqrt((1.0 + x)))) <= 2e-8: tmp = math.pow(x, -0.5) * (((0.5 / x) + (0.3125 / math.pow(x, 3.0))) - (0.375 / (x * x))) else: tmp = math.pow(x, -0.5) * (1.0 - math.sqrt((x / (1.0 + x)))) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(1.0 / sqrt(x)) + Float64(-1.0 / sqrt(Float64(1.0 + x)))) <= 2e-8) tmp = Float64((x ^ -0.5) * Float64(Float64(Float64(0.5 / x) + Float64(0.3125 / (x ^ 3.0))) - Float64(0.375 / Float64(x * x)))); else tmp = Float64((x ^ -0.5) * Float64(1.0 - sqrt(Float64(x / Float64(1.0 + x))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-8) tmp = (x ^ -0.5) * (((0.5 / x) + (0.3125 / (x ^ 3.0))) - (0.375 / (x * x))); else tmp = (x ^ -0.5) * (1.0 - sqrt((x / (1.0 + x)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-8], N[(N[Power[x, -0.5], $MachinePrecision] * N[(N[(N[(0.5 / x), $MachinePrecision] + N[(0.3125 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.375 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.5], $MachinePrecision] * N[(1.0 - N[Sqrt[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \leq 2 \cdot 10^{-8}:\\
\;\;\;\;{x}^{-0.5} \cdot \left(\left(\frac{0.5}{x} + \frac{0.3125}{{x}^{3}}\right) - \frac{0.375}{x \cdot x}\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \left(1 - \sqrt{\frac{x}{1 + x}}\right)\\
\end{array}
\end{array}
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 2e-8Initial program 35.2%
frac-sub35.3%
div-inv35.3%
*-un-lft-identity35.3%
+-commutative35.3%
*-rgt-identity35.3%
metadata-eval35.3%
frac-times35.3%
un-div-inv35.3%
pow1/235.3%
pow-flip35.3%
metadata-eval35.3%
+-commutative35.3%
Applied egg-rr35.3%
associate-*r/35.3%
*-rgt-identity35.3%
times-frac35.3%
div-sub35.3%
*-inverses35.3%
/-rgt-identity35.3%
Simplified35.3%
Taylor expanded in x around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
unpow299.6%
Simplified99.6%
if 2e-8 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.5%
frac-sub99.5%
div-inv99.5%
*-un-lft-identity99.5%
+-commutative99.5%
*-rgt-identity99.5%
metadata-eval99.5%
frac-times99.5%
un-div-inv99.5%
pow1/299.5%
pow-flip99.9%
metadata-eval99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
times-frac99.9%
div-sub99.8%
*-inverses99.8%
/-rgt-identity99.8%
Simplified99.8%
*-un-lft-identity99.8%
sqrt-undiv99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Final simplification99.7%
(FPCore (x) :precision binary64 (if (<= (+ (/ 1.0 (sqrt x)) (/ -1.0 (sqrt (+ 1.0 x)))) 2e-11) (* (pow x -0.5) (- (/ 0.5 x) (/ 0.375 (* x x)))) (* (pow x -0.5) (- 1.0 (sqrt (/ x (+ 1.0 x)))))))
double code(double x) {
double tmp;
if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-11) {
tmp = pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x)));
} else {
tmp = pow(x, -0.5) * (1.0 - sqrt((x / (1.0 + x))));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (((1.0d0 / sqrt(x)) + ((-1.0d0) / sqrt((1.0d0 + x)))) <= 2d-11) then
tmp = (x ** (-0.5d0)) * ((0.5d0 / x) - (0.375d0 / (x * x)))
else
tmp = (x ** (-0.5d0)) * (1.0d0 - sqrt((x / (1.0d0 + x))))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((1.0 / Math.sqrt(x)) + (-1.0 / Math.sqrt((1.0 + x)))) <= 2e-11) {
tmp = Math.pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x)));
} else {
tmp = Math.pow(x, -0.5) * (1.0 - Math.sqrt((x / (1.0 + x))));
}
return tmp;
}
def code(x): tmp = 0 if ((1.0 / math.sqrt(x)) + (-1.0 / math.sqrt((1.0 + x)))) <= 2e-11: tmp = math.pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x))) else: tmp = math.pow(x, -0.5) * (1.0 - math.sqrt((x / (1.0 + x)))) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(1.0 / sqrt(x)) + Float64(-1.0 / sqrt(Float64(1.0 + x)))) <= 2e-11) tmp = Float64((x ^ -0.5) * Float64(Float64(0.5 / x) - Float64(0.375 / Float64(x * x)))); else tmp = Float64((x ^ -0.5) * Float64(1.0 - sqrt(Float64(x / Float64(1.0 + x))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-11) tmp = (x ^ -0.5) * ((0.5 / x) - (0.375 / (x * x))); else tmp = (x ^ -0.5) * (1.0 - sqrt((x / (1.0 + x)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-11], N[(N[Power[x, -0.5], $MachinePrecision] * N[(N[(0.5 / x), $MachinePrecision] - N[(0.375 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.5], $MachinePrecision] * N[(1.0 - N[Sqrt[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \leq 2 \cdot 10^{-11}:\\
\;\;\;\;{x}^{-0.5} \cdot \left(\frac{0.5}{x} - \frac{0.375}{x \cdot x}\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \left(1 - \sqrt{\frac{x}{1 + x}}\right)\\
\end{array}
\end{array}
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 1.99999999999999988e-11Initial program 34.6%
frac-sub34.7%
div-inv34.7%
*-un-lft-identity34.7%
+-commutative34.7%
*-rgt-identity34.7%
metadata-eval34.7%
frac-times34.7%
un-div-inv34.7%
pow1/234.7%
pow-flip34.7%
metadata-eval34.7%
+-commutative34.7%
Applied egg-rr34.7%
associate-*r/34.7%
*-rgt-identity34.7%
times-frac34.7%
div-sub34.7%
*-inverses34.7%
/-rgt-identity34.7%
Simplified34.7%
Taylor expanded in x around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
unpow299.6%
Simplified99.6%
if 1.99999999999999988e-11 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.1%
frac-sub99.1%
div-inv99.1%
*-un-lft-identity99.1%
+-commutative99.1%
*-rgt-identity99.1%
metadata-eval99.1%
frac-times99.1%
un-div-inv99.1%
pow1/299.1%
pow-flip99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-*r/99.5%
*-rgt-identity99.5%
times-frac99.5%
div-sub99.4%
*-inverses99.4%
/-rgt-identity99.4%
Simplified99.4%
*-un-lft-identity99.4%
sqrt-undiv99.4%
Applied egg-rr99.4%
*-lft-identity99.4%
Simplified99.4%
Final simplification99.5%
(FPCore (x) :precision binary64 (if (<= (+ (/ 1.0 (sqrt x)) (/ -1.0 (sqrt (+ 1.0 x)))) 2e-11) (* (pow x -0.5) (- (/ 0.5 x) (/ 0.375 (* x x)))) (- (pow x -0.5) (pow (+ 1.0 x) -0.5))))
double code(double x) {
double tmp;
if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-11) {
tmp = pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x)));
} else {
tmp = pow(x, -0.5) - pow((1.0 + x), -0.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (((1.0d0 / sqrt(x)) + ((-1.0d0) / sqrt((1.0d0 + x)))) <= 2d-11) then
tmp = (x ** (-0.5d0)) * ((0.5d0 / x) - (0.375d0 / (x * x)))
else
tmp = (x ** (-0.5d0)) - ((1.0d0 + x) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((1.0 / Math.sqrt(x)) + (-1.0 / Math.sqrt((1.0 + x)))) <= 2e-11) {
tmp = Math.pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x)));
} else {
tmp = Math.pow(x, -0.5) - Math.pow((1.0 + x), -0.5);
}
return tmp;
}
def code(x): tmp = 0 if ((1.0 / math.sqrt(x)) + (-1.0 / math.sqrt((1.0 + x)))) <= 2e-11: tmp = math.pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x))) else: tmp = math.pow(x, -0.5) - math.pow((1.0 + x), -0.5) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(1.0 / sqrt(x)) + Float64(-1.0 / sqrt(Float64(1.0 + x)))) <= 2e-11) tmp = Float64((x ^ -0.5) * Float64(Float64(0.5 / x) - Float64(0.375 / Float64(x * x)))); else tmp = Float64((x ^ -0.5) - (Float64(1.0 + x) ^ -0.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((1.0 / sqrt(x)) + (-1.0 / sqrt((1.0 + x)))) <= 2e-11) tmp = (x ^ -0.5) * ((0.5 / x) - (0.375 / (x * x))); else tmp = (x ^ -0.5) - ((1.0 + x) ^ -0.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-11], N[(N[Power[x, -0.5], $MachinePrecision] * N[(N[(0.5 / x), $MachinePrecision] - N[(0.375 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.5], $MachinePrecision] - N[Power[N[(1.0 + x), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \leq 2 \cdot 10^{-11}:\\
\;\;\;\;{x}^{-0.5} \cdot \left(\frac{0.5}{x} - \frac{0.375}{x \cdot x}\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\
\end{array}
\end{array}
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 1.99999999999999988e-11Initial program 34.6%
frac-sub34.7%
div-inv34.7%
*-un-lft-identity34.7%
+-commutative34.7%
*-rgt-identity34.7%
metadata-eval34.7%
frac-times34.7%
un-div-inv34.7%
pow1/234.7%
pow-flip34.7%
metadata-eval34.7%
+-commutative34.7%
Applied egg-rr34.7%
associate-*r/34.7%
*-rgt-identity34.7%
times-frac34.7%
div-sub34.7%
*-inverses34.7%
/-rgt-identity34.7%
Simplified34.7%
Taylor expanded in x around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
unpow299.6%
Simplified99.6%
if 1.99999999999999988e-11 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.1%
*-un-lft-identity99.1%
clear-num99.1%
associate-/r/99.1%
prod-diff99.1%
*-un-lft-identity99.1%
fma-neg99.1%
*-un-lft-identity99.1%
inv-pow99.1%
sqrt-pow299.4%
metadata-eval99.4%
pow1/299.4%
pow-flip99.4%
+-commutative99.4%
metadata-eval99.4%
Applied egg-rr99.4%
fma-udef99.4%
distribute-lft1-in99.4%
metadata-eval99.4%
mul0-lft99.4%
+-rgt-identity99.4%
Simplified99.4%
Final simplification99.5%
(FPCore (x) :precision binary64 (if (<= x 1.1) (+ (pow x -0.5) (- -1.0 (* x -0.5))) (* (pow x -0.5) (- (/ 0.5 x) (/ 0.375 (* x x))))))
double code(double x) {
double tmp;
if (x <= 1.1) {
tmp = pow(x, -0.5) + (-1.0 - (x * -0.5));
} else {
tmp = pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.1d0) then
tmp = (x ** (-0.5d0)) + ((-1.0d0) - (x * (-0.5d0)))
else
tmp = (x ** (-0.5d0)) * ((0.5d0 / x) - (0.375d0 / (x * x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 1.1) {
tmp = Math.pow(x, -0.5) + (-1.0 - (x * -0.5));
} else {
tmp = Math.pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x)));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.1: tmp = math.pow(x, -0.5) + (-1.0 - (x * -0.5)) else: tmp = math.pow(x, -0.5) * ((0.5 / x) - (0.375 / (x * x))) return tmp
function code(x) tmp = 0.0 if (x <= 1.1) tmp = Float64((x ^ -0.5) + Float64(-1.0 - Float64(x * -0.5))); else tmp = Float64((x ^ -0.5) * Float64(Float64(0.5 / x) - Float64(0.375 / Float64(x * x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.1) tmp = (x ^ -0.5) + (-1.0 - (x * -0.5)); else tmp = (x ^ -0.5) * ((0.5 / x) - (0.375 / (x * x))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.1], N[(N[Power[x, -0.5], $MachinePrecision] + N[(-1.0 - N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.5], $MachinePrecision] * N[(N[(0.5 / x), $MachinePrecision] - N[(0.375 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.1:\\
\;\;\;\;{x}^{-0.5} + \left(-1 - x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} \cdot \left(\frac{0.5}{x} - \frac{0.375}{x \cdot x}\right)\\
\end{array}
\end{array}
if x < 1.1000000000000001Initial program 99.6%
Taylor expanded in x around 0 99.6%
add-log-exp4.2%
*-un-lft-identity4.2%
log-prod4.2%
metadata-eval4.2%
add-log-exp98.8%
pow1/298.8%
pow-flip99.2%
metadata-eval99.2%
Applied egg-rr99.9%
+-lft-identity99.2%
Simplified99.9%
if 1.1000000000000001 < x Initial program 36.1%
frac-sub36.2%
div-inv36.2%
*-un-lft-identity36.2%
+-commutative36.2%
*-rgt-identity36.2%
metadata-eval36.2%
frac-times36.2%
un-div-inv36.2%
pow1/236.2%
pow-flip36.2%
metadata-eval36.2%
+-commutative36.2%
Applied egg-rr36.2%
associate-*r/36.2%
*-rgt-identity36.2%
times-frac36.2%
div-sub36.1%
*-inverses36.1%
/-rgt-identity36.1%
Simplified36.1%
Taylor expanded in x around inf 98.2%
associate-*r/98.2%
metadata-eval98.2%
associate-*r/98.2%
metadata-eval98.2%
unpow298.2%
Simplified98.2%
Final simplification99.1%
(FPCore (x) :precision binary64 (if (<= x 1.0) (+ (pow x -0.5) (- -1.0 (* x -0.5))) (* (/ 0.5 x) (pow x -0.5))))
double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = pow(x, -0.5) + (-1.0 - (x * -0.5));
} else {
tmp = (0.5 / x) * pow(x, -0.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)) + ((-1.0d0) - (x * (-0.5d0)))
else
tmp = (0.5d0 / x) * (x ** (-0.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) + (-1.0 - (x * -0.5));
} else {
tmp = (0.5 / x) * Math.pow(x, -0.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.0: tmp = math.pow(x, -0.5) + (-1.0 - (x * -0.5)) else: tmp = (0.5 / x) * math.pow(x, -0.5) return tmp
function code(x) tmp = 0.0 if (x <= 1.0) tmp = Float64((x ^ -0.5) + Float64(-1.0 - Float64(x * -0.5))); else tmp = Float64(Float64(0.5 / x) * (x ^ -0.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.0) tmp = (x ^ -0.5) + (-1.0 - (x * -0.5)); else tmp = (0.5 / x) * (x ^ -0.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.0], N[(N[Power[x, -0.5], $MachinePrecision] + N[(-1.0 - N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 / x), $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;{x}^{-0.5} + \left(-1 - x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{x} \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 1Initial program 99.6%
Taylor expanded in x around 0 99.6%
add-log-exp4.2%
*-un-lft-identity4.2%
log-prod4.2%
metadata-eval4.2%
add-log-exp98.8%
pow1/298.8%
pow-flip99.2%
metadata-eval99.2%
Applied egg-rr99.9%
+-lft-identity99.2%
Simplified99.9%
if 1 < x Initial program 36.1%
frac-sub36.2%
div-inv36.2%
*-un-lft-identity36.2%
+-commutative36.2%
*-rgt-identity36.2%
metadata-eval36.2%
frac-times36.2%
un-div-inv36.2%
pow1/236.2%
pow-flip36.2%
metadata-eval36.2%
+-commutative36.2%
Applied egg-rr36.2%
associate-*r/36.2%
*-rgt-identity36.2%
times-frac36.2%
div-sub36.1%
*-inverses36.1%
/-rgt-identity36.1%
Simplified36.1%
Taylor expanded in x around inf 97.0%
Final simplification98.4%
(FPCore (x) :precision binary64 (if (<= x 0.68) (+ (pow x -0.5) -1.0) (* (/ 0.5 x) (pow x -0.5))))
double code(double x) {
double tmp;
if (x <= 0.68) {
tmp = pow(x, -0.5) + -1.0;
} else {
tmp = (0.5 / x) * pow(x, -0.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 0.68d0) then
tmp = (x ** (-0.5d0)) + (-1.0d0)
else
tmp = (0.5d0 / x) * (x ** (-0.5d0))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 0.68) {
tmp = Math.pow(x, -0.5) + -1.0;
} else {
tmp = (0.5 / x) * Math.pow(x, -0.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 0.68: tmp = math.pow(x, -0.5) + -1.0 else: tmp = (0.5 / x) * math.pow(x, -0.5) return tmp
function code(x) tmp = 0.0 if (x <= 0.68) tmp = Float64((x ^ -0.5) + -1.0); else tmp = Float64(Float64(0.5 / x) * (x ^ -0.5)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 0.68) tmp = (x ^ -0.5) + -1.0; else tmp = (0.5 / x) * (x ^ -0.5); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 0.68], N[(N[Power[x, -0.5], $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(0.5 / x), $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.68:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{x} \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 0.680000000000000049Initial program 99.6%
Taylor expanded in x around 0 98.8%
add-log-exp4.2%
*-un-lft-identity4.2%
log-prod4.2%
metadata-eval4.2%
add-log-exp98.8%
pow1/298.8%
pow-flip99.2%
metadata-eval99.2%
Applied egg-rr99.2%
+-lft-identity99.2%
Simplified99.2%
if 0.680000000000000049 < x Initial program 36.1%
frac-sub36.2%
div-inv36.2%
*-un-lft-identity36.2%
+-commutative36.2%
*-rgt-identity36.2%
metadata-eval36.2%
frac-times36.2%
un-div-inv36.2%
pow1/236.2%
pow-flip36.2%
metadata-eval36.2%
+-commutative36.2%
Applied egg-rr36.2%
associate-*r/36.2%
*-rgt-identity36.2%
times-frac36.2%
div-sub36.1%
*-inverses36.1%
/-rgt-identity36.1%
Simplified36.1%
Taylor expanded in x around inf 97.0%
Final simplification98.1%
(FPCore (x) :precision binary64 (if (<= x 0.81) (+ (pow x -0.5) -1.0) (pow x -0.5)))
double code(double x) {
double tmp;
if (x <= 0.81) {
tmp = pow(x, -0.5) + -1.0;
} else {
tmp = pow(x, -0.5);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 0.81d0) then
tmp = (x ** (-0.5d0)) + (-1.0d0)
else
tmp = x ** (-0.5d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 0.81) {
tmp = Math.pow(x, -0.5) + -1.0;
} else {
tmp = Math.pow(x, -0.5);
}
return tmp;
}
def code(x): tmp = 0 if x <= 0.81: tmp = math.pow(x, -0.5) + -1.0 else: tmp = math.pow(x, -0.5) return tmp
function code(x) tmp = 0.0 if (x <= 0.81) tmp = Float64((x ^ -0.5) + -1.0); else tmp = x ^ -0.5; end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 0.81) tmp = (x ^ -0.5) + -1.0; else tmp = x ^ -0.5; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 0.81], N[(N[Power[x, -0.5], $MachinePrecision] + -1.0), $MachinePrecision], N[Power[x, -0.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.81:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5}\\
\end{array}
\end{array}
if x < 0.81000000000000005Initial program 99.6%
Taylor expanded in x around 0 98.8%
add-log-exp4.2%
*-un-lft-identity4.2%
log-prod4.2%
metadata-eval4.2%
add-log-exp98.8%
pow1/298.8%
pow-flip99.2%
metadata-eval99.2%
Applied egg-rr99.2%
+-lft-identity99.2%
Simplified99.2%
if 0.81000000000000005 < x Initial program 36.1%
frac-sub36.2%
div-inv36.2%
*-un-lft-identity36.2%
+-commutative36.2%
*-rgt-identity36.2%
metadata-eval36.2%
frac-times36.2%
un-div-inv36.2%
pow1/236.2%
pow-flip36.2%
metadata-eval36.2%
+-commutative36.2%
Applied egg-rr36.2%
associate-*r/36.2%
*-rgt-identity36.2%
times-frac36.2%
div-sub36.1%
*-inverses36.1%
/-rgt-identity36.1%
Simplified36.1%
Taylor expanded in x around 0 5.7%
Final simplification51.7%
(FPCore (x) :precision binary64 (pow x -0.5))
double code(double x) {
return pow(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 Math.pow(x, -0.5);
}
def code(x): return math.pow(x, -0.5)
function code(x) return x ^ -0.5 end
function tmp = code(x) tmp = x ^ -0.5; end
code[x_] := N[Power[x, -0.5], $MachinePrecision]
\begin{array}{l}
\\
{x}^{-0.5}
\end{array}
Initial program 67.3%
frac-sub67.4%
div-inv67.4%
*-un-lft-identity67.4%
+-commutative67.4%
*-rgt-identity67.4%
metadata-eval67.4%
frac-times67.4%
un-div-inv67.4%
pow1/267.4%
pow-flip67.6%
metadata-eval67.6%
+-commutative67.6%
Applied egg-rr67.6%
associate-*r/67.6%
*-rgt-identity67.6%
times-frac67.6%
div-sub67.6%
*-inverses67.6%
/-rgt-identity67.6%
Simplified67.6%
Taylor expanded in x around 0 49.1%
Final simplification49.1%
(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}
Initial program 67.3%
Taylor expanded in x around 0 50.8%
Taylor expanded in x around inf 4.1%
Final simplification4.1%
(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 2023222
(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)))))