ABCF->ab-angle angle

Percentage Accurate: 53.8% → 88.9%
Time: 12.7s
Alternatives: 15
Speedup: 2.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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.8% 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: 88.9% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.5% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.5% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

Alternative 4: 79.5% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

Alternative 5: 73.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

Alternative 6: 73.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

    1. Initial program 28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

Alternative 7: 52.0% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3.3 \cdot 10^{-271}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 1.68 \cdot 10^{-233}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 40000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= B -3.3e-271)
   (* 180.0 (/ (atan (+ 1.0 (/ C B))) (PI)))
   (if (<= B 1.68e-233)
     (* 180.0 (/ (atan 0.0) (PI)))
     (if (<= B 40000.0)
       (* 180.0 (/ (atan (* 2.0 (/ C B))) (PI)))
       (* 180.0 (/ (atan -1.0) (PI)))))))
\begin{array}{l}

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

\mathbf{elif}\;B \leq 1.68 \cdot 10^{-233}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;B \leq 40000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\mathsf{PI}\left(\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < -3.3000000000000002e-271

    1. Initial program 63.0%

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

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

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

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

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

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

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

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

      if -3.3000000000000002e-271 < B < 1.67999999999999993e-233

      1. Initial program 45.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. distribute-rgt1-inN/A

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

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

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

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

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

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

      if 1.67999999999999993e-233 < B < 4e4

      1. Initial program 59.8%

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

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

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

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

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

      if 4e4 < B

      1. Initial program 53.1%

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

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

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

      Alternative 8: 51.1% accurate, 2.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;B \leq -3.3 \cdot 10^{-271}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{-108}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 40000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
      (FPCore (A B C)
       :precision binary64
       (let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ C B))) (PI)))))
         (if (<= B -3.3e-271)
           t_0
           (if (<= B 4.8e-108)
             (* 180.0 (/ (atan 0.0) (PI)))
             (if (<= B 40000.0) t_0 (* 180.0 (/ (atan -1.0) (PI))))))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\mathsf{PI}\left(\right)}\\
      \mathbf{if}\;B \leq -3.3 \cdot 10^{-271}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;B \leq 4.8 \cdot 10^{-108}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
      
      \mathbf{elif}\;B \leq 40000:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if B < -3.3000000000000002e-271 or 4.80000000000000034e-108 < B < 4e4

        1. Initial program 62.7%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \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. lower-sqrt.f64N/A

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

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

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

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

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

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

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

          if -3.3000000000000002e-271 < B < 4.80000000000000034e-108

          1. Initial program 52.6%

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

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

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

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

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

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

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

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

          if 4e4 < B

          1. Initial program 53.1%

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

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

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

          Alternative 9: 56.3% accurate, 2.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

            if -5.50000000000000024e-32 < A < 2.9000000000000001e82

            1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

              if 2.9000000000000001e82 < A

              1. Initial program 81.8%

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

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

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

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

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

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

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

            Alternative 10: 56.3% accurate, 2.5× speedup?

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

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

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

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

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

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

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

              if -5.50000000000000024e-32 < A < 2.9000000000000001e82

              1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

                if 2.9000000000000001e82 < A

                1. Initial program 81.8%

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

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

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

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

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

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

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

              Alternative 11: 60.5% accurate, 2.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                if -5.50000000000000024e-32 < A

                1. Initial program 69.2%

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

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

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

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

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

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

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

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

              Alternative 12: 53.8% accurate, 2.6× speedup?

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

                1. Initial program 73.8%

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

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

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

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

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

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

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

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

                  if 1.1e-284 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 13: 44.7% accurate, 2.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -2.05 \cdot 10^{-199}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;B \leq 3.1 \cdot 10^{-62}:\\ \;\;\;\;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.05e-199)
                     (* 180.0 (/ (atan 1.0) (PI)))
                     (if (<= B 3.1e-62)
                       (* 180.0 (/ (atan 0.0) (PI)))
                       (* 180.0 (/ (atan -1.0) (PI))))))
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;B \leq -2.05 \cdot 10^{-199}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
                  
                  \mathbf{elif}\;B \leq 3.1 \cdot 10^{-62}:\\
                  \;\;\;\;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.05000000000000011e-199

                    1. Initial program 63.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 rewrites47.3%

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

                      if -2.05000000000000011e-199 < B < 3.0999999999999999e-62

                      1. Initial program 54.8%

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

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

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

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

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

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

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

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

                      if 3.0999999999999999e-62 < B

                      1. Initial program 55.8%

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

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

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

                      Alternative 14: 29.6% accurate, 2.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 3.1 \cdot 10^{-62}:\\ \;\;\;\;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 3.1e-62)
                         (* 180.0 (/ (atan 0.0) (PI)))
                         (* 180.0 (/ (atan -1.0) (PI)))))
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;B \leq 3.1 \cdot 10^{-62}:\\
                      \;\;\;\;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 2 regimes
                      2. if B < 3.0999999999999999e-62

                        1. Initial program 59.5%

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

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

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

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

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

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

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

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

                        if 3.0999999999999999e-62 < B

                        1. Initial program 55.8%

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

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

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

                        Alternative 15: 21.4% 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 58.6%

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

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

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

                          Reproduce

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