
(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 14 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 -6.5e+24) (/ (* 180.0 (atan (/ (* 0.5 B) A))) PI) (* (atan (/ (- (- C A) (hypot B (- A C))) B)) (/ 180.0 PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -6.5e+24) {
tmp = (180.0 * atan(((0.5 * B) / A))) / ((double) M_PI);
} else {
tmp = atan((((C - A) - hypot(B, (A - C))) / B)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -6.5e+24) {
tmp = (180.0 * Math.atan(((0.5 * B) / A))) / Math.PI;
} else {
tmp = Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6.5e+24: tmp = (180.0 * math.atan(((0.5 * B) / A))) / math.pi else: tmp = math.atan((((C - A) - math.hypot(B, (A - C))) / B)) * (180.0 / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6.5e+24) tmp = Float64(Float64(180.0 * atan(Float64(Float64(0.5 * B) / A))) / pi); else tmp = Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -6.5e+24) tmp = (180.0 * atan(((0.5 * B) / A))) / pi; else tmp = atan((((C - A) - hypot(B, (A - C))) / B)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6.5e+24], N[(N[(180.0 * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.5 \cdot 10^{+24}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if A < -6.4999999999999996e24Initial program 12.7%
Taylor expanded in A around -inf 78.6%
associate-*r/78.7%
associate-*r/78.7%
Applied egg-rr78.7%
if -6.4999999999999996e24 < A Initial program 65.3%
Simplified86.8%
Taylor expanded in C around 0 65.3%
Simplified86.8%
Final simplification84.9%
(FPCore (A B C) :precision binary64 (if (<= A -4e+23) (/ (* 180.0 (atan (/ (* 0.5 B) A))) PI) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4e+23) {
tmp = (180.0 * atan(((0.5 * B) / A))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -4e+23) {
tmp = (180.0 * Math.atan(((0.5 * B) / A))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -4e+23: tmp = (180.0 * math.atan(((0.5 * B) / A))) / math.pi else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -4e+23) tmp = Float64(Float64(180.0 * atan(Float64(Float64(0.5 * B) / A))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -4e+23) tmp = (180.0 * atan(((0.5 * B) / A))) / pi; else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -4e+23], N[(N[(180.0 * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $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 \cdot 10^{+23}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.9999999999999997e23Initial program 12.7%
Taylor expanded in A around -inf 78.6%
associate-*r/78.7%
associate-*r/78.7%
Applied egg-rr78.7%
if -3.9999999999999997e23 < A Initial program 65.3%
Simplified86.8%
Final simplification84.9%
(FPCore (A B C) :precision binary64 (if (<= A -6.5e+24) (/ (* 180.0 (atan (/ (* 0.5 B) A))) PI) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -6.5e+24) {
tmp = (180.0 * atan(((0.5 * B) / A))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -6.5e+24) {
tmp = (180.0 * Math.atan(((0.5 * B) / A))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6.5e+24: tmp = (180.0 * math.atan(((0.5 * B) / A))) / math.pi else: tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6.5e+24) tmp = Float64(Float64(180.0 * atan(Float64(Float64(0.5 * B) / A))) / pi); 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 <= -6.5e+24) tmp = (180.0 * atan(((0.5 * B) / A))) / pi; else tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6.5e+24], N[(N[(180.0 * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $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 -6.5 \cdot 10^{+24}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\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 < -6.4999999999999996e24Initial program 12.7%
Taylor expanded in A around -inf 78.6%
associate-*r/78.7%
associate-*r/78.7%
Applied egg-rr78.7%
if -6.4999999999999996e24 < A Initial program 65.3%
Simplified86.8%
Final simplification84.9%
(FPCore (A B C) :precision binary64 (if (<= A -5e+16) (/ (* 180.0 (atan (/ (* 0.5 B) A))) PI) (* 180.0 (/ (atan (/ (+ A (hypot B A)) (- B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5e+16) {
tmp = (180.0 * atan(((0.5 * B) / A))) / ((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 <= -5e+16) {
tmp = (180.0 * Math.atan(((0.5 * B) / A))) / 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 <= -5e+16: tmp = (180.0 * math.atan(((0.5 * B) / A))) / 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 <= -5e+16) tmp = Float64(Float64(180.0 * atan(Float64(Float64(0.5 * B) / A))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) / Float64(-B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5e+16) tmp = (180.0 * atan(((0.5 * B) / A))) / pi; else tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5e+16], N[(N[(180.0 * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $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 -5 \cdot 10^{+16}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5e16Initial program 12.7%
Taylor expanded in A around -inf 78.6%
associate-*r/78.7%
associate-*r/78.7%
Applied egg-rr78.7%
if -5e16 < A Initial program 65.3%
Taylor expanded in C around 0 54.3%
mul-1-neg54.3%
distribute-neg-frac254.3%
+-commutative54.3%
unpow254.3%
unpow254.3%
hypot-define72.5%
Simplified72.5%
Final simplification74.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (* -180.0 (atan (/ A B))) PI))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= B -5.3e-27)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -4.8e-166)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= B -7.5e-215)
t_1
(if (<= B 1.12e-303)
t_0
(if (<= B 2.5e-254)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 9.6e-118)
t_0
(if (<= B 1.2e-36) t_1 (* 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 t_1 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (B <= -5.3e-27) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -4.8e-166) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (B <= -7.5e-215) {
tmp = t_1;
} else if (B <= 1.12e-303) {
tmp = t_0;
} else if (B <= 2.5e-254) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 9.6e-118) {
tmp = t_0;
} else if (B <= 1.2e-36) {
tmp = t_1;
} 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 t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (B <= -5.3e-27) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -4.8e-166) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (B <= -7.5e-215) {
tmp = t_1;
} else if (B <= 1.12e-303) {
tmp = t_0;
} else if (B <= 2.5e-254) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 9.6e-118) {
tmp = t_0;
} else if (B <= 1.2e-36) {
tmp = t_1;
} 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 t_1 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if B <= -5.3e-27: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -4.8e-166: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif B <= -7.5e-215: tmp = t_1 elif B <= 1.12e-303: tmp = t_0 elif B <= 2.5e-254: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 9.6e-118: tmp = t_0 elif B <= 1.2e-36: tmp = t_1 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(-180.0 * atan(Float64(A / B))) / pi) t_1 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (B <= -5.3e-27) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -4.8e-166) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (B <= -7.5e-215) tmp = t_1; elseif (B <= 1.12e-303) tmp = t_0; elseif (B <= 2.5e-254) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 9.6e-118) tmp = t_0; elseif (B <= 1.2e-36) tmp = t_1; 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; t_1 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (B <= -5.3e-27) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -4.8e-166) tmp = 180.0 * (atan((C / B)) / pi); elseif (B <= -7.5e-215) tmp = t_1; elseif (B <= 1.12e-303) tmp = t_0; elseif (B <= 2.5e-254) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 9.6e-118) tmp = t_0; elseif (B <= 1.2e-36) tmp = t_1; 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 * N[ArcTan[N[(A / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -5.3e-27], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -4.8e-166], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -7.5e-215], t$95$1, If[LessEqual[B, 1.12e-303], t$95$0, If[LessEqual[B, 2.5e-254], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.6e-118], t$95$0, If[LessEqual[B, 1.2e-36], t$95$1, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-180 \cdot \tan^{-1} \left(\frac{A}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;B \leq -5.3 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -4.8 \cdot 10^{-166}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -7.5 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq 1.12 \cdot 10^{-303}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 2.5 \cdot 10^{-254}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 9.6 \cdot 10^{-118}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 1.2 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -5.30000000000000006e-27Initial program 40.7%
Taylor expanded in B around -inf 61.0%
if -5.30000000000000006e-27 < B < -4.7999999999999997e-166Initial program 71.8%
+-commutative71.8%
unpow271.8%
unpow271.8%
hypot-undefine72.1%
add-cube-cbrt71.3%
pow371.2%
hypot-undefine71.2%
unpow271.2%
unpow271.2%
+-commutative71.2%
unpow271.2%
unpow271.2%
hypot-define71.2%
Applied egg-rr71.2%
Taylor expanded in C around inf 49.8%
if -4.7999999999999997e-166 < B < -7.49999999999999986e-215 or 9.6000000000000006e-118 < B < 1.2e-36Initial program 43.1%
Taylor expanded in A around -inf 61.9%
if -7.49999999999999986e-215 < B < 1.1199999999999999e-303 or 2.5000000000000002e-254 < B < 9.6000000000000006e-118Initial program 68.4%
+-commutative68.4%
unpow268.4%
unpow268.4%
hypot-undefine82.1%
add-cube-cbrt70.2%
pow368.0%
hypot-undefine65.9%
unpow265.9%
unpow265.9%
+-commutative65.9%
unpow265.9%
unpow265.9%
hypot-define68.0%
Applied egg-rr68.0%
Taylor expanded in A around inf 54.8%
associate-*r/54.8%
mul-1-neg54.8%
Simplified54.8%
associate-*r/54.8%
distribute-frac-neg54.8%
atan-neg54.8%
Applied egg-rr54.8%
distribute-rgt-neg-out54.8%
distribute-lft-neg-in54.8%
metadata-eval54.8%
Simplified54.8%
if 1.1199999999999999e-303 < B < 2.5000000000000002e-254Initial program 27.7%
Simplified76.1%
Taylor expanded in C around inf 38.6%
Taylor expanded in B around 0 76.1%
distribute-rgt1-in76.1%
metadata-eval76.1%
mul0-lft76.1%
div076.1%
metadata-eval76.1%
Simplified76.1%
if 1.2e-36 < B Initial program 53.7%
Taylor expanded in B around inf 65.2%
Final simplification60.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (* -180.0 (atan (/ A B))) PI))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= B -1.25e-27)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -4e-166)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= B -1.42e-216)
t_1
(if (<= B -2.5e-266)
t_0
(if (<= B 4.3e-240)
(* 180.0 (/ (atan (/ (* B -0.5) C)) PI))
(if (<= B 7.4e-116)
t_0
(if (<= B 1.25e-37) t_1 (* 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 t_1 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (B <= -1.25e-27) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -4e-166) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (B <= -1.42e-216) {
tmp = t_1;
} else if (B <= -2.5e-266) {
tmp = t_0;
} else if (B <= 4.3e-240) {
tmp = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
} else if (B <= 7.4e-116) {
tmp = t_0;
} else if (B <= 1.25e-37) {
tmp = t_1;
} 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 t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (B <= -1.25e-27) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -4e-166) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (B <= -1.42e-216) {
tmp = t_1;
} else if (B <= -2.5e-266) {
tmp = t_0;
} else if (B <= 4.3e-240) {
tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
} else if (B <= 7.4e-116) {
tmp = t_0;
} else if (B <= 1.25e-37) {
tmp = t_1;
} 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 t_1 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if B <= -1.25e-27: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -4e-166: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif B <= -1.42e-216: tmp = t_1 elif B <= -2.5e-266: tmp = t_0 elif B <= 4.3e-240: tmp = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi) elif B <= 7.4e-116: tmp = t_0 elif B <= 1.25e-37: tmp = t_1 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(-180.0 * atan(Float64(A / B))) / pi) t_1 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (B <= -1.25e-27) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -4e-166) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (B <= -1.42e-216) tmp = t_1; elseif (B <= -2.5e-266) tmp = t_0; elseif (B <= 4.3e-240) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi)); elseif (B <= 7.4e-116) tmp = t_0; elseif (B <= 1.25e-37) tmp = t_1; 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; t_1 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (B <= -1.25e-27) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -4e-166) tmp = 180.0 * (atan((C / B)) / pi); elseif (B <= -1.42e-216) tmp = t_1; elseif (B <= -2.5e-266) tmp = t_0; elseif (B <= 4.3e-240) tmp = 180.0 * (atan(((B * -0.5) / C)) / pi); elseif (B <= 7.4e-116) tmp = t_0; elseif (B <= 1.25e-37) tmp = t_1; 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 * N[ArcTan[N[(A / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.25e-27], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -4e-166], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.42e-216], t$95$1, If[LessEqual[B, -2.5e-266], t$95$0, If[LessEqual[B, 4.3e-240], N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.4e-116], t$95$0, If[LessEqual[B, 1.25e-37], t$95$1, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-180 \cdot \tan^{-1} \left(\frac{A}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;B \leq -1.25 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -4 \cdot 10^{-166}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -1.42 \cdot 10^{-216}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq -2.5 \cdot 10^{-266}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 4.3 \cdot 10^{-240}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 7.4 \cdot 10^{-116}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 1.25 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.25e-27Initial program 40.7%
Taylor expanded in B around -inf 61.0%
if -1.25e-27 < B < -4.00000000000000016e-166Initial program 71.8%
+-commutative71.8%
unpow271.8%
unpow271.8%
hypot-undefine72.1%
add-cube-cbrt71.3%
pow371.2%
hypot-undefine71.2%
unpow271.2%
unpow271.2%
+-commutative71.2%
unpow271.2%
unpow271.2%
hypot-define71.2%
Applied egg-rr71.2%
Taylor expanded in C around inf 49.8%
if -4.00000000000000016e-166 < B < -1.42000000000000004e-216 or 7.4000000000000005e-116 < B < 1.2499999999999999e-37Initial program 43.1%
Taylor expanded in A around -inf 61.9%
if -1.42000000000000004e-216 < B < -2.49999999999999996e-266 or 4.30000000000000013e-240 < B < 7.4000000000000005e-116Initial program 70.0%
+-commutative70.0%
unpow270.0%
unpow270.0%
hypot-undefine84.7%
add-cube-cbrt75.2%
pow372.5%
hypot-undefine69.7%
unpow269.7%
unpow269.7%
+-commutative69.7%
unpow269.7%
unpow269.7%
hypot-define72.5%
Applied egg-rr72.5%
Taylor expanded in A around inf 58.5%
associate-*r/58.5%
mul-1-neg58.5%
Simplified58.5%
associate-*r/58.5%
distribute-frac-neg58.5%
atan-neg58.5%
Applied egg-rr58.5%
distribute-rgt-neg-out58.5%
distribute-lft-neg-in58.5%
metadata-eval58.5%
Simplified58.5%
if -2.49999999999999996e-266 < B < 4.30000000000000013e-240Initial program 47.3%
Simplified63.5%
Taylor expanded in C around inf 35.9%
Taylor expanded in A around 0 57.2%
associate-*r/57.2%
Simplified57.2%
if 1.2499999999999999e-37 < B Initial program 53.7%
Taylor expanded in B around inf 65.2%
Final simplification60.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (* -180.0 (atan (/ A B))) PI))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= B -3.5e-26)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -2e-166)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= B -7.8e-215)
t_1
(if (<= B -2.3e-266)
t_0
(if (<= B 6.6e-253)
(* 180.0 (/ (atan (/ (* B -0.5) C)) PI))
(if (<= B 2.1e-119)
t_0
(if (<= B 5.5e-36) t_1 (* 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 t_1 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (B <= -3.5e-26) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -2e-166) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (B <= -7.8e-215) {
tmp = t_1;
} else if (B <= -2.3e-266) {
tmp = t_0;
} else if (B <= 6.6e-253) {
tmp = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
} else if (B <= 2.1e-119) {
tmp = t_0;
} else if (B <= 5.5e-36) {
tmp = t_1;
} 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 t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (B <= -3.5e-26) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -2e-166) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (B <= -7.8e-215) {
tmp = t_1;
} else if (B <= -2.3e-266) {
tmp = t_0;
} else if (B <= 6.6e-253) {
tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
} else if (B <= 2.1e-119) {
tmp = t_0;
} else if (B <= 5.5e-36) {
tmp = t_1;
} 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 t_1 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if B <= -3.5e-26: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -2e-166: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif B <= -7.8e-215: tmp = t_1 elif B <= -2.3e-266: tmp = t_0 elif B <= 6.6e-253: tmp = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi) elif B <= 2.1e-119: tmp = t_0 elif B <= 5.5e-36: tmp = t_1 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(-180.0 * atan(Float64(A / B))) / pi) t_1 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (B <= -3.5e-26) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -2e-166) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (B <= -7.8e-215) tmp = t_1; elseif (B <= -2.3e-266) tmp = t_0; elseif (B <= 6.6e-253) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi)); elseif (B <= 2.1e-119) tmp = t_0; elseif (B <= 5.5e-36) tmp = t_1; 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; t_1 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (B <= -3.5e-26) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -2e-166) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (B <= -7.8e-215) tmp = t_1; elseif (B <= -2.3e-266) tmp = t_0; elseif (B <= 6.6e-253) tmp = 180.0 * (atan(((B * -0.5) / C)) / pi); elseif (B <= 2.1e-119) tmp = t_0; elseif (B <= 5.5e-36) tmp = t_1; 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 * N[ArcTan[N[(A / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.5e-26], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2e-166], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -7.8e-215], t$95$1, If[LessEqual[B, -2.3e-266], t$95$0, If[LessEqual[B, 6.6e-253], N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.1e-119], t$95$0, If[LessEqual[B, 5.5e-36], t$95$1, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-180 \cdot \tan^{-1} \left(\frac{A}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;B \leq -3.5 \cdot 10^{-26}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -2 \cdot 10^{-166}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -7.8 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq -2.3 \cdot 10^{-266}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 6.6 \cdot 10^{-253}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.1 \cdot 10^{-119}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 5.5 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.49999999999999985e-26Initial program 40.7%
Taylor expanded in B around -inf 61.0%
if -3.49999999999999985e-26 < B < -2.00000000000000008e-166Initial program 71.8%
Simplified71.8%
Taylor expanded in C around -inf 49.8%
if -2.00000000000000008e-166 < B < -7.7999999999999999e-215 or 2.1e-119 < B < 5.49999999999999984e-36Initial program 43.1%
Taylor expanded in A around -inf 61.9%
if -7.7999999999999999e-215 < B < -2.29999999999999996e-266 or 6.6000000000000002e-253 < B < 2.1e-119Initial program 70.0%
+-commutative70.0%
unpow270.0%
unpow270.0%
hypot-undefine84.7%
add-cube-cbrt75.2%
pow372.5%
hypot-undefine69.7%
unpow269.7%
unpow269.7%
+-commutative69.7%
unpow269.7%
unpow269.7%
hypot-define72.5%
Applied egg-rr72.5%
Taylor expanded in A around inf 58.5%
associate-*r/58.5%
mul-1-neg58.5%
Simplified58.5%
associate-*r/58.5%
distribute-frac-neg58.5%
atan-neg58.5%
Applied egg-rr58.5%
distribute-rgt-neg-out58.5%
distribute-lft-neg-in58.5%
metadata-eval58.5%
Simplified58.5%
if -2.29999999999999996e-266 < B < 6.6000000000000002e-253Initial program 47.3%
Simplified63.5%
Taylor expanded in C around inf 35.9%
Taylor expanded in A around 0 57.2%
associate-*r/57.2%
Simplified57.2%
if 5.49999999999999984e-36 < B Initial program 53.7%
Taylor expanded in B around inf 65.2%
Final simplification60.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= B -2.45e-27)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -4.4e-166)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= B -3.2e-216)
t_0
(if (<= B -3.7e-266)
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI))
(if (<= B 5.5e-250)
(* 180.0 (/ (atan (/ (* B -0.5) C)) PI))
(if (<= B 3.3e-115)
(/ (* -180.0 (atan (/ A B))) PI)
(if (<= B 2.65e-36) t_0 (* 180.0 (/ (atan -1.0) PI)))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (B <= -2.45e-27) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -4.4e-166) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (B <= -3.2e-216) {
tmp = t_0;
} else if (B <= -3.7e-266) {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
} else if (B <= 5.5e-250) {
tmp = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
} else if (B <= 3.3e-115) {
tmp = (-180.0 * atan((A / B))) / ((double) M_PI);
} else if (B <= 2.65e-36) {
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((0.5 * (B / A))) / Math.PI);
double tmp;
if (B <= -2.45e-27) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -4.4e-166) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (B <= -3.2e-216) {
tmp = t_0;
} else if (B <= -3.7e-266) {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
} else if (B <= 5.5e-250) {
tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
} else if (B <= 3.3e-115) {
tmp = (-180.0 * Math.atan((A / B))) / Math.PI;
} else if (B <= 2.65e-36) {
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((0.5 * (B / A))) / math.pi) tmp = 0 if B <= -2.45e-27: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -4.4e-166: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif B <= -3.2e-216: tmp = t_0 elif B <= -3.7e-266: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) elif B <= 5.5e-250: tmp = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi) elif B <= 3.3e-115: tmp = (-180.0 * math.atan((A / B))) / math.pi elif B <= 2.65e-36: 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(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (B <= -2.45e-27) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -4.4e-166) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (B <= -3.2e-216) tmp = t_0; elseif (B <= -3.7e-266) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / pi)); elseif (B <= 5.5e-250) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi)); elseif (B <= 3.3e-115) tmp = Float64(Float64(-180.0 * atan(Float64(A / B))) / pi); elseif (B <= 2.65e-36) 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((0.5 * (B / A))) / pi); tmp = 0.0; if (B <= -2.45e-27) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -4.4e-166) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (B <= -3.2e-216) tmp = t_0; elseif (B <= -3.7e-266) tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); elseif (B <= 5.5e-250) tmp = 180.0 * (atan(((B * -0.5) / C)) / pi); elseif (B <= 3.3e-115) tmp = (-180.0 * atan((A / B))) / pi; elseif (B <= 2.65e-36) 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[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -2.45e-27], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -4.4e-166], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -3.2e-216], t$95$0, If[LessEqual[B, -3.7e-266], N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.5e-250], N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.3e-115], N[(N[(-180.0 * N[ArcTan[N[(A / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[B, 2.65e-36], 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(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;B \leq -2.45 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -4.4 \cdot 10^{-166}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -3.2 \cdot 10^{-216}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq -3.7 \cdot 10^{-266}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 5.5 \cdot 10^{-250}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.3 \cdot 10^{-115}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(\frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.65 \cdot 10^{-36}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.44999999999999988e-27Initial program 40.7%
Taylor expanded in B around -inf 61.0%
if -2.44999999999999988e-27 < B < -4.4000000000000002e-166Initial program 71.8%
Simplified71.8%
Taylor expanded in C around -inf 49.8%
if -4.4000000000000002e-166 < B < -3.20000000000000026e-216 or 3.2999999999999999e-115 < B < 2.6499999999999999e-36Initial program 43.1%
Taylor expanded in A around -inf 61.9%
if -3.20000000000000026e-216 < B < -3.7000000000000003e-266Initial program 78.8%
Taylor expanded in A around inf 68.2%
associate-*r/68.2%
*-commutative68.2%
Simplified68.2%
if -3.7000000000000003e-266 < B < 5.5e-250Initial program 47.3%
Simplified63.5%
Taylor expanded in C around inf 35.9%
Taylor expanded in A around 0 57.2%
associate-*r/57.2%
Simplified57.2%
if 5.5e-250 < B < 3.2999999999999999e-115Initial program 66.9%
+-commutative66.9%
unpow266.9%
unpow266.9%
hypot-undefine83.1%
add-cube-cbrt74.1%
pow370.4%
hypot-undefine66.6%
unpow266.6%
unpow266.6%
+-commutative66.6%
unpow266.6%
unpow266.6%
hypot-define70.4%
Applied egg-rr70.4%
Taylor expanded in A around inf 55.2%
associate-*r/55.2%
mul-1-neg55.2%
Simplified55.2%
associate-*r/55.2%
distribute-frac-neg55.2%
atan-neg55.2%
Applied egg-rr55.2%
distribute-rgt-neg-out55.2%
distribute-lft-neg-in55.2%
metadata-eval55.2%
Simplified55.2%
if 2.6499999999999999e-36 < B Initial program 53.7%
Taylor expanded in B around inf 65.2%
Final simplification60.6%
(FPCore (A B C)
:precision binary64
(if (<= B -1.25e-27)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -2.55e-166)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= B -8.8e-215)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= B -3.7e-266)
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI))
(if (<= B 3.5e-246)
(* 180.0 (/ (atan (/ (* B -0.5) C)) PI))
(if (<= B 1.05e-117)
(/ (* -180.0 (atan (/ A B))) PI)
(if (<= B 7.5e-35)
(/ (* 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 <= -1.25e-27) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -2.55e-166) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (B <= -8.8e-215) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (B <= -3.7e-266) {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
} else if (B <= 3.5e-246) {
tmp = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
} else if (B <= 1.05e-117) {
tmp = (-180.0 * atan((A / B))) / ((double) M_PI);
} else if (B <= 7.5e-35) {
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 <= -1.25e-27) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -2.55e-166) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (B <= -8.8e-215) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (B <= -3.7e-266) {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
} else if (B <= 3.5e-246) {
tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
} else if (B <= 1.05e-117) {
tmp = (-180.0 * Math.atan((A / B))) / Math.PI;
} else if (B <= 7.5e-35) {
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 <= -1.25e-27: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -2.55e-166: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif B <= -8.8e-215: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif B <= -3.7e-266: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) elif B <= 3.5e-246: tmp = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi) elif B <= 1.05e-117: tmp = (-180.0 * math.atan((A / B))) / math.pi elif B <= 7.5e-35: 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 <= -1.25e-27) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -2.55e-166) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (B <= -8.8e-215) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (B <= -3.7e-266) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / pi)); elseif (B <= 3.5e-246) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi)); elseif (B <= 1.05e-117) tmp = Float64(Float64(-180.0 * atan(Float64(A / B))) / pi); elseif (B <= 7.5e-35) tmp = Float64(Float64(180.0 * 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 <= -1.25e-27) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -2.55e-166) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (B <= -8.8e-215) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (B <= -3.7e-266) tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); elseif (B <= 3.5e-246) tmp = 180.0 * (atan(((B * -0.5) / C)) / pi); elseif (B <= 1.05e-117) tmp = (-180.0 * atan((A / B))) / pi; elseif (B <= 7.5e-35) 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, -1.25e-27], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.55e-166], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -8.8e-215], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -3.7e-266], N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.5e-246], N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.05e-117], N[(N[(-180.0 * N[ArcTan[N[(A / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[B, 7.5e-35], N[(N[(180.0 * N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.25 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -2.55 \cdot 10^{-166}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -8.8 \cdot 10^{-215}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;B \leq -3.7 \cdot 10^{-266}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.5 \cdot 10^{-246}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.05 \cdot 10^{-117}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(\frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 7.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{180 \cdot \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 < -1.25e-27Initial program 40.7%
Taylor expanded in B around -inf 61.0%
if -1.25e-27 < B < -2.5500000000000001e-166Initial program 71.8%
Simplified71.8%
Taylor expanded in C around -inf 49.8%
if -2.5500000000000001e-166 < B < -8.79999999999999985e-215Initial program 36.4%
Taylor expanded in A around -inf 68.1%
if -8.79999999999999985e-215 < B < -3.7000000000000003e-266Initial program 78.8%
Taylor expanded in A around inf 68.2%
associate-*r/68.2%
*-commutative68.2%
Simplified68.2%
if -3.7000000000000003e-266 < B < 3.5000000000000002e-246Initial program 47.3%
Simplified63.5%
Taylor expanded in C around inf 35.9%
Taylor expanded in A around 0 57.2%
associate-*r/57.2%
Simplified57.2%
if 3.5000000000000002e-246 < B < 1.05e-117Initial program 66.9%
+-commutative66.9%
unpow266.9%
unpow266.9%
hypot-undefine83.1%
add-cube-cbrt74.1%
pow370.4%
hypot-undefine66.6%
unpow266.6%
unpow266.6%
+-commutative66.6%
unpow266.6%
unpow266.6%
hypot-define70.4%
Applied egg-rr70.4%
Taylor expanded in A around inf 55.2%
associate-*r/55.2%
mul-1-neg55.2%
Simplified55.2%
associate-*r/55.2%
distribute-frac-neg55.2%
atan-neg55.2%
Applied egg-rr55.2%
distribute-rgt-neg-out55.2%
distribute-lft-neg-in55.2%
metadata-eval55.2%
Simplified55.2%
if 1.05e-117 < B < 7.5e-35Initial program 47.1%
Taylor expanded in A around -inf 58.3%
associate-*r/58.4%
associate-*r/58.4%
Applied egg-rr58.4%
if 7.5e-35 < B Initial program 53.7%
Taylor expanded in B around inf 65.2%
Final simplification60.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ C B)) PI))))
(if (<= B -1.95e-27)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -7.5e-246)
t_0
(if (<= B 6e-257)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 1.55e-86) t_0 (* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((C / B)) / ((double) M_PI));
double tmp;
if (B <= -1.95e-27) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -7.5e-246) {
tmp = t_0;
} else if (B <= 6e-257) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 1.55e-86) {
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((C / B)) / Math.PI);
double tmp;
if (B <= -1.95e-27) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -7.5e-246) {
tmp = t_0;
} else if (B <= 6e-257) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 1.55e-86) {
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((C / B)) / math.pi) tmp = 0 if B <= -1.95e-27: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -7.5e-246: tmp = t_0 elif B <= 6e-257: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 1.55e-86: 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(C / B)) / pi)) tmp = 0.0 if (B <= -1.95e-27) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -7.5e-246) tmp = t_0; elseif (B <= 6e-257) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 1.55e-86) 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((C / B)) / pi); tmp = 0.0; if (B <= -1.95e-27) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -7.5e-246) tmp = t_0; elseif (B <= 6e-257) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 1.55e-86) 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[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.95e-27], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -7.5e-246], t$95$0, If[LessEqual[B, 6e-257], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.55e-86], 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{C}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -1.95 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -7.5 \cdot 10^{-246}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 6 \cdot 10^{-257}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 1.55 \cdot 10^{-86}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.94999999999999986e-27Initial program 40.7%
Taylor expanded in B around -inf 61.0%
if -1.94999999999999986e-27 < B < -7.50000000000000049e-246 or 5.9999999999999999e-257 < B < 1.54999999999999994e-86Initial program 65.8%
+-commutative65.8%
unpow265.8%
unpow265.8%
hypot-undefine77.5%
add-cube-cbrt70.3%
pow369.0%
hypot-undefine65.3%
unpow265.3%
unpow265.3%
+-commutative65.3%
unpow265.3%
unpow265.3%
hypot-define69.0%
Applied egg-rr69.0%
Taylor expanded in C around inf 46.8%
if -7.50000000000000049e-246 < B < 5.9999999999999999e-257Initial program 47.7%
Simplified62.3%
Taylor expanded in C around inf 32.4%
Taylor expanded in B around 0 52.6%
distribute-rgt1-in52.6%
metadata-eval52.6%
mul0-lft52.6%
div052.6%
metadata-eval52.6%
Simplified52.6%
if 1.54999999999999994e-86 < B Initial program 51.3%
Taylor expanded in B around inf 59.4%
Final simplification55.4%
(FPCore (A B C)
:precision binary64
(if (<= B -5.5e-27)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -8.2e-246)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= B 3e-250)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 5e-95)
(/ (* -180.0 (atan (/ A B))) PI)
(* 180.0 (/ (atan -1.0) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5.5e-27) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -8.2e-246) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (B <= 3e-250) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 5e-95) {
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 <= -5.5e-27) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -8.2e-246) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (B <= 3e-250) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 5e-95) {
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 <= -5.5e-27: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -8.2e-246: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif B <= 3e-250: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 5e-95: 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 <= -5.5e-27) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -8.2e-246) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (B <= 3e-250) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 5e-95) tmp = Float64(Float64(-180.0 * atan(Float64(A / B))) / pi); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5.5e-27) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -8.2e-246) tmp = 180.0 * (atan((C / B)) / pi); elseif (B <= 3e-250) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 5e-95) 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, -5.5e-27], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -8.2e-246], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3e-250], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5e-95], N[(N[(-180.0 * N[ArcTan[N[(A / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5.5 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -8.2 \cdot 10^{-246}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3 \cdot 10^{-250}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(\frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -5.5000000000000002e-27Initial program 40.7%
Taylor expanded in B around -inf 61.0%
if -5.5000000000000002e-27 < B < -8.19999999999999971e-246Initial program 64.8%
+-commutative64.8%
unpow264.8%
unpow264.8%
hypot-undefine75.5%
add-cube-cbrt68.4%
pow368.3%
hypot-undefine64.1%
unpow264.1%
unpow264.1%
+-commutative64.1%
unpow264.1%
unpow264.1%
hypot-define68.3%
Applied egg-rr68.3%
Taylor expanded in C around inf 47.3%
if -8.19999999999999971e-246 < B < 3.00000000000000016e-250Initial program 47.7%
Simplified62.3%
Taylor expanded in C around inf 32.4%
Taylor expanded in B around 0 52.6%
distribute-rgt1-in52.6%
metadata-eval52.6%
mul0-lft52.6%
div052.6%
metadata-eval52.6%
Simplified52.6%
if 3.00000000000000016e-250 < B < 4.9999999999999998e-95Initial program 70.4%
+-commutative70.4%
unpow270.4%
unpow270.4%
hypot-undefine84.8%
add-cube-cbrt76.8%
pow373.4%
hypot-undefine70.1%
unpow270.1%
unpow270.1%
+-commutative70.1%
unpow270.1%
unpow270.1%
hypot-define73.4%
Applied egg-rr73.4%
Taylor expanded in A around inf 53.0%
associate-*r/53.0%
mul-1-neg53.0%
Simplified53.0%
associate-*r/53.0%
distribute-frac-neg53.0%
atan-neg53.0%
Applied egg-rr53.0%
distribute-rgt-neg-out53.0%
distribute-lft-neg-in53.0%
metadata-eval53.0%
Simplified53.0%
if 4.9999999999999998e-95 < B Initial program 50.9%
Taylor expanded in B around inf 57.8%
Final simplification55.8%
(FPCore (A B C)
:precision binary64
(if (<= B -3e-166)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 9.6e-79)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3e-166) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 9.6e-79) {
tmp = 180.0 * (atan(0.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 <= -3e-166) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 9.6e-79) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3e-166: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 9.6e-79: tmp = 180.0 * (math.atan(0.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 <= -3e-166) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 9.6e-79) tmp = Float64(180.0 * Float64(atan(0.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 <= -3e-166) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 9.6e-79) tmp = 180.0 * (atan(0.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3e-166], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.6e-79], N[(180.0 * N[(N[ArcTan[0.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 -3 \cdot 10^{-166}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 9.6 \cdot 10^{-79}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.0000000000000003e-166Initial program 49.8%
Taylor expanded in B around -inf 48.3%
if -3.0000000000000003e-166 < B < 9.60000000000000023e-79Initial program 56.2%
Simplified65.1%
Taylor expanded in C around inf 16.2%
Taylor expanded in B around 0 30.5%
distribute-rgt1-in30.5%
metadata-eval30.5%
mul0-lft30.5%
div030.5%
metadata-eval30.5%
Simplified30.5%
if 9.60000000000000023e-79 < B Initial program 52.9%
Taylor expanded in B around inf 61.3%
Final simplification47.7%
(FPCore (A B C) :precision binary64 (if (<= B 1.95e-78) (* 180.0 (/ (atan 0.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1.95e-78) {
tmp = 180.0 * (atan(0.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 <= 1.95e-78) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 1.95e-78: tmp = 180.0 * (math.atan(0.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 <= 1.95e-78) tmp = Float64(180.0 * Float64(atan(0.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 <= 1.95e-78) tmp = 180.0 * (atan(0.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 1.95e-78], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.95 \cdot 10^{-78}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 1.9500000000000001e-78Initial program 52.7%
Simplified68.3%
Taylor expanded in C around inf 15.9%
Taylor expanded in B around 0 16.2%
distribute-rgt1-in16.2%
metadata-eval16.2%
mul0-lft16.2%
div016.2%
metadata-eval16.2%
Simplified16.2%
if 1.9500000000000001e-78 < B Initial program 52.9%
Taylor expanded in B around inf 61.3%
Final simplification32.0%
(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 52.8%
Taylor expanded in B around inf 24.4%
Final simplification24.4%
herbie shell --seed 2024052
(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)))