Average Error: 54.0 → 0.1
Time: 32.3s
Precision: 64
Internal Precision: 4416
\[\frac{\left(a \cdot a + 2 \cdot \cos a\right) - 2}{\left(\left(\left(2 \cdot a\right) \cdot a\right) \cdot a\right) \cdot a}\]
\[\begin{array}{l} \mathbf{if}\;a \le -0.10855796127936836 \lor \neg \left(a \le 0.11455721367218925\right):\\ \;\;\;\;\frac{\frac{\frac{1}{2}}{a}}{a} - \left(\frac{1}{{a}^{4}} - \frac{\cos a}{{a}^{4}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{40320} \cdot {a}^{4} + \frac{1}{24}\right) - {a}^{2} \cdot \frac{1}{720}\\ \end{array}\]

Error

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if a < -0.10855796127936836 or 0.11455721367218925 < a

    1. Initial program 46.3

      \[\frac{\left(a \cdot a + 2 \cdot \cos a\right) - 2}{\left(\left(\left(2 \cdot a\right) \cdot a\right) \cdot a\right) \cdot a}\]
    2. Initial simplification46.3

      \[\leadsto \frac{\left(\cos a - 1\right) + \frac{a \cdot a}{2}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\]
    3. Taylor expanded around inf 0.7

      \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{{a}^{2}} + \frac{\cos a}{{a}^{4}}\right) - \frac{1}{{a}^{4}}}\]
    4. Simplified0.1

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{2}}{a}}{a} - \left(\frac{1}{{a}^{4}} - \frac{\cos a}{{a}^{4}}\right)}\]

    if -0.10855796127936836 < a < 0.11455721367218925

    1. Initial program 61.8

      \[\frac{\left(a \cdot a + 2 \cdot \cos a\right) - 2}{\left(\left(\left(2 \cdot a\right) \cdot a\right) \cdot a\right) \cdot a}\]
    2. Initial simplification61.2

      \[\leadsto \frac{\left(\cos a - 1\right) + \frac{a \cdot a}{2}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\]
    3. Taylor expanded around 0 0.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -0.10855796127936836 \lor \neg \left(a \le 0.11455721367218925\right):\\ \;\;\;\;\frac{\frac{\frac{1}{2}}{a}}{a} - \left(\frac{1}{{a}^{4}} - \frac{\cos a}{{a}^{4}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{40320} \cdot {a}^{4} + \frac{1}{24}\right) - {a}^{2} \cdot \frac{1}{720}\\ \end{array}\]

Runtime

Time bar (total: 32.3s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (a)
  :name "(a*a + 2*cos(a) - 2)/(2*a*a*a*a)"
  (/ (- (+ (* a a) (* 2 (cos a))) 2) (* (* (* (* 2 a) a) a) a)))