Average Error: 0.0 → 0.0
Time: 7.9s
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 r1440623 = x;
        double r1440624 = 1.0;
        double r1440625 = r1440623 + r1440624;
        double r1440626 = sqrt(r1440625);
        double r1440627 = sqrt(r1440623);
        double r1440628 = r1440626 + r1440627;
        return r1440628;
}

double f(double x) {
        double r1440629 = x;
        double r1440630 = 1.0;
        double r1440631 = r1440629 + r1440630;
        double r1440632 = sqrt(r1440631);
        double r1440633 = sqrt(r1440629);
        double r1440634 = r1440632 + r1440633;
        return r1440634;
}

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