\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
Test:
NMSE example 3.6
Bits:
128 bits
Bits error versus x
Time: 11.3 s
Input Error: 8.4
Output Error: 3.0
Log:
Profile: 🕒
\(\begin{cases} \frac{1 \cdot \left(1 + x\right) - x \cdot 1}{\left(\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}\right) \cdot \left(x \cdot \left(1 + x\right)\right)} & \text{when } x \le 12176675.0f0 \\ \frac{\left(\frac{1}{{x}^2} + \frac{1}{{x}^{4}}\right) - \frac{1}{{x}^{3}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} & \text{otherwise} \end{cases}\)

    if x < 12176675.0f0

    1. Started with
      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
      1.9
    2. Using strategy rm
      1.9
    3. Applied flip-- to get
      \[\color{red}{\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}} \leadsto \color{blue}{\frac{{\left(\frac{1}{\sqrt{x}}\right)}^2 - {\left(\frac{1}{\sqrt{x + 1}}\right)}^2}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}}\]
      1.9
    4. Applied simplify to get
      \[\frac{\color{red}{{\left(\frac{1}{\sqrt{x}}\right)}^2 - {\left(\frac{1}{\sqrt{x + 1}}\right)}^2}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \leadsto \frac{\color{blue}{\frac{1}{x} - \frac{1}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}\]
      1.9
    5. Using strategy rm
      1.9
    6. Applied frac-sub to get
      \[\frac{\color{red}{\frac{1}{x} - \frac{1}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \leadsto \frac{\color{blue}{\frac{1 \cdot \left(1 + x\right) - x \cdot 1}{x \cdot \left(1 + x\right)}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}\]
      0.4
    7. Applied associate-/l/ to get
      \[\color{red}{\frac{\frac{1 \cdot \left(1 + x\right) - x \cdot 1}{x \cdot \left(1 + x\right)}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}} \leadsto \color{blue}{\frac{1 \cdot \left(1 + x\right) - x \cdot 1}{\left(\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}\right) \cdot \left(x \cdot \left(1 + x\right)\right)}}\]
      0.3

    if 12176675.0f0 < x

    1. Started with
      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
      17.8
    2. Using strategy rm
      17.8
    3. Applied flip-- to get
      \[\color{red}{\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}} \leadsto \color{blue}{\frac{{\left(\frac{1}{\sqrt{x}}\right)}^2 - {\left(\frac{1}{\sqrt{x + 1}}\right)}^2}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}}\]
      17.8
    4. Applied simplify to get
      \[\frac{\color{red}{{\left(\frac{1}{\sqrt{x}}\right)}^2 - {\left(\frac{1}{\sqrt{x + 1}}\right)}^2}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \leadsto \frac{\color{blue}{\frac{1}{x} - \frac{1}{1 + x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}\]
      17.8
    5. Applied taylor to get
      \[\frac{\frac{1}{x} - \frac{1}{1 + x}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \leadsto \frac{\left(\frac{1}{{x}^2} + \frac{1}{{x}^{4}}\right) - \frac{1}{{x}^{3}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}\]
      6.9
    6. Taylor expanded around inf to get
      \[\frac{\color{red}{\left(\frac{1}{{x}^2} + \frac{1}{{x}^{4}}\right) - \frac{1}{{x}^{3}}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}} \leadsto \frac{\color{blue}{\left(\frac{1}{{x}^2} + \frac{1}{{x}^{4}}\right) - \frac{1}{{x}^{3}}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}\]
      6.9

  1. Removed slow pow expressions

Original test:


(lambda ((x default))
  #:name "NMSE example 3.6"
  (- (/ 1 (sqrt x)) (/ 1 (sqrt (+ x 1))))
  #:target
  (/ 1 (+ (* (+ x 1) (sqrt x)) (* x (sqrt (+ x 1))))))