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

Error

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if x < -1.9471071872654402

    1. Initial program 29.7

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

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

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

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

      \[\leadsto \frac{x - \left(x + 1\right)}{\color{blue}{\sqrt{(x \cdot x + x)_*} \cdot \sqrt{(x \cdot x + x)_*}}}\]
    8. Applied associate-/r*28.3

      \[\leadsto \color{blue}{\frac{\frac{x - \left(x + 1\right)}{\sqrt{(x \cdot x + x)_*}}}{\sqrt{(x \cdot x + x)_*}}}\]
    9. Applied simplify0.6

      \[\leadsto \frac{\color{blue}{\frac{0 - 1}{\sqrt{(x \cdot x + x)_*}}}}{\sqrt{(x \cdot x + x)_*}}\]

    if -1.9471071872654402 < x < 8884.01148314997

    1. Initial program 0.0

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

      \[\leadsto \frac{1}{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}} - \frac{1}{x}\]
    4. Applied associate-/r*0.1

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

    if 8884.01148314997 < x

    1. Initial program 29.0

      \[\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 3 regimes into one program.
  4. Applied simplify0.4

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;x \le -1.9471071872654402:\\ \;\;\;\;\frac{\frac{-1}{\sqrt{(x \cdot x + x)_*}}}{\sqrt{(x \cdot x + x)_*}}\\ \mathbf{if}\;x \le 8884.01148314997:\\ \;\;\;\;\frac{\frac{1}{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}}{\sqrt[3]{1 + x}} - \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{3}} - \left(\frac{1}{{x}^{2}} + \frac{1}{{x}^{4}}\right)\\ \end{array}}\]

Runtime

Time bar (total: 17.5s)Debug logProfile

herbie shell --seed '#(1070258749 1877548225 2229079127 1588002776 3179087814 1886870650)' +o rules:numerics
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))