rsin A (should all be same)

Percentage Accurate: 76.9% → 99.5%
Time: 15.1s
Alternatives: 14
Speedup: TODO×

Specification

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

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Alternative 1?

\[\begin{array}{l} t_0 := \sin b \cdot \sin a\\ \frac{\sin b}{\mathsf{fma}\left(-2, t_0, \mathsf{fma}\left(\cos a, \cos b, t_0\right)\right)} \cdot r \end{array} \]
Derivation
  1. Initial program 76.3%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. associate-*r/76.3%

      \[\leadsto \color{blue}{r \cdot \frac{\sin b}{\cos \left(a + b\right)}} \]
    2. *-commutative76.3%

      \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(a + b\right)} \cdot r} \]
    3. +-commutative76.3%

      \[\leadsto \frac{\sin b}{\cos \color{blue}{\left(b + a\right)}} \cdot r \]
  3. Simplified76.3%

    \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(b + a\right)} \cdot r} \]
  4. Step-by-step derivation
    1. cos-sum99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \cdot r \]
    2. *-un-lft-identity99.5%

      \[\leadsto \frac{\sin b}{\cos b \cdot \cos a - \color{blue}{1 \cdot \left(\sin b \cdot \sin a\right)}} \cdot r \]
    3. *-un-lft-identity99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{1 \cdot \left(\cos b \cdot \cos a\right)} - 1 \cdot \left(\sin b \cdot \sin a\right)} \cdot r \]
    4. prod-diff99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{\mathsf{fma}\left(1, \cos b \cdot \cos a, -\left(\sin b \cdot \sin a\right) \cdot 1\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)}} \cdot r \]
  5. Applied egg-rr99.5%

    \[\leadsto \frac{\sin b}{\color{blue}{\mathsf{fma}\left(1, \cos b \cdot \cos a, -\left(\sin b \cdot \sin a\right) \cdot 1\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)}} \cdot r \]
  6. Step-by-step derivation
    1. *-rgt-identity99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos b \cdot \cos a, -\color{blue}{\sin b \cdot \sin a}\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    2. *-commutative99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \color{blue}{\cos a \cdot \cos b}, -\sin b \cdot \sin a\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    3. distribute-lft-neg-in99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \color{blue}{\left(-\sin b\right) \cdot \sin a}\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    4. *-commutative99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \color{blue}{\sin a \cdot \left(-\sin b\right)}\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    5. fma-udef99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \color{blue}{\left(\left(-\sin b \cdot \sin a\right) \cdot 1 + \left(\sin b \cdot \sin a\right) \cdot 1\right)}} \cdot r \]
    6. *-rgt-identity99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \left(\color{blue}{\left(-\sin b \cdot \sin a\right)} + \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    7. distribute-lft-neg-in99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \left(\color{blue}{\left(-\sin b\right) \cdot \sin a} + \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    8. *-rgt-identity99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \left(\left(-\sin b\right) \cdot \sin a + \color{blue}{\sin b \cdot \sin a}\right)} \cdot r \]
    9. fma-udef99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \color{blue}{\mathsf{fma}\left(-\sin b, \sin a, \sin b \cdot \sin a\right)}} \cdot r \]
    10. *-commutative99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \mathsf{fma}\left(-\sin b, \sin a, \color{blue}{\sin a \cdot \sin b}\right)} \cdot r \]
  7. Simplified99.5%

    \[\leadsto \frac{\sin b}{\color{blue}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \mathsf{fma}\left(-\sin b, \sin a, \sin a \cdot \sin b\right)}} \cdot r \]
  8. Taylor expanded in b around inf 99.5%

    \[\leadsto \color{blue}{\frac{\sin b}{-2 \cdot \left(\sin a \cdot \sin b\right) + \left(\cos a \cdot \cos b + \sin a \cdot \sin b\right)}} \cdot r \]
  9. Step-by-step derivation
    1. fma-def99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{\mathsf{fma}\left(-2, \sin a \cdot \sin b, \cos a \cdot \cos b + \sin a \cdot \sin b\right)}} \cdot r \]
    2. fma-def99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(-2, \sin a \cdot \sin b, \color{blue}{\mathsf{fma}\left(\cos a, \cos b, \sin a \cdot \sin b\right)}\right)} \cdot r \]
  10. Simplified99.5%

    \[\leadsto \color{blue}{\frac{\sin b}{\mathsf{fma}\left(-2, \sin a \cdot \sin b, \mathsf{fma}\left(\cos a, \cos b, \sin a \cdot \sin b\right)\right)}} \cdot r \]
  11. Final simplification99.5%

    \[\leadsto \frac{\sin b}{\mathsf{fma}\left(-2, \sin b \cdot \sin a, \mathsf{fma}\left(\cos a, \cos b, \sin b \cdot \sin a\right)\right)} \cdot r \]

