
(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 -7.3e-40)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) (PI)))
(if (<= C 2e+82)
(* 180.0 (/ (atan (- (/ (+ (hypot A B) A) B))) (PI)))
(*
180.0
(/ (atan (fma -0.5 (+ (/ B C) (* A (/ B (* C C)))) (/ 0.0 B))) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -7.3 \cdot 10^{-40}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;C \leq 2 \cdot 10^{+82}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\frac{\mathsf{hypot}\left(A, B\right) + A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(-0.5, \frac{B}{C} + A \cdot \frac{B}{C \cdot C}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if C < -7.30000000000000005e-40Initial program 84.8%
Taylor expanded in A around 0
Applied rewrites94.0%
if -7.30000000000000005e-40 < C < 1.9999999999999999e82Initial program 59.0%
Taylor expanded in C around 0
Applied rewrites81.5%
if 1.9999999999999999e82 < C Initial program 21.1%
Taylor expanded in C around 0
Applied rewrites41.3%
Taylor expanded in C around inf
Applied rewrites74.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 -5e-65)
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) B))) (PI)))
(if (<= t_0 0.0)
(*
180.0
(/ (atan (fma -0.5 (+ (/ B C) (* A (/ B (* C C)))) (/ 0.0 B))) (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 -5 \cdot 10^{-65}:\\
\;\;\;\;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(\mathsf{fma}\left(-0.5, \frac{B}{C} + A \cdot \frac{B}{C \cdot C}, \frac{0}{B}\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\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))) < -4.99999999999999983e-65Initial program 62.3%
Taylor expanded in B around inf
Applied rewrites80.0%
if -4.99999999999999983e-65 < (*.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 23.0%
Taylor expanded in C around 0
Applied rewrites16.2%
Taylor expanded in C around inf
Applied rewrites71.8%
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 63.1%
Taylor expanded in B around -inf
Applied rewrites79.4%
(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 -5e-65)
(* 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 -5 \cdot 10^{-65}:\\
\;\;\;\;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:\\
\;\;\;\;\frac{180 \cdot \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 - 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))) < -4.99999999999999983e-65Initial program 62.3%
Taylor expanded in B around inf
Applied rewrites80.0%
if -4.99999999999999983e-65 < (*.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 23.0%
Taylor expanded in A around 0
Applied rewrites20.0%
Taylor expanded in B around 0
Applied rewrites70.4%
Applied rewrites70.5%
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 63.1%
Taylor expanded in B around -inf
Applied rewrites79.4%
(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 -5e-65)
(* 180.0 (/ (atan (- (/ (+ B 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 -5 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\frac{B + A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \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 - 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))) < -4.99999999999999983e-65Initial program 62.3%
Taylor expanded in C around 0
Applied rewrites73.9%
Taylor expanded in A around 0
Applied rewrites66.0%
if -4.99999999999999983e-65 < (*.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 23.0%
Taylor expanded in A around 0
Applied rewrites20.0%
Taylor expanded in B around 0
Applied rewrites70.4%
Applied rewrites70.5%
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 63.1%
Taylor expanded in B around -inf
Applied rewrites79.4%
(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 -5e-65)
(* 180.0 (/ (atan (- (/ (+ B A) B))) (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 -5 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\frac{B + A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \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))) < -4.99999999999999983e-65Initial program 62.3%
Taylor expanded in C around 0
Applied rewrites73.9%
Taylor expanded in A around 0
Applied rewrites66.0%
if -4.99999999999999983e-65 < (*.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 23.0%
Taylor expanded in A around 0
Applied rewrites20.0%
Taylor expanded in B around 0
Applied rewrites70.4%
Applied rewrites70.5%
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 63.1%
Taylor expanded in A around 0
Applied rewrites73.1%
Taylor expanded in B around -inf
Applied rewrites67.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 -5e-65)
(* 180.0 (/ (atan (- (/ (+ B A) B))) (PI)))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* -0.5 (/ B C))) (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 -5 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\frac{B + A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\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))) < -4.99999999999999983e-65Initial program 62.3%
Taylor expanded in C around 0
Applied rewrites73.9%
Taylor expanded in A around 0
Applied rewrites66.0%
if -4.99999999999999983e-65 < (*.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 23.0%
Taylor expanded in C around inf
Applied rewrites70.4%
Taylor expanded in A around 0
Applied rewrites70.4%
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 63.1%
Taylor expanded in A around 0
Applied rewrites73.1%
Taylor expanded in B around -inf
Applied rewrites67.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 -5e-65)
(* 180.0 (/ (atan (/ (- C B) B)) (PI)))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* -0.5 (/ B C))) (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 -5 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\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))) < -4.99999999999999983e-65Initial program 62.3%
Taylor expanded in A around 0
Applied rewrites71.0%
Taylor expanded in B around inf
Applied rewrites61.1%
if -4.99999999999999983e-65 < (*.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 23.0%
Taylor expanded in C around inf
Applied rewrites70.4%
Taylor expanded in A around 0
Applied rewrites70.4%
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 63.1%
Taylor expanded in A around 0
Applied rewrites73.1%
Taylor expanded in B around -inf
Applied rewrites67.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 -5e-65)
(* 180.0 (/ (atan (/ (- C B) B)) (PI)))
(if (<= t_0 0.0)
(/ (* 180.0 (atan 0.0)) (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 -5 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\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))) < -4.99999999999999983e-65Initial program 62.3%
Taylor expanded in A around 0
Applied rewrites71.0%
Taylor expanded in B around inf
Applied rewrites61.1%
if -4.99999999999999983e-65 < (*.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 23.0%
Taylor expanded in C around 0
Applied rewrites16.2%
Taylor expanded in C around inf
Applied rewrites23.0%
Applied rewrites23.0%
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 63.1%
Taylor expanded in A around 0
Applied rewrites73.1%
Taylor expanded in B around -inf
Applied rewrites67.7%
(FPCore (A B C)
:precision binary64
(if (<= A -3.3e+138)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(if (<= A 4.4e-57)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) (PI)))
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) B))) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.3 \cdot 10^{+138}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 4.4 \cdot 10^{-57}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - B\right)\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -3.29999999999999978e138Initial program 11.0%
Taylor expanded in A around -inf
Applied rewrites80.8%
if -3.29999999999999978e138 < A < 4.39999999999999997e-57Initial program 56.2%
Taylor expanded in A around 0
Applied rewrites79.4%
if 4.39999999999999997e-57 < A Initial program 77.5%
Taylor expanded in B around inf
Applied rewrites82.6%
(FPCore (A B C) :precision binary64 (if (<= B 9.2e-26) (* 180.0 (/ (atan (+ 1.0 (/ C B))) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9.2 \cdot 10^{-26}:\\
\;\;\;\;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 < 9.20000000000000035e-26Initial program 60.1%
Taylor expanded in A around 0
Applied rewrites65.7%
Taylor expanded in B around -inf
Applied rewrites51.8%
if 9.20000000000000035e-26 < B Initial program 52.9%
Taylor expanded in B around inf
Applied rewrites59.1%
(FPCore (A B C)
:precision binary64
(if (<= B -4.6e-127)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 2.6e-96)
(/ (* 180.0 (atan 0.0)) (PI))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.6 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-96}:\\
\;\;\;\;\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 < -4.60000000000000038e-127Initial program 52.9%
Taylor expanded in B around -inf
Applied rewrites55.1%
if -4.60000000000000038e-127 < B < 2.6000000000000002e-96Initial program 64.1%
Taylor expanded in C around 0
Applied rewrites62.2%
Taylor expanded in C around inf
Applied rewrites30.1%
Applied rewrites30.1%
if 2.6000000000000002e-96 < B Initial program 56.8%
Taylor expanded in B around inf
Applied rewrites52.0%
(FPCore (A B C) :precision binary64 (if (<= B -2e-310) (* 180.0 (/ (atan 1.0) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2 \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 < -1.999999999999994e-310Initial program 58.9%
Taylor expanded in B around -inf
Applied rewrites41.6%
if -1.999999999999994e-310 < B Initial program 57.6%
Taylor expanded in B around inf
Applied rewrites38.1%
(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 58.2%
Taylor expanded in B around inf
Applied rewrites20.6%
herbie shell --seed 2025036 -o generate:simplify -o generate:proofs
(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))))