Average Error: 29.0 → 0.0
Time: 30.9s
Precision: 64
Internal Precision: 1408
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -11711.035741065163:\\ \;\;\;\;\left(1 + \frac{3}{x}\right) \cdot \frac{-1}{x \cdot x} + \left(-\frac{3}{x}\right)\\ \mathbf{if}\;x \le 13794.093518101245:\\ \;\;\;\;x \cdot \frac{1}{x + 1} - \frac{x + 1}{x - 1}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{3}{x}\right) \cdot \frac{-1}{x \cdot x} + \left(-\frac{3}{x}\right)\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -11711.035741065163 or 13794.093518101245 < x

    1. Initial program 59.3

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

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

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

    if -11711.035741065163 < x < 13794.093518101245

    1. Initial program 0.1

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

      \[\leadsto \color{blue}{x \cdot \frac{1}{x + 1}} - \frac{x + 1}{x - 1}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 30.9s)Debug log

herbie shell --seed '#(3134395454 2560787729 2839617794 3603201618 2404842889 1897446260)' 
(FPCore (x)
  :name "Asymptote C"
  (- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))