Average Error: 29.2 → 0.1
Time: 44.7s
Precision: 64
Internal Precision: 1408
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -11001.194808699116:\\ \;\;\;\;\left(1 + \frac{3}{x}\right) \cdot \frac{-1}{x \cdot x} + \left(-\frac{3}{x}\right)\\ \mathbf{if}\;x \le 10338.616334416238:\\ \;\;\;\;\frac{x}{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 < -11001.194808699116 or 10338.616334416238 < x

    1. Initial program 59.1

      \[\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 -11001.194808699116 < x < 10338.616334416238

    1. Initial program 0.1

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

Runtime

Time bar (total: 44.7s)Debug logProfile

herbie shell --seed '#(1064269945 2896236262 301053905 1701069080 1701464310 1614783279)' 
(FPCore (x)
  :name "Asymptote C"
  (- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))