ABCF->ab-angle angle

Percentage Accurate: 54.5% → 81.4%
Time: 9.2s
Alternatives: 19
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 19 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: 81.4% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -6e103

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6e103 < A

    1. Initial program 58.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. 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.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)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.9%

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

Alternative 2: 60.5% accurate, 0.3× 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 -1:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{-14}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+307}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0
         (*
          (pow B -1.0)
          (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
   (if (<= t_0 -1.0)
     (/ (* (atan (/ (- C B) B)) 180.0) (PI))
     (if (<= t_0 1e-14)
       (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
       (if (<= t_0 5e+307)
         (* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI)))
         (* 180.0 (/ (atan (- 1.0 (/ A B))) (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 -1:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 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)))))) < -1

    1. Initial program 54.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 rewrites87.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 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.f6475.1

        \[\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 rewrites75.1%

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

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

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

      if -1 < (*.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)))))) < 9.99999999999999999e-15

      1. Initial program 17.0%

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

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

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

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

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

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

      if 9.99999999999999999e-15 < (*.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)))))) < 5e307

      1. Initial program 96.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}{\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--.f6496.6

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
      7. Step-by-step derivation
        1. Applied rewrites88.0%

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

        if 5e307 < (*.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 43.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 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.f6463.7

            \[\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 rewrites63.7%

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

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

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

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

        Alternative 3: 72.9% accurate, 0.3× speedup?

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

          1. Initial program 54.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 rewrites87.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(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)} \cdot 180}{\mathsf{PI}\left(\right)} \]
          6. Step-by-step derivation
            1. +-commutativeN/A

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

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

              \[\leadsto \frac{\tan^{-1} \left(\color{blue}{\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--.f6476.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 61.1%

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\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--.f6472.9

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

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

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

        Alternative 4: 72.9% accurate, 0.3× speedup?

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

          1. Initial program 54.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 rewrites87.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(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)} \cdot 180}{\mathsf{PI}\left(\right)} \]
          6. Step-by-step derivation
            1. +-commutativeN/A

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

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

              \[\leadsto \frac{\tan^{-1} \left(\color{blue}{\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--.f6476.5

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

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

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

          1. Initial program 17.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 61.1%

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\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--.f6472.9

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

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

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

        Alternative 5: 72.7% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\ t_1 := \frac{C - A}{B}\\ \mathbf{if}\;t\_0 \leq -40:\\ \;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-13}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
        (FPCore (A B C)
         :precision binary64
         (let* ((t_0
                 (*
                  180.0
                  (/
                   (atan
                    (*
                     (pow B -1.0)
                     (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
                   (PI))))
                (t_1 (/ (- C A) B)))
           (if (<= t_0 -40.0)
             (/ (* (atan (- t_1 1.0)) 180.0) (PI))
             (if (<= t_0 5e-13)
               (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
               (* 180.0 (/ (atan (+ t_1 1.0)) (PI)))))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\
        t_1 := \frac{C - A}{B}\\
        \mathbf{if}\;t\_0 \leq -40:\\
        \;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-13}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -40

          1. Initial program 54.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 rewrites87.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(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)} \cdot 180}{\mathsf{PI}\left(\right)} \]
          6. Step-by-step derivation
            1. +-commutativeN/A

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

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

              \[\leadsto \frac{\tan^{-1} \left(\color{blue}{\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--.f6476.5

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

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

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

          1. Initial program 17.0%

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

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

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

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

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

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

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

          1. Initial program 61.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}{\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--.f6473.5

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

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

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

        Alternative 6: 72.7% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\ t_1 := \frac{C - A}{B}\\ \mathbf{if}\;t\_0 \leq -40:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-13}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
        (FPCore (A B C)
         :precision binary64
         (let* ((t_0
                 (*
                  180.0
                  (/
                   (atan
                    (*
                     (pow B -1.0)
                     (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
                   (PI))))
                (t_1 (/ (- C A) B)))
           (if (<= t_0 -40.0)
             (* 180.0 (/ (atan (- t_1 1.0)) (PI)))
             (if (<= t_0 5e-13)
               (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
               (* 180.0 (/ (atan (+ t_1 1.0)) (PI)))))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\
        t_1 := \frac{C - A}{B}\\
        \mathbf{if}\;t\_0 \leq -40:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-13}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -40

          1. Initial program 54.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}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

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

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

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

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

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

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

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

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

          1. Initial program 17.0%

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

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

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

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

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

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

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

          1. Initial program 61.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}{\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--.f6473.5

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

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

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

        Alternative 7: 66.9% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;t\_0 \leq -40:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-13}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
        (FPCore (A B C)
         :precision binary64
         (let* ((t_0
                 (*
                  180.0
                  (/
                   (atan
                    (*
                     (pow B -1.0)
                     (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
                   (PI)))))
           (if (<= t_0 -40.0)
             (/ (* (atan (/ (- C B) B)) 180.0) (PI))
             (if (<= t_0 5e-13)
               (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
               (* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI)))))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\
        \mathbf{if}\;t\_0 \leq -40:\\
        \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-13}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -40

          1. Initial program 54.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 rewrites87.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 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.f6475.1

              \[\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 rewrites75.1%

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

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

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

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

            1. Initial program 17.0%

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

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

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

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

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

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

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

            1. Initial program 61.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}{\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--.f6473.5

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

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

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

          Alternative 8: 78.0% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -5.50000000000000001e103 < A < 1.8999999999999999e-40

            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 A around 0

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

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

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

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

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

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

            if 1.8999999999999999e-40 < A

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

                \[\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 rewrites83.6%

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

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

          Alternative 9: 78.0% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -5.50000000000000001e103 < A < 1.8999999999999999e-40

            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. 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 rewrites80.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)}} \]
            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.f6478.9

                \[\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 rewrites78.9%

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

            if 1.8999999999999999e-40 < A

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

                \[\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 rewrites83.6%

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

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

          Alternative 10: 75.9% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -5.50000000000000001e103 < A < 2.75e20

            1. Initial program 52.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 rewrites79.0%

              \[\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.f6477.2

                \[\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 rewrites77.2%

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

            if 2.75e20 < A

            1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

          Alternative 11: 75.9% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -5.50000000000000001e103 < A < 2.75e20

            1. Initial program 52.4%

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

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

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

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

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

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

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

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

            if 2.75e20 < A

            1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

          Alternative 12: 59.2% accurate, 2.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -9.6 \cdot 10^{+54}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq -1.12 \cdot 10^{-148}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 5.2 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B + A}{-B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
          (FPCore (A B C)
           :precision binary64
           (if (<= A -9.6e+54)
             (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
             (if (<= A -1.12e-148)
               (/ (* (atan (/ (- C B) B)) 180.0) (PI))
               (if (<= A 5.2e-183)
                 (* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI)))
                 (/ (* (atan (/ (+ B A) (- B))) 180.0) (PI))))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;A \leq -9.6 \cdot 10^{+54}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;A \leq -1.12 \cdot 10^{-148}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;A \leq 5.2 \cdot 10^{-183}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{B + A}{-B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if A < -9.59999999999999993e54

            1. Initial program 19.0%

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

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

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

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

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

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

            if -9.59999999999999993e54 < A < -1.1199999999999999e-148

            1. Initial program 52.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. 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 rewrites80.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.f6480.4

                \[\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 rewrites80.4%

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

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

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

              if -1.1199999999999999e-148 < A < 5.1999999999999998e-183

              1. Initial program 55.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--.f6452.3

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
              7. Step-by-step derivation
                1. Applied rewrites52.3%

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

                if 5.1999999999999998e-183 < A

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

                    \[\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 rewrites77.7%

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A + B}{-\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                7. Step-by-step derivation
                  1. Applied rewrites66.9%

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

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -9.6 \cdot 10^{+54}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq -1.12 \cdot 10^{-148}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 5.2 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B + A}{-B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                10. Add Preprocessing

                Alternative 13: 59.2% accurate, 2.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -9.6 \cdot 10^{+54}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq -1.12 \cdot 10^{-148}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 5.2 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                (FPCore (A B C)
                 :precision binary64
                 (if (<= A -9.6e+54)
                   (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
                   (if (<= A -1.12e-148)
                     (/ (* (atan (/ (- C B) B)) 180.0) (PI))
                     (if (<= A 5.2e-183)
                       (* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI)))
                       (* 180.0 (/ (atan (/ (+ B A) (- B))) (PI)))))))
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;A \leq -9.6 \cdot 10^{+54}:\\
                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
                
                \mathbf{elif}\;A \leq -1.12 \cdot 10^{-148}:\\
                \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                
                \mathbf{elif}\;A \leq 5.2 \cdot 10^{-183}:\\
                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if A < -9.59999999999999993e54

                  1. Initial program 19.0%

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

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

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

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

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

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

                  if -9.59999999999999993e54 < A < -1.1199999999999999e-148

                  1. Initial program 52.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. 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 rewrites80.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.f6480.4

                      \[\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 rewrites80.4%

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

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

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

                    if -1.1199999999999999e-148 < A < 5.1999999999999998e-183

                    1. Initial program 55.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--.f6452.3

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites52.3%

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

                      if 5.1999999999999998e-183 < A

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

                          \[\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 rewrites77.7%

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

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A + B}{-\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                      7. Step-by-step derivation
                        1. Applied rewrites66.9%

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -9.6 \cdot 10^{+54}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq -1.12 \cdot 10^{-148}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 5.2 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 14: 54.9% accurate, 2.5× speedup?

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

                        1. Initial program 59.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}{\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--.f6468.1

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites57.9%

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

                          if 5.9999999999999997e-269 < B < 1.05e-225

                          1. Initial program 34.1%

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

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                          if 1.05e-225 < B

                          1. Initial program 47.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. 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 rewrites76.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 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.f6466.2

                              \[\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 rewrites66.2%

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6 \cdot 10^{-269}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.05 \cdot 10^{-225}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                          12. Add Preprocessing

                          Alternative 15: 51.1% accurate, 2.6× speedup?

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

                            1. Initial program 56.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}{\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--.f6458.6

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

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
                            7. Step-by-step derivation
                              1. Applied rewrites48.5%

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

                              if 3.79999999999999979e-41 < B

                              1. Initial program 41.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 rewrites61.4%

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

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

                              Alternative 16: 50.2% accurate, 2.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1.75 \cdot 10^{-264}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.75 \cdot 10^{-129}:\\ \;\;\;\;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.75e-264)
                                 (* 180.0 (/ (atan (- 1.0 (/ A B))) (PI)))
                                 (if (<= B 2.75e-129)
                                   (* 180.0 (/ (atan 0.0) (PI)))
                                   (* 180.0 (/ (atan -1.0) (PI))))))
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;B \leq 1.75 \cdot 10^{-264}:\\
                              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)}\\
                              
                              \mathbf{elif}\;B \leq 2.75 \cdot 10^{-129}:\\
                              \;\;\;\;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 < 1.75e-264

                                1. Initial program 59.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} \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.f6462.1

                                    \[\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 rewrites62.1%

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

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

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

                                  if 1.75e-264 < B < 2.75000000000000012e-129

                                  1. Initial program 42.6%

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

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

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                                  if 2.75000000000000012e-129 < B

                                  1. Initial program 47.4%

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

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

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

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

                                  Alternative 17: 44.6% accurate, 2.8× speedup?

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

                                    1. Initial program 53.1%

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

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

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

                                      if -4.8999999999999999e-80 < B < 2.75000000000000012e-129

                                      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. 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. mul-1-negN/A

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

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                                      if 2.75000000000000012e-129 < B

                                      1. Initial program 47.4%

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

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

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

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

                                      Alternative 18: 39.7% accurate, 2.9× speedup?

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

                                        1. Initial program 57.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 rewrites40.0%

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

                                          if -4.999999999999985e-310 < B

                                          1. Initial program 47.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 rewrites41.5%

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

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

                                          Alternative 19: 20.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 52.1%

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

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

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

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

                                            Reproduce

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