\[\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.8 s
Input Error: 4.2
Output Error: 0.5
Log:
Profile: 🕒
\(\begin{cases} \left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3} & \text{when } x \le -0.78645045f0 \\ \left({\left(\sqrt[3]{\frac{1}{x + 1}}\right)}^3 - \frac{2}{x}\right) + \frac{1}{x - 1} & \text{when } x \le 321.24472f0 \\ \left(\frac{2}{{x}^{5}} + \frac{2}{{x}^{7}}\right) + \frac{2}{{x}^3} & \text{otherwise} \end{cases}\)

    if x < -0.78645045f0 or 321.24472f0 < x

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

    if -0.78645045f0 < x < 321.24472f0

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

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