Average Error: 15.0 → 0.3
Time: 26.4s
Precision: 64
$r \cdot \frac{\sin b}{\cos \left(a + b\right)}$
$\frac{r \cdot \sin b}{\cos a \cdot \cos b - \sin a \cdot \sin b}$
r \cdot \frac{\sin b}{\cos \left(a + b\right)}
\frac{r \cdot \sin b}{\cos a \cdot \cos b - \sin a \cdot \sin b}
double f(double r, double b, double a) {
double r48896878 = r;
double r48896879 = b;
double r48896880 = sin(r48896879);
double r48896881 = a;
double r48896882 = r48896881 + r48896879;
double r48896883 = cos(r48896882);
double r48896884 = r48896880 / r48896883;
double r48896885 = r48896878 * r48896884;
return r48896885;
}


double f(double r, double b, double a) {
double r48896886 = r;
double r48896887 = b;
double r48896888 = sin(r48896887);
double r48896889 = r48896886 * r48896888;
double r48896890 = a;
double r48896891 = cos(r48896890);
double r48896892 = cos(r48896887);
double r48896893 = r48896891 * r48896892;
double r48896894 = sin(r48896890);
double r48896895 = r48896894 * r48896888;
double r48896896 = r48896893 - r48896895;
double r48896897 = r48896889 / r48896896;
return r48896897;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 15.0

$r \cdot \frac{\sin b}{\cos \left(a + b\right)}$
2. Using strategy rm
3. Applied cos-sum0.3

$\leadsto r \cdot \frac{\sin b}{\color{blue}{\cos a \cdot \cos b - \sin a \cdot \sin b}}$
4. Taylor expanded around inf 0.3

$\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin a \cdot \sin b}}$
5. Final simplification0.3

$\leadsto \frac{r \cdot \sin b}{\cos a \cdot \cos b - \sin a \cdot \sin b}$

# Reproduce

herbie shell --seed 1
(FPCore (r b a)
:name "r * (sin(b) / cos(a+b))"
(* r (/ (sin b) (cos (+ a b)))))