Alternative 2?

\[\frac{\sin b \cdot r}{\mathsf{fma}\left(\cos b, \cos a, \sin b \cdot \left(-\sin a\right)\right)} \]
Derivation
  1. Initial program 76.3%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. +-commutative76.3%

      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
  3. Simplified76.3%

    \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
  4. Step-by-step derivation
    1. cos-sum99.5%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
    2. cancel-sign-sub-inv99.5%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(-\sin b\right) \cdot \sin a}} \]
    3. fma-def99.5%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
  5. Applied egg-rr99.5%

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
  6. Final simplification99.5%

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

Alternative 3?

\[r \cdot \frac{\sin b}{\cos a \cdot \cos b - \sin b \cdot \sin a} \]
Derivation
  1. Initial program 76.3%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. associate-*r/76.3%

      \[\leadsto \color{blue}{r \cdot \frac{\sin b}{\cos \left(a + b\right)}} \]
    2. *-commutative76.3%

      \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(a + b\right)} \cdot r} \]
    3. +-commutative76.3%

      \[\leadsto \frac{\sin b}{\cos \color{blue}{\left(b + a\right)}} \cdot r \]
  3. Simplified76.3%

    \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(b + a\right)} \cdot r} \]
  4. Step-by-step derivation
    1. cos-sum99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \cdot r \]
  5. Applied egg-rr99.5%

    \[\leadsto \frac{\sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \cdot r \]
  6. Final simplification99.5%

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

Alternative 4?

\[r \cdot \frac{\sin b}{-2 \cdot \left(\sin b \cdot \sin a\right) + \cos \left(a - b\right)} \]
Derivation
  1. Initial program 76.3%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. associate-*r/76.3%

      \[\leadsto \color{blue}{r \cdot \frac{\sin b}{\cos \left(a + b\right)}} \]
    2. *-commutative76.3%

      \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(a + b\right)} \cdot r} \]
    3. +-commutative76.3%

      \[\leadsto \frac{\sin b}{\cos \color{blue}{\left(b + a\right)}} \cdot r \]
  3. Simplified76.3%

    \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(b + a\right)} \cdot r} \]
  4. Step-by-step derivation
    1. cos-sum99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \cdot r \]
    2. *-un-lft-identity99.5%

      \[\leadsto \frac{\sin b}{\cos b \cdot \cos a - \color{blue}{1 \cdot \left(\sin b \cdot \sin a\right)}} \cdot r \]
    3. *-un-lft-identity99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{1 \cdot \left(\cos b \cdot \cos a\right)} - 1 \cdot \left(\sin b \cdot \sin a\right)} \cdot r \]
    4. prod-diff99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{\mathsf{fma}\left(1, \cos b \cdot \cos a, -\left(\sin b \cdot \sin a\right) \cdot 1\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)}} \cdot r \]
  5. Applied egg-rr99.5%

    \[\leadsto \frac{\sin b}{\color{blue}{\mathsf{fma}\left(1, \cos b \cdot \cos a, -\left(\sin b \cdot \sin a\right) \cdot 1\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)}} \cdot r \]
  6. Step-by-step derivation
    1. *-rgt-identity99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos b \cdot \cos a, -\color{blue}{\sin b \cdot \sin a}\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    2. *-commutative99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \color{blue}{\cos a \cdot \cos b}, -\sin b \cdot \sin a\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    3. distribute-lft-neg-in99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \color{blue}{\left(-\sin b\right) \cdot \sin a}\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    4. *-commutative99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \color{blue}{\sin a \cdot \left(-\sin b\right)}\right) + \mathsf{fma}\left(-\sin b \cdot \sin a, 1, \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    5. fma-udef99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \color{blue}{\left(\left(-\sin b \cdot \sin a\right) \cdot 1 + \left(\sin b \cdot \sin a\right) \cdot 1\right)}} \cdot r \]
    6. *-rgt-identity99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \left(\color{blue}{\left(-\sin b \cdot \sin a\right)} + \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    7. distribute-lft-neg-in99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \left(\color{blue}{\left(-\sin b\right) \cdot \sin a} + \left(\sin b \cdot \sin a\right) \cdot 1\right)} \cdot r \]
    8. *-rgt-identity99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \left(\left(-\sin b\right) \cdot \sin a + \color{blue}{\sin b \cdot \sin a}\right)} \cdot r \]
    9. fma-udef99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \color{blue}{\mathsf{fma}\left(-\sin b, \sin a, \sin b \cdot \sin a\right)}} \cdot r \]
    10. *-commutative99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \mathsf{fma}\left(-\sin b, \sin a, \color{blue}{\sin a \cdot \sin b}\right)} \cdot r \]
  7. Simplified99.5%

    \[\leadsto \frac{\sin b}{\color{blue}{\mathsf{fma}\left(1, \cos a \cdot \cos b, \sin a \cdot \left(-\sin b\right)\right) + \mathsf{fma}\left(-\sin b, \sin a, \sin a \cdot \sin b\right)}} \cdot r \]
  8. Taylor expanded in b around inf 99.5%

    \[\leadsto \color{blue}{\frac{\sin b}{-2 \cdot \left(\sin a \cdot \sin b\right) + \left(\cos a \cdot \cos b + \sin a \cdot \sin b\right)}} \cdot r \]
  9. Step-by-step derivation
    1. fma-def99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{\mathsf{fma}\left(-2, \sin a \cdot \sin b, \cos a \cdot \cos b + \sin a \cdot \sin b\right)}} \cdot r \]
    2. fma-def99.5%

      \[\leadsto \frac{\sin b}{\mathsf{fma}\left(-2, \sin a \cdot \sin b, \color{blue}{\mathsf{fma}\left(\cos a, \cos b, \sin a \cdot \sin b\right)}\right)} \cdot r \]
  10. Simplified99.5%

    \[\leadsto \color{blue}{\frac{\sin b}{\mathsf{fma}\left(-2, \sin a \cdot \sin b, \mathsf{fma}\left(\cos a, \cos b, \sin a \cdot \sin b\right)\right)}} \cdot r \]
  11. Step-by-step derivation
    1. fma-udef99.5%

      \[\leadsto \frac{\sin b}{\color{blue}{-2 \cdot \left(\sin a \cdot \sin b\right) + \mathsf{fma}\left(\cos a, \cos b, \sin a \cdot \sin b\right)}} \cdot r \]
    2. *-commutative99.5%

      \[\leadsto \frac{\sin b}{-2 \cdot \color{blue}{\left(\sin b \cdot \sin a\right)} + \mathsf{fma}\left(\cos a, \cos b, \sin a \cdot \sin b\right)} \cdot r \]
    3. fma-udef99.5%

      \[\leadsto \frac{\sin b}{-2 \cdot \left(\sin b \cdot \sin a\right) + \color{blue}{\left(\cos a \cdot \cos b + \sin a \cdot \sin b\right)}} \cdot r \]
    4. cos-diff77.1%

      \[\leadsto \frac{\sin b}{-2 \cdot \left(\sin b \cdot \sin a\right) + \color{blue}{\cos \left(a - b\right)}} \cdot r \]
  12. Applied egg-rr77.1%

    \[\leadsto \frac{\sin b}{\color{blue}{-2 \cdot \left(\sin b \cdot \sin a\right) + \cos \left(a - b\right)}} \cdot r \]
  13. Final simplification77.1%

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

