ABCF->ab-angle angle

Percentage Accurate: 54.4% → 80.7%
Time: 7.3s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 54.4% 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.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq 4.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)\right) \cdot {B}^{-1}\right)}{\mathsf{PI}\left(\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 4.2000000000000002e-16

    1. Initial program 69.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. 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-PI.f64N/A

        \[\leadsto 180 \cdot \frac{\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)}} \]
      3. 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)}} \]
    4. Applied rewrites88.5%

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

    if 4.2000000000000002e-16 < C

    1. Initial program 22.0%

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
      5. lower-*.f6420.6

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 73.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_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)}\\
\mathbf{if}\;t\_0 \leq -40:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - B}{B}\right)}{\mathsf{PI}\left(\right)}\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 19.9%

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        5. lower-*.f6410.8

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
      5. Applied rewrites10.8%

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 59.0%

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

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

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

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

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

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

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

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

    Alternative 3: 73.2% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 19.9%

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
          5. lower-*.f6410.8

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        5. Applied rewrites10.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{-1 \cdot \left(A + -1 \cdot A\right)}{B}\right)\right)}{\mathsf{PI}\left(\right)} \]
        10. Applied rewrites60.6%

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

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

        1. Initial program 59.0%

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

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

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

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

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

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

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

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

      Alternative 4: 73.2% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 19.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-PI.f64N/A

              \[\leadsto 180 \cdot \frac{\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)}} \]
            3. 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)}} \]
          4. Applied rewrites19.9%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]
          10. Applied rewrites60.4%

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

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

          1. Initial program 59.0%

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

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

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

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

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

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

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

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

        Alternative 5: 67.9% accurate, 0.4× speedup?

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

          1. Initial program 64.8%

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

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

              \[\leadsto 180 \cdot \frac{\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)}} \]
            3. 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)}} \]
          4. Applied rewrites87.6%

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 19.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-PI.f64N/A

                \[\leadsto 180 \cdot \frac{\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)}} \]
              3. 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)}} \]
            4. Applied rewrites19.9%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]
            10. Applied rewrites60.4%

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

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

            1. Initial program 59.0%

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

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

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

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

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

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

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

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

          Alternative 6: 62.2% accurate, 0.6× speedup?

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

            1. Initial program 64.8%

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

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

                \[\leadsto 180 \cdot \frac{\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)}} \]
              3. 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)}} \]
            4. Applied rewrites87.6%

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 19.9%

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

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

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

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

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

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

              if -0.0 < (*.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 59.0%

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

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

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

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

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

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

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

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

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

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

              Alternative 7: 58.2% accurate, 0.6× speedup?

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

                1. Initial program 64.8%

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

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

                    \[\leadsto 180 \cdot \frac{\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)}} \]
                  3. 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)}} \]
                4. Applied rewrites87.6%

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 19.9%

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
                    5. lower-*.f6410.8

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
                  5. Applied rewrites10.8%

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

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

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

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

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1 \cdot \left(A + -1 \cdot A\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
                    4. *-lft-identityN/A

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{0 \cdot -1}{B}\right)}{\mathsf{PI}\left(\right)} \]
                    9. metadata-eval19.9

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

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

                  if -0.0 < (*.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 59.0%

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

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

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

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

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

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

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

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

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

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

                  Alternative 8: 76.8% accurate, 1.5× speedup?

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

                    1. Initial program 19.1%

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

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

                        \[\leadsto 180 \cdot \frac{\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)}} \]
                      3. 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)}} \]
                    4. Applied rewrites44.1%

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

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

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

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

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

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

                    if -1.5800000000000001e50 < A < 9.99999999999999946e33

                    1. Initial program 53.4%

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

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

                        \[\leadsto 180 \cdot \frac{\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)}} \]
                      3. 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)}} \]
                    4. Applied rewrites79.0%

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

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

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

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

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

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

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

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

                    if 9.99999999999999946e33 < A

                    1. Initial program 84.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} \left(1 + \color{blue}{\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 + \frac{C - A}{\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                      3. lower-+.f64N/A

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

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

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

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

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

                  Alternative 9: 76.8% accurate, 1.5× speedup?

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

                    1. Initial program 19.1%

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

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

                        \[\leadsto 180 \cdot \frac{\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)}} \]
                      3. 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)}} \]
                    4. Applied rewrites44.1%

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

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

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

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

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

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

                    if -1.5800000000000001e50 < A < 9.99999999999999946e33

                    1. Initial program 53.4%

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

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

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

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

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

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

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

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

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

                    if 9.99999999999999946e33 < A

                    1. Initial program 84.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} \left(1 + \color{blue}{\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 + \frac{C - A}{\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                      3. lower-+.f64N/A

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

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

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

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

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

                  Alternative 10: 47.2% accurate, 2.4× speedup?

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

                    1. Initial program 52.7%

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

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

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

                      if -6.0000000000000003e-114 < B < 2.4999999999999999e-261

                      1. Initial program 59.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(\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} \left(1 + \color{blue}{\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 + \frac{C - A}{\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                        3. lower-+.f64N/A

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

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

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

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

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

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

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

                      if 2.4999999999999999e-261 < B < 8.49999999999999988e-132

                      1. Initial program 45.1%

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

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

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
                        5. lower-*.f6433.6

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1 \cdot \left(A + -1 \cdot A\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
                        4. *-lft-identityN/A

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

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{0 \cdot -1}{B}\right)}{\mathsf{PI}\left(\right)} \]
                        9. metadata-eval41.8

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\mathsf{PI}\left(\right)} \]
                      10. Applied rewrites41.8%

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

                      if 8.49999999999999988e-132 < B

                      1. Initial program 58.5%

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

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

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

                      Alternative 11: 59.4% accurate, 2.5× speedup?

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

                        1. Initial program 82.5%

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

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

                            \[\leadsto 180 \cdot \frac{\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)}} \]
                          3. 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)}} \]
                        4. Applied rewrites96.2%

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

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

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

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

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

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

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

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

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

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

                          if -1.8e-25 < C < 1.3e-24

                          1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

                          if 1.3e-24 < C

                          1. Initial program 23.8%

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

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

                              \[\leadsto 180 \cdot \frac{\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)}} \]
                            3. 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)}} \]
                          4. Applied rewrites53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -1.8 \cdot 10^{-25}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;C \leq 1.3 \cdot 10^{-24}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                        12. Add Preprocessing

                        Alternative 12: 52.5% accurate, 2.5× speedup?

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

                          1. Initial program 82.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} \left(1 + \color{blue}{\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 + \frac{C - A}{\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                            3. lower-+.f64N/A

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

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

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

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

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

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

                            if -2.7e-46 < C < 5.49999999999999972e169

                            1. Initial program 51.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}{\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} \left(1 + \color{blue}{\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 + \frac{C - A}{\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                              3. lower-+.f64N/A

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

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

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

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

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

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

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

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

                            if 5.49999999999999972e169 < C

                            1. Initial program 11.0%

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

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

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

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
                              5. lower-*.f6411.0

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1 \cdot \left(A + -1 \cdot A\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              4. *-lft-identityN/A

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

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

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{0 \cdot -1}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              9. metadata-eval47.8

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\mathsf{PI}\left(\right)} \]
                            10. Applied rewrites47.8%

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

                          Alternative 13: 49.8% accurate, 2.5× speedup?

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

                            1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

                            if -6.3999999999999998e-18 < C < 5.49999999999999972e169

                            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}{\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} \left(1 + \color{blue}{\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 + \frac{C - A}{\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                              3. lower-+.f64N/A

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

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

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

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

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

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

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

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

                            if 5.49999999999999972e169 < C

                            1. Initial program 11.0%

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

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

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

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
                              5. lower-*.f6411.0

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1 \cdot \left(A + -1 \cdot A\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              4. *-lft-identityN/A

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

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

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{0 \cdot -1}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              9. metadata-eval47.8

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\mathsf{PI}\left(\right)} \]
                            10. Applied rewrites47.8%

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{0}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                          3. Recombined 3 regimes into one program.
                          4. Add Preprocessing

                          Alternative 14: 47.7% accurate, 2.5× speedup?

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

                            1. Initial program 52.7%

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

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

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

                              if -6.0000000000000003e-114 < B < 7.3999999999999995e-122

                              1. Initial program 55.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} \left(1 + \color{blue}{\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 + \frac{C - A}{\color{blue}{B}}\right)}{\mathsf{PI}\left(\right)} \]
                                3. lower-+.f64N/A

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

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

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

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

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

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

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

                              if 7.3999999999999995e-122 < B

                              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 B around inf

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

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

                              Alternative 15: 41.0% accurate, 2.9× speedup?

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

                                1. Initial program 52.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 rewrites40.6%

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

                                  if -1.000000000000002e-309 < B

                                  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 B around inf

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

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

                                  Alternative 16: 21.5% accurate, 3.1× speedup?

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

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

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

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

                                    Reproduce

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