Average Error: 6.1 → 0
Time: 5.6s
Precision: 64
\[x \gt 10\]
\[\sqrt{x + 1} - \sqrt{x + 2}\]
\[\frac{\left(-2\right) + 1}{\sqrt{x + 1} + \sqrt{x + 2}}\]
\sqrt{x + 1} - \sqrt{x + 2}
\frac{\left(-2\right) + 1}{\sqrt{x + 1} + \sqrt{x + 2}}
double f(double x) {
        double r3607836 = x;
        double r3607837 = 1.0;
        double r3607838 = r3607836 + r3607837;
        double r3607839 = sqrt(r3607838);
        double r3607840 = 2.0;
        double r3607841 = r3607836 + r3607840;
        double r3607842 = sqrt(r3607841);
        double r3607843 = r3607839 - r3607842;
        return r3607843;
}

double f(double x) {
        double r3607844 = 2.0;
        double r3607845 = -r3607844;
        double r3607846 = 1.0;
        double r3607847 = r3607845 + r3607846;
        double r3607848 = x;
        double r3607849 = r3607848 + r3607846;
        double r3607850 = sqrt(r3607849);
        double r3607851 = r3607848 + r3607844;
        double r3607852 = sqrt(r3607851);
        double r3607853 = r3607850 + r3607852;
        double r3607854 = r3607847 / r3607853;
        return r3607854;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 6.1

    \[\sqrt{x + 1} - \sqrt{x + 2}\]
  2. Using strategy rm
  3. Applied flip--6.0

    \[\leadsto \color{blue}{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x + 2} \cdot \sqrt{x + 2}}{\sqrt{x + 1} + \sqrt{x + 2}}}\]
  4. Simplified0

    \[\leadsto \frac{\color{blue}{1 + \left(0 - 2\right)}}{\sqrt{x + 1} + \sqrt{x + 2}}\]
  5. Final simplification0

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

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "sqrt(x+1) - sqrt(x+2)"
  :precision binary32
  :pre (> x 10)
  (- (sqrt (+ x 1)) (sqrt (+ x 2))))