Average Error: 10.5 → 2.3
Time: 16.3s
Precision: 64
\[-10^{3} \le a \le 10^{3}\]
\[\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 r524748 = a;
        double r524749 = pR;
        double r524750 = 2.0;
        double r524751 = pow(r524749, r524750);
        double r524752 = r524748 / r524751;
        double r524753 = p0;
        double r524754 = t;
        double r524755 = r524749 * r524754;
        double r524756 = r524753 - r524755;
        double r524757 = cos(r524756);
        double r524758 = cos(r524753);
        double r524759 = r524757 - r524758;
        double r524760 = r524752 * r524759;
        return r524760;
}

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

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 10.5

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

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

    \[\leadsto 0\]

Reproduce

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