
(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 -7.5e+181)
(* 180.0 (/ (atan (* (/ 0.5 A) B)) (PI)))
(if (<= A 2.25e-18)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) (PI)))
(* 180.0 (/ (atan (- 1.0 (/ A B))) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -7.5 \cdot 10^{+181}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;A \leq 2.25 \cdot 10^{-18}:\\
\;\;\;\;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(1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if A < -7.5000000000000005e181Initial program 10.7%
Taylor expanded in A around -inf
Applied rewrites71.7%
Taylor expanded in B around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.3%
Taylor expanded in A around inf
lift-/.f6490.1
Applied rewrites90.1%
if -7.5000000000000005e181 < A < 2.24999999999999997e-18Initial program 52.3%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.0
Applied rewrites76.0%
if 2.24999999999999997e-18 < A Initial program 75.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6485.6
Applied rewrites85.6%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6485.7
Applied rewrites85.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 -40.0)
(* 180.0 (/ (atan (/ (- C B) 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 -40:\\
\;\;\;\;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(\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))) < -40Initial program 59.1%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.7
Applied rewrites70.7%
Taylor expanded in B around inf
Applied rewrites63.8%
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 22.8%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6422.1
Applied rewrites22.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6456.8
Applied rewrites56.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 58.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.3
Applied rewrites76.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 -40.0)
(* 180.0 (/ (atan (/ (- C B) B)) (PI)))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B C) -0.5)) (PI)))
(* 180.0 (/ (atan (- 1.0 (/ 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 -40:\\
\;\;\;\;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(\frac{B}{C} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{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))) < -40Initial program 59.1%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.7
Applied rewrites70.7%
Taylor expanded in B around inf
Applied rewrites63.8%
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 22.8%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6422.1
Applied rewrites22.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6456.8
Applied rewrites56.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 58.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.3
Applied rewrites76.3%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6468.4
Applied rewrites68.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 -40.0)
(* 180.0 (/ (atan (/ (- C B) B)) (PI)))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ 0.5 A) B)) (PI)))
(* 180.0 (/ (atan (- 1.0 (/ 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 -40:\\
\;\;\;\;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(\frac{0.5}{A} \cdot B\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{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))) < -40Initial program 59.1%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.7
Applied rewrites70.7%
Taylor expanded in B around inf
Applied rewrites63.8%
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 22.8%
Taylor expanded in A around -inf
Applied rewrites30.2%
Taylor expanded in B around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites34.9%
Taylor expanded in A around inf
lift-/.f6440.4
Applied rewrites40.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 58.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.3
Applied rewrites76.3%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6468.4
Applied rewrites68.4%
(FPCore (A B C)
:precision binary64
(if (<= B -3.5e-248)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) (PI)))
(if (<= B 1.65e-286)
(* 180.0 (/ (atan (/ (* 0.5 (fma (/ C A) B B)) A)) (PI)))
(if (<= B 1.15e+121)
(*
180.0
(/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (fma C C (* B B)))))) (PI)))
(* 180.0 (/ (atan -1.0) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.5 \cdot 10^{-248}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.65 \cdot 10^{-286}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot \mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.15 \cdot 10^{+121}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -3.49999999999999983e-248Initial program 54.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6473.1
Applied rewrites73.1%
if -3.49999999999999983e-248 < B < 1.6499999999999999e-286Initial program 40.3%
Taylor expanded in A around -inf
Applied rewrites32.3%
Taylor expanded in A around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-/.f64N/A
distribute-lft-outN/A
associate-*r/N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6466.7
Applied rewrites66.7%
if 1.6499999999999999e-286 < B < 1.1499999999999999e121Initial program 65.3%
Taylor expanded in A around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6464.5
Applied rewrites64.5%
if 1.1499999999999999e121 < B Initial program 23.6%
Taylor expanded in B around inf
Applied rewrites89.2%
(FPCore (A B C)
:precision binary64
(if (<= B -9.5e-271)
(* 180.0 (/ (atan (- 1.0 (/ A B))) (PI)))
(if (<= B 6.2e-167)
(* 180.0 (/ (atan (/ (- C C) B)) (PI)))
(* 180.0 (/ (atan (/ (- C B) B)) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -9.5 \cdot 10^{-271}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 6.2 \cdot 10^{-167}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - C}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -9.50000000000000103e-271Initial program 53.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6470.9
Applied rewrites70.9%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6464.3
Applied rewrites64.3%
if -9.50000000000000103e-271 < B < 6.2e-167Initial program 48.1%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.6
Applied rewrites72.6%
Taylor expanded in B around 0
Applied rewrites53.2%
if 6.2e-167 < B Initial program 56.1%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.7
Applied rewrites65.7%
Taylor expanded in B around inf
Applied rewrites63.4%
(FPCore (A B C)
:precision binary64
(if (<= B -1.05e-65)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 1.25e-111)
(* 180.0 (/ (atan (/ (- A) B)) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.05 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.25 \cdot 10^{-111}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < -1.05000000000000001e-65Initial program 55.6%
Taylor expanded in B around -inf
Applied rewrites62.5%
if -1.05000000000000001e-65 < B < 1.2500000000000001e-111Initial program 52.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6446.5
Applied rewrites46.5%
Taylor expanded in A around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6434.5
Applied rewrites34.5%
if 1.2500000000000001e-111 < B Initial program 53.2%
Taylor expanded in B around inf
Applied rewrites54.2%
(FPCore (A B C)
:precision binary64
(if (<= B -3.45e-127)
(* 180.0 (/ (atan 1.0) (PI)))
(if (<= B 1.6e+54)
(* 180.0 (/ (atan (/ C B)) (PI)))
(* 180.0 (/ (atan -1.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.45 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\mathsf{PI}\left(\right)}\\
\mathbf{elif}\;B \leq 1.6 \cdot 10^{+54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\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 < -3.45000000000000008e-127Initial program 53.6%
Taylor expanded in B around -inf
Applied rewrites56.4%
if -3.45000000000000008e-127 < B < 1.6e54Initial program 58.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6446.9
Applied rewrites46.9%
Taylor expanded in C around inf
lower-/.f6434.2
Applied rewrites34.2%
if 1.6e54 < B Initial program 43.0%
Taylor expanded in B around inf
Applied rewrites75.0%
(FPCore (A B C) :precision binary64 (if (<= B 6e-263) (* 180.0 (/ (atan (- 1.0 (/ A B))) (PI))) (* 180.0 (/ (atan (/ (- C B) B)) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 6 \cdot 10^{-263}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\mathsf{PI}\left(\right)}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\mathsf{PI}\left(\right)}\\
\end{array}
\end{array}
if B < 6.0000000000000001e-263Initial program 52.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6464.7
Applied rewrites64.7%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
if 6.0000000000000001e-263 < B Initial program 55.6%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.4
Applied rewrites66.4%
Taylor expanded in B around inf
Applied rewrites59.8%
(FPCore (A B C) :precision binary64 (if (<= B 9e-112) (* 180.0 (/ (atan (- 1.0 (/ A B))) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9 \cdot 10^{-112}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{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.00000000000000024e-112Initial program 54.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6463.1
Applied rewrites63.1%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6454.7
Applied rewrites54.7%
if 9.00000000000000024e-112 < B Initial program 53.2%
Taylor expanded in B around inf
Applied rewrites54.2%
(FPCore (A B C) :precision binary64 (if (<= B -1e-309) (* 180.0 (/ (atan 1.0) (PI))) (* 180.0 (/ (atan -1.0) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1 \cdot 10^{-309}:\\
\;\;\;\;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.000000000000002e-309Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites45.1%
if -1.000000000000002e-309 < B Initial program 54.8%
Taylor expanded in B around inf
Applied rewrites39.5%
(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 53.8%
Taylor expanded in B around inf
Applied rewrites19.5%
herbie shell --seed 2025028
(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))))