ABCF->ab-angle angle

Percentage Accurate: 54.9% → 80.7%
Time: 10.5s
Alternatives: 14
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 54.9% 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.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.3 \cdot 10^{-6}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\frac{180}{\frac{\mathsf{PI}\left(\right)}{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}}\\


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

    1. Initial program 26.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)} \]
    7. 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 \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)} \]
    8. Step-by-step derivation
      1. associate-*r/N/A

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

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

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

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

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

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

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\color{blue}{\frac{1}{2}} \cdot \left(B + \frac{B \cdot C}{A}\right)}{A}\right) \]
      8. associate-/l*N/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)} \]
      9. 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)} \]
      10. 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) \]
      11. +-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) \]
      12. 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) \]
      13. *-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) \]
      14. 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) \]
      15. lower-/.f6479.5

        \[\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) \]
    9. Applied rewrites79.5%

      \[\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 -3.30000000000000017e-6 < A

    1. Initial program 63.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_0 \leq 10^{-6}:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\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 61.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{C - A}{B} - \color{blue}{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)))))) < 9.99999999999999955e-7

      1. Initial program 20.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 73.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}\\ 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 10^{-6}:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\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 1e-6)
           (* (/ (atan (* -0.5 (/ B C))) (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 10^{-6}:\\
    \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\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 61.2%

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

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

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

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

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

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

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

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

        \[\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)))))) < 9.99999999999999955e-7

      1. Initial program 20.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 10^{-6}:\\ \;\;\;\;\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 - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 67.3% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\\ \mathbf{if}\;t\_0 \leq -0.5:\\ \;\;\;\;\tan^{-1} \left(\frac{-\left(B + A\right)}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{-6}:\\ \;\;\;\;\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 - 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 (/ (- (+ B A)) B)) (/ 180.0 (PI)))
         (if (<= t_0 1e-6)
           (* (/ (atan (* -0.5 (/ B C))) (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{-\left(B + A\right)}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;t\_0 \leq 10^{-6}:\\
    \;\;\;\;\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 - 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 61.2%

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

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

          \[\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 rewrites85.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 C around 0

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{-\left(B + A\right)}{B}\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)))))) < 9.99999999999999955e-7

        1. Initial program 20.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 5: 76.7% accurate, 1.5× speedup?

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

        1. Initial program 84.9%

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

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

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

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

        if -9.50000000000000028e64 < C < 1.49999999999999995e152

        1. Initial program 54.0%

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

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

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

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

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

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

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

        if 1.49999999999999995e152 < C

        1. Initial program 8.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 80.8% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;A \leq -3.3 \cdot 10^{-6}:\\ \;\;\;\;\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right) \cdot t\_0\\ \end{array} \end{array} \]
      (FPCore (A B C)
       :precision binary64
       (let* ((t_0 (/ 180.0 (PI))))
         (if (<= A -3.3e-6)
           (* (atan (* (/ (fma (/ C A) B B) A) 0.5)) t_0)
           (* (atan (/ (- (- C A) (hypot (- A C) B)) B)) t_0))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
      \mathbf{if}\;A \leq -3.3 \cdot 10^{-6}:\\
      \;\;\;\;\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right) \cdot t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right) \cdot t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if A < -3.30000000000000017e-6

        1. Initial program 26.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \color{blue}{\left(\frac{C - A}{B} - \frac{\mathsf{hypot}\left(B, A - C\right)}{B}\right)} \]
        7. 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 \frac{B \cdot C}{A} - \frac{1}{2} \cdot B}{A}\right)} \]
        8. Step-by-step derivation
          1. associate-*r/N/A

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

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

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

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

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

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

            \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\color{blue}{\frac{1}{2}} \cdot \left(B + \frac{B \cdot C}{A}\right)}{A}\right) \]
          8. associate-/l*N/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)} \]
          9. 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)} \]
          10. 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) \]
          11. +-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) \]
          12. 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) \]
          13. *-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) \]
          14. 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) \]
          15. lower-/.f6479.5

            \[\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) \]
        9. Applied rewrites79.5%

          \[\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 -3.30000000000000017e-6 < A

        1. Initial program 63.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-/.f6463.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 rewrites80.7%

          \[\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)} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification80.4%

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

      Alternative 7: 48.3% accurate, 2.4× speedup?

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

        1. Initial program 26.3%

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

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

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

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

        if -4.99999999999999999e-15 < A < 1.60000000000000003e-193

        1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.60000000000000003e-193 < A < 1.12e8

        1. Initial program 62.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 rewrites44.1%

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

          if 1.12e8 < A

          1. Initial program 81.1%

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

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

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

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

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

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

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

        Alternative 8: 48.3% accurate, 2.4× speedup?

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

          1. Initial program 26.3%

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

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

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

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

          if -4.99999999999999999e-15 < A < 1.60000000000000003e-193

          1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.60000000000000003e-193 < A < 1.12e8

          1. Initial program 62.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 rewrites44.1%

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

            if 1.12e8 < A

            1. Initial program 81.1%

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

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

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

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

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

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

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

          Alternative 9: 48.1% accurate, 2.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -5.5 \cdot 10^{-72}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 2.5 \cdot 10^{-189}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 112000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
          (FPCore (A B C)
           :precision binary64
           (if (<= A -5.5e-72)
             (* (/ (atan (* (/ B A) 0.5)) (PI)) 180.0)
             (if (<= A 2.5e-189)
               (* (/ (atan -1.0) (PI)) 180.0)
               (if (<= A 112000000.0)
                 (* (/ (atan 1.0) (PI)) 180.0)
                 (* (/ (atan (* -2.0 (/ A B))) (PI)) 180.0)))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;A \leq -5.5 \cdot 10^{-72}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{elif}\;A \leq 2.5 \cdot 10^{-189}:\\
          \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{elif}\;A \leq 112000000:\\
          \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if A < -5.49999999999999994e-72

            1. Initial program 29.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 -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-/.f6465.7

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

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

            if -5.49999999999999994e-72 < A < 2.4999999999999999e-189

            1. Initial program 54.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 rewrites34.4%

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

              if 2.4999999999999999e-189 < A < 1.12e8

              1. Initial program 62.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 rewrites44.1%

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

                if 1.12e8 < A

                1. Initial program 81.1%

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -5.5 \cdot 10^{-72}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 2.5 \cdot 10^{-189}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;A \leq 112000000:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
              7. Add Preprocessing

              Alternative 10: 56.0% accurate, 2.5× speedup?

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

                1. Initial program 83.7%

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

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

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

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

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

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

                if -2.9e81 < C < 4.4000000000000002e-137

                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. 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-/.f6463.0

                    \[\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 rewrites82.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 0

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

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

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

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

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

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

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

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

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

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

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

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

                  if 4.4000000000000002e-137 < C

                  1. Initial program 31.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 11: 47.3% accurate, 2.5× speedup?

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

                  1. Initial program 51.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 rewrites51.2%

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

                    if -2e5 < B < 6.00000000000000033e-55

                    1. Initial program 59.8%

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

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

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

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

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

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

                    if 6.00000000000000033e-55 < B

                    1. Initial program 49.1%

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

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

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

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

                    Alternative 12: 44.4% accurate, 2.8× speedup?

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

                      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 rewrites40.5%

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

                        if -2e-136 < B < 5.19999999999999969e-209

                        1. Initial program 58.0%

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

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

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

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

                        if 5.19999999999999969e-209 < B

                        1. Initial program 52.9%

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

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -2 \cdot 10^{-136}:\\ \;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-209}:\\ \;\;\;\;\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 13: 28.8% accurate, 2.9× speedup?

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

                          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 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-eval15.6

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

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

                          if 5.19999999999999969e-209 < B

                          1. Initial program 52.9%

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

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

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

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

                          Alternative 14: 21.1% accurate, 3.1× speedup?

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

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

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

                            Reproduce

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