Average Error: 0.0 → 0.0
Time: 11.6s
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 r44560189 = x;
        double r44560190 = 1.0;
        double r44560191 = r44560189 + r44560190;
        double r44560192 = sqrt(r44560191);
        double r44560193 = sqrt(r44560189);
        double r44560194 = r44560192 + r44560193;
        return r44560194;
}

double f(double x) {
        double r44560195 = x;
        double r44560196 = 1.0;
        double r44560197 = r44560195 + r44560196;
        double r44560198 = sqrt(r44560197);
        double r44560199 = sqrt(r44560195);
        double r44560200 = r44560198 + r44560199;
        return r44560200;
}

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)"
  (+ (sqrt (+ x 1.0)) (sqrt x)))