\[\frac{1 - \cos x}{{x}^2}\]
Test:
NMSE problem 3.4.1
Bits:
128 bits
Bits error versus x
Time: 8.2 s
Input Error: 14.6
Output Error: 0.3
Log:
Profile: 🕒
\(\begin{cases} {\left(\frac{\sqrt{1 - \cos x}}{x}\right)}^2 & \text{when } x \le -0.34971526f0 \\ \left(\frac{1}{720} \cdot {x}^{4} + \frac{1}{2}\right) - \frac{1}{24} \cdot {x}^2 & \text{when } x \le 0.440316f0 \\ {\left(\frac{\sqrt{1 - \cos x}}{x}\right)}^2 & \text{otherwise} \end{cases}\)

    if x < -0.34971526f0 or 0.440316f0 < x

    1. Started with
      \[\frac{1 - \cos x}{{x}^2}\]
      1.3
    2. Using strategy rm
      1.3
    3. Applied add-sqr-sqrt to get
      \[\frac{\color{red}{1 - \cos x}}{{x}^2} \leadsto \frac{\color{blue}{{\left(\sqrt{1 - \cos x}\right)}^2}}{{x}^2}\]
      1.4
    4. Applied square-undiv to get
      \[\color{red}{\frac{{\left(\sqrt{1 - \cos x}\right)}^2}{{x}^2}} \leadsto \color{blue}{{\left(\frac{\sqrt{1 - \cos x}}{x}\right)}^2}\]
      0.5

    if -0.34971526f0 < x < 0.440316f0

    1. Started with
      \[\frac{1 - \cos x}{{x}^2}\]
      28.4
    2. Applied taylor to get
      \[\frac{1 - \cos x}{{x}^2} \leadsto \left(\frac{1}{720} \cdot {x}^{4} + \frac{1}{2}\right) - \frac{1}{24} \cdot {x}^2\]
      0
    3. Taylor expanded around 0 to get
      \[\color{red}{\left(\frac{1}{720} \cdot {x}^{4} + \frac{1}{2}\right) - \frac{1}{24} \cdot {x}^2} \leadsto \color{blue}{\left(\frac{1}{720} \cdot {x}^{4} + \frac{1}{2}\right) - \frac{1}{24} \cdot {x}^2}\]
      0

  1. Removed slow pow expressions

Original test:


(lambda ((x default))
  #:name "NMSE problem 3.4.1"
  (/ (- 1 (cos x)) (sqr x)))