ABCF->ab-angle angle

Percentage Accurate: 53.7% → 67.4%
Time: 6.5s
Alternatives: 14
Speedup: 2.5×

Specification

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 53.7% 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: 67.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 2.05 \cdot 10^{+133}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \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{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(C - B\right)\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= B -1.32e+154)
   (* 180.0 (/ (atan 1.0) (PI)))
   (if (<= B 2.05e+133)
     (*
      180.0
      (/
       (atan
        (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
       (PI)))
     (* 180.0 (/ (atan (* (/ 1.0 B) (- C B))) (PI))))))
\begin{array}{l}

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

\mathbf{elif}\;B \leq 2.05 \cdot 10^{+133}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \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{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(C - B\right)\right)}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < -1.31999999999999998e154

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

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

      if -1.31999999999999998e154 < B < 2.05000000000000002e133

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

      if 2.05000000000000002e133 < B

      1. Initial program 29.8%

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

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

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

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

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

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

          1. Initial program 63.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} \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 rewrites81.3%

              \[\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 -40 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < 1.99999999999999991e-6

            1. Initial program 17.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 1.99999999999999991e-6 < (*.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.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} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{{B}^{2} + {C}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

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

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

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

          Alternative 3: 62.0% accurate, 2.1× speedup?

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

            1. Initial program 27.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -3.1000000000000001e-12 < A < 1.9499999999999999e-231

            1. Initial program 58.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 A around 0

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

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

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

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

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

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

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

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

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

              if 1.9499999999999999e-231 < A

              1. Initial program 71.2%

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

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

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

              Alternative 4: 46.1% accurate, 2.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.6 \cdot 10^{-34}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 8 \cdot 10^{-265}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 7.5 \cdot 10^{-176}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
              (FPCore (A B C)
               :precision binary64
               (if (<= B -1.6e-34)
                 (* 180.0 (/ (atan 1.0) (PI)))
                 (if (<= B 8e-265)
                   (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
                   (if (<= B 7.5e-176)
                     (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
                     (* 180.0 (/ (atan -1.0) (PI)))))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;B \leq -1.6 \cdot 10^{-34}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;B \leq 8 \cdot 10^{-265}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{elif}\;B \leq 7.5 \cdot 10^{-176}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
              
              \mathbf{else}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if B < -1.60000000000000001e-34

                1. Initial program 50.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 rewrites57.0%

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

                  if -1.60000000000000001e-34 < B < 7.99999999999999988e-265

                  1. Initial program 62.8%

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

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

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

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

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

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

                  if 7.99999999999999988e-265 < B < 7.5e-176

                  1. Initial program 49.7%

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

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

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

                  if 7.5e-176 < B

                  1. Initial program 59.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 rewrites59.8%

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

                  Alternative 5: 47.2% accurate, 2.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.6 \cdot 10^{-34}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 6.6 \cdot 10^{-205}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.36 \cdot 10^{-139}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                  (FPCore (A B C)
                   :precision binary64
                   (if (<= B -1.6e-34)
                     (* 180.0 (/ (atan 1.0) (PI)))
                     (if (<= B 6.6e-205)
                       (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
                       (if (<= B 1.36e-139)
                         (* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
                         (* 180.0 (/ (atan -1.0) (PI)))))))
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;B \leq -1.6 \cdot 10^{-34}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                  
                  \mathbf{elif}\;B \leq 6.6 \cdot 10^{-205}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
                  
                  \mathbf{elif}\;B \leq 1.36 \cdot 10^{-139}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if B < -1.60000000000000001e-34

                    1. Initial program 50.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 rewrites57.0%

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

                      if -1.60000000000000001e-34 < B < 6.5999999999999998e-205

                      1. Initial program 63.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 inf

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

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

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

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

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

                      if 6.5999999999999998e-205 < B < 1.36000000000000003e-139

                      1. Initial program 33.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 1.36000000000000003e-139 < B

                      1. Initial program 59.9%

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

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

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

                      Alternative 6: 60.7% accurate, 2.4× speedup?

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

                        1. Initial program 69.3%

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

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

                            \[\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 4.5e6 < C

                          1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 7: 59.3% accurate, 2.4× speedup?

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

                          1. Initial program 76.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 rewrites81.7%

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

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

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

                              if -1.45e-106 < C < 4.5e6

                              1. Initial program 63.8%

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

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

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

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

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

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

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

                                if 4.5e6 < C

                                1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 8: 47.5% accurate, 2.5× speedup?

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

                                1. Initial program 79.8%

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

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

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

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

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

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

                                if -9.19999999999999959e-83 < C < 1.6e6

                                1. Initial program 62.8%

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

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

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

                                  if 1.6e6 < C

                                  1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 9: 46.8% accurate, 2.5× speedup?

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

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

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

                                    if -1.34999999999999997e-73 < B < 1.36000000000000003e-139

                                    1. Initial program 56.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 1.36000000000000003e-139 < B

                                    1. Initial program 59.9%

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

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

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

                                    Alternative 10: 60.7% accurate, 2.5× speedup?

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

                                      1. Initial program 69.3%

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

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

                                          \[\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 4.5e6 < C

                                        1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 11: 51.8% accurate, 2.5× speedup?

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

                                        1. Initial program 69.3%

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

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

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

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

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

                                            if 1.6e6 < C

                                            1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 12: 45.4% accurate, 2.8× speedup?

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

                                            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 rewrites47.2%

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

                                              if -1.70000000000000004e-140 < B < 6.1000000000000003e-176

                                              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} \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 rewrites49.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if 6.1000000000000003e-176 < B

                                                1. Initial program 59.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 rewrites59.8%

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

                                                Alternative 13: 40.6% accurate, 2.9× speedup?

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

                                                  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 rewrites38.6%

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

                                                    if -1.05000000000000004e-304 < B

                                                    1. Initial program 58.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 rewrites47.5%

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

                                                    Alternative 14: 20.5% accurate, 3.1× speedup?

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

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

                                                      Reproduce

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