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

    if x < -0.059066683f0 or 1.2336446f0 < x

    1. Started with
      \[\frac{1 - \cos x}{{x}^2}\]
      1.3
    2. Using strategy rm
      1.3
    3. Applied square-mult to get
      \[\frac{1 - \cos x}{\color{red}{{x}^2}} \leadsto \frac{1 - \cos x}{\color{blue}{x \cdot x}}\]
      1.3
    4. Applied associate-/r* to get
      \[\color{red}{\frac{1 - \cos x}{x \cdot x}} \leadsto \color{blue}{\frac{\frac{1 - \cos x}{x}}{x}}\]
      0.4

    if -0.059066683f0 < x < 1.2336446f0

    1. Started with
      \[\frac{1 - \cos x}{{x}^2}\]
      28.5
    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.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.0

  1. Removed slow pow expressions

Original test:


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