\[\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.9 s
Input Error: 4.1
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.6975026f0 \\ \left({\left(\sqrt{\frac{1}{x + 1}}\right)}^2 - \frac{2}{x}\right) + \frac{1}{x - 1} & \text{when } x \le 22.159796f0 \\ \left(\frac{2}{{x}^{7}} + \frac{\frac{2}{x}}{x \cdot x}\right) + \frac{2}{{x}^{5}} & \text{otherwise} \end{cases}\)

    if x < -1.6975026f0 or 22.159796f0 < x

    1. Started with
      \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
      8.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.7
    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.7
    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.8
    5. Using strategy rm
      0.8
    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.8
    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.6975026f0 < x < 22.159796f0

    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 add-sqr-sqrt to get
      \[\left(\color{red}{\frac{1}{x + 1}} - \frac{2}{x}\right) + \frac{1}{x - 1} \leadsto \left(\color{blue}{{\left(\sqrt{\frac{1}{x + 1}}\right)}^2} - \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))))