ABCF->ab-angle angle

Percentage Accurate: 53.1% → 81.3%
Time: 11.7s
Alternatives: 14
Speedup: 2.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 81.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.80000000000000023e134 < A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 72.2% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 63.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 2.16 \cdot 10^{-44}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -3.4e-11)
   (* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
   (if (<= A 2.16e-44)
     (*
      180.0
      (/ (atan (* (pow B -1.0) (- (- C A) (sqrt (fma B B (* C C)))))) (PI)))
     (* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI))))))
\begin{array}{l}

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

\mathbf{elif}\;A \leq 2.16 \cdot 10^{-44}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -3.3999999999999999e-11

    1. Initial program 18.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3999999999999999e-11 < A < 2.15999999999999988e-44

    1. Initial program 58.9%

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

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

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

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

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

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

    if 2.15999999999999988e-44 < A

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 75.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;A \leq -5.2 \cdot 10^{+131}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot t\_0\\ \mathbf{elif}\;A \leq 2.4 \cdot 10^{+42}:\\ \;\;\;\;\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (/ 180.0 (PI))))
   (if (<= A -5.2e+131)
     (* (atan (* (/ B A) 0.5)) t_0)
     (if (<= A 2.4e+42)
       (* (atan (/ (- C (hypot B C)) B)) t_0)
       (/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))))))
\begin{array}{l}

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

\mathbf{elif}\;A \leq 2.4 \cdot 10^{+42}:\\
\;\;\;\;\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -5.2e131

    1. Initial program 7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2e131 < A < 2.3999999999999999e42

    1. Initial program 57.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3999999999999999e42 < A

    1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 75.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;A \leq 2.4 \cdot 10^{+42}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -5.2e131

    1. Initial program 7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2e131 < A < 2.3999999999999999e42

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

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

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

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

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

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

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

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

    if 2.3999999999999999e42 < A

    1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.3% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.80000000000000023e134 < A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 46.8% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;A \leq -4.8 \cdot 10^{-26}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq -8.5 \cdot 10^{-112}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;A \leq 2.6 \cdot 10^{-281}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 3.6 \cdot 10^{-112}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan -1.0) (PI)))))
   (if (<= A -4.8e-26)
     (* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
     (if (<= A -8.5e-112)
       t_0
       (if (<= A 2.6e-281)
         (* 180.0 (/ (atan 1.0) (PI)))
         (if (<= A 3.6e-112)
           t_0
           (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))))))))
\begin{array}{l}

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

