ABCF->ab-angle angle

Percentage Accurate: 54.5% → 82.4%
Time: 10.1s
Alternatives: 15
Speedup: 2.5×

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 15 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: 54.5% 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: 82.4% 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)\\ \mathbf{if}\;t\_0 \leq -0.5 \lor \neg \left(t\_0 \leq 0\right):\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\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)))))))
   (if (or (<= t_0 -0.5) (not (<= t_0 0.0)))
     (/ (* (atan (/ (- (- C A) (hypot B (- A C))) B)) 180.0) (PI))
     (/ (* (atan (* (/ B A) 0.5)) 180.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)\\
\mathbf{if}\;t\_0 \leq -0.5 \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 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.5 or 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 56.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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{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. lift-/.f64N/A

        \[\leadsto 180 \cdot \color{blue}{\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)}} \]
      3. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
    4. Applied rewrites90.1%

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

    if -0.5 < (*.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 15.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 \color{blue}{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. lift-/.f64N/A

        \[\leadsto 180 \cdot \color{blue}{\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)}} \]
      3. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
    4. Applied rewrites15.2%

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

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

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

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

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

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

    \[\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.5 \lor \neg \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq 0\right):\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 66.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.6 \cdot 10^{-241}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)\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 -1.82e-137)
   (/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
   (if (<= B -4.6e-241)
     (* 180.0 (/ (atan (fma (* (+ (/ A C) 1.0) (/ B C)) -0.5 0.0)) (PI)))
     (if (<= B 2.4e+153)
       (*
        180.0
        (/ (atan (* (pow B -1.0) (- (- C A) (sqrt (fma B B (* A A)))))) (PI)))
       (* 180.0 (/ (atan -1.0) (PI)))))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\

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

\mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)\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 4 regimes
  2. if B < -1.82e-137

    1. Initial program 53.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 \color{blue}{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. lift-/.f64N/A

        \[\leadsto 180 \cdot \color{blue}{\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)}} \]
      3. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
    4. Applied rewrites79.4%

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

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

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

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

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

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

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

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

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

    if -1.82e-137 < B < -4.5999999999999999e-241

    1. Initial program 52.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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5999999999999999e-241 < B < 2.39999999999999992e153

    1. Initial program 61.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 C around 0

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(B, B, \color{blue}{A \cdot A}\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
      5. lower-*.f6459.8

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

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

    if 2.39999999999999992e153 < B

    1. Initial program 24.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}{-1}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites86.1%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.6 \cdot 10^{-241}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 78.3% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq -0.005:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;C \leq 7 \cdot 10^{+126}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(B, A\right) + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= C -0.005)
       (/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
       (if (<= C 7e+126)
         (* 180.0 (/ (atan (/ (+ (hypot B A) A) (- B))) (PI)))
         (* 180.0 (/ (atan (fma (* (+ (/ A C) 1.0) (/ B C)) -0.5 0.0)) (PI))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;C \leq -0.005:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;C \leq 7 \cdot 10^{+126}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(B, A\right) + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if C < -0.0050000000000000001

      1. Initial program 77.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 \color{blue}{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. lift-/.f64N/A

          \[\leadsto 180 \cdot \color{blue}{\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)}} \]
        3. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
      4. Applied rewrites92.3%

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

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

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

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

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

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

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

      if -0.0050000000000000001 < C < 7.0000000000000005e126

      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 0

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(B, A\right) + A}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        12. lower-neg.f6479.3

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

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

      if 7.0000000000000005e126 < C

      1. Initial program 18.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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}}{\mathsf{PI}\left(\right)} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 4: 73.9% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -9.6 \cdot 10^{+107}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 3.6 \cdot 10^{+195}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= A -9.6e+107)
       (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
       (if (<= A 3.6e+195)
         (/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
         (/ (* (atan (/ (- (- C A) (sqrt (* B B))) B)) 180.0) (PI)))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;A \leq -9.6 \cdot 10^{+107}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;A \leq 3.6 \cdot 10^{+195}:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if A < -9.6000000000000002e107

      1. Initial program 13.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 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-/.f6473.6

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

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

      if -9.6000000000000002e107 < A < 3.5999999999999999e195

      1. Initial program 57.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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{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. lift-/.f64N/A

          \[\leadsto 180 \cdot \color{blue}{\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)}} \]
        3. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
      4. Applied rewrites83.6%

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

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

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

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

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

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

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

      if 3.5999999999999999e195 < A

      1. Initial program 96.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} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{{B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. unpow2N/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{B \cdot 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(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{B \cdot B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
        2. lift-/.f64N/A

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

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

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

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

    Alternative 5: 64.9% accurate, 2.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -3.2 \cdot 10^{-243}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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
     (if (<= B -1.82e-137)
       (/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
       (if (<= B -3.2e-243)
         (* 180.0 (/ (atan (fma (* (+ (/ A C) 1.0) (/ B C)) -0.5 0.0)) (PI)))
         (if (<= B 2.4e+153)
           (/ (* (atan (/ (- (- C A) (sqrt (* B B))) B)) 180.0) (PI))
           (* 180.0 (/ (atan -1.0) (PI)))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;B \leq -3.2 \cdot 10^{-243}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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 < -1.82e-137

      1. Initial program 53.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 \color{blue}{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. lift-/.f64N/A

          \[\leadsto 180 \cdot \color{blue}{\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)}} \]
        3. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
      4. Applied rewrites79.4%

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

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

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

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

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

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

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

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

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

      if -1.82e-137 < B < -3.1999999999999998e-243

      1. Initial program 52.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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.1999999999999998e-243 < B < 2.39999999999999992e153

      1. Initial program 61.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 B around inf

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{B \cdot 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(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{B \cdot B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
        2. lift-/.f64N/A

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

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

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

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

      if 2.39999999999999992e153 < B

      1. Initial program 24.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}{-1}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. Applied rewrites86.1%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -3.2 \cdot 10^{-243}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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 6: 64.8% accurate, 2.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -3.2 \cdot 10^{-243}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{A}{C}, B, B\right) \cdot -0.5}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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
       (if (<= B -1.82e-137)
         (/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
         (if (<= B -3.2e-243)
           (/ (* (atan (/ (* (fma (/ A C) B B) -0.5) C)) 180.0) (PI))
           (if (<= B 2.4e+153)
             (/ (* (atan (/ (- (- C A) (sqrt (* B B))) B)) 180.0) (PI))
             (* 180.0 (/ (atan -1.0) (PI)))))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\
      \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
      
      \mathbf{elif}\;B \leq -3.2 \cdot 10^{-243}:\\
      \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{A}{C}, B, B\right) \cdot -0.5}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
      
      \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\
      \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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 < -1.82e-137

        1. Initial program 53.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 \color{blue}{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. lift-/.f64N/A

            \[\leadsto 180 \cdot \color{blue}{\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)}} \]
          3. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
          4. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
        4. Applied rewrites79.4%

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

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

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

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

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

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

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

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

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

        if -1.82e-137 < B < -3.1999999999999998e-243

        1. Initial program 52.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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -3.1999999999999998e-243 < B < 2.39999999999999992e153

        1. Initial program 61.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 B around inf

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{B \cdot 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(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{B \cdot B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
          2. lift-/.f64N/A

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

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

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

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

        if 2.39999999999999992e153 < B

        1. Initial program 24.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}{-1}}{\mathsf{PI}\left(\right)} \]
        4. Step-by-step derivation
          1. Applied rewrites86.1%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -3.2 \cdot 10^{-243}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{A}{C}, B, B\right) \cdot -0.5}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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: 65.4% accurate, 2.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1 \cdot 10^{+158}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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
         (if (<= B -1e+158)
           (/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
           (if (<= B 2.4e+153)
             (/ (* (atan (/ (- (- C A) (sqrt (* B B))) B)) 180.0) (PI))
             (* 180.0 (/ (atan -1.0) (PI))))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;B \leq -1 \cdot 10^{+158}:\\
        \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\
        \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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 3 regimes
        2. if B < -9.99999999999999953e157

          1. Initial program 27.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 \color{blue}{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. lift-/.f64N/A

              \[\leadsto 180 \cdot \color{blue}{\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)}} \]
            3. associate-*r/N/A

              \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
            4. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
          4. Applied rewrites85.9%

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

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

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

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

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

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

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

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

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

          if -9.99999999999999953e157 < B < 2.39999999999999992e153

          1. Initial program 63.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} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{{B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
          4. Step-by-step derivation
            1. unpow2N/A

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{B \cdot 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(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{B \cdot B}\right)\right)}{\mathsf{PI}\left(\right)}} \]
            2. lift-/.f64N/A

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

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

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

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

          if 2.39999999999999992e153 < B

          1. Initial program 24.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}{-1}}{\mathsf{PI}\left(\right)} \]
          4. Step-by-step derivation
            1. Applied rewrites86.1%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1 \cdot 10^{+158}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\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: 47.5% accurate, 2.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -2.3 \cdot 10^{-224}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.9 \cdot 10^{-112}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.55 \cdot 10^{-23}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\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 -1.25e-71)
             (* 180.0 (/ (atan 1.0) (PI)))
             (if (<= B -2.3e-224)
               (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
               (if (<= B 2.9e-112)
                 (* 180.0 (/ (atan 0.0) (PI)))
                 (if (<= B 1.55e-23)
                   (* 180.0 (/ (atan (* (/ C B) 2.0)) (PI)))
                   (* 180.0 (/ (atan -1.0) (PI))))))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;B \leq -2.3 \cdot 10^{-224}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;B \leq 2.9 \cdot 10^{-112}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;B \leq 1.55 \cdot 10^{-23}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\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 5 regimes
          2. if B < -1.24999999999999999e-71

            1. Initial program 53.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 B around -inf

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

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

              if -1.24999999999999999e-71 < B < -2.29999999999999988e-224

              1. Initial program 58.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 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-/.f6448.8

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

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

              if -2.29999999999999988e-224 < B < 2.89999999999999992e-112

              1. Initial program 52.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 C around inf

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

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

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

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

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

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

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

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

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

              if 2.89999999999999992e-112 < B < 1.5499999999999999e-23

              1. Initial program 73.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(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-/.f6462.7

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

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

              if 1.5499999999999999e-23 < B

              1. Initial program 41.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}{-1}}{\mathsf{PI}\left(\right)} \]
              4. Step-by-step derivation
                1. Applied rewrites67.4%

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

              Alternative 9: 47.3% accurate, 2.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -2.3 \cdot 10^{-224}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 3.6 \cdot 10^{+22}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\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 -1.25e-71)
                 (* 180.0 (/ (atan 1.0) (PI)))
                 (if (<= B -2.3e-224)
                   (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
                   (if (<= B 3.6e+22)
                     (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
                     (* 180.0 (/ (atan -1.0) (PI)))))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;B \leq -2.3 \cdot 10^{-224}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;B \leq 3.6 \cdot 10^{+22}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\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 4 regimes
              2. if B < -1.24999999999999999e-71

                1. Initial program 53.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 B around -inf

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

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

                  if -1.24999999999999999e-71 < B < -2.29999999999999988e-224

                  1. Initial program 58.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 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-/.f6448.8

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

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

                  if -2.29999999999999988e-224 < B < 3.6e22

                  1. Initial program 56.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 -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-/.f6441.3

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

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

                  if 3.6e22 < B

                  1. Initial program 40.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 rewrites73.2%

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

                  Alternative 10: 47.7% accurate, 2.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.75 \cdot 10^{-42}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\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 -1.25e-71)
                     (* 180.0 (/ (atan 1.0) (PI)))
                     (if (<= B 1.75e-42)
                       (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
                       (* 180.0 (/ (atan -1.0) (PI))))))
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                  
                  \mathbf{elif}\;B \leq 1.75 \cdot 10^{-42}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\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 < -1.24999999999999999e-71

                    1. Initial program 53.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 B around -inf

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

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

                      if -1.24999999999999999e-71 < B < 1.7500000000000001e-42

                      1. Initial program 58.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.6

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

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

                      if 1.7500000000000001e-42 < B

                      1. Initial program 41.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 rewrites63.5%

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

                      Alternative 11: 60.9% accurate, 2.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 3.4 \cdot 10^{-15}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\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
                       (if (<= B 3.4e-15)
                         (/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
                         (* 180.0 (/ (atan -1.0) (PI)))))
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;B \leq 3.4 \cdot 10^{-15}:\\
                      \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\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 2 regimes
                      2. if B < 3.4e-15

                        1. Initial program 56.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 \color{blue}{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. lift-/.f64N/A

                            \[\leadsto 180 \cdot \color{blue}{\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)}} \]
                          3. associate-*r/N/A

                            \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
                          4. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{180 \cdot \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)}} \]
                        4. Applied rewrites81.5%

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

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

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

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

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

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

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

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

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

                        if 3.4e-15 < B

                        1. Initial program 38.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}{-1}}{\mathsf{PI}\left(\right)} \]
                        4. Step-by-step derivation
                          1. Applied rewrites68.4%

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.4 \cdot 10^{-15}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\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 12: 60.9% accurate, 2.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 3.4 \cdot 10^{-15}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\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 3.4e-15)
                           (* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI)))
                           (* 180.0 (/ (atan -1.0) (PI)))))
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;B \leq 3.4 \cdot 10^{-15}:\\
                        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\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 2 regimes
                        2. if B < 3.4e-15

                          1. Initial program 56.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.7

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

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

                          if 3.4e-15 < B

                          1. Initial program 38.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}{-1}}{\mathsf{PI}\left(\right)} \]
                          4. Step-by-step derivation
                            1. Applied rewrites68.4%

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

                          Alternative 13: 45.3% accurate, 2.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -2.8 \cdot 10^{-81}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.15 \cdot 10^{-114}:\\ \;\;\;\;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 -2.8e-81)
                             (* 180.0 (/ (atan 1.0) (PI)))
                             (if (<= B 1.15e-114)
                               (* 180.0 (/ (atan 0.0) (PI)))
                               (* 180.0 (/ (atan -1.0) (PI))))))
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;B \leq -2.8 \cdot 10^{-81}:\\
                          \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                          
                          \mathbf{elif}\;B \leq 1.15 \cdot 10^{-114}:\\
                          \;\;\;\;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 < -2.7999999999999999e-81

                            1. Initial program 53.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 rewrites58.2%

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

                              if -2.7999999999999999e-81 < B < 1.15e-114

                              1. Initial program 53.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(-1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                              4. Step-by-step derivation
                                1. associate-*r/N/A

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

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

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

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

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

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

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

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

                              if 1.15e-114 < B

                              1. Initial program 48.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}{-1}}{\mathsf{PI}\left(\right)} \]
                              4. Step-by-step derivation
                                1. Applied rewrites56.4%

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

                              Alternative 14: 29.6% accurate, 2.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1.15 \cdot 10^{-114}:\\ \;\;\;\;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 1.15e-114)
                                 (* 180.0 (/ (atan 0.0) (PI)))
                                 (* 180.0 (/ (atan -1.0) (PI)))))
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;B \leq 1.15 \cdot 10^{-114}:\\
                              \;\;\;\;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 2 regimes
                              2. if B < 1.15e-114

                                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}\right)}}{\mathsf{PI}\left(\right)} \]
                                4. Step-by-step derivation
                                  1. associate-*r/N/A

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

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

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

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

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

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

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

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

                                if 1.15e-114 < B

                                1. Initial program 48.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}{-1}}{\mathsf{PI}\left(\right)} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites56.4%

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

                                Alternative 15: 21.4% 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.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}{-1}}{\mathsf{PI}\left(\right)} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites21.3%

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

                                  Reproduce

                                  ?
                                  herbie shell --seed 2024322 
                                  (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))))