Average Error: 19.7 → 0.4
Time: 28.9s
Precision: 64
Ground Truth: 128
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x}}}{\sqrt{x + 1}}\]

Error

Bits error versus x

Target

Original19.7
Comparison0.7
Herbie0.4
\[ \frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}} \]

Derivation

  1. Initial program 19.7

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
  2. Using strategy rm
  3. Applied frac-sub 19.7

    \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}}\]
  4. Applied simplify 19.7

    \[\leadsto \frac{\color{blue}{\sqrt{1 + x} - \sqrt{x}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  5. Using strategy rm
  6. Applied flip-- 19.4

    \[\leadsto \frac{\color{blue}{\frac{{\left(\sqrt{1 + x}\right)}^2 - {\left(\sqrt{x}\right)}^2}{\sqrt{1 + x} + \sqrt{x}}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  7. Applied simplify 0.4

    \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  8. Using strategy rm
  9. Applied associate-/r* 0.4

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x}}}{\sqrt{x + 1}}}\]
  10. Removed slow pow expressions

Runtime

Total time: 28.9s Debug log

Please include this information when filing a bug report:

herbie --seed '#(2225669314 4254913380 3368992123 2519810392 3538272482 1946589551)'
(FPCore (x)
  :name "NMSE example 3.6"

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

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