Average Error: 15.3 → 0.4
Time: 22.7s
Precision: 64
\[r \cdot \frac{\sin b}{\cos \left(a + b\right)}\]
\[r \cdot \left(\frac{\sin b}{\left(\left(\cos b \cdot \cos a\right) \cdot \left(\cos b \cdot \cos a\right)\right) \cdot \left(\cos b \cdot \cos a\right) - \left(\sin b \cdot \sin a\right) \cdot \left(\left(\sin b \cdot \sin a\right) \cdot \left(\sin b \cdot \sin a\right)\right)} \cdot \left(\left(\left(\cos b \cdot \cos a\right) \cdot \left(\sin b \cdot \sin a\right) + \left(\sin b \cdot \sin a\right) \cdot \left(\sin b \cdot \sin a\right)\right) + \left(\cos b \cdot \cos a\right) \cdot \left(\cos b \cdot \cos a\right)\right)\right)\]
r \cdot \frac{\sin b}{\cos \left(a + b\right)}
r \cdot \left(\frac{\sin b}{\left(\left(\cos b \cdot \cos a\right) \cdot \left(\cos b \cdot \cos a\right)\right) \cdot \left(\cos b \cdot \cos a\right) - \left(\sin b \cdot \sin a\right) \cdot \left(\left(\sin b \cdot \sin a\right) \cdot \left(\sin b \cdot \sin a\right)\right)} \cdot \left(\left(\left(\cos b \cdot \cos a\right) \cdot \left(\sin b \cdot \sin a\right) + \left(\sin b \cdot \sin a\right) \cdot \left(\sin b \cdot \sin a\right)\right) + \left(\cos b \cdot \cos a\right) \cdot \left(\cos b \cdot \cos a\right)\right)\right)
double f(double r, double a, double b) {
        double r393080 = r;
        double r393081 = b;
        double r393082 = sin(r393081);
        double r393083 = a;
        double r393084 = r393083 + r393081;
        double r393085 = cos(r393084);
        double r393086 = r393082 / r393085;
        double r393087 = r393080 * r393086;
        return r393087;
}

double f(double r, double a, double b) {
        double r393088 = r;
        double r393089 = b;
        double r393090 = sin(r393089);
        double r393091 = cos(r393089);
        double r393092 = a;
        double r393093 = cos(r393092);
        double r393094 = r393091 * r393093;
        double r393095 = r393094 * r393094;
        double r393096 = r393095 * r393094;
        double r393097 = sin(r393092);
        double r393098 = r393090 * r393097;
        double r393099 = r393098 * r393098;
        double r393100 = r393098 * r393099;
        double r393101 = r393096 - r393100;
        double r393102 = r393090 / r393101;
        double r393103 = r393094 * r393098;
        double r393104 = r393103 + r393099;
        double r393105 = r393104 + r393095;
        double r393106 = r393102 * r393105;
        double r393107 = r393088 * r393106;
        return r393107;
}

Error

Bits error versus r

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.3

    \[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. Using strategy rm
  5. Applied flip3--0.4

    \[\leadsto r \cdot \frac{\sin b}{\color{blue}{\frac{{\left(\cos a \cdot \cos b\right)}^{3} - {\left(\sin a \cdot \sin b\right)}^{3}}{\left(\cos a \cdot \cos b\right) \cdot \left(\cos a \cdot \cos b\right) + \left(\left(\sin a \cdot \sin b\right) \cdot \left(\sin a \cdot \sin b\right) + \left(\cos a \cdot \cos b\right) \cdot \left(\sin a \cdot \sin b\right)\right)}}}\]
  6. Applied associate-/r/0.4

    \[\leadsto r \cdot \color{blue}{\left(\frac{\sin b}{{\left(\cos a \cdot \cos b\right)}^{3} - {\left(\sin a \cdot \sin b\right)}^{3}} \cdot \left(\left(\cos a \cdot \cos b\right) \cdot \left(\cos a \cdot \cos b\right) + \left(\left(\sin a \cdot \sin b\right) \cdot \left(\sin a \cdot \sin b\right) + \left(\cos a \cdot \cos b\right) \cdot \left(\sin a \cdot \sin b\right)\right)\right)\right)}\]
  7. Simplified0.4

    \[\leadsto r \cdot \left(\color{blue}{\frac{\sin b}{\left(\left(\cos b \cdot \cos a\right) \cdot \left(\cos b \cdot \cos a\right)\right) \cdot \left(\cos b \cdot \cos a\right) - \left(\sin b \cdot \sin a\right) \cdot \left(\left(\sin b \cdot \sin a\right) \cdot \left(\sin b \cdot \sin a\right)\right)}} \cdot \left(\left(\cos a \cdot \cos b\right) \cdot \left(\cos a \cdot \cos b\right) + \left(\left(\sin a \cdot \sin b\right) \cdot \left(\sin a \cdot \sin b\right) + \left(\cos a \cdot \cos b\right) \cdot \left(\sin a \cdot \sin b\right)\right)\right)\right)\]
  8. Final simplification0.4

    \[\leadsto r \cdot \left(\frac{\sin b}{\left(\left(\cos b \cdot \cos a\right) \cdot \left(\cos b \cdot \cos a\right)\right) \cdot \left(\cos b \cdot \cos a\right) - \left(\sin b \cdot \sin a\right) \cdot \left(\left(\sin b \cdot \sin a\right) \cdot \left(\sin b \cdot \sin a\right)\right)} \cdot \left(\left(\left(\cos b \cdot \cos a\right) \cdot \left(\sin b \cdot \sin a\right) + \left(\sin b \cdot \sin a\right) \cdot \left(\sin b \cdot \sin a\right)\right) + \left(\cos b \cdot \cos a\right) \cdot \left(\cos b \cdot \cos a\right)\right)\right)\]

Reproduce

herbie shell --seed 2019128 +o rules:numerics
(FPCore (r a b)
  :name "r*sin(b)/cos(a+b), B"
  (* r (/ (sin b) (cos (+ a b)))))