Average Error: 0.0 → 0.0
Time: 11.3s
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 r32149402 = x;
        double r32149403 = 1.0;
        double r32149404 = r32149402 + r32149403;
        double r32149405 = sqrt(r32149404);
        double r32149406 = sqrt(r32149402);
        double r32149407 = r32149405 + r32149406;
        return r32149407;
}

double f(double x) {
        double r32149408 = x;
        double r32149409 = 1.0;
        double r32149410 = r32149408 + r32149409;
        double r32149411 = sqrt(r32149410);
        double r32149412 = sqrt(r32149408);
        double r32149413 = r32149411 + r32149412;
        return r32149413;
}

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