
(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 15 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 -5.5e+71) (* (atan (* 0.5 (/ B A))) (/ 180.0 (PI))) (/ (* (atan (/ (- (- C A) (hypot (- A C) B)) B)) 180.0) (PI))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.5 \cdot 10^{+71}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -5.5e71Initial program 16.2%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6414.3
Applied rewrites14.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6414.3
Applied rewrites14.3%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6478.0
Applied rewrites78.0%
if -5.5e71 < A Initial program 60.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites83.6%
Final simplification82.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B)))
(t_1 (/ (- C A) B)))
(if (<= t_0 -5e-14)
(/ (* (atan (- t_1 1.0)) 180.0) (PI))
(if (<= t_0 5e-30)
(/ (atan (* (/ B C) -0.5)) (* 0.005555555555555556 (PI)))
(* (/ (atan (+ t_1 1.0)) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-30}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\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)))))) < -5.0000000000000002e-14Initial program 56.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites81.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6472.9
Applied rewrites72.9%
if -5.0000000000000002e-14 < (*.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)))))) < 4.99999999999999972e-30Initial program 21.2%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6464.7
Applied rewrites64.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites64.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6464.8
Applied rewrites64.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites64.9%
if 4.99999999999999972e-30 < (*.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 54.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6475.6
Applied rewrites75.6%
Final simplification72.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B)))
(t_1 (/ (- C A) B)))
(if (<= t_0 -5e-14)
(* (/ (atan (- t_1 1.0)) (PI)) 180.0)
(if (<= t_0 5e-30)
(/ (atan (* (/ B C) -0.5)) (* 0.005555555555555556 (PI)))
(* (/ (atan (+ t_1 1.0)) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-30}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\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)))))) < -5.0000000000000002e-14Initial program 56.5%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6472.9
Applied rewrites72.9%
if -5.0000000000000002e-14 < (*.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)))))) < 4.99999999999999972e-30Initial program 21.2%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6464.7
Applied rewrites64.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites64.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6464.8
Applied rewrites64.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites64.9%
if 4.99999999999999972e-30 < (*.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 54.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6475.6
Applied rewrites75.6%
Final simplification72.8%
(FPCore (A B C)
:precision binary64
(if (<= A -7.5e+15)
(* (atan (* 0.5 (/ B A))) (/ 180.0 (PI)))
(if (<= A 5e+52)
(/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
(* (/ (atan (- (/ (- C A) B) 1.0)) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -7.5 \cdot 10^{+15}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 5 \cdot 10^{+52}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -7.5e15Initial program 21.0%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6414.9
Applied rewrites14.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6414.9
Applied rewrites14.9%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6476.0
Applied rewrites76.0%
if -7.5e15 < A < 5e52Initial program 54.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites79.3%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.2
Applied rewrites76.2%
if 5e52 < A Initial program 74.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6483.0
Applied rewrites83.0%
Final simplification77.5%
(FPCore (A B C)
:precision binary64
(if (<= B -58000000000000.0)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B -1.15e-100)
(* (atan (* 0.5 (/ B A))) (/ 180.0 (PI)))
(if (<= B 2.6e-138)
(/ (atan (* (/ B C) -0.5)) (* 0.005555555555555556 (PI)))
(if (<= B 1.32e-40)
(* (/ (atan (* (/ C B) 2.0)) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -58000000000000:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -5.8e13Initial program 46.5%
Taylor expanded in B around -inf
Applied rewrites73.4%
if -5.8e13 < B < -1.14999999999999997e-100Initial program 41.6%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6412.2
Applied rewrites12.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites12.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6412.2
Applied rewrites12.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.9
Applied rewrites63.9%
if -1.14999999999999997e-100 < B < 2.6e-138Initial program 54.1%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6444.8
Applied rewrites44.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites44.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6444.8
Applied rewrites44.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites44.9%
if 2.6e-138 < B < 1.32000000000000009e-40Initial program 75.9%
Taylor expanded in C around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.1
Applied rewrites58.1%
if 1.32000000000000009e-40 < B Initial program 47.1%
Taylor expanded in B around inf
Applied rewrites56.3%
Final simplification57.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ 180.0 (PI))))
(if (<= B -58000000000000.0)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B -1.15e-100)
(* (atan (* 0.5 (/ B A))) t_0)
(if (<= B 2.6e-138)
(* (atan (* (/ B C) -0.5)) t_0)
(if (<= B 1.32e-40)
(* (/ (atan (* (/ C B) 2.0)) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;B \leq -58000000000000:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot t\_0\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot t\_0\\
\mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -5.8e13Initial program 46.5%
Taylor expanded in B around -inf
Applied rewrites73.4%
if -5.8e13 < B < -1.14999999999999997e-100Initial program 41.6%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6412.2
Applied rewrites12.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites12.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6412.2
Applied rewrites12.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.9
Applied rewrites63.9%
if -1.14999999999999997e-100 < B < 2.6e-138Initial program 54.1%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6444.8
Applied rewrites44.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites44.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6444.8
Applied rewrites44.8%
if 2.6e-138 < B < 1.32000000000000009e-40Initial program 75.9%
Taylor expanded in C around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.1
Applied rewrites58.1%
if 1.32000000000000009e-40 < B Initial program 47.1%
Taylor expanded in B around inf
Applied rewrites56.3%
Final simplification57.8%
(FPCore (A B C)
:precision binary64
(if (<= B -58000000000000.0)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B -1.15e-100)
(* (atan (* 0.5 (/ B A))) (/ 180.0 (PI)))
(if (<= B 2.6e-138)
(* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)
(if (<= B 1.32e-40)
(* (/ (atan (* (/ C B) 2.0)) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -58000000000000:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -5.8e13Initial program 46.5%
Taylor expanded in B around -inf
Applied rewrites73.4%
if -5.8e13 < B < -1.14999999999999997e-100Initial program 41.6%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6412.2
Applied rewrites12.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites12.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6412.2
Applied rewrites12.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.9
Applied rewrites63.9%
if -1.14999999999999997e-100 < B < 2.6e-138Initial program 54.1%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6444.8
Applied rewrites44.8%
Applied rewrites44.8%
if 2.6e-138 < B < 1.32000000000000009e-40Initial program 75.9%
Taylor expanded in C around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.1
Applied rewrites58.1%
if 1.32000000000000009e-40 < B Initial program 47.1%
Taylor expanded in B around inf
Applied rewrites56.3%
Final simplification57.8%
(FPCore (A B C)
:precision binary64
(if (<= B -58000000000000.0)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B -1.15e-100)
(* (/ (atan (* (/ 0.5 A) B)) (PI)) 180.0)
(if (<= B 2.6e-138)
(* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)
(if (<= B 1.32e-40)
(* (/ (atan (* (/ C B) 2.0)) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -58000000000000:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-138}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 1.32 \cdot 10^{-40}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -5.8e13Initial program 46.5%
Taylor expanded in B around -inf
Applied rewrites73.4%
if -5.8e13 < B < -1.14999999999999997e-100Initial program 41.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
Applied rewrites63.8%
if -1.14999999999999997e-100 < B < 2.6e-138Initial program 54.1%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6444.8
Applied rewrites44.8%
Applied rewrites44.8%
if 2.6e-138 < B < 1.32000000000000009e-40Initial program 75.9%
Taylor expanded in C around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.1
Applied rewrites58.1%
if 1.32000000000000009e-40 < B Initial program 47.1%
Taylor expanded in B around inf
Applied rewrites56.3%
Final simplification57.8%
(FPCore (A B C)
:precision binary64
(if (<= B -58000000000000.0)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B -1.15e-100)
(* (/ (atan (* (/ 0.5 A) B)) (PI)) 180.0)
(if (<= B 6.1e+40)
(* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -58000000000000:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq -1.15 \cdot 10^{-100}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 6.1 \cdot 10^{+40}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -5.8e13Initial program 46.5%
Taylor expanded in B around -inf
Applied rewrites73.4%
if -5.8e13 < B < -1.14999999999999997e-100Initial program 41.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
Applied rewrites63.8%
if -1.14999999999999997e-100 < B < 6.1e40Initial program 59.3%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6440.1
Applied rewrites40.1%
Applied rewrites40.1%
if 6.1e40 < B Initial program 42.3%
Taylor expanded in B around inf
Applied rewrites63.7%
Final simplification56.2%
(FPCore (A B C)
:precision binary64
(if (<= B -6.4e-66)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 6.1e+40)
(* (/ (atan (* (/ -0.5 C) B)) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -6.4 \cdot 10^{-66}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 6.1 \cdot 10^{+40}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -6.39999999999999963e-66Initial program 48.8%
Taylor expanded in B around -inf
Applied rewrites65.0%
if -6.39999999999999963e-66 < B < 6.1e40Initial program 55.9%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6437.9
Applied rewrites37.9%
Applied rewrites37.9%
if 6.1e40 < B Initial program 42.3%
Taylor expanded in B around inf
Applied rewrites63.7%
Final simplification52.6%
(FPCore (A B C)
:precision binary64
(if (<= B -7.8e-57)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 3.5e+40)
(* (/ (atan (* (/ A B) -2.0)) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -7.8 \cdot 10^{-57}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 3.5 \cdot 10^{+40}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -7.80000000000000013e-57Initial program 48.2%
Taylor expanded in B around -inf
Applied rewrites65.6%
if -7.80000000000000013e-57 < B < 3.4999999999999999e40Initial program 56.3%
Taylor expanded in A around inf
lower-*.f64N/A
lower-/.f6435.3
Applied rewrites35.3%
if 3.4999999999999999e40 < B Initial program 42.3%
Taylor expanded in B around inf
Applied rewrites63.7%
Final simplification51.5%
(FPCore (A B C) :precision binary64 (if (<= A -7.2e+15) (* (atan (* 0.5 (/ B A))) (/ 180.0 (PI))) (* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -7.2 \cdot 10^{+15}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if A < -7.2e15Initial program 21.0%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6414.9
Applied rewrites14.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6414.9
Applied rewrites14.9%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6476.0
Applied rewrites76.0%
if -7.2e15 < A Initial program 60.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6458.6
Applied rewrites58.6%
Final simplification63.0%
(FPCore (A B C)
:precision binary64
(if (<= B -3.85e-66)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 6.4e-78)
(* (/ (atan 0.0) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.85 \cdot 10^{-66}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 6.4 \cdot 10^{-78}:\\
\;\;\;\;\frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -3.8500000000000001e-66Initial program 48.8%
Taylor expanded in B around -inf
Applied rewrites65.0%
if -3.8500000000000001e-66 < B < 6.4e-78Initial program 52.7%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval27.0
Applied rewrites27.0%
if 6.4e-78 < B Initial program 49.2%
Taylor expanded in B around inf
Applied rewrites52.9%
Final simplification47.3%
(FPCore (A B C) :precision binary64 (if (<= B 6.4e-78) (* (/ (atan 0.0) (PI)) 180.0) (* (/ (atan -1.0) (PI)) 180.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 6.4 \cdot 10^{-78}:\\
\;\;\;\;\frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < 6.4e-78Initial program 50.9%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval16.3
Applied rewrites16.3%
if 6.4e-78 < B Initial program 49.2%
Taylor expanded in B around inf
Applied rewrites52.9%
Final simplification28.6%
(FPCore (A B C) :precision binary64 (* (/ (atan -1.0) (PI)) 180.0))
\begin{array}{l}
\\
\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 50.3%
Taylor expanded in B around inf
Applied rewrites21.4%
Final simplification21.4%
herbie shell --seed 2024249
(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))))