
(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 -1300000000000.0) (/ (* 180.0 (atan (* (+ (/ B (/ (* A A) C)) (/ B A)) 0.5))) PI) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1300000000000.0) {
tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / ((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 <= -1300000000000.0) {
tmp = (180.0 * Math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / 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 <= -1300000000000.0: tmp = (180.0 * math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / 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 <= -1300000000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(B / Float64(Float64(A * A) / C)) + Float64(B / A)) * 0.5))) / 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 <= -1300000000000.0) tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / 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, -1300000000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[(B / N[(N[(A * A), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(B / A), $MachinePrecision]), $MachinePrecision] * 0.5), $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 -1300000000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{\frac{A \cdot A}{C}} + \frac{B}{A}\right) \cdot 0.5\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 < -1.3e12Initial program 18.1%
associate-*l/18.1%
*-lft-identity18.1%
+-commutative18.1%
unpow218.1%
unpow218.1%
hypot-def50.6%
Simplified50.6%
Taylor expanded in A around -inf 73.2%
distribute-lft-out73.2%
*-commutative73.2%
unpow273.2%
Simplified73.2%
associate-*r/73.5%
*-commutative73.5%
associate-/l*74.5%
Applied egg-rr74.5%
if -1.3e12 < A Initial program 70.0%
associate-*l/70.0%
*-lft-identity70.0%
+-commutative70.0%
unpow270.0%
unpow270.0%
hypot-def90.8%
Simplified90.8%
Final simplification87.2%
(FPCore (A B C)
:precision binary64
(if (<= A -1050000000000.0)
(/ (* 180.0 (atan (* (+ (/ B (/ (* A A) C)) (/ B A)) 0.5))) PI)
(if (<= A 4.3e-172)
(* (/ 180.0 PI) (atan (/ (- C (hypot B C)) B)))
(* (/ 180.0 PI) (atan (/ (- C (+ A (hypot A B))) B))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1050000000000.0) {
tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / ((double) M_PI);
} else if (A <= 4.3e-172) {
tmp = (180.0 / ((double) M_PI)) * atan(((C - hypot(B, C)) / B));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((C - (A + hypot(A, B))) / B));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1050000000000.0) {
tmp = (180.0 * Math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / Math.PI;
} else if (A <= 4.3e-172) {
tmp = (180.0 / Math.PI) * Math.atan(((C - Math.hypot(B, C)) / B));
} else {
tmp = (180.0 / Math.PI) * Math.atan(((C - (A + Math.hypot(A, B))) / B));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1050000000000.0: tmp = (180.0 * math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / math.pi elif A <= 4.3e-172: tmp = (180.0 / math.pi) * math.atan(((C - math.hypot(B, C)) / B)) else: tmp = (180.0 / math.pi) * math.atan(((C - (A + math.hypot(A, B))) / B)) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1050000000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(B / Float64(Float64(A * A) / C)) + Float64(B / A)) * 0.5))) / pi); elseif (A <= 4.3e-172) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - hypot(B, C)) / B))); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - Float64(A + hypot(A, B))) / B))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1050000000000.0) tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / pi; elseif (A <= 4.3e-172) tmp = (180.0 / pi) * atan(((C - hypot(B, C)) / B)); else tmp = (180.0 / pi) * atan(((C - (A + hypot(A, B))) / B)); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1050000000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[(B / N[(N[(A * A), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(B / A), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 4.3e-172], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1050000000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{\frac{A \cdot A}{C}} + \frac{B}{A}\right) \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 4.3 \cdot 10^{-172}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(A, B\right)\right)}{B}\right)\\
\end{array}
\end{array}
if A < -1.05e12Initial program 18.1%
associate-*l/18.1%
*-lft-identity18.1%
+-commutative18.1%
unpow218.1%
unpow218.1%
hypot-def50.6%
Simplified50.6%
Taylor expanded in A around -inf 73.2%
distribute-lft-out73.2%
*-commutative73.2%
unpow273.2%
Simplified73.2%
associate-*r/73.5%
*-commutative73.5%
associate-/l*74.5%
Applied egg-rr74.5%
if -1.05e12 < A < 4.2999999999999997e-172Initial program 60.9%
associate-*r/60.9%
associate-*l/60.9%
associate-*l/60.9%
*-lft-identity60.9%
sub-neg60.9%
associate-+l-60.9%
sub-neg60.9%
remove-double-neg60.9%
+-commutative60.9%
unpow260.9%
unpow260.9%
hypot-def85.3%
Simplified85.3%
Taylor expanded in A around 0 59.9%
unpow259.9%
unpow259.9%
hypot-def84.3%
Simplified84.3%
if 4.2999999999999997e-172 < A Initial program 78.0%
associate-*r/78.0%
associate-*l/78.0%
associate-*l/78.0%
*-lft-identity78.0%
sub-neg78.0%
associate-+l-78.0%
sub-neg78.0%
remove-double-neg78.0%
+-commutative78.0%
unpow278.0%
unpow278.0%
hypot-def95.7%
Simplified95.7%
Taylor expanded in C around 0 76.8%
+-commutative76.8%
unpow276.8%
unpow276.8%
hypot-def92.4%
Simplified92.4%
Final simplification85.5%
(FPCore (A B C)
:precision binary64
(if (<= A -180000000000.0)
(/ (* 180.0 (atan (* (+ (/ B (/ (* A A) C)) (/ B A)) 0.5))) PI)
(if (<= A 5.8e-8)
(* (/ 180.0 PI) (atan (/ (- C (hypot B C)) B)))
(* 180.0 (/ (atan (/ (- (- A) (hypot A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -180000000000.0) {
tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / ((double) M_PI);
} else if (A <= 5.8e-8) {
tmp = (180.0 / ((double) M_PI)) * atan(((C - hypot(B, C)) / B));
} else {
tmp = 180.0 * (atan(((-A - hypot(A, B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -180000000000.0) {
tmp = (180.0 * Math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / Math.PI;
} else if (A <= 5.8e-8) {
tmp = (180.0 / Math.PI) * Math.atan(((C - Math.hypot(B, C)) / B));
} else {
tmp = 180.0 * (Math.atan(((-A - Math.hypot(A, B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -180000000000.0: tmp = (180.0 * math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / math.pi elif A <= 5.8e-8: tmp = (180.0 / math.pi) * math.atan(((C - math.hypot(B, C)) / B)) else: tmp = 180.0 * (math.atan(((-A - math.hypot(A, B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -180000000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(B / Float64(Float64(A * A) / C)) + Float64(B / A)) * 0.5))) / pi); elseif (A <= 5.8e-8) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - hypot(B, C)) / B))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - hypot(A, B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -180000000000.0) tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / pi; elseif (A <= 5.8e-8) tmp = (180.0 / pi) * atan(((C - hypot(B, C)) / B)); else tmp = 180.0 * (atan(((-A - hypot(A, B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -180000000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[(B / N[(N[(A * A), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(B / A), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 5.8e-8], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[((-A) - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -180000000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{\frac{A \cdot A}{C}} + \frac{B}{A}\right) \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 5.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(A, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.8e11Initial program 18.1%
associate-*l/18.1%
*-lft-identity18.1%
+-commutative18.1%
unpow218.1%
unpow218.1%
hypot-def50.6%
Simplified50.6%
Taylor expanded in A around -inf 73.2%
distribute-lft-out73.2%
*-commutative73.2%
unpow273.2%
Simplified73.2%
associate-*r/73.5%
*-commutative73.5%
associate-/l*74.5%
Applied egg-rr74.5%
if -1.8e11 < A < 5.8000000000000003e-8Initial program 64.4%
associate-*r/64.4%
associate-*l/64.4%
associate-*l/64.4%
*-lft-identity64.4%
sub-neg64.4%
associate-+l-64.4%
sub-neg64.4%
remove-double-neg64.4%
+-commutative64.4%
unpow264.4%
unpow264.4%
hypot-def87.9%
Simplified87.9%
Taylor expanded in A around 0 59.5%
unpow259.5%
unpow259.5%
hypot-def83.3%
Simplified83.3%
if 5.8000000000000003e-8 < A Initial program 80.3%
associate-*l/80.3%
*-lft-identity80.3%
+-commutative80.3%
unpow280.3%
unpow280.3%
hypot-def96.2%
Simplified96.2%
Taylor expanded in C around 0 78.9%
mul-1-neg78.9%
+-commutative78.9%
unpow278.9%
unpow278.9%
hypot-def94.2%
Simplified94.2%
Final simplification84.3%
(FPCore (A B C)
:precision binary64
(if (<= A -580000000000.0)
(/ (* 180.0 (atan (* (+ (/ B (/ (* A A) C)) (/ B A)) 0.5))) PI)
(if (<= A 3000000000.0)
(* (/ 180.0 PI) (atan (/ (- C (hypot B C)) B)))
(* (/ 180.0 PI) (atan (/ (+ C (- B A)) B))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -580000000000.0) {
tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / ((double) M_PI);
} else if (A <= 3000000000.0) {
tmp = (180.0 / ((double) M_PI)) * atan(((C - hypot(B, C)) / B));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((C + (B - A)) / B));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -580000000000.0) {
tmp = (180.0 * Math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / Math.PI;
} else if (A <= 3000000000.0) {
tmp = (180.0 / Math.PI) * Math.atan(((C - Math.hypot(B, C)) / B));
} else {
tmp = (180.0 / Math.PI) * Math.atan(((C + (B - A)) / B));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -580000000000.0: tmp = (180.0 * math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / math.pi elif A <= 3000000000.0: tmp = (180.0 / math.pi) * math.atan(((C - math.hypot(B, C)) / B)) else: tmp = (180.0 / math.pi) * math.atan(((C + (B - A)) / B)) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -580000000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(B / Float64(Float64(A * A) / C)) + Float64(B / A)) * 0.5))) / pi); elseif (A <= 3000000000.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - hypot(B, C)) / B))); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C + Float64(B - A)) / B))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -580000000000.0) tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / pi; elseif (A <= 3000000000.0) tmp = (180.0 / pi) * atan(((C - hypot(B, C)) / B)); else tmp = (180.0 / pi) * atan(((C + (B - A)) / B)); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -580000000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[(B / N[(N[(A * A), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(B / A), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 3000000000.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -580000000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{\frac{A \cdot A}{C}} + \frac{B}{A}\right) \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 3000000000:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\
\end{array}
\end{array}
if A < -5.8e11Initial program 18.1%
associate-*l/18.1%
*-lft-identity18.1%
+-commutative18.1%
unpow218.1%
unpow218.1%
hypot-def50.6%
Simplified50.6%
Taylor expanded in A around -inf 73.2%
distribute-lft-out73.2%
*-commutative73.2%
unpow273.2%
Simplified73.2%
associate-*r/73.5%
*-commutative73.5%
associate-/l*74.5%
Applied egg-rr74.5%
if -5.8e11 < A < 3e9Initial program 65.2%
associate-*r/65.2%
associate-*l/65.2%
associate-*l/65.2%
*-lft-identity65.2%
sub-neg65.2%
associate-+l-65.2%
sub-neg65.2%
remove-double-neg65.2%
+-commutative65.2%
unpow265.2%
unpow265.2%
hypot-def88.2%
Simplified88.2%
Taylor expanded in A around 0 60.5%
unpow260.5%
unpow260.5%
hypot-def83.7%
Simplified83.7%
if 3e9 < A Initial program 79.4%
associate-*r/79.4%
associate-*l/79.4%
associate-*l/79.4%
*-lft-identity79.4%
sub-neg79.4%
associate-+l-79.4%
sub-neg79.4%
remove-double-neg79.4%
+-commutative79.4%
unpow279.4%
unpow279.4%
hypot-def96.0%
Simplified96.0%
Taylor expanded in B around -inf 84.2%
neg-mul-184.2%
unsub-neg84.2%
Simplified84.2%
Final simplification81.8%
(FPCore (A B C)
:precision binary64
(if (<= B -2.6e-220)
(* (/ 180.0 PI) (atan (/ (+ C (- B A)) B)))
(if (<= B 8.5e-303)
(* 180.0 (/ (atan (* 0.5 (+ (/ B A) (/ (* B C) (* A A))))) PI))
(* 180.0 (/ (atan (/ (- (- C B) A) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.6e-220) {
tmp = (180.0 / ((double) M_PI)) * atan(((C + (B - A)) / B));
} else if (B <= 8.5e-303) {
tmp = 180.0 * (atan((0.5 * ((B / A) + ((B * C) / (A * A))))) / ((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 (B <= -2.6e-220) {
tmp = (180.0 / Math.PI) * Math.atan(((C + (B - A)) / B));
} else if (B <= 8.5e-303) {
tmp = 180.0 * (Math.atan((0.5 * ((B / A) + ((B * C) / (A * A))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.6e-220: tmp = (180.0 / math.pi) * math.atan(((C + (B - A)) / B)) elif B <= 8.5e-303: tmp = 180.0 * (math.atan((0.5 * ((B / A) + ((B * C) / (A * A))))) / 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 (B <= -2.6e-220) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C + Float64(B - A)) / B))); elseif (B <= 8.5e-303) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(B / A) + Float64(Float64(B * C) / Float64(A * A))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.6e-220) tmp = (180.0 / pi) * atan(((C + (B - A)) / B)); elseif (B <= 8.5e-303) tmp = 180.0 * (atan((0.5 * ((B / A) + ((B * C) / (A * A))))) / pi); else tmp = 180.0 * (atan((((C - B) - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.6e-220], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8.5e-303], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(B / A), $MachinePrecision] + N[(N[(B * C), $MachinePrecision] / N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.6 \cdot 10^{-220}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\
\mathbf{elif}\;B \leq 8.5 \cdot 10^{-303}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(\frac{B}{A} + \frac{B \cdot C}{A \cdot A}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -2.6e-220Initial program 54.6%
associate-*r/54.6%
associate-*l/54.6%
associate-*l/54.6%
*-lft-identity54.6%
sub-neg54.6%
associate-+l-54.6%
sub-neg54.6%
remove-double-neg54.6%
+-commutative54.6%
unpow254.6%
unpow254.6%
hypot-def72.7%
Simplified72.7%
Taylor expanded in B around -inf 69.6%
neg-mul-169.6%
unsub-neg69.6%
Simplified69.6%
if -2.6e-220 < B < 8.5e-303Initial program 57.2%
associate-*l/57.2%
*-lft-identity57.2%
+-commutative57.2%
unpow257.2%
unpow257.2%
hypot-def94.8%
Simplified94.8%
Taylor expanded in A around -inf 64.7%
distribute-lft-out64.7%
*-commutative64.7%
unpow264.7%
Simplified64.7%
if 8.5e-303 < B Initial program 61.6%
associate-*l/61.6%
*-lft-identity61.6%
+-commutative61.6%
unpow261.6%
unpow261.6%
hypot-def84.2%
Simplified84.2%
Taylor expanded in B around inf 73.8%
neg-mul-173.8%
unsub-neg73.8%
Simplified73.8%
Final simplification71.5%
(FPCore (A B C)
:precision binary64
(if (<= B -2.6e-214)
(* (/ 180.0 PI) (atan (/ (+ C (- B A)) B)))
(if (<= B 7.5e-234)
(/ (* 180.0 (atan (* (+ (/ B (/ (* A A) C)) (/ B A)) 0.5))) PI)
(* 180.0 (/ (atan (/ (- (- C B) A) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.6e-214) {
tmp = (180.0 / ((double) M_PI)) * atan(((C + (B - A)) / B));
} else if (B <= 7.5e-234) {
tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / ((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 (B <= -2.6e-214) {
tmp = (180.0 / Math.PI) * Math.atan(((C + (B - A)) / B));
} else if (B <= 7.5e-234) {
tmp = (180.0 * Math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.6e-214: tmp = (180.0 / math.pi) * math.atan(((C + (B - A)) / B)) elif B <= 7.5e-234: tmp = (180.0 * math.atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / 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 (B <= -2.6e-214) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C + Float64(B - A)) / B))); elseif (B <= 7.5e-234) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(B / Float64(Float64(A * A) / C)) + Float64(B / A)) * 0.5))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.6e-214) tmp = (180.0 / pi) * atan(((C + (B - A)) / B)); elseif (B <= 7.5e-234) tmp = (180.0 * atan((((B / ((A * A) / C)) + (B / A)) * 0.5))) / pi; else tmp = 180.0 * (atan((((C - B) - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.6e-214], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.5e-234], N[(N[(180.0 * N[ArcTan[N[(N[(N[(B / N[(N[(A * A), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(B / A), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.6 \cdot 10^{-214}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\
\mathbf{elif}\;B \leq 7.5 \cdot 10^{-234}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{\frac{A \cdot A}{C}} + \frac{B}{A}\right) \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -2.6e-214Initial program 54.6%
associate-*r/54.6%
associate-*l/54.6%
associate-*l/54.6%
*-lft-identity54.6%
sub-neg54.6%
associate-+l-54.6%
sub-neg54.6%
remove-double-neg54.6%
+-commutative54.6%
unpow254.6%
unpow254.6%
hypot-def72.7%
Simplified72.7%
Taylor expanded in B around -inf 69.6%
neg-mul-169.6%
unsub-neg69.6%
Simplified69.6%
if -2.6e-214 < B < 7.49999999999999996e-234Initial program 58.3%
associate-*l/58.3%
*-lft-identity58.3%
+-commutative58.3%
unpow258.3%
unpow258.3%
hypot-def90.6%
Simplified90.6%
Taylor expanded in A around -inf 59.3%
distribute-lft-out59.3%
*-commutative59.3%
unpow259.3%
Simplified59.3%
associate-*r/59.3%
*-commutative59.3%
associate-/l*66.0%
Applied egg-rr66.0%
if 7.49999999999999996e-234 < B Initial program 61.8%
associate-*l/61.8%
*-lft-identity61.8%
+-commutative61.8%
unpow261.8%
unpow261.8%
hypot-def84.3%
Simplified84.3%
Taylor expanded in B around inf 75.2%
neg-mul-175.2%
unsub-neg75.2%
Simplified75.2%
Final simplification71.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ C B)) PI)))
(t_1 (* 180.0 (/ (atan 1.0) PI))))
(if (<= B -1.42e-66)
t_1
(if (<= B -1.3e-149)
t_0
(if (<= B -4e-166)
t_1
(if (<= B 3.1e-173)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 1.2e-53) 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 t_1 = 180.0 * (atan(1.0) / ((double) M_PI));
double tmp;
if (B <= -1.42e-66) {
tmp = t_1;
} else if (B <= -1.3e-149) {
tmp = t_0;
} else if (B <= -4e-166) {
tmp = t_1;
} else if (B <= 3.1e-173) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 1.2e-53) {
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 t_1 = 180.0 * (Math.atan(1.0) / Math.PI);
double tmp;
if (B <= -1.42e-66) {
tmp = t_1;
} else if (B <= -1.3e-149) {
tmp = t_0;
} else if (B <= -4e-166) {
tmp = t_1;
} else if (B <= 3.1e-173) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 1.2e-53) {
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) t_1 = 180.0 * (math.atan(1.0) / math.pi) tmp = 0 if B <= -1.42e-66: tmp = t_1 elif B <= -1.3e-149: tmp = t_0 elif B <= -4e-166: tmp = t_1 elif B <= 3.1e-173: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 1.2e-53: 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)) t_1 = Float64(180.0 * Float64(atan(1.0) / pi)) tmp = 0.0 if (B <= -1.42e-66) tmp = t_1; elseif (B <= -1.3e-149) tmp = t_0; elseif (B <= -4e-166) tmp = t_1; elseif (B <= 3.1e-173) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 1.2e-53) 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); t_1 = 180.0 * (atan(1.0) / pi); tmp = 0.0; if (B <= -1.42e-66) tmp = t_1; elseif (B <= -1.3e-149) tmp = t_0; elseif (B <= -4e-166) tmp = t_1; elseif (B <= 3.1e-173) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 1.2e-53) 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]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.42e-66], t$95$1, If[LessEqual[B, -1.3e-149], t$95$0, If[LessEqual[B, -4e-166], t$95$1, If[LessEqual[B, 3.1e-173], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.2e-53], 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}\\
t_1 := 180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{if}\;B \leq -1.42 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq -1.3 \cdot 10^{-149}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq -4 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 3.1 \cdot 10^{-173}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 1.2 \cdot 10^{-53}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.41999999999999988e-66 or -1.29999999999999999e-149 < B < -4.00000000000000016e-166Initial program 51.2%
associate-*l/51.2%
*-lft-identity51.2%
+-commutative51.2%
unpow251.2%
unpow251.2%
hypot-def76.0%
Simplified76.0%
Taylor expanded in B around -inf 52.2%
if -1.41999999999999988e-66 < B < -1.29999999999999999e-149 or 3.10000000000000005e-173 < B < 1.20000000000000004e-53Initial program 58.9%
associate-*l/58.9%
*-lft-identity58.9%
+-commutative58.9%
unpow258.9%
unpow258.9%
hypot-def71.7%
Simplified71.7%
Taylor expanded in B around inf 57.5%
neg-mul-157.5%
unsub-neg57.5%
Simplified57.5%
Taylor expanded in C around inf 35.7%
if -4.00000000000000016e-166 < B < 3.10000000000000005e-173Initial program 64.6%
associate-*l/64.6%
*-lft-identity64.6%
+-commutative64.6%
unpow264.6%
unpow264.6%
hypot-def94.2%
Simplified94.2%
div-sub49.3%
sub-neg49.3%
Applied egg-rr49.3%
sub-neg49.3%
Simplified49.3%
Taylor expanded in C around inf 19.6%
distribute-rgt1-in19.6%
metadata-eval19.6%
mul0-lft46.8%
metadata-eval46.8%
Simplified46.8%
if 1.20000000000000004e-53 < B Initial program 61.2%
associate-*l/61.2%
*-lft-identity61.2%
+-commutative61.2%
unpow261.2%
unpow261.2%
hypot-def85.0%
Simplified85.0%
Taylor expanded in B around inf 63.1%
Final simplification52.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) PI))))
(if (<= A -7.6e-271)
(* 180.0 (/ (atan (* (/ B A) 0.5)) PI))
(if (<= A 1.7e-116)
t_0
(if (<= A 3.8e-95)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 2000.0) t_0 (* 180.0 (/ (atan (/ (* A -2.0) B)) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
double tmp;
if (A <= -7.6e-271) {
tmp = 180.0 * (atan(((B / A) * 0.5)) / ((double) M_PI));
} else if (A <= 1.7e-116) {
tmp = t_0;
} else if (A <= 3.8e-95) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 2000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
double tmp;
if (A <= -7.6e-271) {
tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / Math.PI);
} else if (A <= 1.7e-116) {
tmp = t_0;
} else if (A <= 3.8e-95) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 2000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(-1.0) / math.pi) tmp = 0 if A <= -7.6e-271: tmp = 180.0 * (math.atan(((B / A) * 0.5)) / math.pi) elif A <= 1.7e-116: tmp = t_0 elif A <= 3.8e-95: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 2000.0: tmp = t_0 else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(-1.0) / pi)) tmp = 0.0 if (A <= -7.6e-271) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi)); elseif (A <= 1.7e-116) tmp = t_0; elseif (A <= 3.8e-95) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 2000.0) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(-1.0) / pi); tmp = 0.0; if (A <= -7.6e-271) tmp = 180.0 * (atan(((B / A) * 0.5)) / pi); elseif (A <= 1.7e-116) tmp = t_0; elseif (A <= 3.8e-95) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 2000.0) tmp = t_0; else tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -7.6e-271], N[(180.0 * N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.7e-116], t$95$0, If[LessEqual[A, 3.8e-95], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2000.0], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{if}\;A \leq -7.6 \cdot 10^{-271}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.7 \cdot 10^{-116}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 3.8 \cdot 10^{-95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 2000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -7.60000000000000019e-271Initial program 36.1%
associate-*l/36.1%
*-lft-identity36.1%
+-commutative36.1%
unpow236.1%
unpow236.1%
hypot-def64.1%
Simplified64.1%
Taylor expanded in A around -inf 54.8%
if -7.60000000000000019e-271 < A < 1.69999999999999996e-116 or 3.7999999999999997e-95 < A < 2e3Initial program 69.1%
associate-*l/69.1%
*-lft-identity69.1%
+-commutative69.1%
unpow269.1%
unpow269.1%
hypot-def91.7%
Simplified91.7%
Taylor expanded in B around inf 44.8%
if 1.69999999999999996e-116 < A < 3.7999999999999997e-95Initial program 67.5%
associate-*l/67.5%
*-lft-identity67.5%
+-commutative67.5%
unpow267.5%
unpow267.5%
hypot-def100.0%
Simplified100.0%
Taylor expanded in B around -inf 83.8%
if 2e3 < A Initial program 79.4%
associate-*l/79.4%
*-lft-identity79.4%
+-commutative79.4%
unpow279.4%
unpow279.4%
hypot-def96.0%
Simplified96.0%
Taylor expanded in A around inf 72.4%
*-commutative72.4%
Simplified72.4%
Final simplification56.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- A) B)) PI))))
(if (<= B -7e-38)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -1.15e-219)
t_0
(if (<= B 2.6e-173)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 1.55e-53) 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 <= -7e-38) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -1.15e-219) {
tmp = t_0;
} else if (B <= 2.6e-173) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 1.55e-53) {
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 <= -7e-38) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -1.15e-219) {
tmp = t_0;
} else if (B <= 2.6e-173) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 1.55e-53) {
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 <= -7e-38: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -1.15e-219: tmp = t_0 elif B <= 2.6e-173: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 1.55e-53: 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(Float64(-A) / B)) / pi)) tmp = 0.0 if (B <= -7e-38) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -1.15e-219) tmp = t_0; elseif (B <= 2.6e-173) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 1.55e-53) 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 <= -7e-38) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -1.15e-219) tmp = t_0; elseif (B <= 2.6e-173) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 1.55e-53) 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, -7e-38], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.15e-219], t$95$0, If[LessEqual[B, 2.6e-173], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.55e-53], 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 -7 \cdot 10^{-38}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -1.15 \cdot 10^{-219}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-173}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 1.55 \cdot 10^{-53}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -7.0000000000000003e-38Initial program 48.3%
associate-*l/48.3%
*-lft-identity48.3%
+-commutative48.3%
unpow248.3%
unpow248.3%
hypot-def76.1%
Simplified76.1%
Taylor expanded in B around -inf 57.2%
if -7.0000000000000003e-38 < B < -1.14999999999999994e-219 or 2.60000000000000003e-173 < B < 1.55000000000000008e-53Initial program 62.9%
associate-*l/62.9%
*-lft-identity62.9%
+-commutative62.9%
unpow262.9%
unpow262.9%
hypot-def76.1%
Simplified76.1%
Taylor expanded in B around inf 59.6%
neg-mul-159.6%
unsub-neg59.6%
Simplified59.6%
Taylor expanded in A around inf 45.4%
associate-*r/45.4%
mul-1-neg45.4%
Simplified45.4%
if -1.14999999999999994e-219 < B < 2.60000000000000003e-173Initial program 62.4%
associate-*l/62.4%
*-lft-identity62.4%
+-commutative62.4%
unpow262.4%
unpow262.4%
hypot-def93.1%
Simplified93.1%
div-sub46.7%
sub-neg46.7%
Applied egg-rr46.7%
sub-neg46.7%
Simplified46.7%
Taylor expanded in C around inf 20.8%
distribute-rgt1-in20.8%
metadata-eval20.8%
mul0-lft48.2%
metadata-eval48.2%
Simplified48.2%
if 1.55000000000000008e-53 < B Initial program 61.2%
associate-*l/61.2%
*-lft-identity61.2%
+-commutative61.2%
unpow261.2%
unpow261.2%
hypot-def85.0%
Simplified85.0%
Taylor expanded in B around inf 63.1%
Final simplification55.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) PI))))
(if (<= A -2.55e-273)
(* 180.0 (/ (atan (* (/ B A) 0.5)) PI))
(if (<= A 1.95e-116)
t_0
(if (<= A 4.5e-95)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 20000.0) t_0 (* 180.0 (/ (atan (/ (- A) B)) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
double tmp;
if (A <= -2.55e-273) {
tmp = 180.0 * (atan(((B / A) * 0.5)) / ((double) M_PI));
} else if (A <= 1.95e-116) {
tmp = t_0;
} else if (A <= 4.5e-95) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 20000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
double tmp;
if (A <= -2.55e-273) {
tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / Math.PI);
} else if (A <= 1.95e-116) {
tmp = t_0;
} else if (A <= 4.5e-95) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 20000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(-1.0) / math.pi) tmp = 0 if A <= -2.55e-273: tmp = 180.0 * (math.atan(((B / A) * 0.5)) / math.pi) elif A <= 1.95e-116: tmp = t_0 elif A <= 4.5e-95: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 20000.0: tmp = t_0 else: tmp = 180.0 * (math.atan((-A / B)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(-1.0) / pi)) tmp = 0.0 if (A <= -2.55e-273) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi)); elseif (A <= 1.95e-116) tmp = t_0; elseif (A <= 4.5e-95) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 20000.0) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(-1.0) / pi); tmp = 0.0; if (A <= -2.55e-273) tmp = 180.0 * (atan(((B / A) * 0.5)) / pi); elseif (A <= 1.95e-116) tmp = t_0; elseif (A <= 4.5e-95) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 20000.0) tmp = t_0; else tmp = 180.0 * (atan((-A / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -2.55e-273], N[(180.0 * N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.95e-116], t$95$0, If[LessEqual[A, 4.5e-95], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 20000.0], t$95$0, N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{if}\;A \leq -2.55 \cdot 10^{-273}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.95 \cdot 10^{-116}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 4.5 \cdot 10^{-95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 20000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.54999999999999983e-273Initial program 36.1%
associate-*l/36.1%
*-lft-identity36.1%
+-commutative36.1%
unpow236.1%
unpow236.1%
hypot-def64.1%
Simplified64.1%
Taylor expanded in A around -inf 54.8%
if -2.54999999999999983e-273 < A < 1.95e-116 or 4.5e-95 < A < 2e4Initial program 69.1%
associate-*l/69.1%
*-lft-identity69.1%
+-commutative69.1%
unpow269.1%
unpow269.1%
hypot-def91.7%
Simplified91.7%
Taylor expanded in B around inf 44.8%
if 1.95e-116 < A < 4.5e-95Initial program 67.5%
associate-*l/67.5%
*-lft-identity67.5%
+-commutative67.5%
unpow267.5%
unpow267.5%
hypot-def100.0%
Simplified100.0%
Taylor expanded in B around -inf 83.8%
if 2e4 < A Initial program 79.4%
associate-*l/79.4%
*-lft-identity79.4%
+-commutative79.4%
unpow279.4%
unpow279.4%
hypot-def96.0%
Simplified96.0%
Taylor expanded in B around inf 75.1%
neg-mul-175.1%
unsub-neg75.1%
Simplified75.1%
Taylor expanded in A around inf 70.5%
associate-*r/70.5%
mul-1-neg70.5%
Simplified70.5%
Final simplification56.3%
(FPCore (A B C)
:precision binary64
(if (<= B -4.3e-221)
(* (/ 180.0 PI) (atan (/ (+ C (- B A)) B)))
(if (<= B -2.55e-278)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan (/ (- (- C B) A) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.3e-221) {
tmp = (180.0 / ((double) M_PI)) * atan(((C + (B - A)) / B));
} else if (B <= -2.55e-278) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((C - B) - A) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -4.3e-221) {
tmp = (180.0 / Math.PI) * Math.atan(((C + (B - A)) / B));
} else if (B <= -2.55e-278) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.3e-221: tmp = (180.0 / math.pi) * math.atan(((C + (B - A)) / B)) elif B <= -2.55e-278: tmp = 180.0 * (math.atan(0.0) / 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 (B <= -4.3e-221) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C + Float64(B - A)) / B))); elseif (B <= -2.55e-278) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -4.3e-221) tmp = (180.0 / pi) * atan(((C + (B - A)) / B)); elseif (B <= -2.55e-278) tmp = 180.0 * (atan(0.0) / pi); else tmp = 180.0 * (atan((((C - B) - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.3e-221], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.55e-278], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.3 \cdot 10^{-221}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\
\mathbf{elif}\;B \leq -2.55 \cdot 10^{-278}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -4.2999999999999998e-221Initial program 54.6%
associate-*r/54.6%
associate-*l/54.6%
associate-*l/54.6%
*-lft-identity54.6%
sub-neg54.6%
associate-+l-54.6%
sub-neg54.6%
remove-double-neg54.6%
+-commutative54.6%
unpow254.6%
unpow254.6%
hypot-def72.7%
Simplified72.7%
Taylor expanded in B around -inf 69.6%
neg-mul-169.6%
unsub-neg69.6%
Simplified69.6%
if -4.2999999999999998e-221 < B < -2.55000000000000005e-278Initial program 43.8%
associate-*l/43.8%
*-lft-identity43.8%
+-commutative43.8%
unpow243.8%
unpow243.8%
hypot-def92.3%
Simplified92.3%
div-sub25.6%
sub-neg25.6%
Applied egg-rr25.6%
sub-neg25.6%
Simplified25.6%
Taylor expanded in C around inf 26.1%
distribute-rgt1-in26.1%
metadata-eval26.1%
mul0-lft68.1%
metadata-eval68.1%
Simplified68.1%
if -2.55000000000000005e-278 < B Initial program 62.6%
associate-*l/62.6%
*-lft-identity62.6%
+-commutative62.6%
unpow262.6%
unpow262.6%
hypot-def84.9%
Simplified84.9%
Taylor expanded in B around inf 72.8%
neg-mul-172.8%
unsub-neg72.8%
Simplified72.8%
Final simplification71.3%
(FPCore (A B C)
:precision binary64
(if (<= A -0.00019)
(* 180.0 (/ (atan (* (/ B A) 0.5)) PI))
(if (<= A 4500000000.0)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -0.00019) {
tmp = 180.0 * (atan(((B / A) * 0.5)) / ((double) M_PI));
} else if (A <= 4500000000.0) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -0.00019) {
tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / Math.PI);
} else if (A <= 4500000000.0) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -0.00019: tmp = 180.0 * (math.atan(((B / A) * 0.5)) / math.pi) elif A <= 4500000000.0: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -0.00019) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi)); elseif (A <= 4500000000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -0.00019) tmp = 180.0 * (atan(((B / A) * 0.5)) / pi); elseif (A <= 4500000000.0) tmp = 180.0 * (atan(((C - B) / B)) / pi); else tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -0.00019], N[(180.0 * N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4500000000.0], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -0.00019:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 4500000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.9000000000000001e-4Initial program 19.2%
associate-*l/19.2%
*-lft-identity19.2%
+-commutative19.2%
unpow219.2%
unpow219.2%
hypot-def52.3%
Simplified52.3%
Taylor expanded in A around -inf 69.2%
if -1.9000000000000001e-4 < A < 4.5e9Initial program 65.5%
associate-*l/65.5%
*-lft-identity65.5%
+-commutative65.5%
unpow265.5%
unpow265.5%
hypot-def88.0%
Simplified88.0%
Taylor expanded in B around inf 63.4%
neg-mul-163.4%
unsub-neg63.4%
Simplified63.4%
Taylor expanded in A around 0 59.9%
if 4.5e9 < A Initial program 79.4%
associate-*l/79.4%
*-lft-identity79.4%
+-commutative79.4%
unpow279.4%
unpow279.4%
hypot-def96.0%
Simplified96.0%
Taylor expanded in A around inf 72.4%
*-commutative72.4%
Simplified72.4%
Final simplification65.3%
(FPCore (A B C)
:precision binary64
(if (<= A -0.0052)
(* 180.0 (/ (atan (* (/ B A) 0.5)) PI))
(if (<= A 4200000000.0)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(* (/ 180.0 PI) (atan (* -2.0 (/ A B)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -0.0052) {
tmp = 180.0 * (atan(((B / A) * 0.5)) / ((double) M_PI));
} else if (A <= 4200000000.0) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan((-2.0 * (A / B)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -0.0052) {
tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / Math.PI);
} else if (A <= 4200000000.0) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan((-2.0 * (A / B)));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -0.0052: tmp = 180.0 * (math.atan(((B / A) * 0.5)) / math.pi) elif A <= 4200000000.0: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) else: tmp = (180.0 / math.pi) * math.atan((-2.0 * (A / B))) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -0.0052) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi)); elseif (A <= 4200000000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(-2.0 * Float64(A / B)))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -0.0052) tmp = 180.0 * (atan(((B / A) * 0.5)) / pi); elseif (A <= 4200000000.0) tmp = 180.0 * (atan(((C - B) / B)) / pi); else tmp = (180.0 / pi) * atan((-2.0 * (A / B))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -0.0052], N[(180.0 * N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4200000000.0], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -0.0052:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 4200000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-2 \cdot \frac{A}{B}\right)\\
\end{array}
\end{array}
if A < -0.0051999999999999998Initial program 19.2%
associate-*l/19.2%
*-lft-identity19.2%
+-commutative19.2%
unpow219.2%
unpow219.2%
hypot-def52.3%
Simplified52.3%
Taylor expanded in A around -inf 69.2%
if -0.0051999999999999998 < A < 4.2e9Initial program 65.5%
associate-*l/65.5%
*-lft-identity65.5%
+-commutative65.5%
unpow265.5%
unpow265.5%
hypot-def88.0%
Simplified88.0%
Taylor expanded in B around inf 63.4%
neg-mul-163.4%
unsub-neg63.4%
Simplified63.4%
Taylor expanded in A around 0 59.9%
if 4.2e9 < A Initial program 79.4%
associate-*l/79.4%
*-lft-identity79.4%
+-commutative79.4%
unpow279.4%
unpow279.4%
hypot-def96.0%
Simplified96.0%
Taylor expanded in A around inf 72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in A around 0 72.4%
associate-*r/72.4%
associate-/l*72.4%
associate-/r/72.4%
*-commutative72.4%
Simplified72.4%
Final simplification65.3%
(FPCore (A B C)
:precision binary64
(if (<= A -0.00015)
(* 180.0 (/ (atan (* (/ B A) 0.5)) PI))
(if (<= A 340000000.0)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(/ (* 180.0 (atan (* -2.0 (/ A B)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -0.00015) {
tmp = 180.0 * (atan(((B / A) * 0.5)) / ((double) M_PI));
} else if (A <= 340000000.0) {
tmp = 180.0 * (atan(((C - B) / 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 <= -0.00015) {
tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / Math.PI);
} else if (A <= 340000000.0) {
tmp = 180.0 * (Math.atan(((C - B) / 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 <= -0.00015: tmp = 180.0 * (math.atan(((B / A) * 0.5)) / math.pi) elif A <= 340000000.0: tmp = 180.0 * (math.atan(((C - B) / 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 <= -0.00015) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi)); elseif (A <= 340000000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(-2.0 * Float64(A / B)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -0.00015) tmp = 180.0 * (atan(((B / A) * 0.5)) / pi); elseif (A <= 340000000.0) tmp = 180.0 * (atan(((C - B) / B)) / pi); else tmp = (180.0 * atan((-2.0 * (A / B)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -0.00015], N[(180.0 * N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 340000000.0], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -0.00015:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 340000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.49999999999999987e-4Initial program 19.2%
associate-*l/19.2%
*-lft-identity19.2%
+-commutative19.2%
unpow219.2%
unpow219.2%
hypot-def52.3%
Simplified52.3%
Taylor expanded in A around -inf 69.2%
if -1.49999999999999987e-4 < A < 3.4e8Initial program 65.5%
associate-*l/65.5%
*-lft-identity65.5%
+-commutative65.5%
unpow265.5%
unpow265.5%
hypot-def88.0%
Simplified88.0%
Taylor expanded in B around inf 63.4%
neg-mul-163.4%
unsub-neg63.4%
Simplified63.4%
Taylor expanded in A around 0 59.9%
if 3.4e8 < A Initial program 79.4%
associate-*l/79.4%
*-lft-identity79.4%
+-commutative79.4%
unpow279.4%
unpow279.4%
hypot-def96.0%
Simplified96.0%
Taylor expanded in A around inf 72.4%
*-commutative72.4%
Simplified72.4%
associate-*r/72.4%
*-commutative72.4%
associate-*r/72.4%
Applied egg-rr72.4%
Final simplification65.3%
(FPCore (A B C) :precision binary64 (if (<= A -0.0028) (* 180.0 (/ (atan (* (/ B A) 0.5)) PI)) (* 180.0 (/ (atan (/ (- (- C B) A) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -0.0028) {
tmp = 180.0 * (atan(((B / A) * 0.5)) / ((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 <= -0.0028) {
tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / 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 <= -0.0028: tmp = 180.0 * (math.atan(((B / A) * 0.5)) / 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 <= -0.0028) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -0.0028) tmp = 180.0 * (atan(((B / A) * 0.5)) / pi); else tmp = 180.0 * (atan((((C - B) - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -0.0028], N[(180.0 * N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -0.0028:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -0.00279999999999999997Initial program 19.2%
associate-*l/19.2%
*-lft-identity19.2%
+-commutative19.2%
unpow219.2%
unpow219.2%
hypot-def52.3%
Simplified52.3%
Taylor expanded in A around -inf 69.2%
if -0.00279999999999999997 < A Initial program 70.2%
associate-*l/70.2%
*-lft-identity70.2%
+-commutative70.2%
unpow270.2%
unpow270.2%
hypot-def90.7%
Simplified90.7%
Taylor expanded in B around inf 67.4%
neg-mul-167.4%
unsub-neg67.4%
Simplified67.4%
Final simplification67.8%
(FPCore (A B C)
:precision binary64
(if (<= B -2.7e-164)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.6e-91)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.7e-164) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.6e-91) {
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 <= -2.7e-164) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.6e-91) {
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 <= -2.7e-164: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.6e-91: 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 <= -2.7e-164) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.6e-91) 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 <= -2.7e-164) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.6e-91) 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, -2.7e-164], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.6e-91], 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 -2.7 \cdot 10^{-164}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-91}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.7000000000000001e-164Initial program 52.9%
associate-*l/52.9%
*-lft-identity52.9%
+-commutative52.9%
unpow252.9%
unpow252.9%
hypot-def74.6%
Simplified74.6%
Taylor expanded in B around -inf 45.2%
if -2.7000000000000001e-164 < B < 2.60000000000000014e-91Initial program 62.1%
associate-*l/62.1%
*-lft-identity62.1%
+-commutative62.1%
unpow262.1%
unpow262.1%
hypot-def89.4%
Simplified89.4%
div-sub52.1%
sub-neg52.1%
Applied egg-rr52.1%
sub-neg52.1%
Simplified52.1%
Taylor expanded in C around inf 17.0%
distribute-rgt1-in17.0%
metadata-eval17.0%
mul0-lft39.5%
metadata-eval39.5%
Simplified39.5%
if 2.60000000000000014e-91 < B Initial program 61.7%
associate-*l/61.7%
*-lft-identity61.7%
+-commutative61.7%
unpow261.7%
unpow261.7%
hypot-def84.0%
Simplified84.0%
Taylor expanded in B around inf 60.0%
Final simplification49.1%
(FPCore (A B C) :precision binary64 (if (<= B 1.76e-91) (* 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.76e-91) {
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.76e-91) {
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.76e-91: 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.76e-91) 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.76e-91) 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.76e-91], 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.76 \cdot 10^{-91}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 1.7599999999999999e-91Initial program 56.6%
associate-*l/56.6%
*-lft-identity56.6%
+-commutative56.6%
unpow256.6%
unpow256.6%
hypot-def80.6%
Simplified80.6%
div-sub64.3%
sub-neg64.3%
Applied egg-rr64.3%
sub-neg64.3%
Simplified64.3%
Taylor expanded in C around inf 9.1%
distribute-rgt1-in9.1%
metadata-eval9.1%
mul0-lft19.4%
metadata-eval19.4%
Simplified19.4%
if 1.7599999999999999e-91 < B Initial program 61.7%
associate-*l/61.7%
*-lft-identity61.7%
+-commutative61.7%
unpow261.7%
unpow261.7%
hypot-def84.0%
Simplified84.0%
Taylor expanded in B around inf 60.0%
Final simplification34.3%
(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 58.5%
associate-*l/58.5%
*-lft-identity58.5%
+-commutative58.5%
unpow258.5%
unpow258.5%
hypot-def81.9%
Simplified81.9%
Taylor expanded in B around inf 25.2%
Final simplification25.2%
herbie shell --seed 2023174
(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)))