Error: 14.0 → 0.2
Time: 13.4s
Precision: 64
Ground Truth: 128
\[\frac{1}{x + 1} - \frac{1}{x}\]
\[\begin{cases} \frac{\frac{1}{x}}{{x}^2} - \frac{\frac{1}{x}}{x} & \text{when } x \le -304234235346920.7 \\ \frac{x - \left(1 + x\right)}{\left(x + 1\right) \cdot x} & \text{when } x \le 108678362595.63406 \\ \frac{1}{{x}^{3}} - \left(\frac{1}{{x}^{4}} + \frac{1}{{x}^2}\right) & \text{otherwise} \end{cases}\]

Error

Bits error versus x

Derivation

    if x < -304234235346920.7

    1. Initial program 28.8

      \[\frac{1}{x + 1} - \frac{1}{x}\]
    2. Applied taylor 28.8

      \[\leadsto \left(\left(\frac{1}{x} + \frac{1}{{x}^{3}}\right) - \frac{1}{{x}^2}\right) - \frac{1}{x}\]
    3. Taylor expanded around inf 28.8

      \[\leadsto \color{blue}{\left(\left(\frac{1}{x} + \frac{1}{{x}^{3}}\right) - \frac{1}{{x}^2}\right)} - \frac{1}{x}\]
    4. Applied simplify 0.1

      \[\leadsto \color{blue}{\frac{\frac{1}{x}}{{x}^2} - \frac{\frac{1}{x}}{x}}\]

    if -304234235346920.7 < x < 108678362595.63406

    1. Initial program 0.6

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

      \[\leadsto \color{blue}{\frac{1 \cdot x - \left(x + 1\right) \cdot 1}{\left(x + 1\right) \cdot x}}\]
    4. Applied simplify 0.0

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

    if 108678362595.63406 < x

    1. Initial program 28.6

      \[\frac{1}{x + 1} - \frac{1}{x}\]
    2. Applied taylor 0.8

      \[\leadsto \frac{1}{{x}^{3}} - \left(\frac{1}{{x}^{4}} + \frac{1}{{x}^2}\right)\]
    3. Taylor expanded around inf 0.8

      \[\leadsto \color{blue}{\frac{1}{{x}^{3}} - \left(\frac{1}{{x}^{4}} + \frac{1}{{x}^2}\right)}\]
  1. Removed slow pow expressions

Runtime

Total time: 13.4s Debug log

Please report a bug with the following info:

herbie --seed '#(3598044517 3793165664 1842507353 3491948924 1440530565 3213152369)'
(FPCore (x)
  :name "NMSE problem 3.3.1"
  (- (/ 1 (+ x 1)) (/ 1 x)))