
(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
(let* ((t_0 (- x (sqrt (- (* x x) eps)))))
(if (<= t_0 -1e-154)
t_0
(/
eps
(+
x
(+ x (fma -0.125 (pow (/ eps (pow x 1.5)) 2.0) (* (/ eps x) -0.5))))))))
double code(double x, double eps) {
double t_0 = x - sqrt(((x * x) - eps));
double tmp;
if (t_0 <= -1e-154) {
tmp = t_0;
} else {
tmp = eps / (x + (x + fma(-0.125, pow((eps / pow(x, 1.5)), 2.0), ((eps / x) * -0.5))));
}
return tmp;
}
function code(x, eps) t_0 = Float64(x - sqrt(Float64(Float64(x * x) - eps))) tmp = 0.0 if (t_0 <= -1e-154) tmp = t_0; else tmp = Float64(eps / Float64(x + Float64(x + fma(-0.125, (Float64(eps / (x ^ 1.5)) ^ 2.0), Float64(Float64(eps / x) * -0.5))))); end return 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-154], t$95$0, N[(eps / N[(x + N[(x + N[(-0.125 * N[Power[N[(eps / N[Power[x, 1.5], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $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^{-154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{x + \left(x + \mathsf{fma}\left(-0.125, {\left(\frac{\varepsilon}{{x}^{1.5}}\right)}^{2}, \frac{\varepsilon}{x} \cdot -0.5\right)\right)}\\
\end{array}
\end{array}
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -9.9999999999999997e-155Initial program 99.3%
if -9.9999999999999997e-155 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 8.4%
flip--8.4%
div-inv8.4%
add-sqr-sqrt8.5%
associate--r-99.6%
pow299.6%
pow299.6%
sub-neg99.6%
add-sqr-sqrt45.8%
hypot-def45.8%
Applied egg-rr45.8%
+-inverses45.8%
+-lft-identity45.8%
associate-*r/45.9%
associate-/l*45.9%
/-rgt-identity45.9%
Simplified45.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%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt96.8%
associate-*r*96.8%
metadata-eval96.8%
associate-*r/96.8%
*-commutative96.8%
Simplified96.8%
add-sqr-sqrt96.8%
sqrt-div96.8%
unpow296.8%
sqrt-prod52.9%
add-sqr-sqrt96.8%
sqrt-pow196.8%
metadata-eval96.8%
sqrt-div96.8%
unpow296.8%
sqrt-prod53.1%
add-sqr-sqrt97.0%
sqrt-pow1100.0%
metadata-eval100.0%
Applied egg-rr100.0%
unpow2100.0%
Simplified100.0%
Final simplification99.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- x (sqrt (- (* x x) eps)))))
(if (<= t_0 -1e-154)
t_0
(/
eps
(+
(* (/ eps x) -0.5)
(+ (* -0.125 (pow (/ eps (pow x 1.5)) 2.0)) (* x 2.0)))))))
double code(double x, double eps) {
double t_0 = x - sqrt(((x * x) - eps));
double tmp;
if (t_0 <= -1e-154) {
tmp = t_0;
} else {
tmp = eps / (((eps / x) * -0.5) + ((-0.125 * pow((eps / pow(x, 1.5)), 2.0)) + (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-154)) then
tmp = t_0
else
tmp = eps / (((eps / x) * (-0.5d0)) + (((-0.125d0) * ((eps / (x ** 1.5d0)) ** 2.0d0)) + (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-154) {
tmp = t_0;
} else {
tmp = eps / (((eps / x) * -0.5) + ((-0.125 * Math.pow((eps / Math.pow(x, 1.5)), 2.0)) + (x * 2.0)));
}
return tmp;
}
def code(x, eps): t_0 = x - math.sqrt(((x * x) - eps)) tmp = 0 if t_0 <= -1e-154: tmp = t_0 else: tmp = eps / (((eps / x) * -0.5) + ((-0.125 * math.pow((eps / math.pow(x, 1.5)), 2.0)) + (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-154) tmp = t_0; else tmp = Float64(eps / Float64(Float64(Float64(eps / x) * -0.5) + Float64(Float64(-0.125 * (Float64(eps / (x ^ 1.5)) ^ 2.0)) + 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-154) tmp = t_0; else tmp = eps / (((eps / x) * -0.5) + ((-0.125 * ((eps / (x ^ 1.5)) ^ 2.0)) + (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-154], t$95$0, N[(eps / N[(N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(N[(-0.125 * N[Power[N[(eps / N[Power[x, 1.5], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $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^{-154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\varepsilon}{x} \cdot -0.5 + \left(-0.125 \cdot {\left(\frac{\varepsilon}{{x}^{1.5}}\right)}^{2} + x \cdot 2\right)}\\
\end{array}
\end{array}
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -9.9999999999999997e-155Initial program 99.3%
if -9.9999999999999997e-155 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 8.4%
flip--8.4%
div-inv8.4%
add-sqr-sqrt8.5%
associate--r-99.6%
pow299.6%
pow299.6%
sub-neg99.6%
add-sqr-sqrt45.8%
hypot-def45.8%
Applied egg-rr45.8%
+-inverses45.8%
+-lft-identity45.8%
associate-*r/45.9%
associate-/l*45.9%
/-rgt-identity45.9%
Simplified45.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%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt96.8%
associate-*r*96.8%
metadata-eval96.8%
associate-*r/96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 96.8%
add-sqr-sqrt96.8%
sqrt-div96.8%
unpow296.8%
sqrt-prod52.9%
add-sqr-sqrt96.8%
sqrt-pow196.8%
metadata-eval96.8%
sqrt-div96.8%
unpow296.8%
sqrt-prod53.1%
add-sqr-sqrt97.0%
sqrt-pow1100.0%
metadata-eval100.0%
Applied egg-rr99.9%
unpow2100.0%
Simplified99.9%
Final simplification99.5%
(FPCore (x eps) :precision binary64 (let* ((t_0 (- x (sqrt (- (* x x) eps))))) (if (<= t_0 -1e-154) t_0 (/ eps (+ x (+ x (* (/ eps x) -0.5)))))))
double code(double x, double eps) {
double t_0 = x - sqrt(((x * x) - eps));
double tmp;
if (t_0 <= -1e-154) {
tmp = t_0;
} else {
tmp = eps / (x + (x + ((eps / x) * -0.5)));
}
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-154)) then
tmp = t_0
else
tmp = eps / (x + (x + ((eps / x) * (-0.5d0))))
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-154) {
tmp = t_0;
} else {
tmp = eps / (x + (x + ((eps / x) * -0.5)));
}
return tmp;
}
def code(x, eps): t_0 = x - math.sqrt(((x * x) - eps)) tmp = 0 if t_0 <= -1e-154: tmp = t_0 else: tmp = eps / (x + (x + ((eps / x) * -0.5))) return tmp
function code(x, eps) t_0 = Float64(x - sqrt(Float64(Float64(x * x) - eps))) tmp = 0.0 if (t_0 <= -1e-154) tmp = t_0; else tmp = Float64(eps / Float64(x + Float64(x + Float64(Float64(eps / x) * -0.5)))); end return tmp end
function tmp_2 = code(x, eps) t_0 = x - sqrt(((x * x) - eps)); tmp = 0.0; if (t_0 <= -1e-154) tmp = t_0; else tmp = eps / (x + (x + ((eps / x) * -0.5))); 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-154], t$95$0, N[(eps / N[(x + N[(x + N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision]), $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^{-154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{x + \left(x + \frac{\varepsilon}{x} \cdot -0.5\right)}\\
\end{array}
\end{array}
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -9.9999999999999997e-155Initial program 99.3%
if -9.9999999999999997e-155 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 8.4%
flip--8.4%
div-inv8.4%
add-sqr-sqrt8.5%
associate--r-99.6%
pow299.6%
pow299.6%
sub-neg99.6%
add-sqr-sqrt45.8%
hypot-def45.8%
Applied egg-rr45.8%
+-inverses45.8%
+-lft-identity45.8%
associate-*r/45.9%
associate-/l*45.9%
/-rgt-identity45.9%
Simplified45.9%
hypot-udef45.9%
unpow245.9%
add-sqr-sqrt100.0%
sub-neg100.0%
flip3--67.4%
sqrt-div67.5%
Applied egg-rr67.4%
Taylor expanded in x around inf 99.6%
Final simplification99.4%
(FPCore (x eps) :precision binary64 (if (<= x 2.05e-96) (- x (sqrt (- eps))) (/ eps (+ x (+ x (* (/ eps x) -0.5))))))
double code(double x, double eps) {
double tmp;
if (x <= 2.05e-96) {
tmp = x - sqrt(-eps);
} else {
tmp = eps / (x + (x + ((eps / x) * -0.5)));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 2.05d-96) then
tmp = x - sqrt(-eps)
else
tmp = eps / (x + (x + ((eps / x) * (-0.5d0))))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 2.05e-96) {
tmp = x - Math.sqrt(-eps);
} else {
tmp = eps / (x + (x + ((eps / x) * -0.5)));
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 2.05e-96: tmp = x - math.sqrt(-eps) else: tmp = eps / (x + (x + ((eps / x) * -0.5))) return tmp
function code(x, eps) tmp = 0.0 if (x <= 2.05e-96) tmp = Float64(x - sqrt(Float64(-eps))); else tmp = Float64(eps / Float64(x + Float64(x + Float64(Float64(eps / x) * -0.5)))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 2.05e-96) tmp = x - sqrt(-eps); else tmp = eps / (x + (x + ((eps / x) * -0.5))); end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 2.05e-96], N[(x - N[Sqrt[(-eps)], $MachinePrecision]), $MachinePrecision], N[(eps / N[(x + N[(x + N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05 \cdot 10^{-96}:\\
\;\;\;\;x - \sqrt{-\varepsilon}\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{x + \left(x + \frac{\varepsilon}{x} \cdot -0.5\right)}\\
\end{array}
\end{array}
if x < 2.05000000000000012e-96Initial program 97.9%
Taylor expanded in x around 0 96.9%
neg-mul-196.9%
Simplified96.9%
if 2.05000000000000012e-96 < x Initial program 26.7%
flip--26.7%
div-inv26.6%
add-sqr-sqrt26.6%
associate--r-99.5%
pow299.5%
pow299.5%
sub-neg99.5%
add-sqr-sqrt56.4%
hypot-def56.4%
Applied egg-rr56.4%
+-inverses56.4%
+-lft-identity56.4%
associate-*r/56.5%
associate-/l*56.5%
/-rgt-identity56.5%
Simplified56.5%
hypot-udef56.5%
unpow256.5%
add-sqr-sqrt99.9%
sub-neg99.9%
flip3--72.0%
sqrt-div72.0%
Applied egg-rr56.2%
Taylor expanded in x around inf 82.2%
Final simplification90.0%
(FPCore (x eps) :precision binary64 (/ eps (+ x (+ x (* (/ eps x) -0.5)))))
double code(double x, double eps) {
return eps / (x + (x + ((eps / x) * -0.5)));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps / (x + (x + ((eps / x) * (-0.5d0))))
end function
public static double code(double x, double eps) {
return eps / (x + (x + ((eps / x) * -0.5)));
}
def code(x, eps): return eps / (x + (x + ((eps / x) * -0.5)))
function code(x, eps) return Float64(eps / Float64(x + Float64(x + Float64(Float64(eps / x) * -0.5)))) end
function tmp = code(x, eps) tmp = eps / (x + (x + ((eps / x) * -0.5))); end
code[x_, eps_] := N[(eps / N[(x + N[(x + N[(N[(eps / x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\varepsilon}{x + \left(x + \frac{\varepsilon}{x} \cdot -0.5\right)}
\end{array}
Initial program 64.5%
flip--64.5%
div-inv64.3%
add-sqr-sqrt64.1%
associate--r-99.4%
pow299.4%
pow299.4%
sub-neg99.4%
add-sqr-sqrt78.8%
hypot-def78.8%
Applied egg-rr78.8%
+-inverses78.8%
+-lft-identity78.8%
associate-*r/78.9%
associate-/l*78.9%
/-rgt-identity78.9%
Simplified78.9%
hypot-udef78.9%
unpow278.9%
add-sqr-sqrt99.6%
sub-neg99.6%
flip3--52.1%
sqrt-div52.1%
Applied egg-rr26.9%
Taylor expanded in x around inf 42.6%
Final simplification42.6%
(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 64.5%
Taylor expanded in x around inf 41.8%
Final simplification41.8%
(FPCore (x eps) :precision binary64 (* x -2.0))
double code(double x, double eps) {
return x * -2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = x * (-2.0d0)
end function
public static double code(double x, double eps) {
return x * -2.0;
}
def code(x, eps): return x * -2.0
function code(x, eps) return Float64(x * -2.0) end
function tmp = code(x, eps) tmp = x * -2.0; end
code[x_, eps_] := N[(x * -2.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -2
\end{array}
Initial program 64.5%
flip--64.5%
div-inv64.3%
add-sqr-sqrt64.1%
associate--r-99.4%
pow299.4%
pow299.4%
sub-neg99.4%
add-sqr-sqrt78.8%
hypot-def78.8%
Applied egg-rr78.8%
+-inverses78.8%
+-lft-identity78.8%
associate-*r/78.9%
associate-/l*78.9%
/-rgt-identity78.9%
Simplified78.9%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
fma-def0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt42.6%
mul-1-neg42.6%
Simplified42.6%
Taylor expanded in eps around inf 5.3%
*-commutative5.3%
Simplified5.3%
Final simplification5.3%
(FPCore (x eps) :precision binary64 0.0)
double code(double x, double eps) {
return 0.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 0.0d0
end function
public static double code(double x, double eps) {
return 0.0;
}
def code(x, eps): return 0.0
function code(x, eps) return 0.0 end
function tmp = code(x, eps) tmp = 0.0; end
code[x_, eps_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 64.5%
sub-neg64.5%
+-commutative64.5%
add-sqr-sqrt63.9%
distribute-rgt-neg-in63.9%
fma-def63.6%
pow1/263.6%
sqrt-pow163.8%
pow263.8%
metadata-eval63.8%
pow1/263.8%
sqrt-pow163.7%
pow263.7%
metadata-eval63.7%
Applied egg-rr63.7%
Taylor expanded in x around inf 4.3%
distribute-rgt1-in4.3%
metadata-eval4.3%
mul0-lft4.3%
Simplified4.3%
Final simplification4.3%
(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 2024021
(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))))