?

Average Accuracy: 68.3% → 99.7%
Time: 13.8s
Precision: binary64
Cost: 27204

?

\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
\[\begin{array}{l} t_0 := \sqrt{1 + x}\\ \mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{t_0} \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{x} + t_0}}{\left(x + 0.5\right) - \frac{0.125}{x}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\ \end{array} \]
(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (sqrt (+ 1.0 x))))
   (if (<= (- (/ 1.0 (sqrt x)) (/ 1.0 t_0)) 5e-10)
     (/ (/ 1.0 (+ (sqrt x) t_0)) (- (+ x 0.5) (/ 0.125 x)))
     (- (pow x -0.5) (pow (+ 1.0 x) -0.5)))))
double code(double x) {
	return (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
}
double code(double x) {
	double t_0 = sqrt((1.0 + x));
	double tmp;
	if (((1.0 / sqrt(x)) - (1.0 / t_0)) <= 5e-10) {
		tmp = (1.0 / (sqrt(x) + t_0)) / ((x + 0.5) - (0.125 / x));
	} else {
		tmp = pow(x, -0.5) - pow((1.0 + x), -0.5);
	}
	return tmp;
}
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((1.0d0 + x))
    if (((1.0d0 / sqrt(x)) - (1.0d0 / t_0)) <= 5d-10) then
        tmp = (1.0d0 / (sqrt(x) + t_0)) / ((x + 0.5d0) - (0.125d0 / x))
    else
        tmp = (x ** (-0.5d0)) - ((1.0d0 + x) ** (-0.5d0))
    end if
    code = tmp
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) {
	double t_0 = Math.sqrt((1.0 + x));
	double tmp;
	if (((1.0 / Math.sqrt(x)) - (1.0 / t_0)) <= 5e-10) {
		tmp = (1.0 / (Math.sqrt(x) + t_0)) / ((x + 0.5) - (0.125 / x));
	} else {
		tmp = Math.pow(x, -0.5) - Math.pow((1.0 + x), -0.5);
	}
	return tmp;
}
def code(x):
	return (1.0 / math.sqrt(x)) - (1.0 / math.sqrt((x + 1.0)))
def code(x):
	t_0 = math.sqrt((1.0 + x))
	tmp = 0
	if ((1.0 / math.sqrt(x)) - (1.0 / t_0)) <= 5e-10:
		tmp = (1.0 / (math.sqrt(x) + t_0)) / ((x + 0.5) - (0.125 / x))
	else:
		tmp = math.pow(x, -0.5) - math.pow((1.0 + x), -0.5)
	return tmp
function code(x)
	return Float64(Float64(1.0 / sqrt(x)) - Float64(1.0 / sqrt(Float64(x + 1.0))))
end
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)) <= 5e-10)
		tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_0)) / Float64(Float64(x + 0.5) - Float64(0.125 / x)));
	else
		tmp = Float64((x ^ -0.5) - (Float64(1.0 + x) ^ -0.5));
	end
	return tmp
end
function tmp = code(x)
	tmp = (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
end
function tmp_2 = code(x)
	t_0 = sqrt((1.0 + x));
	tmp = 0.0;
	if (((1.0 / sqrt(x)) - (1.0 / t_0)) <= 5e-10)
		tmp = (1.0 / (sqrt(x) + t_0)) / ((x + 0.5) - (0.125 / x));
	else
		tmp = (x ^ -0.5) - ((1.0 + x) ^ -0.5);
	end
	tmp_2 = tmp;
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_] := 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], 5e-10], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(x + 0.5), $MachinePrecision] - N[(0.125 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.5], $MachinePrecision] - N[Power[N[(1.0 + x), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\begin{array}{l}
t_0 := \sqrt{1 + x}\\
\mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{t_0} \leq 5 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{x} + t_0}}{\left(x + 0.5\right) - \frac{0.125}{x}}\\

\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original68.3%
Target99.0%
Herbie99.7%
\[\frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}} \]

