ABCF->ab-angle angle

Percentage Accurate: 54.0% → 80.9%
Time: 8.3s
Alternatives: 14
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 54.0% accurate, 1.0× speedup?

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

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

Alternative 1: 80.9% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 20.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 rewrites54.4%

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

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

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

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

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

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

    if -2.8500000000000001e56 < A

    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 rewrites81.7%

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

Alternative 2: 73.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \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 -40:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\

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

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - -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))) < -40

    1. Initial program 55.3%

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

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

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

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

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

    1. Initial program 23.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 rewrites29.9%

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

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

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

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

        \[\leadsto \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)} \cdot 180}{\mathsf{PI}\left(\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
      5. mul-1-negN/A

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
      6. distribute-frac-negN/A

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
      7. distribute-rgt1-inN/A

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
      8. metadata-evalN/A

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
      9. distribute-lft-neg-inN/A

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
      10. metadata-evalN/A

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

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
      12. distribute-rgt1-inN/A

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

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

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
      15. metadata-evalN/A

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

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

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

    if 5 < (*.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.2%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 73.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \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 -40:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;t\_0 \leq 5:\\
\;\;\;\;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(t\_1 - -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))) < -40

    1. Initial program 55.3%

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

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

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

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

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

    1. Initial program 23.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\frac{B}{C}, A, B\right)}{C}, \frac{0}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
    6. Taylor expanded in A 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 rewrites59.8%

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

      if 5 < (*.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.2%

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 73.0% accurate, 0.4× speedup?

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

      1. Initial program 55.3%

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

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

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

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

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

      1. Initial program 23.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 rewrites29.9%

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

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

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

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

          \[\leadsto \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)} \cdot 180}{\mathsf{PI}\left(\right)} \]
        4. lower-/.f64N/A

          \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
        5. mul-1-negN/A

          \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
        6. distribute-frac-negN/A

          \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
        7. distribute-rgt1-inN/A

          \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
        8. metadata-evalN/A

          \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
        9. distribute-lft-neg-inN/A

          \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
        10. metadata-evalN/A

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

          \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
        12. distribute-rgt1-inN/A

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

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

          \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
        15. metadata-evalN/A

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

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

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

      if 0.10000000000000001 < (*.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.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} \left(\frac{1}{B} \cdot \color{blue}{\left(-1 \cdot \left(B \cdot \left(-1 \cdot \frac{C - A}{B} - 1\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 75.3% accurate, 1.5× speedup?

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

      1. Initial program 20.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 rewrites54.4%

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

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

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

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

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

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

      if -2.8500000000000001e56 < A < 1.49999999999999993e100

      1. Initial program 51.4%

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

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

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

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

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

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

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

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

      if 1.49999999999999993e100 < A

      1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 61.2% accurate, 2.4× speedup?

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

      1. Initial program 20.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 rewrites54.4%

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

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

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

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

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

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

      if -8.40000000000000018e36 < A < 1.9999999999999999e-225

      1. Initial program 41.8%

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

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

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

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

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

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

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

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

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

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

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

        if 1.9999999999999999e-225 < A

        1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 56.0% accurate, 2.5× speedup?

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

        1. Initial program 20.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 rewrites54.4%

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

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

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

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

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

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

        if -8.40000000000000018e36 < A < 4.19999999999999966e119

        1. Initial program 51.1%

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

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

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

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

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

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

          if 4.19999999999999966e119 < A

          1. Initial program 86.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 rewrites97.6%

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

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

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

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

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

        Alternative 8: 56.0% accurate, 2.5× speedup?

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

          1. Initial program 20.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 rewrites54.4%

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

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

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

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

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

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

          if -8.40000000000000018e36 < A < 4.19999999999999966e119

          1. Initial program 51.1%

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

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

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

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

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

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

            if 4.19999999999999966e119 < A

            1. Initial program 86.6%

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

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

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

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

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

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

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

          Alternative 9: 56.0% accurate, 2.5× speedup?

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

            1. Initial program 20.1%

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

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

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

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

            if -8.40000000000000018e36 < A < 4.19999999999999966e119

            1. Initial program 51.1%

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

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

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

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

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

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

              if 4.19999999999999966e119 < A

              1. Initial program 86.6%

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

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

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

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

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

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

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

            Alternative 10: 47.5% accurate, 2.5× speedup?

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

              1. Initial program 20.1%

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

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

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

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

              if -2.90000000000000007e56 < A < 4.19999999999999966e119

              1. Initial program 51.1%

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

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

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

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

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

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

                if 4.19999999999999966e119 < A

                1. Initial program 86.6%

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

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

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

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

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

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

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

                Alternative 11: 45.6% accurate, 2.5× speedup?

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

                  1. Initial program 35.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 rewrites77.3%

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

                    if -9.0000000000000005e87 < B < 7.2e44

                    1. Initial program 57.4%

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

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

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

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

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

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

                      if 7.2e44 < B

                      1. Initial program 39.0%

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

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

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

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

                      Alternative 12: 53.3% accurate, 2.6× speedup?

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

                        1. Initial program 71.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--.f6474.2

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

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

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

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

                          if 1.9999999999999988e-309 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\frac{B}{C}, A, B\right)}{C}, \frac{0}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                          6. Taylor expanded in A 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 rewrites53.0%

                              \[\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. Final simplification59.0%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq 2 \cdot 10^{-309}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - 1\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} \]
                          10. Add Preprocessing

                          Alternative 13: 40.3% accurate, 2.9× speedup?

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

                            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 rewrites33.9%

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

                              if -6.1999999999999996e-307 < B

                              1. Initial program 48.8%

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

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

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

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

                              Alternative 14: 20.6% 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.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 rewrites20.8%

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

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

                                Reproduce

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