Average Error: 14.7 → 0.4
Time: 34.4s
Precision: 64
Internal Precision: 128
\[r \cdot \frac{\sin b}{\cos \left(a + b\right)}\]
\[\frac{r}{(\left(\frac{\cos a}{\sin b}\right) \cdot \left(\cos b\right) + \left(-\sin a\right))_*}\]

Error

Bits error versus r

Bits error versus a

Bits error versus b

Derivation

  1. Initial program 14.7

    \[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{\sin b \cdot r}{\cos a \cdot \cos b - \sin a \cdot \sin b}}\]
  5. Simplified0.4

    \[\leadsto \color{blue}{\frac{r}{\frac{\cos a}{\sin b} \cdot \cos b - \sin a}}\]
  6. Using strategy rm
  7. Applied fma-neg0.4

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

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

Reproduce

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