ABCF->ab-angle angle

Percentage Accurate: 52.8% → 80.2%
Time: 11.3s
Alternatives: 17
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 17 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: 52.8% 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: 80.2% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 9.1%

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

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

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

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

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

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

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

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

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

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

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

    if -5.8000000000000003e192 < A

    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. 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. clear-numN/A

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

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

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

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

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

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

        \[\leadsto \frac{1}{0.005555555555555556 \cdot \color{blue}{\frac{\mathsf{PI}\left(\right)}{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}}} \]
    4. Applied rewrites82.8%

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

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

Alternative 2: 72.5% accurate, 0.5× speedup?

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

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

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

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


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

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

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

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

    if -9.9999999999999998e-86 < (*.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.99999999999999991e-6

    1. Initial program 21.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 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-/.f6459.0

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

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

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

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

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

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

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

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

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

    if 1.99999999999999991e-6 < (*.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 62.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. 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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 72.5% accurate, 0.6× speedup?

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

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

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

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


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

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

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

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

    if -9.9999999999999998e-86 < (*.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.99999999999999991e-6

    1. Initial program 21.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 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-/.f6459.0

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

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

    if 1.99999999999999991e-6 < (*.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 62.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. 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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 72.5% accurate, 0.6× speedup?

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

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

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

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


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

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

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

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

    if -9.9999999999999998e-86 < (*.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.99999999999999991e-6

    1. Initial program 21.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 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-/.f6459.0

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

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

    if 1.99999999999999991e-6 < (*.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 62.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--.f6477.6

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

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

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

Alternative 5: 67.3% accurate, 0.6× speedup?

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

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

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

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


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

    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. +-commutativeN/A

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

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

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

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

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

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

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

      if -9.9999999999999998e-86 < (*.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.99999999999999991e-6

      1. Initial program 21.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 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-/.f6459.0

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

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

      if 1.99999999999999991e-6 < (*.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 62.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--.f6477.6

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

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

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

    Alternative 6: 80.2% accurate, 1.4× speedup?

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

      1. Initial program 9.1%

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

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

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

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

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

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

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

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

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

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

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

      if -5.8000000000000003e192 < A

      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. 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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 77.0% accurate, 1.5× speedup?

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

      1. Initial program 25.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 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-/.f6471.9

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

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

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

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

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

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

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

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

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

      if -3.89999999999999999e31 < A < 3.8000000000000001e-97

      1. Initial program 53.8%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in A around 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. +-commutativeN/A

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

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

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

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

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

      if 3.8000000000000001e-97 < A

      1. Initial program 71.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.f6487.3

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

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

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

    Alternative 8: 74.6% accurate, 1.5× speedup?

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

      1. Initial program 25.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 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-/.f6471.9

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

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

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

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

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

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

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

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

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

      if -3.89999999999999999e31 < A < 1.04999999999999999e75

      1. Initial program 56.8%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in A around 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. +-commutativeN/A

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

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

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

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

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

      if 1.04999999999999999e75 < A

      1. Initial program 79.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(\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--.f6490.2

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

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

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

    Alternative 9: 59.4% accurate, 2.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.4 \cdot 10^{-29}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 2.1 \cdot 10^{-237}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 9.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= A -1.4e-29)
       (/ (* 180.0 (atan (* (/ B A) 0.5))) (PI))
       (if (<= A 2.1e-237)
         (* (/ (atan (/ (- C B) B)) (PI)) 180.0)
         (if (<= A 9.5e-125)
           (* (/ (atan (+ (/ C B) 1.0)) (PI)) 180.0)
           (* (/ (atan (- -1.0 (/ A B))) (PI)) 180.0)))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;A \leq -1.4 \cdot 10^{-29}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;A \leq 2.1 \cdot 10^{-237}:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
    
    \mathbf{elif}\;A \leq 9.5 \cdot 10^{-125}:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if A < -1.4000000000000001e-29

      1. Initial program 25.8%

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

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

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

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

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

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

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

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

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

      if -1.4000000000000001e-29 < A < 2.1000000000000001e-237

      1. Initial program 57.1%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in A around 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. +-commutativeN/A

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

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

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

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

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

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

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

        if 2.1000000000000001e-237 < A < 9.50000000000000031e-125

        1. Initial program 68.7%

          \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in A around 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. +-commutativeN/A

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

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

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

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

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

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

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

          if 9.50000000000000031e-125 < A

          1. Initial program 69.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 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.f6485.2

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

            \[\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 \cdot \frac{A}{B} - \color{blue}{1}\right)}{\mathsf{PI}\left(\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites70.2%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -1.4 \cdot 10^{-29}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 2.1 \cdot 10^{-237}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 9.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
          10. Add Preprocessing

          Alternative 10: 59.4% accurate, 2.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.4 \cdot 10^{-29}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 2.1 \cdot 10^{-237}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 9.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
          (FPCore (A B C)
           :precision binary64
           (if (<= A -1.4e-29)
             (* (/ (atan (* (/ B A) 0.5)) (PI)) 180.0)
             (if (<= A 2.1e-237)
               (* (/ (atan (/ (- C B) B)) (PI)) 180.0)
               (if (<= A 9.5e-125)
                 (* (/ (atan (+ (/ C B) 1.0)) (PI)) 180.0)
                 (* (/ (atan (- -1.0 (/ A B))) (PI)) 180.0)))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;A \leq -1.4 \cdot 10^{-29}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{elif}\;A \leq 2.1 \cdot 10^{-237}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{elif}\;A \leq 9.5 \cdot 10^{-125}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if A < -1.4000000000000001e-29

            1. Initial program 25.8%

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

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

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

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

            if -1.4000000000000001e-29 < A < 2.1000000000000001e-237

            1. Initial program 57.1%

              \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in A around 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. +-commutativeN/A

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

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

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

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

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

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

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

              if 2.1000000000000001e-237 < A < 9.50000000000000031e-125

              1. Initial program 68.7%

                \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in A around 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. +-commutativeN/A

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

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

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

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

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

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

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

                if 9.50000000000000031e-125 < A

                1. Initial program 69.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 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.f6485.2

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

                  \[\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 \cdot \frac{A}{B} - \color{blue}{1}\right)}{\mathsf{PI}\left(\right)} \]
                7. Step-by-step derivation
                  1. Applied rewrites70.2%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -1.4 \cdot 10^{-29}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 2.1 \cdot 10^{-237}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 9.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                10. Add Preprocessing

                Alternative 11: 55.0% accurate, 2.5× speedup?

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

                  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. 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. +-commutativeN/A

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

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

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

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

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

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

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

                    if -5.7999999999999996e-225 < B < 1.2000000000000001e-252

                    1. Initial program 48.4%

                      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in 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. distribute-rgt1-inN/A

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

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

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

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

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

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

                    if 1.2000000000000001e-252 < 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 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. +-commutativeN/A

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

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

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

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

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

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

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

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

                    Alternative 12: 54.7% accurate, 2.5× speedup?

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

                      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. 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. +-commutativeN/A

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

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

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

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

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

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

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

                        if -5.7999999999999996e-225 < B < 3.4000000000000002e-213

                        1. Initial program 50.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 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. distribute-rgt1-inN/A

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

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

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

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

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

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

                        if 3.4000000000000002e-213 < B

                        1. Initial program 46.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.f6467.3

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

                          \[\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 \cdot \frac{A}{B} - \color{blue}{1}\right)}{\mathsf{PI}\left(\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites63.0%

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

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

                        Alternative 13: 55.5% accurate, 2.5× speedup?

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

                          1. Initial program 57.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.f6461.3

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

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

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

                            if -2.09999999999999993e-295 < B < 3.4000000000000002e-213

                            1. Initial program 49.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 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. distribute-rgt1-inN/A

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

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

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

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

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

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

                            if 3.4000000000000002e-213 < B

                            1. Initial program 46.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.f6467.3

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

                              \[\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 \cdot \frac{A}{B} - \color{blue}{1}\right)}{\mathsf{PI}\left(\right)} \]
                            7. Step-by-step derivation
                              1. Applied rewrites63.0%

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

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

                            Alternative 14: 50.0% accurate, 2.5× speedup?

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

                              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. 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 rewrites47.3%

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

                                if -1.59999999999999986e-144 < B < 3.4000000000000002e-213

                                1. Initial program 52.8%

                                  \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                                2. Add Preprocessing
                                3. Taylor expanded in 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. distribute-rgt1-inN/A

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

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

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

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

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

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

                                if 3.4000000000000002e-213 < B

                                1. Initial program 46.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.f6467.3

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

                                  \[\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 \cdot \frac{A}{B} - \color{blue}{1}\right)}{\mathsf{PI}\left(\right)} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites63.0%

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

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

                                Alternative 15: 44.8% accurate, 2.8× speedup?

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

                                  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. 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 rewrites47.3%

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

                                    if -1.59999999999999986e-144 < B < 3.7999999999999998e-181

                                    1. Initial program 52.8%

                                      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in 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. distribute-rgt1-inN/A

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

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

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

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

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

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

                                    if 3.7999999999999998e-181 < B

                                    1. Initial program 46.3%

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

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

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

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

                                    Alternative 16: 29.3% accurate, 2.9× speedup?

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

                                      1. Initial program 56.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. distribute-rgt1-inN/A

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

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

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

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

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

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

                                      if 3.7999999999999998e-181 < B

                                      1. Initial program 46.3%

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

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

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

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

                                      Alternative 17: 21.8% accurate, 3.1× speedup?

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

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

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

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

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

                                        Reproduce

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