Average Error: 30.4 → 0.3
Time: 10.5s
Precision: 64
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt{\sqrt[3]{1 + x}} + \sqrt{x}}\]
\sqrt{x + 1} - \sqrt{x}
\frac{1}{\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt{\sqrt[3]{1 + x}} + \sqrt{x}}
double f(double x) {
        double r28827185 = x;
        double r28827186 = 1.0;
        double r28827187 = r28827185 + r28827186;
        double r28827188 = sqrt(r28827187);
        double r28827189 = sqrt(r28827185);
        double r28827190 = r28827188 - r28827189;
        return r28827190;
}

double f(double x) {
        double r28827191 = 1.0;
        double r28827192 = x;
        double r28827193 = r28827191 + r28827192;
        double r28827194 = cbrt(r28827193);
        double r28827195 = r28827194 * r28827194;
        double r28827196 = sqrt(r28827195);
        double r28827197 = sqrt(r28827194);
        double r28827198 = r28827196 * r28827197;
        double r28827199 = sqrt(r28827192);
        double r28827200 = r28827198 + r28827199;
        double r28827201 = r28827191 / r28827200;
        return r28827201;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.4

    \[\sqrt{x + 1} - \sqrt{x}\]
  2. Using strategy rm
  3. Applied flip--30.2

    \[\leadsto \color{blue}{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}}\]
  4. Simplified0.2

    \[\leadsto \frac{\color{blue}{1}}{\sqrt{x + 1} + \sqrt{x}}\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.3

    \[\leadsto \frac{1}{\sqrt{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}} + \sqrt{x}}\]
  7. Applied sqrt-prod0.3

    \[\leadsto \frac{1}{\color{blue}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}} + \sqrt{x}}\]
  8. Final simplification0.3

    \[\leadsto \frac{1}{\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt{\sqrt[3]{1 + x}} + \sqrt{x}}\]

Reproduce

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