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

    if x < 139.71252f0

    1. Started with
      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
      0.4
    2. Using strategy rm
      0.4
    3. Applied add-exp-log to get
      \[\frac{1}{\sqrt{x}} - \frac{1}{\color{red}{\sqrt{x + 1}}} \leadsto \frac{1}{\sqrt{x}} - \frac{1}{\color{blue}{e^{\log \left(\sqrt{x + 1}\right)}}}\]
      0.4
    4. Applied rec-exp to get
      \[\frac{1}{\sqrt{x}} - \color{red}{\frac{1}{e^{\log \left(\sqrt{x + 1}\right)}}} \leadsto \frac{1}{\sqrt{x}} - \color{blue}{e^{-\log \left(\sqrt{x + 1}\right)}}\]
      0.4

    if 139.71252f0 < x

    1. Started with
      \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
      17.3
    2. Using strategy rm
      17.3
    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.3
    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.1
    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}}}\]
      5.8
    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}}}\]
      5.8
    7. Applied simplify to get
      \[\frac{\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{\left(\frac{1}{{x}^{4}} + \frac{\frac{1}{x}}{x}\right) - \frac{1}{{x}^3}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{1 + x}}}\]
      4.4

    8. Applied final simplification

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