Alternative 5?

\[\begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-7} \lor \neg \left(a \leq 3.2 \cdot 10^{-10}\right):\\ \;\;\;\;r \cdot \frac{\sin b}{\cos a}\\ \mathbf{else}:\\ \;\;\;\;r \cdot \frac{1}{\frac{1}{\tan b} - a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if a < -1.6e-7 or 3.19999999999999981e-10 < a

    1. Initial program 53.4%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. associate-*r/53.5%

        \[\leadsto \color{blue}{r \cdot \frac{\sin b}{\cos \left(a + b\right)}} \]
      2. *-commutative53.5%

        \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(a + b\right)} \cdot r} \]
      3. +-commutative53.5%

        \[\leadsto \frac{\sin b}{\cos \color{blue}{\left(b + a\right)}} \cdot r \]
    3. Simplified53.5%

      \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(b + a\right)} \cdot r} \]
    4. Taylor expanded in b around 0 52.8%

      \[\leadsto \frac{\sin b}{\color{blue}{\cos a}} \cdot r \]

    if -1.6e-7 < a < 3.19999999999999981e-10

    1. Initial program 99.6%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. associate-/l*99.5%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(a + b\right)}{\sin b}}} \]
      2. +-commutative99.5%

        \[\leadsto \frac{r}{\frac{\cos \color{blue}{\left(b + a\right)}}{\sin b}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(b + a\right)}{\sin b}}} \]
    4. Taylor expanded in a around 0 99.5%

      \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} + -1 \cdot a}} \]
    5. Step-by-step derivation
      1. mul-1-neg99.5%

        \[\leadsto \frac{r}{\frac{\cos b}{\sin b} + \color{blue}{\left(-a\right)}} \]
      2. unsub-neg99.5%

        \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} - a}} \]
    6. Simplified99.5%

      \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} - a}} \]
    7. Step-by-step derivation
      1. div-inv99.6%

        \[\leadsto \color{blue}{r \cdot \frac{1}{\frac{\cos b}{\sin b} - a}} \]
      2. clear-num99.6%

        \[\leadsto r \cdot \frac{1}{\color{blue}{\frac{1}{\frac{\sin b}{\cos b}}} - a} \]
      3. quot-tan99.7%

        \[\leadsto r \cdot \frac{1}{\frac{1}{\color{blue}{\tan b}} - a} \]
    8. Applied egg-rr99.7%

      \[\leadsto \color{blue}{r \cdot \frac{1}{\frac{1}{\tan b} - a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-7} \lor \neg \left(a \leq 3.2 \cdot 10^{-10}\right):\\ \;\;\;\;r \cdot \frac{\sin b}{\cos a}\\ \mathbf{else}:\\ \;\;\;\;r \cdot \frac{1}{\frac{1}{\tan b} - a}\\ \end{array} \]

Alternative 6?

\[\begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{-6} \lor \neg \left(b \leq 2.35 \cdot 10^{-20}\right):\\ \;\;\;\;r \cdot \frac{\sin b}{\cos b}\\ \mathbf{else}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if b < -7.50000000000000019e-6 or 2.35000000000000007e-20 < b

    1. Initial program 57.4%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. associate-*r/57.4%

        \[\leadsto \color{blue}{r \cdot \frac{\sin b}{\cos \left(a + b\right)}} \]
      2. *-commutative57.4%

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

        \[\leadsto \frac{\sin b}{\cos \color{blue}{\left(b + a\right)}} \cdot r \]
    3. Simplified57.4%

      \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(b + a\right)} \cdot r} \]
    4. Taylor expanded in a around 0 57.7%

      \[\leadsto \frac{\sin b}{\color{blue}{\cos b}} \cdot r \]

    if -7.50000000000000019e-6 < b < 2.35000000000000007e-20

    1. Initial program 99.2%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.2%

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    3. Simplified99.2%

      \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
    4. Step-by-step derivation
      1. cos-sum99.7%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      2. cancel-sign-sub-inv99.7%

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

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    6. Taylor expanded in b around 0 99.2%

      \[\leadsto \color{blue}{\frac{b \cdot r}{\cos a}} \]
    7. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{\color{blue}{r \cdot b}}{\cos a} \]
      2. associate-/l*99.0%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos a}{b}}} \]
      3. associate-/r/99.3%

        \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
    8. Simplified99.3%

      \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{-6} \lor \neg \left(b \leq 2.35 \cdot 10^{-20}\right):\\ \;\;\;\;r \cdot \frac{\sin b}{\cos b}\\ \mathbf{else}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \end{array} \]

