Average Error: 4.3 → 2.3
Time: 19.8s
Precision: 64
$0.001000000047497451305389404296875 \le \left|pR\right| \le 10^{3}$
$\frac{a}{{pR}^{2}} \cdot \left(\cos \left(p0 + pR \cdot t\right) - \cos p0\right)$
$\frac{a}{{pR}^{2}} \cdot \left(-2 \cdot \left(\sin \left(\frac{\left(p0 + pR \cdot t\right) + p0}{2}\right) \cdot \sin \left(\frac{pR \cdot t}{2}\right)\right)\right)$
\frac{a}{{pR}^{2}} \cdot \left(\cos \left(p0 + pR \cdot t\right) - \cos p0\right)
\frac{a}{{pR}^{2}} \cdot \left(-2 \cdot \left(\sin \left(\frac{\left(p0 + pR \cdot t\right) + p0}{2}\right) \cdot \sin \left(\frac{pR \cdot t}{2}\right)\right)\right)
double f(double a, double pR, double p0, double t) {
double r2235207 = a;
double r2235208 = pR;
double r2235209 = 2.0;
double r2235210 = pow(r2235208, r2235209);
double r2235211 = r2235207 / r2235210;
double r2235212 = p0;
double r2235213 = t;
double r2235214 = r2235208 * r2235213;
double r2235215 = r2235212 + r2235214;
double r2235216 = cos(r2235215);
double r2235217 = cos(r2235212);
double r2235218 = r2235216 - r2235217;
double r2235219 = r2235211 * r2235218;
return r2235219;
}


double f(double a, double pR, double p0, double t) {
double r2235220 = a;
double r2235221 = pR;
double r2235222 = 2.0;
double r2235223 = pow(r2235221, r2235222);
double r2235224 = r2235220 / r2235223;
double r2235225 = -2.0;
double r2235226 = p0;
double r2235227 = t;
double r2235228 = r2235221 * r2235227;
double r2235229 = r2235226 + r2235228;
double r2235230 = r2235229 + r2235226;
double r2235231 = 2.0;
double r2235232 = r2235230 / r2235231;
double r2235233 = sin(r2235232);
double r2235234 = r2235228 / r2235231;
double r2235235 = sin(r2235234);
double r2235236 = r2235233 * r2235235;
double r2235237 = r2235225 * r2235236;
double r2235238 = r2235224 * r2235237;
return r2235238;
}



# Try it out

Your Program's Arguments

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 4.3

$\frac{a}{{pR}^{2}} \cdot \left(\cos \left(p0 + pR \cdot t\right) - \cos p0\right)$
2. Using strategy rm
3. Applied diff-cos3.9

$\leadsto \frac{a}{{pR}^{2}} \cdot \color{blue}{\left(-2 \cdot \left(\sin \left(\frac{\left(p0 + pR \cdot t\right) - p0}{2}\right) \cdot \sin \left(\frac{\left(p0 + pR \cdot t\right) + p0}{2}\right)\right)\right)}$
4. Simplified2.3

$\leadsto \frac{a}{{pR}^{2}} \cdot \left(-2 \cdot \color{blue}{\left(\sin \left(\frac{\left(p0 + pR \cdot t\right) + p0}{2}\right) \cdot \sin \left(\frac{pR \cdot t}{2}\right)\right)}\right)$
5. Final simplification2.3

$\leadsto \frac{a}{{pR}^{2}} \cdot \left(-2 \cdot \left(\sin \left(\frac{\left(p0 + pR \cdot t\right) + p0}{2}\right) \cdot \sin \left(\frac{pR \cdot t}{2}\right)\right)\right)$

# Reproduce

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