ABCF->ab-angle angle

Percentage Accurate: 53.4% → 82.4%
Time: 6.9s
Alternatives: 17
Speedup: 2.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 53.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.4% accurate, 0.3× speedup?

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

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

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


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

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

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

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

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

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

    1. Initial program 10.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 72.6% accurate, 0.4× speedup?

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

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

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

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


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

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

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

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

      1. Initial program 10.3%

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 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. Taylor expanded in B around -inf

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

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

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

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

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

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

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

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

    Alternative 3: 67.1% accurate, 0.4× speedup?

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

      1. Initial program 60.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}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 10.3%

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 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. Taylor expanded in B around -inf

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

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

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

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

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

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

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

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

    Alternative 4: 61.7% accurate, 0.4× speedup?

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

      1. Initial program 60.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}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 10.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 61.7% accurate, 0.4× speedup?

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

      1. Initial program 60.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}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 10.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 61.7% accurate, 0.4× speedup?

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

      1. Initial program 60.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}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 10.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 77.2% accurate, 1.5× speedup?

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

      1. Initial program 14.9%

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

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

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

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

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

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

      if -9.0000000000000007e68 < A < 2.3e-156

      1. Initial program 55.0%

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

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

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

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

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

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

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

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

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

      if 2.3e-156 < A

      1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 75.6% accurate, 1.5× speedup?

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

      1. Initial program 14.9%

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

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

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

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

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

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

      if -9.0000000000000007e68 < A < 1.8499999999999999e25

      1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

      if 1.8499999999999999e25 < A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 9: 56.6% accurate, 2.5× speedup?

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

      1. Initial program 54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 8e-276 < B < 5.20000000000000034e-242

      1. Initial program 37.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{\tan^{-1} \left(\frac{0}{B}\right) \cdot 180}}{\mathsf{PI}\left(\right)} \]
        3. lower-*.f6463.7

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

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

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

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

      if 5.20000000000000034e-242 < B

      1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 10: 51.8% accurate, 2.5× speedup?

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

      1. Initial program 53.4%

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

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

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

        if -2.3999999999999999e-21 < B < 2.6000000000000001e-230

        1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{neg}\left(A\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
          4. lower-neg.f6439.0

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

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

        if 2.6000000000000001e-230 < B

        1. Initial program 53.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. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

      Alternative 11: 47.5% accurate, 2.5× speedup?

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

        1. Initial program 53.4%

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

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

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

          if -2.3999999999999999e-21 < B < 2.30000000000000011e-34

          1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{180 \cdot \tan^{-1} \left(-\frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \]
          12. Step-by-step derivation
            1. lift-/.f6433.9

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

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

          if 2.30000000000000011e-34 < B

          1. Initial program 56.5%

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

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

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

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

          Alternative 12: 47.5% accurate, 2.5× speedup?

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

            1. Initial program 53.4%

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

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

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

              if -2.3999999999999999e-21 < B < 2.30000000000000011e-34

              1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{neg}\left(A\right)}{B}\right)}{\mathsf{PI}\left(\right)} \]
                4. lower-neg.f6433.9

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

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

              if 2.30000000000000011e-34 < B

              1. Initial program 56.5%

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

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

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

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

              Alternative 13: 47.4% accurate, 2.5× speedup?

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

                1. Initial program 52.7%

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

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

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

                  if -6.1999999999999998e-15 < B < 4.75e-91

                  1. Initial program 53.1%

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

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

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

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

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

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

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

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

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

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

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

                  if 4.75e-91 < B

                  1. Initial program 55.9%

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

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

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

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

                  Alternative 14: 56.1% accurate, 2.6× speedup?

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

                    1. Initial program 54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 2.6000000000000001e-230 < B

                    1. Initial program 53.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. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 15: 45.7% accurate, 2.8× speedup?

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

                    1. Initial program 55.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 rewrites58.2%

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

                      if -3.8000000000000003e-98 < B < 5.70000000000000032e-99

                      1. Initial program 50.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 5.70000000000000032e-99 < B

                      1. Initial program 56.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 rewrites64.1%

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

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

                      Alternative 16: 40.6% accurate, 2.9× speedup?

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

                        1. Initial program 55.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 rewrites45.6%

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

                          if -1.000000000000002e-309 < B

                          1. Initial program 53.1%

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

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

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

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

                          Alternative 17: 21.2% accurate, 3.1× speedup?

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

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

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

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

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

                            Reproduce

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