Alternative 7?

\[\begin{array}{l} \mathbf{if}\;b \leq -3.6 \cdot 10^{-5}:\\ \;\;\;\;r \cdot \frac{\sin b}{\cos b}\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{-15}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \mathbf{else}:\\ \;\;\;\;\frac{r}{\frac{\cos b}{\sin b}}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if b < -3.60000000000000009e-5

    1. Initial program 47.1%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. associate-*r/47.1%

        \[\leadsto \color{blue}{r \cdot \frac{\sin b}{\cos \left(a + b\right)}} \]
      2. *-commutative47.1%

        \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(a + b\right)} \cdot r} \]
      3. +-commutative47.1%

        \[\leadsto \frac{\sin b}{\cos \color{blue}{\left(b + a\right)}} \cdot r \]
    3. Simplified47.1%

      \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(b + a\right)} \cdot r} \]
    4. Taylor expanded in a around 0 47.8%

      \[\leadsto \frac{\sin b}{\color{blue}{\cos b}} \cdot r \]

    if -3.60000000000000009e-5 < b < 4.10000000000000036e-15

    1. Initial program 99.2%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.2%

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    3. Simplified99.2%

      \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
    4. Step-by-step derivation
      1. cos-sum99.7%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      2. cancel-sign-sub-inv99.7%

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

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    6. Taylor expanded in b around 0 99.2%

      \[\leadsto \color{blue}{\frac{b \cdot r}{\cos a}} \]
    7. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{\color{blue}{r \cdot b}}{\cos a} \]
      2. associate-/l*99.1%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos a}{b}}} \]
      3. associate-/r/99.3%

        \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
    8. Simplified99.3%

      \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]

    if 4.10000000000000036e-15 < b

    1. Initial program 64.7%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. associate-/l*64.8%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(a + b\right)}{\sin b}}} \]
      2. +-commutative64.8%

        \[\leadsto \frac{r}{\frac{\cos \color{blue}{\left(b + a\right)}}{\sin b}} \]
    3. Simplified64.8%

      \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(b + a\right)}{\sin b}}} \]
    4. Taylor expanded in a around 0 64.7%

      \[\leadsto \frac{r}{\frac{\color{blue}{\cos b}}{\sin b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.6 \cdot 10^{-5}:\\ \;\;\;\;r \cdot \frac{\sin b}{\cos b}\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{-15}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \mathbf{else}:\\ \;\;\;\;\frac{r}{\frac{\cos b}{\sin b}}\\ \end{array} \]

Alternative 8?

\[\sin b \cdot \frac{r}{\cos \left(b + a\right)} \]
Derivation
  1. Initial program 76.3%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. associate-/l*76.3%

      \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(a + b\right)}{\sin b}}} \]
    2. +-commutative76.3%

      \[\leadsto \frac{r}{\frac{\cos \color{blue}{\left(b + a\right)}}{\sin b}} \]
  3. Simplified76.3%

    \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(b + a\right)}{\sin b}}} \]
  4. Step-by-step derivation
    1. associate-/r/76.4%

      \[\leadsto \color{blue}{\frac{r}{\cos \left(b + a\right)} \cdot \sin b} \]
  5. Applied egg-rr76.4%

    \[\leadsto \color{blue}{\frac{r}{\cos \left(b + a\right)} \cdot \sin b} \]
  6. Final simplification76.4%

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

