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

    if x < -3.2784791869173944e-06

    1. Started with
      \[\frac{1 - \cos x}{{x}^2}\]
      1.2
    2. Using strategy rm
      1.2
    3. Applied flip-- to get
      \[\frac{\color{red}{1 - \cos x}}{{x}^2} \leadsto \frac{\color{blue}{\frac{{1}^2 - {\left(\cos x\right)}^2}{1 + \cos x}}}{{x}^2}\]
      1.4
    4. Applied simplify to get
      \[\frac{\frac{\color{red}{{1}^2 - {\left(\cos x\right)}^2}}{1 + \cos x}}{{x}^2} \leadsto \frac{\frac{\color{blue}{{\left(\sin x\right)}^2}}{1 + \cos x}}{{x}^2}\]
      1.0
    5. Using strategy rm
      1.0
    6. Applied add-sqr-sqrt to get
      \[\frac{\color{red}{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}}{{x}^2} \leadsto \frac{\color{blue}{{\left(\sqrt{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}\right)}^2}}{{x}^2}\]
      1.1
    7. Applied square-undiv to get
      \[\color{red}{\frac{{\left(\sqrt{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}\right)}^2}{{x}^2}} \leadsto \color{blue}{{\left(\frac{\sqrt{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}}{x}\right)}^2}\]
      0.6

    if -3.2784791869173944e-06 < x < 501837.3637557024

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

    if 501837.3637557024 < x

    1. Started with
      \[\frac{1 - \cos x}{{x}^2}\]
      1.2
    2. Using strategy rm
      1.2
    3. Applied flip-- to get
      \[\frac{\color{red}{1 - \cos x}}{{x}^2} \leadsto \frac{\color{blue}{\frac{{1}^2 - {\left(\cos x\right)}^2}{1 + \cos x}}}{{x}^2}\]
      1.4
    4. Applied simplify to get
      \[\frac{\frac{\color{red}{{1}^2 - {\left(\cos x\right)}^2}}{1 + \cos x}}{{x}^2} \leadsto \frac{\frac{\color{blue}{{\left(\sin x\right)}^2}}{1 + \cos x}}{{x}^2}\]
      1.2
    5. Using strategy rm
      1.2
    6. Applied square-mult to get
      \[\frac{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}{\color{red}{{x}^2}} \leadsto \frac{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}{\color{blue}{x \cdot x}}\]
      1.2
    7. Applied associate-/r* to get
      \[\color{red}{\frac{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}{x \cdot x}} \leadsto \color{blue}{\frac{\frac{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}{x}}{x}}\]
      0.5

  1. Removed slow pow expressions

Original test:


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