
(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 -1.2e+31) (/ (* (atan (* (/ B A) 0.5)) 180.0) (PI)) (* (/ 180.0 (PI)) (atan (/ (- (- C A) (hypot (- A C) B)) B)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.2 \cdot 10^{+31}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)\\
\end{array}
\end{array}
if A < -1.19999999999999991e31Initial program 20.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.5
Applied rewrites79.5%
if -1.19999999999999991e31 < A Initial program 66.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6485.7
Applied rewrites85.7%
Final simplification84.1%
(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 (* (pow B -1.0) (* (- t_1 1.0) B))) (PI)))
(if (<= t_0 0.0)
(/ (* (atan (* (/ B A) 0.5)) 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({B}^{-1} \cdot \left(\left(t\_1 - 1\right) \cdot B\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\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 60.7%
Taylor expanded in B around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6472.2
Applied rewrites72.2%
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))) < 0.0Initial program 25.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites25.3%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.9
Applied rewrites66.9%
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 58.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Final simplification74.5%
(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 0.0)
(/ (* (atan (* (/ B A) 0.5)) 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 0:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\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 60.7%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6472.2
Applied rewrites72.2%
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))) < 0.0Initial program 25.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites25.3%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.9
Applied rewrites66.9%
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 58.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Final simplification74.5%
(FPCore (A B C)
:precision binary64
(if (<= A -1.2e+31)
(/ (* (atan (* (/ B A) 0.5)) 180.0) (PI))
(if (<= A 6.8e-204)
(/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
(* (/ 180.0 (PI)) (atan (/ (- (+ (hypot B A) A)) B))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.2 \cdot 10^{+31}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 6.8 \cdot 10^{-204}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{-\left(\mathsf{hypot}\left(B, A\right) + A\right)}{B}\right)\\
\end{array}
\end{array}
if A < -1.19999999999999991e31Initial program 20.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.5
Applied rewrites79.5%
if -1.19999999999999991e31 < A < 6.8000000000000004e-204Initial program 56.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites82.5%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.6
Applied rewrites82.6%
if 6.8000000000000004e-204 < A Initial program 73.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites88.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.1
Applied rewrites88.1%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.6
Applied rewrites80.6%
Final simplification80.9%
(FPCore (A B C)
:precision binary64
(if (<= A -1.2e+31)
(/ (* (atan (* (/ B A) 0.5)) 180.0) (PI))
(if (<= A 1.16e+73)
(/ (* (atan (/ (- C (hypot B C)) B)) 180.0) (PI))
(* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.2 \cdot 10^{+31}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 1.16 \cdot 10^{+73}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right) \cdot 180}{\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 < -1.19999999999999991e31Initial program 20.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.5
Applied rewrites79.5%
if -1.19999999999999991e31 < A < 1.16000000000000007e73Initial program 58.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites80.8%
Taylor expanded in A around 0
lower--.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.3
Applied rewrites76.3%
if 1.16000000000000007e73 < A Initial program 85.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6491.0
Applied rewrites91.0%
Final simplification80.2%
(FPCore (A B C)
:precision binary64
(if (<= B -1.15e-132)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 9.5e-97)
(* 180.0 (/ (atan 0.0) (PI)))
(if (<= B 8.5e+45)
(* 180.0 (/ (atan (* B (/ -0.5 C))) (PI)))
(* 180.0 (/ (atan -1.0) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.15 \cdot 10^{-132}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 9.5 \cdot 10^{-97}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 8.5 \cdot 10^{+45}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -1.15000000000000002e-132Initial program 52.9%
Taylor expanded in B around -inf
Applied rewrites57.4%
if -1.15000000000000002e-132 < B < 9.5000000000000001e-97Initial program 60.8%
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-lft31.8
Applied rewrites31.8%
if 9.5000000000000001e-97 < B < 8.4999999999999996e45Initial program 46.8%
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-lft41.3
Applied rewrites41.3%
Applied rewrites41.3%
if 8.4999999999999996e45 < B Initial program 52.7%
Taylor expanded in B around inf
Applied rewrites56.7%
Final simplification46.9%
(FPCore (A B C)
:precision binary64
(if (<= A -1.9e-308)
(/ (* (atan (* (/ B A) 0.5)) 180.0) (PI))
(if (<= A 2.6e-71)
(* 180.0 (/ (atan 1.0) (PI)))
(* (/ 180.0 (PI)) (atan (/ (- (+ B A)) B))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.9 \cdot 10^{-308}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2.6 \cdot 10^{-71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{-\left(B + A\right)}{B}\right)\\
\end{array}
\end{array}
if A < -1.9000000000000001e-308Initial program 39.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites66.4%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.2
Applied rewrites58.2%
if -1.9000000000000001e-308 < A < 2.5999999999999999e-71Initial program 53.5%
Taylor expanded in B around -inf
Applied rewrites43.9%
if 2.5999999999999999e-71 < A Initial program 78.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.5
Applied rewrites91.5%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.7
Applied rewrites83.7%
Taylor expanded in A around 0
Applied rewrites70.1%
Final simplification60.0%
(FPCore (A B C)
:precision binary64
(if (<= A -1.9e-308)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(if (<= A 2.6e-71)
(* 180.0 (/ (atan 1.0) (PI)))
(* (/ 180.0 (PI)) (atan (/ (- (+ B A)) B))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.9 \cdot 10^{-308}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2.6 \cdot 10^{-71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{-\left(B + A\right)}{B}\right)\\
\end{array}
\end{array}
if A < -1.9000000000000001e-308Initial program 39.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.1
Applied rewrites58.1%
if -1.9000000000000001e-308 < A < 2.5999999999999999e-71Initial program 53.5%
Taylor expanded in B around -inf
Applied rewrites43.9%
if 2.5999999999999999e-71 < A Initial program 78.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.5
Applied rewrites91.5%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.7
Applied rewrites83.7%
Taylor expanded in A around 0
Applied rewrites70.1%
Final simplification60.0%
(FPCore (A B C)
:precision binary64
(if (<= A -1.9e-308)
(* 180.0 (/ (atan (* (/ B A) 0.5)) (PI)))
(if (<= A 3.8e-71)
(* 180.0 (/ (atan 1.0) (PI)))
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.9 \cdot 10^{-308}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 3.8 \cdot 10^{-71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\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 < -1.9000000000000001e-308Initial program 39.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.1
Applied rewrites58.1%
if -1.9000000000000001e-308 < A < 3.79999999999999992e-71Initial program 53.5%
Taylor expanded in B around -inf
Applied rewrites43.9%
if 3.79999999999999992e-71 < A Initial program 78.0%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.6
Applied rewrites64.6%
(FPCore (A B C)
:precision binary64
(if (<= B -2.15e-35)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 1.85e+64)
(* 180.0 (/ (atan (* (/ A B) -2.0)) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.15 \cdot 10^{-35}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{+64}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -2.1500000000000001e-35Initial program 52.5%
Taylor expanded in B around -inf
Applied rewrites69.8%
if -2.1500000000000001e-35 < B < 1.84999999999999992e64Initial program 57.2%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6436.3
Applied rewrites36.3%
if 1.84999999999999992e64 < B Initial program 48.3%
Taylor expanded in B around inf
Applied rewrites60.4%
(FPCore (A B C) :precision binary64 (if (<= A -1.3e+30) (/ (* (atan (* (/ B A) 0.5)) 180.0) (PI)) (* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.3 \cdot 10^{+30}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right) \cdot 180}{\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 < -1.29999999999999994e30Initial program 20.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.5
Applied rewrites79.5%
if -1.29999999999999994e30 < A Initial program 66.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6467.4
Applied rewrites67.4%
Final simplification70.5%
(FPCore (A B C)
:precision binary64
(if (<= B -1.15e-132)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 2.2e-52)
(* 180.0 (/ (atan 0.0) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.15 \cdot 10^{-132}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 2.2 \cdot 10^{-52}:\\
\;\;\;\;180 \cdot \frac{\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 < -1.15000000000000002e-132Initial program 52.9%
Taylor expanded in B around -inf
Applied rewrites57.4%
if -1.15000000000000002e-132 < B < 2.20000000000000009e-52Initial program 57.0%
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-lft32.0
Applied rewrites32.0%
if 2.20000000000000009e-52 < B Initial program 53.1%
Taylor expanded in B around inf
Applied rewrites42.1%
Final simplification43.9%
(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 53.7%
Taylor expanded in B around -inf
Applied rewrites44.7%
if -1.999999999999994e-310 < B Initial program 55.2%
Taylor expanded in B around inf
Applied rewrites28.8%
(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 54.4%
Taylor expanded in B around inf
Applied rewrites15.9%
herbie shell --seed 2024356
(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))))