
(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 (/ 180.0 (PI))))
(if (<= A -5.8e+134)
(* t_0 (atan (* (/ B A) 0.5)))
(* (atan (/ (- (- C A) (hypot (- A C) B)) B)) t_0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;A \leq -5.8 \cdot 10^{+134}:\\
\;\;\;\;t\_0 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right) \cdot t\_0\\
\end{array}
\end{array}
if A < -5.80000000000000023e134Initial program 7.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.4
Applied rewrites82.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6482.6
Applied rewrites82.6%
if -5.80000000000000023e134 < A Initial program 64.0%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6464.0
lift-*.f64N/A
*-commutativeN/A
Applied rewrites85.1%
Final simplification84.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(atan
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* (/ (atan (- t_1 1.0)) (PI)) 180.0)
(if (<= t_0 0.0)
(* (/ 180.0 (PI)) (atan (* (/ B A) 0.5)))
(* (/ (atan (+ t_1 1.0)) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) < -0.5Initial program 60.5%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6470.8
Applied rewrites70.8%
if -0.5 < (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) < -0.0Initial program 18.0%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6451.0
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6451.2
Applied rewrites51.2%
if -0.0 < (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) Initial program 56.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6471.7
Applied rewrites71.7%
Final simplification69.0%
(FPCore (A B C)
:precision binary64
(if (<= A -5.2e+131)
(* (/ 180.0 (PI)) (atan (* (/ B A) 0.5)))
(if (<= A 2.4e+42)
(/ (atan (/ (- C (hypot B C)) B)) (* 0.005555555555555556 (PI)))
(* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.2 \cdot 10^{+131}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq 2.4 \cdot 10^{+42}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -5.2e131Initial program 7.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.4
Applied rewrites82.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6482.6
Applied rewrites82.6%
if -5.2e131 < A < 2.3999999999999999e42Initial program 57.1%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6457.1
lift-*.f64N/A
*-commutativeN/A
Applied rewrites80.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval80.5
Applied rewrites80.5%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6478.2
Applied rewrites78.2%
if 2.3999999999999999e42 < A Initial program 83.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6489.4
Applied rewrites89.4%
Final simplification81.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ 180.0 (PI))))
(if (<= A -5.2e+131)
(* t_0 (atan (* (/ B A) 0.5)))
(if (<= A 2.4e+42)
(* (atan (/ (- C (hypot B C)) B)) t_0)
(* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;A \leq -5.2 \cdot 10^{+131}:\\
\;\;\;\;t\_0 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq 2.4 \cdot 10^{+42}:\\
\;\;\;\;\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -5.2e131Initial program 7.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.4
Applied rewrites82.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6482.6
Applied rewrites82.6%
if -5.2e131 < A < 2.3999999999999999e42Initial program 57.1%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6457.1
lift-*.f64N/A
*-commutativeN/A
Applied rewrites80.5%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6478.2
Applied rewrites78.2%
if 2.3999999999999999e42 < A Initial program 83.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6489.4
Applied rewrites89.4%
Final simplification81.3%
(FPCore (A B C)
:precision binary64
(if (<= A -5.2e+131)
(* (/ 180.0 (PI)) (atan (* (/ B A) 0.5)))
(if (<= A 2.4e+42)
(* (/ (atan (/ (- C (hypot C B)) B)) (PI)) 180.0)
(* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.2 \cdot 10^{+131}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq 2.4 \cdot 10^{+42}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -5.2e131Initial program 7.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.4
Applied rewrites82.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6482.6
Applied rewrites82.6%
if -5.2e131 < A < 2.3999999999999999e42Initial program 57.1%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6478.2
Applied rewrites78.2%
if 2.3999999999999999e42 < A Initial program 83.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6489.4
Applied rewrites89.4%
Final simplification81.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ 180.0 (PI))))
(if (<= A -3.4e-11)
(* t_0 (atan (* (/ B A) 0.5)))
(if (<= A 2.16e-44)
(* (atan (/ (- (- C A) (sqrt (fma C C (* B B)))) B)) t_0)
(* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;A \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;t\_0 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq 2.16 \cdot 10^{-44}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}}{B}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -3.3999999999999999e-11Initial program 18.9%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6470.5
Applied rewrites70.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6470.7
Applied rewrites70.7%
if -3.3999999999999999e-11 < A < 2.15999999999999988e-44Initial program 58.9%
Taylor expanded in A around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.9
Applied rewrites58.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
lift-*.f64N/A
lower-*.f64N/A
Applied rewrites58.9%
if 2.15999999999999988e-44 < A Initial program 81.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6488.2
Applied rewrites88.2%
Final simplification69.5%
(FPCore (A B C)
:precision binary64
(if (<= A -2.9e-11)
(* (/ 180.0 (PI)) (atan (* (/ B A) 0.5)))
(if (<= A -1.6e-104)
(/ (atan (/ (- C B) B)) (* 0.005555555555555556 (PI)))
(* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.9 \cdot 10^{-11}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq -1.6 \cdot 10^{-104}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -2.9e-11Initial program 18.9%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6470.5
Applied rewrites70.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6470.7
Applied rewrites70.7%
if -2.9e-11 < A < -1.59999999999999994e-104Initial program 55.4%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6455.4
lift-*.f64N/A
*-commutativeN/A
Applied rewrites76.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval76.6
Applied rewrites76.6%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.7
Applied rewrites76.7%
Taylor expanded in C around 0
Applied rewrites61.7%
if -1.59999999999999994e-104 < A Initial program 68.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6466.9
Applied rewrites66.9%
Final simplification67.5%
(FPCore (A B C)
:precision binary64
(if (<= A -2.9e-11)
(* (/ 180.0 (PI)) (atan (* (/ B A) 0.5)))
(if (<= A 9e-39)
(/ (atan (/ (- C B) B)) (* 0.005555555555555556 (PI)))
(* (/ (atan (* -2.0 (/ A B))) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.9 \cdot 10^{-11}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq 9 \cdot 10^{-39}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -2.9e-11Initial program 18.9%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6470.5
Applied rewrites70.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6470.7
Applied rewrites70.7%
if -2.9e-11 < A < 9.0000000000000002e-39Initial program 58.5%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6458.5
lift-*.f64N/A
*-commutativeN/A
Applied rewrites82.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval82.4
Applied rewrites82.4%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.1
Applied rewrites80.1%
Taylor expanded in C around 0
Applied rewrites48.2%
if 9.0000000000000002e-39 < A Initial program 82.5%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
Final simplification60.0%
(FPCore (A B C)
:precision binary64
(if (<= A -2.55e-11)
(* (/ (atan (* (/ B A) 0.5)) (PI)) 180.0)
(if (<= A 9e-39)
(/ (atan (/ (- C B) B)) (* 0.005555555555555556 (PI)))
(* (/ (atan (* -2.0 (/ A B))) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.55 \cdot 10^{-11}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;A \leq 9 \cdot 10^{-39}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -2.54999999999999992e-11Initial program 18.9%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6470.5
Applied rewrites70.5%
if -2.54999999999999992e-11 < A < 9.0000000000000002e-39Initial program 58.5%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6458.5
lift-*.f64N/A
*-commutativeN/A
Applied rewrites82.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval82.4
Applied rewrites82.4%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.1
Applied rewrites80.1%
Taylor expanded in C around 0
Applied rewrites48.2%
if 9.0000000000000002e-39 < A Initial program 82.5%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
Final simplification59.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (PI))))
(if (<= B -4.3e-147)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 4e-244)
(/ (atan (/ (- A) B)) t_0)
(/ (atan (/ (- C B) B)) t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;B \leq -4.3 \cdot 10^{-147}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 4 \cdot 10^{-244}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B}\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{t\_0}\\
\end{array}
\end{array}
if B < -4.3000000000000001e-147Initial program 49.8%
Taylor expanded in B around -inf
Applied rewrites53.1%
if -4.3000000000000001e-147 < B < 3.9999999999999997e-244Initial program 57.3%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6457.3
lift-*.f64N/A
*-commutativeN/A
Applied rewrites83.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval83.2
Applied rewrites83.2%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in A around inf
Applied rewrites41.0%
if 3.9999999999999997e-244 < B Initial program 55.0%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6455.0
lift-*.f64N/A
*-commutativeN/A
Applied rewrites78.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval78.4
Applied rewrites78.4%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.1
Applied rewrites65.1%
Taylor expanded in C around 0
Applied rewrites56.4%
Final simplification52.0%
(FPCore (A B C)
:precision binary64
(if (<= B -4.3e-147)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 2.8e-223)
(/ (atan (/ (- A) B)) (* 0.005555555555555556 (PI)))
(if (<= B 6.5e-43)
(* (/ (atan 0.0) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.3 \cdot 10^{-147}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 2.8 \cdot 10^{-223}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-A}{B}\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 6.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -4.3000000000000001e-147Initial program 49.8%
Taylor expanded in B around -inf
Applied rewrites53.1%
if -4.3000000000000001e-147 < B < 2.80000000000000015e-223Initial program 60.2%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6460.2
lift-*.f64N/A
*-commutativeN/A
Applied rewrites84.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval84.4
Applied rewrites84.4%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6454.6
Applied rewrites54.6%
Taylor expanded in A around inf
Applied rewrites43.4%
if 2.80000000000000015e-223 < B < 6.50000000000000001e-43Initial program 46.7%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval39.2
Applied rewrites39.2%
if 6.50000000000000001e-43 < B Initial program 56.7%
Taylor expanded in B around inf
Applied rewrites58.3%
Final simplification50.3%
(FPCore (A B C) :precision binary64 (if (<= C 1.7e-68) (/ (atan (/ (- C B) B)) (* 0.005555555555555556 (PI))) (* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.7 \cdot 10^{-68}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if C < 1.70000000000000009e-68Initial program 65.6%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6465.6
lift-*.f64N/A
*-commutativeN/A
Applied rewrites86.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval86.9
Applied rewrites86.9%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.7
Applied rewrites72.7%
Taylor expanded in C around 0
Applied rewrites51.4%
if 1.70000000000000009e-68 < C Initial program 29.8%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6459.6
Applied rewrites59.6%
Applied rewrites59.5%
Final simplification54.1%
(FPCore (A B C)
:precision binary64
(if (<= B -3.2e-112)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 6.5e-43)
(* (/ (atan 0.0) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.2 \cdot 10^{-112}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 6.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -3.19999999999999993e-112Initial program 51.5%
Taylor expanded in B around -inf
Applied rewrites56.2%
if -3.19999999999999993e-112 < B < 6.50000000000000001e-43Initial program 53.4%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval34.0
Applied rewrites34.0%
if 6.50000000000000001e-43 < B Initial program 56.7%
Taylor expanded in B around inf
Applied rewrites58.3%
Final simplification47.7%
(FPCore (A B C) :precision binary64 (if (<= B 6.5e-43) (* (/ (atan 0.0) (PI)) 180.0) (* (/ (atan -1.0) (PI)) 180.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 6.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < 6.50000000000000001e-43Initial program 52.6%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval21.5
Applied rewrites21.5%
if 6.50000000000000001e-43 < B Initial program 56.7%
Taylor expanded in B around inf
Applied rewrites58.3%
Final simplification32.4%
(FPCore (A B C) :precision binary64 (* (/ (atan -1.0) (PI)) 180.0))
\begin{array}{l}
\\
\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 53.8%
Taylor expanded in B around inf
Applied rewrites21.3%
Final simplification21.3%
herbie shell --seed 2024332
(FPCore (A B C)
:name "ABCF->ab-angle angle"
:precision binary64
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) (PI))))