\[\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: 15.7 s
Input Error: 9.8
Output Error: 0.4
Log:
Profile: 🕒
\(\begin{cases} \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^3}\right) + \frac{2}{{x}^{5}} & \text{when } x \le -2.8723509911375156 \\ \frac{\left(x + {x}^2\right) + \left(\left(x - 2\right) - x \cdot 2\right) \cdot \left(x - 1\right)}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)} & \text{when } x \le 18533971.955403153 \\ \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^3}\right) + \frac{2}{{x}^{5}} & \text{otherwise} \end{cases}\)

    if x < -2.8723509911375156 or 18533971.955403153 < x

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      19.4
    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

    if -2.8723509911375156 < x < 18533971.955403153

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      0.3
    2. Using strategy rm
      0.3
    3. Applied frac-sub to get
      \[\color{red}{\left(\frac{1}{x + 1} - \frac{2}{x}\right)} + \frac{1}{x - 1} \leadsto \color{blue}{\frac{1 \cdot x - \left(x + 1\right) \cdot 2}{\left(x + 1\right) \cdot x}} + \frac{1}{x - 1}\]
      0.3
    4. Applied frac-add to get
      \[\color{red}{\frac{1 \cdot x - \left(x + 1\right) \cdot 2}{\left(x + 1\right) \cdot x} + \frac{1}{x - 1}} \leadsto \color{blue}{\frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)}}\]
      0.0
    5. Applied simplify to get
      \[\frac{\color{red}{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)} \leadsto \frac{\color{blue}{\left(x + x \cdot x\right) + \left(\left(x - 2\right) - x \cdot 2\right) \cdot \left(x - 1\right)}}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)}\]
      0.1
    6. Applied simplify to get
      \[\frac{\color{red}{\left(x + x \cdot x\right)} + \left(\left(x - 2\right) - x \cdot 2\right) \cdot \left(x - 1\right)}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)} \leadsto \frac{\color{blue}{\left(x + {x}^2\right)} + \left(\left(x - 2\right) - x \cdot 2\right) \cdot \left(x - 1\right)}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)}\]
      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))))