
(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 (if (<= A -5e+128) (/ (atan (* 0.5 (/ B A))) (* 0.005555555555555556 (PI))) (* (atan (/ (- (- C A) (hypot B (- A C))) B)) (/ 180.0 (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{+128}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -5e128Initial program 11.9%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6486.5
Applied rewrites86.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites86.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites86.6%
if -5e128 < A Initial program 58.8%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6458.8
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
un-div-invN/A
lower-/.f6458.8
Applied rewrites86.8%
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6486.8
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f6486.8
Applied rewrites86.8%
Final simplification86.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (pow B -1.0)))
(t_1 (/ -1.0 (sqrt (PI))))
(t_2 (/ (- C A) B)))
(if (<= t_0 -2e-32)
(/ (* (atan (- t_2 1.0)) 180.0) (PI))
(if (<= t_0 0.0)
(* (* (* (atan (* (/ B C) -0.5)) t_1) t_1) 180.0)
(* (/ (atan (+ t_2 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 {B}^{-1}\\
t_1 := \frac{-1}{\sqrt{\mathsf{PI}\left(\right)}}\\
t_2 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_2 - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\left(\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot t\_1\right) \cdot t\_1\right) \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_2 + 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)))))) < -2.00000000000000011e-32Initial program 51.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6429.6
Applied rewrites29.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites29.5%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6473.1
Applied rewrites73.1%
if -2.00000000000000011e-32 < (*.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.0Initial program 11.8%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
mul-1-negN/A
metadata-evalN/A
div0N/A
lower-fma.f64N/A
lower-/.f6452.0
Applied rewrites52.0%
lift-/.f64N/A
frac-2negN/A
neg-mul-1N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
distribute-rgt-neg-inN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
Applied rewrites52.1%
lift-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
distribute-frac-negN/A
neg-mul-1N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6452.2
Applied rewrites52.2%
if 0.0 < (*.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 60.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6481.7
Applied rewrites81.7%
Final simplification74.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (pow B -1.0)))
(t_1 (/ (- C A) B)))
(if (<= t_0 -2e-32)
(/ (* (atan (- t_1 1.0)) 180.0) (PI))
(if (<= t_0 0.0)
(* (atan (* (/ B C) -0.5)) (/ 180.0 (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 {B}^{-1}\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot \frac{180}{\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)))))) < -2.00000000000000011e-32Initial program 51.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6429.6
Applied rewrites29.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites29.5%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6473.1
Applied rewrites73.1%
if -2.00000000000000011e-32 < (*.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.0Initial program 11.8%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6411.8
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
un-div-invN/A
lower-/.f6411.8
Applied rewrites11.8%
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6411.8
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f6411.8
Applied rewrites11.8%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f644.4
lift--.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lift--.f644.4
Applied rewrites4.4%
Taylor expanded in C around inf
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
--rgt-identityN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6452.2
Applied rewrites52.2%
if 0.0 < (*.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 60.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6481.7
Applied rewrites81.7%
Final simplification74.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (pow B -1.0)))
(t_1 (/ (- C A) B)))
(if (<= t_0 -2e-32)
(* (/ (atan (- t_1 1.0)) (PI)) 180.0)
(if (<= t_0 0.0)
(* (atan (* (/ B C) -0.5)) (/ 180.0 (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 {B}^{-1}\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot \frac{180}{\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)))))) < -2.00000000000000011e-32Initial program 51.7%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6473.1
Applied rewrites73.1%
if -2.00000000000000011e-32 < (*.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.0Initial program 11.8%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6411.8
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
un-div-invN/A
lower-/.f6411.8
Applied rewrites11.8%
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6411.8
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f6411.8
Applied rewrites11.8%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f644.4
lift--.f64N/A
lift-hypot.f64N/A
+-commutativeN/A
lower-hypot.f64N/A
lift--.f644.4
Applied rewrites4.4%
Taylor expanded in C around inf
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
--rgt-identityN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6452.2
Applied rewrites52.2%
if 0.0 < (*.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 60.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6481.7
Applied rewrites81.7%
Final simplification74.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ -1.0 (sqrt (PI)))))
(if (<= C -4.2e+47)
(* (/ (atan (- (/ (- C A) B) 1.0)) (PI)) 180.0)
(if (<= C 1.35e+135)
(* (/ (atan (/ (+ (hypot B A) A) (- B))) (PI)) 180.0)
(* (* (* (atan (* (/ B C) -0.5)) t_0) 180.0) t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sqrt{\mathsf{PI}\left(\right)}}\\
\mathbf{if}\;C \leq -4.2 \cdot 10^{+47}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} - 1\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;C \leq 1.35 \cdot 10^{+135}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(B, A\right) + A}{-B}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right) \cdot t\_0\right) \cdot 180\right) \cdot t\_0\\
\end{array}
\end{array}
if C < -4.2e47Initial program 80.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6487.5
Applied rewrites87.5%
if -4.2e47 < C < 1.34999999999999992e135Initial program 50.5%
Taylor expanded in C around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
mul-1-negN/A
lower-neg.f6475.0
Applied rewrites75.0%
if 1.34999999999999992e135 < C Initial program 8.8%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
mul-1-negN/A
metadata-evalN/A
div0N/A
lower-fma.f64N/A
lower-/.f6479.5
Applied rewrites79.5%
lift-/.f64N/A
frac-2negN/A
neg-mul-1N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
distribute-rgt-neg-inN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
Applied rewrites79.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6479.6
Applied rewrites79.6%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
lower-*.f6479.8
Applied rewrites79.8%
Final simplification78.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (atan (* 0.5 (/ B A))) (* 0.005555555555555556 (PI)))))
(if (<= B -5.2e+54)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B -7e-101)
t_0
(if (<= B 7e-294)
(* (/ (atan (* (/ A B) -2.0)) (PI)) 180.0)
(if (<= B 1.45) t_0 (* (/ (atan -1.0) (PI)) 180.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{0.005555555555555556 \cdot \mathsf{PI}\left(\right)}\\
\mathbf{if}\;B \leq -5.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq -7 \cdot 10^{-101}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 7 \cdot 10^{-294}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 1.45:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -5.20000000000000013e54Initial program 43.0%
Taylor expanded in B around -inf
Applied rewrites75.1%
if -5.20000000000000013e54 < B < -6.99999999999999989e-101 or 7.00000000000000064e-294 < B < 1.44999999999999996Initial program 46.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6443.7
Applied rewrites43.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites43.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites43.8%
if -6.99999999999999989e-101 < B < 7.00000000000000064e-294Initial program 79.5%
Taylor expanded in A around inf
lower-*.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
if 1.44999999999999996 < B Initial program 45.9%
Taylor expanded in B around inf
Applied rewrites65.3%
Final simplification59.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* (/ (atan (* 0.5 (/ B A))) (PI)) 180.0)))
(if (<= B -5.2e+54)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B -7e-101)
t_0
(if (<= B 7e-294)
(* (/ (atan (* (/ A B) -2.0)) (PI)) 180.0)
(if (<= B 1.45) t_0 (* (/ (atan -1.0) (PI)) 180.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{if}\;B \leq -5.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq -7 \cdot 10^{-101}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 7 \cdot 10^{-294}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 1.45:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if B < -5.20000000000000013e54Initial program 43.0%
Taylor expanded in B around -inf
Applied rewrites75.1%
if -5.20000000000000013e54 < B < -6.99999999999999989e-101 or 7.00000000000000064e-294 < B < 1.44999999999999996Initial program 46.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6443.7
Applied rewrites43.7%
if -6.99999999999999989e-101 < B < 7.00000000000000064e-294Initial program 79.5%
Taylor expanded in A around inf
lower-*.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
if 1.44999999999999996 < B Initial program 45.9%
Taylor expanded in B around inf
Applied rewrites65.3%
Final simplification59.0%
(FPCore (A B C)
:precision binary64
(if (<= B -8.8e-100)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 4.6e-296)
(* (/ (atan (* (/ A B) -2.0)) (PI)) 180.0)
(if (<= B 3e-107)
(* (/ (atan 0.0) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -8.8 \cdot 10^{-100}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 4.6 \cdot 10^{-296}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 3 \cdot 10^{-107}:\\
\;\;\;\;\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 < -8.79999999999999957e-100Initial program 41.1%
Taylor expanded in B around -inf
Applied rewrites57.8%
if -8.79999999999999957e-100 < B < 4.60000000000000008e-296Initial program 79.5%
Taylor expanded in A around inf
lower-*.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
if 4.60000000000000008e-296 < B < 2.9999999999999997e-107Initial program 42.3%
Taylor expanded in C around inf
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
mul-1-negN/A
metadata-evalN/A
div051.9
Applied rewrites51.9%
if 2.9999999999999997e-107 < B Initial program 50.3%
Taylor expanded in B around inf
Applied rewrites52.7%
Final simplification55.7%
(FPCore (A B C) :precision binary64 (if (<= A -5800000000000.0) (/ (atan (* 0.5 (/ B A))) (* 0.005555555555555556 (PI))) (* (/ (atan (+ (/ (- C A) B) 1.0)) (PI)) 180.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5800000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{0.005555555555555556 \cdot \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 < -5.8e12Initial program 20.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6472.6
Applied rewrites72.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites72.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites72.7%
if -5.8e12 < A Initial program 61.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6462.1
Applied rewrites62.1%
Final simplification64.7%
(FPCore (A B C)
:precision binary64
(if (<= B -1.9e-295)
(* (/ (atan 1.0) (PI)) 180.0)
(if (<= B 3e-107)
(* (/ (atan 0.0) (PI)) 180.0)
(* (/ (atan -1.0) (PI)) 180.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.9 \cdot 10^{-295}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;B \leq 3 \cdot 10^{-107}:\\
\;\;\;\;\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 < -1.90000000000000009e-295Initial program 54.1%
Taylor expanded in B around -inf
Applied rewrites44.6%
if -1.90000000000000009e-295 < B < 2.9999999999999997e-107Initial program 45.1%
Taylor expanded in C around inf
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
mul-1-negN/A
metadata-evalN/A
div049.6
Applied rewrites49.6%
if 2.9999999999999997e-107 < B Initial program 50.3%
Taylor expanded in B around inf
Applied rewrites52.7%
Final simplification48.5%
(FPCore (A B C) :precision binary64 (if (<= B 3e-107) (* (/ (atan 0.0) (PI)) 180.0) (* (/ (atan -1.0) (PI)) 180.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3 \cdot 10^{-107}:\\
\;\;\;\;\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 < 2.9999999999999997e-107Initial program 51.7%
Taylor expanded in C around inf
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
mul-1-negN/A
metadata-evalN/A
div019.0
Applied rewrites19.0%
if 2.9999999999999997e-107 < B Initial program 50.3%
Taylor expanded in B around inf
Applied rewrites52.7%
Final simplification32.0%
(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 51.1%
Taylor expanded in B around inf
Applied rewrites23.1%
Final simplification23.1%
herbie shell --seed 2024271
(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))))