
(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 21 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 (if (<= A -2.25e-18) (* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A))))) (* (/ 180.0 PI) (atan (* (- C (+ A (hypot B (- C A)))) (/ 1.0 B))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.25e-18) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((C - (A + hypot(B, (C - A)))) * (1.0 / B)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.25e-18) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
} else {
tmp = (180.0 / Math.PI) * Math.atan(((C - (A + Math.hypot(B, (C - A)))) * (1.0 / B)));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.25e-18: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A)))) else: tmp = (180.0 / math.pi) * math.atan(((C - (A + math.hypot(B, (C - A)))) * (1.0 / B))) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.25e-18) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A))))); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - Float64(A + hypot(B, Float64(C - A)))) * Float64(1.0 / B)))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.25e-18) tmp = (180.0 / pi) * atan((-0.5 * (B / (C - A)))); else tmp = (180.0 / pi) * atan(((C - (A + hypot(B, (C - A)))) * (1.0 / B))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.25e-18], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(C - A), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.25 \cdot 10^{-18}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\left(C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)\right) \cdot \frac{1}{B}\right)\\
\end{array}
\end{array}
if A < -2.24999999999999997e-18Initial program 31.0%
Simplified27.2%
Taylor expanded in B around 0 79.0%
if -2.24999999999999997e-18 < A Initial program 65.3%
Simplified86.0%
div-inv86.0%
Applied egg-rr86.0%
Final simplification84.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))))
(if (<= A -9.5e-13)
(* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A)))))
(if (<= A 3.7e-22)
t_0
(if (<= A 1.32e+63)
(* 180.0 (/ (atan (+ (/ (- C A) B) -1.0)) PI))
(if (<= A 4.2e+74) t_0 (* 180.0 (/ (atan (- 1.0 (/ 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 tmp;
if (A <= -9.5e-13) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
} else if (A <= 3.7e-22) {
tmp = t_0;
} else if (A <= 1.32e+63) {
tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / ((double) M_PI));
} else if (A <= 4.2e+74) {
tmp = t_0;
} 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 t_0 = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
double tmp;
if (A <= -9.5e-13) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
} else if (A <= 3.7e-22) {
tmp = t_0;
} else if (A <= 1.32e+63) {
tmp = 180.0 * (Math.atan((((C - A) / B) + -1.0)) / Math.PI);
} else if (A <= 4.2e+74) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((1.0 - (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) tmp = 0 if A <= -9.5e-13: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A)))) elif A <= 3.7e-22: tmp = t_0 elif A <= 1.32e+63: tmp = 180.0 * (math.atan((((C - A) / B) + -1.0)) / math.pi) elif A <= 4.2e+74: tmp = t_0 else: tmp = 180.0 * (math.atan((1.0 - (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)) tmp = 0.0 if (A <= -9.5e-13) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A))))); elseif (A <= 3.7e-22) tmp = t_0; elseif (A <= 1.32e+63) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + -1.0)) / pi)); elseif (A <= 4.2e+74) tmp = t_0; 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) t_0 = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); tmp = 0.0; if (A <= -9.5e-13) tmp = (180.0 / pi) * atan((-0.5 * (B / (C - A)))); elseif (A <= 3.7e-22) tmp = t_0; elseif (A <= 1.32e+63) tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / pi); elseif (A <= 4.2e+74) tmp = t_0; else tmp = 180.0 * (atan((1.0 - (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]}, If[LessEqual[A, -9.5e-13], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.7e-22], t$95$0, If[LessEqual[A, 1.32e+63], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.2e+74], t$95$0, N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $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}\\
\mathbf{if}\;A \leq -9.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{elif}\;A \leq 3.7 \cdot 10^{-22}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 1.32 \cdot 10^{+63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
\mathbf{elif}\;A \leq 4.2 \cdot 10^{+74}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -9.49999999999999991e-13Initial program 30.4%
Simplified26.5%
Taylor expanded in B around 0 79.8%
if -9.49999999999999991e-13 < A < 3.7e-22 or 1.32e63 < A < 4.1999999999999998e74Initial program 56.0%
Simplified55.9%
Taylor expanded in A around 0 53.1%
unpow253.1%
unpow253.1%
hypot-def78.6%
Simplified78.6%
if 3.7e-22 < A < 1.32e63Initial program 89.4%
Simplified89.4%
Taylor expanded in B around inf 83.9%
+-commutative83.9%
associate--r+83.9%
div-sub84.0%
Simplified84.0%
if 4.1999999999999998e74 < A Initial program 76.0%
Simplified76.0%
Taylor expanded in C around 0 76.0%
associate-*r/76.0%
mul-1-neg76.0%
unpow276.0%
unpow276.0%
hypot-def89.2%
Simplified89.2%
Taylor expanded in B around -inf 82.8%
mul-1-neg82.8%
unsub-neg82.8%
Simplified82.8%
Final simplification80.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (atan (/ (- C (hypot B C)) B))))
(if (<= A -0.00078)
(* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A)))))
(if (<= A 1.16e-22)
(* 180.0 (/ t_0 PI))
(if (<= A 4.5e+66)
(* 180.0 (/ (atan (+ (/ (- C A) B) -1.0)) PI))
(if (<= A 2.2e+74)
(* (/ 180.0 PI) t_0)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))))))
double code(double A, double B, double C) {
double t_0 = atan(((C - hypot(B, C)) / B));
double tmp;
if (A <= -0.00078) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
} else if (A <= 1.16e-22) {
tmp = 180.0 * (t_0 / ((double) M_PI));
} else if (A <= 4.5e+66) {
tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / ((double) M_PI));
} else if (A <= 2.2e+74) {
tmp = (180.0 / ((double) M_PI)) * t_0;
} 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 t_0 = Math.atan(((C - Math.hypot(B, C)) / B));
double tmp;
if (A <= -0.00078) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
} else if (A <= 1.16e-22) {
tmp = 180.0 * (t_0 / Math.PI);
} else if (A <= 4.5e+66) {
tmp = 180.0 * (Math.atan((((C - A) / B) + -1.0)) / Math.PI);
} else if (A <= 2.2e+74) {
tmp = (180.0 / Math.PI) * t_0;
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = math.atan(((C - math.hypot(B, C)) / B)) tmp = 0 if A <= -0.00078: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A)))) elif A <= 1.16e-22: tmp = 180.0 * (t_0 / math.pi) elif A <= 4.5e+66: tmp = 180.0 * (math.atan((((C - A) / B) + -1.0)) / math.pi) elif A <= 2.2e+74: tmp = (180.0 / math.pi) * t_0 else: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = atan(Float64(Float64(C - hypot(B, C)) / B)) tmp = 0.0 if (A <= -0.00078) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A))))); elseif (A <= 1.16e-22) tmp = Float64(180.0 * Float64(t_0 / pi)); elseif (A <= 4.5e+66) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + -1.0)) / pi)); elseif (A <= 2.2e+74) tmp = Float64(Float64(180.0 / pi) * t_0); 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) t_0 = atan(((C - hypot(B, C)) / B)); tmp = 0.0; if (A <= -0.00078) tmp = (180.0 / pi) * atan((-0.5 * (B / (C - A)))); elseif (A <= 1.16e-22) tmp = 180.0 * (t_0 / pi); elseif (A <= 4.5e+66) tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / pi); elseif (A <= 2.2e+74) tmp = (180.0 / pi) * t_0; else tmp = 180.0 * (atan((1.0 - (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]}, If[LessEqual[A, -0.00078], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.16e-22], N[(180.0 * N[(t$95$0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.5e+66], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.2e+74], N[(N[(180.0 / Pi), $MachinePrecision] * t$95$0), $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}
t_0 := \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\
\mathbf{if}\;A \leq -0.00078:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{elif}\;A \leq 1.16 \cdot 10^{-22}:\\
\;\;\;\;180 \cdot \frac{t_0}{\pi}\\
\mathbf{elif}\;A \leq 4.5 \cdot 10^{+66}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.2 \cdot 10^{+74}:\\
\;\;\;\;\frac{180}{\pi} \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -7.79999999999999986e-4Initial program 30.4%
Simplified26.5%
Taylor expanded in B around 0 79.8%
if -7.79999999999999986e-4 < A < 1.1600000000000001e-22Initial program 57.3%
Simplified57.3%
Taylor expanded in A around 0 54.4%
unpow254.4%
unpow254.4%
hypot-def78.7%
Simplified78.7%
if 1.1600000000000001e-22 < A < 4.4999999999999998e66Initial program 89.4%
Simplified89.4%
Taylor expanded in B around inf 83.9%
+-commutative83.9%
associate--r+83.9%
div-sub84.0%
Simplified84.0%
if 4.4999999999999998e66 < A < 2.2000000000000001e74Initial program 15.5%
Simplified76.4%
div-inv76.4%
Applied egg-rr76.4%
Taylor expanded in A around 0 15.5%
unpow215.5%
unpow215.5%
hypot-def76.4%
Simplified76.4%
if 2.2000000000000001e74 < A Initial program 76.0%
Simplified76.0%
Taylor expanded in C around 0 76.0%
associate-*r/76.0%
mul-1-neg76.0%
unpow276.0%
unpow276.0%
hypot-def89.2%
Simplified89.2%
Taylor expanded in B around -inf 82.8%
mul-1-neg82.8%
unsub-neg82.8%
Simplified82.8%
Final simplification80.2%
(FPCore (A B C)
:precision binary64
(if (<= A -5.0)
(* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A)))))
(if (<= A 3.1e-202)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* (/ 180.0 PI) (atan (* (+ A (hypot A B)) (/ 1.0 (- B))))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.0) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
} else if (A <= 3.1e-202) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((A + hypot(A, B)) * (1.0 / -B)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -5.0) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
} else if (A <= 3.1e-202) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan(((A + Math.hypot(A, B)) * (1.0 / -B)));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -5.0: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A)))) elif A <= 3.1e-202: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = (180.0 / math.pi) * math.atan(((A + math.hypot(A, B)) * (1.0 / -B))) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -5.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A))))); elseif (A <= 3.1e-202) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(A + hypot(A, B)) * Float64(1.0 / Float64(-B))))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5.0) tmp = (180.0 / pi) * atan((-0.5 * (B / (C - A)))); elseif (A <= 3.1e-202) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = (180.0 / pi) * atan(((A + hypot(A, B)) * (1.0 / -B))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.1e-202], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / (-B)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{elif}\;A \leq 3.1 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\left(A + \mathsf{hypot}\left(A, B\right)\right) \cdot \frac{1}{-B}\right)\\
\end{array}
\end{array}
if A < -5Initial program 30.4%
Simplified26.5%
Taylor expanded in B around 0 79.8%
if -5 < A < 3.1e-202Initial program 59.2%
Simplified59.1%
Taylor expanded in A around 0 59.4%
unpow259.4%
unpow259.4%
hypot-def82.9%
Simplified82.9%
if 3.1e-202 < A Initial program 69.8%
Simplified88.0%
div-inv88.0%
Applied egg-rr88.0%
Taylor expanded in C around 0 67.6%
unpow267.6%
unpow267.6%
hypot-def82.3%
associate-*r/82.3%
distribute-lft-in82.3%
neg-mul-182.3%
sub-neg82.3%
mul-1-neg82.3%
hypot-def67.6%
unpow267.6%
unpow267.6%
+-commutative67.6%
unpow267.6%
unpow267.6%
hypot-def82.3%
Simplified82.3%
frac-2neg82.3%
div-inv82.3%
neg-sub082.3%
add-sqr-sqrt0.0%
sqrt-unprod32.9%
sqr-neg32.9%
sqrt-unprod46.9%
add-sqr-sqrt34.4%
associate-+l-34.4%
neg-sub034.4%
add-sqr-sqrt0.0%
sqrt-unprod80.7%
sqr-neg80.7%
sqrt-unprod82.3%
add-sqr-sqrt82.3%
Applied egg-rr82.3%
Final simplification81.9%
(FPCore (A B C) :precision binary64 (if (<= A -4.4e-20) (* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A))))) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.4e-20) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
} 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 <= -4.4e-20) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
} 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 <= -4.4e-20: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A)))) 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 <= -4.4e-20) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A))))); 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 <= -4.4e-20) tmp = (180.0 / pi) * atan((-0.5 * (B / (C - A)))); 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, -4.4e-20], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 -4.4 \cdot 10^{-20}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\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 < -4.39999999999999982e-20Initial program 31.0%
Simplified27.2%
Taylor expanded in B around 0 79.0%
if -4.39999999999999982e-20 < A Initial program 65.3%
Simplified86.0%
Final simplification84.1%
(FPCore (A B C)
:precision binary64
(if (<= A -80.0)
(* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A)))))
(if (<= A 3.1e-202)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (/ (- (+ A (hypot B A))) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -80.0) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
} else if (A <= 3.1e-202) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((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 tmp;
if (A <= -80.0) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
} else if (A <= 3.1e-202) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-(A + Math.hypot(B, A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -80.0: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A)))) elif A <= 3.1e-202: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-(A + math.hypot(B, A)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -80.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A))))); elseif (A <= 3.1e-202) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / 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) tmp = 0.0; if (A <= -80.0) tmp = (180.0 / pi) * atan((-0.5 * (B / (C - A)))); elseif (A <= 3.1e-202) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan((-(A + hypot(B, A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -80.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.1e-202], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / 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}
\mathbf{if}\;A \leq -80:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{elif}\;A \leq 3.1 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-\left(A + \mathsf{hypot}\left(B, A\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -80Initial program 30.4%
Simplified26.5%
Taylor expanded in B around 0 79.8%
if -80 < A < 3.1e-202Initial program 59.2%
Simplified59.1%
Taylor expanded in A around 0 59.4%
unpow259.4%
unpow259.4%
hypot-def82.9%
Simplified82.9%
if 3.1e-202 < A Initial program 69.8%
Simplified69.8%
Taylor expanded in C around 0 67.6%
associate-*r/67.6%
mul-1-neg67.6%
unpow267.6%
unpow267.6%
hypot-def82.3%
Simplified82.3%
Final simplification81.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (- C A) B)))
(if (<= B -3.2e-208)
(* 180.0 (/ (atan (+ 1.0 t_0)) PI))
(if (or (<= B 6e-165) (and (not (<= B 8.3e-97)) (<= B 4.1e-53)))
(* 180.0 (/ (atan (* B (/ -0.5 (- C A)))) PI))
(* 180.0 (/ (atan (+ t_0 -1.0)) PI))))))
double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double tmp;
if (B <= -3.2e-208) {
tmp = 180.0 * (atan((1.0 + t_0)) / ((double) M_PI));
} else if ((B <= 6e-165) || (!(B <= 8.3e-97) && (B <= 4.1e-53))) {
tmp = 180.0 * (atan((B * (-0.5 / (C - A)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((t_0 + -1.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double tmp;
if (B <= -3.2e-208) {
tmp = 180.0 * (Math.atan((1.0 + t_0)) / Math.PI);
} else if ((B <= 6e-165) || (!(B <= 8.3e-97) && (B <= 4.1e-53))) {
tmp = 180.0 * (Math.atan((B * (-0.5 / (C - A)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((t_0 + -1.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (C - A) / B tmp = 0 if B <= -3.2e-208: tmp = 180.0 * (math.atan((1.0 + t_0)) / math.pi) elif (B <= 6e-165) or (not (B <= 8.3e-97) and (B <= 4.1e-53)): tmp = 180.0 * (math.atan((B * (-0.5 / (C - A)))) / math.pi) else: tmp = 180.0 * (math.atan((t_0 + -1.0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(C - A) / B) tmp = 0.0 if (B <= -3.2e-208) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_0)) / pi)); elseif ((B <= 6e-165) || (!(B <= 8.3e-97) && (B <= 4.1e-53))) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / Float64(C - A)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(t_0 + -1.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (C - A) / B; tmp = 0.0; if (B <= -3.2e-208) tmp = 180.0 * (atan((1.0 + t_0)) / pi); elseif ((B <= 6e-165) || (~((B <= 8.3e-97)) && (B <= 4.1e-53))) tmp = 180.0 * (atan((B * (-0.5 / (C - A)))) / pi); else tmp = 180.0 * (atan((t_0 + -1.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -3.2e-208], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[B, 6e-165], And[N[Not[LessEqual[B, 8.3e-97]], $MachinePrecision], LessEqual[B, 4.1e-53]]], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(t$95$0 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{C - A}{B}\\
\mathbf{if}\;B \leq -3.2 \cdot 10^{-208}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t_0\right)}{\pi}\\
\mathbf{elif}\;B \leq 6 \cdot 10^{-165} \lor \neg \left(B \leq 8.3 \cdot 10^{-97}\right) \land B \leq 4.1 \cdot 10^{-53}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C - A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t_0 + -1\right)}{\pi}\\
\end{array}
\end{array}
if B < -3.2000000000000001e-208Initial program 60.5%
Simplified59.6%
Taylor expanded in B around -inf 72.1%
associate--l+72.1%
div-sub73.0%
Simplified73.0%
if -3.2000000000000001e-208 < B < 5.99999999999999958e-165 or 8.29999999999999964e-97 < B < 4.1000000000000001e-53Initial program 49.5%
Simplified55.1%
Taylor expanded in B around 0 66.0%
Taylor expanded in B around 0 65.9%
associate-*r/65.9%
sub-neg65.9%
mul-1-neg65.9%
associate-*r/65.9%
associate-*r/65.9%
mul-1-neg65.9%
sub-neg65.9%
associate-/l*65.2%
associate-/r/65.9%
Simplified65.9%
if 5.99999999999999958e-165 < B < 8.29999999999999964e-97 or 4.1000000000000001e-53 < B Initial program 55.9%
Simplified55.9%
Taylor expanded in B around inf 70.7%
+-commutative70.7%
associate--r+70.7%
div-sub70.7%
Simplified70.7%
Final simplification70.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (- C A) B)))
(if (<= B -1.8e-208)
(* 180.0 (/ (atan (+ 1.0 t_0)) PI))
(if (or (<= B 4.3e-165) (and (not (<= B 1.4e-98)) (<= B 4.1e-53)))
(* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A)))))
(* 180.0 (/ (atan (+ t_0 -1.0)) PI))))))
double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double tmp;
if (B <= -1.8e-208) {
tmp = 180.0 * (atan((1.0 + t_0)) / ((double) M_PI));
} else if ((B <= 4.3e-165) || (!(B <= 1.4e-98) && (B <= 4.1e-53))) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
} else {
tmp = 180.0 * (atan((t_0 + -1.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double tmp;
if (B <= -1.8e-208) {
tmp = 180.0 * (Math.atan((1.0 + t_0)) / Math.PI);
} else if ((B <= 4.3e-165) || (!(B <= 1.4e-98) && (B <= 4.1e-53))) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
} else {
tmp = 180.0 * (Math.atan((t_0 + -1.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (C - A) / B tmp = 0 if B <= -1.8e-208: tmp = 180.0 * (math.atan((1.0 + t_0)) / math.pi) elif (B <= 4.3e-165) or (not (B <= 1.4e-98) and (B <= 4.1e-53)): tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A)))) else: tmp = 180.0 * (math.atan((t_0 + -1.0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(C - A) / B) tmp = 0.0 if (B <= -1.8e-208) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_0)) / pi)); elseif ((B <= 4.3e-165) || (!(B <= 1.4e-98) && (B <= 4.1e-53))) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A))))); else tmp = Float64(180.0 * Float64(atan(Float64(t_0 + -1.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (C - A) / B; tmp = 0.0; if (B <= -1.8e-208) tmp = 180.0 * (atan((1.0 + t_0)) / pi); elseif ((B <= 4.3e-165) || (~((B <= 1.4e-98)) && (B <= 4.1e-53))) tmp = (180.0 / pi) * atan((-0.5 * (B / (C - A)))); else tmp = 180.0 * (atan((t_0 + -1.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -1.8e-208], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[B, 4.3e-165], And[N[Not[LessEqual[B, 1.4e-98]], $MachinePrecision], LessEqual[B, 4.1e-53]]], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(t$95$0 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{C - A}{B}\\
\mathbf{if}\;B \leq -1.8 \cdot 10^{-208}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t_0\right)}{\pi}\\
\mathbf{elif}\;B \leq 4.3 \cdot 10^{-165} \lor \neg \left(B \leq 1.4 \cdot 10^{-98}\right) \land B \leq 4.1 \cdot 10^{-53}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t_0 + -1\right)}{\pi}\\
\end{array}
\end{array}
if B < -1.7999999999999999e-208Initial program 60.5%
Simplified59.6%
Taylor expanded in B around -inf 72.1%
associate--l+72.1%
div-sub73.0%
Simplified73.0%
if -1.7999999999999999e-208 < B < 4.30000000000000007e-165 or 1.3999999999999999e-98 < B < 4.1000000000000001e-53Initial program 49.5%
Simplified55.1%
Taylor expanded in B around 0 66.0%
if 4.30000000000000007e-165 < B < 1.3999999999999999e-98 or 4.1000000000000001e-53 < B Initial program 55.9%
Simplified55.9%
Taylor expanded in B around inf 70.7%
+-commutative70.7%
associate--r+70.7%
div-sub70.7%
Simplified70.7%
Final simplification70.5%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A))))))
(t_1 (/ (- C A) B))
(t_2 (atan (+ t_1 -1.0))))
(if (<= B -4.2e-208)
(* 180.0 (/ (atan (+ 1.0 t_1)) PI))
(if (<= B 2.3e-165)
t_0
(if (<= B 4.5e-96)
(* 180.0 (/ t_2 PI))
(if (<= B 4.2e-53) t_0 (* (/ 180.0 PI) t_2)))))))
double code(double A, double B, double C) {
double t_0 = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
double t_1 = (C - A) / B;
double t_2 = atan((t_1 + -1.0));
double tmp;
if (B <= -4.2e-208) {
tmp = 180.0 * (atan((1.0 + t_1)) / ((double) M_PI));
} else if (B <= 2.3e-165) {
tmp = t_0;
} else if (B <= 4.5e-96) {
tmp = 180.0 * (t_2 / ((double) M_PI));
} else if (B <= 4.2e-53) {
tmp = t_0;
} else {
tmp = (180.0 / ((double) M_PI)) * t_2;
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
double t_1 = (C - A) / B;
double t_2 = Math.atan((t_1 + -1.0));
double tmp;
if (B <= -4.2e-208) {
tmp = 180.0 * (Math.atan((1.0 + t_1)) / Math.PI);
} else if (B <= 2.3e-165) {
tmp = t_0;
} else if (B <= 4.5e-96) {
tmp = 180.0 * (t_2 / Math.PI);
} else if (B <= 4.2e-53) {
tmp = t_0;
} else {
tmp = (180.0 / Math.PI) * t_2;
}
return tmp;
}
def code(A, B, C): t_0 = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A)))) t_1 = (C - A) / B t_2 = math.atan((t_1 + -1.0)) tmp = 0 if B <= -4.2e-208: tmp = 180.0 * (math.atan((1.0 + t_1)) / math.pi) elif B <= 2.3e-165: tmp = t_0 elif B <= 4.5e-96: tmp = 180.0 * (t_2 / math.pi) elif B <= 4.2e-53: tmp = t_0 else: tmp = (180.0 / math.pi) * t_2 return tmp
function code(A, B, C) t_0 = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A))))) t_1 = Float64(Float64(C - A) / B) t_2 = atan(Float64(t_1 + -1.0)) tmp = 0.0 if (B <= -4.2e-208) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_1)) / pi)); elseif (B <= 2.3e-165) tmp = t_0; elseif (B <= 4.5e-96) tmp = Float64(180.0 * Float64(t_2 / pi)); elseif (B <= 4.2e-53) tmp = t_0; else tmp = Float64(Float64(180.0 / pi) * t_2); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (180.0 / pi) * atan((-0.5 * (B / (C - A)))); t_1 = (C - A) / B; t_2 = atan((t_1 + -1.0)); tmp = 0.0; if (B <= -4.2e-208) tmp = 180.0 * (atan((1.0 + t_1)) / pi); elseif (B <= 2.3e-165) tmp = t_0; elseif (B <= 4.5e-96) tmp = 180.0 * (t_2 / pi); elseif (B <= 4.2e-53) tmp = t_0; else tmp = (180.0 / pi) * t_2; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, -4.2e-208], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$1), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.3e-165], t$95$0, If[LessEqual[B, 4.5e-96], N[(180.0 * N[(t$95$2 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.2e-53], t$95$0, N[(N[(180.0 / Pi), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
t_1 := \frac{C - A}{B}\\
t_2 := \tan^{-1} \left(t_1 + -1\right)\\
\mathbf{if}\;B \leq -4.2 \cdot 10^{-208}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t_1\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.3 \cdot 10^{-165}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-96}:\\
\;\;\;\;180 \cdot \frac{t_2}{\pi}\\
\mathbf{elif}\;B \leq 4.2 \cdot 10^{-53}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot t_2\\
\end{array}
\end{array}
if B < -4.20000000000000024e-208Initial program 60.5%
Simplified59.6%
Taylor expanded in B around -inf 72.1%
associate--l+72.1%
div-sub73.0%
Simplified73.0%
if -4.20000000000000024e-208 < B < 2.3e-165 or 4.5e-96 < B < 4.19999999999999955e-53Initial program 49.5%
Simplified55.1%
Taylor expanded in B around 0 66.0%
if 2.3e-165 < B < 4.5e-96Initial program 69.6%
Simplified69.5%
Taylor expanded in B around inf 73.5%
+-commutative73.5%
associate--r+73.5%
div-sub73.5%
Simplified73.5%
if 4.19999999999999955e-53 < B Initial program 53.7%
Simplified73.0%
div-inv73.0%
Applied egg-rr73.0%
Taylor expanded in B around inf 70.2%
+-commutative70.2%
associate--r+70.2%
div-sub70.2%
Simplified70.2%
Final simplification70.5%
(FPCore (A B C)
:precision binary64
(if (<= A -2e-310)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= A 3e-239)
(* (/ 180.0 PI) (atan (* -0.5 (/ B C))))
(if (or (<= A 3.9e-25) (not (<= A 5e+45)))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(* (/ 180.0 PI) (atan (- -1.0 (/ A B))))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2e-310) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (A <= 3e-239) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
} else if ((A <= 3.9e-25) || !(A <= 5e+45)) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan((-1.0 - (A / B)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2e-310) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (A <= 3e-239) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
} else if ((A <= 3.9e-25) || !(A <= 5e+45)) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan((-1.0 - (A / B)));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2e-310: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif A <= 3e-239: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) elif (A <= 3.9e-25) or not (A <= 5e+45): tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) else: tmp = (180.0 / math.pi) * math.atan((-1.0 - (A / B))) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2e-310) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (A <= 3e-239) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); elseif ((A <= 3.9e-25) || !(A <= 5e+45)) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(-1.0 - Float64(A / B)))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2e-310) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (A <= 3e-239) tmp = (180.0 / pi) * atan((-0.5 * (B / C))); elseif ((A <= 3.9e-25) || ~((A <= 5e+45))) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = (180.0 / pi) * atan((-1.0 - (A / B))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2e-310], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3e-239], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[A, 3.9e-25], N[Not[LessEqual[A, 5e+45]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;A \leq 3 \cdot 10^{-239}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\mathbf{elif}\;A \leq 3.9 \cdot 10^{-25} \lor \neg \left(A \leq 5 \cdot 10^{+45}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\
\end{array}
\end{array}
if A < -1.999999999999994e-310Initial program 44.0%
Simplified53.9%
div-inv53.9%
Applied egg-rr53.9%
Taylor expanded in A around -inf 60.9%
if -1.999999999999994e-310 < A < 2.9999999999999998e-239Initial program 56.1%
Simplified70.1%
Taylor expanded in B around 0 48.3%
Taylor expanded in C around inf 48.4%
if 2.9999999999999998e-239 < A < 3.9e-25 or 5e45 < A Initial program 66.6%
Simplified66.6%
Taylor expanded in C around 0 65.2%
associate-*r/65.2%
mul-1-neg65.2%
unpow265.2%
unpow265.2%
hypot-def84.6%
Simplified84.6%
Taylor expanded in B around -inf 72.8%
mul-1-neg72.8%
unsub-neg72.8%
Simplified72.8%
if 3.9e-25 < A < 5e45Initial program 83.3%
Simplified91.5%
div-inv91.5%
Applied egg-rr91.5%
Taylor expanded in C around 0 74.4%
unpow274.4%
unpow274.4%
hypot-def74.4%
associate-*r/74.4%
distribute-lft-in74.4%
neg-mul-174.4%
sub-neg74.4%
mul-1-neg74.4%
hypot-def74.4%
unpow274.4%
unpow274.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-def74.4%
Simplified74.4%
frac-2neg74.4%
div-inv74.4%
neg-sub074.4%
add-sqr-sqrt0.0%
sqrt-unprod36.8%
sqr-neg36.8%
sqrt-unprod49.9%
add-sqr-sqrt36.8%
associate-+l-36.8%
neg-sub036.8%
add-sqr-sqrt0.0%
sqrt-unprod74.4%
sqr-neg74.4%
sqrt-unprod74.4%
add-sqr-sqrt74.4%
Applied egg-rr74.4%
Taylor expanded in A around 0 72.4%
sub-neg72.4%
metadata-eval72.4%
+-commutative72.4%
mul-1-neg72.4%
sub-neg72.4%
Simplified72.4%
Final simplification65.4%
(FPCore (A B C)
:precision binary64
(if (<= A -1e-309)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= A 5.8e-239)
(* (/ 180.0 PI) (atan (* -0.5 (/ B C))))
(if (or (<= A 1.9e-30) (not (<= A 1e+47)))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(/ (* 180.0 (atan (- -1.0 (/ A B)))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1e-309) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (A <= 5.8e-239) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
} else if ((A <= 1.9e-30) || !(A <= 1e+47)) {
tmp = 180.0 * (atan((1.0 - (A / 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 <= -1e-309) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (A <= 5.8e-239) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
} else if ((A <= 1.9e-30) || !(A <= 1e+47)) {
tmp = 180.0 * (Math.atan((1.0 - (A / 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 <= -1e-309: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif A <= 5.8e-239: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) elif (A <= 1.9e-30) or not (A <= 1e+47): tmp = 180.0 * (math.atan((1.0 - (A / 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 <= -1e-309) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (A <= 5.8e-239) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); elseif ((A <= 1.9e-30) || !(A <= 1e+47)) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(-1.0 - Float64(A / B)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1e-309) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (A <= 5.8e-239) tmp = (180.0 / pi) * atan((-0.5 * (B / C))); elseif ((A <= 1.9e-30) || ~((A <= 1e+47))) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = (180.0 * atan((-1.0 - (A / B)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1e-309], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.8e-239], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[A, 1.9e-30], N[Not[LessEqual[A, 1e+47]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;A \leq 5.8 \cdot 10^{-239}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\mathbf{elif}\;A \leq 1.9 \cdot 10^{-30} \lor \neg \left(A \leq 10^{+47}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 44.0%
Simplified53.9%
div-inv53.9%
Applied egg-rr53.9%
Taylor expanded in A around -inf 60.9%
if -1.000000000000002e-309 < A < 5.8000000000000004e-239Initial program 56.1%
Simplified70.1%
Taylor expanded in B around 0 48.3%
Taylor expanded in C around inf 48.4%
if 5.8000000000000004e-239 < A < 1.9000000000000002e-30 or 1e47 < A Initial program 66.6%
Simplified66.6%
Taylor expanded in C around 0 65.2%
associate-*r/65.2%
mul-1-neg65.2%
unpow265.2%
unpow265.2%
hypot-def84.6%
Simplified84.6%
Taylor expanded in B around -inf 72.8%
mul-1-neg72.8%
unsub-neg72.8%
Simplified72.8%
if 1.9000000000000002e-30 < A < 1e47Initial program 83.3%
Simplified91.5%
div-inv91.5%
Applied egg-rr91.5%
Taylor expanded in C around 0 74.4%
unpow274.4%
unpow274.4%
hypot-def74.4%
associate-*r/74.4%
distribute-lft-in74.4%
neg-mul-174.4%
sub-neg74.4%
mul-1-neg74.4%
hypot-def74.4%
unpow274.4%
unpow274.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-def74.4%
Simplified74.4%
Taylor expanded in A around 0 72.4%
neg-mul-172.4%
+-commutative72.4%
unsub-neg72.4%
mul-1-neg72.4%
Simplified72.4%
associate-*l/72.4%
div-sub72.4%
pow172.4%
pow172.4%
pow-div72.4%
metadata-eval72.4%
metadata-eval72.4%
Applied egg-rr72.4%
Final simplification65.4%
(FPCore (A B C)
:precision binary64
(if (<= B -4e-24)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -1.22e-262)
(* (/ 180.0 PI) (atan (/ (- A) B)))
(if (<= B 5.8e-142)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 41000000000000.0)
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))
(* 180.0 (/ (atan -1.0) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4e-24) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -1.22e-262) {
tmp = (180.0 / ((double) M_PI)) * atan((-A / B));
} else if (B <= 5.8e-142) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 41000000000000.0) {
tmp = 180.0 * (atan(((A / B) * -2.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 <= -4e-24) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -1.22e-262) {
tmp = (180.0 / Math.PI) * Math.atan((-A / B));
} else if (B <= 5.8e-142) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 41000000000000.0) {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4e-24: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -1.22e-262: tmp = (180.0 / math.pi) * math.atan((-A / B)) elif B <= 5.8e-142: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 41000000000000.0: tmp = 180.0 * (math.atan(((A / B) * -2.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 <= -4e-24) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -1.22e-262) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(-A) / B))); elseif (B <= 5.8e-142) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 41000000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.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 <= -4e-24) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -1.22e-262) tmp = (180.0 / pi) * atan((-A / B)); elseif (B <= 5.8e-142) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 41000000000000.0) tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4e-24], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.22e-262], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.8e-142], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 41000000000000.0], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $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 \cdot 10^{-24}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -1.22 \cdot 10^{-262}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{-A}{B}\right)\\
\mathbf{elif}\;B \leq 5.8 \cdot 10^{-142}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 41000000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.99999999999999969e-24Initial program 48.0%
Simplified48.0%
Taylor expanded in B around -inf 57.2%
if -3.99999999999999969e-24 < B < -1.2199999999999999e-262Initial program 72.1%
Simplified73.9%
div-inv73.9%
Applied egg-rr73.9%
Taylor expanded in C around 0 52.4%
unpow252.4%
unpow252.4%
hypot-def59.4%
associate-*r/59.4%
distribute-lft-in59.4%
neg-mul-159.4%
sub-neg59.4%
mul-1-neg59.4%
hypot-def52.4%
unpow252.4%
unpow252.4%
+-commutative52.4%
unpow252.4%
unpow252.4%
hypot-def59.4%
Simplified59.4%
Taylor expanded in A around 0 40.1%
neg-mul-140.1%
+-commutative40.1%
unsub-neg40.1%
mul-1-neg40.1%
Simplified40.1%
Taylor expanded in A around inf 40.5%
mul-1-neg40.5%
distribute-frac-neg40.5%
Simplified40.5%
if -1.2199999999999999e-262 < B < 5.7999999999999998e-142Initial program 56.8%
Simplified50.5%
Taylor expanded in C around inf 41.2%
mul-1-neg41.2%
distribute-rgt1-in41.2%
metadata-eval41.2%
mul0-lft41.2%
distribute-frac-neg41.2%
metadata-eval41.2%
Simplified41.2%
if 5.7999999999999998e-142 < B < 4.1e13Initial program 47.7%
Simplified47.7%
Taylor expanded in A around inf 37.7%
if 4.1e13 < B Initial program 52.3%
Simplified52.3%
Taylor expanded in B around inf 61.9%
Final simplification48.5%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* (/ 180.0 PI) (atan (/ (- A) B)))))
(if (<= B -1.6e-24)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -1.85e-264)
t_0
(if (<= B 3.8e-141)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 38000000000000.0) t_0 (* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double t_0 = (180.0 / ((double) M_PI)) * atan((-A / B));
double tmp;
if (B <= -1.6e-24) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -1.85e-264) {
tmp = t_0;
} else if (B <= 3.8e-141) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 38000000000000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (180.0 / Math.PI) * Math.atan((-A / B));
double tmp;
if (B <= -1.6e-24) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -1.85e-264) {
tmp = t_0;
} else if (B <= 3.8e-141) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 38000000000000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (180.0 / math.pi) * math.atan((-A / B)) tmp = 0 if B <= -1.6e-24: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -1.85e-264: tmp = t_0 elif B <= 3.8e-141: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 38000000000000.0: tmp = t_0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(180.0 / pi) * atan(Float64(Float64(-A) / B))) tmp = 0.0 if (B <= -1.6e-24) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -1.85e-264) tmp = t_0; elseif (B <= 3.8e-141) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 38000000000000.0) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (180.0 / pi) * atan((-A / B)); tmp = 0.0; if (B <= -1.6e-24) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -1.85e-264) tmp = t_0; elseif (B <= 3.8e-141) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 38000000000000.0) tmp = t_0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.6e-24], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.85e-264], t$95$0, If[LessEqual[B, 3.8e-141], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 38000000000000.0], t$95$0, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{-A}{B}\right)\\
\mathbf{if}\;B \leq -1.6 \cdot 10^{-24}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -1.85 \cdot 10^{-264}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 3.8 \cdot 10^{-141}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 38000000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.60000000000000006e-24Initial program 48.0%
Simplified48.0%
Taylor expanded in B around -inf 57.2%
if -1.60000000000000006e-24 < B < -1.84999999999999998e-264 or 3.79999999999999987e-141 < B < 3.8e13Initial program 63.3%
Simplified65.6%
div-inv65.6%
Applied egg-rr65.6%
Taylor expanded in C around 0 48.6%
unpow248.6%
unpow248.6%
hypot-def54.4%
associate-*r/54.4%
distribute-lft-in54.4%
neg-mul-154.4%
sub-neg54.4%
mul-1-neg54.4%
hypot-def48.6%
unpow248.6%
unpow248.6%
+-commutative48.6%
unpow248.6%
unpow248.6%
hypot-def54.4%
Simplified54.4%
Taylor expanded in A around 0 39.5%
neg-mul-139.5%
+-commutative39.5%
unsub-neg39.5%
mul-1-neg39.5%
Simplified39.5%
Taylor expanded in A around inf 39.5%
mul-1-neg39.5%
distribute-frac-neg39.5%
Simplified39.5%
if -1.84999999999999998e-264 < B < 3.79999999999999987e-141Initial program 56.8%
Simplified50.5%
Taylor expanded in C around inf 41.2%
mul-1-neg41.2%
distribute-rgt1-in41.2%
metadata-eval41.2%
mul0-lft41.2%
distribute-frac-neg41.2%
metadata-eval41.2%
Simplified41.2%
if 3.8e13 < B Initial program 52.3%
Simplified52.3%
Taylor expanded in B around inf 61.9%
Final simplification48.5%
(FPCore (A B C)
:precision binary64
(if (<= B -7.5e-263)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= B 1.55e-142)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 3.2e+15)
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))
(* 180.0 (/ (atan -1.0) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7.5e-263) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (B <= 1.55e-142) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 3.2e+15) {
tmp = 180.0 * (atan(((A / B) * -2.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 <= -7.5e-263) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (B <= 1.55e-142) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 3.2e+15) {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -7.5e-263: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif B <= 1.55e-142: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 3.2e+15: tmp = 180.0 * (math.atan(((A / B) * -2.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 <= -7.5e-263) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (B <= 1.55e-142) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 3.2e+15) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.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 <= -7.5e-263) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (B <= 1.55e-142) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 3.2e+15) tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -7.5e-263], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.55e-142], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.2e+15], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $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.5 \cdot 10^{-263}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.55 \cdot 10^{-142}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.2 \cdot 10^{+15}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -7.50000000000000044e-263Initial program 59.9%
Simplified58.3%
Taylor expanded in C around 0 47.2%
associate-*r/47.2%
mul-1-neg47.2%
unpow247.2%
unpow247.2%
hypot-def63.6%
Simplified63.6%
Taylor expanded in B around -inf 56.7%
mul-1-neg56.7%
unsub-neg56.7%
Simplified56.7%
if -7.50000000000000044e-263 < B < 1.55e-142Initial program 56.8%
Simplified50.5%
Taylor expanded in C around inf 41.2%
mul-1-neg41.2%
distribute-rgt1-in41.2%
metadata-eval41.2%
mul0-lft41.2%
distribute-frac-neg41.2%
metadata-eval41.2%
Simplified41.2%
if 1.55e-142 < B < 3.2e15Initial program 47.7%
Simplified47.7%
Taylor expanded in A around inf 37.7%
if 3.2e15 < B Initial program 52.3%
Simplified52.3%
Taylor expanded in B around inf 61.9%
Final simplification52.3%
(FPCore (A B C)
:precision binary64
(if (<= B -1.95e-205)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
(if (<= B 200000000000.0)
(* 180.0 (/ (atan (* B (/ -0.5 (- C A)))) PI))
(/ (* 180.0 (atan (- -1.0 (/ A B)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.95e-205) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else if (B <= 200000000000.0) {
tmp = 180.0 * (atan((B * (-0.5 / (C - A)))) / ((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 (B <= -1.95e-205) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else if (B <= 200000000000.0) {
tmp = 180.0 * (Math.atan((B * (-0.5 / (C - A)))) / Math.PI);
} else {
tmp = (180.0 * Math.atan((-1.0 - (A / B)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.95e-205: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) elif B <= 200000000000.0: tmp = 180.0 * (math.atan((B * (-0.5 / (C - A)))) / 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 (B <= -1.95e-205) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); elseif (B <= 200000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / Float64(C - A)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(-1.0 - Float64(A / B)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1.95e-205) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); elseif (B <= 200000000000.0) tmp = 180.0 * (atan((B * (-0.5 / (C - A)))) / pi); else tmp = (180.0 * atan((-1.0 - (A / B)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.95e-205], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 200000000000.0], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.95 \cdot 10^{-205}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 200000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C - A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -1.95000000000000009e-205Initial program 60.5%
Simplified59.6%
Taylor expanded in B around -inf 72.1%
associate--l+72.1%
div-sub73.0%
Simplified73.0%
if -1.95000000000000009e-205 < B < 2e11Initial program 52.2%
Simplified56.8%
Taylor expanded in B around 0 59.1%
Taylor expanded in B around 0 58.9%
associate-*r/58.9%
sub-neg58.9%
mul-1-neg58.9%
associate-*r/58.9%
associate-*r/58.9%
mul-1-neg58.9%
sub-neg58.9%
associate-/l*58.0%
associate-/r/58.9%
Simplified58.9%
if 2e11 < B Initial program 54.2%
Simplified79.6%
div-inv79.6%
Applied egg-rr79.6%
Taylor expanded in C around 0 49.9%
unpow249.9%
unpow249.9%
hypot-def73.7%
associate-*r/73.7%
distribute-lft-in73.7%
neg-mul-173.7%
sub-neg73.7%
mul-1-neg73.7%
hypot-def49.9%
unpow249.9%
unpow249.9%
+-commutative49.9%
unpow249.9%
unpow249.9%
hypot-def73.7%
Simplified73.7%
Taylor expanded in A around 0 71.6%
neg-mul-171.6%
+-commutative71.6%
unsub-neg71.6%
mul-1-neg71.6%
Simplified71.6%
associate-*l/71.6%
div-sub71.6%
pow171.6%
pow171.6%
pow-div71.6%
metadata-eval71.6%
metadata-eval71.6%
Applied egg-rr71.6%
Final simplification67.5%
(FPCore (A B C)
:precision binary64
(if (<= A -9.2e-304)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 9.6e-239)
(* (/ 180.0 PI) (atan (* -0.5 (/ B C))))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -9.2e-304) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 9.6e-239) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
} 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 <= -9.2e-304) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 9.6e-239) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -9.2e-304: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 9.6e-239: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) else: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -9.2e-304) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 9.6e-239) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); 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 <= -9.2e-304) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 9.6e-239) tmp = (180.0 / pi) * atan((-0.5 * (B / C))); else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -9.2e-304], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 9.6e-239], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $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 -9.2 \cdot 10^{-304}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 9.6 \cdot 10^{-239}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -9.1999999999999998e-304Initial program 44.0%
Simplified40.2%
Taylor expanded in A around -inf 60.8%
associate-*r/60.8%
Simplified60.8%
if -9.1999999999999998e-304 < A < 9.59999999999999971e-239Initial program 56.1%
Simplified70.1%
Taylor expanded in B around 0 48.3%
Taylor expanded in C around inf 48.4%
if 9.59999999999999971e-239 < A Initial program 69.8%
Simplified69.8%
Taylor expanded in C around 0 67.0%
associate-*r/67.0%
mul-1-neg67.0%
unpow267.0%
unpow267.0%
hypot-def82.7%
Simplified82.7%
Taylor expanded in B around -inf 68.8%
mul-1-neg68.8%
unsub-neg68.8%
Simplified68.8%
Final simplification63.6%
(FPCore (A B C)
:precision binary64
(if (<= A -2.5e-306)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= A 1.35e-238)
(* (/ 180.0 PI) (atan (* -0.5 (/ B C))))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.5e-306) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (A <= 1.35e-238) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
} 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.5e-306) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (A <= 1.35e-238) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.5e-306: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif A <= 1.35e-238: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) 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.5e-306) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (A <= 1.35e-238) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); 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.5e-306) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (A <= 1.35e-238) tmp = (180.0 / pi) * atan((-0.5 * (B / C))); else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.5e-306], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.35e-238], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $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 -2.5 \cdot 10^{-306}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;A \leq 1.35 \cdot 10^{-238}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.49999999999999999e-306Initial program 44.0%
Simplified53.9%
div-inv53.9%
Applied egg-rr53.9%
Taylor expanded in A around -inf 60.9%
if -2.49999999999999999e-306 < A < 1.34999999999999995e-238Initial program 56.1%
Simplified70.1%
Taylor expanded in B around 0 48.3%
Taylor expanded in C around inf 48.4%
if 1.34999999999999995e-238 < A Initial program 69.8%
Simplified69.8%
Taylor expanded in C around 0 67.0%
associate-*r/67.0%
mul-1-neg67.0%
unpow267.0%
unpow267.0%
hypot-def82.7%
Simplified82.7%
Taylor expanded in B around -inf 68.8%
mul-1-neg68.8%
unsub-neg68.8%
Simplified68.8%
Final simplification63.7%
(FPCore (A B C)
:precision binary64
(if (<= B -3.4e-146)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4e-53)
(* 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 <= -3.4e-146) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4e-53) {
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 <= -3.4e-146) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4e-53) {
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 <= -3.4e-146: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4e-53: 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 <= -3.4e-146) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4e-53) 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 <= -3.4e-146) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4e-53) 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, -3.4e-146], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4e-53], 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 -3.4 \cdot 10^{-146}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4 \cdot 10^{-53}:\\
\;\;\;\;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 < -3.4000000000000001e-146Initial program 57.3%
Simplified57.3%
Taylor expanded in B around -inf 45.8%
if -3.4000000000000001e-146 < B < 4.00000000000000012e-53Initial program 56.9%
Simplified51.7%
Taylor expanded in C around inf 33.9%
mul-1-neg33.9%
distribute-rgt1-in33.9%
metadata-eval33.9%
mul0-lft33.9%
distribute-frac-neg33.9%
metadata-eval33.9%
Simplified33.9%
if 4.00000000000000012e-53 < B Initial program 53.7%
Simplified53.6%
Taylor expanded in B around inf 48.6%
Final simplification42.2%
(FPCore (A B C) :precision binary64 (if (<= A -8.2e-308) (* 180.0 (/ (atan (/ (* B 0.5) A)) PI)) (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -8.2e-308) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((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 <= -8.2e-308) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / 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 <= -8.2e-308: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / 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 <= -8.2e-308) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / 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 <= -8.2e-308) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -8.2e-308], 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[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.2 \cdot 10^{-308}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.19999999999999965e-308Initial program 44.0%
Simplified40.2%
Taylor expanded in A around -inf 60.8%
associate-*r/60.8%
Simplified60.8%
if -8.19999999999999965e-308 < A Initial program 68.2%
Simplified68.2%
Taylor expanded in C around 0 61.4%
associate-*r/61.4%
mul-1-neg61.4%
unpow261.4%
unpow261.4%
hypot-def76.3%
Simplified76.3%
Taylor expanded in B around -inf 62.4%
mul-1-neg62.4%
unsub-neg62.4%
Simplified62.4%
Final simplification61.6%
(FPCore (A B C) :precision binary64 (if (<= B -5e-294) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5e-294) {
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 <= -5e-294) {
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 <= -5e-294: 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 <= -5e-294) 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 <= -5e-294) 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, -5e-294], 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 -5 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -5.0000000000000003e-294Initial program 59.9%
Simplified57.7%
Taylor expanded in B around -inf 36.8%
if -5.0000000000000003e-294 < B Initial program 52.3%
Simplified50.8%
Taylor expanded in B around inf 31.9%
Final simplification34.4%
(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 56.2%
Simplified54.3%
Taylor expanded in B around inf 16.5%
Final simplification16.5%
herbie shell --seed 2023263
(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)))