Average Error: 30.1 → 0.0
Time: 9.1m
Precision: 64
Internal Precision: 128
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
\[\frac{3 + \frac{1}{x}}{\frac{-\left(x + 1\right)}{x} \cdot x + \left(1 + \frac{1}{x}\right)}\]

Error

Bits error versus x

Derivation

  1. Initial program 30.1

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

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

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

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

    \[\leadsto \frac{\color{blue}{(\left(\frac{x + 1}{x}\right) \cdot \left(x + 1\right) + \left(1 - x\right))_*}}{\frac{x + 1}{x} \cdot \left(-\left(x - 1\right)\right)}\]
  7. Taylor expanded around 0 0.0

    \[\leadsto \frac{\color{blue}{\frac{1}{x} + 3}}{\frac{x + 1}{x} \cdot \left(-\left(x - 1\right)\right)}\]
  8. Using strategy rm
  9. Applied sub-neg0.0

    \[\leadsto \frac{\frac{1}{x} + 3}{\frac{x + 1}{x} \cdot \left(-\color{blue}{\left(x + \left(-1\right)\right)}\right)}\]
  10. Applied distribute-neg-in0.0

    \[\leadsto \frac{\frac{1}{x} + 3}{\frac{x + 1}{x} \cdot \color{blue}{\left(\left(-x\right) + \left(-\left(-1\right)\right)\right)}}\]
  11. Applied distribute-rgt-in0.0

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

    \[\leadsto \frac{\frac{1}{x} + 3}{\left(-x\right) \cdot \frac{x + 1}{x} + \color{blue}{\left(\frac{1}{x} + 1\right)}}\]
  13. Final simplification0.0

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

Reproduce

herbie shell --seed 2019088 +o rules:numerics
(FPCore (x)
  :name "Asymptote C"
  (- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))