
(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 13 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 (<= C 1.65e+114) (/ (* 180.0 (atan (* (- (- C A) (hypot (- A C) B)) (pow 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^{+114}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)\right) \cdot {B}^{-1}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if C < 1.65e114Initial program 59.5%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites84.1%
if 1.65e114 < C Initial program 20.2%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6486.8
Applied rewrites86.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites86.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6486.9
Applied rewrites86.9%
Final simplification84.7%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(PI)))))
(if (<= t_0 -0.04)
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) B))) (PI)))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
(/ (* 180.0 (atan (+ 1.0 (/ (- C A) B)))) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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)}\\
\mathbf{if}\;t\_0 \leq -0.04:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - B\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C - A}{B}\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))) < -0.0400000000000000008Initial program 61.3%
Taylor expanded in B around inf
Applied rewrites76.4%
if -0.0400000000000000008 < (*.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 22.7%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6475.3
Applied rewrites75.3%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6475.3
Applied rewrites75.3%
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 53.0%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites87.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6471.7
Applied rewrites71.7%
Final simplification74.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(PI)))))
(if (<= t_0 -0.04)
(* 180.0 (/ (atan (- (/ C B) 1.0)) (PI)))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
(* 180.0 (/ (atan (+ 1.0 (/ C B))) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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)}\\
\mathbf{if}\;t\_0 \leq -0.04:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;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(1 + \frac{C}{B}\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))) < -0.0400000000000000008Initial program 61.3%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.1
Applied rewrites69.1%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f6460.4
Applied rewrites60.4%
if -0.0400000000000000008 < (*.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 22.7%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6475.3
Applied rewrites75.3%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6475.3
Applied rewrites75.3%
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 53.0%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.7
Applied rewrites66.7%
Taylor expanded in B around -inf
lower-+.f64N/A
lower-/.f6457.8
Applied rewrites57.8%
Final simplification61.6%
(FPCore (A B C)
:precision binary64
(if (<= C -1.35e-98)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) (PI)))
(if (<= C 1.65e+114)
(* 180.0 (/ (atan (/ (+ (hypot A B) A) (- B))) (PI)))
(/ (* 180.0 (atan (* (/ B C) -0.5))) (PI)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.35 \cdot 10^{-98}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;C \leq 1.65 \cdot 10^{+114}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(A, B\right) + A}{-B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if C < -1.3499999999999999e-98Initial program 71.3%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6485.2
Applied rewrites85.2%
if -1.3499999999999999e-98 < C < 1.65e114Initial program 53.4%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.7
Applied rewrites79.7%
if 1.65e114 < C Initial program 20.2%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6486.8
Applied rewrites86.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites86.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6486.9
Applied rewrites86.9%
Final simplification82.6%
(FPCore (A B C)
:precision binary64
(if (<= A -8.2e+153)
(/ (* 180.0 (atan (* (/ B A) 0.5))) (PI))
(if (<= A 3.1e+48)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) (PI)))
(/ (* 180.0 (atan (+ 1.0 (/ (- C A) B)))) (PI)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.2 \cdot 10^{+153}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 3.1 \cdot 10^{+48}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -8.20000000000000033e153Initial program 5.2%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites52.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.9
Applied rewrites91.9%
if -8.20000000000000033e153 < A < 3.10000000000000005e48Initial program 51.5%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.8
Applied rewrites72.8%
if 3.10000000000000005e48 < A Initial program 77.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites95.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6481.6
Applied rewrites81.6%
Final simplification77.3%
(FPCore (A B C)
:precision binary64
(if (<= C -5.2e-66)
(* 180.0 (/ (atan (- (/ C B) 1.0)) (PI)))
(if (<= C 1.1e-10)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) (PI)))
(/ (* 180.0 (atan (* (/ B C) -0.5))) (PI)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -5.2 \cdot 10^{-66}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;C \leq 1.1 \cdot 10^{-10}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if C < -5.1999999999999998e-66Initial program 71.0%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6485.0
Applied rewrites85.0%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f6480.5
Applied rewrites80.5%
if -5.1999999999999998e-66 < C < 1.09999999999999995e-10Initial program 56.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6459.1
Applied rewrites59.1%
if 1.09999999999999995e-10 < C Initial program 30.7%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6472.1
Applied rewrites72.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites72.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6472.2
Applied rewrites72.2%
Final simplification68.5%
(FPCore (A B C)
:precision binary64
(if (<= C -9.5e-185)
(* 180.0 (/ (atan (- (/ C B) 1.0)) (PI)))
(if (<= C 1.1e-10)
(* 180.0 (/ (atan (- (- (/ A B) 1.0))) (PI)))
(/ (* 180.0 (atan (* (/ B C) -0.5))) (PI)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -9.5 \cdot 10^{-185}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;C \leq 1.1 \cdot 10^{-10}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\left(\frac{A}{B} - 1\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if C < -9.50000000000000042e-185Initial program 68.7%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6481.6
Applied rewrites81.6%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f6471.4
Applied rewrites71.4%
if -9.50000000000000042e-185 < C < 1.09999999999999995e-10Initial program 54.5%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6485.0
Applied rewrites85.0%
Taylor expanded in B around -inf
lower--.f64N/A
lift-/.f6459.7
Applied rewrites59.7%
if 1.09999999999999995e-10 < C Initial program 30.7%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6472.1
Applied rewrites72.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites72.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6472.2
Applied rewrites72.2%
Final simplification67.9%
(FPCore (A B C)
:precision binary64
(if (<= C -9.5e-185)
(* 180.0 (/ (atan (- (/ C B) 1.0)) (PI)))
(if (<= C 1.1e-10)
(* 180.0 (/ (atan (- (- (/ A B) 1.0))) (PI)))
(* 180.0 (/ (atan (* (/ B C) -0.5)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -9.5 \cdot 10^{-185}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;C \leq 1.1 \cdot 10^{-10}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\left(\frac{A}{B} - 1\right)\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 < -9.50000000000000042e-185Initial program 68.7%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6481.6
Applied rewrites81.6%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f6471.4
Applied rewrites71.4%
if -9.50000000000000042e-185 < C < 1.09999999999999995e-10Initial program 54.5%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6485.0
Applied rewrites85.0%
Taylor expanded in B around -inf
lower--.f64N/A
lift-/.f6459.7
Applied rewrites59.7%
if 1.09999999999999995e-10 < C Initial program 30.7%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6472.1
Applied rewrites72.1%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6472.1
Applied rewrites72.1%
Final simplification67.9%
(FPCore (A B C)
:precision binary64
(if (<= B -5.6e-78)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) (PI)))
(if (<= B 1.2e-281)
(/ (* 180.0 (atan 0.0)) (PI))
(* 180.0 (/ (atan (- (/ C B) 1.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5.6 \cdot 10^{-78}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.2 \cdot 10^{-281}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - 1\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -5.60000000000000047e-78Initial program 48.2%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6460.8
Applied rewrites60.8%
Taylor expanded in B around -inf
lower-+.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
if -5.60000000000000047e-78 < B < 1.2e-281Initial program 55.2%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites88.9%
Taylor expanded in C around inf
associate-*r/N/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
mul0-lftN/A
lift-/.f64N/A
mul0-lft44.9
Applied rewrites44.9%
Taylor expanded in B around 0
Applied rewrites44.9%
if 1.2e-281 < B Initial program 53.3%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.9
Applied rewrites61.9%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f6453.4
Applied rewrites53.4%
Final simplification53.9%
(FPCore (A B C) :precision binary64 (if (<= B 2.7e-63) (* 180.0 (/ (atan (+ 1.0 (/ C B))) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.7 \cdot 10^{-63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \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 < 2.7000000000000002e-63Initial program 53.4%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6460.7
Applied rewrites60.7%
Taylor expanded in B around -inf
lower-+.f64N/A
lower-/.f6445.7
Applied rewrites45.7%
if 2.7000000000000002e-63 < B Initial program 48.4%
Taylor expanded in B around inf
Applied rewrites51.9%
(FPCore (A B C)
:precision binary64
(if (<= B -6.5e-78)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 2.75e-123)
(/ (* 180.0 (atan 0.0)) (PI))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -6.5 \cdot 10^{-78}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.75 \cdot 10^{-123}:\\
\;\;\;\;\frac{180 \cdot \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 < -6.5000000000000003e-78Initial program 48.2%
Taylor expanded in B around -inf
Applied rewrites49.5%
if -6.5000000000000003e-78 < B < 2.75e-123Initial program 57.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites87.3%
Taylor expanded in C around inf
associate-*r/N/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
mul0-lftN/A
lift-/.f64N/A
mul0-lft38.3
Applied rewrites38.3%
Taylor expanded in B around 0
Applied rewrites38.3%
if 2.75e-123 < B Initial program 50.1%
Taylor expanded in B around inf
Applied rewrites46.7%
Final simplification44.9%
(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 49.8%
Taylor expanded in B around -inf
Applied rewrites37.4%
if -3.999999999999988e-310 < B Initial program 54.0%
Taylor expanded in B around inf
Applied rewrites36.3%
(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 51.9%
Taylor expanded in B around inf
Applied rewrites19.6%
herbie shell --seed 2025056
(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))))