
(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 12 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
(/
(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 40.0)
(* 180.0 (/ (atan (* (/ B (- C A)) -0.5)) (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 40:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right)}{\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 64.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.4
Applied rewrites78.4%
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))) < 40Initial program 20.4%
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
sqr-abs-revN/A
pow2N/A
lift--.f64N/A
fabs-subN/A
lift--.f64N/A
pow2N/A
sqr-abs-revN/A
lower-fma.f6420.4
lift-pow.f64N/A
unpow2N/A
lower-*.f6420.4
Applied rewrites20.4%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6494.5
Applied rewrites94.5%
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))) Initial program 55.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6466.6
Applied rewrites66.6%
Final simplification75.8%
(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))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* 180.0 (/ (atan (- t_1 1.0)) (PI)))
(if (<= t_0 0.5)
(/ (* (atan (* -0.5 (/ B C))) 180.0) (PI))
(* 180.0 (/ (atan (+ t_1 1.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)\\
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.5:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 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 (/.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 64.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.4
Applied rewrites78.4%
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.5Initial program 20.4%
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
sqr-abs-revN/A
pow2N/A
lift--.f64N/A
fabs-subN/A
lift--.f64N/A
pow2N/A
sqr-abs-revN/A
lower-fma.f6420.4
lift-pow.f64N/A
unpow2N/A
lower-*.f6420.4
Applied rewrites20.4%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6494.5
Applied rewrites94.5%
Taylor expanded in A around 0
Applied rewrites50.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites50.3%
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)))))) Initial program 55.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6466.6
Applied rewrites66.6%
Final simplification69.8%
(FPCore (A B C)
:precision binary64
(if (<= A -6.2e-96)
(* (/ 180.0 (PI)) (atan (* (/ B A) 0.5)))
(if (<= A -3.5e-243)
(/ (* (atan (* -0.5 (/ B C))) 180.0) (PI))
(if (<= A 2.8e-142)
(* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI)))
(* 180.0 (/ (atan (+ (/ (- A) B) 1.0)) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.2 \cdot 10^{-96}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq -3.5 \cdot 10^{-243}:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2.8 \cdot 10^{-142}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -6.1999999999999998e-96Initial program 27.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.1
Applied rewrites66.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites66.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
if -6.1999999999999998e-96 < A < -3.49999999999999979e-243Initial program 43.8%
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
sqr-abs-revN/A
pow2N/A
lift--.f64N/A
fabs-subN/A
lift--.f64N/A
pow2N/A
sqr-abs-revN/A
lower-fma.f6443.8
lift-pow.f64N/A
unpow2N/A
lower-*.f6443.8
Applied rewrites43.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.8
Applied rewrites57.8%
Taylor expanded in A around 0
Applied rewrites50.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites50.2%
if -3.49999999999999979e-243 < A < 2.80000000000000004e-142Initial program 78.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6453.9
Applied rewrites53.9%
Taylor expanded in A around 0
Applied rewrites53.9%
if 2.80000000000000004e-142 < A Initial program 70.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6475.8
Applied rewrites75.8%
Taylor expanded in A around inf
Applied rewrites74.1%
Final simplification65.2%
(FPCore (A B C)
:precision binary64
(if (<= A -6.2e-96)
(* (/ 180.0 (PI)) (atan (* (/ B A) 0.5)))
(if (<= A -3.5e-243)
(* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
(if (<= A 2.8e-142)
(* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI)))
(* 180.0 (/ (atan (+ (/ (- A) B) 1.0)) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.2 \cdot 10^{-96}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq -3.5 \cdot 10^{-243}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2.8 \cdot 10^{-142}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -6.1999999999999998e-96Initial program 27.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.1
Applied rewrites66.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites66.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
if -6.1999999999999998e-96 < A < -3.49999999999999979e-243Initial program 43.8%
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
sqr-abs-revN/A
pow2N/A
lift--.f64N/A
fabs-subN/A
lift--.f64N/A
pow2N/A
sqr-abs-revN/A
lower-fma.f6443.8
lift-pow.f64N/A
unpow2N/A
lower-*.f6443.8
Applied rewrites43.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.8
Applied rewrites57.8%
Taylor expanded in A around 0
Applied rewrites50.1%
if -3.49999999999999979e-243 < A < 2.80000000000000004e-142Initial program 78.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6453.9
Applied rewrites53.9%
Taylor expanded in A around 0
Applied rewrites53.9%
if 2.80000000000000004e-142 < A Initial program 70.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6475.8
Applied rewrites75.8%
Taylor expanded in A around inf
Applied rewrites74.1%
Final simplification65.2%
(FPCore (A B C)
:precision binary64
(if (<= A -6.2e-96)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(if (<= A -3.5e-243)
(* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
(if (<= A 2.8e-142)
(* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI)))
(* 180.0 (/ (atan (+ (/ (- A) B) 1.0)) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.2 \cdot 10^{-96}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq -3.5 \cdot 10^{-243}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2.8 \cdot 10^{-142}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -6.1999999999999998e-96Initial program 27.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.1
Applied rewrites66.1%
if -6.1999999999999998e-96 < A < -3.49999999999999979e-243Initial program 43.8%
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
sqr-abs-revN/A
pow2N/A
lift--.f64N/A
fabs-subN/A
lift--.f64N/A
pow2N/A
sqr-abs-revN/A
lower-fma.f6443.8
lift-pow.f64N/A
unpow2N/A
lower-*.f6443.8
Applied rewrites43.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.8
Applied rewrites57.8%
Taylor expanded in A around 0
Applied rewrites50.1%
if -3.49999999999999979e-243 < A < 2.80000000000000004e-142Initial program 78.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6453.9
Applied rewrites53.9%
Taylor expanded in A around 0
Applied rewrites53.9%
if 2.80000000000000004e-142 < A Initial program 70.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6475.8
Applied rewrites75.8%
Taylor expanded in A around inf
Applied rewrites74.1%
Final simplification65.1%
(FPCore (A B C)
:precision binary64
(if (<= A -6.2e-96)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(if (<= A -3.5e-243)
(* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
(if (<= A 3.5e-37)
(* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI)))
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.2 \cdot 10^{-96}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq -3.5 \cdot 10^{-243}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 3.5 \cdot 10^{-37}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -6.1999999999999998e-96Initial program 27.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.1
Applied rewrites66.1%
if -6.1999999999999998e-96 < A < -3.49999999999999979e-243Initial program 43.8%
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
sqr-abs-revN/A
pow2N/A
lift--.f64N/A
fabs-subN/A
lift--.f64N/A
pow2N/A
sqr-abs-revN/A
lower-fma.f6443.8
lift-pow.f64N/A
unpow2N/A
lower-*.f6443.8
Applied rewrites43.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.8
Applied rewrites57.8%
Taylor expanded in A around 0
Applied rewrites50.1%
if -3.49999999999999979e-243 < A < 3.5000000000000001e-37Initial program 70.0%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6454.5
Applied rewrites54.5%
Taylor expanded in A around 0
Applied rewrites53.1%
if 3.5000000000000001e-37 < A Initial program 77.0%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6471.5
Applied rewrites71.5%
Final simplification62.6%
(FPCore (A B C)
:precision binary64
(if (<= A -6.2e-96)
(* (/ 180.0 (PI)) (atan (* (/ B A) 0.5)))
(if (<= A -3.5e-243)
(/ (* (atan (* -0.5 (/ B C))) 180.0) (PI))
(* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.2 \cdot 10^{-96}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)\\
\mathbf{elif}\;A \leq -3.5 \cdot 10^{-243}:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot 180}{\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 < -6.1999999999999998e-96Initial program 27.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.1
Applied rewrites66.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites66.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
if -6.1999999999999998e-96 < A < -3.49999999999999979e-243Initial program 43.8%
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
sqr-abs-revN/A
pow2N/A
lift--.f64N/A
fabs-subN/A
lift--.f64N/A
pow2N/A
sqr-abs-revN/A
lower-fma.f6443.8
lift-pow.f64N/A
unpow2N/A
lower-*.f6443.8
Applied rewrites43.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.8
Applied rewrites57.8%
Taylor expanded in A around 0
Applied rewrites50.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites50.2%
if -3.49999999999999979e-243 < A Initial program 73.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6468.0
Applied rewrites68.0%
Final simplification65.8%
(FPCore (A B C) :precision binary64 (if (<= C 1.65e-136) (* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI))) (* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.65 \cdot 10^{-136}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if C < 1.65000000000000009e-136Initial program 65.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6460.8
Applied rewrites60.8%
Taylor expanded in A around 0
Applied rewrites49.7%
if 1.65000000000000009e-136 < C Initial program 36.4%
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
sqr-abs-revN/A
pow2N/A
lift--.f64N/A
fabs-subN/A
lift--.f64N/A
pow2N/A
sqr-abs-revN/A
lower-fma.f6436.4
lift-pow.f64N/A
unpow2N/A
lower-*.f6436.4
Applied rewrites36.4%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6466.6
Applied rewrites66.6%
Taylor expanded in A around 0
Applied rewrites60.7%
Final simplification53.6%
(FPCore (A B C) :precision binary64 (if (<= B 1.6e-23) (* 180.0 (/ (atan (+ (/ C B) 1.0)) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.6 \cdot 10^{-23}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{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 < 1.59999999999999988e-23Initial program 56.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6459.0
Applied rewrites59.0%
Taylor expanded in A around 0
Applied rewrites45.3%
if 1.59999999999999988e-23 < B Initial program 50.7%
Taylor expanded in B around inf
Applied rewrites57.7%
(FPCore (A B C)
:precision binary64
(if (<= B -2.9e-70)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 7.4e-209)
(/ (* (atan 0.0) 180.0) (PI))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.9 \cdot 10^{-70}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 7.4 \cdot 10^{-209}:\\
\;\;\;\;\frac{\tan^{-1} 0 \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -2.89999999999999971e-70Initial program 54.9%
Taylor expanded in B around -inf
Applied rewrites48.0%
if -2.89999999999999971e-70 < B < 7.3999999999999995e-209Initial program 52.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-lft38.3
Applied rewrites38.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites38.3%
if 7.3999999999999995e-209 < B Initial program 56.5%
Taylor expanded in B around inf
Applied rewrites44.7%
Final simplification43.5%
(FPCore (A B C) :precision binary64 (if (<= B -5e-311) (* 180.0 (/ (atan 1.0) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5 \cdot 10^{-311}:\\
\;\;\;\;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 < -5.00000000000023e-311Initial program 49.6%
Taylor expanded in B around -inf
Applied rewrites32.0%
if -5.00000000000023e-311 < B Initial program 59.8%
Taylor expanded in B around inf
Applied rewrites38.8%
(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 54.9%
Taylor expanded in B around inf
Applied rewrites21.1%
herbie shell --seed 2024340
(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))))