Average Error: 14.8 → 0.4
Time: 13.7s
Precision: 64
Internal Precision: 128
\[\frac{1}{x + 1} - \frac{1}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -23.06066892739458 \lor \neg \left(x \le 2.3990114478591055 \cdot 10^{-05}\right):\\ \;\;\;\;\frac{\frac{-1}{\sqrt{(x \cdot x + x)_*}}}{\sqrt{(x \cdot x + x)_*}}\\ \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 x < -23.06066892739458 or 2.3990114478591055e-05 < x

    1. Initial program 28.8

      \[\frac{1}{x + 1} - \frac{1}{x}\]
    2. Initial simplification28.8

      \[\leadsto \frac{1}{x + 1} - \frac{1}{x}\]
    3. Using strategy rm
    4. Applied frac-sub27.7

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

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

      \[\leadsto \frac{-1}{\color{blue}{(x \cdot x + x)_*}}\]
    7. Using strategy rm
    8. Applied add-sqr-sqrt0.7

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

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

    if -23.06066892739458 < x < 2.3990114478591055e-05

    1. Initial program 0.0

      \[\frac{1}{x + 1} - \frac{1}{x}\]
    2. Initial simplification0.0

      \[\leadsto \frac{1}{x + 1} - \frac{1}{x}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -23.06066892739458 \lor \neg \left(x \le 2.3990114478591055 \cdot 10^{-05}\right):\\ \;\;\;\;\frac{\frac{-1}{\sqrt{(x \cdot x + x)_*}}}{\sqrt{(x \cdot x + x)_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x + 1} - \frac{1}{x}\\ \end{array}\]

Runtime

Time bar (total: 13.7s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes14.80.40.314.499.6%
herbie shell --seed 2018353 +o rules:numerics
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))