Average Error: 14.1 → 0.6
Time: 17.6s
Precision: 64
Internal Precision: 896
\[\frac{1}{x + 1} - \frac{1}{x}\]
\[\begin{array}{l} \mathbf{if}\;\sqrt[3]{(x \cdot x + x)_*} \le 8773097.605766743:\\ \;\;\;\;\frac{\frac{{x}^{3} - {\left(x + 1\right)}^{3}}{(\left(x + 1\right) \cdot \left((2 \cdot x + 1)_*\right) + \left(x \cdot x\right))_*}}{(x \cdot x + x)_*}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{3}} - \left(\frac{1}{{x}^{4}} + \frac{1}{{x}^{2}}\right)\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if (cbrt (fma x x x)) < 8773097.605766743

    1. Initial program 0.4

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

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

      \[\leadsto \frac{\color{blue}{x - \left(x + 1\right)}}{\left(x + 1\right) \cdot x}\]
    5. Applied simplify0.0

      \[\leadsto \frac{x - \left(x + 1\right)}{\color{blue}{(x \cdot x + x)_*}}\]
    6. Using strategy rm
    7. Applied flip3--0.4

      \[\leadsto \frac{\color{blue}{\frac{{x}^{3} - {\left(x + 1\right)}^{3}}{x \cdot x + \left(\left(x + 1\right) \cdot \left(x + 1\right) + x \cdot \left(x + 1\right)\right)}}}{(x \cdot x + x)_*}\]
    8. Applied simplify0.4

      \[\leadsto \frac{\frac{{x}^{3} - {\left(x + 1\right)}^{3}}{\color{blue}{(\left(x + 1\right) \cdot \left((2 \cdot x + 1)_*\right) + \left(x \cdot x\right))_*}}}{(x \cdot x + x)_*}\]

    if 8773097.605766743 < (cbrt (fma x x x))

    1. Initial program 29.2

      \[\frac{1}{x + 1} - \frac{1}{x}\]
    2. Taylor expanded around inf 0.8

      \[\leadsto \color{blue}{\frac{1}{{x}^{3}} - \left(\frac{1}{{x}^{4}} + \frac{1}{{x}^{2}}\right)}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 17.6s)Debug logProfile

herbie shell --seed '#(1070355188 2193211668 3977393919 3454156579 3755371326 1656365382)' +o rules:numerics
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))