Alternative 9?

\[\begin{array}{l} \mathbf{if}\;b \leq -0.00019 \lor \neg \left(b \leq 2.35 \cdot 10^{-20}\right):\\ \;\;\;\;r \cdot \frac{1}{\frac{1}{\tan b} - a}\\ \mathbf{else}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if b < -1.9000000000000001e-4 or 2.35000000000000007e-20 < b

    1. Initial program 57.4%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. associate-/l*57.4%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(a + b\right)}{\sin b}}} \]
      2. +-commutative57.4%

        \[\leadsto \frac{r}{\frac{\cos \color{blue}{\left(b + a\right)}}{\sin b}} \]
    3. Simplified57.4%

      \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(b + a\right)}{\sin b}}} \]
    4. Taylor expanded in a around 0 53.5%

      \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} + -1 \cdot a}} \]
    5. Step-by-step derivation
      1. mul-1-neg53.5%

        \[\leadsto \frac{r}{\frac{\cos b}{\sin b} + \color{blue}{\left(-a\right)}} \]
      2. unsub-neg53.5%

        \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} - a}} \]
    6. Simplified53.5%

      \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} - a}} \]
    7. Step-by-step derivation
      1. div-inv53.4%

        \[\leadsto \color{blue}{r \cdot \frac{1}{\frac{\cos b}{\sin b} - a}} \]
      2. clear-num53.4%

        \[\leadsto r \cdot \frac{1}{\color{blue}{\frac{1}{\frac{\sin b}{\cos b}}} - a} \]
      3. quot-tan53.5%

        \[\leadsto r \cdot \frac{1}{\frac{1}{\color{blue}{\tan b}} - a} \]
    8. Applied egg-rr53.5%

      \[\leadsto \color{blue}{r \cdot \frac{1}{\frac{1}{\tan b} - a}} \]

    if -1.9000000000000001e-4 < b < 2.35000000000000007e-20

    1. Initial program 99.2%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.2%

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    3. Simplified99.2%

      \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
    4. Step-by-step derivation
      1. cos-sum99.7%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      2. cancel-sign-sub-inv99.7%

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

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    6. Taylor expanded in b around 0 99.2%

      \[\leadsto \color{blue}{\frac{b \cdot r}{\cos a}} \]
    7. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{\color{blue}{r \cdot b}}{\cos a} \]
      2. associate-/l*99.0%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos a}{b}}} \]
      3. associate-/r/99.3%

        \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
    8. Simplified99.3%

      \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.00019 \lor \neg \left(b \leq 2.35 \cdot 10^{-20}\right):\\ \;\;\;\;r \cdot \frac{1}{\frac{1}{\tan b} - a}\\ \mathbf{else}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \end{array} \]

