Average Error: 1.6 → 0
Time: 3.5s
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 r2393221 = x;
        double r2393222 = 1.0;
        double r2393223 = r2393221 + r2393222;
        double r2393224 = sqrt(r2393223);
        double r2393225 = sqrt(r2393221);
        double r2393226 = r2393224 - r2393225;
        return r2393226;
}

double f(double x) {
        double r2393227 = 1.0;
        double r2393228 = x;
        double r2393229 = r2393228 + r2393227;
        double r2393230 = sqrt(r2393229);
        double r2393231 = sqrt(r2393228);
        double r2393232 = r2393230 + r2393231;
        double r2393233 = r2393227 / r2393232;
        return r2393233;
}

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)))