
(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 (* 0.005555555555555556 (PI))))
(if (<= A -6.6e+75)
(/ (atan (* (/ (fma (/ C A) B B) A) 0.5)) t_0)
(/ (atan (/ (- (- C A) (hypot B (- A C))) B)) t_0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;A \leq -6.6 \cdot 10^{+75}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{t\_0}\\
\end{array}
\end{array}
if A < -6.59999999999999996e75Initial program 21.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-/.f6421.6
lift-*.f64N/A
*-commutativeN/A
Applied rewrites51.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval51.6
Applied rewrites51.6%
Taylor expanded in A around -inf
mul-1-negN/A
distribute-lft-outN/A
associate-/l*N/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6479.9
Applied rewrites79.9%
if -6.59999999999999996e75 < A Initial program 59.7%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6459.7
lift-*.f64N/A
*-commutativeN/A
Applied rewrites83.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval83.1
Applied rewrites83.1%
Final simplification82.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ -1.0 B) (- (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))) (- C A))))
(t_1 (/ (- C A) B))
(t_2 (/ 180.0 (PI))))
(if (<= t_0 -0.5)
(* (atan (- t_1 1.0)) t_2)
(if (<= t_0 0.0)
(* (atan (* (/ B A) 0.5)) t_2)
(* (atan (/ (* (- t_1 -1.0) B) B)) t_2)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} - \left(C - A\right)\right)\\
t_1 := \frac{C - A}{B}\\
t_2 := \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\tan^{-1} \left(t\_1 - 1\right) \cdot t\_2\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(t\_1 - -1\right) \cdot B}{B}\right) \cdot t\_2\\
\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.5Initial 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 rewrites85.5%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
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.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-/.f6415.3
lift-*.f64N/A
*-commutativeN/A
Applied rewrites15.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.7
Applied rewrites62.7%
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)))))) Initial 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 rewrites87.7%
Taylor expanded in B around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
mul-1-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6476.8
Applied rewrites76.8%
Final simplification74.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ -1.0 B) (- (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))) (- C A))))
(t_1 (/ (- C A) B))
(t_2 (/ 180.0 (PI))))
(if (<= t_0 -0.5)
(* (atan (- t_1 1.0)) t_2)
(if (<= t_0 0.0)
(* (atan (* (/ B A) 0.5)) t_2)
(* (atan (+ t_1 1.0)) t_2)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} - \left(C - A\right)\right)\\
t_1 := \frac{C - A}{B}\\
t_2 := \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\tan^{-1} \left(t\_1 - 1\right) \cdot t\_2\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(t\_1 + 1\right) \cdot t\_2\\
\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.5Initial 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 rewrites85.5%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
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.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-/.f6415.3
lift-*.f64N/A
*-commutativeN/A
Applied rewrites15.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.7
Applied rewrites62.7%
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)))))) Initial 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 rewrites87.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6476.8
Applied rewrites76.8%
Final simplification74.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ 180.0 (PI)))
(t_1
(* (/ -1.0 B) (- (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))) (- C A))))
(t_2 (/ (- C A) B)))
(if (<= t_1 -0.5)
(* (/ (atan (- t_2 1.0)) (PI)) 180.0)
(if (<= t_1 0.0)
(* (atan (* (/ B A) 0.5)) t_0)
(* (atan (+ t_2 1.0)) t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
t_1 := \frac{-1}{B} \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} - \left(C - A\right)\right)\\
t_2 := \frac{C - A}{B}\\
\mathbf{if}\;t\_1 \leq -0.5:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_2 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(t\_2 + 1\right) \cdot t\_0\\
\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.5Initial program 57.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
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.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-/.f6415.3
lift-*.f64N/A
*-commutativeN/A
Applied rewrites15.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.7
Applied rewrites62.7%
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)))))) Initial 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 rewrites87.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6476.8
Applied rewrites76.8%
Final simplification74.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ -1.0 B) (- (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))) (- C A))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* (/ (atan (- t_1 1.0)) (PI)) 180.0)
(if (<= t_0 0.0)
(* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
(* (/ (atan (+ t_1 1.0)) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} - \left(C - A\right)\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:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\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.5Initial program 57.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
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.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-/.f6415.3
lift-*.f64N/A
*-commutativeN/A
Applied rewrites15.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.7
Applied rewrites62.7%
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)))))) Initial program 57.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
Final simplification74.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (PI))))
(if (<= A -8e+55)
(/ (atan (* (/ (fma (/ C A) B B) A) 0.5)) t_0)
(if (<= A 4.8e+78)
(/ (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 := 0.005555555555555556 \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;A \leq -8 \cdot 10^{+55}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right)}{t\_0}\\
\mathbf{elif}\;A \leq 4.8 \cdot 10^{+78}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{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 < -8.00000000000000008e55Initial program 22.7%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6422.7
lift-*.f64N/A
*-commutativeN/A
Applied rewrites51.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval51.2
Applied rewrites51.2%
Taylor expanded in A around -inf
mul-1-negN/A
distribute-lft-outN/A
associate-/l*N/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.4
Applied rewrites76.4%
if -8.00000000000000008e55 < A < 4.7999999999999997e78Initial program 52.9%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6452.9
lift-*.f64N/A
*-commutativeN/A
Applied rewrites81.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval81.0
Applied rewrites81.0%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.2
Applied rewrites79.2%
if 4.7999999999999997e78 < A Initial program 80.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6482.2
Applied rewrites82.2%
Final simplification79.1%
(FPCore (A B C)
:precision binary64
(if (<= A -8e+55)
(/ (atan (* (/ (fma (/ C A) B B) A) 0.5)) (* 0.005555555555555556 (PI)))
(if (<= A 4.8e+78)
(* (atan (/ (- C (hypot B C)) B)) (/ 180.0 (PI)))
(* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8 \cdot 10^{+55}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 4.8 \cdot 10^{+78}:\\
\;\;\;\;\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -8.00000000000000008e55Initial program 22.7%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6422.7
lift-*.f64N/A
*-commutativeN/A
Applied rewrites51.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval51.2
Applied rewrites51.2%
Taylor expanded in A around -inf
mul-1-negN/A
distribute-lft-outN/A
associate-/l*N/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.4
Applied rewrites76.4%
if -8.00000000000000008e55 < A < 4.7999999999999997e78Initial program 52.9%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6452.9
lift-*.f64N/A
*-commutativeN/A
Applied rewrites81.0%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.2
Applied rewrites79.2%
if 4.7999999999999997e78 < A Initial program 80.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6482.2
Applied rewrites82.2%
Final simplification79.1%
(FPCore (A B C)
:precision binary64
(if (<= A -8e+55)
(/ (atan (* (/ (fma (/ C A) B B) A) 0.5)) (* 0.005555555555555556 (PI)))
(if (<= A 4.8e+78)
(* (/ (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 -8 \cdot 10^{+55}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 4.8 \cdot 10^{+78}:\\
\;\;\;\;\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 < -8.00000000000000008e55Initial program 22.7%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6422.7
lift-*.f64N/A
*-commutativeN/A
Applied rewrites51.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval51.2
Applied rewrites51.2%
Taylor expanded in A around -inf
mul-1-negN/A
distribute-lft-outN/A
associate-/l*N/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.4
Applied rewrites76.4%
if -8.00000000000000008e55 < A < 4.7999999999999997e78Initial program 52.9%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.2
Applied rewrites79.2%
if 4.7999999999999997e78 < A Initial program 80.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6482.2
Applied rewrites82.2%
Final simplification79.1%
(FPCore (A B C) :precision binary64 (if (<= A -6.6e+75) (/ (atan (* (/ (fma (/ C A) B B) A) 0.5)) (* 0.005555555555555556 (PI))) (* (atan (/ (- (- C A) (hypot (- A C) B)) B)) (/ 180.0 (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.6 \cdot 10^{+75}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A} \cdot 0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -6.59999999999999996e75Initial program 21.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-/.f6421.6
lift-*.f64N/A
*-commutativeN/A
Applied rewrites51.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval51.6
Applied rewrites51.6%
Taylor expanded in A around -inf
mul-1-negN/A
distribute-lft-outN/A
associate-/l*N/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6479.9
Applied rewrites79.9%
if -6.59999999999999996e75 < A Initial program 59.7%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6459.7
lift-*.f64N/A
*-commutativeN/A
Applied rewrites83.1%
Final simplification82.4%
(FPCore (A B C)
:precision binary64
(if (<= B -1.7e+40)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 1.05e+125)
(* (atan (/ (- C A) B)) (/ 180.0 (PI)))
(* (/ (atan -1.0) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.7 \cdot 10^{+40}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 1.05 \cdot 10^{+125}:\\
\;\;\;\;\tan^{-1} \left(\frac{C - A}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -1.69999999999999994e40Initial program 39.8%
Taylor expanded in B around -inf
Applied rewrites67.2%
if -1.69999999999999994e40 < B < 1.05e125Initial program 58.9%
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.9
lift-*.f64N/A
*-commutativeN/A
Applied rewrites71.0%
Taylor expanded in B around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
mul-1-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6450.7
Applied rewrites50.7%
Taylor expanded in B around 0
Applied rewrites49.0%
if 1.05e125 < B Initial program 36.7%
Taylor expanded in B around inf
Applied rewrites75.8%
Final simplification57.5%
(FPCore (A B C)
:precision binary64
(if (<= B -3.9e-106)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 6.8e+65)
(* (atan (/ (- A) B)) (/ 180.0 (PI)))
(* (/ (atan -1.0) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.9 \cdot 10^{-106}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 6.8 \cdot 10^{+65}:\\
\;\;\;\;\tan^{-1} \left(\frac{-A}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -3.9000000000000001e-106Initial program 42.2%
Taylor expanded in B around -inf
Applied rewrites49.6%
if -3.9000000000000001e-106 < B < 6.7999999999999999e65Initial program 62.7%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
times-fracN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-/.f6462.7
lift-*.f64N/A
*-commutativeN/A
Applied rewrites76.6%
Taylor expanded in B around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
mul-1-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6454.6
Applied rewrites54.6%
Taylor expanded in A around inf
Applied rewrites38.6%
if 6.7999999999999999e65 < B Initial program 40.7%
Taylor expanded in B around inf
Applied rewrites63.6%
Final simplification48.0%
(FPCore (A B C) :precision binary64 (if (<= A -1.05e-108) (/ (atan (* (/ B A) 0.5)) (* 0.005555555555555556 (PI))) (* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.05 \cdot 10^{-108}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\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 < -1.05e-108Initial program 24.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-/.f6424.1
lift-*.f64N/A
*-commutativeN/A
Applied rewrites53.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-hypot.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval53.8
Applied rewrites53.8%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.9
Applied rewrites63.9%
if -1.05e-108 < A Initial program 66.0%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6465.0
Applied rewrites65.0%
Final simplification64.6%
(FPCore (A B C)
:precision binary64
(if (<= B -2.25e-59)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 1.35e-61)
(* (/ (atan 0.0) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.25 \cdot 10^{-59}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 1.35 \cdot 10^{-61}:\\
\;\;\;\;\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 < -2.25000000000000006e-59Initial program 44.1%
Taylor expanded in B around -inf
Applied rewrites53.3%
if -2.25000000000000006e-59 < B < 1.34999999999999997e-61Initial program 58.4%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval27.0
Applied rewrites27.0%
if 1.34999999999999997e-61 < B Initial program 49.0%
Taylor expanded in B around inf
Applied rewrites51.9%
Final simplification43.1%
(FPCore (A B C) :precision binary64 (if (<= B 1.35e-61) (* (/ (atan 0.0) (PI)) 180.0) (* (/ (atan -1.0) (PI)) 180.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.35 \cdot 10^{-61}:\\
\;\;\;\;\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 < 1.34999999999999997e-61Initial program 52.2%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval16.9
Applied rewrites16.9%
if 1.34999999999999997e-61 < B Initial program 49.0%
Taylor expanded in B around inf
Applied rewrites51.9%
Final simplification29.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 51.1%
Taylor expanded in B around inf
Applied rewrites21.7%
Final simplification21.7%
herbie shell --seed 2024276
(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))))