
(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 18 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 -4.8e+122) (* (/ 180.0 PI) (atan (/ (* 0.5 B) 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.8e+122) {
tmp = (180.0 / ((double) M_PI)) * atan(((0.5 * B) / 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.8e+122) {
tmp = (180.0 / Math.PI) * Math.atan(((0.5 * B) / 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.8e+122: tmp = (180.0 / math.pi) * math.atan(((0.5 * B) / 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.8e+122) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(0.5 * B) / A))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - 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.8e+122) tmp = (180.0 / pi) * atan(((0.5 * B) / 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.8e+122], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.8 \cdot 10^{+122}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.8000000000000004e122Initial program 13.3%
Taylor expanded in A around -inf 77.1%
associate-*r/77.1%
Simplified77.1%
clear-num75.8%
un-div-inv75.9%
associate-/l*75.9%
Applied egg-rr75.9%
associate-/r/77.3%
associate-*r/77.3%
Simplified77.3%
if -4.8000000000000004e122 < A Initial program 60.4%
Simplified86.7%
Final simplification84.9%
(FPCore (A B C)
:precision binary64
(if (<= C -2.05e+40)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(if (<= C 1.8e+178)
(* 180.0 (/ (atan (/ (+ A (hypot B A)) (- B))) PI))
(* (/ 180.0 PI) (atan (* -0.5 (/ B C)))))))
double code(double A, double B, double C) {
double tmp;
if (C <= -2.05e+40) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else if (C <= 1.8e+178) {
tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -2.05e+40) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else if (C <= 1.8e+178) {
tmp = 180.0 * (Math.atan(((A + Math.hypot(B, A)) / -B)) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -2.05e+40: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) elif C <= 1.8e+178: tmp = 180.0 * (math.atan(((A + math.hypot(B, A)) / -B)) / math.pi) else: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -2.05e+40) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); elseif (C <= 1.8e+178) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) / Float64(-B))) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -2.05e+40) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); elseif (C <= 1.8e+178) tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / pi); else tmp = (180.0 / pi) * atan((-0.5 * (B / C))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -2.05e+40], 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[C, 1.8e+178], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -2.05 \cdot 10^{+40}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.8 \cdot 10^{+178}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\end{array}
\end{array}
if C < -2.0500000000000001e40Initial program 79.4%
Taylor expanded in A around 0 79.4%
unpow279.4%
unpow279.4%
hypot-define96.7%
Simplified96.7%
if -2.0500000000000001e40 < C < 1.7999999999999999e178Initial program 48.1%
Taylor expanded in C around 0 47.0%
mul-1-neg47.0%
distribute-neg-frac247.0%
+-commutative47.0%
unpow247.0%
unpow247.0%
hypot-define77.0%
Simplified77.0%
if 1.7999999999999999e178 < C Initial program 8.9%
Taylor expanded in A around 0 8.9%
unpow28.9%
unpow28.9%
hypot-define44.3%
Simplified44.3%
Taylor expanded in C around inf 88.9%
associate-*r/88.9%
Simplified88.9%
Taylor expanded in B around 0 88.9%
associate-*r/89.0%
*-commutative89.0%
associate-/l*89.0%
Simplified89.0%
Final simplification82.6%
(FPCore (A B C)
:precision binary64
(if (<= A -8.5e+128)
(* (/ 180.0 PI) (atan (/ (* 0.5 B) A)))
(if (<= A 1.1e+57)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -8.5e+128) {
tmp = (180.0 / ((double) M_PI)) * atan(((0.5 * B) / A));
} else if (A <= 1.1e+57) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -8.5e+128) {
tmp = (180.0 / Math.PI) * Math.atan(((0.5 * B) / A));
} else if (A <= 1.1e+57) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -8.5e+128: tmp = (180.0 / math.pi) * math.atan(((0.5 * B) / A)) elif A <= 1.1e+57: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -8.5e+128) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(0.5 * B) / A))); elseif (A <= 1.1e+57) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -8.5e+128) tmp = (180.0 / pi) * atan(((0.5 * B) / A)); elseif (A <= 1.1e+57) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -8.5e+128], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.1e+57], 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[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.5 \cdot 10^{+128}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)\\
\mathbf{elif}\;A \leq 1.1 \cdot 10^{+57}:\\
\;\;\;\;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{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.50000000000000045e128Initial program 13.3%
Taylor expanded in A around -inf 77.1%
associate-*r/77.1%
Simplified77.1%
clear-num75.8%
un-div-inv75.9%
associate-/l*75.9%
Applied egg-rr75.9%
associate-/r/77.3%
associate-*r/77.3%
Simplified77.3%
if -8.50000000000000045e128 < A < 1.1e57Initial program 54.1%
Taylor expanded in A around 0 51.2%
unpow251.2%
unpow251.2%
hypot-define79.8%
Simplified79.8%
if 1.1e57 < A Initial program 78.2%
Simplified98.2%
Taylor expanded in B around inf 89.6%
+-commutative89.6%
Simplified89.6%
Final simplification81.4%
(FPCore (A B C) :precision binary64 (if (<= A -3.3e+124) (* (/ 180.0 PI) (atan (/ (* 0.5 B) A))) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.3e+124) {
tmp = (180.0 / ((double) M_PI)) * atan(((0.5 * B) / 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 <= -3.3e+124) {
tmp = (180.0 / Math.PI) * Math.atan(((0.5 * B) / 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 <= -3.3e+124: tmp = (180.0 / math.pi) * math.atan(((0.5 * B) / 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 <= -3.3e+124) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(0.5 * B) / 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 <= -3.3e+124) tmp = (180.0 / pi) * atan(((0.5 * B) / 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, -3.3e+124], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $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 -3.3 \cdot 10^{+124}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{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 < -3.30000000000000015e124Initial program 13.3%
Taylor expanded in A around -inf 77.1%
associate-*r/77.1%
Simplified77.1%
clear-num75.8%
un-div-inv75.9%
associate-/l*75.9%
Applied egg-rr75.9%
associate-/r/77.3%
associate-*r/77.3%
Simplified77.3%
if -3.30000000000000015e124 < A Initial program 60.4%
Simplified86.5%
Final simplification84.7%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ C B)) PI)))
(t_1 (* 180.0 (/ (atan -1.0) PI)))
(t_2 (* 180.0 (/ (atan (/ 0.0 B)) PI))))
(if (<= B -3.6e-25)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 9e-295)
t_0
(if (<= B 6e-183)
t_2
(if (<= B 2.85e-123)
t_0
(if (<= B 2.35e-89)
t_1
(if (<= B 1.85e-76) t_2 (if (<= B 2.4e-30) t_0 t_1)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((C / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan(-1.0) / ((double) M_PI));
double t_2 = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
double tmp;
if (B <= -3.6e-25) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 9e-295) {
tmp = t_0;
} else if (B <= 6e-183) {
tmp = t_2;
} else if (B <= 2.85e-123) {
tmp = t_0;
} else if (B <= 2.35e-89) {
tmp = t_1;
} else if (B <= 1.85e-76) {
tmp = t_2;
} else if (B <= 2.4e-30) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((C / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan(-1.0) / Math.PI);
double t_2 = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
double tmp;
if (B <= -3.6e-25) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 9e-295) {
tmp = t_0;
} else if (B <= 6e-183) {
tmp = t_2;
} else if (B <= 2.85e-123) {
tmp = t_0;
} else if (B <= 2.35e-89) {
tmp = t_1;
} else if (B <= 1.85e-76) {
tmp = t_2;
} else if (B <= 2.4e-30) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((C / B)) / math.pi) t_1 = 180.0 * (math.atan(-1.0) / math.pi) t_2 = 180.0 * (math.atan((0.0 / B)) / math.pi) tmp = 0 if B <= -3.6e-25: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 9e-295: tmp = t_0 elif B <= 6e-183: tmp = t_2 elif B <= 2.85e-123: tmp = t_0 elif B <= 2.35e-89: tmp = t_1 elif B <= 1.85e-76: tmp = t_2 elif B <= 2.4e-30: tmp = t_0 else: tmp = t_1 return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(-1.0) / pi)) t_2 = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)) tmp = 0.0 if (B <= -3.6e-25) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 9e-295) tmp = t_0; elseif (B <= 6e-183) tmp = t_2; elseif (B <= 2.85e-123) tmp = t_0; elseif (B <= 2.35e-89) tmp = t_1; elseif (B <= 1.85e-76) tmp = t_2; elseif (B <= 2.4e-30) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((C / B)) / pi); t_1 = 180.0 * (atan(-1.0) / pi); t_2 = 180.0 * (atan((0.0 / B)) / pi); tmp = 0.0; if (B <= -3.6e-25) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 9e-295) tmp = t_0; elseif (B <= 6e-183) tmp = t_2; elseif (B <= 2.85e-123) tmp = t_0; elseif (B <= 2.35e-89) tmp = t_1; elseif (B <= 1.85e-76) tmp = t_2; elseif (B <= 2.4e-30) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.6e-25], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9e-295], t$95$0, If[LessEqual[B, 6e-183], t$95$2, If[LessEqual[B, 2.85e-123], t$95$0, If[LessEqual[B, 2.35e-89], t$95$1, If[LessEqual[B, 1.85e-76], t$95$2, If[LessEqual[B, 2.4e-30], t$95$0, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
t_2 := 180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -3.6 \cdot 10^{-25}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 9 \cdot 10^{-295}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 6 \cdot 10^{-183}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;B \leq 2.85 \cdot 10^{-123}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 2.35 \cdot 10^{-89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{-76}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;B \leq 2.4 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if B < -3.5999999999999999e-25Initial program 45.6%
Taylor expanded in B around -inf 62.9%
if -3.5999999999999999e-25 < B < 9.0000000000000003e-295 or 5.9999999999999996e-183 < B < 2.85000000000000014e-123 or 1.85000000000000006e-76 < B < 2.39999999999999985e-30Initial program 61.1%
Taylor expanded in A around 0 48.5%
unpow248.5%
unpow248.5%
hypot-define57.8%
Simplified57.8%
Taylor expanded in B around -inf 44.0%
+-commutative44.0%
Simplified44.0%
Taylor expanded in C around inf 41.8%
if 9.0000000000000003e-295 < B < 5.9999999999999996e-183 or 2.34999999999999998e-89 < B < 1.85000000000000006e-76Initial program 45.6%
Taylor expanded in C around inf 54.1%
associate-*r/54.1%
distribute-rgt1-in54.1%
metadata-eval54.1%
mul0-lft54.1%
metadata-eval54.1%
Simplified54.1%
if 2.85000000000000014e-123 < B < 2.34999999999999998e-89 or 2.39999999999999985e-30 < B Initial program 48.3%
Taylor expanded in B around inf 58.8%
Final simplification54.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ A (- B))) PI))))
(if (<= B -1.2e-61)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.3e-285)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
(if (<= B 2.1e-181)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 3.6e-155)
t_0
(if (<= B 8e-85)
(* 180.0 (/ (atan (/ (* B -0.5) C)) PI))
(if (<= B 1.8e-74)
t_0
(if (<= B 4.2e-17)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((A / -B)) / ((double) M_PI));
double tmp;
if (B <= -1.2e-61) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.3e-285) {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
} else if (B <= 2.1e-181) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 3.6e-155) {
tmp = t_0;
} else if (B <= 8e-85) {
tmp = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
} else if (B <= 1.8e-74) {
tmp = t_0;
} else if (B <= 4.2e-17) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((A / -B)) / Math.PI);
double tmp;
if (B <= -1.2e-61) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.3e-285) {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
} else if (B <= 2.1e-181) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 3.6e-155) {
tmp = t_0;
} else if (B <= 8e-85) {
tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
} else if (B <= 1.8e-74) {
tmp = t_0;
} else if (B <= 4.2e-17) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((A / -B)) / math.pi) tmp = 0 if B <= -1.2e-61: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.3e-285: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) elif B <= 2.1e-181: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 3.6e-155: tmp = t_0 elif B <= 8e-85: tmp = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi) elif B <= 1.8e-74: tmp = t_0 elif B <= 4.2e-17: tmp = 180.0 * (math.atan((C / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(A / Float64(-B))) / pi)) tmp = 0.0 if (B <= -1.2e-61) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.3e-285) tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); elseif (B <= 2.1e-181) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 3.6e-155) tmp = t_0; elseif (B <= 8e-85) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi)); elseif (B <= 1.8e-74) tmp = t_0; elseif (B <= 4.2e-17) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((A / -B)) / pi); tmp = 0.0; if (B <= -1.2e-61) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.3e-285) tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); elseif (B <= 2.1e-181) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 3.6e-155) tmp = t_0; elseif (B <= 8e-85) tmp = 180.0 * (atan(((B * -0.5) / C)) / pi); elseif (B <= 1.8e-74) tmp = t_0; elseif (B <= 4.2e-17) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.2e-61], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.3e-285], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.1e-181], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.6e-155], t$95$0, If[LessEqual[B, 8e-85], N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.8e-74], t$95$0, If[LessEqual[B, 4.2e-17], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{if}\;B \leq -1.2 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.3 \cdot 10^{-285}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.1 \cdot 10^{-181}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.6 \cdot 10^{-155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 8 \cdot 10^{-85}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.8 \cdot 10^{-74}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 4.2 \cdot 10^{-17}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.2e-61Initial program 45.3%
Taylor expanded in B around -inf 59.3%
if -1.2e-61 < B < 1.3000000000000001e-285Initial program 68.6%
Taylor expanded in A around inf 52.9%
if 1.3000000000000001e-285 < B < 2.10000000000000003e-181Initial program 44.3%
Taylor expanded in C around inf 54.6%
associate-*r/54.6%
distribute-rgt1-in54.6%
metadata-eval54.6%
mul0-lft54.6%
metadata-eval54.6%
Simplified54.6%
if 2.10000000000000003e-181 < B < 3.59999999999999989e-155 or 7.9999999999999998e-85 < B < 1.8000000000000001e-74Initial program 85.1%
Simplified99.7%
Taylor expanded in B around -inf 75.5%
neg-mul-175.5%
unsub-neg75.5%
Simplified75.5%
Taylor expanded in A around inf 75.5%
mul-1-neg75.5%
distribute-neg-frac275.5%
Simplified75.5%
if 3.59999999999999989e-155 < B < 7.9999999999999998e-85Initial program 39.6%
Taylor expanded in A around 0 39.9%
unpow239.9%
unpow239.9%
hypot-define50.1%
Simplified50.1%
Taylor expanded in C around inf 34.7%
associate-*r/34.7%
Simplified34.7%
if 1.8000000000000001e-74 < B < 4.19999999999999984e-17Initial program 48.2%
Taylor expanded in A around 0 49.2%
unpow249.2%
unpow249.2%
hypot-define49.2%
Simplified49.2%
Taylor expanded in B around -inf 40.0%
+-commutative40.0%
Simplified40.0%
Taylor expanded in C around inf 40.1%
if 4.19999999999999984e-17 < B Initial program 46.4%
Taylor expanded in B around inf 62.0%
Final simplification56.5%
(FPCore (A B C)
:precision binary64
(if (<= B -3e-63)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 9.5e-295)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
(if (<= B 7.5e-182)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 3.55e-152)
(* 180.0 (/ (atan (/ A (- B))) PI))
(if (<= B 1.85e-22)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3e-63) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 9.5e-295) {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
} else if (B <= 7.5e-182) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 3.55e-152) {
tmp = 180.0 * (atan((A / -B)) / ((double) M_PI));
} else if (B <= 1.85e-22) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((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 <= -3e-63) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 9.5e-295) {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
} else if (B <= 7.5e-182) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 3.55e-152) {
tmp = 180.0 * (Math.atan((A / -B)) / Math.PI);
} else if (B <= 1.85e-22) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3e-63: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 9.5e-295: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) elif B <= 7.5e-182: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 3.55e-152: tmp = 180.0 * (math.atan((A / -B)) / math.pi) elif B <= 1.85e-22: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -3e-63) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 9.5e-295) tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); elseif (B <= 7.5e-182) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 3.55e-152) tmp = Float64(180.0 * Float64(atan(Float64(A / Float64(-B))) / pi)); elseif (B <= 1.85e-22) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / 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 <= -3e-63) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 9.5e-295) tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); elseif (B <= 7.5e-182) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 3.55e-152) tmp = 180.0 * (atan((A / -B)) / pi); elseif (B <= 1.85e-22) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3e-63], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.5e-295], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.5e-182], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.55e-152], N[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.85e-22], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $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 \cdot 10^{-63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 9.5 \cdot 10^{-295}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 7.5 \cdot 10^{-182}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.55 \cdot 10^{-152}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{-22}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.99999999999999979e-63Initial program 45.3%
Taylor expanded in B around -inf 59.3%
if -2.99999999999999979e-63 < B < 9.5e-295Initial program 68.6%
Taylor expanded in A around inf 52.9%
if 9.5e-295 < B < 7.49999999999999935e-182Initial program 44.3%
Taylor expanded in C around inf 54.6%
associate-*r/54.6%
distribute-rgt1-in54.6%
metadata-eval54.6%
mul0-lft54.6%
metadata-eval54.6%
Simplified54.6%
if 7.49999999999999935e-182 < B < 3.55000000000000005e-152Initial program 82.3%
Simplified90.1%
Taylor expanded in B around -inf 70.5%
neg-mul-170.5%
unsub-neg70.5%
Simplified70.5%
Taylor expanded in A around inf 70.8%
mul-1-neg70.8%
distribute-neg-frac270.8%
Simplified70.8%
if 3.55000000000000005e-152 < B < 1.85e-22Initial program 43.0%
Taylor expanded in A around -inf 54.6%
associate-*r/54.6%
Simplified54.6%
if 1.85e-22 < B Initial program 47.8%
Taylor expanded in B around inf 61.9%
Final simplification58.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ A (- B))) PI))))
(if (<= B -4.1e-63)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4.8e-295)
t_0
(if (<= B 6e-181)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 2.7e-115) t_0 (* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((A / -B)) / ((double) M_PI));
double tmp;
if (B <= -4.1e-63) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4.8e-295) {
tmp = t_0;
} else if (B <= 6e-181) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 2.7e-115) {
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.atan((A / -B)) / Math.PI);
double tmp;
if (B <= -4.1e-63) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4.8e-295) {
tmp = t_0;
} else if (B <= 6e-181) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 2.7e-115) {
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.atan((A / -B)) / math.pi) tmp = 0 if B <= -4.1e-63: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4.8e-295: tmp = t_0 elif B <= 6e-181: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 2.7e-115: tmp = t_0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(A / Float64(-B))) / pi)) tmp = 0.0 if (B <= -4.1e-63) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4.8e-295) tmp = t_0; elseif (B <= 6e-181) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 2.7e-115) 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 * (atan((A / -B)) / pi); tmp = 0.0; if (B <= -4.1e-63) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4.8e-295) tmp = t_0; elseif (B <= 6e-181) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 2.7e-115) 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[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -4.1e-63], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.8e-295], t$95$0, If[LessEqual[B, 6e-181], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.7e-115], t$95$0, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{if}\;B \leq -4.1 \cdot 10^{-63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4.8 \cdot 10^{-295}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 6 \cdot 10^{-181}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.7 \cdot 10^{-115}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.0999999999999998e-63Initial program 45.3%
Taylor expanded in B around -inf 59.3%
if -4.0999999999999998e-63 < B < 4.7999999999999996e-295 or 5.99999999999999948e-181 < B < 2.7e-115Initial program 67.1%
Simplified75.6%
Taylor expanded in B around -inf 64.5%
neg-mul-164.5%
unsub-neg64.5%
Simplified64.5%
Taylor expanded in A around inf 52.5%
mul-1-neg52.5%
distribute-neg-frac252.5%
Simplified52.5%
if 4.7999999999999996e-295 < B < 5.99999999999999948e-181Initial program 44.3%
Taylor expanded in C around inf 54.6%
associate-*r/54.6%
distribute-rgt1-in54.6%
metadata-eval54.6%
mul0-lft54.6%
metadata-eval54.6%
Simplified54.6%
if 2.7e-115 < B Initial program 46.9%
Taylor expanded in B around inf 51.9%
Final simplification54.4%
(FPCore (A B C)
:precision binary64
(if (<= B -7.2e-58)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 9e-294)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
(if (<= B 3.9e-182)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 2.3e-114)
(* 180.0 (/ (atan (/ A (- B))) PI))
(* 180.0 (/ (atan -1.0) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7.2e-58) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 9e-294) {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
} else if (B <= 3.9e-182) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 2.3e-114) {
tmp = 180.0 * (atan((A / -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 <= -7.2e-58) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 9e-294) {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
} else if (B <= 3.9e-182) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 2.3e-114) {
tmp = 180.0 * (Math.atan((A / -B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -7.2e-58: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 9e-294: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) elif B <= 3.9e-182: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 2.3e-114: tmp = 180.0 * (math.atan((A / -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 <= -7.2e-58) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 9e-294) tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); elseif (B <= 3.9e-182) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 2.3e-114) tmp = Float64(180.0 * Float64(atan(Float64(A / Float64(-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 <= -7.2e-58) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 9e-294) tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); elseif (B <= 3.9e-182) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 2.3e-114) tmp = 180.0 * (atan((A / -B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -7.2e-58], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9e-294], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.9e-182], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.3e-114], N[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -7.2 \cdot 10^{-58}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 9 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.9 \cdot 10^{-182}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.3 \cdot 10^{-114}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -7.20000000000000019e-58Initial program 45.3%
Taylor expanded in B around -inf 59.3%
if -7.20000000000000019e-58 < B < 8.99999999999999963e-294Initial program 68.6%
Taylor expanded in A around inf 52.9%
if 8.99999999999999963e-294 < B < 3.9e-182Initial program 44.3%
Taylor expanded in C around inf 54.6%
associate-*r/54.6%
distribute-rgt1-in54.6%
metadata-eval54.6%
mul0-lft54.6%
metadata-eval54.6%
Simplified54.6%
if 3.9e-182 < B < 2.2999999999999999e-114Initial program 63.4%
Simplified73.4%
Taylor expanded in B around -inf 56.6%
neg-mul-156.6%
unsub-neg56.6%
Simplified56.6%
Taylor expanded in A around inf 51.3%
mul-1-neg51.3%
distribute-neg-frac251.3%
Simplified51.3%
if 2.2999999999999999e-114 < B Initial program 46.9%
Taylor expanded in B around inf 51.9%
Final simplification54.4%
(FPCore (A B C)
:precision binary64
(if (<= A -2.1e+32)
(* (/ 180.0 PI) (atan (/ (* 0.5 B) A)))
(if (or (<= A 2.4e-190) (not (<= A 2.8e+54)))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))
(* 180.0 (/ (atan (/ (+ B C) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.1e+32) {
tmp = (180.0 / ((double) M_PI)) * atan(((0.5 * B) / A));
} else if ((A <= 2.4e-190) || !(A <= 2.8e+54)) {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.1e+32) {
tmp = (180.0 / Math.PI) * Math.atan(((0.5 * B) / A));
} else if ((A <= 2.4e-190) || !(A <= 2.8e+54)) {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.1e+32: tmp = (180.0 / math.pi) * math.atan(((0.5 * B) / A)) elif (A <= 2.4e-190) or not (A <= 2.8e+54): tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.1e+32) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(0.5 * B) / A))); elseif ((A <= 2.4e-190) || !(A <= 2.8e+54)) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.1e+32) tmp = (180.0 / pi) * atan(((0.5 * B) / A)); elseif ((A <= 2.4e-190) || ~((A <= 2.8e+54))) tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); else tmp = 180.0 * (atan(((B + C) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.1e+32], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[A, 2.4e-190], N[Not[LessEqual[A, 2.8e+54]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.1 \cdot 10^{+32}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)\\
\mathbf{elif}\;A \leq 2.4 \cdot 10^{-190} \lor \neg \left(A \leq 2.8 \cdot 10^{+54}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.1000000000000001e32Initial program 22.3%
Taylor expanded in A around -inf 69.2%
associate-*r/69.2%
Simplified69.2%
clear-num68.7%
un-div-inv68.7%
associate-/l*68.7%
Applied egg-rr68.7%
associate-/r/69.4%
associate-*r/69.4%
Simplified69.4%
if -2.1000000000000001e32 < A < 2.4e-190 or 2.80000000000000015e54 < A Initial program 65.3%
Simplified88.4%
Taylor expanded in B around inf 68.3%
+-commutative68.3%
Simplified68.3%
if 2.4e-190 < A < 2.80000000000000015e54Initial program 52.4%
Taylor expanded in A around 0 46.3%
unpow246.3%
unpow246.3%
hypot-define82.3%
Simplified82.3%
Taylor expanded in B around -inf 61.5%
+-commutative61.5%
Simplified61.5%
Final simplification67.4%
(FPCore (A B C)
:precision binary64
(if (<= A -6.9e+31)
(* (/ 180.0 PI) (atan (/ (* 0.5 B) A)))
(if (or (<= A 1.5e-190) (not (<= A 7e+55)))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))
(* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -6.9e+31) {
tmp = (180.0 / ((double) M_PI)) * atan(((0.5 * B) / A));
} else if ((A <= 1.5e-190) || !(A <= 7e+55)) {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((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 tmp;
if (A <= -6.9e+31) {
tmp = (180.0 / Math.PI) * Math.atan(((0.5 * B) / A));
} else if ((A <= 1.5e-190) || !(A <= 7e+55)) {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6.9e+31: tmp = (180.0 / math.pi) * math.atan(((0.5 * B) / A)) elif (A <= 1.5e-190) or not (A <= 7e+55): tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6.9e+31) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(0.5 * B) / A))); elseif ((A <= 1.5e-190) || !(A <= 7e+55)) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -6.9e+31) tmp = (180.0 / pi) * atan(((0.5 * B) / A)); elseif ((A <= 1.5e-190) || ~((A <= 7e+55))) tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); else tmp = 180.0 * (atan(((C + (B - A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6.9e+31], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[A, 1.5e-190], N[Not[LessEqual[A, 7e+55]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.9 \cdot 10^{+31}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)\\
\mathbf{elif}\;A \leq 1.5 \cdot 10^{-190} \lor \neg \left(A \leq 7 \cdot 10^{+55}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -6.8999999999999999e31Initial program 22.3%
Taylor expanded in A around -inf 69.2%
associate-*r/69.2%
Simplified69.2%
clear-num68.7%
un-div-inv68.7%
associate-/l*68.7%
Applied egg-rr68.7%
associate-/r/69.4%
associate-*r/69.4%
Simplified69.4%
if -6.8999999999999999e31 < A < 1.4999999999999999e-190 or 7.00000000000000021e55 < A Initial program 65.3%
Simplified88.4%
Taylor expanded in B around inf 68.3%
+-commutative68.3%
Simplified68.3%
if 1.4999999999999999e-190 < A < 7.00000000000000021e55Initial program 52.4%
Simplified87.6%
Taylor expanded in B around -inf 67.1%
neg-mul-167.1%
unsub-neg67.1%
Simplified67.1%
Final simplification68.4%
(FPCore (A B C)
:precision binary64
(if (<= A -1.06e+35)
(* (/ 180.0 PI) (atan (/ (* 0.5 B) A)))
(if (<= A 1.65e+74)
(* 180.0 (/ (atan (/ (+ B C) B)) PI))
(* 180.0 (/ (atan (/ (+ A B) (- B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.06e+35) {
tmp = (180.0 / ((double) M_PI)) * atan(((0.5 * B) / A));
} else if (A <= 1.65e+74) {
tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A + B) / -B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.06e+35) {
tmp = (180.0 / Math.PI) * Math.atan(((0.5 * B) / A));
} else if (A <= 1.65e+74) {
tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A + B) / -B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.06e+35: tmp = (180.0 / math.pi) * math.atan(((0.5 * B) / A)) elif A <= 1.65e+74: tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((A + B) / -B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.06e+35) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(0.5 * B) / A))); elseif (A <= 1.65e+74) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + B) / Float64(-B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.06e+35) tmp = (180.0 / pi) * atan(((0.5 * B) / A)); elseif (A <= 1.65e+74) tmp = 180.0 * (atan(((B + C) / B)) / pi); else tmp = 180.0 * (atan(((A + B) / -B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.06e+35], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.65e+74], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A + B), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.06 \cdot 10^{+35}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)\\
\mathbf{elif}\;A \leq 1.65 \cdot 10^{+74}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + B}{-B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.0600000000000001e35Initial program 22.3%
Taylor expanded in A around -inf 69.9%
associate-*r/69.9%
Simplified69.9%
clear-num69.4%
un-div-inv69.4%
associate-/l*69.4%
Applied egg-rr69.4%
associate-/r/70.1%
associate-*r/70.1%
Simplified70.1%
if -1.0600000000000001e35 < A < 1.6500000000000001e74Initial program 55.9%
Taylor expanded in A around 0 53.5%
unpow253.5%
unpow253.5%
hypot-define82.1%
Simplified82.1%
Taylor expanded in B around -inf 52.4%
+-commutative52.4%
Simplified52.4%
if 1.6500000000000001e74 < A Initial program 77.4%
Taylor expanded in C around 0 77.4%
mul-1-neg77.4%
distribute-neg-frac277.4%
+-commutative77.4%
unpow277.4%
unpow277.4%
hypot-define91.3%
Simplified91.3%
Taylor expanded in A around 0 85.8%
+-commutative85.8%
Simplified85.8%
Final simplification63.9%
(FPCore (A B C)
:precision binary64
(if (<= A -3.25e+38)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(if (<= A 1.6e+74)
(* 180.0 (/ (atan (/ (+ B C) B)) PI))
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.25e+38) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else if (A <= 1.6e+74) {
tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.25e+38) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else if (A <= 1.6e+74) {
tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.25e+38: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) elif A <= 1.6e+74: tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.25e+38) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); elseif (A <= 1.6e+74) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.25e+38) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); elseif (A <= 1.6e+74) tmp = 180.0 * (atan(((B + C) / B)) / pi); else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.25e+38], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.6e+74], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.25 \cdot 10^{+38}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.6 \cdot 10^{+74}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.25e38Initial program 22.3%
Taylor expanded in A around -inf 69.9%
associate-*r/69.9%
Simplified69.9%
if -3.25e38 < A < 1.59999999999999997e74Initial program 55.9%
Taylor expanded in A around 0 53.5%
unpow253.5%
unpow253.5%
hypot-define82.1%
Simplified82.1%
Taylor expanded in B around -inf 52.4%
+-commutative52.4%
Simplified52.4%
if 1.59999999999999997e74 < A Initial program 77.4%
Taylor expanded in A around inf 72.9%
Final simplification61.3%
(FPCore (A B C)
:precision binary64
(if (<= A -1.55e+42)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(if (<= A 2.45e+14)
(* 180.0 (/ (atan (/ (+ B C) B)) PI))
(* 180.0 (/ (atan (/ (- B A) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.55e+42) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else if (A <= 2.45e+14) {
tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((B - A) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.55e+42) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else if (A <= 2.45e+14) {
tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((B - A) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.55e+42: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) elif A <= 2.45e+14: tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((B - A) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.55e+42) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); elseif (A <= 2.45e+14) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.55e+42) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); elseif (A <= 2.45e+14) tmp = 180.0 * (atan(((B + C) / B)) / pi); else tmp = 180.0 * (atan(((B - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.55e+42], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.45e+14], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.55 \cdot 10^{+42}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.45 \cdot 10^{+14}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.5500000000000001e42Initial program 22.3%
Taylor expanded in A around -inf 69.9%
associate-*r/69.9%
Simplified69.9%
if -1.5500000000000001e42 < A < 2.45e14Initial program 55.6%
Taylor expanded in A around 0 53.6%
unpow253.6%
unpow253.6%
hypot-define83.0%
Simplified83.0%
Taylor expanded in B around -inf 51.2%
+-commutative51.2%
Simplified51.2%
if 2.45e14 < A Initial program 75.0%
Simplified95.2%
Taylor expanded in B around -inf 77.9%
neg-mul-177.9%
unsub-neg77.9%
Simplified77.9%
Taylor expanded in C around 0 73.6%
Final simplification61.6%
(FPCore (A B C)
:precision binary64
(if (<= A -1.8e+33)
(* (/ 180.0 PI) (atan (/ (* 0.5 B) A)))
(if (<= A 2.6e+14)
(* 180.0 (/ (atan (/ (+ B C) B)) PI))
(* 180.0 (/ (atan (/ (- B A) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.8e+33) {
tmp = (180.0 / ((double) M_PI)) * atan(((0.5 * B) / A));
} else if (A <= 2.6e+14) {
tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((B - A) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.8e+33) {
tmp = (180.0 / Math.PI) * Math.atan(((0.5 * B) / A));
} else if (A <= 2.6e+14) {
tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((B - A) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.8e+33: tmp = (180.0 / math.pi) * math.atan(((0.5 * B) / A)) elif A <= 2.6e+14: tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((B - A) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.8e+33) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(0.5 * B) / A))); elseif (A <= 2.6e+14) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.8e+33) tmp = (180.0 / pi) * atan(((0.5 * B) / A)); elseif (A <= 2.6e+14) tmp = 180.0 * (atan(((B + C) / B)) / pi); else tmp = 180.0 * (atan(((B - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.8e+33], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.6e+14], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.8 \cdot 10^{+33}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)\\
\mathbf{elif}\;A \leq 2.6 \cdot 10^{+14}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.8000000000000001e33Initial program 22.3%
Taylor expanded in A around -inf 69.9%
associate-*r/69.9%
Simplified69.9%
clear-num69.4%
un-div-inv69.4%
associate-/l*69.4%
Applied egg-rr69.4%
associate-/r/70.1%
associate-*r/70.1%
Simplified70.1%
if -1.8000000000000001e33 < A < 2.6e14Initial program 55.6%
Taylor expanded in A around 0 53.6%
unpow253.6%
unpow253.6%
hypot-define83.0%
Simplified83.0%
Taylor expanded in B around -inf 51.2%
+-commutative51.2%
Simplified51.2%
if 2.6e14 < A Initial program 75.0%
Simplified95.2%
Taylor expanded in B around -inf 77.9%
neg-mul-177.9%
unsub-neg77.9%
Simplified77.9%
Taylor expanded in C around 0 73.6%
Final simplification61.6%
(FPCore (A B C)
:precision binary64
(if (<= B -1.05e-157)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 6.5e-129)
(* 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.05e-157) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 6.5e-129) {
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.05e-157) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 6.5e-129) {
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.05e-157: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 6.5e-129: 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.05e-157) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 6.5e-129) 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.05e-157) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 6.5e-129) 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.05e-157], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 6.5e-129], 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.05 \cdot 10^{-157}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 6.5 \cdot 10^{-129}:\\
\;\;\;\;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.05e-157Initial program 51.9%
Taylor expanded in B around -inf 52.5%
if -1.05e-157 < B < 6.49999999999999952e-129Initial program 56.4%
Taylor expanded in C around inf 37.7%
associate-*r/37.7%
distribute-rgt1-in37.7%
metadata-eval37.7%
mul0-lft37.7%
metadata-eval37.7%
Simplified37.7%
if 6.49999999999999952e-129 < B Initial program 47.5%
Taylor expanded in B around inf 50.9%
Final simplification48.2%
(FPCore (A B C) :precision binary64 (if (<= B -5e-310) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5e-310) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -5e-310) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -5e-310: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -5e-310) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5e-310) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -5e-310], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.999999999999985e-310Initial program 52.9%
Taylor expanded in B around -inf 43.3%
if -4.999999999999985e-310 < B Initial program 49.8%
Taylor expanded in B around inf 41.0%
Final simplification42.1%
(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 51.2%
Taylor expanded in B around inf 23.3%
Final simplification23.3%
herbie shell --seed 2024044
(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)))