Average Error: 14.1 → 0.2
Time: 39.6s
Precision: 64
Internal Precision: 832
\[\frac{1}{x + 1} - \frac{1}{x}\]
\[\begin{array}{l} \mathbf{if}\;\frac{1}{x + 1} - \frac{1}{x} \le -1.1737696399251457 \cdot 10^{-18}:\\ \;\;\;\;\frac{1}{x + 1} - \frac{1}{x}\\ \mathbf{if}\;\frac{1}{x + 1} - \frac{1}{x} \le 0.0:\\ \;\;\;\;\frac{1}{{x}^{3}} - \left(\frac{1}{{x}^{4}} + {x}^{\left(-2\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x + 1} - \frac{1}{x}\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if (- (/ 1 (+ x 1)) (/ 1 x)) < -1.1737696399251457e-18 or 0.0 < (- (/ 1 (+ x 1)) (/ 1 x))

    1. Initial program 0.4

      \[\frac{1}{x + 1} - \frac{1}{x}\]

    if -1.1737696399251457e-18 < (- (/ 1 (+ x 1)) (/ 1 x)) < 0.0

    1. Initial program 28.6

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

      \[\leadsto \color{blue}{\frac{1}{{x}^{3}} - \left(\frac{1}{{x}^{4}} + \frac{1}{{x}^{2}}\right)}\]
    3. Using strategy rm
    4. Applied pow-flip0.0

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

Runtime

Time bar (total: 39.6s)Debug logProfile

herbie shell --seed '#(1071725047 233389029 2036512464 3988615230 2972226563 1111574017)' 
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))