Alternative 10?

\[\begin{array}{l} \mathbf{if}\;b \leq -0.000105 \lor \neg \left(b \leq 4.1 \cdot 10^{-15}\right):\\ \;\;\;\;\frac{r}{\frac{1}{\tan b} - a}\\ \mathbf{else}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if b < -1.05e-4 or 4.10000000000000036e-15 < b

    1. Initial program 56.8%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. associate-/l*56.8%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(a + b\right)}{\sin b}}} \]
      2. +-commutative56.8%

        \[\leadsto \frac{r}{\frac{\cos \color{blue}{\left(b + a\right)}}{\sin b}} \]
    3. Simplified56.8%

      \[\leadsto \color{blue}{\frac{r}{\frac{\cos \left(b + a\right)}{\sin b}}} \]
    4. Taylor expanded in a around 0 52.8%

      \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} + -1 \cdot a}} \]
    5. Step-by-step derivation
      1. mul-1-neg52.8%

        \[\leadsto \frac{r}{\frac{\cos b}{\sin b} + \color{blue}{\left(-a\right)}} \]
      2. unsub-neg52.8%

        \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} - a}} \]
    6. Simplified52.8%

      \[\leadsto \frac{r}{\color{blue}{\frac{\cos b}{\sin b} - a}} \]
    7. Step-by-step derivation
      1. expm1-log1p-u40.6%

        \[\leadsto \frac{r}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\cos b}{\sin b}\right)\right)} - a} \]
      2. expm1-udef40.2%

        \[\leadsto \frac{r}{\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\cos b}{\sin b}\right)} - 1\right)} - a} \]
      3. clear-num40.3%

        \[\leadsto \frac{r}{\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{1}{\frac{\sin b}{\cos b}}}\right)} - 1\right) - a} \]
      4. quot-tan40.3%

        \[\leadsto \frac{r}{\left(e^{\mathsf{log1p}\left(\frac{1}{\color{blue}{\tan b}}\right)} - 1\right) - a} \]
    8. Applied egg-rr40.3%

      \[\leadsto \frac{r}{\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{1}{\tan b}\right)} - 1\right)} - a} \]
    9. Step-by-step derivation
      1. expm1-def40.6%

        \[\leadsto \frac{r}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\tan b}\right)\right)} - a} \]
      2. expm1-log1p52.8%

        \[\leadsto \frac{r}{\color{blue}{\frac{1}{\tan b}} - a} \]
    10. Simplified52.8%

      \[\leadsto \frac{r}{\color{blue}{\frac{1}{\tan b}} - a} \]

    if -1.05e-4 < b < 4.10000000000000036e-15

    1. Initial program 99.2%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.2%

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    3. Simplified99.2%

      \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
    4. Step-by-step derivation
      1. cos-sum99.7%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      2. cancel-sign-sub-inv99.7%

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

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    6. Taylor expanded in b around 0 99.2%

      \[\leadsto \color{blue}{\frac{b \cdot r}{\cos a}} \]
    7. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{\color{blue}{r \cdot b}}{\cos a} \]
      2. associate-/l*99.1%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos a}{b}}} \]
      3. associate-/r/99.3%

        \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
    8. Simplified99.3%

      \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.000105 \lor \neg \left(b \leq 4.1 \cdot 10^{-15}\right):\\ \;\;\;\;\frac{r}{\frac{1}{\tan b} - a}\\ \mathbf{else}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \end{array} \]

