
(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 (if (<= A -2.85e+56) (/ (* (atan (* (/ B A) 0.5)) 180.0) (PI)) (/ (* (atan (/ (- (- C A) (hypot B (- A C))) B)) 180.0) (PI))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.85 \cdot 10^{+56}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -2.8500000000000001e56Initial program 20.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites54.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
if -2.8500000000000001e56 < A Initial program 58.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites81.7%
(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 5.0)
(/ (* (atan (fma (/ B C) -0.5 0.0)) 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 5:\\
\;\;\;\;\frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, 0\right)\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 #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 55.3%
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))) < 5Initial program 23.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites29.9%
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-lft59.8
Applied rewrites59.8%
if 5 < (*.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 57.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6477.1
Applied rewrites77.1%
Final simplification70.9%
(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 5.0)
(* 180.0 (/ (atan (* (/ B C) -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 5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \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 55.3%
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))) < 5Initial program 23.5%
Taylor expanded in C around inf
+-commutativeN/A
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-/l*N/A
div-addN/A
distribute-lft-outN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
distribute-frac-negN/A
Applied rewrites58.5%
Taylor expanded in A around 0
Applied rewrites59.8%
if 5 < (*.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 57.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6477.1
Applied rewrites77.1%
Final simplification70.9%
(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.1)
(/ (* (atan (fma (/ B C) -0.5 0.0)) 180.0) (PI))
(* 180.0 (/ (atan (* (pow B -1.0) (* (- t_1 -1.0) B))) (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.1:\\
\;\;\;\;\frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, 0\right)\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left({B}^{-1} \cdot \left(\left(t\_1 - -1\right) \cdot B\right)\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 55.3%
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 < (*.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.10000000000000001Initial program 23.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites29.9%
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-lft59.8
Applied rewrites59.8%
if 0.10000000000000001 < (*.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.2%
Taylor expanded in B around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
lower--.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6477.1
Applied rewrites77.1%
Final simplification70.9%
(FPCore (A B C)
:precision binary64
(if (<= A -2.85e+56)
(/ (* (atan (* (/ B A) 0.5)) 180.0) (PI))
(if (<= A 1.5e+100)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) (PI)))
(* 180.0 (/ (atan (- (/ (- C A) B) 1.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.85 \cdot 10^{+56}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 1.5 \cdot 10^{+100}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\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 < -2.8500000000000001e56Initial program 20.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites54.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
if -2.8500000000000001e56 < A < 1.49999999999999993e100Initial program 51.4%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.0
Applied rewrites73.0%
if 1.49999999999999993e100 < A Initial program 82.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6490.4
Applied rewrites90.4%
Final simplification77.7%
(FPCore (A B C)
:precision binary64
(if (<= A -8.4e+36)
(/ (* (atan (* (/ B A) 0.5)) 180.0) (PI))
(if (<= A 2e-225)
(* 180.0 (/ (atan (- (/ C B) 1.0)) (PI)))
(* 180.0 (/ (atan (- (/ (- C A) B) -1.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.4 \cdot 10^{+36}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2 \cdot 10^{-225}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - 1\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 < -8.40000000000000018e36Initial program 20.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites54.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
if -8.40000000000000018e36 < A < 1.9999999999999999e-225Initial program 41.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.4
Applied rewrites50.4%
Taylor expanded in A around 0
Applied rewrites50.7%
if 1.9999999999999999e-225 < A Initial program 70.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6470.6
Applied rewrites70.6%
Final simplification66.1%
(FPCore (A B C)
:precision binary64
(if (<= A -8.4e+36)
(/ (* (atan (* (/ B A) 0.5)) 180.0) (PI))
(if (<= A 4.2e+119)
(* 180.0 (/ (atan (- (/ C B) 1.0)) (PI)))
(/ (* (atan (/ (* -2.0 A) B)) 180.0) (PI)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.4 \cdot 10^{+36}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 4.2 \cdot 10^{+119}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-2 \cdot A}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -8.40000000000000018e36Initial program 20.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites54.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
if -8.40000000000000018e36 < A < 4.19999999999999966e119Initial program 51.1%
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 0
Applied rewrites50.6%
if 4.19999999999999966e119 < A Initial program 86.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites97.6%
Taylor expanded in A around inf
lower-*.f6485.8
Applied rewrites85.8%
Final simplification62.5%
(FPCore (A B C)
:precision binary64
(if (<= A -8.4e+36)
(/ (* (atan (* (/ B A) 0.5)) 180.0) (PI))
(if (<= A 4.2e+119)
(* 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 -8.4 \cdot 10^{+36}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 4.2 \cdot 10^{+119}:\\
\;\;\;\;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 < -8.40000000000000018e36Initial program 20.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites54.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
if -8.40000000000000018e36 < A < 4.19999999999999966e119Initial program 51.1%
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 0
Applied rewrites50.6%
if 4.19999999999999966e119 < A Initial program 86.6%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6485.8
Applied rewrites85.8%
Final simplification62.5%
(FPCore (A B C)
:precision binary64
(if (<= A -8.4e+36)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(if (<= A 4.2e+119)
(* 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 -8.4 \cdot 10^{+36}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 4.2 \cdot 10^{+119}:\\
\;\;\;\;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 < -8.40000000000000018e36Initial program 20.1%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
if -8.40000000000000018e36 < A < 4.19999999999999966e119Initial program 51.1%
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 0
Applied rewrites50.6%
if 4.19999999999999966e119 < A Initial program 86.6%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6485.8
Applied rewrites85.8%
Final simplification62.5%
(FPCore (A B C)
:precision binary64
(if (<= A -2.9e+56)
(* 180.0 (/ (atan 0.0) (PI)))
(if (<= A 4.2e+119)
(* 180.0 (/ (atan (- (/ C B) 1.0)) (PI)))
(* 180.0 (/ (atan (/ (- A) B)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.9 \cdot 10^{+56}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 4.2 \cdot 10^{+119}:\\
\;\;\;\;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}\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -2.90000000000000007e56Initial program 20.1%
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.8
Applied rewrites39.8%
if -2.90000000000000007e56 < A < 4.19999999999999966e119Initial program 51.1%
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 0
Applied rewrites50.6%
if 4.19999999999999966e119 < A Initial program 86.6%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6489.4
Applied rewrites89.4%
Taylor expanded in A around inf
Applied rewrites85.7%
Final simplification53.8%
(FPCore (A B C)
:precision binary64
(if (<= B -9e+87)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 7.2e+44)
(* 180.0 (/ (atan (/ C B)) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -9 \cdot 10^{+87}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 7.2 \cdot 10^{+44}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -9.0000000000000005e87Initial program 35.7%
Taylor expanded in B around -inf
Applied rewrites77.3%
if -9.0000000000000005e87 < B < 7.2e44Initial program 57.4%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.1
Applied rewrites50.1%
Taylor expanded in C around inf
Applied rewrites34.6%
if 7.2e44 < B Initial program 39.0%
Taylor expanded in B around inf
Applied rewrites59.7%
Final simplification45.9%
(FPCore (A B C) :precision binary64 (if (<= C 2e-309) (* 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 2 \cdot 10^{-309}:\\
\;\;\;\;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.9999999999999988e-309Initial program 71.2%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6474.2
Applied rewrites74.2%
Taylor expanded in A around 0
Applied rewrites65.9%
if 1.9999999999999988e-309 < C Initial program 32.0%
Taylor expanded in C around inf
+-commutativeN/A
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-/l*N/A
div-addN/A
distribute-lft-outN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
distribute-frac-negN/A
Applied rewrites55.6%
Taylor expanded in A around 0
Applied rewrites53.0%
Final simplification59.0%
(FPCore (A B C) :precision binary64 (if (<= B -6.2e-307) (* 180.0 (/ (atan 1.0) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -6.2 \cdot 10^{-307}:\\
\;\;\;\;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 < -6.1999999999999996e-307Initial program 52.2%
Taylor expanded in B around -inf
Applied rewrites33.9%
if -6.1999999999999996e-307 < B Initial program 48.8%
Taylor expanded in B around inf
Applied rewrites34.1%
Final simplification34.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 50.2%
Taylor expanded in B around inf
Applied rewrites20.8%
Final simplification20.8%
herbie shell --seed 2024354
(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))))