\[\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: 7.6 s
Input Error: 10.0
Output Error: 0.1
Log:
Profile: 🕒
\(\begin{cases} \left(\frac{2}{{x}^{7}} + \frac{\frac{2}{x}}{x \cdot x}\right) + \frac{2}{{x}^{5}} & \text{when } x \le -1.128700823931291 \cdot 10^{-06} \\ \left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1} & \text{when } x \le 8727.195470384844 \\ \left(\frac{2}{{x}^{7}} + \frac{\frac{2}{x}}{x \cdot x}\right) + \frac{2}{{x}^{5}} & \text{otherwise} \end{cases}\)

    if x < -1.128700823931291e-06 or 8727.195470384844 < x

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      20.0
    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.5
    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.5
    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. Using strategy rm
      0.6
    6. Applied cube-mult to get
      \[\left(\frac{2}{{x}^{7}} + \frac{2}{\color{red}{{x}^3}}\right) + \frac{2}{{x}^{5}} \leadsto \left(\frac{2}{{x}^{7}} + \frac{2}{\color{blue}{x \cdot \left(x \cdot x\right)}}\right) + \frac{2}{{x}^{5}}\]
      0.6
    7. Applied associate-/r* to get
      \[\left(\frac{2}{{x}^{7}} + \color{red}{\frac{2}{x \cdot \left(x \cdot x\right)}}\right) + \frac{2}{{x}^{5}} \leadsto \left(\frac{2}{{x}^{7}} + \color{blue}{\frac{\frac{2}{x}}{x \cdot x}}\right) + \frac{2}{{x}^{5}}\]
      0.1

    if -1.128700823931291e-06 < x < 8727.195470384844

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

  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))))