2isqrt (example 3.6)

Percentage Accurate: 39.4% → 98.8%
Time: 13.7s
Alternatives: 7
Speedup: 1.0×

Specification

?
\[x > 1 \land x < 10^{+308}\]
\[\begin{array}{l} \\ \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \end{array} \]
(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)));
}
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)));
}
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 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]
\begin{array}{l}

\\
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\end{array}

Sampling outcomes in binary64 precision:

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.

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
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.

Initial Program: 39.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \end{array} \]
(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)));
}
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)));
}
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 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]
\begin{array}{l}

\\
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\end{array}

Alternative 1: 98.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{x}}\\ \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot t\_0\right) - \frac{t\_0 \cdot 0.375}{x}\right) + 0.5 \cdot \log \left(e^{{x}^{-2.5}}\right)}{x} \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (sqrt (/ 1.0 x))))
   (/
    (+
     (- (fma (sqrt (/ 1.0 (pow x 5.0))) -0.25 (* 0.5 t_0)) (/ (* t_0 0.375) x))
     (* 0.5 (log (exp (pow x -2.5)))))
    x)))
double code(double x) {
	double t_0 = sqrt((1.0 / x));
	return ((fma(sqrt((1.0 / pow(x, 5.0))), -0.25, (0.5 * t_0)) - ((t_0 * 0.375) / x)) + (0.5 * log(exp(pow(x, -2.5))))) / x;
}
function code(x)
	t_0 = sqrt(Float64(1.0 / x))
	return Float64(Float64(Float64(fma(sqrt(Float64(1.0 / (x ^ 5.0))), -0.25, Float64(0.5 * t_0)) - Float64(Float64(t_0 * 0.375) / x)) + Float64(0.5 * log(exp((x ^ -2.5))))) / x)
