
(FPCore (x eps) :precision binary64 (- x (sqrt (- (* x x) eps))))
double code(double x, double eps) {
return x - sqrt(((x * x) - eps));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = x - sqrt(((x * x) - eps))
end function
public static double code(double x, double eps) {
return x - Math.sqrt(((x * x) - eps));
}
def code(x, eps): return x - math.sqrt(((x * x) - eps))
function code(x, eps) return Float64(x - sqrt(Float64(Float64(x * x) - eps))) end
function tmp = code(x, eps) tmp = x - sqrt(((x * x) - eps)); end
code[x_, eps_] := N[(x - N[Sqrt[N[(N[(x * x), $MachinePrecision] - eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \sqrt{x \cdot x - \varepsilon}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (- x (sqrt (- (* x x) eps))))
double code(double x, double eps) {
return x - sqrt(((x * x) - eps));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = x - sqrt(((x * x) - eps))
end function
public static double code(double x, double eps) {
return x - Math.sqrt(((x * x) - eps));
}
def code(x, eps): return x - math.sqrt(((x * x) - eps))
function code(x, eps) return Float64(x - sqrt(Float64(Float64(x * x) - eps))) end
function tmp = code(x, eps) tmp = x - sqrt(((x * x) - eps)); end
code[x_, eps_] := N[(x - N[Sqrt[N[(N[(x * x), $MachinePrecision] - eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \sqrt{x \cdot x - \varepsilon}
\end{array}
(FPCore (x eps)
:precision binary64
(if (<= (- x (sqrt (- (* x x) eps))) -1e-152)
(- x (hypot (sqrt (- eps)) x))
(/
eps
(fma
-0.125
(* (/ eps (pow x 2.0)) (/ eps x))
(fma x 2.0 (* eps (/ -0.5 x)))))))
double code(double x, double eps) {
double tmp;
if ((x - sqrt(((x * x) - eps))) <= -1e-152) {
tmp = x - hypot(sqrt(-eps), x);
} else {
tmp = eps / fma(-0.125, ((eps / pow(x, 2.0)) * (eps / x)), fma(x, 2.0, (eps * (-0.5 / x))));
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (Float64(x - sqrt(Float64(Float64(x * x) - eps))) <= -1e-152) tmp = Float64(x - hypot(sqrt(Float64(-eps)), x)); else tmp = Float64(eps / fma(-0.125, Float64(Float64(eps / (x ^ 2.0)) * Float64(eps / x)), fma(x, 2.0, Float64(eps * Float64(-0.5 / x))))); end return tmp end
code[x_, eps_] := If[LessEqual[N[(x - N[Sqrt[N[(N[(x * x), $MachinePrecision] - eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -1e-152], N[(x - N[Sqrt[N[Sqrt[(-eps)], $MachinePrecision] ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision], N[(eps / N[(-0.125 * N[(N[(eps / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] * N[(eps / x), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0 + N[(eps * N[(-0.5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x - \sqrt{x \cdot x - \varepsilon} \leq -1 \cdot 10^{-152}:\\
\;\;\;\;x - \mathsf{hypot}\left(\sqrt{-\varepsilon}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{\mathsf{fma}\left(-0.125, \frac{\varepsilon}{{x}^{2}} \cdot \frac{\varepsilon}{x}, \mathsf{fma}\left(x, 2, \varepsilon \cdot \frac{-0.5}{x}\right)\right)}\\
\end{array}
\end{array}
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -1.00000000000000007e-152Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
add-sqr-sqrt99.2%
hypot-def99.2%
Applied egg-rr99.2%
if -1.00000000000000007e-152 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 8.6%
flip--8.6%
div-inv8.6%
add-sqr-sqrt8.7%
associate--r-99.6%
pow299.6%
pow299.6%
sub-neg99.6%
add-sqr-sqrt47.4%
hypot-def47.4%
Applied egg-rr47.4%
+-inverses47.4%
+-lft-identity47.4%
associate-*r/47.5%
associate-/l*47.5%
/-rgt-identity47.5%
Simplified47.5%
Taylor expanded in x around inf 0.0%
fma-def0.0%
*-commutative0.0%
metadata-eval0.0%
pow-sqr0.0%
unpow20.0%
rem-square-sqrt0.0%
unpow20.0%
rem-square-sqrt0.0%
metadata-eval0.0%
*-lft-identity0.0%
+-commutative0.0%
*-commutative0.0%
fma-def0.0%
associate-*r/0.0%
Simplified87.5%
unpow287.5%
unpow387.5%
times-frac99.8%
pow299.8%
Applied egg-rr99.8%
Final simplification99.5%
(FPCore (x eps) :precision binary64 (if (<= (- x (sqrt (- (* x x) eps))) -1e-152) (- x (hypot (sqrt (- eps)) x)) (/ eps (+ (* (/ eps x) -0.5) (* x 2.0)))))
double code(double x, double eps) {
double tmp;
if ((x - sqrt(((x * x) - eps))) <= -1e-152) {
tmp = x - hypot(sqrt(-eps), x);
} else {
tmp = eps / (((eps / x) * -0.5) + (x * 2.0));
}
return tmp;
}
public static double code(double x, double eps) {
double tmp;
if ((x - Math.sqrt(((x * x) - eps))) <= -1e-152) {
tmp = x - Math.hypot(Math.sqrt(-eps), x);
} else {
tmp = eps / (((eps / x) * -0.5) + (x * 2.0));
}
return tmp;
}
def code(x, eps): tmp = 0 if (x - math.sqrt(((x * x) - eps))) <= -1e-152: tmp = x - math.hypot(math.sqrt(-eps), x) else: tmp = eps / (((eps / x) * -0.5) + (x * 2.0)) return tmp
function code(x, eps) tmp = 0.0 if (Float64(x - sqrt(Float64(Float64(x * x) - eps))) <= -1e-152) tmp = Float64(x - hypot(sqrt(Float64(-eps)), x)); else tmp = Float64(eps / Float64(Float64(Float64(eps / x) * -0.5) + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if ((x - sqrt(((x * x) - eps))) <= -1e-152) tmp = x - hypot(sqrt(-eps), x); else tmp = eps / (((eps / x) * -0.5) + (x * 2.0)); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[N[(x - N[Sqrt[N[(N[(x * x), $MachinePrecision] - eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -1e-152], N[(x - N[Sqrt[N[Sqrt[(-eps)], $MachinePrecision] ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision], N[(eps / N[(N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x - \sqrt{x \cdot x - \varepsilon} \leq -1 \cdot 10^{-152}:\\
\;\;\;\;x - \mathsf{hypot}\left(\sqrt{-\varepsilon}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\varepsilon}{x} \cdot -0.5 + x \cdot 2}\\
\end{array}
\end{array}
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -1.00000000000000007e-152Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
add-sqr-sqrt99.2%
hypot-def99.2%
Applied egg-rr99.2%
if -1.00000000000000007e-152 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 8.6%
flip--8.6%
div-inv8.6%
add-sqr-sqrt8.7%
associate--r-99.6%
pow299.6%
pow299.6%
sub-neg99.6%
add-sqr-sqrt47.4%
hypot-def47.4%
Applied egg-rr47.4%
+-inverses47.4%
+-lft-identity47.4%
associate-*r/47.5%
associate-/l*47.5%
/-rgt-identity47.5%
Simplified47.5%
Taylor expanded in x around inf 0.0%
fma-def0.0%
*-commutative0.0%
metadata-eval0.0%
pow-sqr0.0%
unpow20.0%
rem-square-sqrt0.0%
unpow20.0%
rem-square-sqrt0.0%
metadata-eval0.0%
*-lft-identity0.0%
+-commutative0.0%
*-commutative0.0%
fma-def0.0%
associate-*r/0.0%
Simplified87.5%
Taylor expanded in eps around 0 99.1%
Final simplification99.2%
(FPCore (x eps) :precision binary64 (let* ((t_0 (- x (sqrt (- (* x x) eps))))) (if (<= t_0 -1e-152) t_0 (/ eps (+ (* (/ eps x) -0.5) (* x 2.0))))))
double code(double x, double eps) {
double t_0 = x - sqrt(((x * x) - eps));
double tmp;
if (t_0 <= -1e-152) {
tmp = t_0;
} else {
tmp = eps / (((eps / x) * -0.5) + (x * 2.0));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = x - sqrt(((x * x) - eps))
if (t_0 <= (-1d-152)) then
tmp = t_0
else
tmp = eps / (((eps / x) * (-0.5d0)) + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = x - Math.sqrt(((x * x) - eps));
double tmp;
if (t_0 <= -1e-152) {
tmp = t_0;
} else {
tmp = eps / (((eps / x) * -0.5) + (x * 2.0));
}
return tmp;
}
def code(x, eps): t_0 = x - math.sqrt(((x * x) - eps)) tmp = 0 if t_0 <= -1e-152: tmp = t_0 else: tmp = eps / (((eps / x) * -0.5) + (x * 2.0)) return tmp
function code(x, eps) t_0 = Float64(x - sqrt(Float64(Float64(x * x) - eps))) tmp = 0.0 if (t_0 <= -1e-152) tmp = t_0; else tmp = Float64(eps / Float64(Float64(Float64(eps / x) * -0.5) + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, eps) t_0 = x - sqrt(((x * x) - eps)); tmp = 0.0; if (t_0 <= -1e-152) tmp = t_0; else tmp = eps / (((eps / x) * -0.5) + (x * 2.0)); end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(x - N[Sqrt[N[(N[(x * x), $MachinePrecision] - eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-152], t$95$0, N[(eps / N[(N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - \sqrt{x \cdot x - \varepsilon}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-152}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\varepsilon}{x} \cdot -0.5 + x \cdot 2}\\
\end{array}
\end{array}
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -1.00000000000000007e-152Initial program 99.2%
if -1.00000000000000007e-152 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 8.6%
flip--8.6%
div-inv8.6%
add-sqr-sqrt8.7%
associate--r-99.6%
pow299.6%
pow299.6%
sub-neg99.6%
add-sqr-sqrt47.4%
hypot-def47.4%
Applied egg-rr47.4%
+-inverses47.4%
+-lft-identity47.4%
associate-*r/47.5%
associate-/l*47.5%
/-rgt-identity47.5%
Simplified47.5%
Taylor expanded in x around inf 0.0%
fma-def0.0%
*-commutative0.0%
metadata-eval0.0%
pow-sqr0.0%
unpow20.0%
rem-square-sqrt0.0%
unpow20.0%
rem-square-sqrt0.0%
metadata-eval0.0%
*-lft-identity0.0%
+-commutative0.0%
*-commutative0.0%
fma-def0.0%
associate-*r/0.0%
Simplified87.5%
Taylor expanded in eps around 0 99.1%
Final simplification99.1%
(FPCore (x eps) :precision binary64 (if (<= x 9.2e-122) (- x (sqrt (- eps))) (/ eps (+ (* (/ eps x) -0.5) (* x 2.0)))))
double code(double x, double eps) {
double tmp;
if (x <= 9.2e-122) {
tmp = x - sqrt(-eps);
} else {
tmp = eps / (((eps / x) * -0.5) + (x * 2.0));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 9.2d-122) then
tmp = x - sqrt(-eps)
else
tmp = eps / (((eps / x) * (-0.5d0)) + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 9.2e-122) {
tmp = x - Math.sqrt(-eps);
} else {
tmp = eps / (((eps / x) * -0.5) + (x * 2.0));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 9.2e-122: tmp = x - math.sqrt(-eps) else: tmp = eps / (((eps / x) * -0.5) + (x * 2.0)) return tmp
function code(x, eps) tmp = 0.0 if (x <= 9.2e-122) tmp = Float64(x - sqrt(Float64(-eps))); else tmp = Float64(eps / Float64(Float64(Float64(eps / x) * -0.5) + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 9.2e-122) tmp = x - sqrt(-eps); else tmp = eps / (((eps / x) * -0.5) + (x * 2.0)); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 9.2e-122], N[(x - N[Sqrt[(-eps)], $MachinePrecision]), $MachinePrecision], N[(eps / N[(N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.2 \cdot 10^{-122}:\\
\;\;\;\;x - \sqrt{-\varepsilon}\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\varepsilon}{x} \cdot -0.5 + x \cdot 2}\\
\end{array}
\end{array}
if x < 9.20000000000000028e-122Initial program 96.5%
Taylor expanded in x around 0 93.4%
neg-mul-193.4%
Simplified93.4%
if 9.20000000000000028e-122 < x Initial program 23.3%
flip--23.2%
div-inv23.2%
add-sqr-sqrt23.2%
associate--r-99.6%
pow299.6%
pow299.6%
sub-neg99.6%
add-sqr-sqrt58.7%
hypot-def58.8%
Applied egg-rr58.8%
+-inverses58.8%
+-lft-identity58.8%
associate-*r/58.9%
associate-/l*58.9%
/-rgt-identity58.9%
Simplified58.9%
Taylor expanded in x around inf 0.0%
fma-def0.0%
*-commutative0.0%
metadata-eval0.0%
pow-sqr0.0%
unpow20.0%
rem-square-sqrt0.0%
unpow20.0%
rem-square-sqrt0.0%
metadata-eval0.0%
*-lft-identity0.0%
+-commutative0.0%
*-commutative0.0%
fma-def0.0%
associate-*r/0.0%
Simplified78.4%
Taylor expanded in eps around 0 84.8%
Final simplification88.7%
(FPCore (x eps) :precision binary64 (/ 1.0 (- (* 2.0 (/ x eps)) (/ 0.5 x))))
double code(double x, double eps) {
return 1.0 / ((2.0 * (x / eps)) - (0.5 / x));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 1.0d0 / ((2.0d0 * (x / eps)) - (0.5d0 / x))
end function
public static double code(double x, double eps) {
return 1.0 / ((2.0 * (x / eps)) - (0.5 / x));
}
def code(x, eps): return 1.0 / ((2.0 * (x / eps)) - (0.5 / x))
function code(x, eps) return Float64(1.0 / Float64(Float64(2.0 * Float64(x / eps)) - Float64(0.5 / x))) end
function tmp = code(x, eps) tmp = 1.0 / ((2.0 * (x / eps)) - (0.5 / x)); end
code[x_, eps_] := N[(1.0 / N[(N[(2.0 * N[(x / eps), $MachinePrecision]), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{2 \cdot \frac{x}{\varepsilon} - \frac{0.5}{x}}
\end{array}
Initial program 56.7%
flip--56.7%
div-inv56.5%
add-sqr-sqrt56.3%
associate--r-99.4%
pow299.4%
pow299.4%
sub-neg99.4%
add-sqr-sqrt74.9%
hypot-def74.9%
Applied egg-rr74.9%
*-commutative74.9%
associate-/r/74.8%
+-inverses74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
fma-def0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt50.7%
metadata-eval50.7%
Simplified50.7%
Taylor expanded in x around 0 50.7%
Simplified50.7%
Final simplification50.7%
(FPCore (x eps) :precision binary64 (/ eps (+ (* (/ eps x) -0.5) (* x 2.0))))
double code(double x, double eps) {
return eps / (((eps / x) * -0.5) + (x * 2.0));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps / (((eps / x) * (-0.5d0)) + (x * 2.0d0))
end function
public static double code(double x, double eps) {
return eps / (((eps / x) * -0.5) + (x * 2.0));
}
def code(x, eps): return eps / (((eps / x) * -0.5) + (x * 2.0))
function code(x, eps) return Float64(eps / Float64(Float64(Float64(eps / x) * -0.5) + Float64(x * 2.0))) end
function tmp = code(x, eps) tmp = eps / (((eps / x) * -0.5) + (x * 2.0)); end
code[x_, eps_] := N[(eps / N[(N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\varepsilon}{\frac{\varepsilon}{x} \cdot -0.5 + x \cdot 2}
\end{array}
Initial program 56.7%
flip--56.7%
div-inv56.5%
add-sqr-sqrt56.3%
associate--r-99.4%
pow299.4%
pow299.4%
sub-neg99.4%
add-sqr-sqrt74.9%
hypot-def74.9%
Applied egg-rr74.9%
+-inverses74.9%
+-lft-identity74.9%
associate-*r/75.0%
associate-/l*75.0%
/-rgt-identity75.0%
Simplified75.0%
Taylor expanded in x around inf 0.0%
fma-def0.0%
*-commutative0.0%
metadata-eval0.0%
pow-sqr0.0%
unpow20.0%
rem-square-sqrt0.0%
unpow20.0%
rem-square-sqrt0.0%
metadata-eval0.0%
*-lft-identity0.0%
+-commutative0.0%
*-commutative0.0%
fma-def0.0%
associate-*r/0.0%
Simplified43.3%
Taylor expanded in eps around 0 50.8%
Final simplification50.8%
(FPCore (x eps) :precision binary64 (* (/ eps x) 0.5))
double code(double x, double eps) {
return (eps / x) * 0.5;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (eps / x) * 0.5d0
end function
public static double code(double x, double eps) {
return (eps / x) * 0.5;
}
def code(x, eps): return (eps / x) * 0.5
function code(x, eps) return Float64(Float64(eps / x) * 0.5) end
function tmp = code(x, eps) tmp = (eps / x) * 0.5; end
code[x_, eps_] := N[(N[(eps / x), $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{\varepsilon}{x} \cdot 0.5
\end{array}
Initial program 56.7%
Taylor expanded in x around inf 49.6%
Final simplification49.6%
(FPCore (x eps) :precision binary64 eps)
double code(double x, double eps) {
return eps;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps
end function
public static double code(double x, double eps) {
return eps;
}
def code(x, eps): return eps
function code(x, eps) return eps end
function tmp = code(x, eps) tmp = eps; end
code[x_, eps_] := eps
\begin{array}{l}
\\
\varepsilon
\end{array}
Initial program 56.7%
flip--56.7%
div-inv56.5%
add-sqr-sqrt56.3%
associate--r-99.4%
pow299.4%
pow299.4%
sub-neg99.4%
add-sqr-sqrt74.9%
hypot-def74.9%
Applied egg-rr74.9%
unpow274.9%
Applied egg-rr74.9%
unpow274.9%
Applied egg-rr74.9%
un-div-inv75.0%
clear-num74.8%
add-sqr-sqrt74.8%
sqrt-unprod76.8%
sqr-neg76.8%
sqrt-prod23.3%
add-sqr-sqrt23.3%
+-inverses23.3%
+-lft-identity23.3%
Applied egg-rr23.3%
Simplified7.8%
Final simplification7.8%
(FPCore (x eps) :precision binary64 (/ eps (+ x (sqrt (- (* x x) eps)))))
double code(double x, double eps) {
return eps / (x + sqrt(((x * x) - eps)));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps / (x + sqrt(((x * x) - eps)))
end function
public static double code(double x, double eps) {
return eps / (x + Math.sqrt(((x * x) - eps)));
}
def code(x, eps): return eps / (x + math.sqrt(((x * x) - eps)))
function code(x, eps) return Float64(eps / Float64(x + sqrt(Float64(Float64(x * x) - eps)))) end
function tmp = code(x, eps) tmp = eps / (x + sqrt(((x * x) - eps))); end
code[x_, eps_] := N[(eps / N[(x + N[Sqrt[N[(N[(x * x), $MachinePrecision] - eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\varepsilon}{x + \sqrt{x \cdot x - \varepsilon}}
\end{array}
herbie shell --seed 2023310
(FPCore (x eps)
:name "ENA, Section 1.4, Exercise 4d"
:precision binary64
:pre (and (and (<= 0.0 x) (<= x 1000000000.0)) (and (<= -1.0 eps) (<= eps 1.0)))
:herbie-target
(/ eps (+ x (sqrt (- (* x x) eps))))
(- x (sqrt (- (* x x) eps))))