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 r3319898 = x;
        double r3319899 = 1.0;
        double r3319900 = r3319898 + r3319899;
        double r3319901 = sqrt(r3319900);
        double r3319902 = sqrt(r3319898);
        double r3319903 = r3319901 - r3319902;
        return r3319903;
}

double f(double x) {
        double r3319904 = 1.0;
        double r3319905 = x;
        double r3319906 = r3319904 + r3319905;
        double r3319907 = cbrt(r3319906);
        double r3319908 = r3319907 * r3319907;
        double r3319909 = sqrt(r3319908);
        double r3319910 = sqrt(r3319907);
        double r3319911 = r3319909 * r3319910;
        double r3319912 = sqrt(r3319905);
        double r3319913 = r3319911 + r3319912;
        double r3319914 = r3319904 / r3319913;
        return r3319914;
}

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