
(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 14 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 (PI) 0.25)))
(if (<= A -5.8e+134)
(* (/ (/ 180.0 (sqrt (PI))) t_0) (/ (atan (* (/ B A) 0.5)) t_0))
(* (atan (/ (- (- C A) (hypot (- A C) B)) B)) (/ 180.0 (PI))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\mathsf{PI}\left(\right)}^{0.25}\\
\mathbf{if}\;A \leq -5.8 \cdot 10^{+134}:\\
\;\;\;\;\frac{\frac{180}{\sqrt{\mathsf{PI}\left(\right)}}}{t\_0} \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
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
lift-/.f64N/A
associate-*r/N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites82.1%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
sqr-powN/A
Applied rewrites82.6%
if -5.80000000000000023e134 < A Initial program 64.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6464.0
Applied rewrites85.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(*
(pow B -1.0)
(- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(PI))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -40.0)
(* 180.0 (/ (atan (- t_1 1.0)) (PI)))
(if (<= t_0 0.0)
(* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
(* 180.0 (/ (atan (+ t_1 1.0)) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -40:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -40Initial 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 -40 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -0.0Initial program 18.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6418.0
Applied rewrites24.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6424.8
Applied rewrites24.8%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6451.2
Applied rewrites51.2%
if -0.0 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) 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 -3.4e-11)
(* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
(if (<= A 2.16e-44)
(*
180.0
(/ (atan (* (pow B -1.0) (- (- C A) (sqrt (fma B B (* C C)))))) (PI)))
(* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2.16 \cdot 10^{-44}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -3.3999999999999999e-11Initial program 18.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6418.9
Applied rewrites53.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6453.6
Applied rewrites53.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.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
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.9
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
(let* ((t_0 (/ 180.0 (PI))))
(if (<= A -5.2e+131)
(* (atan (* (/ B A) 0.5)) t_0)
(if (<= A 2.4e+42)
(* (atan (/ (- C (hypot B C)) B)) t_0)
(/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;A \leq -5.2 \cdot 10^{+131}:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot t\_0\\
\mathbf{elif}\;A \leq 2.4 \cdot 10^{+42}:\\
\;\;\;\;\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -5.2e131Initial program 7.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f647.6
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6449.4
Applied rewrites49.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.6
Applied rewrites82.6%
if -5.2e131 < A < 2.3999999999999999e42Initial program 57.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.1
Applied rewrites80.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6480.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%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites98.2%
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)
(* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
(if (<= A 2.4e+42)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) (PI)))
(/ (* (atan (+ (/ (- C A) B) 1.0)) 180.0) (PI)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.2 \cdot 10^{+131}:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2.4 \cdot 10^{+42}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -5.2e131Initial program 7.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f647.6
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6449.4
Applied rewrites49.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.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
unpow2N/A
unpow2N/A
lower-hypot.f6478.2
Applied rewrites78.2%
if 2.3999999999999999e42 < A Initial program 83.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites98.2%
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.8e+134)
(* (atan (* (/ B A) 0.5)) t_0)
(* (atan (/ (- (- C A) (hypot (- A C) B)) B)) t_0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;A \leq -5.8 \cdot 10^{+134}:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right) \cdot t\_0\\
\end{array}
\end{array}
if A < -5.80000000000000023e134Initial program 7.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f647.6
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6449.4
Applied rewrites49.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.6
Applied rewrites82.6%
if -5.80000000000000023e134 < A Initial program 64.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6464.0
Applied rewrites85.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Final simplification84.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) (PI)))))
(if (<= A -4.8e-26)
(* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
(if (<= A -8.5e-112)
t_0
(if (<= A 2.6e-281)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= A 3.6e-112)
t_0
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;A \leq -4.8 \cdot 10^{-26}:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq -8.5 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq 2.6 \cdot 10^{-281}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 3.6 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -4.8000000000000002e-26Initial program 22.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
Applied rewrites55.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6455.5
Applied rewrites55.5%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6471.4
Applied rewrites71.4%
if -4.8000000000000002e-26 < A < -8.49999999999999992e-112 or 2.60000000000000005e-281 < A < 3.6000000000000001e-112Initial program 60.3%
Taylor expanded in B around inf
Applied rewrites44.0%
if -8.49999999999999992e-112 < A < 2.60000000000000005e-281Initial program 50.2%
Taylor expanded in B around -inf
Applied rewrites41.5%
if 3.6000000000000001e-112 < A Initial program 81.7%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6465.6
Applied rewrites65.6%
Final simplification57.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) (PI)))))
(if (<= A -4.8e-26)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(if (<= A -8.5e-112)
t_0
(if (<= A 2.6e-281)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= A 3.6e-112)
t_0
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;A \leq -4.8 \cdot 10^{-26}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq -8.5 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq 2.6 \cdot 10^{-281}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 3.6 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -4.8000000000000002e-26Initial program 22.3%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
if -4.8000000000000002e-26 < A < -8.49999999999999992e-112 or 2.60000000000000005e-281 < A < 3.6000000000000001e-112Initial program 60.3%
Taylor expanded in B around inf
Applied rewrites44.0%
if -8.49999999999999992e-112 < A < 2.60000000000000005e-281Initial program 50.2%
Taylor expanded in B around -inf
Applied rewrites41.5%
if 3.6000000000000001e-112 < A Initial program 81.7%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6465.6
Applied rewrites65.6%
(FPCore (A B C)
:precision binary64
(if (<= B -2.5e-27)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B -4.2e-248)
(* 180.0 (/ (atan (* B (/ -0.5 C))) (PI)))
(if (<= B 1.5e-228)
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
(if (<= B 1.5e-46)
(* 180.0 (/ (atan 0.0) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.5 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq -4.2 \cdot 10^{-248}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.5 \cdot 10^{-228}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -2.5000000000000001e-27Initial program 54.3%
Taylor expanded in B around -inf
Applied rewrites60.8%
if -2.5000000000000001e-27 < B < -4.2e-248Initial program 42.1%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
distribute-frac-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt1-inN/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lft42.9
Applied rewrites42.9%
Applied rewrites42.8%
if -4.2e-248 < B < 1.5e-228Initial program 66.2%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6450.2
Applied rewrites50.2%
if 1.5e-228 < B < 1.49999999999999994e-46Initial program 46.7%
Taylor expanded in C around inf
mul-1-negN/A
distribute-frac-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt1-inN/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lft39.2
Applied rewrites39.2%
if 1.49999999999999994e-46 < B Initial program 56.7%
Taylor expanded in B around inf
Applied rewrites58.3%
Final simplification52.7%
(FPCore (A B C)
:precision binary64
(if (<= A -4.8e-26)
(* (atan (* (/ B A) 0.5)) (/ 180.0 (PI)))
(if (<= A -5.3e-111)
(* 180.0 (/ (atan -1.0) (PI)))
(* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.8 \cdot 10^{-26}:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq -5.3 \cdot 10^{-111}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -4.8000000000000002e-26Initial program 22.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
Applied rewrites55.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lower-/.f6455.5
Applied rewrites55.5%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6471.4
Applied rewrites71.4%
if -4.8000000000000002e-26 < A < -5.2999999999999997e-111Initial program 47.3%
Taylor expanded in B around inf
Applied rewrites52.4%
if -5.2999999999999997e-111 < A Initial program 68.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6467.3
Applied rewrites67.3%
Final simplification67.2%
(FPCore (A B C)
:precision binary64
(if (<= B -2.5e-27)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B -9e-202)
(* 180.0 (/ (atan (* B (/ -0.5 C))) (PI)))
(if (<= B 1.5e-46)
(* 180.0 (/ (atan 0.0) (PI)))
(* 180.0 (/ (atan -1.0) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.5 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq -9 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -2.5000000000000001e-27Initial program 54.3%
Taylor expanded in B around -inf
Applied rewrites60.8%
if -2.5000000000000001e-27 < B < -9.00000000000000078e-202Initial program 43.4%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
distribute-frac-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt1-inN/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lft45.2
Applied rewrites45.2%
Applied rewrites45.1%
if -9.00000000000000078e-202 < B < 1.49999999999999994e-46Initial program 54.4%
Taylor expanded in C around inf
mul-1-negN/A
distribute-frac-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt1-inN/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lft35.9
Applied rewrites35.9%
if 1.49999999999999994e-46 < B Initial program 56.7%
Taylor expanded in B around inf
Applied rewrites58.3%
Final simplification50.1%
(FPCore (A B C)
:precision binary64
(if (<= B -2.8e-111)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 1.5e-46)
(* 180.0 (/ (atan 0.0) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.8 \cdot 10^{-111}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.5 \cdot 10^{-46}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -2.79999999999999995e-111Initial program 51.5%
Taylor expanded in B around -inf
Applied rewrites56.2%
if -2.79999999999999995e-111 < B < 1.49999999999999994e-46Initial program 53.4%
Taylor expanded in C around inf
mul-1-negN/A
distribute-frac-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt1-inN/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lft34.0
Applied rewrites34.0%
if 1.49999999999999994e-46 < 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 -4e-310) (* 180.0 (/ (atan 1.0) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4 \cdot 10^{-310}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -3.999999999999988e-310Initial program 51.2%
Taylor expanded in B around -inf
Applied rewrites41.2%
if -3.999999999999988e-310 < B Initial program 56.2%
Taylor expanded in B around inf
Applied rewrites39.0%
(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 53.8%
Taylor expanded in B around inf
Applied rewrites21.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))))