2isqrt (example 3.6)

?

Percentage Accurate: 69.0% → 99.7%
Time: 7.4s
Precision: binary64
Cost: 33732

?

\[\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 0:\\ \;\;\;\;0.5 \cdot {x}^{-1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x + \left(1 - x\right)}{\sqrt{x} + t_0}}{\sqrt{x \cdot \left(1 + x\right)}}\\ \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)) 0.0)
     (* 0.5 (pow x -1.5))
     (/ (/ (+ x (- 1.0 x)) (+ (sqrt x) t_0)) (sqrt (* x (+ 1.0 x)))))))
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)) <= 0.0) {
		tmp = 0.5 * pow(x, -1.5);
	} else {
		tmp = ((x + (1.0 - x)) / (sqrt(x) + t_0)) / sqrt((x * (1.0 + x)));
	}
	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)) <= 0.0d0) then
        tmp = 0.5d0 * (x ** (-1.5d0))
    else
        tmp = ((x + (1.0d0 - x)) / (sqrt(x) + t_0)) / sqrt((x * (1.0d0 + x)))
    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)) <= 0.0) {
		tmp = 0.5 * Math.pow(x, -1.5);
	} else {
		tmp = ((x + (1.0 - x)) / (Math.sqrt(x) + t_0)) / Math.sqrt((x * (1.0 + x)));
	}
	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)) <= 0.0:
		tmp = 0.5 * math.pow(x, -1.5)
	else:
		tmp = ((x + (1.0 - x)) / (math.sqrt(x) + t_0)) / math.sqrt((x * (1.0 + x)))
	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)) <= 0.0)
		tmp = Float64(0.5 * (x ^ -1.5));
	else
		tmp = Float64(Float64(Float64(x + Float64(1.0 - x)) / Float64(sqrt(x) + t_0)) / sqrt(Float64(x * Float64(1.0 + x))));
	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)) <= 0.0)
		tmp = 0.5 * (x ^ -1.5);
	else
		tmp = ((x + (1.0 - x)) / (sqrt(x) + t_0)) / sqrt((x * (1.0 + x)));
	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], 0.0], N[(0.5 * N[Power[x, -1.5], $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(x * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $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 0:\\
\;\;\;\;0.5 \cdot {x}^{-1.5}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x + \left(1 - x\right)}{\sqrt{x} + t_0}}{\sqrt{x \cdot \left(1 + x\right)}}\\


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 7 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original69.0%
Target98.9%
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)))) < 0.0

    1. Initial program 36.5%

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

      \[\leadsto \color{blue}{\frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{-0.5} + {\left(1 + x\right)}^{-0.5}}} \]
      Step-by-step derivation

      [Start]36.5%

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

      flip-- [=>]36.5%

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

      frac-times [=>]16.4%

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

      metadata-eval [=>]16.4%

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

      add-sqr-sqrt [<=]17.7%

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

      frac-times [=>]24.7%

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

      metadata-eval [=>]24.7%

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

      add-sqr-sqrt [<=]36.5%

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

      +-commutative [=>]36.5%

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

      pow1/2 [=>]36.5%

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

      pow-flip [=>]36.5%

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

      metadata-eval [=>]36.5%

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

      inv-pow [=>]36.5%

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

      sqrt-pow2 [=>]36.5%

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

      +-commutative [=>]36.5%

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

      metadata-eval [=>]36.5%

      \[ \frac{\frac{1}{x} - \frac{1}{1 + x}}{{x}^{-0.5} + {\left(1 + x\right)}^{\color{blue}{-0.5}}} \]
    3. Taylor expanded in x around inf 67.0%

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}} \]
    4. Simplified100.0%

      \[\leadsto \color{blue}{0.5 \cdot {x}^{-1.5}} \]
      Step-by-step derivation

      [Start]67.0%

      \[ 0.5 \cdot \sqrt{\frac{1}{{x}^{3}}} \]

      exp-to-pow [<=]64.1%

      \[ 0.5 \cdot \sqrt{\frac{1}{\color{blue}{e^{\log x \cdot 3}}}} \]

      *-commutative [<=]64.1%

      \[ 0.5 \cdot \sqrt{\frac{1}{e^{\color{blue}{3 \cdot \log x}}}} \]

      exp-neg [<=]64.1%

      \[ 0.5 \cdot \sqrt{\color{blue}{e^{-3 \cdot \log x}}} \]

      distribute-lft-neg-in [=>]64.1%

      \[ 0.5 \cdot \sqrt{e^{\color{blue}{\left(-3\right) \cdot \log x}}} \]

      metadata-eval [=>]64.1%

      \[ 0.5 \cdot \sqrt{e^{\color{blue}{-3} \cdot \log x}} \]

      *-commutative [=>]64.1%

      \[ 0.5 \cdot \sqrt{e^{\color{blue}{\log x \cdot -3}}} \]

      exp-to-pow [=>]67.0%

      \[ 0.5 \cdot \sqrt{\color{blue}{{x}^{-3}}} \]

      metadata-eval [<=]67.0%

      \[ 0.5 \cdot \sqrt{{x}^{\color{blue}{\left(2 \cdot -1.5\right)}}} \]

      pow-sqr [<=]67.1%

      \[ 0.5 \cdot \sqrt{\color{blue}{{x}^{-1.5} \cdot {x}^{-1.5}}} \]

      rem-sqrt-square [=>]100.0%

      \[ 0.5 \cdot \color{blue}{\left|{x}^{-1.5}\right|} \]

      rem-square-sqrt [<=]99.4%

      \[ 0.5 \cdot \left|\color{blue}{\sqrt{{x}^{-1.5}} \cdot \sqrt{{x}^{-1.5}}}\right| \]

      fabs-sqr [=>]99.4%

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

      rem-square-sqrt [=>]100.0%

      \[ 0.5 \cdot \color{blue}{{x}^{-1.5}} \]

    if 0.0 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1))))

    1. Initial program 98.2%

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

      \[\leadsto \color{blue}{\frac{\sqrt{1 + x} - \sqrt{x}}{\sqrt{x \cdot \left(1 + x\right)}}} \]
      Step-by-step derivation

      [Start]98.2%

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

      frac-sub [=>]98.2%

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

      *-un-lft-identity [<=]98.2%

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

      +-commutative [=>]98.2%

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

      *-rgt-identity [=>]98.2%

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

      sqrt-unprod [=>]98.2%

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

      +-commutative [=>]98.2%

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

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 - x\right)\right) \cdot \frac{1}{\sqrt{x} + \sqrt{x + 1}}}}{\sqrt{x \cdot \left(1 + x\right)}} \]
      Step-by-step derivation

      [Start]98.2%

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

      add-sqr-sqrt [=>]98.2%

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

      hypot-1-def [=>]98.2%

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

      flip-- [=>]98.4%

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

      div-inv [=>]98.4%

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

      hypot-1-def [<=]98.6%

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

      add-sqr-sqrt [<=]98.4%

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

      hypot-1-def [<=]98.6%

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

      add-sqr-sqrt [<=]98.4%

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

      add-sqr-sqrt [<=]99.1%

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

      +-commutative [=>]99.1%

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

      add-sqr-sqrt [<=]99.6%

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

      associate--l+ [=>]99.6%

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

      +-commutative [=>]99.6%

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

      hypot-1-def [<=]99.6%

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

      add-sqr-sqrt [<=]99.6%

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

      \[\leadsto \frac{\color{blue}{\frac{x + \left(1 - x\right)}{\sqrt{x} + \sqrt{x + 1}}}}{\sqrt{x \cdot \left(1 + x\right)}} \]
      Step-by-step derivation

      [Start]99.6%

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

      associate-*r/ [=>]99.6%

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

      *-rgt-identity [=>]99.6%

      \[ \frac{\frac{\color{blue}{x + \left(1 - x\right)}}{\sqrt{x} + \sqrt{x + 1}}}{\sqrt{x \cdot \left(1 + x\right)}} \]
  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 0:\\ \;\;\;\;0.5 \cdot {x}^{-1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x + \left(1 - x\right)}{\sqrt{x} + \sqrt{1 + x}}}{\sqrt{x \cdot \left(1 + x\right)}}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.7%
