Average Error: 0.0 → 0.0
Time: 11.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 r16412165 = x;
        double r16412166 = 1.0;
        double r16412167 = r16412165 + r16412166;
        double r16412168 = sqrt(r16412167);
        double r16412169 = sqrt(r16412165);
        double r16412170 = r16412168 + r16412169;
        return r16412170;
}

double f(double x) {
        double r16412171 = x;
        double r16412172 = 1.0;
        double r16412173 = r16412171 + r16412172;
        double r16412174 = sqrt(r16412173);
        double r16412175 = sqrt(r16412171);
        double r16412176 = r16412174 + r16412175;
        return r16412176;
}

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