ABCF->ab-angle angle

Percentage Accurate: 53.4% → 79.0%
Time: 8.3s
Alternatives: 13
Speedup: 2.3×

Specification

?
\[\begin{array}{l} \\ 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (*
  180.0
  (/
   (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
   (PI))))
\begin{array}{l}

\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}
\end{array}

Sampling outcomes in binary64 precision:

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 13 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.

Initial Program: 53.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (*
  180.0
  (/
   (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
   (PI))))
\begin{array}{l}

\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}
\end{array}

Alternative 1: 79.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -340000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 5 \cdot 10^{-225}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -340000000000.0)
   (* 180.0 (/ (atan (* 0.5 (/ (fma C (/ B A) B) A))) (PI)))
   (if (<= A 5e-225)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) (PI)))
     (* 180.0 (/ (atan (- (/ (- C A) B) (/ (hypot B (- A C)) B))) (PI))))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;A \leq -340000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;A \leq 5 \cdot 10^{-225}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -3.4e11

    1. Initial program 21.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{B}} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-*l/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      4. *-lft-identityN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lift--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      6. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      7. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      8. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-/.f6414.9

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \color{blue}{\frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      10. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      11. lift-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      12. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      13. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2}} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      14. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      15. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{{\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      16. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-hypot.f6427.2

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    4. Applied rewrites27.2%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    5. Taylor expanded in A around 0

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. lower-/.f6427.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    7. Applied rewrites27.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    8. Taylor expanded in A around -inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. fp-cancel-sub-sign-invN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot \frac{B \cdot C}{A} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot B}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} + \color{blue}{\frac{-1}{2}} \cdot B}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      4. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot B + \frac{-1}{2} \cdot \frac{B \cdot C}{A}}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      5. distribute-lft-outN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot \left(B + \frac{B \cdot C}{A}\right)}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      6. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{2} \cdot \frac{B + \frac{B \cdot C}{A}}{A}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      7. distribute-lft-neg-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
      8. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{2}} \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
      10. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \color{blue}{\frac{B + \frac{B \cdot C}{A}}{A}}\right)}{\mathsf{PI}\left(\right)} \]
      11. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{\frac{B \cdot C}{A} + B}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      12. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\frac{\color{blue}{C \cdot B}}{A} + B}{A}\right)}{\mathsf{PI}\left(\right)} \]
      13. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{C \cdot \frac{B}{A}} + B}{A}\right)}{\mathsf{PI}\left(\right)} \]
      14. lower-fma.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      15. lower-/.f6473.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \color{blue}{\frac{B}{A}}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)} \]
    10. Applied rewrites73.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]

    if -3.4e11 < A < 5.0000000000000001e-225

    1. Initial program 46.5%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in A around 0

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      2. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - \sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      3. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      4. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{B \cdot B + \color{blue}{C \cdot C}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lower-hypot.f6472.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \color{blue}{\mathsf{hypot}\left(B, C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites72.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]

    if 5.0000000000000001e-225 < A

    1. Initial program 70.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{B}} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-*l/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      4. *-lft-identityN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lift--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      6. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      7. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      8. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-/.f6469.9

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \color{blue}{\frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      10. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      11. lift-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      12. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      13. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2}} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      14. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      15. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{{\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      16. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-hypot.f6489.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    4. Applied rewrites89.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -340000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 5 \cdot 10^{-225}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 72.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\ t_1 := \frac{C - A}{B}\\ \mathbf{if}\;t\_0 \leq -40:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0
         (*
          180.0
          (/
           (atan
            (*
             (pow B -1.0)
             (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
           (PI))))
        (t_1 (/ (- C A) B)))
   (if (<= t_0 -40.0)
     (* 180.0 (/ (atan (- t_1 1.0)) (PI)))
     (if (<= t_0 0.0)
       (* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
       (* 180.0 (/ (atan (+ t_1 1.0)) (PI)))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -40:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -40

    1. Initial program 60.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \color{blue}{\left(\frac{A}{B} + 1\right)}\right)}{\mathsf{PI}\left(\right)} \]
      2. associate--r+N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
      3. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
      4. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - 1\right)}}{\mathsf{PI}\left(\right)} \]
      5. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
      6. lower--.f6481.4

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - A}}{B} - 1\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites81.4%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - 1\right)}}{\mathsf{PI}\left(\right)} \]

    if -40 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -0.0

    1. Initial program 18.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in A around -inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{B}{A} \cdot \frac{1}{2}\right)}}{\mathsf{PI}\left(\right)} \]
      2. lower-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{B}{A} \cdot \frac{1}{2}\right)}}{\mathsf{PI}\left(\right)} \]
      3. lower-/.f6454.3

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{B}{A}} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites54.3%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{B}{A} \cdot 0.5\right)}}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)}} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\frac{B}{A} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)}} \]
      3. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)}} \]
      4. lift-PI.f64N/A

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot \frac{1}{2}\right)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
      5. add-sqr-sqrtN/A

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot \frac{1}{2}\right)}{\color{blue}{\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot \frac{1}{2}\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot \frac{1}{2}\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}}} \]
    7. Applied rewrites54.0%

      \[\leadsto \color{blue}{\frac{\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot 180}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot 180}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot 180}{\sqrt{\mathsf{PI}\left(\right)}}}}{\sqrt{\mathsf{PI}\left(\right)}} \]
      3. associate-/l/N/A

        \[\leadsto \color{blue}{\frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot 180}{\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot 180}}{\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}} \]
      5. lift-sqrt.f64N/A

        \[\leadsto \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot 180}{\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}} \]
      6. lift-sqrt.f64N/A

        \[\leadsto \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot 180}{\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot 180}{\color{blue}{\mathsf{PI}\left(\right)}} \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}} \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\tan^{-1} \left(\frac{1}{2} \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}} \]
    9. Applied rewrites54.4%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}} \]

    if -0.0 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64)))

    1. Initial program 55.9%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around -inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(1 + \color{blue}{\frac{C - A}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      3. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]
      4. lower-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]
      5. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right)}{\mathsf{PI}\left(\right)} \]
      6. lower--.f6474.9

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - A}}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites74.9%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \leq -40:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \leq 0:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ t_1 := \frac{C - A}{B}\\ \mathbf{if}\;t\_0 \leq -0.04:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0
         (* (pow B -1.0) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
        (t_1 (/ (- C A) B)))
   (if (<= t_0 -0.04)
     (* 180.0 (/ (atan (- t_1 1.0)) (PI)))
     (if (<= t_0 0.0)
       (* 180.0 (/ (atan (* 0.5 (/ (fma C (/ B A) B) A))) (PI)))
       (* 180.0 (/ (atan (+ t_1 1.0)) (PI)))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.04:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.0400000000000000008

    1. Initial program 60.4%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \color{blue}{\left(\frac{A}{B} + 1\right)}\right)}{\mathsf{PI}\left(\right)} \]
      2. associate--r+N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
      3. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
      4. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - 1\right)}}{\mathsf{PI}\left(\right)} \]
      5. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
      6. lower--.f6480.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - A}}{B} - 1\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites80.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - 1\right)}}{\mathsf{PI}\left(\right)} \]

    if -0.0400000000000000008 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.0

    1. Initial program 16.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{B}} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-*l/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      4. *-lft-identityN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lift--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      6. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      7. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      8. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-/.f644.1

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \color{blue}{\frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      10. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      11. lift-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      12. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      13. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2}} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      14. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      15. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{{\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      16. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-hypot.f644.1

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    4. Applied rewrites4.1%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    5. Taylor expanded in A around 0

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. lower-/.f644.8

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    7. Applied rewrites4.8%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    8. Taylor expanded in A around -inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. fp-cancel-sub-sign-invN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot \frac{B \cdot C}{A} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot B}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} + \color{blue}{\frac{-1}{2}} \cdot B}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      4. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot B + \frac{-1}{2} \cdot \frac{B \cdot C}{A}}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      5. distribute-lft-outN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot \left(B + \frac{B \cdot C}{A}\right)}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      6. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{2} \cdot \frac{B + \frac{B \cdot C}{A}}{A}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      7. distribute-lft-neg-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
      8. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{2}} \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
      10. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \color{blue}{\frac{B + \frac{B \cdot C}{A}}{A}}\right)}{\mathsf{PI}\left(\right)} \]
      11. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{\frac{B \cdot C}{A} + B}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      12. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\frac{\color{blue}{C \cdot B}}{A} + B}{A}\right)}{\mathsf{PI}\left(\right)} \]
      13. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{C \cdot \frac{B}{A}} + B}{A}\right)}{\mathsf{PI}\left(\right)} \]
      14. lower-fma.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      15. lower-/.f6456.2

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \color{blue}{\frac{B}{A}}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)} \]
    10. Applied rewrites56.2%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]

    if -0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

    1. Initial program 55.9%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around -inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(1 + \color{blue}{\frac{C - A}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      3. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]
      4. lower-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]
      5. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right)}{\mathsf{PI}\left(\right)} \]
      6. lower--.f6474.9

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - A}}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites74.9%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq -0.04:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;{B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq 0:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 78.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -340000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 5 \cdot 10^{-225}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -340000000000.0)
   (* 180.0 (/ (atan (* 0.5 (/ (fma C (/ B A) B) A))) (PI)))
   (if (<= A 5e-225)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) (PI)))
     (* 180.0 (/ (atan (- (/ C B) (/ (hypot B (- A C)) B))) (PI))))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;A \leq -340000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;A \leq 5 \cdot 10^{-225}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -3.4e11

    1. Initial program 21.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{B}} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-*l/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      4. *-lft-identityN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lift--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      6. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      7. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      8. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-/.f6414.9

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \color{blue}{\frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      10. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      11. lift-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      12. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      13. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2}} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      14. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      15. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{{\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      16. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-hypot.f6427.2

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    4. Applied rewrites27.2%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    5. Taylor expanded in A around 0

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. lower-/.f6427.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    7. Applied rewrites27.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    8. Taylor expanded in A around -inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. fp-cancel-sub-sign-invN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot \frac{B \cdot C}{A} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot B}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} + \color{blue}{\frac{-1}{2}} \cdot B}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      4. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot B + \frac{-1}{2} \cdot \frac{B \cdot C}{A}}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      5. distribute-lft-outN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot \left(B + \frac{B \cdot C}{A}\right)}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      6. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{2} \cdot \frac{B + \frac{B \cdot C}{A}}{A}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      7. distribute-lft-neg-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
      8. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{2}} \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
      10. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \color{blue}{\frac{B + \frac{B \cdot C}{A}}{A}}\right)}{\mathsf{PI}\left(\right)} \]
      11. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{\frac{B \cdot C}{A} + B}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      12. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\frac{\color{blue}{C \cdot B}}{A} + B}{A}\right)}{\mathsf{PI}\left(\right)} \]
      13. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{C \cdot \frac{B}{A}} + B}{A}\right)}{\mathsf{PI}\left(\right)} \]
      14. lower-fma.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      15. lower-/.f6473.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \color{blue}{\frac{B}{A}}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)} \]
    10. Applied rewrites73.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]

    if -3.4e11 < A < 5.0000000000000001e-225

    1. Initial program 46.5%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in A around 0

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      2. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - \sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      3. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      4. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{B \cdot B + \color{blue}{C \cdot C}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lower-hypot.f6472.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \color{blue}{\mathsf{hypot}\left(B, C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites72.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]

    if 5.0000000000000001e-225 < A

    1. Initial program 70.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{B}} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-*l/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      4. *-lft-identityN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lift--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      6. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      7. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      8. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-/.f6469.9

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \color{blue}{\frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      10. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      11. lift-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      12. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      13. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2}} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      14. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      15. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{{\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      16. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-hypot.f6489.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    4. Applied rewrites89.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    5. Taylor expanded in A around 0

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. lower-/.f6488.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    7. Applied rewrites88.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -340000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 5 \cdot 10^{-225}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -340000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 2.25 \cdot 10^{-102}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -340000000000.0)
   (* 180.0 (/ (atan (* 0.5 (/ (fma C (/ B A) B) A))) (PI)))
   (if (<= A 2.25e-102)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) (PI)))
     (* 180.0 (/ (atan (- (/ (- C A) B) 1.0)) (PI))))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;A \leq -340000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;A \leq 2.25 \cdot 10^{-102}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -3.4e11

    1. Initial program 21.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{B}} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-*l/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      4. *-lft-identityN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lift--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      6. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      7. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      8. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-/.f6414.9

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \color{blue}{\frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      10. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      11. lift-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      12. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      13. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2}} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      14. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      15. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{{\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      16. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-hypot.f6427.2

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    4. Applied rewrites27.2%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    5. Taylor expanded in A around 0

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. lower-/.f6427.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    7. Applied rewrites27.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
    8. Taylor expanded in A around -inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. fp-cancel-sub-sign-invN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot \frac{B \cdot C}{A} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot B}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\frac{-1}{2} \cdot \frac{B \cdot C}{A} + \color{blue}{\frac{-1}{2}} \cdot B}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      4. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot B + \frac{-1}{2} \cdot \frac{B \cdot C}{A}}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      5. distribute-lft-outN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{-1}{2} \cdot \left(B + \frac{B \cdot C}{A}\right)}}{A}\right)\right)}{\mathsf{PI}\left(\right)} \]
      6. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{2} \cdot \frac{B + \frac{B \cdot C}{A}}{A}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      7. distribute-lft-neg-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
      8. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{2}} \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B + \frac{B \cdot C}{A}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
      10. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \color{blue}{\frac{B + \frac{B \cdot C}{A}}{A}}\right)}{\mathsf{PI}\left(\right)} \]
      11. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{\frac{B \cdot C}{A} + B}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      12. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\frac{\color{blue}{C \cdot B}}{A} + B}{A}\right)}{\mathsf{PI}\left(\right)} \]
      13. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{C \cdot \frac{B}{A}} + B}{A}\right)}{\mathsf{PI}\left(\right)} \]
      14. lower-fma.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{\color{blue}{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
      15. lower-/.f6473.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \color{blue}{\frac{B}{A}}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)} \]
    10. Applied rewrites73.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]

    if -3.4e11 < A < 2.25e-102

    1. Initial program 50.6%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in A around 0

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      2. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - \sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      3. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      4. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{B \cdot B + \color{blue}{C \cdot C}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lower-hypot.f6476.4

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \color{blue}{\mathsf{hypot}\left(B, C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites76.4%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]

    if 2.25e-102 < A

    1. Initial program 72.6%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \color{blue}{\left(\frac{A}{B} + 1\right)}\right)}{\mathsf{PI}\left(\right)} \]
      2. associate--r+N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
      3. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
      4. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - 1\right)}}{\mathsf{PI}\left(\right)} \]
      5. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
      6. lower--.f6478.5

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - A}}{B} - 1\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites78.5%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - 1\right)}}{\mathsf{PI}\left(\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -340000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 2.25 \cdot 10^{-102}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.8% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;B \leq -3.4 \cdot 10^{-222}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq -4.5 \cdot 10^{-306}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{-28}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI)))))
   (if (<= B -3.4e-222)
     t_0
     (if (<= B -4.5e-306)
       (* 180.0 (/ (atan 0.0) (PI)))
       (if (<= B 2.4e-28)
         t_0
         (if (<= B 2.5e+51)
           (/ (* (atan (* -0.5 (/ B C))) 180.0) (PI))
           (* 180.0 (/ (atan -1.0) (PI)))))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;B \leq -3.4 \cdot 10^{-222}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;B \leq -4.5 \cdot 10^{-306}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;B \leq 2.4 \cdot 10^{-28}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < -3.4000000000000001e-222 or -4.50000000000000005e-306 < B < 2.4000000000000002e-28

    1. Initial program 54.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around -inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(1 + \color{blue}{\frac{C - A}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      3. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]
      4. lower-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]
      5. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right)}{\mathsf{PI}\left(\right)} \]
      6. lower--.f6465.5

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - A}}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites65.5%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + 1\right)}}{\mathsf{PI}\left(\right)} \]

    if -3.4000000000000001e-222 < B < -4.50000000000000005e-306

    1. Initial program 46.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{B}} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-*l/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      4. *-lft-identityN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      5. lift--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      6. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      7. lower--.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      8. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      9. lower-/.f6424.8

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \color{blue}{\frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}}\right)}{\mathsf{PI}\left(\right)} \]
      10. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      11. lift-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      12. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      13. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2}} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      14. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      15. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{{\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      16. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-hypot.f6424.8

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
    4. Applied rewrites24.8%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
    5. Taylor expanded in C around inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \left(-1 \cdot \frac{A}{B} + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\left(-1 \cdot \frac{A}{B} + \frac{A}{B}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
      2. distribute-lft1-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(-1 + 1\right) \cdot \frac{A}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\color{blue}{0} \cdot \frac{A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      4. distribute-lft-neg-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(0\right)\right) \cdot \frac{A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      5. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{0} \cdot \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \]
      6. mul0-lft61.6

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\mathsf{PI}\left(\right)} \]
    7. Applied rewrites61.6%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\mathsf{PI}\left(\right)} \]

    if 2.4000000000000002e-28 < B < 2.5e51

    1. Initial program 43.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + \frac{-1}{2} \cdot \frac{B}{C}\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      2. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{B}{C} \cdot \frac{-1}{2}} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      4. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\color{blue}{\frac{B}{C}}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      5. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\mathsf{neg}\left(\frac{A + -1 \cdot A}{B}\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
      6. distribute-frac-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{\mathsf{neg}\left(\left(A + -1 \cdot A\right)\right)}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      7. distribute-rgt1-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{\left(-1 + 1\right) \cdot A}\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      8. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{0} \cdot A\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      9. distribute-lft-neg-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(\mathsf{neg}\left(0\right)\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      10. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      11. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right)} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      12. distribute-rgt1-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{A + -1 \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      13. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{A + -1 \cdot A}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      14. distribute-rgt1-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      15. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
      16. mul0-lft77.7

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{\color{blue}{0}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites77.7%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
      3. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    7. Applied rewrites77.7%

      \[\leadsto \color{blue}{\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}} \]

    if 2.5e51 < B

    1. Initial program 48.4%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites70.8%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
    5. Recombined 4 regimes into one program.
    6. Final simplification67.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -3.4 \cdot 10^{-222}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.5 \cdot 10^{-306}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{-28}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
    7. Add Preprocessing

    Alternative 7: 45.9% accurate, 2.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.4 \cdot 10^{-306}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq 4.4 \cdot 10^{-221}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0 (/ (* (atan (* -0.5 (/ B C))) 180.0) (PI))))
       (if (<= B -5.5e-31)
         (* 180.0 (/ (atan 1.0) (PI)))
         (if (<= B -4.4e-306)
           t_0
           (if (<= B 4.4e-221)
             (* 180.0 (/ (atan (* (/ C B) 2.0)) (PI)))
             (if (<= B 2.5e+51) t_0 (* 180.0 (/ (atan -1.0) (PI)))))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
    \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;B \leq -4.4 \cdot 10^{-306}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;B \leq 4.4 \cdot 10^{-221}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if B < -5.49999999999999958e-31

      1. Initial program 50.4%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in B around -inf

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. Applied rewrites64.4%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]

        if -5.49999999999999958e-31 < B < -4.40000000000000031e-306 or 4.40000000000000003e-221 < B < 2.5e51

        1. Initial program 48.7%

          \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in C around inf

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + \frac{-1}{2} \cdot \frac{B}{C}\right)}}{\mathsf{PI}\left(\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
          2. *-commutativeN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{B}{C} \cdot \frac{-1}{2}} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
          3. lower-fma.f64N/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
          4. lower-/.f64N/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\color{blue}{\frac{B}{C}}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          5. mul-1-negN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\mathsf{neg}\left(\frac{A + -1 \cdot A}{B}\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
          6. distribute-frac-negN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{\mathsf{neg}\left(\left(A + -1 \cdot A\right)\right)}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
          7. distribute-rgt1-inN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{\left(-1 + 1\right) \cdot A}\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          8. metadata-evalN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{0} \cdot A\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          9. distribute-lft-neg-inN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(\mathsf{neg}\left(0\right)\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          10. metadata-evalN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          11. metadata-evalN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right)} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          12. distribute-rgt1-inN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{A + -1 \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          13. lower-/.f64N/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{A + -1 \cdot A}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
          14. distribute-rgt1-inN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          15. metadata-evalN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
          16. mul0-lft43.3

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{\color{blue}{0}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
        5. Applied rewrites43.3%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
        6. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
          2. lift-/.f64N/A

            \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
          3. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
          4. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
        7. Applied rewrites43.3%

          \[\leadsto \color{blue}{\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}} \]

        if -4.40000000000000031e-306 < B < 4.40000000000000003e-221

        1. Initial program 83.9%

          \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in C around -inf

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(2 \cdot \frac{C}{B}\right)}}{\mathsf{PI}\left(\right)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} \cdot 2\right)}}{\mathsf{PI}\left(\right)} \]
          2. lower-*.f64N/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} \cdot 2\right)}}{\mathsf{PI}\left(\right)} \]
          3. lower-/.f6472.7

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} \cdot 2\right)}{\mathsf{PI}\left(\right)} \]
        5. Applied rewrites72.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} \cdot 2\right)}}{\mathsf{PI}\left(\right)} \]

        if 2.5e51 < B

        1. Initial program 48.4%

          \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in B around inf

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
        4. Step-by-step derivation
          1. Applied rewrites70.8%

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
        5. Recombined 4 regimes into one program.
        6. Final simplification57.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.4 \cdot 10^{-306}:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 4.4 \cdot 10^{-221}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
        7. Add Preprocessing

        Alternative 8: 45.9% accurate, 2.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.4 \cdot 10^{-306}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq 4.4 \cdot 10^{-221}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
        (FPCore (A B C)
         :precision binary64
         (let* ((t_0 (* 180.0 (/ (atan (* B (/ -0.5 C))) (PI)))))
           (if (<= B -5.5e-31)
             (* 180.0 (/ (atan 1.0) (PI)))
             (if (<= B -4.4e-306)
               t_0
               (if (<= B 4.4e-221)
                 (* 180.0 (/ (atan (* (/ C B) 2.0)) (PI)))
                 (if (<= B 2.5e+51) t_0 (* 180.0 (/ (atan -1.0) (PI)))))))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\
        \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{elif}\;B \leq -4.4 \cdot 10^{-306}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;B \leq 4.4 \cdot 10^{-221}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if B < -5.49999999999999958e-31

          1. Initial program 50.4%

            \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in B around -inf

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
          4. Step-by-step derivation
            1. Applied rewrites64.4%

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]

            if -5.49999999999999958e-31 < B < -4.40000000000000031e-306 or 4.40000000000000003e-221 < B < 2.5e51

            1. Initial program 48.7%

              \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in C around inf

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + \frac{-1}{2} \cdot \frac{B}{C}\right)}}{\mathsf{PI}\left(\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
              2. *-commutativeN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{B}{C} \cdot \frac{-1}{2}} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
              3. lower-fma.f64N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
              4. lower-/.f64N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\color{blue}{\frac{B}{C}}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              5. mul-1-negN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\mathsf{neg}\left(\frac{A + -1 \cdot A}{B}\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
              6. distribute-frac-negN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{\mathsf{neg}\left(\left(A + -1 \cdot A\right)\right)}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
              7. distribute-rgt1-inN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{\left(-1 + 1\right) \cdot A}\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              8. metadata-evalN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{0} \cdot A\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              9. distribute-lft-neg-inN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(\mathsf{neg}\left(0\right)\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              10. metadata-evalN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              11. metadata-evalN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right)} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              12. distribute-rgt1-inN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{A + -1 \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              13. lower-/.f64N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{A + -1 \cdot A}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
              14. distribute-rgt1-inN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              15. metadata-evalN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
              16. mul0-lft43.3

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{\color{blue}{0}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
            5. Applied rewrites43.3%

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
            6. Step-by-step derivation
              1. Applied rewrites43.2%

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{-0.5}{C}}\right)}{\mathsf{PI}\left(\right)} \]

              if -4.40000000000000031e-306 < B < 4.40000000000000003e-221

              1. Initial program 83.9%

                \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in C around -inf

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(2 \cdot \frac{C}{B}\right)}}{\mathsf{PI}\left(\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} \cdot 2\right)}}{\mathsf{PI}\left(\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} \cdot 2\right)}}{\mathsf{PI}\left(\right)} \]
                3. lower-/.f6472.7

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C}{B}} \cdot 2\right)}{\mathsf{PI}\left(\right)} \]
              5. Applied rewrites72.7%

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} \cdot 2\right)}}{\mathsf{PI}\left(\right)} \]

              if 2.5e51 < B

              1. Initial program 48.4%

                \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in B around inf

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
              4. Step-by-step derivation
                1. Applied rewrites70.8%

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
              5. Recombined 4 regimes into one program.
              6. Final simplification57.5%

                \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.4 \cdot 10^{-306}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 4.4 \cdot 10^{-221}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
              7. Add Preprocessing

              Alternative 9: 46.0% accurate, 2.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.5 \cdot 10^{-306}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq 2.2 \cdot 10^{-28}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
              (FPCore (A B C)
               :precision binary64
               (let* ((t_0 (* 180.0 (/ (atan (* B (/ -0.5 C))) (PI)))))
                 (if (<= B -5.5e-31)
                   (* 180.0 (/ (atan 1.0) (PI)))
                   (if (<= B -4.5e-306)
                     t_0
                     (if (<= B 2.2e-28)
                       (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
                       (if (<= B 2.5e+51) t_0 (* 180.0 (/ (atan -1.0) (PI)))))))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\
              \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;B \leq -4.5 \cdot 10^{-306}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;B \leq 2.2 \cdot 10^{-28}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{else}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if B < -5.49999999999999958e-31

                1. Initial program 50.4%

                  \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in B around -inf

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
                4. Step-by-step derivation
                  1. Applied rewrites64.4%

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]

                  if -5.49999999999999958e-31 < B < -4.50000000000000005e-306 or 2.19999999999999996e-28 < B < 2.5e51

                  1. Initial program 47.6%

                    \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in C around inf

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + \frac{-1}{2} \cdot \frac{B}{C}\right)}}{\mathsf{PI}\left(\right)} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                    2. *-commutativeN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{B}{C} \cdot \frac{-1}{2}} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
                    3. lower-fma.f64N/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                    4. lower-/.f64N/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\color{blue}{\frac{B}{C}}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    5. mul-1-negN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\mathsf{neg}\left(\frac{A + -1 \cdot A}{B}\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    6. distribute-frac-negN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{\mathsf{neg}\left(\left(A + -1 \cdot A\right)\right)}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    7. distribute-rgt1-inN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{\left(-1 + 1\right) \cdot A}\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    8. metadata-evalN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{0} \cdot A\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    9. distribute-lft-neg-inN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(\mathsf{neg}\left(0\right)\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    10. metadata-evalN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    11. metadata-evalN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right)} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    12. distribute-rgt1-inN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{A + -1 \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    13. lower-/.f64N/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{A + -1 \cdot A}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    14. distribute-rgt1-inN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    15. metadata-evalN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    16. mul0-lft51.3

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{\color{blue}{0}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                  5. Applied rewrites51.3%

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                  6. Step-by-step derivation
                    1. Applied rewrites51.2%

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{-0.5}{C}}\right)}{\mathsf{PI}\left(\right)} \]

                    if -4.50000000000000005e-306 < B < 2.19999999999999996e-28

                    1. Initial program 61.8%

                      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in A around inf

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-2 \cdot \frac{A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{A}{B} \cdot -2\right)}}{\mathsf{PI}\left(\right)} \]
                      2. lower-*.f64N/A

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{A}{B} \cdot -2\right)}}{\mathsf{PI}\left(\right)} \]
                      3. lower-/.f6440.1

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{A}{B}} \cdot -2\right)}{\mathsf{PI}\left(\right)} \]
                    5. Applied rewrites40.1%

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{A}{B} \cdot -2\right)}}{\mathsf{PI}\left(\right)} \]

                    if 2.5e51 < B

                    1. Initial program 48.4%

                      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in B around inf

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                    4. Step-by-step derivation
                      1. Applied rewrites70.8%

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                    5. Recombined 4 regimes into one program.
                    6. Final simplification57.0%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.5 \cdot 10^{-306}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.2 \cdot 10^{-28}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 10: 45.6% accurate, 2.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                    (FPCore (A B C)
                     :precision binary64
                     (if (<= B -5.5e-31)
                       (* 180.0 (/ (atan 1.0) (PI)))
                       (if (<= B 2.5e+51)
                         (* 180.0 (/ (atan (* B (/ -0.5 C))) (PI)))
                         (* 180.0 (/ (atan -1.0) (PI))))))
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\
                    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                    
                    \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\
                    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if B < -5.49999999999999958e-31

                      1. Initial program 50.4%

                        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in B around -inf

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
                      4. Step-by-step derivation
                        1. Applied rewrites64.4%

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]

                        if -5.49999999999999958e-31 < B < 2.5e51

                        1. Initial program 53.7%

                          \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                        2. Add Preprocessing
                        3. Taylor expanded in C around inf

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + \frac{-1}{2} \cdot \frac{B}{C}\right)}}{\mathsf{PI}\left(\right)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                          2. *-commutativeN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{B}{C} \cdot \frac{-1}{2}} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
                          3. lower-fma.f64N/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                          4. lower-/.f64N/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\color{blue}{\frac{B}{C}}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          5. mul-1-negN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\mathsf{neg}\left(\frac{A + -1 \cdot A}{B}\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          6. distribute-frac-negN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{\mathsf{neg}\left(\left(A + -1 \cdot A\right)\right)}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          7. distribute-rgt1-inN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{\left(-1 + 1\right) \cdot A}\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          8. metadata-evalN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\mathsf{neg}\left(\color{blue}{0} \cdot A\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          9. distribute-lft-neg-inN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(\mathsf{neg}\left(0\right)\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          10. metadata-evalN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          11. metadata-evalN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right)} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          12. distribute-rgt1-inN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{A + -1 \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          13. lower-/.f64N/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \color{blue}{\frac{A + -1 \cdot A}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          14. distribute-rgt1-inN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{\left(-1 + 1\right) \cdot A}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          15. metadata-evalN/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\color{blue}{0} \cdot A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          16. mul0-lft38.3

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{\color{blue}{0}}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                        5. Applied rewrites38.3%

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                        6. Step-by-step derivation
                          1. Applied rewrites38.3%

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{-0.5}{C}}\right)}{\mathsf{PI}\left(\right)} \]

                          if 2.5e51 < B

                          1. Initial program 48.4%

                            \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                          2. Add Preprocessing
                          3. Taylor expanded in B around inf

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                          4. Step-by-step derivation
                            1. Applied rewrites70.8%

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                          5. Recombined 3 regimes into one program.
                          6. Final simplification52.9%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -5.5 \cdot 10^{-31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                          7. Add Preprocessing

                          Alternative 11: 44.6% accurate, 2.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3.3 \cdot 10^{-192}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.1 \cdot 10^{-155}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                          (FPCore (A B C)
                           :precision binary64
                           (if (<= B -3.3e-192)
                             (* 180.0 (/ (atan 1.0) (PI)))
                             (if (<= B 1.1e-155)
                               (* 180.0 (/ (atan 0.0) (PI)))
                               (* 180.0 (/ (atan -1.0) (PI))))))
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;B \leq -3.3 \cdot 10^{-192}:\\
                          \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                          
                          \mathbf{elif}\;B \leq 1.1 \cdot 10^{-155}:\\
                          \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if B < -3.29999999999999989e-192

                            1. Initial program 49.4%

                              \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                            2. Add Preprocessing
                            3. Taylor expanded in B around -inf

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
                            4. Step-by-step derivation
                              1. Applied rewrites50.5%

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]

                              if -3.29999999999999989e-192 < B < 1.1e-155

                              1. Initial program 58.0%

                                \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                                2. lift-/.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{1}{B}} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                                3. associate-*l/N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                                4. *-lft-identityN/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                5. lift--.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                6. div-subN/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                                7. lower--.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                                8. lower-/.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - \frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                9. lower-/.f6449.1

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \color{blue}{\frac{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                                10. lift-sqrt.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                11. lift-+.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                12. +-commutativeN/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                13. lift-pow.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{{B}^{2}} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                14. unpow2N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                15. lift-pow.f64N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{{\left(A - C\right)}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                16. unpow2N/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                17. lower-hypot.f6450.2

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} - \frac{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              4. Applied rewrites50.2%

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                              5. Taylor expanded in C around inf

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \left(-1 \cdot \frac{A}{B} + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                              6. Step-by-step derivation
                                1. mul-1-negN/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\left(-1 \cdot \frac{A}{B} + \frac{A}{B}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
                                2. distribute-lft1-inN/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(-1 + 1\right) \cdot \frac{A}{B}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                                3. metadata-evalN/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\color{blue}{0} \cdot \frac{A}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
                                4. distribute-lft-neg-inN/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(0\right)\right) \cdot \frac{A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                                5. metadata-evalN/A

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{0} \cdot \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                6. mul0-lft35.3

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\mathsf{PI}\left(\right)} \]
                              7. Applied rewrites35.3%

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\mathsf{PI}\left(\right)} \]

                              if 1.1e-155 < B

                              1. Initial program 49.7%

                                \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                              2. Add Preprocessing
                              3. Taylor expanded in B around inf

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                              4. Step-by-step derivation
                                1. Applied rewrites50.1%

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                              5. Recombined 3 regimes into one program.
                              6. Final simplification46.7%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -3.3 \cdot 10^{-192}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.1 \cdot 10^{-155}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 12: 40.0% accurate, 2.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3.5 \cdot 10^{-301}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                              (FPCore (A B C)
                               :precision binary64
                               (if (<= B -3.5e-301)
                                 (* 180.0 (/ (atan 1.0) (PI)))
                                 (* 180.0 (/ (atan -1.0) (PI)))))
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;B \leq -3.5 \cdot 10^{-301}:\\
                              \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if B < -3.49999999999999992e-301

                                1. Initial program 50.2%

                                  \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                                2. Add Preprocessing
                                3. Taylor expanded in B around -inf

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites40.5%

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]

                                  if -3.49999999999999992e-301 < B

                                  1. Initial program 52.8%

                                    \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in B around inf

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites41.4%

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                                  5. Recombined 2 regimes into one program.
                                  6. Final simplification40.9%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -3.5 \cdot 10^{-301}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                                  7. Add Preprocessing

                                  Alternative 13: 20.9% accurate, 3.1× speedup?

                                  \[\begin{array}{l} \\ 180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \end{array} \]
                                  (FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) (PI))))
                                  \begin{array}{l}
                                  
                                  \\
                                  180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 51.5%

                                    \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in B around inf

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites22.2%

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                                    2. Final simplification22.2%

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \]
                                    3. Add Preprocessing

                                    Reproduce

                                    ?
                                    herbie shell --seed 2024364 
                                    (FPCore (A B C)
                                      :name "ABCF->ab-angle angle"
                                      :precision binary64
                                      (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) (PI))))