Average Error: 0.0 → 0.0
Time: 8.1s
Precision: 64
\[\sqrt{x + 1} + \sqrt{x}\]
\[\sqrt{x + 1} + \sqrt{x}\]
\sqrt{x + 1} + \sqrt{x}
\sqrt{x + 1} + \sqrt{x}
double f(double x) {
        double r3166739 = x;
        double r3166740 = 1.0;
        double r3166741 = r3166739 + r3166740;
        double r3166742 = sqrt(r3166741);
        double r3166743 = sqrt(r3166739);
        double r3166744 = r3166742 + r3166743;
        return r3166744;
}

double f(double x) {
        double r3166745 = x;
        double r3166746 = 1.0;
        double r3166747 = r3166745 + r3166746;
        double r3166748 = sqrt(r3166747);
        double r3166749 = sqrt(r3166745);
        double r3166750 = r3166748 + r3166749;
        return r3166750;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\sqrt{x + 1} + \sqrt{x}\]
  2. Final simplification0.0

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

Reproduce

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