Error: 31.9 → 0.5
Time: 32.5s
Precision: 64
Ground Truth: 128
\[\frac{1 - \cos x}{{x}^2}\]
\[\begin{cases} \frac{\sin x}{1} \cdot \frac{\frac{\sin x}{1 + \cos x}}{{x}^2} & \text{when } x \le -1.8773586721409905 \cdot 10^{-08} \\ \left(\frac{1}{720} \cdot {x}^{4} + \frac{1}{2}\right) - \frac{1}{24} \cdot {x}^2 & \text{when } x \le 108678362595.63406 \\ \frac{\sin x}{1} \cdot \frac{\frac{\sin x}{1 + \cos x}}{{x}^2} & \text{otherwise} \end{cases}\]

Error

Bits error versus x

Derivation

    if x < -1.8773586721409905e-08 or 108678362595.63406 < x

    1. Initial program 1.4

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

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

      \[\leadsto \frac{\frac{\color{blue}{\sin x \cdot \sin x}}{1 + \cos x}}{{x}^2}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity 1.1

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

      \[\leadsto \frac{\frac{\sin x \cdot \sin x}{\color{blue}{1 \cdot \left(1 + \cos x\right)}}}{1 \cdot {x}^2}\]
    8. Applied times-frac 1.1

      \[\leadsto \frac{\color{blue}{\frac{\sin x}{1} \cdot \frac{\sin x}{1 + \cos x}}}{1 \cdot {x}^2}\]
    9. Applied times-frac 1.1

      \[\leadsto \color{blue}{\frac{\frac{\sin x}{1}}{1} \cdot \frac{\frac{\sin x}{1 + \cos x}}{{x}^2}}\]
    10. Applied simplify 1.1

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

    if -1.8773586721409905e-08 < x < 108678362595.63406

    1. Initial program 61.5

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

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

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

Runtime

Total time: 32.5s Debug log

Please report a bug with the following info:

herbie --seed '#(2392692419 2980109941 1597978070 756077822 3260956253 366005631)'
(FPCore (x)
  :name "NMSE problem 3.4.1"
  (/ (- 1 (cos x)) (sqr x)))