Cost33732
\[\begin{array}{l} t_0 := \sqrt{1 + x}\\ \mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{t_0} \leq 0:\\ \;\;\;\;0.5 \cdot {x}^{-1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x + \left(1 - x\right)}{\sqrt{x} + t_0}}{\sqrt{x \cdot \left(1 + x\right)}}\\ \end{array} \]
Alternative 2
Accuracy99.5%
Cost26692
\[\begin{array}{l} \mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \leq 10^{-13}:\\ \;\;\;\;0.5 \cdot {x}^{-1.5}\\ \mathbf{else}:\\ \;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\ \end{array} \]
Alternative 3
Accuracy98.5%
Cost7044
\[\begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\left({x}^{-0.5} + x \cdot 0.5\right) + -1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot {x}^{-1.5}\\ \end{array} \]
Alternative 4
Accuracy98.2%
Cost6788
\[\begin{array}{l} \mathbf{if}\;x \leq 0.66:\\ \;\;\;\;{x}^{-0.5} + -1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot {x}^{-1.5}\\ \end{array} \]
Alternative 5
Accuracy51.7%
Cost6656
\[0.5 \cdot {x}^{-1.5} \]
Alternative 6
Accuracy7.4%
Cost320
\[\frac{1}{x + 0.5} \]
Alternative 7
Accuracy7.4%
Cost192
\[\frac{1}{x} \]

Reproduce?

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