\mathbf{elif}\;A \leq -8.5 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;A \leq 2.6 \cdot 10^{-281}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;A \leq 3.6 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -4.8000000000000002e-26

    1. Initial program 22.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8000000000000002e-26 < A < -8.49999999999999992e-112 or 2.60000000000000005e-281 < A < 3.6000000000000001e-112

    1. Initial program 60.3%

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

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

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

      if -8.49999999999999992e-112 < A < 2.60000000000000005e-281

      1. Initial program 50.2%

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

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

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

        if 3.6000000000000001e-112 < A

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -4.8 \cdot 10^{-26}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq -8.5 \cdot 10^{-112}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 2.6 \cdot 10^{-281}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 3.6 \cdot 10^{-112}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
      7. Add Preprocessing

      Alternative 8: 46.8% accurate, 2.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;A \leq -4.8 \cdot 10^{-26}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq -8.5 \cdot 10^{-112}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;A \leq 2.6 \cdot 10^{-281}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;A \leq 3.6 \cdot 10^{-112}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
      (FPCore (A B C)
       :precision binary64
       (let* ((t_0 (* 180.0 (/ (atan -1.0) (PI)))))
         (if (<= A -4.8e-26)
           (* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
           (if (<= A -8.5e-112)
             t_0
             (if (<= A 2.6e-281)
               (* 180.0 (/ (atan 1.0) (PI)))
               (if (<= A 3.6e-112)
                 t_0
                 (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))))))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := 180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
      \mathbf{if}\;A \leq -4.8 \cdot 10^{-26}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
      
      \mathbf{elif}\;A \leq -8.5 \cdot 10^{-112}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;A \leq 2.6 \cdot 10^{-281}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
      
      \mathbf{elif}\;A \leq 3.6 \cdot 10^{-112}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if A < -4.8000000000000002e-26

        1. Initial program 22.3%

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

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

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

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

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

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

        if -4.8000000000000002e-26 < A < -8.49999999999999992e-112 or 2.60000000000000005e-281 < A < 3.6000000000000001e-112

        1. Initial program 60.3%

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

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

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

          if -8.49999999999999992e-112 < A < 2.60000000000000005e-281

          1. Initial program 50.2%

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

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

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

            if 3.6000000000000001e-112 < A

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

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

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

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

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

          Alternative 9: 45.8% accurate, 2.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -2.5 \cdot 10^{-27}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -4.2 \cdot 10^{-248}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.5 \cdot 10^{-228}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\ \;\;\;\;180 \cdot \frac{\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 -2.5e-27)
             (* 180.0 (/ (atan 1.0) (PI)))
             (if (<= B -4.2e-248)
               (* 180.0 (/ (atan (* B (/ -0.5 C))) (PI)))
               (if (<= B 1.5e-228)
                 (* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
                 (if (<= B 1.5e-46)
                   (* 180.0 (/ (atan 0.0) (PI)))
                   (* 180.0 (/ (atan -1.0) (PI))))))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;B \leq -2.5 \cdot 10^{-27}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;B \leq -4.2 \cdot 10^{-248}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;B \leq 1.5 \cdot 10^{-228}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
          
          \mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\
          \;\;\;\;180 \cdot \frac{\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 5 regimes
          2. if B < -2.5000000000000001e-27

            1. Initial program 54.3%

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

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

              if -2.5000000000000001e-27 < B < -4.2e-248

              1. Initial program 42.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -4.2e-248 < B < 1.5e-228

                1. Initial program 66.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 A around inf

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

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

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

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

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

                if 1.5e-228 < B < 1.49999999999999994e-46

                1. Initial program 46.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 C around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 1.49999999999999994e-46 < B

                1. Initial program 56.7%

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

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

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

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

                Alternative 10: 59.4% accurate, 2.4× speedup?

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

                  1. Initial program 22.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -4.8000000000000002e-26 < A < -5.2999999999999997e-111

                  1. Initial program 47.3%

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

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

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

                    if -5.2999999999999997e-111 < A

                    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

                  Alternative 11: 45.9% accurate, 2.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -2.5 \cdot 10^{-27}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -9 \cdot 10^{-202}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\ \;\;\;\;180 \cdot \frac{\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 -2.5e-27)
                     (* 180.0 (/ (atan 1.0) (PI)))
                     (if (<= B -9e-202)
                       (* 180.0 (/ (atan (* B (/ -0.5 C))) (PI)))
                       (if (<= B 1.5e-46)
                         (* 180.0 (/ (atan 0.0) (PI)))
                         (* 180.0 (/ (atan -1.0) (PI)))))))
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;B \leq -2.5 \cdot 10^{-27}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                  
                  \mathbf{elif}\;B \leq -9 \cdot 10^{-202}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\
                  
                  \mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\
                  \;\;\;\;180 \cdot \frac{\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 4 regimes
                  2. if B < -2.5000000000000001e-27

                    1. Initial program 54.3%

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

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

                      if -2.5000000000000001e-27 < B < -9.00000000000000078e-202

                      1. Initial program 43.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if -9.00000000000000078e-202 < B < 1.49999999999999994e-46

                        1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 1.49999999999999994e-46 < B

                        1. Initial program 56.7%

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

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -2.5 \cdot 10^{-27}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq -9 \cdot 10^{-202}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                        7. Add Preprocessing

                        Alternative 12: 45.2% accurate, 2.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -2.8 \cdot 10^{-111}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\ \;\;\;\;180 \cdot \frac{\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 -2.8e-111)
                           (* 180.0 (/ (atan 1.0) (PI)))
                           (if (<= B 1.5e-46)
                             (* 180.0 (/ (atan 0.0) (PI)))
                             (* 180.0 (/ (atan -1.0) (PI))))))
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;B \leq -2.8 \cdot 10^{-111}:\\
                        \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                        
                        \mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\
                        \;\;\;\;180 \cdot \frac{\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 < -2.79999999999999995e-111

                          1. Initial program 51.5%

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

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

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

                            if -2.79999999999999995e-111 < B < 1.49999999999999994e-46

                            1. Initial program 53.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 1.49999999999999994e-46 < B

                            1. Initial program 56.7%

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

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

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

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

                            Alternative 13: 40.2% accurate, 2.9× speedup?

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

                              1. Initial program 51.2%

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

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

                                if -3.999999999999988e-310 < B

                                1. Initial program 56.2%

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

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

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

                                Alternative 14: 20.8% 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 53.8%

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

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

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

                                  Reproduce

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