Average Error: 15.4 → 0.4
Time: 23.9s
Precision: 64
Internal Precision: 1344
\[r \cdot \frac{\sin b}{\cos \left(a + b\right)}\]
\[\frac{r \cdot \sin b}{(e^{\log_* (1 + (\left(\cos b\right) \cdot \left(\cos a\right) + \left(\left(-\sin b\right) \cdot \sin a\right))_*)} - 1)^*}\]

Error

Bits error versus r

Bits error versus a

Bits error versus b

Derivation

  1. Initial program 15.4

    \[r \cdot \frac{\sin b}{\cos \left(a + b\right)}\]
  2. Initial simplification15.4

    \[\leadsto \frac{r \cdot \sin b}{\cos \left(b + a\right)}\]
  3. Using strategy rm
  4. Applied cos-sum0.3

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

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{(\left(\cos b\right) \cdot \left(\cos a\right) + \left(-\sin b \cdot \sin a\right))_*}}\]
  7. Using strategy rm
  8. Applied expm1-log1p-u0.4

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

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

Runtime

Time bar (total: 23.9s)Debug logProfile

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