Alternative 11?

\[\begin{array}{l} \mathbf{if}\;b \leq -54000 \lor \neg \left(b \leq 88000000000\right):\\ \;\;\;\;\sin b \cdot r\\ \mathbf{else}:\\ \;\;\;\;r \cdot \frac{b}{\cos a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if b < -54000 or 8.8e10 < b

    1. Initial program 55.1%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. +-commutative55.1%

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    3. Simplified55.1%

      \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
    4. Taylor expanded in b around 0 12.6%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos a}} \]
    5. Taylor expanded in a around 0 12.6%

      \[\leadsto \color{blue}{\sin b \cdot r} \]

    if -54000 < b < 8.8e10

    1. Initial program 98.2%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. associate-*r/98.2%

        \[\leadsto \color{blue}{r \cdot \frac{\sin b}{\cos \left(a + b\right)}} \]
      2. *-commutative98.2%

        \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(a + b\right)} \cdot r} \]
      3. +-commutative98.2%

        \[\leadsto \frac{\sin b}{\cos \color{blue}{\left(b + a\right)}} \cdot r \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(b + a\right)} \cdot r} \]
    4. Taylor expanded in b around 0 95.6%

      \[\leadsto \color{blue}{\frac{b}{\cos a}} \cdot r \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -54000 \lor \neg \left(b \leq 88000000000\right):\\ \;\;\;\;\sin b \cdot r\\ \mathbf{else}:\\ \;\;\;\;r \cdot \frac{b}{\cos a}\\ \end{array} \]

