ABCF->ab-angle angle

Percentage Accurate: 53.7% → 80.8%
Time: 11.1s
Alternatives: 16
Speedup: 1.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 16 alternatives:

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

Initial Program: 53.7% accurate, 1.0× speedup?

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

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

Alternative 1: 80.8% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 9.59999999999999947e70

    1. Initial program 66.7%

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

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

        \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \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. lift-/.f64N/A

        \[\leadsto \frac{180}{1} \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)}} \]
      4. times-fracN/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)}{1 \cdot \mathsf{PI}\left(\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
      6. times-fracN/A

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

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

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

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

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

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

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

    if 9.59999999999999947e70 < C

    1. Initial program 12.3%

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

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

        \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \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. lift-/.f64N/A

        \[\leadsto \frac{180}{1} \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)}} \]
      4. times-fracN/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)}{1 \cdot \mathsf{PI}\left(\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 73.3% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 29.4%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 73.3% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 29.4%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 60.1%

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

        \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \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. lift-/.f64N/A

        \[\leadsto \frac{180}{1} \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)}} \]
      4. times-fracN/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)}{1 \cdot \mathsf{PI}\left(\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 73.4% 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 -0.5:\\ \;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;t\_0 \leq 0.02:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(t\_1 + 1\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0
         (* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B)))
        (t_1 (/ (- C A) B)))
   (if (<= t_0 -0.5)
     (* (/ (atan (- t_1 1.0)) (PI)) 180.0)
     (if (<= t_0 0.02)
       (* (/ (atan (* (/ B A) 0.5)) (PI)) 180.0)
       (* (atan (+ t_1 1.0)) (/ 180.0 (PI)))))))
\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 -0.5:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\

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

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 29.4%

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

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

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

    if 0.0200000000000000004 < (*.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 60.1%

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

        \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \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. lift-/.f64N/A

        \[\leadsto \frac{180}{1} \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)}} \]
      4. times-fracN/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)}{1 \cdot \mathsf{PI}\left(\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 73.4% 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 -0.5:\\ \;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;t\_0 \leq 0.02:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0
         (* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B)))
        (t_1 (/ (- C A) B)))
   (if (<= t_0 -0.5)
     (* (/ (atan (- t_1 1.0)) (PI)) 180.0)
     (if (<= t_0 0.02)
       (* (/ (atan (* (/ B A) 0.5)) (PI)) 180.0)
       (* (/ (atan (+ t_1 1.0)) (PI)) 180.0)))))
\begin{array}{l}

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

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

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 29.4%

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

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

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

    if 0.0200000000000000004 < (*.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 60.1%

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

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

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

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

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

Alternative 6: 67.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}\\ \mathbf{if}\;t\_0 \leq -0.5:\\ \;\;\;\;\tan^{-1} \left(\frac{-A}{B} - 1\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 0.02:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0
         (* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
   (if (<= t_0 -0.5)
     (* (atan (- (/ (- A) B) 1.0)) (/ 180.0 (PI)))
     (if (<= t_0 0.02)
       (* (/ (atan (* (/ B A) 0.5)) (PI)) 180.0)
       (* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0)))))