Derivation?

  1. Split input into 2 regimes
  2. if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 5.00000000000000031e-10

    1. Initial program 31.2%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Applied egg-rr31.3%

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x \cdot \left(1 + x\right)}}} \]
      Proof

      [Start]31.2

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

      frac-sub [=>]31.3

      \[ \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}} \]

      *-un-lft-identity [<=]31.3

      \[ \frac{\color{blue}{\sqrt{x + 1}} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}} \]

      +-commutative [=>]31.3

      \[ \frac{\sqrt{\color{blue}{1 + x}} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}} \]

      *-rgt-identity [=>]31.3

      \[ \frac{\sqrt{1 + x} - \color{blue}{\sqrt{x}}}{\sqrt{x} \cdot \sqrt{x + 1}} \]

      sqrt-unprod [=>]31.3

      \[ \frac{\sqrt{1 + x} - \sqrt{x}}{\color{blue}{\sqrt{x \cdot \left(x + 1\right)}}} \]

      +-commutative [=>]31.3

      \[ \frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x \cdot \color{blue}{\left(1 + x\right)}}} \]
    3. Applied egg-rr32.9%

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x \cdot \left(1 + x\right)}} \]
      Proof

      [Start]31.3

      \[ \frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      flip-- [=>]32.0

      \[ \frac{\color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      div-inv [=>]32.0

      \[ \frac{\color{blue}{\left(\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      add-sqr-sqrt [<=]32.5

      \[ \frac{\left(\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      +-commutative [=>]32.5

      \[ \frac{\left(\color{blue}{\left(x + 1\right)} - \sqrt{x} \cdot \sqrt{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      add-sqr-sqrt [<=]32.9

      \[ \frac{\left(\left(x + 1\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      associate--l+ [=>]32.9

      \[ \frac{\color{blue}{\left(x + \left(1 - x\right)\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      +-commutative [=>]32.9

      \[ \frac{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\sqrt{\color{blue}{x + 1}} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]
    4. Simplified77.1%

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}}{\sqrt{x \cdot \left(1 + x\right)}} \]
      Proof

      [Start]32.9

      \[ \frac{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      associate-*r/ [=>]32.9

      \[ \frac{\color{blue}{\frac{\left(x + \left(1 - x\right)\right) \cdot 1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      *-rgt-identity [=>]32.9

      \[ \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      +-commutative [=>]32.9

      \[ \frac{\frac{\color{blue}{\left(1 - x\right) + x}}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      associate-+l- [=>]77.1

      \[ \frac{\frac{\color{blue}{1 - \left(x - x\right)}}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      +-inverses [=>]77.1

      \[ \frac{\frac{1 - \color{blue}{0}}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      metadata-eval [=>]77.1

      \[ \frac{\frac{\color{blue}{1}}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x \cdot \left(1 + x\right)}} \]

      +-commutative [=>]77.1

      \[ \frac{\frac{1}{\color{blue}{\sqrt{x} + \sqrt{x + 1}}}}{\sqrt{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around inf 99.7%

      \[\leadsto \frac{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}{\color{blue}{\left(0.5 + x\right) - 0.125 \cdot \frac{1}{x}}} \]
    6. Simplified99.7%

      \[\leadsto \frac{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}{\color{blue}{\left(x + 0.5\right) - \frac{0.125}{x}}} \]
      Proof

      [Start]99.7

      \[ \frac{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}{\left(0.5 + x\right) - 0.125 \cdot \frac{1}{x}} \]

      +-commutative [=>]99.7

      \[ \frac{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}{\color{blue}{\left(x + 0.5\right)} - 0.125 \cdot \frac{1}{x}} \]

      associate-*r/ [=>]99.7

      \[ \frac{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}{\left(x + 0.5\right) - \color{blue}{\frac{0.125 \cdot 1}{x}}} \]

      metadata-eval [=>]99.7

      \[ \frac{\frac{1}{\sqrt{x} + \sqrt{x + 1}}}{\left(x + 0.5\right) - \frac{\color{blue}{0.125}}{x}} \]

    if 5.00000000000000031e-10 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1))))

    1. Initial program 99.5%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right)} \]
      Proof

      [Start]99.5

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

      *-un-lft-identity [=>]99.5

      \[ \color{blue}{1 \cdot \frac{1}{\sqrt{x}}} - \frac{1}{\sqrt{x + 1}} \]

      clear-num [=>]99.5

      \[ 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\frac{\sqrt{x + 1}}{1}}} \]

      associate-/r/ [=>]99.5

      \[ 1 \cdot \frac{1}{\sqrt{x}} - \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot 1} \]

      prod-diff [=>]99.5

      \[ \color{blue}{\mathsf{fma}\left(1, \frac{1}{\sqrt{x}}, -1 \cdot \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right)} \]

      *-un-lft-identity [<=]99.5

      \[ \mathsf{fma}\left(1, \frac{1}{\sqrt{x}}, -\color{blue}{\frac{1}{\sqrt{x + 1}}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      fma-neg [<=]99.5

      \[ \color{blue}{\left(1 \cdot \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\right)} + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      *-un-lft-identity [<=]99.5

      \[ \left(\color{blue}{\frac{1}{\sqrt{x}}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      inv-pow [=>]99.5

      \[ \left(\color{blue}{{\left(\sqrt{x}\right)}^{-1}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      sqrt-pow2 [=>]99.9

      \[ \left(\color{blue}{{x}^{\left(\frac{-1}{2}\right)}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      metadata-eval [=>]99.9

      \[ \left({x}^{\color{blue}{-0.5}} - \frac{1}{\sqrt{x + 1}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      pow1/2 [=>]99.9

      \[ \left({x}^{-0.5} - \frac{1}{\color{blue}{{\left(x + 1\right)}^{0.5}}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      pow-flip [=>]99.9

      \[ \left({x}^{-0.5} - \color{blue}{{\left(x + 1\right)}^{\left(-0.5\right)}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      +-commutative [=>]99.9

      \[ \left({x}^{-0.5} - {\color{blue}{\left(1 + x\right)}}^{\left(-0.5\right)}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]

      metadata-eval [=>]99.9

      \[ \left({x}^{-0.5} - {\left(1 + x\right)}^{\color{blue}{-0.5}}\right) + \mathsf{fma}\left(-1, \frac{1}{\sqrt{x + 1}}, 1 \cdot \frac{1}{\sqrt{x + 1}}\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
      Proof

      [Start]99.9

      \[ \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \mathsf{fma}\left(-1, {\left(1 + x\right)}^{-0.5}, {\left(1 + x\right)}^{-0.5}\right) \]

      fma-udef [=>]99.9

      \[ \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \color{blue}{\left(-1 \cdot {\left(1 + x\right)}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)} \]

      distribute-lft1-in [=>]99.9

      \[ \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \color{blue}{\left(-1 + 1\right) \cdot {\left(1 + x\right)}^{-0.5}} \]

      metadata-eval [=>]99.9

      \[ \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \color{blue}{0} \cdot {\left(1 + x\right)}^{-0.5} \]

      mul0-lft [=>]99.9

      \[ \left({x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\right) + \color{blue}{0} \]

      +-rgt-identity [=>]99.9

      \[ \color{blue}{{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{1 + x}} \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}{\left(x + 0.5\right) - \frac{0.125}{x}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.7%
Cost26948
\[\begin{array}{l} t_0 := \sqrt{1 + x}\\ \mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{t_0} \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{x} + t_0}}{x + 0.5}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\ \end{array} \]
Alternative 2
Accuracy99.3%
Cost26820
\[\begin{array}{l} t_0 := \sqrt{1 + x}\\ \mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{t_0} \leq 5 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{x} + t_0}}{x}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\ \end{array} \]
Alternative 3
Accuracy82.1%
Cost26692
\[\begin{array}{l} \mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{1 + x}} \leq 5 \cdot 10^{-14}:\\ \;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\ \end{array} \]
Alternative 4
Accuracy99.0%
Cost26240
\[\frac{1}{\left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \mathsf{hypot}\left(x, \sqrt{x}\right)} \]
Alternative 5
Accuracy81.2%
Cost13316
\[\begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;{x}^{-0.5} - \left(1 + x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}\\ \end{array} \]
Alternative 6
Accuracy65.6%
Cost6848
\[\frac{1}{\sqrt{x \cdot \left(1 + x\right)}} \]
Alternative 7
Accuracy52.5%
Cost6788
\[\begin{array}{l} \mathbf{if}\;x \leq 0.73:\\ \;\;\;\;{x}^{-0.5} + -1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(x + 0.5\right) - \frac{0.125}{x}}\\ \end{array} \]
Alternative 8
Accuracy65.2%
Cost6784
\[\left(1 + {x}^{-0.5}\right) + -1 \]
Alternative 9
Accuracy51.9%
Cost6720
\[\frac{1}{x + \sqrt{x}} \]
Alternative 10
Accuracy49.8%
Cost6528
\[{x}^{-0.5} \]
Alternative 11
Accuracy4.9%
Cost576
\[\frac{1}{\left(x + 0.5\right) - \frac{0.125}{x}} \]
Alternative 12
Accuracy3.9%
Cost192
\[x \cdot 0.5 \]

Error

Reproduce?

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