Average Error: 14.2 → 0.2
Time: 37.0s
Precision: 64
Internal Precision: 832
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\begin{array}{l} \mathbf{if}\;\frac{1}{x + 1} - \frac{1}{x - 1} \le 7.896825413969131 \cdot 10^{-177}:\\ \;\;\;\;\left(-\left(\frac{2}{{x}^{6}} + \frac{\frac{2}{x}}{x}\right)\right) - \frac{2}{{x}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{x + 1}} \cdot \sqrt{\frac{1}{x + 1}} - \frac{1}{x - 1}\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if (- (/ 1 (+ x 1)) (/ 1 (- x 1))) < 7.896825413969131e-177

    1. Initial program 28.5

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

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

      \[\leadsto \color{blue}{\left(\frac{-2}{x \cdot x} + \frac{-2}{{x}^{6}}\right) - \frac{2}{{x}^{4}}}\]
    4. Using strategy rm
    5. Applied associate-/r*0.3

      \[\leadsto \left(\color{blue}{\frac{\frac{-2}{x}}{x}} + \frac{-2}{{x}^{6}}\right) - \frac{2}{{x}^{4}}\]

    if 7.896825413969131e-177 < (- (/ 1 (+ x 1)) (/ 1 (- x 1)))

    1. Initial program 0.0

      \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt0.0

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x + 1}} \cdot \sqrt{\frac{1}{x + 1}}} - \frac{1}{x - 1}\]
  3. Recombined 2 regimes into one program.
  4. Applied simplify0.2

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;\frac{1}{x + 1} - \frac{1}{x - 1} \le 7.896825413969131 \cdot 10^{-177}:\\ \;\;\;\;\left(-\left(\frac{2}{{x}^{6}} + \frac{\frac{2}{x}}{x}\right)\right) - \frac{2}{{x}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{x + 1}} \cdot \sqrt{\frac{1}{x + 1}} - \frac{1}{x - 1}\\ \end{array}}\]

Runtime

Time bar (total: 37.0s)Debug logProfile

herbie shell --seed '#(1071948828 1180510430 2986424009 997076509 406109801 420189285)' 
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))