Input Error: 31.2b
Output Error: 0.4b
Time: 33.9s
Precision: 64b
Ground Truth: 128b
\[\frac{1 - \cos x}{{x}^2}\]
\[\begin{cases} \frac{1}{x} \cdot \frac{{\left(\sin x\right)}^2}{x \cdot \cos x + x} & \text{when } x \le -7.621017336353511 \cdot 10^{-15} \\ \left(\frac{1}{2} + \frac{1}{720} \cdot {x}^{4}\right) - \frac{1}{24} \cdot {x}^2 & \text{when } x \le 0.4439134345824553 \\ \frac{\frac{\sin x \cdot \sin x}{1 + \cos x}}{{x}^2} & \text{otherwise} \end{cases}\]

Error

Bits error versus x

Derivation

    if x < -7.621017336353511e-15

    1. Initial program 3.3b

      \[\frac{1 - \cos x}{{x}^2}\]
    2. Using strategy rm
    3. Applied flip-- 3.5b

      \[\leadsto \frac{\color{blue}{\frac{{1}^2 - {\left(\cos x\right)}^2}{1 + \cos x}}}{{x}^2}\]
    4. Applied simplify 1.2b

      \[\leadsto \frac{\frac{\color{blue}{\sin x \cdot \sin x}}{1 + \cos x}}{{x}^2}\]
    5. Using strategy rm
    6. Applied square-mult 1.2b

      \[\leadsto \frac{\frac{\sin x \cdot \sin x}{1 + \cos x}}{\color{blue}{x \cdot x}}\]
    7. Applied *-un-lft-identity 1.2b

      \[\leadsto \frac{\color{blue}{1 \cdot \frac{\sin x \cdot \sin x}{1 + \cos x}}}{x \cdot x}\]
    8. Applied times-frac 0.5b

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{\frac{\sin x \cdot \sin x}{1 + \cos x}}{x}}\]
    9. Applied simplify 0.5b

      \[\leadsto \frac{1}{x} \cdot \color{blue}{\frac{{\left(\sin x\right)}^2}{x \cdot \cos x + x}}\]

    if -7.621017336353511e-15 < x < 0.4439134345824553

    1. Initial program 61.7b

      \[\frac{1 - \cos x}{{x}^2}\]
    2. Applied taylor 0.0b

      \[\leadsto \left(\frac{1}{2} + \frac{1}{720} \cdot {x}^{4}\right) - \frac{1}{24} \cdot {x}^2\]
    3. Taylor expanded around 0 0.0b

      \[\leadsto \color{blue}{\left(\frac{1}{2} + \frac{1}{720} \cdot {x}^{4}\right) - \frac{1}{24} \cdot {x}^2}\]

    if 0.4439134345824553 < x

    1. Initial program 1.0b

      \[\frac{1 - \cos x}{{x}^2}\]
    2. Using strategy rm
    3. Applied flip-- 1.2b

      \[\leadsto \frac{\color{blue}{\frac{{1}^2 - {\left(\cos x\right)}^2}{1 + \cos x}}}{{x}^2}\]
    4. Applied simplify 1.1b

      \[\leadsto \frac{\frac{\color{blue}{\sin x \cdot \sin x}}{1 + \cos x}}{{x}^2}\]
  1. Removed slow pow expressions

Runtime

Total time: 33.9s Debug log

herbie --seed '#(3823920687 2130546804 1378687420 2818341529 732645619 212482852)'
(FPCore (x)
  :name "NMSE problem 3.4.1"
  (/ (- 1 (cos x)) (sqr x)))