Average Error: 11.2 → 3.4
Time: 16.9s
Precision: 64
\[\frac{a}{{pR}^{2}} \cdot \left(\cos \left(p0 + pR \cdot t\right) - \cos p0\right)\]
\[0\]
\frac{a}{{pR}^{2}} \cdot \left(\cos \left(p0 + pR \cdot t\right) - \cos p0\right)
0
double f(double a, double pR, double p0, double t) {
        double r3160311 = a;
        double r3160312 = pR;
        double r3160313 = 2.0;
        double r3160314 = pow(r3160312, r3160313);
        double r3160315 = r3160311 / r3160314;
        double r3160316 = p0;
        double r3160317 = t;
        double r3160318 = r3160312 * r3160317;
        double r3160319 = r3160316 + r3160318;
        double r3160320 = cos(r3160319);
        double r3160321 = cos(r3160316);
        double r3160322 = r3160320 - r3160321;
        double r3160323 = r3160315 * r3160322;
        return r3160323;
}

double f(double __attribute__((unused)) a, double __attribute__((unused)) pR, double __attribute__((unused)) p0, double __attribute__((unused)) t) {
        double r3160324 = 0.0;
        return r3160324;
}

Error

Bits error versus a

Bits error versus pR

Bits error versus p0

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 11.2

    \[\frac{a}{{pR}^{2}} \cdot \left(\cos \left(p0 + pR \cdot t\right) - \cos p0\right)\]
  2. Taylor expanded around 0 3.4

    \[\leadsto \color{blue}{0}\]
  3. Final simplification3.4

    \[\leadsto 0\]

Reproduce

herbie shell --seed 1 
(FPCore (a pR p0 t)
  :name "a/pR^2 * (cos(p0 + pR*t) - cos(p0))"
  :precision binary32
  (* (/ a (pow pR 2)) (- (cos (+ p0 (* pR t))) (cos p0))))