ABCF->ab-angle angle

Percentage Accurate: 53.3% → 81.0%
Time: 7.4s
Alternatives: 17
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 53.3% accurate, 1.0× speedup?

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

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

Alternative 1: 81.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq 3.6 \cdot 10^{+16}:\\ \;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\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 3.6e+16)
   (* (atan (/ (- (- C A) (hypot B (- A C))) B)) (/ 180.0 (PI)))
   (* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))))
\begin{array}{l}

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

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6e16 < C

    1. Initial program 17.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in B around 0

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

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

    Alternative 2: 72.3% 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)}\\ t_1 := \frac{C - A}{B}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-13}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(-0.5, \frac{B}{C}, 0\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(1 + t\_1\right) \cdot \frac{180}{\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))))
            (t_1 (/ (- C A) B)))
       (if (<= t_0 -2e-13)
         (* 180.0 (/ (atan (- t_1 1.0)) (PI)))
         (if (<= t_0 0.0)
           (/ (* 180.0 (atan (fma -0.5 (/ B C) 0.0))) (PI))
           (* (atan (+ 1.0 t_1)) (/ 180.0 (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)}\\
    t_1 := \frac{C - A}{B}\\
    \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-13}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;t\_0 \leq 0:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(-0.5, \frac{B}{C}, 0\right)\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\tan^{-1} \left(1 + t\_1\right) \cdot \frac{180}{\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))) < -2.0000000000000001e-13

      1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

      if -2.0000000000000001e-13 < (*.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 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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(-0.5, \frac{B}{C}, 0\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 57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 72.3% 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)}\\ t_1 := \frac{C - A}{B}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-13}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(1 + t\_1\right) \cdot \frac{180}{\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))))
            (t_1 (/ (- C A) B)))
       (if (<= t_0 -2e-13)
         (* 180.0 (/ (atan (- t_1 1.0)) (PI)))
         (if (<= t_0 0.0)
           (* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
           (* (atan (+ 1.0 t_1)) (/ 180.0 (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)}\\
    t_1 := \frac{C - A}{B}\\
    \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-13}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{elif}\;t\_0 \leq 0:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\tan^{-1} \left(1 + t\_1\right) \cdot \frac{180}{\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))) < -2.0000000000000001e-13

      1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

      if -2.0000000000000001e-13 < (*.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 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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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)} \]
      6. Taylor expanded in B around 0

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

          \[\leadsto 180 \cdot \frac{\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 57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 72.3% 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)}\\ t_1 := \frac{C - A}{B}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-13}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_1\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))))
              (t_1 (/ (- C A) B)))
         (if (<= t_0 -2e-13)
           (* 180.0 (/ (atan (- t_1 1.0)) (PI)))
           (if (<= t_0 0.0)
             (* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
             (* 180.0 (/ (atan (+ 1.0 t_1)) (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)}\\
      t_1 := \frac{C - A}{B}\\
      \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-13}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\
      
      \mathbf{elif}\;t\_0 \leq 0:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_1\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))) < -2.0000000000000001e-13

        1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

        if -2.0000000000000001e-13 < (*.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 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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\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)} \]
        6. Taylor expanded in B around 0

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

            \[\leadsto 180 \cdot \frac{\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 57.8%

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

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

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

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

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

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

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

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

        Alternative 5: 67.1% 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 -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;180 \cdot \frac{\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
                 (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
           (if (<= t_0 -4e-15)
             (/ (* (atan (- (/ (- A) B) 1.0)) 180.0) (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 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
        \mathbf{if}\;t\_0 \leq -4 \cdot 10^{-15}:\\
        \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
        
        \mathbf{elif}\;t\_0 \leq 0:\\
        \;\;\;\;180 \cdot \frac{\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 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -4.0000000000000003e-15

          1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -4.0000000000000003e-15 < (*.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 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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\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)} \]
            6. Taylor expanded in B around 0

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot \color{blue}{-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 57.8%

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

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

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

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

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

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

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

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

              \[\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 -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} - 1\right) \cdot 180}{\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}{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} \]
            10. Add Preprocessing

            Alternative 6: 77.7% accurate, 1.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq -2.25 \cdot 10^{-7}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;C \leq 3.6 \cdot 10^{+16}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(A, B\right) + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\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 -2.25e-7)
               (/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
               (if (<= C 3.6e+16)
                 (* 180.0 (/ (atan (/ (+ (hypot A B) A) (- B))) (PI)))
                 (* 180.0 (/ (atan (* (/ B C) -0.5)) (PI))))))
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;C \leq -2.25 \cdot 10^{-7}:\\
            \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
            
            \mathbf{elif}\;C \leq 3.6 \cdot 10^{+16}:\\
            \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(A, B\right) + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;180 \cdot \frac{\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 < -2.2499999999999999e-7

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

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

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

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

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

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

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

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

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

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

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

              if -2.2499999999999999e-7 < C < 3.6e16

              1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 3.6e16 < C

              1. Initial program 17.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\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)} \]
              6. Taylor expanded in B around 0

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

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

              Alternative 7: 73.7% accurate, 1.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.25 \cdot 10^{+187}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 3.5 \cdot 10^{-8}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\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.25e+187)
                 (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
                 (if (<= A 3.5e-8)
                   (/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
                   (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) (PI))))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;A \leq -1.25 \cdot 10^{+187}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;A \leq 3.5 \cdot 10^{-8}:\\
              \;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\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.25e187

                1. Initial program 4.9%

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

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

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

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

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

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

                if -1.25e187 < A < 3.50000000000000024e-8

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

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

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

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

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

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

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

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

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

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

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

                if 3.50000000000000024e-8 < A

                1. Initial program 77.2%

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

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

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

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

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

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

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(1 + \frac{\color{blue}{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)} \]
              3. Recombined 3 regimes into one program.
              4. Add Preprocessing

              Alternative 8: 73.7% accurate, 1.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.25 \cdot 10^{+187}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 3.5 \cdot 10^{-8}:\\ \;\;\;\;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.25e+187)
                 (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
                 (if (<= A 3.5e-8)
                   (* 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.25 \cdot 10^{+187}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;A \leq 3.5 \cdot 10^{-8}:\\
              \;\;\;\;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.25e187

                1. Initial program 4.9%

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

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

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

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

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

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

                if -1.25e187 < A < 3.50000000000000024e-8

                1. Initial program 47.6%

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

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

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

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

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

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

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

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

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

                if 3.50000000000000024e-8 < A

                1. Initial program 77.2%

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

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

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

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

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

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

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(1 + \frac{\color{blue}{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)} \]
              3. Recombined 3 regimes into one program.
              4. Add Preprocessing

              Alternative 9: 55.7% accurate, 2.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;C \leq -9.5 \cdot 10^{+171}:\\ \;\;\;\;\tan^{-1} \left(1 + \frac{C}{B}\right) \cdot t\_0\\ \mathbf{elif}\;C \leq -2.09 \cdot 10^{-74}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;C \leq 10^{-69}:\\ \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
              (FPCore (A B C)
               :precision binary64
               (let* ((t_0 (/ 180.0 (PI))))
                 (if (<= C -9.5e+171)
                   (* (atan (+ 1.0 (/ C B))) t_0)
                   (if (<= C -2.09e-74)
                     (/ (* (atan (- (/ (- A) B) 1.0)) 180.0) (PI))
                     (if (<= C 1e-69)
                       (* (atan (- 1.0 (/ A B))) t_0)
                       (* 180.0 (/ (atan (* (/ B C) -0.5)) (PI))))))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
              \mathbf{if}\;C \leq -9.5 \cdot 10^{+171}:\\
              \;\;\;\;\tan^{-1} \left(1 + \frac{C}{B}\right) \cdot t\_0\\
              
              \mathbf{elif}\;C \leq -2.09 \cdot 10^{-74}:\\
              \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;C \leq 10^{-69}:\\
              \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot t\_0\\
              
              \mathbf{else}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if C < -9.49999999999999924e171

                1. Initial program 83.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -9.49999999999999924e171 < C < -2.09000000000000004e-74

                  1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -2.09000000000000004e-74 < C < 9.9999999999999996e-70

                    1. Initial program 57.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 9.9999999999999996e-70 < C

                      1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\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)} \]
                      6. Taylor expanded in B around 0

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

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

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

                      Alternative 10: 57.8% accurate, 2.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;C \leq -1.12 \cdot 10^{-20}:\\ \;\;\;\;\tan^{-1} \left(1 + \frac{C}{B}\right) \cdot t\_0\\ \mathbf{elif}\;C \leq -2.09 \cdot 10^{-74}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;C \leq 10^{-69}:\\ \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                      (FPCore (A B C)
                       :precision binary64
                       (let* ((t_0 (/ 180.0 (PI))))
                         (if (<= C -1.12e-20)
                           (* (atan (+ 1.0 (/ C B))) t_0)
                           (if (<= C -2.09e-74)
                             (* 180.0 (/ (atan -1.0) (PI)))
                             (if (<= C 1e-69)
                               (* (atan (- 1.0 (/ A B))) t_0)
                               (* 180.0 (/ (atan (* (/ B C) -0.5)) (PI))))))))
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
                      \mathbf{if}\;C \leq -1.12 \cdot 10^{-20}:\\
                      \;\;\;\;\tan^{-1} \left(1 + \frac{C}{B}\right) \cdot t\_0\\
                      
                      \mathbf{elif}\;C \leq -2.09 \cdot 10^{-74}:\\
                      \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
                      
                      \mathbf{elif}\;C \leq 10^{-69}:\\
                      \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot t\_0\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if C < -1.12000000000000002e-20

                        1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if -1.12000000000000002e-20 < C < -2.09000000000000004e-74

                          1. Initial program 57.8%

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

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

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

                            if -2.09000000000000004e-74 < C < 9.9999999999999996e-70

                            1. Initial program 57.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 9.9999999999999996e-70 < C

                              1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\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)} \]
                              6. Taylor expanded in B around 0

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

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

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

                              Alternative 11: 49.5% accurate, 2.4× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;C \leq -1.12 \cdot 10^{-20}:\\ \;\;\;\;\tan^{-1} \left(1 + \frac{C}{B}\right) \cdot t\_0\\ \mathbf{elif}\;C \leq -2.09 \cdot 10^{-74}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;C \leq 8 \cdot 10^{+117}:\\ \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot t\_0\\ \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
                               (let* ((t_0 (/ 180.0 (PI))))
                                 (if (<= C -1.12e-20)
                                   (* (atan (+ 1.0 (/ C B))) t_0)
                                   (if (<= C -2.09e-74)
                                     (* 180.0 (/ (atan -1.0) (PI)))
                                     (if (<= C 8e+117)
                                       (* (atan (- 1.0 (/ A B))) t_0)
                                       (* 180.0 (/ (atan (/ 0.0 B)) (PI))))))))
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
                              \mathbf{if}\;C \leq -1.12 \cdot 10^{-20}:\\
                              \;\;\;\;\tan^{-1} \left(1 + \frac{C}{B}\right) \cdot t\_0\\
                              
                              \mathbf{elif}\;C \leq -2.09 \cdot 10^{-74}:\\
                              \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
                              
                              \mathbf{elif}\;C \leq 8 \cdot 10^{+117}:\\
                              \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot t\_0\\
                              
                              \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 4 regimes
                              2. if C < -1.12000000000000002e-20

                                1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if -1.12000000000000002e-20 < C < -2.09000000000000004e-74

                                  1. Initial program 57.8%

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

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

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

                                    if -2.09000000000000004e-74 < C < 8.0000000000000004e117

                                    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 8.0000000000000004e117 < C

                                      1. Initial program 11.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{0}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                                    12. Recombined 4 regimes into one program.
                                    13. Final simplification54.8%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -1.12 \cdot 10^{-20}:\\ \;\;\;\;\tan^{-1} \left(1 + \frac{C}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;C \leq -2.09 \cdot 10^{-74}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;C \leq 8 \cdot 10^{+117}:\\ \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                                    14. Add Preprocessing

                                    Alternative 12: 55.6% accurate, 2.5× speedup?

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

                                      1. Initial program 43.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if -2e17 < B < 5.6000000000000001e98

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if 5.6000000000000001e98 < B

                                          1. Initial program 37.1%

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

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

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

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

                                          Alternative 13: 45.7% accurate, 2.5× speedup?

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

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

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

                                              if -7e15 < B < 1.39999999999999999e94

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if 1.39999999999999999e94 < B

                                                1. Initial program 37.1%

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

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

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

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

                                                Alternative 14: 45.5% accurate, 2.5× speedup?

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

                                                  1. Initial program 49.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}{1}}{\mathsf{PI}\left(\right)} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites49.0%

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

                                                    if -1.6499999999999999e-161 < B < 2.3500000000000001e-79

                                                    1. Initial program 55.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    if 2.3500000000000001e-79 < B

                                                    1. Initial program 47.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}{-1}}{\mathsf{PI}\left(\right)} \]
                                                    4. Step-by-step derivation
                                                      1. Applied rewrites54.9%

                                                        \[\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: 51.5% accurate, 2.6× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1.85 \cdot 10^{-81}:\\ \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot \frac{180}{\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 1.85e-81)
                                                       (* (atan (- 1.0 (/ A B))) (/ 180.0 (PI)))
                                                       (* 180.0 (/ (atan -1.0) (PI)))))
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;B \leq 1.85 \cdot 10^{-81}:\\
                                                    \;\;\;\;\tan^{-1} \left(1 - \frac{A}{B}\right) \cdot \frac{180}{\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.84999999999999993e-81

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if 1.84999999999999993e-81 < B

                                                        1. Initial program 46.9%

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

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

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

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

                                                        Alternative 16: 40.7% accurate, 2.9× speedup?

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

                                                          1. Initial program 52.2%

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

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

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

                                                            if -4.999999999999985e-310 < B

                                                            1. Initial program 49.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 rewrites37.0%

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

                                                            Alternative 17: 22.2% 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 50.9%

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

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

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

                                                              Reproduce

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