?

Average Error: 19.9 → 19.9
Time: 13.0s
Precision: binary64
Cost: 13376

?

\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
(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)));
}
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
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)));
}
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)))
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 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
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]
code[x_] := N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original19.9
Target0.7
Herbie19.9
\[\frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}} \]

Derivation?

  1. Initial program 19.9

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Final simplification19.9

    \[\leadsto \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]

Alternatives

Alternative 1
Error30.7
Cost7872
\[\begin{array}{l} t_0 := \frac{1}{1 + x \cdot 0.5}\\ \left(\frac{1}{\sqrt{x}} + t_0 \cdot 2\right) + t_0 \cdot -3 \end{array} \]
Alternative 2
Error30.7
Cost7744
\[\begin{array}{l} t_0 := \frac{1}{1 + x \cdot 0.5}\\ \left(\frac{1}{\sqrt{x}} + t_0\right) + t_0 \cdot -2 \end{array} \]
Alternative 3
Error30.7
Cost7104
\[\frac{1}{\sqrt{x}} - \frac{1}{0.5 \cdot x + 1} \]
Alternative 4
Error31.5
Cost6976
\[\frac{1}{\sqrt{x}} - \left(-0.5 \cdot x + 1\right) \]
Alternative 5
Error31.9
Cost6720
\[\frac{1}{\sqrt{x}} - 1 \]
Alternative 6
Error62.2
Cost192
\[\frac{-2}{x} \]
Alternative 7
Error62.8
Cost64
\[-1 \]

Error

Reproduce?

herbie shell --seed 2023096 
(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)))))