\[\left(0 \leq x \land x \leq 1000000000\right) \land \left(-1 \leq \varepsilon \land \varepsilon \leq 1\right)\]
\[x - \sqrt{x \cdot x - \varepsilon}
\]
↓
\[\frac{\left(x \cdot x - x \cdot x\right) + \varepsilon}{x + \sqrt{x \cdot x - \varepsilon}}
\]
(FPCore (x eps) :precision binary64 (- x (sqrt (- (* x x) eps))))
↓
(FPCore (x eps)
:precision binary64
(/ (+ (- (* x x) (* x x)) eps) (+ x (sqrt (- (* x x) eps)))))
double code(double x, double eps) {
return x - sqrt(((x * x) - eps));
}
↓
double code(double x, double eps) {
return (((x * x) - (x * x)) + eps) / (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
↓
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((x * x) - (x * x)) + eps) / (x + sqrt(((x * x) - eps)))
end function
public static double code(double x, double eps) {
return x - Math.sqrt(((x * x) - eps));
}
↓
public static double code(double x, double eps) {
return (((x * x) - (x * x)) + eps) / (x + Math.sqrt(((x * x) - eps)));
}
def code(x, eps):
return x - math.sqrt(((x * x) - eps))
↓
def code(x, eps):
return (((x * x) - (x * x)) + eps) / (x + math.sqrt(((x * x) - eps)))
function code(x, eps)
return Float64(x - sqrt(Float64(Float64(x * x) - eps)))
end
↓
function code(x, eps)
return Float64(Float64(Float64(Float64(x * x) - Float64(x * x)) + eps) / Float64(x + sqrt(Float64(Float64(x * x) - eps))))
end
function tmp = code(x, eps)
tmp = x - sqrt(((x * x) - eps));
end
↓
function tmp = code(x, eps)
tmp = (((x * x) - (x * x)) + eps) / (x + sqrt(((x * x) - eps)));
end
code[x_, eps_] := N[(x - N[Sqrt[N[(N[(x * x), $MachinePrecision] - eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
code[x_, eps_] := N[(N[(N[(N[(x * x), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] + eps), $MachinePrecision] / N[(x + N[Sqrt[N[(N[(x * x), $MachinePrecision] - eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \sqrt{x \cdot x - \varepsilon}
↓
\frac{\left(x \cdot x - x \cdot x\right) + \varepsilon}{x + \sqrt{x \cdot x - \varepsilon}}
Alternatives
| Alternative 1 |
|---|
| Error | 0.7 |
|---|
| Cost | 13764 |
|---|
\[\begin{array}{l}
t_0 := x - \sqrt{x \cdot x - \varepsilon}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot x - x \cdot x\right) + \varepsilon}{x + \left(x + -0.5 \cdot \frac{\varepsilon}{x}\right)}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 8.0 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 2.35 \cdot 10^{-98}:\\
\;\;\;\;x - \sqrt{-\varepsilon}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot x - x \cdot x\right) + \varepsilon}{x + \left(x + -0.5 \cdot \frac{\varepsilon}{x}\right)}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 35.5 |
|---|
| Cost | 1216 |
|---|
\[\frac{\left(x \cdot x - x \cdot x\right) + \varepsilon}{x + \left(x + -0.5 \cdot \frac{\varepsilon}{x}\right)}
\]
| Alternative 4 |
|---|
| Error | 35.6 |
|---|
| Cost | 704 |
|---|
\[\frac{1}{2 \cdot \frac{x}{\varepsilon} + \frac{-0.5}{x}}
\]
| Alternative 5 |
|---|
| Error | 36.1 |
|---|
| Cost | 320 |
|---|
\[\varepsilon \cdot \frac{0.5}{x}
\]
| Alternative 6 |
|---|
| Error | 36.0 |
|---|
| Cost | 320 |
|---|
\[\frac{\varepsilon}{x} \cdot 0.5
\]
| Alternative 7 |
|---|
| Error | 56.8 |
|---|
| Cost | 192 |
|---|
\[\frac{\varepsilon}{x}
\]
| Alternative 8 |
|---|
| Error | 61.7 |
|---|
| Cost | 64 |
|---|
\[x
\]
| Alternative 9 |
|---|
| Error | 61.3 |
|---|
| Cost | 64 |
|---|
\[0
\]