
(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 16 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
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(if (or (<= t_0 -1e-47) (not (<= t_0 0.0)))
(/ (* 180.0 (atan (/ (- (- C A) (hypot (- A C) B)) B))) PI)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI)))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double tmp;
if ((t_0 <= -1e-47) || !(t_0 <= 0.0)) {
tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double tmp;
if ((t_0 <= -1e-47) || !(t_0 <= 0.0)) {
tmp = (180.0 * Math.atan((((C - A) - Math.hypot((A - C), B)) / B))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) tmp = 0 if (t_0 <= -1e-47) or not (t_0 <= 0.0): tmp = (180.0 * math.atan((((C - A) - math.hypot((A - C), B)) / B))) / math.pi else: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) tmp = 0.0 if ((t_0 <= -1e-47) || !(t_0 <= 0.0)) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / B))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); tmp = 0.0; if ((t_0 <= -1e-47) || ~((t_0 <= 0.0))) tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / pi; else tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = 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]}, If[Or[LessEqual[t$95$0, -1e-47], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-47} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -9.9999999999999997e-48 or 0.0 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) Initial program 57.1%
associate-*r/57.1%
Applied egg-rr85.7%
if -9.9999999999999997e-48 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < 0.0Initial program 12.6%
associate--l-6.5%
Simplified6.5%
Taylor expanded in A around -inf 59.3%
associate-*r/59.3%
Simplified59.3%
Final simplification81.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (* B 0.5) A)) PI)))
(t_1 (- C (hypot B C)))
(t_2 (atan (/ t_1 B))))
(if (<= A -4.8e+213)
t_0
(if (<= A -1.5e+158)
(/ (* 180.0 t_2) PI)
(if (<= A -6.5e+48)
t_0
(if (<= A 3e+34)
(* 180.0 (/ t_2 PI))
(/ (* 180.0 (atan (/ (- t_1 A) B))) PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
double t_1 = C - hypot(B, C);
double t_2 = atan((t_1 / B));
double tmp;
if (A <= -4.8e+213) {
tmp = t_0;
} else if (A <= -1.5e+158) {
tmp = (180.0 * t_2) / ((double) M_PI);
} else if (A <= -6.5e+48) {
tmp = t_0;
} else if (A <= 3e+34) {
tmp = 180.0 * (t_2 / ((double) M_PI));
} else {
tmp = (180.0 * atan(((t_1 - A) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
double t_1 = C - Math.hypot(B, C);
double t_2 = Math.atan((t_1 / B));
double tmp;
if (A <= -4.8e+213) {
tmp = t_0;
} else if (A <= -1.5e+158) {
tmp = (180.0 * t_2) / Math.PI;
} else if (A <= -6.5e+48) {
tmp = t_0;
} else if (A <= 3e+34) {
tmp = 180.0 * (t_2 / Math.PI);
} else {
tmp = (180.0 * Math.atan(((t_1 - A) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) t_1 = C - math.hypot(B, C) t_2 = math.atan((t_1 / B)) tmp = 0 if A <= -4.8e+213: tmp = t_0 elif A <= -1.5e+158: tmp = (180.0 * t_2) / math.pi elif A <= -6.5e+48: tmp = t_0 elif A <= 3e+34: tmp = 180.0 * (t_2 / math.pi) else: tmp = (180.0 * math.atan(((t_1 - A) / B))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)) t_1 = Float64(C - hypot(B, C)) t_2 = atan(Float64(t_1 / B)) tmp = 0.0 if (A <= -4.8e+213) tmp = t_0; elseif (A <= -1.5e+158) tmp = Float64(Float64(180.0 * t_2) / pi); elseif (A <= -6.5e+48) tmp = t_0; elseif (A <= 3e+34) tmp = Float64(180.0 * Float64(t_2 / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(t_1 - A) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((B * 0.5) / A)) / pi); t_1 = C - hypot(B, C); t_2 = atan((t_1 / B)); tmp = 0.0; if (A <= -4.8e+213) tmp = t_0; elseif (A <= -1.5e+158) tmp = (180.0 * t_2) / pi; elseif (A <= -6.5e+48) tmp = t_0; elseif (A <= 3e+34) tmp = 180.0 * (t_2 / pi); else tmp = (180.0 * atan(((t_1 - A) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(t$95$1 / B), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[A, -4.8e+213], t$95$0, If[LessEqual[A, -1.5e+158], N[(N[(180.0 * t$95$2), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -6.5e+48], t$95$0, If[LessEqual[A, 3e+34], N[(180.0 * N[(t$95$2 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(t$95$1 - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
t_1 := C - \mathsf{hypot}\left(B, C\right)\\
t_2 := \tan^{-1} \left(\frac{t\_1}{B}\right)\\
\mathbf{if}\;A \leq -4.8 \cdot 10^{+213}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -1.5 \cdot 10^{+158}:\\
\;\;\;\;\frac{180 \cdot t\_2}{\pi}\\
\mathbf{elif}\;A \leq -6.5 \cdot 10^{+48}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq 3 \cdot 10^{+34}:\\
\;\;\;\;180 \cdot \frac{t\_2}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{t\_1 - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.8e213 or -1.5e158 < A < -6.49999999999999972e48Initial program 19.6%
associate--l-15.2%
Simplified15.2%
Taylor expanded in A around -inf 73.7%
associate-*r/73.7%
Simplified73.7%
if -4.8e213 < A < -1.5e158Initial program 32.5%
associate-*r/32.5%
Applied egg-rr81.7%
Taylor expanded in A around 0 41.5%
unpow241.5%
unpow241.5%
hypot-def72.1%
Simplified72.1%
if -6.49999999999999972e48 < A < 3.00000000000000018e34Initial program 53.9%
associate--l-53.9%
Simplified53.9%
Taylor expanded in A around 0 51.7%
unpow251.7%
unpow251.7%
hypot-def77.5%
Simplified77.5%
if 3.00000000000000018e34 < A Initial program 79.5%
associate-*r/79.5%
Applied egg-rr92.9%
Taylor expanded in C around -inf 87.5%
Simplified87.5%
Taylor expanded in A around 0 78.6%
unpow278.6%
unpow278.6%
hypot-def86.2%
Simplified86.2%
Final simplification78.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (atan (/ (- C (hypot B C)) B)))
(t_1 (* 180.0 (/ (atan (/ (* B 0.5) A)) PI))))
(if (<= A -6.5e+212)
t_1
(if (<= A -1.55e+158)
(/ (* 180.0 t_0) PI)
(if (<= A -5.6e+48)
t_1
(if (<= A 2e+35)
(* 180.0 (/ t_0 PI))
(* 180.0 (/ (atan (/ (- (- A) (hypot B A)) B)) PI))))))))
double code(double A, double B, double C) {
double t_0 = atan(((C - hypot(B, C)) / B));
double t_1 = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
double tmp;
if (A <= -6.5e+212) {
tmp = t_1;
} else if (A <= -1.55e+158) {
tmp = (180.0 * t_0) / ((double) M_PI);
} else if (A <= -5.6e+48) {
tmp = t_1;
} else if (A <= 2e+35) {
tmp = 180.0 * (t_0 / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-A - hypot(B, A)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = Math.atan(((C - Math.hypot(B, C)) / B));
double t_1 = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
double tmp;
if (A <= -6.5e+212) {
tmp = t_1;
} else if (A <= -1.55e+158) {
tmp = (180.0 * t_0) / Math.PI;
} else if (A <= -5.6e+48) {
tmp = t_1;
} else if (A <= 2e+35) {
tmp = 180.0 * (t_0 / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-A - Math.hypot(B, A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = math.atan(((C - math.hypot(B, C)) / B)) t_1 = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) tmp = 0 if A <= -6.5e+212: tmp = t_1 elif A <= -1.55e+158: tmp = (180.0 * t_0) / math.pi elif A <= -5.6e+48: tmp = t_1 elif A <= 2e+35: tmp = 180.0 * (t_0 / math.pi) else: tmp = 180.0 * (math.atan(((-A - math.hypot(B, A)) / B)) / math.pi) return tmp
function code(A, B, C) t_0 = atan(Float64(Float64(C - hypot(B, C)) / B)) t_1 = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)) tmp = 0.0 if (A <= -6.5e+212) tmp = t_1; elseif (A <= -1.55e+158) tmp = Float64(Float64(180.0 * t_0) / pi); elseif (A <= -5.6e+48) tmp = t_1; elseif (A <= 2e+35) tmp = Float64(180.0 * Float64(t_0 / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - hypot(B, A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = atan(((C - hypot(B, C)) / B)); t_1 = 180.0 * (atan(((B * 0.5) / A)) / pi); tmp = 0.0; if (A <= -6.5e+212) tmp = t_1; elseif (A <= -1.55e+158) tmp = (180.0 * t_0) / pi; elseif (A <= -5.6e+48) tmp = t_1; elseif (A <= 2e+35) tmp = 180.0 * (t_0 / pi); else tmp = 180.0 * (atan(((-A - hypot(B, A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -6.5e+212], t$95$1, If[LessEqual[A, -1.55e+158], N[(N[(180.0 * t$95$0), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -5.6e+48], t$95$1, If[LessEqual[A, 2e+35], N[(180.0 * N[(t$95$0 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[((-A) - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -6.5 \cdot 10^{+212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -1.55 \cdot 10^{+158}:\\
\;\;\;\;\frac{180 \cdot t\_0}{\pi}\\
\mathbf{elif}\;A \leq -5.6 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq 2 \cdot 10^{+35}:\\
\;\;\;\;180 \cdot \frac{t\_0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(B, A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -6.49999999999999997e212 or -1.5500000000000001e158 < A < -5.60000000000000025e48Initial program 19.6%
associate--l-15.2%
Simplified15.2%
Taylor expanded in A around -inf 73.7%
associate-*r/73.7%
Simplified73.7%
if -6.49999999999999997e212 < A < -1.5500000000000001e158Initial program 32.5%
associate-*r/32.5%
Applied egg-rr81.7%
Taylor expanded in A around 0 41.5%
unpow241.5%
unpow241.5%
hypot-def72.1%
Simplified72.1%
if -5.60000000000000025e48 < A < 1.9999999999999999e35Initial program 53.9%
associate--l-53.9%
Simplified53.9%
Taylor expanded in A around 0 51.7%
unpow251.7%
unpow251.7%
hypot-def77.5%
Simplified77.5%
if 1.9999999999999999e35 < A Initial program 79.5%
associate--l-79.5%
Simplified79.5%
Taylor expanded in C around 0 79.5%
associate-*r/79.5%
mul-1-neg79.5%
+-commutative79.5%
unpow279.5%
unpow279.5%
hypot-def86.1%
Simplified86.1%
Final simplification78.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI)))
(t_1 (* 180.0 (/ (atan (/ (* B 0.5) A)) PI))))
(if (<= A -6.5e+212)
t_1
(if (<= A -8e+157)
t_0
(if (<= A -1.5e+45)
t_1
(if (<= A 8e+38) t_0 (/ (* 180.0 (atan (/ (- (- C B) A) B))) PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
double tmp;
if (A <= -6.5e+212) {
tmp = t_1;
} else if (A <= -8e+157) {
tmp = t_0;
} else if (A <= -1.5e+45) {
tmp = t_1;
} else if (A <= 8e+38) {
tmp = t_0;
} else {
tmp = (180.0 * atan((((C - B) - A) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
double tmp;
if (A <= -6.5e+212) {
tmp = t_1;
} else if (A <= -8e+157) {
tmp = t_0;
} else if (A <= -1.5e+45) {
tmp = t_1;
} else if (A <= 8e+38) {
tmp = t_0;
} else {
tmp = (180.0 * Math.atan((((C - B) - A) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) t_1 = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) tmp = 0 if A <= -6.5e+212: tmp = t_1 elif A <= -8e+157: tmp = t_0 elif A <= -1.5e+45: tmp = t_1 elif A <= 8e+38: tmp = t_0 else: tmp = (180.0 * math.atan((((C - B) - A) / B))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)) tmp = 0.0 if (A <= -6.5e+212) tmp = t_1; elseif (A <= -8e+157) tmp = t_0; elseif (A <= -1.5e+45) tmp = t_1; elseif (A <= 8e+38) tmp = t_0; else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - B) - A) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); t_1 = 180.0 * (atan(((B * 0.5) / A)) / pi); tmp = 0.0; if (A <= -6.5e+212) tmp = t_1; elseif (A <= -8e+157) tmp = t_0; elseif (A <= -1.5e+45) tmp = t_1; elseif (A <= 8e+38) tmp = t_0; else tmp = (180.0 * atan((((C - B) - A) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -6.5e+212], t$95$1, If[LessEqual[A, -8e+157], t$95$0, If[LessEqual[A, -1.5e+45], t$95$1, If[LessEqual[A, 8e+38], t$95$0, N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -6.5 \cdot 10^{+212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -8 \cdot 10^{+157}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -1.5 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq 8 \cdot 10^{+38}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -6.49999999999999997e212 or -7.99999999999999987e157 < A < -1.50000000000000005e45Initial program 19.6%
associate--l-15.2%
Simplified15.2%
Taylor expanded in A around -inf 73.7%
associate-*r/73.7%
Simplified73.7%
if -6.49999999999999997e212 < A < -7.99999999999999987e157 or -1.50000000000000005e45 < A < 7.99999999999999982e38Initial program 51.1%
associate--l-51.0%
Simplified51.0%
Taylor expanded in A around 0 50.6%
unpow250.6%
unpow250.6%
hypot-def76.9%
Simplified76.9%
if 7.99999999999999982e38 < A Initial program 79.1%
associate-*r/79.1%
Applied egg-rr92.8%
Taylor expanded in B around inf 81.0%
neg-mul-181.0%
unsub-neg81.0%
Simplified81.0%
Final simplification77.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (atan (/ (- C (hypot B C)) B)))
(t_1 (* 180.0 (/ (atan (/ (* B 0.5) A)) PI))))
(if (<= A -6.5e+212)
t_1
(if (<= A -1.6e+158)
(/ (* 180.0 t_0) PI)
(if (<= A -1.25e+46)
t_1
(if (<= A 1.25e+39)
(* 180.0 (/ t_0 PI))
(/ (* 180.0 (atan (/ (- (- C B) A) B))) PI)))))))
double code(double A, double B, double C) {
double t_0 = atan(((C - hypot(B, C)) / B));
double t_1 = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
double tmp;
if (A <= -6.5e+212) {
tmp = t_1;
} else if (A <= -1.6e+158) {
tmp = (180.0 * t_0) / ((double) M_PI);
} else if (A <= -1.25e+46) {
tmp = t_1;
} else if (A <= 1.25e+39) {
tmp = 180.0 * (t_0 / ((double) M_PI));
} else {
tmp = (180.0 * atan((((C - B) - A) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = Math.atan(((C - Math.hypot(B, C)) / B));
double t_1 = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
double tmp;
if (A <= -6.5e+212) {
tmp = t_1;
} else if (A <= -1.6e+158) {
tmp = (180.0 * t_0) / Math.PI;
} else if (A <= -1.25e+46) {
tmp = t_1;
} else if (A <= 1.25e+39) {
tmp = 180.0 * (t_0 / Math.PI);
} else {
tmp = (180.0 * Math.atan((((C - B) - A) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = math.atan(((C - math.hypot(B, C)) / B)) t_1 = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) tmp = 0 if A <= -6.5e+212: tmp = t_1 elif A <= -1.6e+158: tmp = (180.0 * t_0) / math.pi elif A <= -1.25e+46: tmp = t_1 elif A <= 1.25e+39: tmp = 180.0 * (t_0 / math.pi) else: tmp = (180.0 * math.atan((((C - B) - A) / B))) / math.pi return tmp
function code(A, B, C) t_0 = atan(Float64(Float64(C - hypot(B, C)) / B)) t_1 = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)) tmp = 0.0 if (A <= -6.5e+212) tmp = t_1; elseif (A <= -1.6e+158) tmp = Float64(Float64(180.0 * t_0) / pi); elseif (A <= -1.25e+46) tmp = t_1; elseif (A <= 1.25e+39) tmp = Float64(180.0 * Float64(t_0 / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - B) - A) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = atan(((C - hypot(B, C)) / B)); t_1 = 180.0 * (atan(((B * 0.5) / A)) / pi); tmp = 0.0; if (A <= -6.5e+212) tmp = t_1; elseif (A <= -1.6e+158) tmp = (180.0 * t_0) / pi; elseif (A <= -1.25e+46) tmp = t_1; elseif (A <= 1.25e+39) tmp = 180.0 * (t_0 / pi); else tmp = (180.0 * atan((((C - B) - A) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -6.5e+212], t$95$1, If[LessEqual[A, -1.6e+158], N[(N[(180.0 * t$95$0), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -1.25e+46], t$95$1, If[LessEqual[A, 1.25e+39], N[(180.0 * N[(t$95$0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -6.5 \cdot 10^{+212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -1.6 \cdot 10^{+158}:\\
\;\;\;\;\frac{180 \cdot t\_0}{\pi}\\
\mathbf{elif}\;A \leq -1.25 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq 1.25 \cdot 10^{+39}:\\
\;\;\;\;180 \cdot \frac{t\_0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -6.49999999999999997e212 or -1.59999999999999997e158 < A < -1.2500000000000001e46Initial program 19.6%
associate--l-15.2%
Simplified15.2%
Taylor expanded in A around -inf 73.7%
associate-*r/73.7%
Simplified73.7%
if -6.49999999999999997e212 < A < -1.59999999999999997e158Initial program 32.5%
associate-*r/32.5%
Applied egg-rr81.7%
Taylor expanded in A around 0 41.5%
unpow241.5%
unpow241.5%
hypot-def72.1%
Simplified72.1%
if -1.2500000000000001e46 < A < 1.25000000000000004e39Initial program 54.2%
associate--l-54.2%
Simplified54.2%
Taylor expanded in A around 0 52.1%
unpow252.1%
unpow252.1%
hypot-def77.7%
Simplified77.7%
if 1.25000000000000004e39 < A Initial program 79.1%
associate-*r/79.1%
Applied egg-rr92.8%
Taylor expanded in B around inf 81.0%
neg-mul-181.0%
unsub-neg81.0%
Simplified81.0%
Final simplification77.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (* B 0.5) A)) PI))))
(if (<= A -1.35e+217)
t_0
(if (<= A -1.25e+158)
(/ (* 180.0 (atan (/ (- C (hypot B C)) B))) PI)
(if (<= A -2.9e+47)
t_0
(* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
double tmp;
if (A <= -1.35e+217) {
tmp = t_0;
} else if (A <= -1.25e+158) {
tmp = (180.0 * atan(((C - hypot(B, C)) / B))) / ((double) M_PI);
} else if (A <= -2.9e+47) {
tmp = t_0;
} 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 t_0 = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
double tmp;
if (A <= -1.35e+217) {
tmp = t_0;
} else if (A <= -1.25e+158) {
tmp = (180.0 * Math.atan(((C - Math.hypot(B, C)) / B))) / Math.PI;
} else if (A <= -2.9e+47) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) tmp = 0 if A <= -1.35e+217: tmp = t_0 elif A <= -1.25e+158: tmp = (180.0 * math.atan(((C - math.hypot(B, C)) / B))) / math.pi elif A <= -2.9e+47: tmp = t_0 else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)) tmp = 0.0 if (A <= -1.35e+217) tmp = t_0; elseif (A <= -1.25e+158) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - hypot(B, C)) / B))) / pi); elseif (A <= -2.9e+47) tmp = t_0; 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) t_0 = 180.0 * (atan(((B * 0.5) / A)) / pi); tmp = 0.0; if (A <= -1.35e+217) tmp = t_0; elseif (A <= -1.25e+158) tmp = (180.0 * atan(((C - hypot(B, C)) / B))) / pi; elseif (A <= -2.9e+47) tmp = t_0; else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.35e+217], t$95$0, If[LessEqual[A, -1.25e+158], N[(N[(180.0 * N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -2.9e+47], t$95$0, 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}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.35 \cdot 10^{+217}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -1.25 \cdot 10^{+158}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.9 \cdot 10^{+47}:\\
\;\;\;\;t\_0\\
\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 < -1.35000000000000001e217 or -1.2499999999999999e158 < A < -2.8999999999999998e47Initial program 19.6%
associate--l-15.2%
Simplified15.2%
Taylor expanded in A around -inf 73.7%
associate-*r/73.7%
Simplified73.7%
if -1.35000000000000001e217 < A < -1.2499999999999999e158Initial program 32.5%
associate-*r/32.5%
Applied egg-rr81.7%
Taylor expanded in A around 0 41.5%
unpow241.5%
unpow241.5%
hypot-def72.1%
Simplified72.1%
if -2.8999999999999998e47 < A Initial program 61.5%
Simplified83.5%
Final simplification80.5%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (* B 0.5) A)) PI))))
(if (<= A -4e+214)
t_0
(if (<= A -1.6e+158)
(/ (* 180.0 (atan (/ (- C (hypot B C)) B))) PI)
(if (<= A -9e+46)
t_0
(* (/ 180.0 PI) (atan (/ (- C (+ A (hypot B (- A C)))) B))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
double tmp;
if (A <= -4e+214) {
tmp = t_0;
} else if (A <= -1.6e+158) {
tmp = (180.0 * atan(((C - hypot(B, C)) / B))) / ((double) M_PI);
} else if (A <= -9e+46) {
tmp = t_0;
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((C - (A + hypot(B, (A - C)))) / B));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
double tmp;
if (A <= -4e+214) {
tmp = t_0;
} else if (A <= -1.6e+158) {
tmp = (180.0 * Math.atan(((C - Math.hypot(B, C)) / B))) / Math.PI;
} else if (A <= -9e+46) {
tmp = t_0;
} else {
tmp = (180.0 / Math.PI) * Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B));
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) tmp = 0 if A <= -4e+214: tmp = t_0 elif A <= -1.6e+158: tmp = (180.0 * math.atan(((C - math.hypot(B, C)) / B))) / math.pi elif A <= -9e+46: tmp = t_0 else: tmp = (180.0 / math.pi) * math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)) tmp = 0.0 if (A <= -4e+214) tmp = t_0; elseif (A <= -1.6e+158) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - hypot(B, C)) / B))) / pi); elseif (A <= -9e+46) tmp = t_0; else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B))); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((B * 0.5) / A)) / pi); tmp = 0.0; if (A <= -4e+214) tmp = t_0; elseif (A <= -1.6e+158) tmp = (180.0 * atan(((C - hypot(B, C)) / B))) / pi; elseif (A <= -9e+46) tmp = t_0; else tmp = (180.0 / pi) * atan(((C - (A + hypot(B, (A - C)))) / B)); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -4e+214], t$95$0, If[LessEqual[A, -1.6e+158], N[(N[(180.0 * N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -9e+46], t$95$0, N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -4 \cdot 10^{+214}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -1.6 \cdot 10^{+158}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -9 \cdot 10^{+46}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)\\
\end{array}
\end{array}
if A < -3.9999999999999998e214 or -1.59999999999999997e158 < A < -9.00000000000000019e46Initial program 19.6%
associate--l-15.2%
Simplified15.2%
Taylor expanded in A around -inf 73.7%
associate-*r/73.7%
Simplified73.7%
if -3.9999999999999998e214 < A < -1.59999999999999997e158Initial program 32.5%
associate-*r/32.5%
Applied egg-rr81.7%
Taylor expanded in A around 0 41.5%
unpow241.5%
unpow241.5%
hypot-def72.1%
Simplified72.1%
if -9.00000000000000019e46 < A Initial program 61.5%
Taylor expanded in B around 0 61.5%
Simplified83.5%
Final simplification80.5%
(FPCore (A B C)
:precision binary64
(if (<= B -4.5e+19)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -4e-281)
(* 180.0 (/ (- (atan (/ A B))) PI))
(if (<= B 2.7e-93)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 2e+93)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(* 180.0 (/ (atan -1.0) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.5e+19) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -4e-281) {
tmp = 180.0 * (-atan((A / B)) / ((double) M_PI));
} else if (B <= 2.7e-93) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 2e+93) {
tmp = 180.0 * (atan((2.0 * (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 <= -4.5e+19) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -4e-281) {
tmp = 180.0 * (-Math.atan((A / B)) / Math.PI);
} else if (B <= 2.7e-93) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 2e+93) {
tmp = 180.0 * (Math.atan((2.0 * (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 <= -4.5e+19: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -4e-281: tmp = 180.0 * (-math.atan((A / B)) / math.pi) elif B <= 2.7e-93: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 2e+93: tmp = 180.0 * (math.atan((2.0 * (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 <= -4.5e+19) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -4e-281) tmp = Float64(180.0 * Float64(Float64(-atan(Float64(A / B))) / pi)); elseif (B <= 2.7e-93) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 2e+93) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * 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 <= -4.5e+19) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -4e-281) tmp = 180.0 * (-atan((A / B)) / pi); elseif (B <= 2.7e-93) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 2e+93) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.5e+19], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -4e-281], N[(180.0 * N[((-N[ArcTan[N[(A / B), $MachinePrecision]], $MachinePrecision]) / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.7e-93], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2e+93], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $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 -4.5 \cdot 10^{+19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -4 \cdot 10^{-281}:\\
\;\;\;\;180 \cdot \frac{-\tan^{-1} \left(\frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.7 \cdot 10^{-93}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2 \cdot 10^{+93}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.5e19Initial program 46.6%
associate--l-46.6%
Simplified46.6%
Taylor expanded in B around -inf 65.7%
if -4.5e19 < B < -4.0000000000000001e-281Initial program 60.0%
add-sqr-sqrt59.7%
pow259.7%
unpow259.7%
unpow259.7%
hypot-def71.3%
Applied egg-rr71.3%
Taylor expanded in A around inf 40.1%
mul-1-neg40.1%
Simplified40.1%
distribute-rgt-neg-out40.1%
atan-neg40.1%
add-sqr-sqrt39.0%
sqrt-unprod47.2%
sqr-neg47.2%
sqrt-unprod9.2%
add-sqr-sqrt10.2%
associate-*l/10.2%
*-un-lft-identity10.2%
add-sqr-sqrt9.2%
sqrt-unprod47.2%
sqr-neg47.2%
sqrt-unprod39.0%
add-sqr-sqrt40.1%
Applied egg-rr40.1%
if -4.0000000000000001e-281 < B < 2.7000000000000001e-93Initial program 45.6%
associate--l-41.1%
Simplified41.1%
Taylor expanded in C around inf 35.6%
associate-*r/35.6%
distribute-rgt1-in35.6%
metadata-eval35.6%
mul0-lft35.6%
metadata-eval35.6%
Simplified35.6%
if 2.7000000000000001e-93 < B < 2.00000000000000009e93Initial program 56.9%
associate--l-56.9%
Simplified56.9%
Taylor expanded in C around -inf 36.6%
if 2.00000000000000009e93 < B Initial program 44.7%
associate--l-44.7%
Simplified44.7%
Taylor expanded in B around inf 62.6%
Final simplification49.6%
(FPCore (A B C)
:precision binary64
(if (<= B -5.2e+19)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -6.5e-283)
(* 180.0 (/ (- (atan (/ A B))) PI))
(if (<= B 2.5e-98)
(* 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 <= -5.2e+19) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -6.5e-283) {
tmp = 180.0 * (-atan((A / B)) / ((double) M_PI));
} else if (B <= 2.5e-98) {
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 <= -5.2e+19) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -6.5e-283) {
tmp = 180.0 * (-Math.atan((A / B)) / Math.PI);
} else if (B <= 2.5e-98) {
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 <= -5.2e+19: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -6.5e-283: tmp = 180.0 * (-math.atan((A / B)) / math.pi) elif B <= 2.5e-98: 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 <= -5.2e+19) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -6.5e-283) tmp = Float64(180.0 * Float64(Float64(-atan(Float64(A / B))) / pi)); elseif (B <= 2.5e-98) 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 <= -5.2e+19) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -6.5e-283) tmp = 180.0 * (-atan((A / B)) / pi); elseif (B <= 2.5e-98) 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, -5.2e+19], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -6.5e-283], N[(180.0 * N[((-N[ArcTan[N[(A / B), $MachinePrecision]], $MachinePrecision]) / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.5e-98], 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 -5.2 \cdot 10^{+19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -6.5 \cdot 10^{-283}:\\
\;\;\;\;180 \cdot \frac{-\tan^{-1} \left(\frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.5 \cdot 10^{-98}:\\
\;\;\;\;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 < -5.2e19Initial program 46.6%
associate--l-46.6%
Simplified46.6%
Taylor expanded in B around -inf 65.7%
if -5.2e19 < B < -6.50000000000000031e-283Initial program 60.0%
add-sqr-sqrt59.7%
pow259.7%
unpow259.7%
unpow259.7%
hypot-def71.3%
Applied egg-rr71.3%
Taylor expanded in A around inf 40.1%
mul-1-neg40.1%
Simplified40.1%
distribute-rgt-neg-out40.1%
atan-neg40.1%
add-sqr-sqrt39.0%
sqrt-unprod47.2%
sqr-neg47.2%
sqrt-unprod9.2%
add-sqr-sqrt10.2%
associate-*l/10.2%
*-un-lft-identity10.2%
add-sqr-sqrt9.2%
sqrt-unprod47.2%
sqr-neg47.2%
sqrt-unprod39.0%
add-sqr-sqrt40.1%
Applied egg-rr40.1%
if -6.50000000000000031e-283 < B < 2.50000000000000009e-98Initial program 45.6%
associate--l-41.1%
Simplified41.1%
Taylor expanded in C around inf 35.6%
associate-*r/35.6%
distribute-rgt1-in35.6%
metadata-eval35.6%
mul0-lft35.6%
metadata-eval35.6%
Simplified35.6%
if 2.50000000000000009e-98 < B Initial program 50.4%
associate--l-50.4%
Simplified50.4%
Taylor expanded in B around inf 44.1%
Final simplification47.6%
(FPCore (A B C)
:precision binary64
(if (<= A -2.2e+44)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 4.1e-16)
(* 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.2e+44) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 4.1e-16) {
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.2e+44) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 4.1e-16) {
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.2e+44: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 4.1e-16: 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.2e+44) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 4.1e-16) 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.2e+44) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 4.1e-16) 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.2e+44], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.1e-16], 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.2 \cdot 10^{+44}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 4.1 \cdot 10^{-16}:\\
\;\;\;\;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.19999999999999996e44Initial program 23.4%
associate--l-20.3%
Simplified20.3%
Taylor expanded in A around -inf 63.2%
associate-*r/63.2%
Simplified63.2%
if -2.19999999999999996e44 < A < 4.10000000000000006e-16Initial program 55.7%
associate--l-55.6%
Simplified55.6%
Taylor expanded in B around -inf 57.8%
associate--l+57.8%
div-sub57.8%
Simplified57.8%
Taylor expanded in C around inf 56.3%
if 4.10000000000000006e-16 < A Initial program 72.5%
associate--l-72.5%
Simplified72.5%
Taylor expanded in C around 0 72.5%
associate-*r/72.5%
mul-1-neg72.5%
+-commutative72.5%
unpow272.5%
unpow272.5%
hypot-def81.9%
Simplified81.9%
Taylor expanded in A around 0 73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in B around 0 73.4%
mul-1-neg73.4%
distribute-neg-frac73.4%
+-commutative73.4%
distribute-neg-out73.4%
mul-1-neg73.4%
sub-neg73.4%
sub-neg73.4%
mul-1-neg73.4%
distribute-neg-out73.4%
+-commutative73.4%
distribute-neg-out73.4%
mul-1-neg73.4%
sub-neg73.4%
Simplified73.4%
Final simplification62.5%
(FPCore (A B C)
:precision binary64
(if (<= B -1.9e-168)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.2e-97)
(* 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 <= -1.9e-168) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.2e-97) {
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 <= -1.9e-168) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.2e-97) {
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 <= -1.9e-168: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.2e-97: 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 <= -1.9e-168) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.2e-97) 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 <= -1.9e-168) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.2e-97) 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, -1.9e-168], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.2e-97], 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 -1.9 \cdot 10^{-168}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.2 \cdot 10^{-97}:\\
\;\;\;\;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 < -1.9e-168Initial program 52.5%
associate--l-52.5%
Simplified52.5%
Taylor expanded in B around -inf 50.0%
if -1.9e-168 < B < 2.1999999999999999e-97Initial program 47.5%
associate--l-44.2%
Simplified44.2%
Taylor expanded in C around inf 34.8%
associate-*r/34.8%
distribute-rgt1-in34.8%
metadata-eval34.8%
mul0-lft34.8%
metadata-eval34.8%
Simplified34.8%
if 2.1999999999999999e-97 < B Initial program 50.4%
associate--l-50.4%
Simplified50.4%
Taylor expanded in B around inf 44.1%
Final simplification44.0%
(FPCore (A B C) :precision binary64 (if (<= A -8.6e+42) (* 180.0 (/ (atan (/ (* B 0.5) A)) PI)) (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -8.6e+42) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -8.6e+42) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -8.6e+42: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -8.6e+42) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -8.6e+42) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -8.6e+42], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.6 \cdot 10^{+42}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.5999999999999996e42Initial program 23.4%
associate--l-20.3%
Simplified20.3%
Taylor expanded in A around -inf 63.2%
associate-*r/63.2%
Simplified63.2%
if -8.5999999999999996e42 < A Initial program 61.5%
associate--l-61.5%
Simplified61.5%
Taylor expanded in B around -inf 62.3%
associate--l+62.3%
div-sub62.9%
Simplified62.9%
Final simplification63.0%
(FPCore (A B C) :precision binary64 (if (<= A 9.5e+38) (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI)) (* 180.0 (/ (atan (* (/ A B) -2.0)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= 9.5e+38) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= 9.5e+38) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= 9.5e+38: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= 9.5e+38) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= 9.5e+38) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, 9.5e+38], 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[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq 9.5 \cdot 10^{+38}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < 9.4999999999999995e38Initial program 43.0%
associate--l-41.9%
Simplified41.9%
Taylor expanded in B around -inf 44.4%
associate--l+44.4%
div-sub45.4%
Simplified45.4%
Taylor expanded in C around inf 44.4%
if 9.4999999999999995e38 < A Initial program 79.1%
associate--l-79.1%
Simplified79.1%
Taylor expanded in A around inf 73.4%
Final simplification50.4%
(FPCore (A B C) :precision binary64 (if (<= A 1.9e-29) (* 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 <= 1.9e-29) {
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 <= 1.9e-29) {
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 <= 1.9e-29: 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 <= 1.9e-29) 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 <= 1.9e-29) 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, 1.9e-29], 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 1.9 \cdot 10^{-29}:\\
\;\;\;\;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 < 1.89999999999999988e-29Initial program 43.3%
associate--l-42.1%
Simplified42.1%
Taylor expanded in B around -inf 44.6%
associate--l+44.6%
div-sub45.6%
Simplified45.6%
Taylor expanded in C around inf 44.9%
if 1.89999999999999988e-29 < A Initial program 72.5%
associate--l-72.5%
Simplified72.5%
Taylor expanded in C around 0 72.5%
associate-*r/72.5%
mul-1-neg72.5%
+-commutative72.5%
unpow272.5%
unpow272.5%
hypot-def81.9%
Simplified81.9%
Taylor expanded in A around 0 73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in B around 0 73.4%
mul-1-neg73.4%
distribute-neg-frac73.4%
+-commutative73.4%
distribute-neg-out73.4%
mul-1-neg73.4%
sub-neg73.4%
sub-neg73.4%
mul-1-neg73.4%
distribute-neg-out73.4%
+-commutative73.4%
distribute-neg-out73.4%
mul-1-neg73.4%
sub-neg73.4%
Simplified73.4%
Final simplification51.9%
(FPCore (A B C) :precision binary64 (if (<= B -1e-309) (* 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-309) {
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-309) {
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-309: 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-309) 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-309) 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-309], 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^{-309}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.000000000000002e-309Initial program 52.0%
associate--l-52.0%
Simplified52.0%
Taylor expanded in B around -inf 42.5%
if -1.000000000000002e-309 < B Initial program 48.9%
associate--l-47.1%
Simplified47.1%
Taylor expanded in B around inf 32.6%
Final simplification37.7%
(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 50.5%
associate--l-49.6%
Simplified49.6%
Taylor expanded in B around inf 16.8%
Final simplification16.8%
herbie shell --seed 2024040
(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)))