Average Error: 30.5 → 0.4
Time: 38.2s
Precision: 64
Internal Precision: 128
\[\frac{1 - \cos x}{x \cdot x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.03197219319152313 \lor \neg \left(x \le 0.033272800969350896\right):\\ \;\;\;\;\frac{\sqrt[3]{1 - \cos x}}{x} \cdot \frac{\sqrt[3]{1 - \cos x} \cdot \sqrt[3]{1 - \cos x}}{x}\\ \mathbf{else}:\\ \;\;\;\;(\frac{1}{720} \cdot \left({x}^{4}\right) + \left((\left(x \cdot \frac{-1}{24}\right) \cdot x + \frac{1}{2})_*\right))_*\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -0.03197219319152313 or 0.033272800969350896 < x

    1. Initial program 1.0

      \[\frac{1 - \cos x}{x \cdot x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt1.4

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1 - \cos x} \cdot \sqrt[3]{1 - \cos x}\right) \cdot \sqrt[3]{1 - \cos x}}}{x \cdot x}\]
    4. Applied times-frac0.8

      \[\leadsto \color{blue}{\frac{\sqrt[3]{1 - \cos x} \cdot \sqrt[3]{1 - \cos x}}{x} \cdot \frac{\sqrt[3]{1 - \cos x}}{x}}\]

    if -0.03197219319152313 < x < 0.033272800969350896

    1. Initial program 61.4

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

      \[\leadsto \frac{\color{blue}{\frac{1 \cdot 1 - \cos x \cdot \cos x}{1 + \cos x}}}{x \cdot x}\]
    4. Applied associate-/l/61.4

      \[\leadsto \color{blue}{\frac{1 \cdot 1 - \cos x \cdot \cos x}{\left(x \cdot x\right) \cdot \left(1 + \cos x\right)}}\]
    5. Simplified30.4

      \[\leadsto \frac{\color{blue}{\sin x \cdot \sin x}}{\left(x \cdot x\right) \cdot \left(1 + \cos x\right)}\]
    6. Using strategy rm
    7. Applied associate-/r*30.4

      \[\leadsto \color{blue}{\frac{\frac{\sin x \cdot \sin x}{x \cdot x}}{1 + \cos x}}\]
    8. 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}}\]
    9. Simplified0.0

      \[\leadsto \color{blue}{(\frac{1}{720} \cdot \left({x}^{4}\right) + \left((\left(x \cdot \frac{-1}{24}\right) \cdot x + \frac{1}{2})_*\right))_*}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.03197219319152313 \lor \neg \left(x \le 0.033272800969350896\right):\\ \;\;\;\;\frac{\sqrt[3]{1 - \cos x}}{x} \cdot \frac{\sqrt[3]{1 - \cos x} \cdot \sqrt[3]{1 - \cos x}}{x}\\ \mathbf{else}:\\ \;\;\;\;(\frac{1}{720} \cdot \left({x}^{4}\right) + \left((\left(x \cdot \frac{-1}{24}\right) \cdot x + \frac{1}{2})_*\right))_*\\ \end{array}\]

Runtime

Time bar (total: 38.2s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes15.40.40.015.497.4%
herbie shell --seed 2018353 +o rules:numerics
(FPCore (x)
  :name "cos2 (problem 3.4.1)"
  (/ (- 1 (cos x)) (* x x)))