
(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
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (- (- C A) (hypot (- A C) B))))
(if (<= t_0 -0.05)
(* 180.0 (/ 1.0 (/ PI (atan (/ t_1 B)))))
(if (<= t_0 0.0)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(/ 180.0 (/ PI (atan (* (/ 1.0 B) t_1))))))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_1 = (C - A) - hypot((A - C), B);
double tmp;
if (t_0 <= -0.05) {
tmp = 180.0 * (1.0 / (((double) M_PI) / atan((t_1 / B))));
} else if (t_0 <= 0.0) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else {
tmp = 180.0 / (((double) M_PI) / atan(((1.0 / B) * t_1)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_1 = (C - A) - Math.hypot((A - C), B);
double tmp;
if (t_0 <= -0.05) {
tmp = 180.0 * (1.0 / (Math.PI / Math.atan((t_1 / B))));
} else if (t_0 <= 0.0) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else {
tmp = 180.0 / (Math.PI / Math.atan(((1.0 / B) * t_1)));
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_1 = (C - A) - math.hypot((A - C), B) tmp = 0 if t_0 <= -0.05: tmp = 180.0 * (1.0 / (math.pi / math.atan((t_1 / B)))) elif t_0 <= 0.0: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) else: tmp = 180.0 / (math.pi / math.atan(((1.0 / B) * t_1))) return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_1 = Float64(Float64(C - A) - hypot(Float64(A - C), B)) tmp = 0.0 if (t_0 <= -0.05) tmp = Float64(180.0 * Float64(1.0 / Float64(pi / atan(Float64(t_1 / B))))); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); else tmp = Float64(180.0 / Float64(pi / atan(Float64(Float64(1.0 / B) * t_1)))); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_1 = (C - A) - hypot((A - C), B); tmp = 0.0; if (t_0 <= -0.05) tmp = 180.0 * (1.0 / (pi / atan((t_1 / B)))); elseif (t_0 <= 0.0) tmp = (180.0 / pi) * atan((0.5 * (B / A))); else tmp = 180.0 / (pi / atan(((1.0 / B) * t_1))); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.05], N[(180.0 * N[(1.0 / N[(Pi / N[ArcTan[N[(t$95$1 / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)\\
\mathbf{if}\;t_0 \leq -0.05:\\
\;\;\;\;180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{t_1}{B}\right)}}\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{1}{B} \cdot t_1\right)}}\\
\end{array}
\end{array}
if (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -0.050000000000000003Initial program 64.5%
Applied egg-rr86.1%
div-inv86.1%
Applied egg-rr86.1%
if -0.050000000000000003 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -0.0Initial program 14.7%
Applied egg-rr14.7%
Taylor expanded in A around -inf 45.8%
expm1-log1p-u45.4%
expm1-udef14.3%
associate-/r/14.3%
*-un-lft-identity14.3%
times-frac14.3%
metadata-eval14.3%
Applied egg-rr14.3%
expm1-def45.4%
expm1-log1p45.8%
associate-/l/49.9%
unpow249.9%
times-frac65.3%
*-inverses65.3%
Simplified65.3%
if -0.0 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) Initial program 67.9%
Applied egg-rr90.9%
div-inv90.9%
Applied egg-rr90.9%
Final simplification84.9%
(FPCore (A B C)
:precision binary64
(if (<= A -2.7e+23)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= A 7e-67)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(/ 180.0 (/ PI (atan (* (+ A (hypot A B)) (/ -1.0 B))))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.7e+23) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (A <= 7e-67) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 / (((double) M_PI) / atan(((A + hypot(A, B)) * (-1.0 / B))));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.7e+23) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (A <= 7e-67) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 / (Math.PI / Math.atan(((A + Math.hypot(A, B)) * (-1.0 / B))));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.7e+23: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif A <= 7e-67: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 / (math.pi / math.atan(((A + math.hypot(A, B)) * (-1.0 / B)))) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.7e+23) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (A <= 7e-67) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 / Float64(pi / atan(Float64(Float64(A + hypot(A, B)) * Float64(-1.0 / B))))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.7e+23) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (A <= 7e-67) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 / (pi / atan(((A + hypot(A, B)) * (-1.0 / B)))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.7e+23], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7e-67], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.7 \cdot 10^{+23}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;A \leq 7 \cdot 10^{-67}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\left(A + \mathsf{hypot}\left(A, B\right)\right) \cdot \frac{-1}{B}\right)}}\\
\end{array}
\end{array}
if A < -2.6999999999999999e23Initial program 24.0%
Applied egg-rr46.7%
Taylor expanded in A around -inf 57.0%
expm1-log1p-u54.3%
expm1-udef23.2%
associate-/r/23.2%
*-un-lft-identity23.2%
times-frac23.2%
metadata-eval23.2%
Applied egg-rr23.2%
expm1-def54.3%
expm1-log1p57.0%
associate-/l/58.4%
unpow258.4%
times-frac72.0%
*-inverses72.0%
Simplified72.0%
if -2.6999999999999999e23 < A < 7.0000000000000001e-67Initial program 62.8%
Taylor expanded in A around 0 61.4%
unpow261.4%
unpow261.4%
hypot-def78.9%
Simplified78.9%
if 7.0000000000000001e-67 < A Initial program 75.5%
Applied egg-rr93.8%
div-inv93.8%
Applied egg-rr93.8%
Taylor expanded in C around 0 72.8%
distribute-lft-in72.8%
+-commutative72.8%
unpow272.8%
unpow272.8%
hypot-def86.7%
neg-mul-186.7%
sub-neg86.7%
neg-mul-186.7%
hypot-def72.8%
unpow272.8%
unpow272.8%
+-commutative72.8%
unpow272.8%
unpow272.8%
hypot-def86.7%
Simplified86.7%
Final simplification79.9%
(FPCore (A B C) :precision binary64 (if (<= A -8.6e+22) (* (/ 180.0 PI) (atan (* 0.5 (/ B A)))) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -8.6e+22) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -8.6e+22) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -8.6e+22: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -8.6e+22) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -8.6e+22) tmp = (180.0 / pi) * atan((0.5 * (B / A))); else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -8.6e+22], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.6 \cdot 10^{+22}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.6000000000000004e22Initial program 24.0%
Applied egg-rr46.7%
Taylor expanded in A around -inf 57.0%
expm1-log1p-u54.3%
expm1-udef23.2%
associate-/r/23.2%
*-un-lft-identity23.2%
times-frac23.2%
metadata-eval23.2%
Applied egg-rr23.2%
expm1-def54.3%
expm1-log1p57.0%
associate-/l/58.4%
unpow258.4%
times-frac72.0%
*-inverses72.0%
Simplified72.0%
if -8.6000000000000004e22 < A Initial program 68.1%
Simplified85.9%
Final simplification82.8%
(FPCore (A B C) :precision binary64 (if (<= A -4.9e+23) (* (/ 180.0 PI) (atan (* 0.5 (/ B A)))) (/ 180.0 (/ PI (atan (/ (- (- C A) (hypot (- A C) B)) B))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.9e+23) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else {
tmp = 180.0 / (((double) M_PI) / atan((((C - A) - hypot((A - C), B)) / B)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -4.9e+23) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else {
tmp = 180.0 / (Math.PI / Math.atan((((C - A) - Math.hypot((A - C), B)) / B)));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -4.9e+23: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) else: tmp = 180.0 / (math.pi / math.atan((((C - A) - math.hypot((A - C), B)) / B))) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -4.9e+23) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); else tmp = Float64(180.0 / Float64(pi / atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / B)))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -4.9e+23) tmp = (180.0 / pi) * atan((0.5 * (B / A))); else tmp = 180.0 / (pi / atan((((C - A) - hypot((A - C), B)) / B))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -4.9e+23], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.9 \cdot 10^{+23}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}}\\
\end{array}
\end{array}
if A < -4.9000000000000003e23Initial program 24.0%
Applied egg-rr46.7%
Taylor expanded in A around -inf 57.0%
expm1-log1p-u54.3%
expm1-udef23.2%
associate-/r/23.2%
*-un-lft-identity23.2%
times-frac23.2%
metadata-eval23.2%
Applied egg-rr23.2%
expm1-def54.3%
expm1-log1p57.0%
associate-/l/58.4%
unpow258.4%
times-frac72.0%
*-inverses72.0%
Simplified72.0%
if -4.9000000000000003e23 < A Initial program 68.1%
Applied egg-rr85.9%
Final simplification82.8%
(FPCore (A B C)
:precision binary64
(if (<= A -1.32e+23)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= A 2e-67)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (/ (- (- A) (hypot B A)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.32e+23) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (A <= 2e-67) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-A - hypot(B, A)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.32e+23) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (A <= 2e-67) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-A - Math.hypot(B, A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.32e+23: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif A <= 2e-67: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((-A - math.hypot(B, A)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.32e+23) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (A <= 2e-67) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - hypot(B, A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.32e+23) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (A <= 2e-67) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan(((-A - hypot(B, A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.32e+23], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2e-67], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[((-A) - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.32 \cdot 10^{+23}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;A \leq 2 \cdot 10^{-67}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(B, A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.3199999999999999e23Initial program 24.0%
Applied egg-rr46.7%
Taylor expanded in A around -inf 57.0%
expm1-log1p-u54.3%
expm1-udef23.2%
associate-/r/23.2%
*-un-lft-identity23.2%
times-frac23.2%
metadata-eval23.2%
Applied egg-rr23.2%
expm1-def54.3%
expm1-log1p57.0%
associate-/l/58.4%
unpow258.4%
times-frac72.0%
*-inverses72.0%
Simplified72.0%
if -1.3199999999999999e23 < A < 1.99999999999999989e-67Initial program 62.8%
Taylor expanded in A around 0 61.4%
unpow261.4%
unpow261.4%
hypot-def78.9%
Simplified78.9%
if 1.99999999999999989e-67 < A Initial program 75.5%
Taylor expanded in C around 0 72.8%
associate-*r/72.8%
mul-1-neg72.8%
+-commutative72.8%
unpow272.8%
unpow272.8%
hypot-def86.7%
Simplified86.7%
Final simplification79.9%
(FPCore (A B C)
:precision binary64
(if (<= A -5.8e+21)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= A 2.5e-67)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(/ 180.0 (/ PI (atan (/ (- (- A) (hypot A B)) B)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.8e+21) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (A <= 2.5e-67) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 / (((double) M_PI) / atan(((-A - hypot(A, B)) / B)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -5.8e+21) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (A <= 2.5e-67) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 / (Math.PI / Math.atan(((-A - Math.hypot(A, B)) / B)));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -5.8e+21: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif A <= 2.5e-67: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 / (math.pi / math.atan(((-A - math.hypot(A, B)) / B))) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -5.8e+21) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (A <= 2.5e-67) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 / Float64(pi / atan(Float64(Float64(Float64(-A) - hypot(A, B)) / B)))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5.8e+21) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (A <= 2.5e-67) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 / (pi / atan(((-A - hypot(A, B)) / B))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5.8e+21], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.5e-67], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(N[((-A) - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.8 \cdot 10^{+21}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;A \leq 2.5 \cdot 10^{-67}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(A, B\right)}{B}\right)}}\\
\end{array}
\end{array}
if A < -5.8e21Initial program 24.0%
Applied egg-rr46.7%
Taylor expanded in A around -inf 57.0%
expm1-log1p-u54.3%
expm1-udef23.2%
associate-/r/23.2%
*-un-lft-identity23.2%
times-frac23.2%
metadata-eval23.2%
Applied egg-rr23.2%
expm1-def54.3%
expm1-log1p57.0%
associate-/l/58.4%
unpow258.4%
times-frac72.0%
*-inverses72.0%
Simplified72.0%
if -5.8e21 < A < 2.4999999999999999e-67Initial program 62.8%
Taylor expanded in A around 0 61.4%
unpow261.4%
unpow261.4%
hypot-def78.9%
Simplified78.9%
if 2.4999999999999999e-67 < A Initial program 75.5%
Applied egg-rr93.8%
Taylor expanded in C around 0 72.8%
distribute-lft-in72.8%
+-commutative72.8%
unpow272.8%
unpow272.8%
hypot-def86.7%
neg-mul-186.7%
sub-neg86.7%
neg-mul-186.7%
hypot-def72.8%
unpow272.8%
unpow272.8%
+-commutative72.8%
unpow272.8%
unpow272.8%
hypot-def86.7%
Simplified86.7%
Final simplification79.9%
(FPCore (A B C)
:precision binary64
(if (<= A -5.3e+23)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= A 8.6e-72)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (/ (- C (+ B A)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.3e+23) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (A <= 8.6e-72) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (B + A)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -5.3e+23) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (A <= 8.6e-72) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (B + A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -5.3e+23: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif A <= 8.6e-72: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (B + A)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -5.3e+23) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (A <= 8.6e-72) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(B + A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5.3e+23) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (A <= 8.6e-72) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan(((C - (B + A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5.3e+23], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 8.6e-72], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(B + A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;A \leq 8.6 \cdot 10^{-72}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.3000000000000001e23Initial program 24.0%
Applied egg-rr46.7%
Taylor expanded in A around -inf 57.0%
expm1-log1p-u54.3%
expm1-udef23.2%
associate-/r/23.2%
*-un-lft-identity23.2%
times-frac23.2%
metadata-eval23.2%
Applied egg-rr23.2%
expm1-def54.3%
expm1-log1p57.0%
associate-/l/58.4%
unpow258.4%
times-frac72.0%
*-inverses72.0%
Simplified72.0%
if -5.3000000000000001e23 < A < 8.5999999999999998e-72Initial program 61.9%
Taylor expanded in A around 0 60.4%
unpow260.4%
unpow260.4%
hypot-def78.3%
Simplified78.3%
if 8.5999999999999998e-72 < A Initial program 76.3%
Simplified94.0%
Taylor expanded in B around inf 79.9%
+-commutative79.9%
Simplified79.9%
Final simplification77.4%
(FPCore (A B C)
:precision binary64
(if (<= A -6e-145)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 1.8e-252)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= A 1e-144)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 1.15e-61)
(* 180.0 (/ (atan -1.0) PI))
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -6e-145) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 1.8e-252) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (A <= 1e-144) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 1.15e-61) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -6e-145) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 1.8e-252) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (A <= 1e-144) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 1.15e-61) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6e-145: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 1.8e-252: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif A <= 1e-144: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 1.15e-61: tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6e-145) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 1.8e-252) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (A <= 1e-144) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 1.15e-61) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -6e-145) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 1.8e-252) tmp = 180.0 * (atan((C / B)) / pi); elseif (A <= 1e-144) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 1.15e-61) tmp = 180.0 * (atan(-1.0) / pi); else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6e-145], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.8e-252], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1e-144], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.15e-61], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6 \cdot 10^{-145}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.8 \cdot 10^{-252}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 10^{-144}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 1.15 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.99999999999999985e-145Initial program 31.9%
Taylor expanded in A around -inf 62.2%
if -5.99999999999999985e-145 < A < 1.80000000000000011e-252Initial program 68.5%
Simplified84.7%
add-sqr-sqrt80.5%
pow280.5%
hypot-udef64.2%
unpow264.2%
unpow264.2%
+-commutative64.2%
unpow264.2%
unpow264.2%
hypot-def80.5%
Applied egg-rr80.5%
Taylor expanded in C around inf 49.1%
if 1.80000000000000011e-252 < A < 9.9999999999999995e-145Initial program 55.7%
Taylor expanded in B around -inf 44.9%
if 9.9999999999999995e-145 < A < 1.14999999999999996e-61Initial program 76.1%
Taylor expanded in B around inf 54.8%
if 1.14999999999999996e-61 < A Initial program 75.9%
Taylor expanded in A around inf 67.4%
Final simplification59.4%
(FPCore (A B C)
:precision binary64
(if (<= A -6.8e-145)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 1.2e-249)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= A 1.22e-141)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 1.25e-54)
(* 180.0 (/ (atan -1.0) PI))
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -6.8e-145) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 1.2e-249) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (A <= 1.22e-141) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 1.25e-54) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -6.8e-145) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 1.2e-249) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (A <= 1.22e-141) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 1.25e-54) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6.8e-145: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 1.2e-249: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif A <= 1.22e-141: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 1.25e-54: tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6.8e-145) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 1.2e-249) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (A <= 1.22e-141) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 1.25e-54) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -6.8e-145) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 1.2e-249) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (A <= 1.22e-141) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 1.25e-54) tmp = 180.0 * (atan(-1.0) / pi); else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6.8e-145], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.2e-249], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.22e-141], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.25e-54], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.8 \cdot 10^{-145}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.2 \cdot 10^{-249}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.22 \cdot 10^{-141}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 1.25 \cdot 10^{-54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < -6.7999999999999998e-145Initial program 31.9%
Taylor expanded in A around -inf 62.2%
if -6.7999999999999998e-145 < A < 1.20000000000000006e-249Initial program 68.5%
Taylor expanded in C around -inf 49.4%
if 1.20000000000000006e-249 < A < 1.22e-141Initial program 55.7%
Taylor expanded in B around -inf 44.9%
if 1.22e-141 < A < 1.25000000000000004e-54Initial program 76.1%
Taylor expanded in B around inf 54.8%
if 1.25000000000000004e-54 < A Initial program 75.9%
Taylor expanded in A around inf 67.4%
Final simplification59.4%
(FPCore (A B C)
:precision binary64
(if (<= A -3.3e-143)
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
(if (or (<= A 3.9e-231) (not (<= A 1.45e-169)))
(* 180.0 (/ (atan (/ (- C (+ B A)) B)) PI))
(* 180.0 (/ (atan 1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.3e-143) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else if ((A <= 3.9e-231) || !(A <= 1.45e-169)) {
tmp = 180.0 * (atan(((C - (B + 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 (A <= -3.3e-143) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else if ((A <= 3.9e-231) || !(A <= 1.45e-169)) {
tmp = 180.0 * (Math.atan(((C - (B + A)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.3e-143: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi elif (A <= 3.9e-231) or not (A <= 1.45e-169): tmp = 180.0 * (math.atan(((C - (B + 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 (A <= -3.3e-143) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); elseif ((A <= 3.9e-231) || !(A <= 1.45e-169)) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(B + 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 (A <= -3.3e-143) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; elseif ((A <= 3.9e-231) || ~((A <= 1.45e-169))) tmp = 180.0 * (atan(((C - (B + A)) / B)) / pi); else tmp = 180.0 * (atan(1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.3e-143], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[Or[LessEqual[A, 3.9e-231], N[Not[LessEqual[A, 1.45e-169]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(B + A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.3 \cdot 10^{-143}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 3.9 \cdot 10^{-231} \lor \neg \left(A \leq 1.45 \cdot 10^{-169}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\end{array}
\end{array}
if A < -3.3000000000000001e-143Initial program 32.1%
Applied egg-rr52.4%
Taylor expanded in A around -inf 47.1%
Taylor expanded in B around 0 62.7%
associate-*r/62.8%
Simplified62.8%
if -3.3000000000000001e-143 < A < 3.8999999999999998e-231 or 1.4500000000000001e-169 < A Initial program 73.0%
Simplified90.8%
Taylor expanded in B around inf 71.2%
+-commutative71.2%
Simplified71.2%
if 3.8999999999999998e-231 < A < 1.4500000000000001e-169Initial program 49.3%
Taylor expanded in B around -inf 53.8%
Final simplification67.5%
(FPCore (A B C)
:precision binary64
(if (<= A -9.2e-145)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 2.5e-250)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= A 2.25e-169)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -9.2e-145) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 2.5e-250) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (A <= 2.25e-169) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -9.2e-145) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 2.5e-250) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (A <= 2.25e-169) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -9.2e-145: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 2.5e-250: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif A <= 2.25e-169: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -9.2e-145) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 2.5e-250) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (A <= 2.25e-169) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -9.2e-145) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 2.5e-250) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (A <= 2.25e-169) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -9.2e-145], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.5e-250], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.25e-169], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -9.2 \cdot 10^{-145}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.5 \cdot 10^{-250}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.25 \cdot 10^{-169}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -9.20000000000000028e-145Initial program 31.9%
Taylor expanded in A around -inf 62.2%
if -9.20000000000000028e-145 < A < 2.50000000000000013e-250Initial program 68.5%
Taylor expanded in C around -inf 49.4%
if 2.50000000000000013e-250 < A < 2.2499999999999999e-169Initial program 53.4%
Taylor expanded in B around -inf 51.4%
if 2.2499999999999999e-169 < A Initial program 75.7%
Taylor expanded in C around 0 68.8%
associate-*r/68.8%
mul-1-neg68.8%
+-commutative68.8%
unpow268.8%
unpow268.8%
hypot-def82.9%
Simplified82.9%
Taylor expanded in A around 0 72.0%
Taylor expanded in A around 0 72.0%
neg-mul-172.0%
distribute-neg-frac72.0%
+-commutative72.0%
distribute-neg-in72.0%
neg-mul-172.0%
sub-neg72.0%
sub-neg72.0%
neg-mul-172.0%
distribute-neg-in72.0%
+-commutative72.0%
distribute-neg-in72.0%
mul-1-neg72.0%
sub-neg72.0%
Simplified72.0%
Final simplification63.0%
(FPCore (A B C)
:precision binary64
(if (<= A -5.9e-145)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 1.85e-253)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= A 1.2e-161)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.9e-145) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 1.85e-253) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (A <= 1.2e-161) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -5.9e-145) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 1.85e-253) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (A <= 1.2e-161) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -5.9e-145: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 1.85e-253: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif A <= 1.2e-161: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -5.9e-145) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 1.85e-253) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (A <= 1.2e-161) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5.9e-145) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 1.85e-253) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (A <= 1.2e-161) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5.9e-145], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.85e-253], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.2e-161], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.9 \cdot 10^{-145}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.85 \cdot 10^{-253}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.2 \cdot 10^{-161}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.8999999999999998e-145Initial program 31.9%
Taylor expanded in A around -inf 62.2%
if -5.8999999999999998e-145 < A < 1.84999999999999988e-253Initial program 68.5%
Taylor expanded in C around -inf 49.4%
if 1.84999999999999988e-253 < A < 1.19999999999999999e-161Initial program 58.3%
Taylor expanded in C around 0 46.1%
associate-*r/46.1%
mul-1-neg46.1%
+-commutative46.1%
unpow246.1%
unpow246.1%
hypot-def67.5%
Simplified67.5%
Taylor expanded in B around -inf 56.5%
mul-1-neg56.5%
unsub-neg56.5%
Simplified56.5%
if 1.19999999999999999e-161 < A Initial program 75.2%
Taylor expanded in C around 0 69.0%
associate-*r/69.0%
mul-1-neg69.0%
+-commutative69.0%
unpow269.0%
unpow269.0%
hypot-def83.4%
Simplified83.4%
Taylor expanded in A around 0 72.4%
Taylor expanded in A around 0 72.4%
neg-mul-172.4%
distribute-neg-frac72.4%
+-commutative72.4%
distribute-neg-in72.4%
neg-mul-172.4%
sub-neg72.4%
sub-neg72.4%
neg-mul-172.4%
distribute-neg-in72.4%
+-commutative72.4%
distribute-neg-in72.4%
mul-1-neg72.4%
sub-neg72.4%
Simplified72.4%
Final simplification63.4%
(FPCore (A B C)
:precision binary64
(if (<= A -7.2e-145)
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
(if (<= A 2.7e-252)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= A 1.2e-157)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -7.2e-145) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else if (A <= 2.7e-252) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (A <= 1.2e-157) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -7.2e-145) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else if (A <= 2.7e-252) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (A <= 1.2e-157) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -7.2e-145: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi elif A <= 2.7e-252: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif A <= 1.2e-157: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -7.2e-145) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); elseif (A <= 2.7e-252) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (A <= 1.2e-157) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -7.2e-145) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; elseif (A <= 2.7e-252) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (A <= 1.2e-157) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -7.2e-145], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 2.7e-252], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.2e-157], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -7.2 \cdot 10^{-145}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.7 \cdot 10^{-252}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.2 \cdot 10^{-157}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -7.2000000000000001e-145Initial program 31.9%
Applied egg-rr53.0%
Taylor expanded in A around -inf 46.7%
Taylor expanded in B around 0 62.2%
associate-*r/62.3%
Simplified62.3%
if -7.2000000000000001e-145 < A < 2.69999999999999981e-252Initial program 68.5%
Taylor expanded in C around -inf 49.4%
if 2.69999999999999981e-252 < A < 1.2e-157Initial program 58.3%
Taylor expanded in C around 0 46.1%
associate-*r/46.1%
mul-1-neg46.1%
+-commutative46.1%
unpow246.1%
unpow246.1%
hypot-def67.5%
Simplified67.5%
Taylor expanded in B around -inf 56.5%
mul-1-neg56.5%
unsub-neg56.5%
Simplified56.5%
if 1.2e-157 < A Initial program 75.2%
Taylor expanded in C around 0 69.0%
associate-*r/69.0%
mul-1-neg69.0%
+-commutative69.0%
unpow269.0%
unpow269.0%
hypot-def83.4%
Simplified83.4%
Taylor expanded in A around 0 72.4%
Taylor expanded in A around 0 72.4%
neg-mul-172.4%
distribute-neg-frac72.4%
+-commutative72.4%
distribute-neg-in72.4%
neg-mul-172.4%
sub-neg72.4%
sub-neg72.4%
neg-mul-172.4%
distribute-neg-in72.4%
+-commutative72.4%
distribute-neg-in72.4%
mul-1-neg72.4%
sub-neg72.4%
Simplified72.4%
Final simplification63.4%
(FPCore (A B C)
:precision binary64
(if (<= B 1.4e-103)
(* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI))
(if (<= B 2300000.0)
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
(* 180.0 (/ (atan (/ (- C (+ B A)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1.4e-103) {
tmp = 180.0 * (atan(((C + (B - A)) / B)) / ((double) M_PI));
} else if (B <= 2300000.0) {
tmp = (180.0 * atan((0.5 * (B / 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 <= 1.4e-103) {
tmp = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
} else if (B <= 2300000.0) {
tmp = (180.0 * Math.atan((0.5 * (B / 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 <= 1.4e-103: tmp = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi) elif B <= 2300000.0: tmp = (180.0 * math.atan((0.5 * (B / 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 <= 1.4e-103) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi)); elseif (B <= 2300000.0) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(B + A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 1.4e-103) tmp = 180.0 * (atan(((C + (B - A)) / B)) / pi); elseif (B <= 2300000.0) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; else tmp = 180.0 * (atan(((C - (B + A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 1.4e-103], N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2300000.0], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(B + A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.4 \cdot 10^{-103}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2300000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < 1.40000000000000011e-103Initial program 60.9%
Simplified73.9%
Taylor expanded in B around -inf 67.5%
neg-mul-167.5%
unsub-neg67.5%
Simplified67.5%
if 1.40000000000000011e-103 < B < 2.3e6Initial program 38.8%
Applied egg-rr48.8%
Taylor expanded in A around -inf 57.1%
Taylor expanded in B around 0 61.0%
associate-*r/61.1%
Simplified61.1%
if 2.3e6 < B Initial program 58.2%
Simplified84.2%
Taylor expanded in B around inf 80.7%
+-commutative80.7%
Simplified80.7%
Final simplification70.4%
(FPCore (A B C)
:precision binary64
(if (<= B -6.2e-81)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.6e-61)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -6.2e-81) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.6e-61) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -6.2e-81) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.6e-61) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -6.2e-81: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.6e-61: tmp = 180.0 * (math.atan((C / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -6.2e-81) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.6e-61) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -6.2e-81) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.6e-61) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -6.2e-81], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.6e-61], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -6.2 \cdot 10^{-81}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.6 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -6.19999999999999976e-81Initial program 58.3%
Taylor expanded in B around -inf 58.9%
if -6.19999999999999976e-81 < B < 1.6000000000000001e-61Initial program 61.5%
Simplified66.5%
add-sqr-sqrt60.9%
pow260.9%
hypot-udef57.1%
unpow257.1%
unpow257.1%
+-commutative57.1%
unpow257.1%
unpow257.1%
hypot-def60.9%
Applied egg-rr60.9%
Taylor expanded in C around inf 37.4%
if 1.6000000000000001e-61 < B Initial program 53.7%
Taylor expanded in B around inf 54.2%
Final simplification48.5%
(FPCore (A B C)
:precision binary64
(if (<= B -1.1e-130)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 7.2e-226)
(/ 180.0 (/ PI (atan 0.0)))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.1e-130) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 7.2e-226) {
tmp = 180.0 / (((double) M_PI) / atan(0.0));
} 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.1e-130) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 7.2e-226) {
tmp = 180.0 / (Math.PI / Math.atan(0.0));
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.1e-130: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 7.2e-226: tmp = 180.0 / (math.pi / math.atan(0.0)) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1.1e-130) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 7.2e-226) tmp = Float64(180.0 / Float64(pi / atan(0.0))); 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.1e-130) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 7.2e-226) tmp = 180.0 / (pi / atan(0.0)); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.1e-130], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.2e-226], N[(180.0 / N[(Pi / N[ArcTan[0.0], $MachinePrecision]), $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.1 \cdot 10^{-130}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 7.2 \cdot 10^{-226}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} 0}}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.0999999999999999e-130Initial program 62.4%
Taylor expanded in B around -inf 53.4%
if -1.0999999999999999e-130 < B < 7.19999999999999988e-226Initial program 55.7%
Applied egg-rr74.5%
div-inv74.5%
Applied egg-rr74.5%
Taylor expanded in C around inf 28.6%
associate-*r/28.6%
distribute-rgt1-in28.6%
metadata-eval28.6%
mul0-lft28.6%
metadata-eval28.6%
div028.6%
Simplified28.6%
if 7.19999999999999988e-226 < B Initial program 56.5%
Taylor expanded in B around inf 41.5%
Final simplification42.6%
(FPCore (A B C) :precision binary64 (if (<= B -5e-310) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5e-310) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -5e-310) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -5e-310: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -5e-310) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5e-310) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -5e-310], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.999999999999985e-310Initial program 59.4%
Taylor expanded in B around -inf 40.6%
if -4.999999999999985e-310 < B Initial program 57.2%
Taylor expanded in B around inf 37.0%
Final simplification38.7%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 58.3%
Taylor expanded in B around inf 20.1%
Final simplification20.1%
herbie shell --seed 2023322
(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)))