Average Error: 14.4 → 0.1
Time: 32.1s
Precision: 64
Internal Precision: 832
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -203.61048441999895 \lor \neg \left(x \le 233.82257986812613\right):\\ \;\;\;\;\left(\frac{\frac{-2}{x}}{x} + \frac{-2}{{x}^{4}}\right) + \frac{-2}{{x}^{6}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1 + x} - \log_* (1 + (e^{\frac{1}{x - 1}} - 1)^*)\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -203.61048441999895 or 233.82257986812613 < x

    1. Initial program 29.4

      \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
    2. Using strategy rm
    3. Applied log1p-expm1-u29.4

      \[\leadsto \frac{1}{x + 1} - \color{blue}{\log_* (1 + (e^{\frac{1}{x - 1}} - 1)^*)}\]
    4. Taylor expanded around -inf 0.8

      \[\leadsto \color{blue}{-\left(2 \cdot \frac{1}{{x}^{4}} + \left(2 \cdot \frac{1}{{x}^{6}} + 2 \cdot \frac{1}{{x}^{2}}\right)\right)}\]
    5. Simplified0.8

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

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

    if -203.61048441999895 < x < 233.82257986812613

    1. Initial program 0.0

      \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
    2. Using strategy rm
    3. Applied log1p-expm1-u0.0

      \[\leadsto \frac{1}{x + 1} - \color{blue}{\log_* (1 + (e^{\frac{1}{x - 1}} - 1)^*)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -203.61048441999895 \lor \neg \left(x \le 233.82257986812613\right):\\ \;\;\;\;\left(\frac{\frac{-2}{x}}{x} + \frac{-2}{{x}^{4}}\right) + \frac{-2}{{x}^{6}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1 + x} - \log_* (1 + (e^{\frac{1}{x - 1}} - 1)^*)\\ \end{array}\]

Runtime

Time bar (total: 32.1s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes14.40.10.014.399.6%
herbie shell --seed 2018340 +o rules:numerics
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))