Alternative 12?

\[\begin{array}{l} \mathbf{if}\;b \leq -54000 \lor \neg \left(b \leq 88000000000\right):\\ \;\;\;\;\sin b \cdot r\\ \mathbf{else}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if b < -54000 or 8.8e10 < b

    1. Initial program 55.1%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. +-commutative55.1%

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    3. Simplified55.1%

      \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
    4. Taylor expanded in b around 0 12.6%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos a}} \]
    5. Taylor expanded in a around 0 12.6%

      \[\leadsto \color{blue}{\sin b \cdot r} \]

    if -54000 < b < 8.8e10

    1. Initial program 98.2%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. +-commutative98.2%

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
    4. Step-by-step derivation
      1. cos-sum99.7%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      2. cancel-sign-sub-inv99.7%

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

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    6. Taylor expanded in b around 0 95.5%

      \[\leadsto \color{blue}{\frac{b \cdot r}{\cos a}} \]
    7. Step-by-step derivation
      1. *-commutative95.5%

        \[\leadsto \frac{\color{blue}{r \cdot b}}{\cos a} \]
      2. associate-/l*95.4%

        \[\leadsto \color{blue}{\frac{r}{\frac{\cos a}{b}}} \]
      3. associate-/r/95.7%

        \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
    8. Simplified95.7%

      \[\leadsto \color{blue}{\frac{r}{\cos a} \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -54000 \lor \neg \left(b \leq 88000000000\right):\\ \;\;\;\;\sin b \cdot r\\ \mathbf{else}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \end{array} \]

Alternative 13?

\[\sin b \cdot r \]
Derivation
  1. Initial program 76.3%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. +-commutative76.3%

      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
  3. Simplified76.3%

    \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos \left(b + a\right)}} \]
  4. Taylor expanded in b around 0 53.2%

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos a}} \]
  5. Taylor expanded in a around 0 37.4%

    \[\leadsto \color{blue}{\sin b \cdot r} \]
  6. Final simplification37.4%

    \[\leadsto \sin b \cdot r \]

Alternative 14?

\[b \cdot r \]
Derivation
  1. Initial program 76.3%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. associate-*r/76.3%

      \[\leadsto \color{blue}{r \cdot \frac{\sin b}{\cos \left(a + b\right)}} \]
    2. *-commutative76.3%

      \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(a + b\right)} \cdot r} \]
    3. +-commutative76.3%

      \[\leadsto \frac{\sin b}{\cos \color{blue}{\left(b + a\right)}} \cdot r \]
  3. Simplified76.3%

    \[\leadsto \color{blue}{\frac{\sin b}{\cos \left(b + a\right)} \cdot r} \]
  4. Taylor expanded in b around 0 48.9%

    \[\leadsto \color{blue}{\frac{b}{\cos a}} \cdot r \]
  5. Taylor expanded in a around 0 33.0%

    \[\leadsto \color{blue}{b} \cdot r \]
  6. Final simplification33.0%

    \[\leadsto b \cdot r \]

Reproduce

?
herbie shell --seed 2023166 
(FPCore (r a b)
  :name "rsin A (should all be same)"
  :precision binary64
  (/ (* r (sin b)) (cos (+ a b))))