\[\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: 12.1 s
Input Error: 4.3
Output Error: 0.3
Log:
Profile: 🕒
\(\begin{cases} \frac{\frac{2}{x}}{x \cdot x} + \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^{5}}\right) & \text{when } x \le -8.724425f0 \\ \frac{1}{x + 1} + \frac{(\left(-2\right) * \left(x - 1\right) + x)_*}{x \cdot \left(x - 1\right)} & \text{when } x \le 13.294522f0 \\ \left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3} & \text{otherwise} \end{cases}\)

    if x < -8.724425f0

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      8.6
    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.8
    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.8
    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}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3}}\]
      0.9
    5. Applied taylor to get
      \[\left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3} \leadsto \left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3}\]
      0.9
    6. Taylor expanded around 0 to get
      \[\left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \color{red}{\frac{2}{{x}^3}} \leadsto \left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \color{blue}{\frac{2}{{x}^3}}\]
      0.9
    7. Applied simplify to get
      \[\left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3} \leadsto \frac{\frac{2}{x}}{x \cdot x} + \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^{5}}\right)\]
      0.1

    8. Applied final simplification

    if -8.724425f0 < x < 13.294522f0

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      0.1
    2. Using strategy rm
      0.1
    3. Applied sub-neg to get
      \[\color{red}{\left(\frac{1}{x + 1} - \frac{2}{x}\right)} + \frac{1}{x - 1} \leadsto \color{blue}{\left(\frac{1}{x + 1} + \left(-\frac{2}{x}\right)\right)} + \frac{1}{x - 1}\]
      0.1
    4. Applied associate-+l+ to get
      \[\color{red}{\left(\frac{1}{x + 1} + \left(-\frac{2}{x}\right)\right) + \frac{1}{x - 1}} \leadsto \color{blue}{\frac{1}{x + 1} + \left(\left(-\frac{2}{x}\right) + \frac{1}{x - 1}\right)}\]
      0.1
    5. Using strategy rm
      0.1
    6. Applied distribute-neg-frac to get
      \[\frac{1}{x + 1} + \left(\color{red}{\left(-\frac{2}{x}\right)} + \frac{1}{x - 1}\right) \leadsto \frac{1}{x + 1} + \left(\color{blue}{\frac{-2}{x}} + \frac{1}{x - 1}\right)\]
      0.1
    7. Applied frac-add to get
      \[\frac{1}{x + 1} + \color{red}{\left(\frac{-2}{x} + \frac{1}{x - 1}\right)} \leadsto \frac{1}{x + 1} + \color{blue}{\frac{\left(-2\right) \cdot \left(x - 1\right) + x \cdot 1}{x \cdot \left(x - 1\right)}}\]
      0.1
    8. Applied simplify to get
      \[\frac{1}{x + 1} + \frac{\color{red}{\left(-2\right) \cdot \left(x - 1\right) + x \cdot 1}}{x \cdot \left(x - 1\right)} \leadsto \frac{1}{x + 1} + \frac{\color{blue}{(\left(-2\right) * \left(x - 1\right) + x)_*}}{x \cdot \left(x - 1\right)}\]
      0.1

    if 13.294522f0 < x

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      8.9
    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.8
    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.8
    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}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3}}\]
      0.8

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