
(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)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\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)}{\pi}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 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)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\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)}{\pi}
\end{array}
(FPCore (A B C)
:precision binary64
(let* ((t_0 (hypot B (- A C))))
(if (<= C 9.5e-145)
(* 180.0 (/ (atan (/ (- (- C A) t_0) B)) PI))
(/ (* 180.0 (atan (/ -1.0 (fma -1.0 (/ (- A C) B) (/ t_0 B))))) PI))))
double code(double A, double B, double C) {
double t_0 = hypot(B, (A - C));
double tmp;
if (C <= 9.5e-145) {
tmp = 180.0 * (atan((((C - A) - t_0) / B)) / ((double) M_PI));
} else {
tmp = (180.0 * atan((-1.0 / fma(-1.0, ((A - C) / B), (t_0 / B))))) / ((double) M_PI);
}
return tmp;
}
function code(A, B, C) t_0 = hypot(B, Float64(A - C)) tmp = 0.0 if (C <= 9.5e-145) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - t_0) / B)) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / fma(-1.0, Float64(Float64(A - C) / B), Float64(t_0 / B))))) / pi); end return tmp end
code[A_, B_, C_] := Block[{t$95$0 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[C, 9.5e-145], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - t$95$0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(-1.0 * N[(N[(A - C), $MachinePrecision] / B), $MachinePrecision] + N[(t$95$0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B, A - C\right)\\
\mathbf{if}\;C \leq 9.5 \cdot 10^{-145}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - t\_0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\mathsf{fma}\left(-1, \frac{A - C}{B}, \frac{t\_0}{B}\right)}\right)}{\pi}\\
\end{array}
\end{array}
if C < 9.49999999999999981e-145Initial program 67.9%
associate-*l/67.9%
*-lft-identity67.9%
+-commutative67.9%
unpow267.9%
unpow267.9%
hypot-define91.0%
Simplified91.0%
if 9.49999999999999981e-145 < C Initial program 33.8%
*-commutative33.8%
associate--l-33.7%
+-commutative33.7%
unpow233.7%
unpow233.7%
hypot-undefine59.7%
associate--r+63.8%
div-inv63.8%
div-sub48.5%
flip--32.2%
Applied egg-rr32.2%
Taylor expanded in C around -inf 49.1%
Simplified90.2%
associate-*r/90.2%
Applied egg-rr90.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (hypot B (- A C))))
(if (<= C 6.9e-147)
(* 180.0 (/ (atan (/ (- (- C A) t_0) B)) PI))
(* 180.0 (/ (atan (/ -1.0 (fma -1.0 (/ (- A C) B) (/ t_0 B)))) PI)))))
double code(double A, double B, double C) {
double t_0 = hypot(B, (A - C));
double tmp;
if (C <= 6.9e-147) {
tmp = 180.0 * (atan((((C - A) - t_0) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 / fma(-1.0, ((A - C) / B), (t_0 / B)))) / ((double) M_PI));
}
return tmp;
}
function code(A, B, C) t_0 = hypot(B, Float64(A - C)) tmp = 0.0 if (C <= 6.9e-147) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - t_0) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / fma(-1.0, Float64(Float64(A - C) / B), Float64(t_0 / B)))) / pi)); end return tmp end
code[A_, B_, C_] := Block[{t$95$0 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[C, 6.9e-147], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - t$95$0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(-1.0 * N[(N[(A - C), $MachinePrecision] / B), $MachinePrecision] + N[(t$95$0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B, A - C\right)\\
\mathbf{if}\;C \leq 6.9 \cdot 10^{-147}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - t\_0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\mathsf{fma}\left(-1, \frac{A - C}{B}, \frac{t\_0}{B}\right)}\right)}{\pi}\\
\end{array}
\end{array}
if C < 6.89999999999999999e-147Initial program 67.9%
associate-*l/67.9%
*-lft-identity67.9%
+-commutative67.9%
unpow267.9%
unpow267.9%
hypot-define91.0%
Simplified91.0%
if 6.89999999999999999e-147 < C Initial program 33.8%
*-commutative33.8%
associate--l-33.7%
+-commutative33.7%
unpow233.7%
unpow233.7%
hypot-undefine59.7%
associate--r+63.8%
div-inv63.8%
div-sub48.5%
flip--32.2%
Applied egg-rr32.2%
Taylor expanded in C around -inf 49.1%
Simplified90.2%
(FPCore (A B C)
:precision binary64
(if (<= C -3.8e-44)
(* (/ 180.0 PI) (atan (/ (- C (hypot C B)) B)))
(if (<= C 1.7e+14)
(* 180.0 (/ (atan (/ (+ A (hypot A B)) (- B))) PI))
(* 180.0 (/ (atan (/ -1.0 (+ (/ C B) (/ (hypot C B) B)))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -3.8e-44) {
tmp = (180.0 / ((double) M_PI)) * atan(((C - hypot(C, B)) / B));
} else if (C <= 1.7e+14) {
tmp = 180.0 * (atan(((A + hypot(A, B)) / -B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 / ((C / B) + (hypot(C, B) / B)))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -3.8e-44) {
tmp = (180.0 / Math.PI) * Math.atan(((C - Math.hypot(C, B)) / B));
} else if (C <= 1.7e+14) {
tmp = 180.0 * (Math.atan(((A + Math.hypot(A, B)) / -B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 / ((C / B) + (Math.hypot(C, B) / B)))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -3.8e-44: tmp = (180.0 / math.pi) * math.atan(((C - math.hypot(C, B)) / B)) elif C <= 1.7e+14: tmp = 180.0 * (math.atan(((A + math.hypot(A, B)) / -B)) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 / ((C / B) + (math.hypot(C, B) / B)))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -3.8e-44) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - hypot(C, B)) / B))); elseif (C <= 1.7e+14) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(A, B)) / Float64(-B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(C / B) + Float64(hypot(C, B) / B)))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -3.8e-44) tmp = (180.0 / pi) * atan(((C - hypot(C, B)) / B)); elseif (C <= 1.7e+14) tmp = 180.0 * (atan(((A + hypot(A, B)) / -B)) / pi); else tmp = 180.0 * (atan((-1.0 / ((C / B) + (hypot(C, B) / B)))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -3.8e-44], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.7e+14], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(C / B), $MachinePrecision] + N[(N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -3.8 \cdot 10^{-44}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)\\
\mathbf{elif}\;C \leq 1.7 \cdot 10^{+14}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{C}{B} + \frac{\mathsf{hypot}\left(C, B\right)}{B}}\right)}{\pi}\\
\end{array}
\end{array}
if C < -3.8000000000000001e-44Initial program 79.7%
Taylor expanded in B around 0 79.7%
Simplified94.6%
Taylor expanded in A around 0 78.5%
+-commutative78.5%
unpow278.5%
unpow278.5%
hypot-define93.4%
Simplified93.4%
if -3.8000000000000001e-44 < C < 1.7e14Initial program 55.7%
Taylor expanded in C around 0 53.1%
associate-*r/53.1%
mul-1-neg53.1%
unpow253.1%
unpow253.1%
hypot-define78.9%
Simplified78.9%
if 1.7e14 < C Initial program 26.6%
*-commutative26.6%
associate--l-26.6%
+-commutative26.6%
unpow226.6%
unpow226.6%
hypot-undefine57.8%
associate--r+60.8%
div-inv60.8%
div-sub41.1%
flip--24.6%
Applied egg-rr24.6%
Taylor expanded in C around -inf 39.8%
Simplified90.6%
Taylor expanded in A around 0 38.2%
Simplified80.7%
Final simplification83.4%
(FPCore (A B C)
:precision binary64
(if (<= A -3.6e+138)
(* 180.0 (/ (atan (/ -1.0 (* -2.0 (/ A B)))) PI))
(if (<= A 3e-22)
(* (/ 180.0 PI) (atan (/ (- C (hypot C B)) B)))
(* 180.0 (/ (atan (/ (+ A (hypot A B)) (- B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.6e+138) {
tmp = 180.0 * (atan((-1.0 / (-2.0 * (A / B)))) / ((double) M_PI));
} else if (A <= 3e-22) {
tmp = (180.0 / ((double) M_PI)) * atan(((C - hypot(C, B)) / B));
} else {
tmp = 180.0 * (atan(((A + hypot(A, B)) / -B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.6e+138) {
tmp = 180.0 * (Math.atan((-1.0 / (-2.0 * (A / B)))) / Math.PI);
} else if (A <= 3e-22) {
tmp = (180.0 / Math.PI) * Math.atan(((C - Math.hypot(C, B)) / B));
} else {
tmp = 180.0 * (Math.atan(((A + Math.hypot(A, B)) / -B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.6e+138: tmp = 180.0 * (math.atan((-1.0 / (-2.0 * (A / B)))) / math.pi) elif A <= 3e-22: tmp = (180.0 / math.pi) * math.atan(((C - math.hypot(C, B)) / B)) else: tmp = 180.0 * (math.atan(((A + math.hypot(A, B)) / -B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.6e+138) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(-2.0 * Float64(A / B)))) / pi)); elseif (A <= 3e-22) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - hypot(C, B)) / B))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(A, B)) / Float64(-B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.6e+138) tmp = 180.0 * (atan((-1.0 / (-2.0 * (A / B)))) / pi); elseif (A <= 3e-22) tmp = (180.0 / pi) * atan(((C - hypot(C, B)) / B)); else tmp = 180.0 * (atan(((A + hypot(A, B)) / -B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.6e+138], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3e-22], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.6 \cdot 10^{+138}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{-2 \cdot \frac{A}{B}}\right)}{\pi}\\
\mathbf{elif}\;A \leq 3 \cdot 10^{-22}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{-B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.6000000000000001e138Initial program 11.4%
*-commutative11.4%
associate--l-11.3%
+-commutative11.3%
unpow211.3%
unpow211.3%
hypot-undefine24.3%
associate--r+57.0%
div-inv57.0%
div-sub17.6%
flip--10.0%
Applied egg-rr10.0%
Taylor expanded in C around -inf 47.8%
Simplified93.6%
Taylor expanded in A around -inf 81.0%
if -3.6000000000000001e138 < A < 2.9999999999999999e-22Initial program 53.5%
Taylor expanded in B around 0 52.7%
Simplified77.6%
Taylor expanded in A around 0 51.5%
+-commutative51.5%
unpow251.5%
unpow251.5%
hypot-define76.4%
Simplified76.4%
if 2.9999999999999999e-22 < A Initial program 75.0%
Taylor expanded in C around 0 75.0%
associate-*r/75.0%
mul-1-neg75.0%
unpow275.0%
unpow275.0%
hypot-define93.3%
Simplified93.3%
Final simplification82.3%
(FPCore (A B C)
:precision binary64
(if (<= A -1.3e+147)
(* 180.0 (/ (atan (/ -1.0 (* -2.0 (/ A B)))) PI))
(if (<= A 3.2e-9)
(* (/ 180.0 PI) (atan (/ (- C (hypot C B)) B)))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.3e+147) {
tmp = 180.0 * (atan((-1.0 / (-2.0 * (A / B)))) / ((double) M_PI));
} else if (A <= 3.2e-9) {
tmp = (180.0 / ((double) M_PI)) * atan(((C - hypot(C, B)) / B));
} else {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.3e+147) {
tmp = 180.0 * (Math.atan((-1.0 / (-2.0 * (A / B)))) / Math.PI);
} else if (A <= 3.2e-9) {
tmp = (180.0 / Math.PI) * Math.atan(((C - Math.hypot(C, B)) / B));
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.3e+147: tmp = 180.0 * (math.atan((-1.0 / (-2.0 * (A / B)))) / math.pi) elif A <= 3.2e-9: tmp = (180.0 / math.pi) * math.atan(((C - math.hypot(C, B)) / B)) else: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.3e+147) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(-2.0 * Float64(A / B)))) / pi)); elseif (A <= 3.2e-9) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - hypot(C, B)) / B))); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.3e+147) tmp = 180.0 * (atan((-1.0 / (-2.0 * (A / B)))) / pi); elseif (A <= 3.2e-9) tmp = (180.0 / pi) * atan(((C - hypot(C, B)) / B)); else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.3e+147], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.2e-9], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.3 \cdot 10^{+147}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{-2 \cdot \frac{A}{B}}\right)}{\pi}\\
\mathbf{elif}\;A \leq 3.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.2999999999999999e147Initial program 11.4%
*-commutative11.4%
associate--l-11.3%
+-commutative11.3%
unpow211.3%
unpow211.3%
hypot-undefine24.3%
associate--r+57.0%
div-inv57.0%
div-sub17.6%
flip--10.0%
Applied egg-rr10.0%
Taylor expanded in C around -inf 47.8%
Simplified93.6%
Taylor expanded in A around -inf 81.0%
if -1.2999999999999999e147 < A < 3.20000000000000012e-9Initial program 53.7%
Taylor expanded in B around 0 52.9%
Simplified78.2%
Taylor expanded in A around 0 51.1%
+-commutative51.1%
unpow251.1%
unpow251.1%
hypot-define76.4%
Simplified76.4%
if 3.20000000000000012e-9 < A Initial program 75.8%
Taylor expanded in B around -inf 78.8%
associate--l+78.8%
div-sub82.7%
Simplified82.7%
Taylor expanded in C around 0 83.0%
(FPCore (A B C)
:precision binary64
(if (<= A -4.4e+130)
(* 180.0 (/ (atan (/ -1.0 (* -2.0 (/ A B)))) PI))
(if (<= A 5.2e-9)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) PI))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.4e+130) {
tmp = 180.0 * (atan((-1.0 / (-2.0 * (A / B)))) / ((double) M_PI));
} else if (A <= 5.2e-9) {
tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -4.4e+130) {
tmp = 180.0 * (Math.atan((-1.0 / (-2.0 * (A / B)))) / Math.PI);
} else if (A <= 5.2e-9) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(C, B)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -4.4e+130: tmp = 180.0 * (math.atan((-1.0 / (-2.0 * (A / B)))) / math.pi) elif A <= 5.2e-9: tmp = 180.0 * (math.atan(((C - math.hypot(C, B)) / B)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -4.4e+130) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(-2.0 * Float64(A / B)))) / pi)); elseif (A <= 5.2e-9) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(C, B)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -4.4e+130) tmp = 180.0 * (atan((-1.0 / (-2.0 * (A / B)))) / pi); elseif (A <= 5.2e-9) tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / pi); else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -4.4e+130], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.2e-9], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.4 \cdot 10^{+130}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{-2 \cdot \frac{A}{B}}\right)}{\pi}\\
\mathbf{elif}\;A \leq 5.2 \cdot 10^{-9}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.39999999999999987e130Initial program 11.4%
*-commutative11.4%
associate--l-11.3%
+-commutative11.3%
unpow211.3%
unpow211.3%
hypot-undefine24.3%
associate--r+57.0%
div-inv57.0%
div-sub17.6%
flip--10.0%
Applied egg-rr10.0%
Taylor expanded in C around -inf 47.8%
Simplified93.6%
Taylor expanded in A around -inf 81.0%
if -4.39999999999999987e130 < A < 5.2000000000000002e-9Initial program 53.7%
Taylor expanded in A around 0 51.0%
+-commutative51.0%
unpow251.0%
unpow251.0%
hypot-define76.4%
Simplified76.4%
if 5.2000000000000002e-9 < A Initial program 75.8%
Taylor expanded in B around -inf 78.8%
associate--l+78.8%
div-sub82.7%
Simplified82.7%
Taylor expanded in C around 0 83.0%
(FPCore (A B C) :precision binary64 (if (<= C 1.4e+16) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI)) (* 180.0 (/ (atan (/ -1.0 (+ (/ C B) (/ (hypot C B) B)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 1.4e+16) {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 / ((C / B) + (hypot(C, B) / B)))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 1.4e+16) {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 / ((C / B) + (Math.hypot(C, B) / B)))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 1.4e+16: tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 / ((C / B) + (math.hypot(C, B) / B)))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 1.4e+16) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(C / B) + Float64(hypot(C, B) / B)))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 1.4e+16) tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); else tmp = 180.0 * (atan((-1.0 / ((C / B) + (hypot(C, B) / B)))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 1.4e+16], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(C / B), $MachinePrecision] + N[(N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.4 \cdot 10^{+16}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{C}{B} + \frac{\mathsf{hypot}\left(C, B\right)}{B}}\right)}{\pi}\\
\end{array}
\end{array}
if C < 1.4e16Initial program 64.7%
associate-*l/64.7%
*-lft-identity64.7%
+-commutative64.7%
unpow264.7%
unpow264.7%
hypot-define87.5%
Simplified87.5%
if 1.4e16 < C Initial program 26.6%
*-commutative26.6%
associate--l-26.6%
+-commutative26.6%
unpow226.6%
unpow226.6%
hypot-undefine57.8%
associate--r+60.8%
div-inv60.8%
div-sub41.1%
flip--24.6%
Applied egg-rr24.6%
Taylor expanded in C around -inf 39.8%
Simplified90.6%
Taylor expanded in A around 0 38.2%
Simplified80.7%
(FPCore (A B C) :precision binary64 (if (<= A -8.8e+129) (* 180.0 (/ (atan (/ -1.0 (* -2.0 (/ A B)))) PI)) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -8.8e+129) {
tmp = 180.0 * (atan((-1.0 / (-2.0 * (A / B)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -8.8e+129) {
tmp = 180.0 * (Math.atan((-1.0 / (-2.0 * (A / B)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -8.8e+129: tmp = 180.0 * (math.atan((-1.0 / (-2.0 * (A / B)))) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -8.8e+129) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(-2.0 * Float64(A / B)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -8.8e+129) tmp = 180.0 * (atan((-1.0 / (-2.0 * (A / B)))) / pi); else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -8.8e+129], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.8 \cdot 10^{+129}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{-2 \cdot \frac{A}{B}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.7999999999999997e129Initial program 11.4%
*-commutative11.4%
associate--l-11.3%
+-commutative11.3%
unpow211.3%
unpow211.3%
hypot-undefine24.3%
associate--r+57.0%
div-inv57.0%
div-sub17.6%
flip--10.0%
Applied egg-rr10.0%
Taylor expanded in C around -inf 47.8%
Simplified93.6%
Taylor expanded in A around -inf 81.0%
if -8.7999999999999997e129 < A Initial program 61.3%
Simplified83.6%
(FPCore (A B C)
:precision binary64
(if (<= B 1.65e-95)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
(if (<= B 4.4e-45)
(*
180.0
(/
(atan (/ -1.0 (* C (+ (* -2.0 (/ A (* C B))) (* 2.0 (/ 1.0 B))))))
PI))
(* 180.0 (/ (atan (+ (/ C B) (- -1.0 (/ A B)))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1.65e-95) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else if (B <= 4.4e-45) {
tmp = 180.0 * (atan((-1.0 / (C * ((-2.0 * (A / (C * B))) + (2.0 * (1.0 / B)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 1.65e-95) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else if (B <= 4.4e-45) {
tmp = 180.0 * (Math.atan((-1.0 / (C * ((-2.0 * (A / (C * B))) + (2.0 * (1.0 / B)))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C / B) + (-1.0 - (A / B)))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 1.65e-95: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) elif B <= 4.4e-45: tmp = 180.0 * (math.atan((-1.0 / (C * ((-2.0 * (A / (C * B))) + (2.0 * (1.0 / B)))))) / math.pi) else: tmp = 180.0 * (math.atan(((C / B) + (-1.0 - (A / B)))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 1.65e-95) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); elseif (B <= 4.4e-45) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(C * Float64(Float64(-2.0 * Float64(A / Float64(C * B))) + Float64(2.0 * Float64(1.0 / B)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) + Float64(-1.0 - Float64(A / B)))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 1.65e-95) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); elseif (B <= 4.4e-45) tmp = 180.0 * (atan((-1.0 / (C * ((-2.0 * (A / (C * B))) + (2.0 * (1.0 / B)))))) / pi); else tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 1.65e-95], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.4e-45], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(C * N[(N[(-2.0 * N[(A / N[(C * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.65 \cdot 10^{-95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 4.4 \cdot 10^{-45}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{C \cdot \left(-2 \cdot \frac{A}{C \cdot B} + 2 \cdot \frac{1}{B}\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + \left(-1 - \frac{A}{B}\right)\right)}{\pi}\\
\end{array}
\end{array}
if B < 1.65e-95Initial program 55.3%
Taylor expanded in B around -inf 60.5%
associate--l+60.5%
div-sub65.2%
Simplified65.2%
if 1.65e-95 < B < 4.39999999999999987e-45Initial program 30.8%
*-commutative30.8%
associate--l-30.6%
+-commutative30.6%
unpow230.6%
unpow230.6%
hypot-undefine39.1%
associate--r+63.4%
div-inv63.4%
div-sub29.8%
flip--3.5%
Applied egg-rr3.5%
Taylor expanded in C around -inf 67.7%
Simplified99.6%
Taylor expanded in C around inf 65.9%
if 4.39999999999999987e-45 < B Initial program 57.8%
Taylor expanded in B around inf 84.2%
Final simplification70.6%
(FPCore (A B C)
:precision binary64
(if (<= A -2.7e+124)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 3.7e-33)
(* 180.0 (/ (atan (+ -1.0 (/ C B))) PI))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.7e+124) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 3.7e-33) {
tmp = 180.0 * (atan((-1.0 + (C / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.7e+124) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 3.7e-33) {
tmp = 180.0 * (Math.atan((-1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.7e+124: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 3.7e-33: tmp = 180.0 * (math.atan((-1.0 + (C / B))) / math.pi) else: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.7e+124) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 3.7e-33) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.7e+124) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 3.7e-33) tmp = 180.0 * (atan((-1.0 + (C / B))) / pi); else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.7e+124], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.7e-33], N[(180.0 * N[(N[ArcTan[N[(-1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.7 \cdot 10^{+124}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 3.7 \cdot 10^{-33}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.69999999999999978e124Initial program 11.4%
Taylor expanded in A around -inf 81.0%
associate-*r/81.0%
Simplified81.0%
if -2.69999999999999978e124 < A < 3.70000000000000014e-33Initial program 53.5%
unpow253.5%
unpow253.5%
hypot-define78.8%
Applied egg-rr78.8%
Taylor expanded in A around 0 51.5%
+-commutative51.5%
unpow251.5%
unpow251.5%
hypot-define76.7%
Simplified76.7%
Taylor expanded in B around inf 53.1%
if 3.70000000000000014e-33 < A Initial program 74.4%
Taylor expanded in B around -inf 75.6%
associate--l+75.6%
div-sub79.3%
Simplified79.3%
Taylor expanded in C around 0 79.5%
Final simplification65.2%
(FPCore (A B C)
:precision binary64
(if (<= C -1e-160)
(* 180.0 (/ (atan (+ -1.0 (/ C B))) PI))
(if (<= C 1e+63)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1e-160) {
tmp = 180.0 * (atan((-1.0 + (C / B))) / ((double) M_PI));
} else if (C <= 1e+63) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1e-160) {
tmp = 180.0 * (Math.atan((-1.0 + (C / B))) / Math.PI);
} else if (C <= 1e+63) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1e-160: tmp = 180.0 * (math.atan((-1.0 + (C / B))) / math.pi) elif C <= 1e+63: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1e-160) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 + Float64(C / B))) / pi)); elseif (C <= 1e+63) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1e-160) tmp = 180.0 * (atan((-1.0 + (C / B))) / pi); elseif (C <= 1e+63) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1e-160], N[(180.0 * N[(N[ArcTan[N[(-1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1e+63], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1 \cdot 10^{-160}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 10^{+63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -9.9999999999999999e-161Initial program 79.4%
unpow279.4%
unpow279.4%
hypot-define95.8%
Applied egg-rr95.8%
Taylor expanded in A around 0 74.5%
+-commutative74.5%
unpow274.5%
unpow274.5%
hypot-define88.8%
Simplified88.8%
Taylor expanded in B around inf 79.5%
if -9.9999999999999999e-161 < C < 1.00000000000000006e63Initial program 49.9%
Taylor expanded in B around -inf 51.0%
associate--l+51.0%
div-sub51.0%
Simplified51.0%
Taylor expanded in C around 0 49.8%
if 1.00000000000000006e63 < C Initial program 25.6%
*-commutative25.6%
associate--l-25.5%
+-commutative25.5%
unpow225.5%
unpow225.5%
hypot-undefine56.8%
associate--r+60.2%
div-inv60.2%
div-sub37.8%
flip--22.9%
Applied egg-rr22.9%
Taylor expanded in C around inf 66.4%
Final simplification64.1%
(FPCore (A B C)
:precision binary64
(if (<= C -8e-58)
(* 180.0 (/ (atan (+ (/ C B) 1.0)) PI))
(if (<= C 6.3e+62)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -8e-58) {
tmp = 180.0 * (atan(((C / B) + 1.0)) / ((double) M_PI));
} else if (C <= 6.3e+62) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -8e-58) {
tmp = 180.0 * (Math.atan(((C / B) + 1.0)) / Math.PI);
} else if (C <= 6.3e+62) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -8e-58: tmp = 180.0 * (math.atan(((C / B) + 1.0)) / math.pi) elif C <= 6.3e+62: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -8e-58) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) + 1.0)) / pi)); elseif (C <= 6.3e+62) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -8e-58) tmp = 180.0 * (atan(((C / B) + 1.0)) / pi); elseif (C <= 6.3e+62) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -8e-58], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.3e+62], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -8 \cdot 10^{-58}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.3 \cdot 10^{+62}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -8.0000000000000002e-58Initial program 78.6%
Taylor expanded in B around -inf 69.0%
associate--l+69.0%
div-sub75.9%
Simplified75.9%
Taylor expanded in A around 0 74.6%
if -8.0000000000000002e-58 < C < 6.29999999999999998e62Initial program 54.8%
Taylor expanded in B around -inf 51.3%
associate--l+51.3%
div-sub51.3%
Simplified51.3%
Taylor expanded in C around 0 49.5%
if 6.29999999999999998e62 < C Initial program 25.6%
*-commutative25.6%
associate--l-25.5%
+-commutative25.5%
unpow225.5%
unpow225.5%
hypot-undefine56.8%
associate--r+60.2%
div-inv60.2%
div-sub37.8%
flip--22.9%
Applied egg-rr22.9%
Taylor expanded in C around inf 66.4%
Final simplification60.4%
(FPCore (A B C)
:precision binary64
(if (<= C -1.08e-58)
(/ (* 180.0 (atan (/ C B))) PI)
(if (<= C -5e-310)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1.08e-58) {
tmp = (180.0 * atan((C / B))) / ((double) M_PI);
} else if (C <= -5e-310) {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1.08e-58) {
tmp = (180.0 * Math.atan((C / B))) / Math.PI;
} else if (C <= -5e-310) {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1.08e-58: tmp = (180.0 * math.atan((C / B))) / math.pi elif C <= -5e-310: tmp = 180.0 * (math.atan((-A / B)) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1.08e-58) tmp = Float64(Float64(180.0 * atan(Float64(C / B))) / pi); elseif (C <= -5e-310) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1.08e-58) tmp = (180.0 * atan((C / B))) / pi; elseif (C <= -5e-310) tmp = 180.0 * (atan((-A / B)) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1.08e-58], N[(N[(180.0 * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, -5e-310], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.08 \cdot 10^{-58}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -5 \cdot 10^{-310}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.08e-58Initial program 77.8%
Taylor expanded in B around -inf 69.4%
associate--l+69.4%
div-sub76.3%
Simplified76.3%
Taylor expanded in C around inf 69.4%
associate-*r/69.4%
Applied egg-rr69.4%
if -1.08e-58 < C < -4.999999999999985e-310Initial program 66.5%
Taylor expanded in B around -inf 56.7%
associate--l+56.7%
div-sub56.7%
Simplified56.7%
Taylor expanded in A around inf 36.2%
associate-*r/36.2%
mul-1-neg36.2%
Simplified36.2%
if -4.999999999999985e-310 < C Initial program 37.9%
*-commutative37.9%
associate--l-37.8%
+-commutative37.8%
unpow237.8%
unpow237.8%
hypot-undefine64.5%
associate--r+70.5%
div-inv70.5%
div-sub56.1%
flip--36.5%
Applied egg-rr36.5%
Taylor expanded in C around inf 49.6%
(FPCore (A B C) :precision binary64 (if (<= B 4e-95) (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)) (* 180.0 (/ (atan (+ (/ C B) (- -1.0 (/ A B)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 4e-95) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 4e-95) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C / B) + (-1.0 - (A / B)))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 4e-95: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) else: tmp = 180.0 * (math.atan(((C / B) + (-1.0 - (A / B)))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 4e-95) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) + Float64(-1.0 - Float64(A / B)))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 4e-95) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); else tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 4e-95], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4 \cdot 10^{-95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + \left(-1 - \frac{A}{B}\right)\right)}{\pi}\\
\end{array}
\end{array}
if B < 3.99999999999999996e-95Initial program 55.0%
Taylor expanded in B around -inf 60.2%
associate--l+60.2%
div-sub64.8%
Simplified64.8%
if 3.99999999999999996e-95 < B Initial program 54.6%
Taylor expanded in B around inf 77.0%
Final simplification68.8%
(FPCore (A B C)
:precision binary64
(if (<= B -185.0)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.2e-72)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -185.0) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.2e-72) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -185.0) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.2e-72) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -185.0: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.2e-72: tmp = 180.0 * (math.atan((C / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -185.0) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.2e-72) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -185.0) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.2e-72) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -185.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.2e-72], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -185:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.2 \cdot 10^{-72}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -185Initial program 40.6%
Taylor expanded in B around -inf 55.1%
if -185 < B < 2.20000000000000002e-72Initial program 63.0%
Taylor expanded in B around -inf 52.8%
associate--l+52.8%
div-sub59.8%
Simplified59.8%
Taylor expanded in C around inf 37.9%
if 2.20000000000000002e-72 < B Initial program 54.7%
Taylor expanded in B around inf 60.7%
(FPCore (A B C)
:precision binary64
(if (<= B -7e-237)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4.4e-45)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7e-237) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4.4e-45) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -7e-237) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4.4e-45) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -7e-237: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4.4e-45: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -7e-237) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4.4e-45) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -7e-237) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4.4e-45) tmp = 180.0 * (atan((0.0 / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -7e-237], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.4e-45], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -7 \cdot 10^{-237}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4.4 \cdot 10^{-45}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -6.99999999999999966e-237Initial program 52.3%
Taylor expanded in B around -inf 40.0%
if -6.99999999999999966e-237 < B < 4.39999999999999987e-45Initial program 56.0%
Taylor expanded in C around inf 28.2%
associate-*r/28.2%
mul-1-neg28.2%
distribute-rgt1-in28.2%
metadata-eval28.2%
mul0-lft28.2%
metadata-eval28.2%
Simplified28.2%
if 4.39999999999999987e-45 < B Initial program 57.8%
Taylor expanded in B around inf 64.5%
(FPCore (A B C) :precision binary64 (if (<= B 2.8e-72) (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)) (* 180.0 (/ (atan (+ -1.0 (/ C B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 2.8e-72) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 + (C / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 2.8e-72) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 + (C / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 2.8e-72: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 + (C / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 2.8e-72) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 + Float64(C / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 2.8e-72) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); else tmp = 180.0 * (atan((-1.0 + (C / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 2.8e-72], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.8 \cdot 10^{-72}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 + \frac{C}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < 2.7999999999999998e-72Initial program 54.9%
Taylor expanded in B around -inf 59.9%
associate--l+59.9%
div-sub64.4%
Simplified64.4%
if 2.7999999999999998e-72 < B Initial program 54.7%
unpow254.7%
unpow254.7%
hypot-define87.6%
Applied egg-rr87.6%
Taylor expanded in A around 0 49.5%
+-commutative49.5%
unpow249.5%
unpow249.5%
hypot-define76.7%
Simplified76.7%
Taylor expanded in B around inf 70.6%
Final simplification66.3%
(FPCore (A B C) :precision binary64 (if (<= C 1e-305) (* 180.0 (/ (atan (+ (/ C B) 1.0)) PI)) (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 1e-305) {
tmp = 180.0 * (atan(((C / B) + 1.0)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 1e-305) {
tmp = 180.0 * (Math.atan(((C / B) + 1.0)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 1e-305: tmp = 180.0 * (math.atan(((C / B) + 1.0)) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 1e-305) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) + 1.0)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 1e-305) tmp = 180.0 * (atan(((C / B) + 1.0)) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 1e-305], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 10^{-305}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + 1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 9.99999999999999996e-306Initial program 72.2%
Taylor expanded in B around -inf 63.3%
associate--l+63.3%
div-sub67.3%
Simplified67.3%
Taylor expanded in A around 0 58.9%
if 9.99999999999999996e-306 < C Initial program 38.4%
*-commutative38.4%
associate--l-38.3%
+-commutative38.3%
unpow238.3%
unpow238.3%
hypot-undefine65.4%
associate--r+70.7%
div-inv70.7%
div-sub57.0%
flip--37.1%
Applied egg-rr37.1%
Taylor expanded in C around inf 50.3%
Final simplification54.5%
(FPCore (A B C) :precision binary64 (if (<= B -1e-310) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1e-310) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1e-310) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1e-310: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1e-310) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1e-310) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1e-310], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1 \cdot 10^{-310}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -9.999999999999969e-311Initial program 53.7%
Taylor expanded in B around -inf 36.0%
if -9.999999999999969e-311 < B Initial program 56.0%
Taylor expanded in B around inf 42.9%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 54.9%
Taylor expanded in B around inf 22.0%
herbie shell --seed 2024137
(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)))