
(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:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
(pow B -1.0)
(- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(if (or (<= t_0 -0.5) (not (<= t_0 0.0)))
(/ (* (atan (/ (- (- C A) (hypot B (- A C))) B)) 180.0) (PI))
(/ (* (atan (* (/ B A) 0.5)) 180.0) (PI)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t\_0 \leq -0.5 \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
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)))))) Initial program 56.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites90.1%
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.0Initial program 15.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites15.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6460.1
Applied rewrites60.1%
Final simplification86.4%
(FPCore (A B C)
:precision binary64
(if (<= B -1.82e-137)
(/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
(if (<= B -4.6e-241)
(* 180.0 (/ (atan (fma (* (+ (/ A C) 1.0) (/ B C)) -0.5 0.0)) (PI)))
(if (<= B 2.4e+153)
(*
180.0
(/ (atan (* (pow B -1.0) (- (- C A) (sqrt (fma B B (* A A)))))) (PI)))
(* 180.0 (/ (atan -1.0) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq -4.6 \cdot 10^{-241}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -1.82e-137Initial program 53.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites79.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6474.2
Applied rewrites74.2%
if -1.82e-137 < B < -4.5999999999999999e-241Initial program 52.2%
Taylor expanded in C around inf
+-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*r/N/A
mul-1-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
div0N/A
lower-fma.f64N/A
unpow2N/A
times-fracN/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6483.8
Applied rewrites83.8%
if -4.5999999999999999e-241 < B < 2.39999999999999992e153Initial program 61.0%
Taylor expanded in C around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6459.8
Applied rewrites59.8%
if 2.39999999999999992e153 < B Initial program 24.6%
Taylor expanded in B around inf
Applied rewrites86.1%
Final simplification71.3%
(FPCore (A B C)
:precision binary64
(if (<= C -0.005)
(/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
(if (<= C 7e+126)
(* 180.0 (/ (atan (/ (+ (hypot B A) A) (- B))) (PI)))
(* 180.0 (/ (atan (fma (* (+ (/ A C) 1.0) (/ B C)) -0.5 0.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -0.005:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;C \leq 7 \cdot 10^{+126}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(B, A\right) + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if C < -0.0050000000000000001Initial program 77.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites92.3%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6487.7
Applied rewrites87.7%
if -0.0050000000000000001 < C < 7.0000000000000005e126Initial program 48.7%
Taylor expanded in C around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
mul-1-negN/A
lower-neg.f6479.3
Applied rewrites79.3%
if 7.0000000000000005e126 < C Initial program 18.2%
Taylor expanded in C around inf
+-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*r/N/A
mul-1-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
div0N/A
lower-fma.f64N/A
unpow2N/A
times-fracN/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6483.5
Applied rewrites83.5%
(FPCore (A B C)
:precision binary64
(if (<= A -9.6e+107)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(if (<= A 3.6e+195)
(/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
(/ (* (atan (/ (- (- C A) (sqrt (* B B))) B)) 180.0) (PI)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -9.6 \cdot 10^{+107}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 3.6 \cdot 10^{+195}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -9.6000000000000002e107Initial program 13.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6473.6
Applied rewrites73.6%
if -9.6000000000000002e107 < A < 3.5999999999999999e195Initial program 57.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites83.6%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.8
Applied rewrites76.8%
if 3.5999999999999999e195 < A Initial program 96.9%
Taylor expanded in B around inf
unpow2N/A
lower-*.f6496.9
Applied rewrites96.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites96.9%
(FPCore (A B C)
:precision binary64
(if (<= B -1.82e-137)
(/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
(if (<= B -3.2e-243)
(* 180.0 (/ (atan (fma (* (+ (/ A C) 1.0) (/ B C)) -0.5 0.0)) (PI)))
(if (<= B 2.4e+153)
(/ (* (atan (/ (- (- C A) (sqrt (* B B))) B)) 180.0) (PI))
(* 180.0 (/ (atan -1.0) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq -3.2 \cdot 10^{-243}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\left(\frac{A}{C} + 1\right) \cdot \frac{B}{C}, -0.5, 0\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -1.82e-137Initial program 53.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites79.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6474.2
Applied rewrites74.2%
if -1.82e-137 < B < -3.1999999999999998e-243Initial program 52.2%
Taylor expanded in C around inf
+-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*r/N/A
mul-1-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
div0N/A
lower-fma.f64N/A
unpow2N/A
times-fracN/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6483.8
Applied rewrites83.8%
if -3.1999999999999998e-243 < B < 2.39999999999999992e153Initial program 61.0%
Taylor expanded in B around inf
unpow2N/A
lower-*.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.9%
if 2.39999999999999992e153 < B Initial program 24.6%
Taylor expanded in B around inf
Applied rewrites86.1%
Final simplification70.2%
(FPCore (A B C)
:precision binary64
(if (<= B -1.82e-137)
(/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
(if (<= B -3.2e-243)
(/ (* (atan (/ (* (fma (/ A C) B B) -0.5) C)) 180.0) (PI))
(if (<= B 2.4e+153)
(/ (* (atan (/ (- (- C A) (sqrt (* B B))) B)) 180.0) (PI))
(* 180.0 (/ (atan -1.0) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.82 \cdot 10^{-137}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq -3.2 \cdot 10^{-243}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{A}{C}, B, B\right) \cdot -0.5}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -1.82e-137Initial program 53.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites79.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6474.2
Applied rewrites74.2%
if -1.82e-137 < B < -3.1999999999999998e-243Initial program 52.2%
Taylor expanded in C around inf
+-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*r/N/A
mul-1-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
div0N/A
lower-fma.f64N/A
unpow2N/A
times-fracN/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6483.8
Applied rewrites83.8%
Applied rewrites83.7%
if -3.1999999999999998e-243 < B < 2.39999999999999992e153Initial program 61.0%
Taylor expanded in B around inf
unpow2N/A
lower-*.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.9%
if 2.39999999999999992e153 < B Initial program 24.6%
Taylor expanded in B around inf
Applied rewrites86.1%
Final simplification70.2%
(FPCore (A B C)
:precision binary64
(if (<= B -1e+158)
(/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))
(if (<= B 2.4e+153)
(/ (* (atan (/ (- (- C A) (sqrt (* B B))) B)) 180.0) (PI))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1 \cdot 10^{+158}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.4 \cdot 10^{+153}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B}}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -9.99999999999999953e157Initial program 27.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites85.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6485.4
Applied rewrites85.4%
if -9.99999999999999953e157 < B < 2.39999999999999992e153Initial program 63.2%
Taylor expanded in B around inf
unpow2N/A
lower-*.f6460.2
Applied rewrites60.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites60.2%
if 2.39999999999999992e153 < B Initial program 24.6%
Taylor expanded in B around inf
Applied rewrites86.1%
Final simplification68.0%
(FPCore (A B C)
:precision binary64
(if (<= B -1.25e-71)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B -2.3e-224)
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
(if (<= B 2.9e-112)
(* 180.0 (/ (atan 0.0) (PI)))
(if (<= B 1.55e-23)
(* 180.0 (/ (atan (* (/ C B) 2.0)) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq -2.3 \cdot 10^{-224}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.9 \cdot 10^{-112}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.55 \cdot 10^{-23}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -1.24999999999999999e-71Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites58.6%
if -1.24999999999999999e-71 < B < -2.29999999999999988e-224Initial program 58.1%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
if -2.29999999999999988e-224 < B < 2.89999999999999992e-112Initial program 52.0%
Taylor expanded in C around inf
associate-*r/N/A
mul-1-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
div044.0
Applied rewrites44.0%
if 2.89999999999999992e-112 < B < 1.5499999999999999e-23Initial program 73.6%
Taylor expanded in C around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.7
Applied rewrites62.7%
if 1.5499999999999999e-23 < B Initial program 41.6%
Taylor expanded in B around inf
Applied rewrites67.4%
(FPCore (A B C)
:precision binary64
(if (<= B -1.25e-71)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B -2.3e-224)
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
(if (<= B 3.6e+22)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(* 180.0 (/ (atan -1.0) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq -2.3 \cdot 10^{-224}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 3.6 \cdot 10^{+22}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -1.24999999999999999e-71Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites58.6%
if -1.24999999999999999e-71 < B < -2.29999999999999988e-224Initial program 58.1%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
if -2.29999999999999988e-224 < B < 3.6e22Initial program 56.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6441.3
Applied rewrites41.3%
if 3.6e22 < B Initial program 40.8%
Taylor expanded in B around inf
Applied rewrites73.2%
(FPCore (A B C)
:precision binary64
(if (<= B -1.25e-71)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 1.75e-42)
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.25 \cdot 10^{-71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.75 \cdot 10^{-42}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -1.24999999999999999e-71Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites58.6%
if -1.24999999999999999e-71 < B < 1.7500000000000001e-42Initial program 58.8%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6440.6
Applied rewrites40.6%
if 1.7500000000000001e-42 < B Initial program 41.7%
Taylor expanded in B around inf
Applied rewrites63.5%
(FPCore (A B C) :precision binary64 (if (<= B 3.4e-15) (/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI)) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < 3.4e-15Initial program 56.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites81.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6465.7
Applied rewrites65.7%
if 3.4e-15 < B Initial program 38.9%
Taylor expanded in B around inf
Applied rewrites68.4%
Final simplification66.4%
(FPCore (A B C) :precision binary64 (if (<= B 3.4e-15) (* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < 3.4e-15Initial program 56.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6465.7
Applied rewrites65.7%
if 3.4e-15 < B Initial program 38.9%
Taylor expanded in B around inf
Applied rewrites68.4%
(FPCore (A B C)
:precision binary64
(if (<= B -2.8e-81)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 1.15e-114)
(* 180.0 (/ (atan 0.0) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.8 \cdot 10^{-81}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.15 \cdot 10^{-114}:\\
\;\;\;\;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}
if B < -2.7999999999999999e-81Initial program 53.5%
Taylor expanded in B around -inf
Applied rewrites58.2%
if -2.7999999999999999e-81 < B < 1.15e-114Initial program 53.9%
Taylor expanded in C around inf
associate-*r/N/A
mul-1-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
div036.7
Applied rewrites36.7%
if 1.15e-114 < B Initial program 48.3%
Taylor expanded in B around inf
Applied rewrites56.4%
(FPCore (A B C) :precision binary64 (if (<= B 1.15e-114) (* 180.0 (/ (atan 0.0) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.15 \cdot 10^{-114}:\\
\;\;\;\;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}
if B < 1.15e-114Initial program 53.7%
Taylor expanded in C around inf
associate-*r/N/A
mul-1-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
div018.8
Applied rewrites18.8%
if 1.15e-114 < B Initial program 48.3%
Taylor expanded in B around inf
Applied rewrites56.4%
(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}
Initial program 51.9%
Taylor expanded in B around inf
Applied rewrites21.3%
herbie shell --seed 2024322
(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))))