Average Error: 6.9 → 2.9
Time: 18.5s
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 pR, double t) {
double r1481535 = a;
double r1481536 = pr;
double r1481537 = 2.0;
double r1481538 = pow(r1481536, r1481537);
double r1481539 = r1481535 / r1481538;
double r1481540 = p0;
double r1481541 = pR;
double r1481542 = t;
double r1481543 = r1481541 * r1481542;
double r1481544 = r1481540 + r1481543;
double r1481545 = cos(r1481544);
double r1481546 = cos(r1481540);
double r1481547 = r1481545 - r1481546;
double r1481548 = r1481539 * r1481547;
return r1481548;
}


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



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 6.9

$\frac{a}{{pr}^{2}} \cdot \left(\cos \left(p0 + pR \cdot t\right) - \cos p0\right)$
2. Taylor expanded around 0 2.9

$\leadsto \color{blue}{0}$
3. Final simplification2.9

$\leadsto 0$

# Reproduce

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