\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
Test:
NMSE problem 3.3.3
Bits:
128 bits
Bits error versus x
Time: 18.2 s
Input Error: 9.9
Output Error: 0.2
Log:
Profile: 🕒
\(\begin{cases} \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^{5}}\right) + \frac{\frac{2}{x}}{x \cdot x} & \text{when } x \le -3.2784791869173944 \cdot 10^{-06} \\ \left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1} & \text{when } x \le 501837.3637557024 \\ \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^3}\right) + \frac{2}{{x}^{5}} & \text{otherwise} \end{cases}\)

    if x < -3.2784791869173944e-06

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      20.5
    2. Applied taylor to get
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1} \leadsto 2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)\]
      0.6
    3. Taylor expanded around inf to get
      \[\color{red}{2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)} \leadsto \color{blue}{2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)}\]
      0.6
    4. Applied simplify to get
      \[\color{red}{2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)} \leadsto \color{blue}{\left(\frac{2}{{x}^{7}} + \frac{2}{{x}^3}\right) + \frac{2}{{x}^{5}}}\]
      0.6
    5. Applied taylor to get
      \[\left(\frac{2}{{x}^{7}} + \frac{2}{{x}^3}\right) + \frac{2}{{x}^{5}} \leadsto \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^3}\right) + \frac{2}{{x}^{5}}\]
      0.6
    6. Taylor expanded around 0 to get
      \[\left(\frac{2}{{x}^{7}} + \color{red}{\frac{2}{{x}^3}}\right) + \frac{2}{{x}^{5}} \leadsto \left(\frac{2}{{x}^{7}} + \color{blue}{\frac{2}{{x}^3}}\right) + \frac{2}{{x}^{5}}\]
      0.6
    7. Applied simplify to get
      \[\left(\frac{2}{{x}^{7}} + \frac{2}{{x}^3}\right) + \frac{2}{{x}^{5}} \leadsto \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^{5}}\right) + \frac{\frac{2}{x}}{x \cdot x}\]
      0.1

    8. Applied final simplification

    if -3.2784791869173944e-06 < x < 501837.3637557024

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      0.2

    if 501837.3637557024 < x

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      19.2
    2. Applied taylor to get
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1} \leadsto 2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)\]
      0.4
    3. Taylor expanded around inf to get
      \[\color{red}{2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)} \leadsto \color{blue}{2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)}\]
      0.4
    4. Applied simplify to get
      \[\color{red}{2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)} \leadsto \color{blue}{\left(\frac{2}{{x}^{7}} + \frac{2}{{x}^3}\right) + \frac{2}{{x}^{5}}}\]
      0.5

  1. Removed slow pow expressions

Original test:


(lambda ((x default))
  #:name "NMSE problem 3.3.3"
  (+ (- (/ 1 (+ x 1)) (/ 2 x)) (/ 1 (- x 1)))
  #:target
  (/ 2 (* x (- (sqr x) 1))))