end
code[x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[(N[Sqrt[N[(1.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.25 + N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$0 * 0.375), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Log[N[Exp[N[Power[x, -2.5], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{x}}\\
\frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot t\_0\right) - \frac{t\_0 \cdot 0.375}{x}\right) + 0.5 \cdot \log \left(e^{{x}^{-2.5}}\right)}{x}
\end{array}
\end{array}
Derivation
  1. Initial program 37.7%

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 85.3%

    \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{5}}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}}} \]
  4. Step-by-step derivation
    1. *-un-lft-identity85.3%

      \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{\left(1 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
    2. pow-flip85.3%

      \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot \sqrt{\color{blue}{{x}^{\left(-5\right)}}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
    3. sqrt-pow185.3%

      \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot \color{blue}{{x}^{\left(\frac{-5}{2}\right)}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
    4. metadata-eval85.3%

      \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot {x}^{\left(\frac{\color{blue}{-5}}{2}\right)}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
    5. metadata-eval85.3%

      \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot {x}^{\color{blue}{-2.5}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
  5. Applied egg-rr85.3%

    \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{\left(1 \cdot {x}^{-2.5}\right)} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
  6. Step-by-step derivation
    1. *-lft-identity85.3%

      \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{{x}^{-2.5}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
  7. Simplified85.3%

    \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{{x}^{-2.5}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
  8. Taylor expanded in x around inf 98.8%

    \[\leadsto \color{blue}{\frac{\left(-1 \cdot \frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{x}}}{x} + \left(-0.25 \cdot \sqrt{\frac{1}{{x}^{5}}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right) - -0.5 \cdot \sqrt{\frac{1}{{x}^{5}}}}{x}} \]
  9. Step-by-step derivation
    1. Simplified98.8%

      \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \sqrt{\frac{1}{{x}^{5}}} \cdot 0.5}{x}} \]
    2. Step-by-step derivation
      1. *-rgt-identity98.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \color{blue}{\left(\sqrt{\frac{1}{{x}^{5}}} \cdot 1\right)} \cdot 0.5}{x} \]
      2. add-log-exp98.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \color{blue}{\log \left(e^{\sqrt{\frac{1}{{x}^{5}}} \cdot 1}\right)} \cdot 0.5}{x} \]
      3. *-rgt-identity98.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \log \left(e^{\color{blue}{\sqrt{\frac{1}{{x}^{5}}}}}\right) \cdot 0.5}{x} \]
      4. pow-flip98.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \log \left(e^{\sqrt{\color{blue}{{x}^{\left(-5\right)}}}}\right) \cdot 0.5}{x} \]
      5. sqrt-pow198.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \log \left(e^{\color{blue}{{x}^{\left(\frac{-5}{2}\right)}}}\right) \cdot 0.5}{x} \]
      6. metadata-eval98.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \log \left(e^{{x}^{\left(\frac{\color{blue}{-5}}{2}\right)}}\right) \cdot 0.5}{x} \]
      7. metadata-eval98.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \log \left(e^{{x}^{\color{blue}{-2.5}}}\right) \cdot 0.5}{x} \]
    3. Applied egg-rr98.8%

      \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \color{blue}{\log \left(e^{{x}^{-2.5}}\right)} \cdot 0.5}{x} \]
    4. Final simplification98.8%

      \[\leadsto \frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + 0.5 \cdot \log \left(e^{{x}^{-2.5}}\right)}{x} \]
    5. Add Preprocessing

    Alternative 2: 98.8% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{x}}\\ \frac{\left(\mathsf{fma}\left({x}^{-2.5}, -0.25, 0.5 \cdot t\_0\right) - \frac{t\_0 \cdot 0.375}{x}\right) + \sqrt{\frac{1}{{x}^{5}}} \cdot 0.5}{x} \end{array} \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (sqrt (/ 1.0 x))))
       (/
        (+
         (- (fma (pow x -2.5) -0.25 (* 0.5 t_0)) (/ (* t_0 0.375) x))
         (* (sqrt (/ 1.0 (pow x 5.0))) 0.5))
        x)))
    double code(double x) {
    	double t_0 = sqrt((1.0 / x));
    	return ((fma(pow(x, -2.5), -0.25, (0.5 * t_0)) - ((t_0 * 0.375) / x)) + (sqrt((1.0 / pow(x, 5.0))) * 0.5)) / x;
    }
    
    function code(x)
    	t_0 = sqrt(Float64(1.0 / x))
    	return Float64(Float64(Float64(fma((x ^ -2.5), -0.25, Float64(0.5 * t_0)) - Float64(Float64(t_0 * 0.375) / x)) + Float64(sqrt(Float64(1.0 / (x ^ 5.0))) * 0.5)) / x)
    end
    
    code[x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[(N[Power[x, -2.5], $MachinePrecision] * -0.25 + N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$0 * 0.375), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sqrt{\frac{1}{x}}\\
    \frac{\left(\mathsf{fma}\left({x}^{-2.5}, -0.25, 0.5 \cdot t\_0\right) - \frac{t\_0 \cdot 0.375}{x}\right) + \sqrt{\frac{1}{{x}^{5}}} \cdot 0.5}{x}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 37.7%

      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 85.3%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{5}}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity85.3%

        \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{\left(1 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      2. pow-flip85.3%

        \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot \sqrt{\color{blue}{{x}^{\left(-5\right)}}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      3. sqrt-pow185.3%

        \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot \color{blue}{{x}^{\left(\frac{-5}{2}\right)}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      4. metadata-eval85.3%

        \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot {x}^{\left(\frac{\color{blue}{-5}}{2}\right)}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      5. metadata-eval85.3%

        \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot {x}^{\color{blue}{-2.5}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
    5. Applied egg-rr85.3%

      \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{\left(1 \cdot {x}^{-2.5}\right)} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
    6. Step-by-step derivation
      1. *-lft-identity85.3%

        \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{{x}^{-2.5}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
    7. Simplified85.3%

      \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{{x}^{-2.5}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
    8. Taylor expanded in x around inf 98.8%

      \[\leadsto \color{blue}{\frac{\left(-1 \cdot \frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{x}}}{x} + \left(-0.25 \cdot \sqrt{\frac{1}{{x}^{5}}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right) - -0.5 \cdot \sqrt{\frac{1}{{x}^{5}}}}{x}} \]
    9. Step-by-step derivation
      1. Simplified98.8%

        \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\sqrt{\frac{1}{{x}^{5}}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \sqrt{\frac{1}{{x}^{5}}} \cdot 0.5}{x}} \]
      2. Step-by-step derivation
        1. *-un-lft-identity85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{\left(1 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
        2. pow-flip85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot \sqrt{\color{blue}{{x}^{\left(-5\right)}}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
        3. sqrt-pow185.3%

          \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot \color{blue}{{x}^{\left(\frac{-5}{2}\right)}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
        4. metadata-eval85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot {x}^{\left(\frac{\color{blue}{-5}}{2}\right)}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
        5. metadata-eval85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot {x}^{\color{blue}{-2.5}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      3. Applied egg-rr98.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\color{blue}{1 \cdot {x}^{-2.5}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \sqrt{\frac{1}{{x}^{5}}} \cdot 0.5}{x} \]
      4. Step-by-step derivation
        1. *-lft-identity85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{{x}^{-2.5}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      5. Simplified98.8%

        \[\leadsto \frac{\left(\mathsf{fma}\left(\color{blue}{{x}^{-2.5}}, -0.25, 0.5 \cdot \sqrt{\frac{1}{x}}\right) - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}\right) + \sqrt{\frac{1}{{x}^{5}}} \cdot 0.5}{x} \]
      6. Add Preprocessing

      Alternative 3: 98.7% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{x}}\\ \frac{0.5 \cdot t\_0 - \frac{t\_0 \cdot 0.375}{x}}{x} \end{array} \end{array} \]
      (FPCore (x)
       :precision binary64
       (let* ((t_0 (sqrt (/ 1.0 x)))) (/ (- (* 0.5 t_0) (/ (* t_0 0.375) x)) x)))
      double code(double x) {
      	double t_0 = sqrt((1.0 / x));
      	return ((0.5 * t_0) - ((t_0 * 0.375) / x)) / x;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          real(8) :: t_0
          t_0 = sqrt((1.0d0 / x))
          code = ((0.5d0 * t_0) - ((t_0 * 0.375d0) / x)) / x
      end function
      
      public static double code(double x) {
      	double t_0 = Math.sqrt((1.0 / x));
      	return ((0.5 * t_0) - ((t_0 * 0.375) / x)) / x;
      }
      
      def code(x):
      	t_0 = math.sqrt((1.0 / x))
      	return ((0.5 * t_0) - ((t_0 * 0.375) / x)) / x
      
      function code(x)
      	t_0 = sqrt(Float64(1.0 / x))
      	return Float64(Float64(Float64(0.5 * t_0) - Float64(Float64(t_0 * 0.375) / x)) / x)
      end
      
      function tmp = code(x)
      	t_0 = sqrt((1.0 / x));
      	tmp = ((0.5 * t_0) - ((t_0 * 0.375) / x)) / x;
      end
      
      code[x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(0.5 * t$95$0), $MachinePrecision] - N[(N[(t$95$0 * 0.375), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \sqrt{\frac{1}{x}}\\
      \frac{0.5 \cdot t\_0 - \frac{t\_0 \cdot 0.375}{x}}{x}
      \end{array}
      \end{array}
      
      Derivation
      1. Initial program 37.7%

        \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 85.3%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{5}}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}}} \]
      4. Step-by-step derivation
        1. *-un-lft-identity85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{\left(1 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
        2. pow-flip85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot \sqrt{\color{blue}{{x}^{\left(-5\right)}}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
        3. sqrt-pow185.3%

          \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot \color{blue}{{x}^{\left(\frac{-5}{2}\right)}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
        4. metadata-eval85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot {x}^{\left(\frac{\color{blue}{-5}}{2}\right)}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
        5. metadata-eval85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\left(1 \cdot {x}^{\color{blue}{-2.5}}\right) \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      5. Applied egg-rr85.3%

        \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{\left(1 \cdot {x}^{-2.5}\right)} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      6. Step-by-step derivation
        1. *-lft-identity85.3%

          \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{{x}^{-2.5}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      7. Simplified85.3%

        \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{{x}^{-2.5}} \cdot \left(1 + 0.5 \cdot x\right)\right) - \left(-0.5 \cdot \sqrt{x} + \left(-0.5 \cdot \left(\sqrt{\frac{1}{{x}^{3}}} \cdot \left(1 + 0.25 \cdot x\right)\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)}{{x}^{2}} \]
      8. Taylor expanded in x around inf 98.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \sqrt{\frac{1}{x}}}{x}} \]
      9. Step-by-step derivation
        1. +-commutative98.7%

          \[\leadsto \frac{\color{blue}{0.5 \cdot \sqrt{\frac{1}{x}} + -1 \cdot \frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{x}}}{x}}}{x} \]
        2. mul-1-neg98.7%

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

          \[\leadsto \frac{\color{blue}{0.5 \cdot \sqrt{\frac{1}{x}} - \frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{x}}}{x}}}{x} \]
        4. distribute-rgt-out98.7%

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

          \[\leadsto \frac{0.5 \cdot \sqrt{\frac{1}{x}} - \frac{\sqrt{\frac{1}{x}} \cdot \color{blue}{0.375}}{x}}{x} \]
      10. Simplified98.7%

        \[\leadsto \color{blue}{\frac{0.5 \cdot \sqrt{\frac{1}{x}} - \frac{\sqrt{\frac{1}{x}} \cdot 0.375}{x}}{x}} \]
      11. Add Preprocessing

      Alternative 4: 98.0% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ -0.5 \cdot \left({x}^{-2.5} - {x}^{-1.5}\right) \end{array} \]
      (FPCore (x) :precision binary64 (* -0.5 (- (pow x -2.5) (pow x -1.5))))
      double code(double x) {
      	return -0.5 * (pow(x, -2.5) - pow(x, -1.5));
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = (-0.5d0) * ((x ** (-2.5d0)) - (x ** (-1.5d0)))
      end function
      
      public static double code(double x) {
      	return -0.5 * (Math.pow(x, -2.5) - Math.pow(x, -1.5));
      }
      
      def code(x):
      	return -0.5 * (math.pow(x, -2.5) - math.pow(x, -1.5))
      
      function code(x)
      	return Float64(-0.5 * Float64((x ^ -2.5) - (x ^ -1.5)))
      end
      
      function tmp = code(x)
      	tmp = -0.5 * ((x ^ -2.5) - (x ^ -1.5));
      end
      
      code[x_] := N[(-0.5 * N[(N[Power[x, -2.5], $MachinePrecision] - N[Power[x, -1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      -0.5 \cdot \left({x}^{-2.5} - {x}^{-1.5}\right)
      \end{array}
      
      Derivation
      1. Initial program 37.7%

        \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. add-sqr-sqrt20.3%

          \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\sqrt{\frac{1}{\sqrt{x + 1}}} \cdot \sqrt{\frac{1}{\sqrt{x + 1}}}} \]
        2. sqrt-unprod37.7%

          \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\sqrt{\frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}} \]
        3. frac-times33.4%

          \[\leadsto \frac{1}{\sqrt{x}} - \sqrt{\color{blue}{\frac{1 \cdot 1}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}} \]
        4. metadata-eval33.4%

          \[\leadsto \frac{1}{\sqrt{x}} - \sqrt{\frac{\color{blue}{1}}{\sqrt{x + 1} \cdot \sqrt{x + 1}}} \]
        5. add-sqr-sqrt29.4%

          \[\leadsto \frac{1}{\sqrt{x}} - \sqrt{\frac{1}{\color{blue}{x + 1}}} \]
        6. +-commutative29.4%

          \[\leadsto \frac{1}{\sqrt{x}} - \sqrt{\frac{1}{\color{blue}{1 + x}}} \]
      4. Applied egg-rr29.4%

        \[\leadsto \frac{1}{\sqrt{x}} - \color{blue}{\sqrt{\frac{1}{1 + x}}} \]
      5. Taylor expanded in x around inf 84.4%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \sqrt{\frac{1}{x}} - -0.5 \cdot \sqrt{x}}{{x}^{2}}} \]
      6. Step-by-step derivation
        1. distribute-lft-out--84.4%

          \[\leadsto \frac{\color{blue}{-0.5 \cdot \left(\sqrt{\frac{1}{x}} - \sqrt{x}\right)}}{{x}^{2}} \]
        2. associate-/l*84.4%

          \[\leadsto \color{blue}{-0.5 \cdot \frac{\sqrt{\frac{1}{x}} - \sqrt{x}}{{x}^{2}}} \]
        3. unpow1/284.4%

          \[\leadsto -0.5 \cdot \frac{\color{blue}{{\left(\frac{1}{x}\right)}^{0.5}} - \sqrt{x}}{{x}^{2}} \]
        4. rem-exp-log84.4%

          \[\leadsto -0.5 \cdot \frac{{\left(\frac{1}{\color{blue}{e^{\log x}}}\right)}^{0.5} - \sqrt{x}}{{x}^{2}} \]
        5. exp-neg84.4%

          \[\leadsto -0.5 \cdot \frac{{\color{blue}{\left(e^{-\log x}\right)}}^{0.5} - \sqrt{x}}{{x}^{2}} \]
        6. exp-prod84.4%

          \[\leadsto -0.5 \cdot \frac{\color{blue}{e^{\left(-\log x\right) \cdot 0.5}} - \sqrt{x}}{{x}^{2}} \]
        7. distribute-lft-neg-out84.4%

          \[\leadsto -0.5 \cdot \frac{e^{\color{blue}{-\log x \cdot 0.5}} - \sqrt{x}}{{x}^{2}} \]
        8. distribute-rgt-neg-in84.4%

          \[\leadsto -0.5 \cdot \frac{e^{\color{blue}{\log x \cdot \left(-0.5\right)}} - \sqrt{x}}{{x}^{2}} \]
        9. metadata-eval84.4%

          \[\leadsto -0.5 \cdot \frac{e^{\log x \cdot \color{blue}{-0.5}} - \sqrt{x}}{{x}^{2}} \]
        10. exp-to-pow84.4%

          \[\leadsto -0.5 \cdot \frac{\color{blue}{{x}^{-0.5}} - \sqrt{x}}{{x}^{2}} \]
      7. Simplified84.4%

        \[\leadsto \color{blue}{-0.5 \cdot \frac{{x}^{-0.5} - \sqrt{x}}{{x}^{2}}} \]
      8. Step-by-step derivation
        1. div-sub84.4%

          \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{{x}^{-0.5}}{{x}^{2}} - \frac{\sqrt{x}}{{x}^{2}}\right)} \]
        2. pow-div84.4%

          \[\leadsto -0.5 \cdot \left(\color{blue}{{x}^{\left(-0.5 - 2\right)}} - \frac{\sqrt{x}}{{x}^{2}}\right) \]
        3. metadata-eval84.4%

          \[\leadsto -0.5 \cdot \left({x}^{\color{blue}{-2.5}} - \frac{\sqrt{x}}{{x}^{2}}\right) \]
        4. pow1/284.4%

          \[\leadsto -0.5 \cdot \left({x}^{-2.5} - \frac{\color{blue}{{x}^{0.5}}}{{x}^{2}}\right) \]
        5. pow-div98.1%

          \[\leadsto -0.5 \cdot \left({x}^{-2.5} - \color{blue}{{x}^{\left(0.5 - 2\right)}}\right) \]
        6. metadata-eval98.1%

          \[\leadsto -0.5 \cdot \left({x}^{-2.5} - {x}^{\color{blue}{-1.5}}\right) \]
      9. Applied egg-rr98.1%

        \[\leadsto -0.5 \cdot \color{blue}{\left({x}^{-2.5} - {x}^{-1.5}\right)} \]
      10. Add Preprocessing

      Alternative 5: 65.4% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ 0.5 \cdot \sqrt{\frac{1}{{x}^{3}}} \end{array} \]
      (FPCore (x) :precision binary64 (* 0.5 (sqrt (/ 1.0 (pow x 3.0)))))
      double code(double x) {
      	return 0.5 * sqrt((1.0 / pow(x, 3.0)));
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = 0.5d0 * sqrt((1.0d0 / (x ** 3.0d0)))
      end function
      
      public static double code(double x) {
      	return 0.5 * Math.sqrt((1.0 / Math.pow(x, 3.0)));
      }
      
      def code(x):
      	return 0.5 * math.sqrt((1.0 / math.pow(x, 3.0)))
      
      function code(x)
      	return Float64(0.5 * sqrt(Float64(1.0 / (x ^ 3.0))))
      end
      
      function tmp = code(x)
      	tmp = 0.5 * sqrt((1.0 / (x ^ 3.0)));
      end
      
      code[x_] := N[(0.5 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}
      \end{array}
      
      Derivation
      1. Initial program 37.7%

        \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 67.3%

        \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{{x}^{3}}}} \]
      4. Add Preprocessing

      Alternative 6: 35.3% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \sqrt[3]{{x}^{-1.5}} \end{array} \]
      (FPCore (x) :precision binary64 (cbrt (pow x -1.5)))
      double code(double x) {
      	return cbrt(pow(x, -1.5));
      }
      
      public static double code(double x) {
      	return Math.cbrt(Math.pow(x, -1.5));
      }
      
      function code(x)
      	return cbrt((x ^ -1.5))
      end
      
      code[x_] := N[Power[N[Power[x, -1.5], $MachinePrecision], 1/3], $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \sqrt[3]{{x}^{-1.5}}
      \end{array}
      
      Derivation
      1. Initial program 37.7%

        \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0 5.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{x}}} \]
      4. Step-by-step derivation
        1. add-cbrt-cube34.9%

          \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt{\frac{1}{x}} \cdot \sqrt{\frac{1}{x}}\right) \cdot \sqrt{\frac{1}{x}}}} \]
        2. add-sqr-sqrt34.9%

          \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{x}} \cdot \sqrt{\frac{1}{x}}} \]
        3. sqrt-div34.9%

          \[\leadsto \sqrt[3]{\frac{1}{x} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{x}}}} \]
        4. metadata-eval34.9%

          \[\leadsto \sqrt[3]{\frac{1}{x} \cdot \frac{\color{blue}{1}}{\sqrt{x}}} \]
        5. frac-times35.6%

          \[\leadsto \sqrt[3]{\color{blue}{\frac{1 \cdot 1}{x \cdot \sqrt{x}}}} \]
        6. metadata-eval35.6%

          \[\leadsto \sqrt[3]{\frac{\color{blue}{1}}{x \cdot \sqrt{x}}} \]
        7. add-sqr-sqrt35.6%

          \[\leadsto \sqrt[3]{\frac{1}{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \sqrt{x}}} \]
        8. sqrt-unprod36.3%

          \[\leadsto \sqrt[3]{\frac{1}{\color{blue}{\sqrt{x \cdot x}} \cdot \sqrt{x}}} \]
        9. sqrt-prod36.3%

          \[\leadsto \sqrt[3]{\frac{1}{\color{blue}{\sqrt{\left(x \cdot x\right) \cdot x}}}} \]
        10. unpow336.3%

          \[\leadsto \sqrt[3]{\frac{1}{\sqrt{\color{blue}{{x}^{3}}}}} \]
        11. metadata-eval36.3%

          \[\leadsto \sqrt[3]{\frac{\color{blue}{\sqrt{1}}}{\sqrt{{x}^{3}}}} \]
        12. sqrt-div36.3%

          \[\leadsto \sqrt[3]{\color{blue}{\sqrt{\frac{1}{{x}^{3}}}}} \]
        13. pow1/336.3%

          \[\leadsto \color{blue}{{\left(\sqrt{\frac{1}{{x}^{3}}}\right)}^{0.3333333333333333}} \]
        14. pow-flip36.3%

          \[\leadsto {\left(\sqrt{\color{blue}{{x}^{\left(-3\right)}}}\right)}^{0.3333333333333333} \]
        15. sqrt-pow134.9%

          \[\leadsto {\color{blue}{\left({x}^{\left(\frac{-3}{2}\right)}\right)}}^{0.3333333333333333} \]
        16. metadata-eval34.9%

          \[\leadsto {\left({x}^{\left(\frac{\color{blue}{-3}}{2}\right)}\right)}^{0.3333333333333333} \]
        17. metadata-eval34.9%

          \[\leadsto {\left({x}^{\color{blue}{-1.5}}\right)}^{0.3333333333333333} \]
      5. Applied egg-rr34.9%

        \[\leadsto \color{blue}{{\left({x}^{-1.5}\right)}^{0.3333333333333333}} \]
      6. Step-by-step derivation
        1. unpow1/334.9%

          \[\leadsto \color{blue}{\sqrt[3]{{x}^{-1.5}}} \]
      7. Simplified34.9%

        \[\leadsto \color{blue}{\sqrt[3]{{x}^{-1.5}}} \]
      8. Add Preprocessing

      Alternative 7: 36.5% accurate, 209.0× speedup?

      \[\begin{array}{l} \\ 0 \end{array} \]
      (FPCore (x) :precision binary64 0.0)
      double code(double x) {
      	return 0.0;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = 0.0d0
      end function
      
      public static double code(double x) {
      	return 0.0;
      }
      
      def code(x):
      	return 0.0
      
      function code(x)
      	return 0.0
      end
      
      function tmp = code(x)
      	tmp = 0.0;
      end
      
      code[x_] := 0.0
      
      \begin{array}{l}
      
      \\
      0
      \end{array}
      
      Derivation
      1. Initial program 37.7%

        \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. sub-neg37.7%

          \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} + \left(-\frac{1}{\sqrt{x + 1}}\right)} \]
        2. +-commutative37.7%

          \[\leadsto \color{blue}{\left(-\frac{1}{\sqrt{x + 1}}\right) + \frac{1}{\sqrt{x}}} \]
        3. add-cube-cbrt12.3%

          \[\leadsto \left(-\color{blue}{\left(\sqrt[3]{\frac{1}{\sqrt{x + 1}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x + 1}}}\right) \cdot \sqrt[3]{\frac{1}{\sqrt{x + 1}}}}\right) + \frac{1}{\sqrt{x}} \]
        4. distribute-lft-neg-in12.3%

          \[\leadsto \color{blue}{\left(-\sqrt[3]{\frac{1}{\sqrt{x + 1}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x + 1}}}\right) \cdot \sqrt[3]{\frac{1}{\sqrt{x + 1}}}} + \frac{1}{\sqrt{x}} \]
        5. fma-define7.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(-\sqrt[3]{\frac{1}{\sqrt{x + 1}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x + 1}}}, \sqrt[3]{\frac{1}{\sqrt{x + 1}}}, \frac{1}{\sqrt{x}}\right)} \]
      4. Applied egg-rr7.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-\sqrt[3]{\frac{1}{1 + x}}, \sqrt[3]{{\left(1 + x\right)}^{-0.5}}, {x}^{-0.5}\right)} \]
      5. Taylor expanded in x around inf 34.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} + -1 \cdot \sqrt{\frac{1}{x}}} \]
      6. Step-by-step derivation
        1. distribute-rgt1-in34.8%

          \[\leadsto \color{blue}{\left(-1 + 1\right) \cdot \sqrt{\frac{1}{x}}} \]
        2. metadata-eval34.8%

          \[\leadsto \color{blue}{0} \cdot \sqrt{\frac{1}{x}} \]
        3. mul0-lft34.8%

          \[\leadsto \color{blue}{0} \]
      7. Simplified34.8%

        \[\leadsto \color{blue}{0} \]
      8. Add Preprocessing

      Developer target: 98.5% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}} \end{array} \]
      (FPCore (x)
       :precision binary64
       (/ 1.0 (+ (* (+ x 1.0) (sqrt x)) (* x (sqrt (+ x 1.0))))))
      double code(double x) {
      	return 1.0 / (((x + 1.0) * sqrt(x)) + (x * sqrt((x + 1.0))));
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = 1.0d0 / (((x + 1.0d0) * sqrt(x)) + (x * sqrt((x + 1.0d0))))
      end function
      
      public static double code(double x) {
      	return 1.0 / (((x + 1.0) * Math.sqrt(x)) + (x * Math.sqrt((x + 1.0))));
      }
      
      def code(x):
      	return 1.0 / (((x + 1.0) * math.sqrt(x)) + (x * math.sqrt((x + 1.0))))
      
      function code(x)
      	return Float64(1.0 / Float64(Float64(Float64(x + 1.0) * sqrt(x)) + Float64(x * sqrt(Float64(x + 1.0)))))
      end
      
      function tmp = code(x)
      	tmp = 1.0 / (((x + 1.0) * sqrt(x)) + (x * sqrt((x + 1.0))));
      end
      
      code[x_] := N[(1.0 / N[(N[(N[(x + 1.0), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(x * N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}}
      \end{array}
      

      Reproduce

      ?
      herbie shell --seed 2024108 
      (FPCore (x)
        :name "2isqrt (example 3.6)"
        :precision binary64
        :pre (and (> x 1.0) (< x 1e+308))
      
        :alt
        (/ 1.0 (+ (* (+ x 1.0) (sqrt x)) (* x (sqrt (+ x 1.0)))))
      
        (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))