\begin{array}{l}

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

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

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


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

    1. Initial program 58.3%

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

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

        \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \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. lift-/.f64N/A

        \[\leadsto \frac{180}{1} \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)}} \]
      4. times-fracN/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)}{1 \cdot \mathsf{PI}\left(\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 29.4%

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

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

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

      if 0.0200000000000000004 < (*.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 60.1%

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

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

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

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

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

    Alternative 7: 62.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}\\ \mathbf{if}\;t\_0 \leq -0.5:\\ \;\;\;\;\tan^{-1} \left(\frac{-A}{B} - 1\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 0.02:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0
             (* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
       (if (<= t_0 -0.5)
         (* (atan (- (/ (- A) B) 1.0)) (/ 180.0 (PI)))
         (if (<= t_0 0.02)
           (* (/ (atan (* (/ B A) 0.5)) (PI)) 180.0)
           (* (/ (atan (+ (/ C B) 1.0)) (PI)) 180.0)))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\\
    \mathbf{if}\;t\_0 \leq -0.5:\\
    \;\;\;\;\tan^{-1} \left(\frac{-A}{B} - 1\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;t\_0 \leq 0.02:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5

      1. Initial program 58.3%

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

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

          \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \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. lift-/.f64N/A

          \[\leadsto \frac{180}{1} \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)}} \]
        4. times-fracN/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)}{1 \cdot \mathsf{PI}\left(\right)}} \]
        5. *-commutativeN/A

          \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
        6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 29.4%

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

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

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

        if 0.0200000000000000004 < (*.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 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 63.0% accurate, 0.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 29.4%

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

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

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

            if 0.0200000000000000004 < (*.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 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 9: 62.5% accurate, 0.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 27.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + \color{blue}{1}\right)}{\mathsf{PI}\left(\right)} \]
                  8. Recombined 3 regimes into one program.
                  9. Final simplification60.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 -0.5:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;\left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B} \leq 10^{-5}:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 10: 58.1% accurate, 0.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                      1. Initial program 27.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 11: 77.8% accurate, 1.5× speedup?

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

                        1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

                        if -9.19999999999999945e-88 < C < 8.80000000000000003e70

                        1. Initial program 63.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 8.80000000000000003e70 < C

                        1. Initial program 12.3%

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

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

                            \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \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. lift-/.f64N/A

                            \[\leadsto \frac{180}{1} \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)}} \]
                          4. times-fracN/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)}{1 \cdot \mathsf{PI}\left(\right)}} \]
                          5. *-commutativeN/A

                            \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
                          6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 12: 73.7% accurate, 1.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -8.5 \cdot 10^{+97}:\\ \;\;\;\;\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 10^{-105}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 9.5 \cdot 10^{-47}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(A, \frac{B}{C}, B\right)}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{PI}\left(\right)}{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}}\\ \end{array} \end{array} \]
                      (FPCore (A B C)
                       :precision binary64
                       (if (<= A -8.5e+97)
                         (* (atan (* (/ (fma (/ C A) B B) A) 0.5)) (/ 180.0 (PI)))
                         (if (<= A 1e-105)
                           (* (/ (atan (/ (- C (hypot C B)) B)) (PI)) 180.0)
                           (if (<= A 9.5e-47)
                             (* (/ (atan (* (/ (fma A (/ B C) B) C) -0.5)) (PI)) 180.0)
                             (/ 1.0 (/ (PI) (* (atan (+ (/ (- C A) B) 1.0)) 180.0)))))))
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;A \leq -8.5 \cdot 10^{+97}:\\
                      \;\;\;\;\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
                      
                      \mathbf{elif}\;A \leq 10^{-105}:\\
                      \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                      
                      \mathbf{elif}\;A \leq 9.5 \cdot 10^{-47}:\\
                      \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(A, \frac{B}{C}, B\right)}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{1}{\frac{\mathsf{PI}\left(\right)}{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if A < -8.4999999999999993e97

                        1. Initial program 16.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. metadata-evalN/A

                            \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \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. lift-/.f64N/A

                            \[\leadsto \frac{180}{1} \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)}} \]
                          4. times-fracN/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)}{1 \cdot \mathsf{PI}\left(\right)}} \]
                          5. *-commutativeN/A

                            \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
                          6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if -8.4999999999999993e97 < A < 9.99999999999999965e-106

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

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

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

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

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

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

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

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

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

                        if 9.99999999999999965e-106 < A < 9.4999999999999991e-47

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 9.4999999999999991e-47 < A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 13: 51.3% accurate, 2.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                          if 2.7e-159 < B

                          1. Initial program 54.6%

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.7 \cdot 10^{-159}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\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 14: 44.4% accurate, 2.8× speedup?

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

                            1. Initial program 55.0%

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

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

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

                              if -8.8000000000000004e-147 < B < 1.10000000000000004e-202

                              1. Initial program 56.1%

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

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

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

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

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

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

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

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

                              if 1.10000000000000004e-202 < B

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -8.8 \cdot 10^{-147}:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 1.1 \cdot 10^{-202}:\\ \;\;\;\;\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: 28.1% accurate, 2.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1.1 \cdot 10^{-202}:\\ \;\;\;\;\frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                              (FPCore (A B C)
                               :precision binary64
                               (if (<= B 1.1e-202)
                                 (* (/ (atan 0.0) (PI)) 180.0)
                                 (* (/ (atan -1.0) (PI)) 180.0)))
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;B \leq 1.1 \cdot 10^{-202}:\\
                              \;\;\;\;\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 < 1.10000000000000004e-202

                                1. Initial program 55.5%

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

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

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

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

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

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

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

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

                                if 1.10000000000000004e-202 < B

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

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

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

                                Alternative 16: 20.8% accurate, 3.1× speedup?

                                \[\begin{array}{l} \\ \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180 \end{array} \]
                                (FPCore (A B C) :precision binary64 (* (/ (atan -1.0) (PI)) 180.0))
                                \begin{array}{l}
                                
                                \\
                                \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180
                                \end{array}
                                
                                Derivation
                                1. Initial program 55.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 rewrites21.1%

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

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

                                  Reproduce

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