Average Error: 1.6 → 0
Time: 3.4s
Precision: 64
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]
\sqrt{x + 1} - \sqrt{x}
\frac{1}{\sqrt{x + 1} + \sqrt{x}}
double f(double x) {
        double r530412 = x;
        double r530413 = 1.0;
        double r530414 = r530412 + r530413;
        double r530415 = sqrt(r530414);
        double r530416 = sqrt(r530412);
        double r530417 = r530415 - r530416;
        return r530417;
}

double f(double x) {
        double r530418 = 1.0;
        double r530419 = x;
        double r530420 = r530419 + r530418;
        double r530421 = sqrt(r530420);
        double r530422 = sqrt(r530419);
        double r530423 = r530421 + r530422;
        double r530424 = r530418 / r530423;
        return r530424;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 1.6

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

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

    \[\leadsto \frac{\color{blue}{1}}{\sqrt{x + 1} + \sqrt{x}}\]
  5. Final simplification0

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

Reproduce

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