Average Error: 14.8 → 0.4
Time: 30.3s
Precision: 64
Internal Precision: 128
\[r \cdot \frac{\sin b}{\cos \left(a + b\right)}\]
\[\frac{r \cdot \sin b}{\log_* (1 + (e^{(\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 14.8

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

    \[\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 log1p-expm1-u0.4

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\log_* (1 + (e^{(\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}{\log_* (1 + (e^{(\left(\cos b\right) \cdot \left(\cos a\right) + \left(\left(-\sin b\right) \cdot \sin a\right))_*} - 1)^*)}\]

Runtime

Time bar (total: 30.3s)Debug logProfile

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