\[\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: 13.0 s
Input Error: 9.8
Output Error: 0.8
Log:
Profile: 🕒
\(\begin{cases} \left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{\frac{\frac{2}{x}}{x}}{x} & \text{when } x \le -0.10661750545102926 \\ \left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1} & \text{when } x \le 5.107891217442523 \cdot 10^{+18} \\ \left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{\frac{\frac{2}{x}}{x}}{x} & \text{otherwise} \end{cases}\)

    if x < -0.10661750545102926 or 5.107891217442523e+18 < x

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      18.5
    2. Using strategy rm
      18.5
    3. Applied add-exp-log to get
      \[\color{red}{\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}} \leadsto \color{blue}{e^{\log \left(\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\right)}}\]
      19.0
    4. Applied taylor to get
      \[e^{\log \left(\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\right)} \leadsto e^{\log \left(2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)\right)}\]
      12.0
    5. Taylor expanded around inf to get
      \[e^{\log \color{red}{\left(2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)\right)}} \leadsto e^{\log \color{blue}{\left(2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)\right)}}\]
      12.0
    6. Applied simplify to get
      \[\color{red}{e^{\log \left(2 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{{x}^{7}} + 2 \cdot \frac{1}{{x}^{3}}\right)\right)}} \leadsto \color{blue}{\left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{\frac{2}{x}}{x \cdot x}}\]
      0.1
    7. Using strategy rm
      0.1
    8. Applied associate-/r* to get
      \[\left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \color{red}{\frac{\frac{2}{x}}{x \cdot x}} \leadsto \left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \color{blue}{\frac{\frac{\frac{2}{x}}{x}}{x}}\]
      0.1

    if -0.10661750545102926 < x < 5.107891217442523e+18

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