Average Error: 30.4 → 0.2
Time: 13.0s
Precision: 64
\[\sqrt{1 + x} - \sqrt{x}\]
\[\frac{1}{\sqrt{1 + x} + \sqrt{x}}\]
\sqrt{1 + x} - \sqrt{x}
\frac{1}{\sqrt{1 + x} + \sqrt{x}}
double f(double x) {
        double r12694992 = 1.0;
        double r12694993 = x;
        double r12694994 = r12694992 + r12694993;
        double r12694995 = sqrt(r12694994);
        double r12694996 = sqrt(r12694993);
        double r12694997 = r12694995 - r12694996;
        return r12694997;
}

double f(double x) {
        double r12694998 = 1.0;
        double r12694999 = x;
        double r12695000 = r12694998 + r12694999;
        double r12695001 = sqrt(r12695000);
        double r12695002 = sqrt(r12694999);
        double r12695003 = r12695001 + r12695002;
        double r12695004 = r12694998 / r12695003;
        return r12695004;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.4

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

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

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

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

Reproduce

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