
(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 14 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 (+ 1.0 x))))
(if (<= (+ (/ 1.0 (sqrt x)) (/ -1.0 t_0)) 1e-10)
(+ (* 0.5 (pow x -1.5)) (* -0.375 (pow x -2.5)))
(- (pow x -0.5) (/ 1.0 t_0)))))
double code(double x) {
double t_0 = sqrt((1.0 + x));
double tmp;
if (((1.0 / sqrt(x)) + (-1.0 / t_0)) <= 1e-10) {
tmp = (0.5 * pow(x, -1.5)) + (-0.375 * pow(x, -2.5));
} else {
tmp = pow(x, -0.5) - (1.0 / t_0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 + x))
if (((1.0d0 / sqrt(x)) + ((-1.0d0) / t_0)) <= 1d-10) then
tmp = (0.5d0 * (x ** (-1.5d0))) + ((-0.375d0) * (x ** (-2.5d0)))
else
tmp = (x ** (-0.5d0)) - (1.0d0 / t_0)
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sqrt((1.0 + x));
double tmp;
if (((1.0 / Math.sqrt(x)) + (-1.0 / t_0)) <= 1e-10) {
tmp = (0.5 * Math.pow(x, -1.5)) + (-0.375 * Math.pow(x, -2.5));
} else {
tmp = Math.pow(x, -0.5) - (1.0 / t_0);
}
return tmp;
}
def code(x): t_0 = math.sqrt((1.0 + x)) tmp = 0 if ((1.0 / math.sqrt(x)) + (-1.0 / t_0)) <= 1e-10: tmp = (0.5 * math.pow(x, -1.5)) + (-0.375 * math.pow(x, -2.5)) else: tmp = math.pow(x, -0.5) - (1.0 / t_0) return tmp
function code(x) t_0 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(Float64(1.0 / sqrt(x)) + Float64(-1.0 / t_0)) <= 1e-10) tmp = Float64(Float64(0.5 * (x ^ -1.5)) + Float64(-0.375 * (x ^ -2.5))); else tmp = Float64((x ^ -0.5) - Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(x) t_0 = sqrt((1.0 + x)); tmp = 0.0; if (((1.0 / sqrt(x)) + (-1.0 / t_0)) <= 1e-10) tmp = (0.5 * (x ^ -1.5)) + (-0.375 * (x ^ -2.5)); else tmp = (x ^ -0.5) - (1.0 / t_0); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], 1e-10], N[(N[(0.5 * N[Power[x, -1.5], $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[Power[x, -2.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.5], $MachinePrecision] - N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{1 + x}\\
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{t_0} \leq 10^{-10}:\\
\;\;\;\;0.5 \cdot {x}^{-1.5} + -0.375 \cdot {x}^{-2.5}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - \frac{1}{t_0}\\
\end{array}
\end{array}
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 1.00000000000000004e-10Initial program 38.6%
add-cbrt-cube38.6%
pow1/338.6%
pow338.6%
pow1/238.6%
pow-flip38.3%
metadata-eval38.3%
inv-pow38.3%
sqrt-pow238.7%
+-commutative38.7%
metadata-eval38.7%
Applied egg-rr38.7%
Taylor expanded in x around inf 60.3%
unpow1/362.2%
rem-cbrt-cube73.2%
+-commutative73.2%
pow-flip73.1%
sqrt-pow199.8%
metadata-eval99.8%
metadata-eval99.8%
pow-flip99.8%
sqrt-pow199.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
if 1.00000000000000004e-10 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.4%
expm1-log1p-u91.9%
expm1-udef91.9%
pow1/291.9%
pow-flip91.9%
metadata-eval91.9%
Applied egg-rr91.9%
expm1-def91.9%
expm1-log1p99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x) :precision binary64 (* (/ 1.0 x) (/ 1.0 (* (+ 1.0 x) (+ (pow x -0.5) (pow (+ 1.0 x) -0.5))))))
double code(double x) {
return (1.0 / x) * (1.0 / ((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 / ((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 / ((1.0 + x) * (Math.pow(x, -0.5) + Math.pow((1.0 + x), -0.5))));
}
def code(x): return (1.0 / x) * (1.0 / ((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(1.0 / 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 / ((1.0 + x) * ((x ^ -0.5) + ((1.0 + x) ^ -0.5)))); end
code[x_] := N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / 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]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x} \cdot \frac{1}{\left(1 + x\right) \cdot \left({x}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)}
\end{array}
Initial program 70.4%
flip--70.4%
frac-times62.6%
metadata-eval62.6%
add-sqr-sqrt59.7%
frac-times62.5%
metadata-eval62.5%
add-sqr-sqrt70.3%
+-commutative70.3%
pow1/270.3%
pow-flip70.3%
metadata-eval70.3%
inv-pow70.3%
sqrt-pow270.3%
+-commutative70.3%
metadata-eval70.3%
Applied egg-rr70.3%
frac-sub70.8%
*-un-lft-identity70.8%
Applied egg-rr70.8%
/-rgt-identity70.8%
*-lft-identity70.8%
/-rgt-identity70.8%
associate-/r*70.8%
*-lft-identity70.8%
/-rgt-identity70.8%
*-rgt-identity70.8%
/-rgt-identity70.8%
associate--l+93.2%
+-inverses93.2%
metadata-eval93.2%
Simplified93.2%
associate-/l/99.4%
div-inv99.2%
*-commutative99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x) :precision binary64 (if (<= x 61000000.0) (- (pow x -0.5) (/ 1.0 (sqrt (+ 1.0 x)))) (/ (/ (/ 1.0 x) (+ 1.0 x)) (* 2.0 (sqrt (/ 1.0 x))))))
double code(double x) {
double tmp;
if (x <= 61000000.0) {
tmp = pow(x, -0.5) - (1.0 / sqrt((1.0 + x)));
} else {
tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * sqrt((1.0 / x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 61000000.0d0) then
tmp = (x ** (-0.5d0)) - (1.0d0 / sqrt((1.0d0 + x)))
else
tmp = ((1.0d0 / x) / (1.0d0 + x)) / (2.0d0 * sqrt((1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 61000000.0) {
tmp = Math.pow(x, -0.5) - (1.0 / Math.sqrt((1.0 + x)));
} else {
tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * Math.sqrt((1.0 / x)));
}
return tmp;
}
def code(x): tmp = 0 if x <= 61000000.0: tmp = math.pow(x, -0.5) - (1.0 / math.sqrt((1.0 + x))) else: tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * math.sqrt((1.0 / x))) return tmp
function code(x) tmp = 0.0 if (x <= 61000000.0) tmp = Float64((x ^ -0.5) - Float64(1.0 / sqrt(Float64(1.0 + x)))); else tmp = Float64(Float64(Float64(1.0 / x) / Float64(1.0 + x)) / Float64(2.0 * sqrt(Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 61000000.0) tmp = (x ^ -0.5) - (1.0 / sqrt((1.0 + x))); else tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * sqrt((1.0 / x))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 61000000.0], N[(N[Power[x, -0.5], $MachinePrecision] - N[(1.0 / N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 61000000:\\
\;\;\;\;{x}^{-0.5} - \frac{1}{\sqrt{1 + x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{1 + x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\end{array}
if x < 6.1e7Initial program 98.9%
expm1-log1p-u91.5%
expm1-udef91.2%
pow1/291.2%
pow-flip91.2%
metadata-eval91.2%
Applied egg-rr91.2%
expm1-def91.6%
expm1-log1p99.3%
Simplified99.3%
if 6.1e7 < x Initial program 38.1%
flip--38.1%
frac-times22.0%
metadata-eval22.0%
add-sqr-sqrt15.7%
frac-times21.5%
metadata-eval21.5%
add-sqr-sqrt38.2%
+-commutative38.2%
pow1/238.2%
pow-flip38.2%
metadata-eval38.2%
inv-pow38.2%
sqrt-pow238.2%
+-commutative38.2%
metadata-eval38.2%
Applied egg-rr38.2%
frac-sub38.5%
*-un-lft-identity38.5%
Applied egg-rr38.5%
/-rgt-identity38.5%
*-lft-identity38.5%
/-rgt-identity38.5%
associate-/r*38.5%
*-lft-identity38.5%
/-rgt-identity38.5%
*-rgt-identity38.5%
/-rgt-identity38.5%
associate--l+86.4%
+-inverses86.4%
metadata-eval86.4%
Simplified86.4%
Taylor expanded in x around inf 86.1%
Final simplification93.2%
(FPCore (x) :precision binary64 (if (<= x 90000000.0) (- (pow x -0.5) (pow (+ 1.0 x) -0.5)) (/ (/ (/ 1.0 x) (+ 1.0 x)) (* 2.0 (sqrt (/ 1.0 x))))))
double code(double x) {
double tmp;
if (x <= 90000000.0) {
tmp = pow(x, -0.5) - pow((1.0 + x), -0.5);
} else {
tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * sqrt((1.0 / x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 90000000.0d0) then
tmp = (x ** (-0.5d0)) - ((1.0d0 + x) ** (-0.5d0))
else
tmp = ((1.0d0 / x) / (1.0d0 + x)) / (2.0d0 * sqrt((1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 90000000.0) {
tmp = Math.pow(x, -0.5) - Math.pow((1.0 + x), -0.5);
} else {
tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * Math.sqrt((1.0 / x)));
}
return tmp;
}
def code(x): tmp = 0 if x <= 90000000.0: tmp = math.pow(x, -0.5) - math.pow((1.0 + x), -0.5) else: tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * math.sqrt((1.0 / x))) return tmp
function code(x) tmp = 0.0 if (x <= 90000000.0) tmp = Float64((x ^ -0.5) - (Float64(1.0 + x) ^ -0.5)); else tmp = Float64(Float64(Float64(1.0 / x) / Float64(1.0 + x)) / Float64(2.0 * sqrt(Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 90000000.0) tmp = (x ^ -0.5) - ((1.0 + x) ^ -0.5); else tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * sqrt((1.0 / x))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 90000000.0], N[(N[Power[x, -0.5], $MachinePrecision] - N[Power[N[(1.0 + x), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 90000000:\\
\;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{1 + x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\end{array}
if x < 9e7Initial program 98.9%
*-un-lft-identity98.9%
clear-num98.9%
associate-/r/98.9%
prod-diff98.9%
*-un-lft-identity98.9%
fma-neg98.9%
*-un-lft-identity98.9%
pow1/298.9%
pow-flip99.3%
metadata-eval99.3%
pow1/299.3%
pow-flip99.3%
+-commutative99.3%
metadata-eval99.3%
Applied egg-rr99.3%
associate-+l-99.3%
expm1-log1p99.3%
expm1-def98.9%
associate--l-98.9%
fma-udef98.9%
distribute-lft1-in98.9%
metadata-eval98.9%
mul0-lft98.9%
metadata-eval98.9%
expm1-def99.3%
expm1-log1p99.3%
Simplified99.3%
if 9e7 < x Initial program 38.1%
flip--38.1%
frac-times22.0%
metadata-eval22.0%
add-sqr-sqrt15.7%
frac-times21.5%
metadata-eval21.5%
add-sqr-sqrt38.2%
+-commutative38.2%
pow1/238.2%
pow-flip38.2%
metadata-eval38.2%
inv-pow38.2%
sqrt-pow238.2%
+-commutative38.2%
metadata-eval38.2%
Applied egg-rr38.2%
frac-sub38.5%
*-un-lft-identity38.5%
Applied egg-rr38.5%
/-rgt-identity38.5%
*-lft-identity38.5%
/-rgt-identity38.5%
associate-/r*38.5%
*-lft-identity38.5%
/-rgt-identity38.5%
*-rgt-identity38.5%
/-rgt-identity38.5%
associate--l+86.4%
+-inverses86.4%
metadata-eval86.4%
Simplified86.4%
Taylor expanded in x around inf 86.1%
Final simplification93.1%
(FPCore (x) :precision binary64 (if (<= x 1.2) (- (pow x -0.5) (/ 1.0 (+ 1.0 (* x 0.5)))) (/ (/ -1.0 (* x (- -1.0 x))) (* 2.0 (sqrt (/ 1.0 x))))))
double code(double x) {
double tmp;
if (x <= 1.2) {
tmp = pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5)));
} else {
tmp = (-1.0 / (x * (-1.0 - x))) / (2.0 * sqrt((1.0 / x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.2d0) then
tmp = (x ** (-0.5d0)) - (1.0d0 / (1.0d0 + (x * 0.5d0)))
else
tmp = ((-1.0d0) / (x * ((-1.0d0) - x))) / (2.0d0 * sqrt((1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 1.2) {
tmp = Math.pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5)));
} else {
tmp = (-1.0 / (x * (-1.0 - x))) / (2.0 * Math.sqrt((1.0 / x)));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.2: tmp = math.pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5))) else: tmp = (-1.0 / (x * (-1.0 - x))) / (2.0 * math.sqrt((1.0 / x))) return tmp
function code(x) tmp = 0.0 if (x <= 1.2) tmp = Float64((x ^ -0.5) - Float64(1.0 / Float64(1.0 + Float64(x * 0.5)))); else tmp = Float64(Float64(-1.0 / Float64(x * Float64(-1.0 - x))) / Float64(2.0 * sqrt(Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.2) tmp = (x ^ -0.5) - (1.0 / (1.0 + (x * 0.5))); else tmp = (-1.0 / (x * (-1.0 - x))) / (2.0 * sqrt((1.0 / x))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.2], N[(N[Power[x, -0.5], $MachinePrecision] - N[(1.0 / N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(x * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.2:\\
\;\;\;\;{x}^{-0.5} - \frac{1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1}{x \cdot \left(-1 - x\right)}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\end{array}
if x < 1.19999999999999996Initial program 99.6%
expm1-log1p-u92.0%
expm1-udef92.0%
pow1/292.0%
pow-flip92.0%
metadata-eval92.0%
Applied egg-rr92.0%
expm1-def92.0%
expm1-log1p100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
*-commutative99.7%
Simplified99.7%
if 1.19999999999999996 < x Initial program 39.3%
flip--39.3%
frac-times23.6%
metadata-eval23.6%
add-sqr-sqrt17.6%
frac-times23.3%
metadata-eval23.3%
add-sqr-sqrt39.4%
+-commutative39.4%
pow1/239.4%
pow-flip39.4%
metadata-eval39.4%
inv-pow39.4%
sqrt-pow239.4%
+-commutative39.4%
metadata-eval39.4%
Applied egg-rr39.4%
Taylor expanded in x around inf 38.4%
frac-2neg38.4%
metadata-eval38.4%
frac-sub38.5%
Applied egg-rr38.5%
*-lft-identity38.5%
cancel-sign-sub-inv38.5%
*-commutative38.5%
mul-1-neg38.5%
distribute-neg-in38.5%
associate-+l+84.5%
sub-neg84.5%
+-inverses84.5%
metadata-eval84.5%
metadata-eval84.5%
distribute-neg-in84.5%
metadata-eval84.5%
unsub-neg84.5%
Simplified84.5%
Final simplification92.3%
(FPCore (x) :precision binary64 (if (<= x 1.2) (- (pow x -0.5) (/ 1.0 (+ 1.0 (* x 0.5)))) (/ (/ (/ 1.0 x) (+ 1.0 x)) (* 2.0 (sqrt (/ 1.0 x))))))
double code(double x) {
double tmp;
if (x <= 1.2) {
tmp = pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5)));
} else {
tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * sqrt((1.0 / x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.2d0) then
tmp = (x ** (-0.5d0)) - (1.0d0 / (1.0d0 + (x * 0.5d0)))
else
tmp = ((1.0d0 / x) / (1.0d0 + x)) / (2.0d0 * sqrt((1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 1.2) {
tmp = Math.pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5)));
} else {
tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * Math.sqrt((1.0 / x)));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.2: tmp = math.pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5))) else: tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * math.sqrt((1.0 / x))) return tmp
function code(x) tmp = 0.0 if (x <= 1.2) tmp = Float64((x ^ -0.5) - Float64(1.0 / Float64(1.0 + Float64(x * 0.5)))); else tmp = Float64(Float64(Float64(1.0 / x) / Float64(1.0 + x)) / Float64(2.0 * sqrt(Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.2) tmp = (x ^ -0.5) - (1.0 / (1.0 + (x * 0.5))); else tmp = ((1.0 / x) / (1.0 + x)) / (2.0 * sqrt((1.0 / x))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.2], N[(N[Power[x, -0.5], $MachinePrecision] - N[(1.0 / N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.2:\\
\;\;\;\;{x}^{-0.5} - \frac{1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{1 + x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\end{array}
if x < 1.19999999999999996Initial program 99.6%
expm1-log1p-u92.0%
expm1-udef92.0%
pow1/292.0%
pow-flip92.0%
metadata-eval92.0%
Applied egg-rr92.0%
expm1-def92.0%
expm1-log1p100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
*-commutative99.7%
Simplified99.7%
if 1.19999999999999996 < x Initial program 39.3%
flip--39.3%
frac-times23.6%
metadata-eval23.6%
add-sqr-sqrt17.6%
frac-times23.3%
metadata-eval23.3%
add-sqr-sqrt39.4%
+-commutative39.4%
pow1/239.4%
pow-flip39.4%
metadata-eval39.4%
inv-pow39.4%
sqrt-pow239.4%
+-commutative39.4%
metadata-eval39.4%
Applied egg-rr39.4%
frac-sub40.5%
*-un-lft-identity40.5%
Applied egg-rr40.5%
/-rgt-identity40.5%
*-lft-identity40.5%
/-rgt-identity40.5%
associate-/r*40.5%
*-lft-identity40.5%
/-rgt-identity40.5%
*-rgt-identity40.5%
/-rgt-identity40.5%
associate--l+86.8%
+-inverses86.8%
metadata-eval86.8%
Simplified86.8%
Taylor expanded in x around inf 84.9%
Final simplification92.5%
(FPCore (x) :precision binary64 (if (<= x 8.5e+122) (- (pow x -0.5) (/ 1.0 (+ 1.0 (* x 0.5)))) (+ -1.0 (+ 1.0 (pow x -0.5)))))
double code(double x) {
double tmp;
if (x <= 8.5e+122) {
tmp = pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5)));
} else {
tmp = -1.0 + (1.0 + pow(x, -0.5));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 8.5d+122) then
tmp = (x ** (-0.5d0)) - (1.0d0 / (1.0d0 + (x * 0.5d0)))
else
tmp = (-1.0d0) + (1.0d0 + (x ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 8.5e+122) {
tmp = Math.pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5)));
} else {
tmp = -1.0 + (1.0 + Math.pow(x, -0.5));
}
return tmp;
}
def code(x): tmp = 0 if x <= 8.5e+122: tmp = math.pow(x, -0.5) - (1.0 / (1.0 + (x * 0.5))) else: tmp = -1.0 + (1.0 + math.pow(x, -0.5)) return tmp
function code(x) tmp = 0.0 if (x <= 8.5e+122) tmp = Float64((x ^ -0.5) - Float64(1.0 / Float64(1.0 + Float64(x * 0.5)))); else tmp = Float64(-1.0 + Float64(1.0 + (x ^ -0.5))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 8.5e+122) tmp = (x ^ -0.5) - (1.0 / (1.0 + (x * 0.5))); else tmp = -1.0 + (1.0 + (x ^ -0.5)); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 8.5e+122], 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[(1.0 + N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{+122}:\\
\;\;\;\;{x}^{-0.5} - \frac{1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(1 + {x}^{-0.5}\right)\\
\end{array}
\end{array}
if x < 8.50000000000000003e122Initial program 74.0%
expm1-log1p-u68.6%
expm1-udef67.9%
pow1/267.9%
pow-flip67.9%
metadata-eval67.9%
Applied egg-rr67.9%
expm1-def68.7%
expm1-log1p74.4%
Simplified74.4%
Taylor expanded in x around 0 73.2%
*-commutative73.2%
Simplified73.2%
if 8.50000000000000003e122 < x Initial program 61.0%
*-un-lft-identity61.0%
clear-num61.0%
associate-/r/61.0%
prod-diff61.0%
*-un-lft-identity61.0%
fma-neg61.0%
*-un-lft-identity61.0%
pow1/261.0%
pow-flip41.8%
metadata-eval41.8%
pow1/241.8%
pow-flip61.0%
+-commutative61.0%
metadata-eval61.0%
Applied egg-rr61.0%
associate-+l-61.0%
expm1-log1p61.0%
expm1-def4.5%
associate--l-4.5%
fma-udef4.5%
distribute-lft1-in4.5%
metadata-eval4.5%
mul0-lft4.5%
metadata-eval4.5%
expm1-def61.0%
expm1-log1p61.0%
Simplified61.0%
Applied egg-rr4.5%
associate-*r/4.5%
*-rgt-identity4.5%
Simplified4.5%
Taylor expanded in x around inf 4.5%
inv-pow4.5%
sqrt-pow14.5%
metadata-eval4.5%
expm1-log1p-u4.5%
expm1-udef61.0%
log1p-udef61.0%
add-exp-log61.0%
Applied egg-rr61.0%
Final simplification69.8%
(FPCore (x) :precision binary64 (/ (/ (/ 1.0 x) (+ 1.0 x)) (+ 1.0 (pow x -0.5))))
double code(double x) {
return ((1.0 / x) / (1.0 + x)) / (1.0 + pow(x, -0.5));
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((1.0d0 / x) / (1.0d0 + x)) / (1.0d0 + (x ** (-0.5d0)))
end function
public static double code(double x) {
return ((1.0 / x) / (1.0 + x)) / (1.0 + Math.pow(x, -0.5));
}
def code(x): return ((1.0 / x) / (1.0 + x)) / (1.0 + math.pow(x, -0.5))
function code(x) return Float64(Float64(Float64(1.0 / x) / Float64(1.0 + x)) / Float64(1.0 + (x ^ -0.5))) end
function tmp = code(x) tmp = ((1.0 / x) / (1.0 + x)) / (1.0 + (x ^ -0.5)); end
code[x_] := N[(N[(N[(1.0 / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{1}{x}}{1 + x}}{1 + {x}^{-0.5}}
\end{array}
Initial program 70.4%
flip--70.4%
frac-times62.6%
metadata-eval62.6%
add-sqr-sqrt59.7%
frac-times62.5%
metadata-eval62.5%
add-sqr-sqrt70.3%
+-commutative70.3%
pow1/270.3%
pow-flip70.3%
metadata-eval70.3%
inv-pow70.3%
sqrt-pow270.3%
+-commutative70.3%
metadata-eval70.3%
Applied egg-rr70.3%
frac-sub70.8%
*-un-lft-identity70.8%
Applied egg-rr70.8%
/-rgt-identity70.8%
*-lft-identity70.8%
/-rgt-identity70.8%
associate-/r*70.8%
*-lft-identity70.8%
/-rgt-identity70.8%
*-rgt-identity70.8%
/-rgt-identity70.8%
associate--l+93.2%
+-inverses93.2%
metadata-eval93.2%
Simplified93.2%
Taylor expanded in x around 0 69.4%
Final simplification69.4%
(FPCore (x) :precision binary64 (/ 1.0 (/ (* x (+ x -1.0)) (- x (sqrt x)))))
double code(double x) {
return 1.0 / ((x * (x + -1.0)) / (x - sqrt(x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 / ((x * (x + (-1.0d0))) / (x - sqrt(x)))
end function
public static double code(double x) {
return 1.0 / ((x * (x + -1.0)) / (x - Math.sqrt(x)));
}
def code(x): return 1.0 / ((x * (x + -1.0)) / (x - math.sqrt(x)))
function code(x) return Float64(1.0 / Float64(Float64(x * Float64(x + -1.0)) / Float64(x - sqrt(x)))) end
function tmp = code(x) tmp = 1.0 / ((x * (x + -1.0)) / (x - sqrt(x))); end
code[x_] := N[(1.0 / N[(N[(x * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / N[(x - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{x \cdot \left(x + -1\right)}{x - \sqrt{x}}}
\end{array}
Initial program 70.4%
flip--70.4%
frac-times62.6%
metadata-eval62.6%
add-sqr-sqrt59.7%
frac-times62.5%
metadata-eval62.5%
add-sqr-sqrt70.3%
+-commutative70.3%
pow1/270.3%
pow-flip70.3%
metadata-eval70.3%
inv-pow70.3%
sqrt-pow270.3%
+-commutative70.3%
metadata-eval70.3%
Applied egg-rr70.3%
Taylor expanded in x around 0 54.0%
distribute-lft-in54.0%
*-rgt-identity54.0%
pow154.0%
pow-prod-up54.2%
metadata-eval54.2%
pow1/254.2%
flip-+69.1%
add-sqr-sqrt69.0%
*-un-lft-identity69.0%
distribute-rgt-out--69.0%
sub-neg69.0%
metadata-eval69.0%
Applied egg-rr69.0%
Final simplification69.0%
(FPCore (x) :precision binary64 (if (<= x 8.2e+76) (- (pow x -0.5) (+ 1.0 (* x -0.5))) (+ -1.0 (+ 1.0 (pow x -0.5)))))
double code(double x) {
double tmp;
if (x <= 8.2e+76) {
tmp = pow(x, -0.5) - (1.0 + (x * -0.5));
} else {
tmp = -1.0 + (1.0 + pow(x, -0.5));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 8.2d+76) then
tmp = (x ** (-0.5d0)) - (1.0d0 + (x * (-0.5d0)))
else
tmp = (-1.0d0) + (1.0d0 + (x ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 8.2e+76) {
tmp = Math.pow(x, -0.5) - (1.0 + (x * -0.5));
} else {
tmp = -1.0 + (1.0 + Math.pow(x, -0.5));
}
return tmp;
}
def code(x): tmp = 0 if x <= 8.2e+76: tmp = math.pow(x, -0.5) - (1.0 + (x * -0.5)) else: tmp = -1.0 + (1.0 + math.pow(x, -0.5)) return tmp
function code(x) tmp = 0.0 if (x <= 8.2e+76) tmp = Float64((x ^ -0.5) - Float64(1.0 + Float64(x * -0.5))); else tmp = Float64(-1.0 + Float64(1.0 + (x ^ -0.5))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 8.2e+76) tmp = (x ^ -0.5) - (1.0 + (x * -0.5)); else tmp = -1.0 + (1.0 + (x ^ -0.5)); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 8.2e+76], N[(N[Power[x, -0.5], $MachinePrecision] - N[(1.0 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(1.0 + N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.2 \cdot 10^{+76}:\\
\;\;\;\;{x}^{-0.5} - \left(1 + x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(1 + {x}^{-0.5}\right)\\
\end{array}
\end{array}
if x < 8.1999999999999997e76Initial program 80.6%
*-un-lft-identity80.6%
clear-num80.6%
associate-/r/80.6%
prod-diff80.6%
*-un-lft-identity80.6%
fma-neg80.6%
*-un-lft-identity80.6%
pow1/280.6%
pow-flip81.0%
metadata-eval81.0%
pow1/281.0%
pow-flip81.0%
+-commutative81.0%
metadata-eval81.0%
Applied egg-rr81.0%
associate-+l-81.0%
expm1-log1p81.0%
expm1-def81.0%
associate--l-81.0%
fma-udef81.0%
distribute-lft1-in81.0%
metadata-eval81.0%
mul0-lft81.0%
metadata-eval81.0%
expm1-def81.0%
expm1-log1p81.0%
Simplified81.0%
Taylor expanded in x around 0 79.1%
*-commutative79.1%
Simplified79.1%
if 8.1999999999999997e76 < x Initial program 50.6%
*-un-lft-identity50.6%
clear-num50.6%
associate-/r/50.6%
prod-diff50.6%
*-un-lft-identity50.6%
fma-neg50.6%
*-un-lft-identity50.6%
pow1/250.6%
pow-flip34.9%
metadata-eval34.9%
pow1/234.9%
pow-flip50.6%
+-commutative50.6%
metadata-eval50.6%
Applied egg-rr50.6%
associate-+l-50.6%
expm1-log1p50.6%
expm1-def4.7%
associate--l-4.7%
fma-udef4.7%
distribute-lft1-in4.7%
metadata-eval4.7%
mul0-lft4.7%
metadata-eval4.7%
expm1-def50.6%
expm1-log1p50.6%
Simplified50.6%
Applied egg-rr4.7%
associate-*r/4.7%
*-rgt-identity4.7%
Simplified4.7%
Taylor expanded in x around inf 4.7%
inv-pow4.7%
sqrt-pow14.7%
metadata-eval4.7%
expm1-log1p-u4.7%
expm1-udef50.6%
log1p-udef50.6%
add-exp-log50.6%
Applied egg-rr50.6%
Final simplification69.4%
(FPCore (x) :precision binary64 (+ -1.0 (+ 1.0 (pow x -0.5))))
double code(double x) {
return -1.0 + (1.0 + pow(x, -0.5));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (-1.0d0) + (1.0d0 + (x ** (-0.5d0)))
end function
public static double code(double x) {
return -1.0 + (1.0 + Math.pow(x, -0.5));
}
def code(x): return -1.0 + (1.0 + math.pow(x, -0.5))
function code(x) return Float64(-1.0 + Float64(1.0 + (x ^ -0.5))) end
function tmp = code(x) tmp = -1.0 + (1.0 + (x ^ -0.5)); end
code[x_] := N[(-1.0 + N[(1.0 + N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-1 + \left(1 + {x}^{-0.5}\right)
\end{array}
Initial program 70.4%
*-un-lft-identity70.4%
clear-num70.4%
associate-/r/70.4%
prod-diff70.4%
*-un-lft-identity70.4%
fma-neg70.4%
*-un-lft-identity70.4%
pow1/270.4%
pow-flip65.3%
metadata-eval65.3%
pow1/265.3%
pow-flip70.7%
+-commutative70.7%
metadata-eval70.7%
Applied egg-rr70.7%
associate-+l-70.7%
expm1-log1p70.7%
expm1-def55.1%
associate--l-55.1%
fma-udef55.1%
distribute-lft1-in55.1%
metadata-eval55.1%
mul0-lft55.1%
metadata-eval55.1%
expm1-def70.7%
expm1-log1p70.7%
Simplified70.7%
Applied egg-rr52.9%
associate-*r/52.9%
*-rgt-identity52.9%
Simplified52.9%
Taylor expanded in x around inf 52.2%
inv-pow52.2%
sqrt-pow152.3%
metadata-eval52.3%
expm1-log1p-u48.4%
expm1-udef63.7%
log1p-udef63.7%
add-exp-log67.6%
Applied egg-rr67.6%
Final simplification67.6%
(FPCore (x) :precision binary64 (/ 1.0 (+ x (sqrt x))))
double code(double x) {
return 1.0 / (x + sqrt(x));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 / (x + sqrt(x))
end function
public static double code(double x) {
return 1.0 / (x + Math.sqrt(x));
}
def code(x): return 1.0 / (x + math.sqrt(x))
function code(x) return Float64(1.0 / Float64(x + sqrt(x))) end
function tmp = code(x) tmp = 1.0 / (x + sqrt(x)); end
code[x_] := N[(1.0 / N[(x + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x + \sqrt{x}}
\end{array}
Initial program 70.4%
flip--70.4%
frac-times62.6%
metadata-eval62.6%
add-sqr-sqrt59.7%
frac-times62.5%
metadata-eval62.5%
add-sqr-sqrt70.3%
+-commutative70.3%
pow1/270.3%
pow-flip70.3%
metadata-eval70.3%
inv-pow70.3%
sqrt-pow270.3%
+-commutative70.3%
metadata-eval70.3%
Applied egg-rr70.3%
Taylor expanded in x around 0 54.0%
+-commutative54.0%
distribute-lft-in54.0%
pow154.0%
pow-prod-up54.2%
metadata-eval54.2%
pow1/254.2%
*-rgt-identity54.2%
Applied egg-rr54.2%
Final simplification54.2%
(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 70.4%
*-un-lft-identity70.4%
clear-num70.4%
associate-/r/70.4%
prod-diff70.4%
*-un-lft-identity70.4%
fma-neg70.4%
*-un-lft-identity70.4%
pow1/270.4%
pow-flip65.3%
metadata-eval65.3%
pow1/265.3%
pow-flip70.7%
+-commutative70.7%
metadata-eval70.7%
Applied egg-rr70.7%
associate-+l-70.7%
expm1-log1p70.7%
expm1-def55.1%
associate--l-55.1%
fma-udef55.1%
distribute-lft1-in55.1%
metadata-eval55.1%
mul0-lft55.1%
metadata-eval55.1%
expm1-def70.7%
expm1-log1p70.7%
Simplified70.7%
Applied egg-rr52.9%
associate-*r/52.9%
*-rgt-identity52.9%
Simplified52.9%
Taylor expanded in x around inf 52.2%
inv-pow52.2%
sqrt-pow152.3%
metadata-eval52.3%
*-un-lft-identity52.3%
Applied egg-rr52.3%
*-lft-identity52.3%
Simplified52.3%
Final simplification52.3%
(FPCore (x) :precision binary64 -1.0)
double code(double x) {
return -1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = -1.0d0
end function
public static double code(double x) {
return -1.0;
}
def code(x): return -1.0
function code(x) return -1.0 end
function tmp = code(x) tmp = -1.0; end
code[x_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 70.4%
Taylor expanded in x around 0 52.0%
Taylor expanded in x around inf 1.9%
Final simplification1.9%
(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 2023331
(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)))))