Average Error: 19.4 → 19.8
Time: 23.1s
Precision: 64
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\sqrt[3]{\frac{\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{1 + x}} \cdot \frac{1}{\sqrt{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{1 + x}}}} \cdot \frac{\sqrt[3]{\frac{1}{x} - \frac{1}{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x} - \sqrt{x}}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{x}}\right) \cdot \sqrt[3]{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{1 + x}}}}\]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\sqrt[3]{\frac{\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{1 + x}} \cdot \frac{1}{\sqrt{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{1 + x}}}} \cdot \frac{\sqrt[3]{\frac{1}{x} - \frac{1}{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x} - \sqrt{x}}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{x}}\right) \cdot \sqrt[3]{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{1 + x}}}}
double f(double x) {
        double r3774149 = 1.0;
        double r3774150 = x;
        double r3774151 = sqrt(r3774150);
        double r3774152 = r3774149 / r3774151;
        double r3774153 = r3774150 + r3774149;
        double r3774154 = sqrt(r3774153);
        double r3774155 = r3774149 / r3774154;
        double r3774156 = r3774152 - r3774155;
        return r3774156;
}

double f(double x) {
        double r3774157 = 1.0;
        double r3774158 = x;
        double r3774159 = sqrt(r3774158);
        double r3774160 = r3774157 / r3774159;
        double r3774161 = r3774160 * r3774160;
        double r3774162 = r3774157 + r3774158;
        double r3774163 = sqrt(r3774162);
        double r3774164 = r3774157 / r3774163;
        double r3774165 = r3774164 * r3774164;
        double r3774166 = r3774161 - r3774165;
        double r3774167 = r3774160 + r3774164;
        double r3774168 = r3774166 / r3774167;
        double r3774169 = cbrt(r3774168);
        double r3774170 = r3774157 / r3774158;
        double r3774171 = r3774157 / r3774162;
        double r3774172 = r3774170 - r3774171;
        double r3774173 = cbrt(r3774172);
        double r3774174 = r3774163 - r3774159;
        double r3774175 = cbrt(r3774174);
        double r3774176 = r3774173 * r3774175;
        double r3774177 = cbrt(r3774163);
        double r3774178 = cbrt(r3774159);
        double r3774179 = r3774177 * r3774178;
        double r3774180 = cbrt(r3774167);
        double r3774181 = r3774179 * r3774180;
        double r3774182 = r3774176 / r3774181;
        double r3774183 = r3774169 * r3774182;
        return r3774183;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original19.4
Target0.6
Herbie19.8
\[\frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}}\]

Derivation

  1. Initial program 19.4

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
  2. Using strategy rm
  3. Applied add-cube-cbrt19.9

    \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}}\right) \cdot \sqrt[3]{\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}}}\]
  4. Using strategy rm
  5. Applied flip--19.9

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

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

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

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

    \[\leadsto \color{blue}{\frac{\sqrt[3]{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1} \cdot \sqrt[3]{\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}}{\sqrt[3]{\sqrt{x} \cdot \sqrt{x + 1}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}}\]
  10. Simplified19.8

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\sqrt{x + 1} - \sqrt{x}} \cdot \sqrt[3]{\frac{1}{x} - \frac{1}{x + 1}}}}{\sqrt[3]{\sqrt{x} \cdot \sqrt{x + 1}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}}\]
  11. Using strategy rm
  12. Applied flip--19.8

    \[\leadsto \frac{\sqrt[3]{\sqrt{x + 1} - \sqrt{x}} \cdot \sqrt[3]{\frac{1}{x} - \frac{1}{x + 1}}}{\sqrt[3]{\sqrt{x} \cdot \sqrt{x + 1}} \cdot \sqrt[3]{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}} \cdot \sqrt[3]{\color{blue}{\frac{\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}}}\]
  13. Using strategy rm
  14. Applied cbrt-prod19.8

    \[\leadsto \frac{\sqrt[3]{\sqrt{x + 1} - \sqrt{x}} \cdot \sqrt[3]{\frac{1}{x} - \frac{1}{x + 1}}}{\color{blue}{\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{x + 1}}\right)} \cdot \sqrt[3]{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}} \cdot \sqrt[3]{\frac{\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}} \cdot \frac{1}{\sqrt{x + 1}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}}\]
  15. Final simplification19.8

    \[\leadsto \sqrt[3]{\frac{\frac{1}{\sqrt{x}} \cdot \frac{1}{\sqrt{x}} - \frac{1}{\sqrt{1 + x}} \cdot \frac{1}{\sqrt{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{1 + x}}}} \cdot \frac{\sqrt[3]{\frac{1}{x} - \frac{1}{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x} - \sqrt{x}}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{x}}\right) \cdot \sqrt[3]{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{1 + x}}}}\]

Reproduce

herbie shell --seed 2019134 
(FPCore (x)
  :name "2isqrt (example 3.6)"

  :herbie-target
  (/ 1 (+ (* (+ x 1) (sqrt x)) (* x (sqrt (+ x 1)))))

  (- (/ 1 (sqrt x)) (/ 1 (sqrt (+ x 1)))))