ABCF->ab-angle angle

Percentage Accurate: 54.0% → 81.5%
Time: 11.5s
Alternatives: 15
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 54.0% accurate, 1.0× speedup?

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

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

Alternative 1: 81.5% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 16.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5e71 < A

    1. Initial program 60.4%

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

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

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

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

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

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

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

Alternative 2: 72.7% 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 -5 \cdot 10^{-14}:\\ \;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-30}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\ \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 -5e-14)
     (/ (* (atan (- t_1 1.0)) 180.0) (PI))
     (if (<= t_0 5e-30)
       (/ (atan (* (/ B C) -0.5)) (* 0.005555555555555556 (PI)))
       (* (/ (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 -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\

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

\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)))))) < -5.0000000000000002e-14

    1. Initial program 56.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e-14 < (*.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)))))) < 4.99999999999999972e-30

    1. Initial program 21.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\tan^{-1} \mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{-1}{2} \cdot \frac{B}{C}\right)\right)}{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{180}}} \]
      9. metadata-evalN/A

        \[\leadsto \frac{\tan^{-1} \mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{-1}{2} \cdot \frac{B}{C}\right)\right)}{\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{1}{180}}} \]
    11. Applied rewrites64.9%

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

    if 4.99999999999999972e-30 < (*.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 54.2%

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - A}}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites75.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 simplification72.8%

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

