ABCF->ab-angle angle

Percentage Accurate: 54.4% → 82.8%
Time: 10.5s
Alternatives: 17
Speedup: 2.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 54.4% accurate, 1.0× speedup?

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

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

Alternative 1: 82.8% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 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 or -0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

    1. Initial program 61.8%

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

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

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

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

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

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

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

    1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 73.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 73.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{t\_2}\\

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


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

    1. Initial program 62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 73.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{t\_2}\\

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


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

    1. Initial program 62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 73.5% accurate, 0.6× speedup?

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

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

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

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


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

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

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

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

    1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 62.6% accurate, 0.6× speedup?

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

      1. Initial program 62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 54.6% accurate, 0.6× speedup?

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

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

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

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

            1. Initial program 23.1%

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

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

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

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

            1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

            Alternative 9: 75.5% accurate, 1.5× speedup?

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

              1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

              if -7.3999999999999999e-4 < C < 2.4000000000000001e90

              1. Initial program 55.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 rewrites80.9%

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

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

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

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

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

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

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

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

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

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

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

              if 2.4000000000000001e90 < C

              1. Initial program 24.7%

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

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

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

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

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

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

                \[\leadsto \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)} \cdot 180}{\mathsf{PI}\left(\right)} \]
              6. Step-by-step derivation
                1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 10: 75.5% accurate, 1.5× speedup?

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

                1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

                if -7.3999999999999999e-4 < C < 2.4000000000000001e90

                1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 2.4000000000000001e90 < C

                1. Initial program 24.7%

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

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

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

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

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

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

                  \[\leadsto \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)} \cdot 180}{\mathsf{PI}\left(\right)} \]
                6. Step-by-step derivation
                  1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 11: 55.9% accurate, 2.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;C \leq 4.4 \cdot 10^{-250}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;C \leq 2.6 \cdot 10^{-30}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                (FPCore (A B C)
                 :precision binary64
                 (if (<= C -4.6e-51)
                   (* (/ (atan (+ (/ C B) 1.0)) (PI)) 180.0)
                   (if (<= C 4.4e-250)
                     (* (/ (atan (+ (/ (- A) B) 1.0)) (PI)) 180.0)
                     (if (<= C 2.6e-30)
                       (* (/ (atan -1.0) (PI)) 180.0)
                       (/ (* (atan (* (/ B C) -0.5)) 180.0) (PI))))))
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;C \leq -4.6 \cdot 10^{-51}:\\
                \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                
                \mathbf{elif}\;C \leq 4.4 \cdot 10^{-250}:\\
                \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                
                \mathbf{elif}\;C \leq 2.6 \cdot 10^{-30}:\\
                \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if C < -4.60000000000000004e-51

                  1. Initial program 74.8%

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

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

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

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

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

                    \[\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} + 1\right)}{\mathsf{PI}\left(\right)} \]
                  7. Step-by-step derivation
                    1. Applied rewrites74.9%

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

                    if -4.60000000000000004e-51 < C < 4.4e-250

                    1. Initial program 58.9%

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

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

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

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

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

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

                      if 4.4e-250 < C < 2.59999999999999987e-30

                      1. Initial program 62.0%

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

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

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

                        if 2.59999999999999987e-30 < C

                        1. Initial program 24.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;C \leq 4.4 \cdot 10^{-250}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;C \leq 2.6 \cdot 10^{-30}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 12: 55.9% accurate, 2.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;C \leq 4.4 \cdot 10^{-250}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;C \leq 2.6 \cdot 10^{-30}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                      (FPCore (A B C)
                       :precision binary64
                       (if (<= C -4.6e-51)
                         (* (/ (atan (+ (/ C B) 1.0)) (PI)) 180.0)
                         (if (<= C 4.4e-250)
                           (* (/ (atan (+ (/ (- A) B) 1.0)) (PI)) 180.0)
                           (if (<= C 2.6e-30)
                             (* (/ (atan -1.0) (PI)) 180.0)
                             (* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)))))
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;C \leq -4.6 \cdot 10^{-51}:\\
                      \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                      
                      \mathbf{elif}\;C \leq 4.4 \cdot 10^{-250}:\\
                      \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                      
                      \mathbf{elif}\;C \leq 2.6 \cdot 10^{-30}:\\
                      \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if C < -4.60000000000000004e-51

                        1. Initial program 74.8%

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

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

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

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

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

                          \[\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} + 1\right)}{\mathsf{PI}\left(\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites74.9%

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

                          if -4.60000000000000004e-51 < C < 4.4e-250

                          1. Initial program 58.9%

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

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

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

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

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

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

                            if 4.4e-250 < C < 2.59999999999999987e-30

                            1. Initial program 62.0%

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

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

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

                              if 2.59999999999999987e-30 < C

                              1. Initial program 24.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;C \leq 4.4 \cdot 10^{-250}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{elif}\;C \leq 2.6 \cdot 10^{-30}:\\ \;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                              9. Add Preprocessing

                              Alternative 13: 52.9% accurate, 2.5× speedup?

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

                                1. Initial program 67.4%

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

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

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

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

                                  \[\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} + 1\right)}{\mathsf{PI}\left(\right)} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites59.9%

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

                                  if 2.75e-250 < C < 2.59999999999999987e-30

                                  1. Initial program 62.0%

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

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

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

                                    if 2.59999999999999987e-30 < C

                                    1. Initial program 24.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 14: 51.4% accurate, 2.6× speedup?

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

                                      1. Initial program 56.1%

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

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

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

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

                                        if 1.6000000000000001 < B

                                        1. Initial program 56.6%

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

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

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

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

                                        Alternative 15: 44.3% accurate, 2.8× speedup?

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

                                          1. Initial program 53.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 rewrites55.7%

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

                                            if -9.0000000000000004e-94 < B < 1.40000000000000006e-73

                                            1. Initial program 55.8%

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

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

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

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

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

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

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

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

                                            if 1.40000000000000006e-73 < B

                                            1. Initial program 59.4%

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

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

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

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

                                            Alternative 16: 28.7% accurate, 2.9× speedup?

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

                                              1. Initial program 54.8%

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

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

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

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

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

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

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

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

                                              if 1.40000000000000006e-73 < B

                                              1. Initial program 59.4%

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

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

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

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

                                              Alternative 17: 20.8% accurate, 3.1× speedup?

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

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

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

                                                Reproduce

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