Average Error: 0.0 → 0.0
Time: 10.5s
Precision: 64
$\cos \left(\left(\cos^{-1} a - \cos^{-1} b\right) \cdot 0.5\right)$
$\cos \left(\left(\cos^{-1} a - \cos^{-1} b\right) \cdot 0.5\right)$
\cos \left(\left(\cos^{-1} a - \cos^{-1} b\right) \cdot 0.5\right)
\cos \left(\left(\cos^{-1} a - \cos^{-1} b\right) \cdot 0.5\right)
double f(double a, double b) {
double r21238 = a;
double r21239 = acos(r21238);
double r21240 = b;
double r21241 = acos(r21240);
double r21242 = r21239 - r21241;
double r21243 = 0.5;
double r21244 = r21242 * r21243;
double r21245 = cos(r21244);
return r21245;
}


double f(double a, double b) {
double r21246 = a;
double r21247 = acos(r21246);
double r21248 = b;
double r21249 = acos(r21248);
double r21250 = r21247 - r21249;
double r21251 = 0.5;
double r21252 = r21250 * r21251;
double r21253 = cos(r21252);
return r21253;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\cos \left(\left(\cos^{-1} a - \cos^{-1} b\right) \cdot 0.5\right)$
2. Final simplification0.0

$\leadsto \cos \left(\left(\cos^{-1} a - \cos^{-1} b\right) \cdot 0.5\right)$

# Reproduce

herbie shell --seed 1
(FPCore (a b)
:name "cos((acos(a) - acos(b)) * 0.5)"
:precision binary64
(cos (* (- (acos a) (acos b)) 0.5)))