\[\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: 9.2 s
Input Error: 4.7
Output Error: 0.1
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 -0.01639637f0 \\ \frac{x - (2 * x + 2)_*}{(x * x + x)_*} + \frac{1}{x - 1} & \text{when } x \le 17.42791f0 \\ \frac{\frac{2}{x}}{x \cdot x} + \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^{5}}\right) & \text{otherwise} \end{cases}\)

    if x < -0.01639637f0 or 17.42791f0 < x

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      9.1
    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}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3}}\]
      0.7
    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.7
    6. Taylor expanded around 0 to get
      \[\left(\frac{2}{{x}^{5}} + \color{red}{\frac{2}{{x}^{7}}}\right) + \frac{2}{{x}^3} \leadsto \left(\frac{2}{{x}^{5}} + \color{blue}{\frac{2}{{x}^{7}}}\right) + \frac{2}{{x}^3}\]
      0.7
    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 -0.01639637f0 < x < 17.42791f0

    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 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.1
    4. Applied simplify to get
      \[\frac{\color{red}{1 \cdot x - \left(x + 1\right) \cdot 2}}{\left(x + 1\right) \cdot x} + \frac{1}{x - 1} \leadsto \frac{\color{blue}{x - (2 * x + 2)_*}}{\left(x + 1\right) \cdot x} + \frac{1}{x - 1}\]
      0.1
    5. Applied simplify to get
      \[\frac{x - (2 * x + 2)_*}{\color{red}{\left(x + 1\right) \cdot x}} + \frac{1}{x - 1} \leadsto \frac{x - (2 * x + 2)_*}{\color{blue}{(x * x + x)_*}} + \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))))