Alternative 3: 72.7% 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 -5 \cdot 10^{-14}:\\ \;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-30}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\ \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 -5e-14)
     (* (/ (atan (- t_1 1.0)) (PI)) 180.0)
     (if (<= t_0 5e-30)
       (/ (atan (* (/ B C) -0.5)) (* 0.005555555555555556 (PI)))
       (* (/ (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 -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\

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

\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)))))) < -5.0000000000000002e-14

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

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

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

    if -5.0000000000000002e-14 < (*.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)))))) < 4.99999999999999972e-30

    1. Initial program 21.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\tan^{-1} \mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{-1}{2} \cdot \frac{B}{C}\right)\right)}{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{180}}} \]
      9. metadata-evalN/A

        \[\leadsto \frac{\tan^{-1} \mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{-1}{2} \cdot \frac{B}{C}\right)\right)}{\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{1}{180}}} \]
    11. Applied rewrites64.9%

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

    if 4.99999999999999972e-30 < (*.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 54.2%

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - A}}{B} + 1\right)}{\mathsf{PI}\left(\right)} \]
    5. Applied rewrites75.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 simplification72.8%

    \[\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 -5 \cdot 10^{-14}:\\ \;\;\;\;\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 5 \cdot 10^{-30}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.8% accurate, 1.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{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 < -7.5e15

    1. Initial program 21.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5e15 < A < 5e52

    1. Initial program 54.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e52 < A

    1. Initial program 74.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(\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--.f6483.0

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

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

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

Alternative 5: 47.1% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\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 -58000000000000.0)
   (* (/ (atan 1.0) (PI)) 180.0)
   (if (<= B -1.15e-100)
     (* (atan (* 0.5 (/ B A))) (/ 180.0 (PI)))
     (if (<= B 2.6e-138)
       (/ (atan (* (/ B C) -0.5)) (* 0.005555555555555556 (PI)))
       (if (<= B 1.32e-40)
         (* (/ (atan (* (/ C B) 2.0)) (PI)) 180.0)
         (* (/ (atan -1.0) (PI)) 180.0))))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq -58000000000000:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\

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

\mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\

\mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\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 5 regimes
  2. if B < -5.8e13

    1. Initial program 46.5%

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

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

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

      if -5.8e13 < B < -1.14999999999999997e-100

      1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.14999999999999997e-100 < B < 2.6e-138

      1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\tan^{-1} \mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{-1}{2} \cdot \frac{B}{C}\right)\right)}{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{180}}} \]
        9. metadata-evalN/A

          \[\leadsto \frac{\tan^{-1} \mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{-1}{2} \cdot \frac{B}{C}\right)\right)}{\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{1}{180}}} \]
      11. Applied rewrites44.9%

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

      if 2.6e-138 < B < 1.32000000000000009e-40

      1. Initial program 75.9%

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

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

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

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

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

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

      if 1.32000000000000009e-40 < B

      1. Initial program 47.1%

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
      7. Add Preprocessing

      Alternative 6: 47.1% accurate, 2.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot t\_0\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot t\_0\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\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
       (let* ((t_0 (/ 180.0 (PI))))
         (if (<= B -58000000000000.0)
           (* (/ (atan 1.0) (PI)) 180.0)
           (if (<= B -1.15e-100)
             (* (atan (* 0.5 (/ B A))) t_0)
             (if (<= B 2.6e-138)
               (* (atan (* (/ B C) -0.5)) t_0)
               (if (<= B 1.32e-40)
                 (* (/ (atan (* (/ C B) 2.0)) (PI)) 180.0)
                 (* (/ (atan -1.0) (PI)) 180.0)))))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
      \mathbf{if}\;B \leq -58000000000000:\\
      \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
      
      \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
      \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot t\_0\\
      
      \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\
      \;\;\;\;\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot t\_0\\
      
      \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\
      \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\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 5 regimes
      2. if B < -5.8e13

        1. Initial program 46.5%

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

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

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

          if -5.8e13 < B < -1.14999999999999997e-100

          1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.14999999999999997e-100 < B < 2.6e-138

          1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 2.6e-138 < B < 1.32000000000000009e-40

          1. Initial program 75.9%

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

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

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

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

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

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

          if 1.32000000000000009e-40 < B

          1. Initial program 47.1%

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
          7. Add Preprocessing

          Alternative 7: 47.1% accurate, 2.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\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 -58000000000000.0)
             (* (/ (atan 1.0) (PI)) 180.0)
             (if (<= B -1.15e-100)
               (* (atan (* 0.5 (/ B A))) (/ 180.0 (PI)))
               (if (<= B 2.6e-138)
                 (* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)
                 (if (<= B 1.32e-40)
                   (* (/ (atan (* (/ C B) 2.0)) (PI)) 180.0)
                   (* (/ (atan -1.0) (PI)) 180.0))))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;B \leq -58000000000000:\\
          \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
          \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\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 5 regimes
          2. if B < -5.8e13

            1. Initial program 46.5%

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

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

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

              if -5.8e13 < B < -1.14999999999999997e-100

              1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -1.14999999999999997e-100 < B < 2.6e-138

              1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 2.6e-138 < B < 1.32000000000000009e-40

                1. Initial program 75.9%

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

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

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

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

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

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

                if 1.32000000000000009e-40 < B

                1. Initial program 47.1%

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                7. Add Preprocessing

                Alternative 8: 47.1% accurate, 2.3× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\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 -58000000000000.0)
                   (* (/ (atan 1.0) (PI)) 180.0)
                   (if (<= B -1.15e-100)
                     (* (/ (atan (* (/ 0.5 A) B)) (PI)) 180.0)
                     (if (<= B 2.6e-138)
                       (* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)
                       (if (<= B 1.32e-40)
                         (* (/ (atan (* (/ C B) 2.0)) (PI)) 180.0)
                         (* (/ (atan -1.0) (PI)) 180.0))))))
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;B \leq -58000000000000:\\
                \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
                
                \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
                \;\;\;\;\frac{\tan^{-1} \left(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                
                \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\
                \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                
                \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\
                \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\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 5 regimes
                2. if B < -5.8e13

                  1. Initial program 46.5%

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

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

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

                    if -5.8e13 < B < -1.14999999999999997e-100

                    1. Initial program 41.6%

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

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

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

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

                      if -1.14999999999999997e-100 < B < 2.6e-138

                      1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 2.6e-138 < B < 1.32000000000000009e-40

                        1. Initial program 75.9%

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

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

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

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

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

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

                        if 1.32000000000000009e-40 < B

                        1. Initial program 47.1%

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

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                        7. Add Preprocessing

                        Alternative 9: 46.9% accurate, 2.4× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -58000000000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 6.1 \cdot 10^{+40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\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 -58000000000000.0)
                           (* (/ (atan 1.0) (PI)) 180.0)
                           (if (<= B -1.15e-100)
                             (* (/ (atan (* (/ 0.5 A) B)) (PI)) 180.0)
                             (if (<= B 6.1e+40)
                               (* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)
                               (* (/ (atan -1.0) (PI)) 180.0)))))
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;B \leq -58000000000000:\\
                        \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
                        
                        \mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
                        \;\;\;\;\frac{\tan^{-1} \left(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                        
                        \mathbf{elif}\;B \leq 6.1 \cdot 10^{+40}:\\
                        \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\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 4 regimes
                        2. if B < -5.8e13

                          1. Initial program 46.5%

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

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

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

                            if -5.8e13 < B < -1.14999999999999997e-100

                            1. Initial program 41.6%

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

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

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

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

                              if -1.14999999999999997e-100 < B < 6.1e40

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

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

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

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

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

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

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

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

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

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

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

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

                                if 6.1e40 < B

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

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

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

                                Alternative 10: 46.4% accurate, 2.5× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -6.4 \cdot 10^{-66}:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 6.1 \cdot 10^{+40}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\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 -6.4e-66)
                                   (* (/ (atan 1.0) (PI)) 180.0)
                                   (if (<= B 6.1e+40)
                                     (* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)
                                     (* (/ (atan -1.0) (PI)) 180.0))))
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;B \leq -6.4 \cdot 10^{-66}:\\
                                \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
                                
                                \mathbf{elif}\;B \leq 6.1 \cdot 10^{+40}:\\
                                \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\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 < -6.39999999999999963e-66

                                  1. Initial program 48.8%

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

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

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

                                    if -6.39999999999999963e-66 < B < 6.1e40

                                    1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 6.1e40 < B

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

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

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

                                      Alternative 11: 46.5% accurate, 2.5× speedup?

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

                                        1. Initial program 48.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 rewrites65.6%

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

                                          if -7.80000000000000013e-57 < B < 3.4999999999999999e40

                                          1. Initial program 56.3%

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

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

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

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

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

                                          if 3.4999999999999999e40 < B

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

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

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

                                          Alternative 12: 61.5% accurate, 2.5× speedup?

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

                                            1. Initial program 21.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if -7.2e15 < A

                                            1. Initial program 60.3%

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

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

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

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

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

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

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

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

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

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

                                          Alternative 13: 45.2% accurate, 2.8× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3.85 \cdot 10^{-66}:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 6.4 \cdot 10^{-78}:\\ \;\;\;\;\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.85e-66)
                                             (* (/ (atan 1.0) (PI)) 180.0)
                                             (if (<= B 6.4e-78)
                                               (* (/ (atan 0.0) (PI)) 180.0)
                                               (* (/ (atan -1.0) (PI)) 180.0))))
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;B \leq -3.85 \cdot 10^{-66}:\\
                                          \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
                                          
                                          \mathbf{elif}\;B \leq 6.4 \cdot 10^{-78}:\\
                                          \;\;\;\;\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 < -3.8500000000000001e-66

                                            1. Initial program 48.8%

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

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

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

                                              if -3.8500000000000001e-66 < B < 6.4e-78

                                              1. Initial program 52.7%

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

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

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

                                              if 6.4e-78 < B

                                              1. Initial program 49.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 rewrites52.9%

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

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -3.85 \cdot 10^{-66}:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 6.4 \cdot 10^{-78}:\\ \;\;\;\;\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 14: 29.4% accurate, 2.9× speedup?

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

                                                1. Initial program 50.9%

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

                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                                                4. Step-by-step derivation
                                                  1. 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-eval16.3

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

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

                                                if 6.4e-78 < B

                                                1. Initial program 49.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 rewrites52.9%

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

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6.4 \cdot 10^{-78}:\\ \;\;\;\;\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 15: 21.1% 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 50.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 rewrites21.4%

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

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

                                                  Reproduce

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