
(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 20 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 (<= C 2.5e+111) (* 180.0 (/ (atan (/ (- (- C (hypot B (- A C))) A) B)) PI)) (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 2.5e+111) {
tmp = 180.0 * (atan((((C - hypot(B, (A - C))) - A) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 2.5e+111) {
tmp = 180.0 * (Math.atan((((C - Math.hypot(B, (A - C))) - A) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 2.5e+111: tmp = 180.0 * (math.atan((((C - math.hypot(B, (A - C))) - A) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 2.5e+111) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - hypot(B, Float64(A - C))) - A) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 2.5e+111) tmp = 180.0 * (atan((((C - hypot(B, (A - C))) - A) / B)) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 2.5e+111], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 2.5 \cdot 10^{+111}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - \mathsf{hypot}\left(B, A - C\right)\right) - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 2.4999999999999998e111Initial program 62.6%
Simplified79.1%
Taylor expanded in C around -inf 84.2%
if 2.4999999999999998e111 < C Initial program 8.4%
Taylor expanded in C around inf 56.3%
Taylor expanded in B around inf 80.4%
Final simplification83.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (+ A (hypot B A))))
(if (<= C -1e-80)
(* 180.0 (/ (atan (/ (- C t_0) B)) PI))
(if (<= C 1.5e+135)
(* 180.0 (/ (atan (* t_0 (/ -1.0 B))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))))
double code(double A, double B, double C) {
double t_0 = A + hypot(B, A);
double tmp;
if (C <= -1e-80) {
tmp = 180.0 * (atan(((C - t_0) / B)) / ((double) M_PI));
} else if (C <= 1.5e+135) {
tmp = 180.0 * (atan((t_0 * (-1.0 / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = A + Math.hypot(B, A);
double tmp;
if (C <= -1e-80) {
tmp = 180.0 * (Math.atan(((C - t_0) / B)) / Math.PI);
} else if (C <= 1.5e+135) {
tmp = 180.0 * (Math.atan((t_0 * (-1.0 / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = A + math.hypot(B, A) tmp = 0 if C <= -1e-80: tmp = 180.0 * (math.atan(((C - t_0) / B)) / math.pi) elif C <= 1.5e+135: tmp = 180.0 * (math.atan((t_0 * (-1.0 / B))) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(A + hypot(B, A)) tmp = 0.0 if (C <= -1e-80) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - t_0) / B)) / pi)); elseif (C <= 1.5e+135) tmp = Float64(180.0 * Float64(atan(Float64(t_0 * Float64(-1.0 / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = A + hypot(B, A); tmp = 0.0; if (C <= -1e-80) tmp = 180.0 * (atan(((C - t_0) / B)) / pi); elseif (C <= 1.5e+135) tmp = 180.0 * (atan((t_0 * (-1.0 / B))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1e-80], N[(180.0 * N[(N[ArcTan[N[(N[(C - t$95$0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.5e+135], N[(180.0 * N[(N[ArcTan[N[(t$95$0 * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := A + \mathsf{hypot}\left(B, A\right)\\
\mathbf{if}\;C \leq -1 \cdot 10^{-80}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - t\_0}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.5 \cdot 10^{+135}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_0 \cdot \frac{-1}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -9.99999999999999961e-81Initial program 76.8%
Simplified92.9%
Taylor expanded in C around 0 76.8%
+-commutative76.8%
unpow276.8%
unpow276.8%
hypot-def92.6%
Simplified92.6%
if -9.99999999999999961e-81 < C < 1.5e135Initial program 52.7%
Taylor expanded in C around 0 51.4%
mul-1-neg51.4%
+-commutative51.4%
unpow251.4%
unpow251.4%
hypot-def76.4%
Simplified76.4%
if 1.5e135 < C Initial program 5.0%
Taylor expanded in C around inf 56.6%
Taylor expanded in B around inf 84.1%
Final simplification82.6%
(FPCore (A B C)
:precision binary64
(if (<= C -1.35e-80)
(* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))
(if (<= C 2.3e+135)
(* 180.0 (/ (atan (* (+ A (hypot B A)) (/ -1.0 B))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1.35e-80) {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
} else if (C <= 2.3e+135) {
tmp = 180.0 * (atan(((A + hypot(B, A)) * (-1.0 / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1.35e-80) {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
} else if (C <= 2.3e+135) {
tmp = 180.0 * (Math.atan(((A + Math.hypot(B, A)) * (-1.0 / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1.35e-80: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) elif C <= 2.3e+135: tmp = 180.0 * (math.atan(((A + math.hypot(B, A)) * (-1.0 / B))) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1.35e-80) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); elseif (C <= 2.3e+135) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) * Float64(-1.0 / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1.35e-80) tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); elseif (C <= 2.3e+135) tmp = 180.0 * (atan(((A + hypot(B, A)) * (-1.0 / B))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1.35e-80], 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], If[LessEqual[C, 2.3e+135], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.35 \cdot 10^{-80}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.3 \cdot 10^{+135}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(A + \mathsf{hypot}\left(B, A\right)\right) \cdot \frac{-1}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.3500000000000001e-80Initial program 76.8%
Simplified92.9%
if -1.3500000000000001e-80 < C < 2.3000000000000001e135Initial program 52.7%
Taylor expanded in C around 0 51.4%
mul-1-neg51.4%
+-commutative51.4%
unpow251.4%
unpow251.4%
hypot-def76.4%
Simplified76.4%
if 2.3000000000000001e135 < C Initial program 5.0%
Taylor expanded in C around inf 56.6%
Taylor expanded in B around inf 84.1%
Final simplification82.7%
(FPCore (A B C)
:precision binary64
(if (<= C -850000000000.0)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(if (<= C 9.5e+131)
(* 180.0 (/ (atan (/ (- (+ A (hypot B A))) B)) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -850000000000.0) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else if (C <= 9.5e+131) {
tmp = 180.0 * (atan((-(A + hypot(B, A)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -850000000000.0) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else if (C <= 9.5e+131) {
tmp = 180.0 * (Math.atan((-(A + Math.hypot(B, A)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -850000000000.0: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) elif C <= 9.5e+131: tmp = 180.0 * (math.atan((-(A + math.hypot(B, A)) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -850000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); elseif (C <= 9.5e+131) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-Float64(A + hypot(B, A))) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -850000000000.0) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); elseif (C <= 9.5e+131) tmp = 180.0 * (atan((-(A + hypot(B, A)) / B)) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -850000000000.0], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 9.5e+131], N[(180.0 * N[(N[ArcTan[N[((-N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -850000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 9.5 \cdot 10^{+131}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-\left(A + \mathsf{hypot}\left(B, A\right)\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -8.5e11Initial program 80.8%
Taylor expanded in A around 0 80.8%
unpow280.8%
unpow280.8%
hypot-def95.0%
Simplified95.0%
if -8.5e11 < C < 9.50000000000000015e131Initial program 54.0%
Taylor expanded in C around 0 51.7%
associate-*r/51.7%
mul-1-neg51.7%
+-commutative51.7%
unpow251.7%
unpow251.7%
hypot-def76.7%
Simplified76.7%
if 9.50000000000000015e131 < C Initial program 5.0%
Taylor expanded in C around inf 56.6%
Taylor expanded in B around inf 84.1%
Final simplification82.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (+ A (hypot B A))))
(if (<= C -8.2e-81)
(* 180.0 (/ (atan (/ (- C t_0) B)) PI))
(if (<= C 8.5e+131)
(* 180.0 (/ (atan (/ (- t_0) B)) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))))
double code(double A, double B, double C) {
double t_0 = A + hypot(B, A);
double tmp;
if (C <= -8.2e-81) {
tmp = 180.0 * (atan(((C - t_0) / B)) / ((double) M_PI));
} else if (C <= 8.5e+131) {
tmp = 180.0 * (atan((-t_0 / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = A + Math.hypot(B, A);
double tmp;
if (C <= -8.2e-81) {
tmp = 180.0 * (Math.atan(((C - t_0) / B)) / Math.PI);
} else if (C <= 8.5e+131) {
tmp = 180.0 * (Math.atan((-t_0 / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = A + math.hypot(B, A) tmp = 0 if C <= -8.2e-81: tmp = 180.0 * (math.atan(((C - t_0) / B)) / math.pi) elif C <= 8.5e+131: tmp = 180.0 * (math.atan((-t_0 / B)) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(A + hypot(B, A)) tmp = 0.0 if (C <= -8.2e-81) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - t_0) / B)) / pi)); elseif (C <= 8.5e+131) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-t_0) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = A + hypot(B, A); tmp = 0.0; if (C <= -8.2e-81) tmp = 180.0 * (atan(((C - t_0) / B)) / pi); elseif (C <= 8.5e+131) tmp = 180.0 * (atan((-t_0 / B)) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -8.2e-81], N[(180.0 * N[(N[ArcTan[N[(N[(C - t$95$0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 8.5e+131], N[(180.0 * N[(N[ArcTan[N[((-t$95$0) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := A + \mathsf{hypot}\left(B, A\right)\\
\mathbf{if}\;C \leq -8.2 \cdot 10^{-81}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - t\_0}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 8.5 \cdot 10^{+131}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-t\_0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -8.19999999999999968e-81Initial program 76.8%
Simplified92.9%
Taylor expanded in C around 0 76.8%
+-commutative76.8%
unpow276.8%
unpow276.8%
hypot-def92.6%
Simplified92.6%
if -8.19999999999999968e-81 < C < 8.50000000000000063e131Initial program 52.7%
Taylor expanded in C around 0 51.4%
associate-*r/51.4%
mul-1-neg51.4%
+-commutative51.4%
unpow251.4%
unpow251.4%
hypot-def76.4%
Simplified76.4%
if 8.50000000000000063e131 < C Initial program 5.0%
Taylor expanded in C around inf 56.6%
Taylor expanded in B around inf 84.1%
Final simplification82.6%
(FPCore (A B C)
:precision binary64
(if (<= A -2.4e+154)
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
(if (<= A 1.55e+164)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.4e+154) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else if (A <= 1.55e+164) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / 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 <= -2.4e+154) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else if (A <= 1.55e+164) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / 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 <= -2.4e+154: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi elif A <= 1.55e+164: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / 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 <= -2.4e+154) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); elseif (A <= 1.55e+164) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / 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 <= -2.4e+154) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; elseif (A <= 1.55e+164) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.4e+154], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 1.55e+164], 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[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.55 \cdot 10^{+164}:\\
\;\;\;\;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(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.40000000000000015e154Initial program 8.3%
Taylor expanded in A around -inf 54.9%
Taylor expanded in B around 0 82.9%
associate-*r/82.9%
Simplified82.9%
if -2.40000000000000015e154 < A < 1.5500000000000001e164Initial program 54.8%
Taylor expanded in A around 0 49.9%
unpow249.9%
unpow249.9%
hypot-def74.2%
Simplified74.2%
if 1.5500000000000001e164 < A Initial program 90.2%
Taylor expanded in C around 0 90.2%
mul-1-neg90.2%
+-commutative90.2%
unpow290.2%
unpow290.2%
hypot-def96.7%
Simplified96.7%
Taylor expanded in B around -inf 95.0%
mul-1-neg95.0%
unsub-neg95.0%
Simplified95.0%
Final simplification78.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))
(if (<= C -1450000000000.0)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C 2.35e-219)
t_0
(if (<= C 1.1e-48)
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))
(if (<= C 6.6e+38)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= C 2.8e+92)
t_0
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
double tmp;
if (C <= -1450000000000.0) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= 2.35e-219) {
tmp = t_0;
} else if (C <= 1.1e-48) {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
} else if (C <= 6.6e+38) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (C <= 2.8e+92) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
double tmp;
if (C <= -1450000000000.0) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= 2.35e-219) {
tmp = t_0;
} else if (C <= 1.1e-48) {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
} else if (C <= 6.6e+38) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (C <= 2.8e+92) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) tmp = 0 if C <= -1450000000000.0: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= 2.35e-219: tmp = t_0 elif C <= 1.1e-48: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) elif C <= 6.6e+38: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif C <= 2.8e+92: tmp = t_0 else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)) tmp = 0.0 if (C <= -1450000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= 2.35e-219) tmp = t_0; elseif (C <= 1.1e-48) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); elseif (C <= 6.6e+38) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (C <= 2.8e+92) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 - (A / B))) / pi); tmp = 0.0; if (C <= -1450000000000.0) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= 2.35e-219) tmp = t_0; elseif (C <= 1.1e-48) tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); elseif (C <= 6.6e+38) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (C <= 2.8e+92) tmp = t_0; else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1450000000000.0], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.35e-219], t$95$0, If[LessEqual[C, 1.1e-48], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.6e+38], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.8e+92], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -1450000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.35 \cdot 10^{-219}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;C \leq 1.1 \cdot 10^{-48}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.6 \cdot 10^{+38}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.8 \cdot 10^{+92}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.45e12Initial program 80.8%
Taylor expanded in C around -inf 75.6%
if -1.45e12 < C < 2.35e-219 or 6.5999999999999998e38 < C < 2.80000000000000001e92Initial program 57.5%
Taylor expanded in C around 0 55.6%
mul-1-neg55.6%
+-commutative55.6%
unpow255.6%
unpow255.6%
hypot-def80.0%
Simplified80.0%
Taylor expanded in B around -inf 58.5%
mul-1-neg58.5%
unsub-neg58.5%
Simplified58.5%
if 2.35e-219 < C < 1.10000000000000006e-48Initial program 57.2%
Simplified75.5%
Taylor expanded in B around inf 63.2%
+-commutative63.2%
Simplified63.2%
Taylor expanded in C around 0 62.8%
associate-*r/62.8%
distribute-lft-in62.8%
mul-1-neg62.8%
sub-neg62.8%
mul-1-neg62.8%
Simplified62.8%
Taylor expanded in A around 0 62.8%
mul-1-neg62.8%
distribute-neg-frac62.8%
distribute-neg-out62.8%
neg-mul-162.8%
sub-neg62.8%
sub-neg62.8%
neg-mul-162.8%
distribute-neg-out62.8%
+-commutative62.8%
distribute-neg-out62.8%
mul-1-neg62.8%
sub-neg62.8%
div-sub62.8%
mul-1-neg62.8%
distribute-frac-neg62.8%
*-inverses62.8%
metadata-eval62.8%
Simplified62.8%
if 1.10000000000000006e-48 < C < 6.5999999999999998e38Initial program 37.9%
Taylor expanded in A around -inf 51.1%
associate-*r/51.1%
Simplified51.1%
if 2.80000000000000001e92 < C Initial program 10.5%
Taylor expanded in C around inf 55.4%
Taylor expanded in B around inf 79.0%
Final simplification66.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))
(if (<= C -1.45e-58)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= C 3.85e-221)
t_0
(if (<= C 3.3e-43)
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))
(if (<= C 2.3e+39)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= C 1.1e+93)
t_0
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
double tmp;
if (C <= -1.45e-58) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (C <= 3.85e-221) {
tmp = t_0;
} else if (C <= 3.3e-43) {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
} else if (C <= 2.3e+39) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (C <= 1.1e+93) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
double tmp;
if (C <= -1.45e-58) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (C <= 3.85e-221) {
tmp = t_0;
} else if (C <= 3.3e-43) {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
} else if (C <= 2.3e+39) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (C <= 1.1e+93) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) tmp = 0 if C <= -1.45e-58: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif C <= 3.85e-221: tmp = t_0 elif C <= 3.3e-43: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) elif C <= 2.3e+39: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif C <= 1.1e+93: tmp = t_0 else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)) tmp = 0.0 if (C <= -1.45e-58) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (C <= 3.85e-221) tmp = t_0; elseif (C <= 3.3e-43) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); elseif (C <= 2.3e+39) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (C <= 1.1e+93) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 - (A / B))) / pi); tmp = 0.0; if (C <= -1.45e-58) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (C <= 3.85e-221) tmp = t_0; elseif (C <= 3.3e-43) tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); elseif (C <= 2.3e+39) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (C <= 1.1e+93) tmp = t_0; else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.45e-58], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 3.85e-221], t$95$0, If[LessEqual[C, 3.3e-43], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.3e+39], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.1e+93], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -1.45 \cdot 10^{-58}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 3.85 \cdot 10^{-221}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;C \leq 3.3 \cdot 10^{-43}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.3 \cdot 10^{+39}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.1 \cdot 10^{+93}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.44999999999999995e-58Initial program 75.4%
Simplified92.2%
Taylor expanded in B around inf 78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in A around 0 78.2%
if -1.44999999999999995e-58 < C < 3.84999999999999996e-221 or 2.30000000000000012e39 < C < 1.10000000000000011e93Initial program 59.2%
Taylor expanded in C around 0 57.0%
mul-1-neg57.0%
+-commutative57.0%
unpow257.0%
unpow257.0%
hypot-def80.1%
Simplified80.1%
Taylor expanded in B around -inf 61.1%
mul-1-neg61.1%
unsub-neg61.1%
Simplified61.1%
if 3.84999999999999996e-221 < C < 3.30000000000000016e-43Initial program 57.2%
Simplified75.5%
Taylor expanded in B around inf 63.2%
+-commutative63.2%
Simplified63.2%
Taylor expanded in C around 0 62.8%
associate-*r/62.8%
distribute-lft-in62.8%
mul-1-neg62.8%
sub-neg62.8%
mul-1-neg62.8%
Simplified62.8%
Taylor expanded in A around 0 62.8%
mul-1-neg62.8%
distribute-neg-frac62.8%
distribute-neg-out62.8%
neg-mul-162.8%
sub-neg62.8%
sub-neg62.8%
neg-mul-162.8%
distribute-neg-out62.8%
+-commutative62.8%
distribute-neg-out62.8%
mul-1-neg62.8%
sub-neg62.8%
div-sub62.8%
mul-1-neg62.8%
distribute-frac-neg62.8%
*-inverses62.8%
metadata-eval62.8%
Simplified62.8%
if 3.30000000000000016e-43 < C < 2.30000000000000012e39Initial program 37.9%
Taylor expanded in A around -inf 51.1%
associate-*r/51.1%
Simplified51.1%
if 1.10000000000000011e93 < C Initial program 10.5%
Taylor expanded in C around inf 55.4%
Taylor expanded in B around inf 79.0%
Final simplification68.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))
(if (<= C -7e-54)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= C 3.9e-220)
t_0
(if (<= C 3.5e-43)
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))
(if (<= C 2.2e+40)
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
(if (<= C 5.2e+91)
t_0
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
double tmp;
if (C <= -7e-54) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (C <= 3.9e-220) {
tmp = t_0;
} else if (C <= 3.5e-43) {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
} else if (C <= 2.2e+40) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else if (C <= 5.2e+91) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
double tmp;
if (C <= -7e-54) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (C <= 3.9e-220) {
tmp = t_0;
} else if (C <= 3.5e-43) {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
} else if (C <= 2.2e+40) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else if (C <= 5.2e+91) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) tmp = 0 if C <= -7e-54: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif C <= 3.9e-220: tmp = t_0 elif C <= 3.5e-43: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) elif C <= 2.2e+40: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi elif C <= 5.2e+91: tmp = t_0 else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)) tmp = 0.0 if (C <= -7e-54) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (C <= 3.9e-220) tmp = t_0; elseif (C <= 3.5e-43) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); elseif (C <= 2.2e+40) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); elseif (C <= 5.2e+91) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 - (A / B))) / pi); tmp = 0.0; if (C <= -7e-54) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (C <= 3.9e-220) tmp = t_0; elseif (C <= 3.5e-43) tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); elseif (C <= 2.2e+40) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; elseif (C <= 5.2e+91) tmp = t_0; else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -7e-54], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 3.9e-220], t$95$0, If[LessEqual[C, 3.5e-43], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.2e+40], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 5.2e+91], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -7 \cdot 10^{-54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 3.9 \cdot 10^{-220}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;C \leq 3.5 \cdot 10^{-43}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;C \leq 5.2 \cdot 10^{+91}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -6.99999999999999964e-54Initial program 75.4%
Simplified92.2%
Taylor expanded in B around inf 78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in A around 0 78.2%
if -6.99999999999999964e-54 < C < 3.90000000000000003e-220 or 2.1999999999999999e40 < C < 5.2000000000000001e91Initial program 59.2%
Taylor expanded in C around 0 57.0%
mul-1-neg57.0%
+-commutative57.0%
unpow257.0%
unpow257.0%
hypot-def80.1%
Simplified80.1%
Taylor expanded in B around -inf 61.1%
mul-1-neg61.1%
unsub-neg61.1%
Simplified61.1%
if 3.90000000000000003e-220 < C < 3.49999999999999997e-43Initial program 57.2%
Simplified75.5%
Taylor expanded in B around inf 63.2%
+-commutative63.2%
Simplified63.2%
Taylor expanded in C around 0 62.8%
associate-*r/62.8%
distribute-lft-in62.8%
mul-1-neg62.8%
sub-neg62.8%
mul-1-neg62.8%
Simplified62.8%
Taylor expanded in A around 0 62.8%
mul-1-neg62.8%
distribute-neg-frac62.8%
distribute-neg-out62.8%
neg-mul-162.8%
sub-neg62.8%
sub-neg62.8%
neg-mul-162.8%
distribute-neg-out62.8%
+-commutative62.8%
distribute-neg-out62.8%
mul-1-neg62.8%
sub-neg62.8%
div-sub62.8%
mul-1-neg62.8%
distribute-frac-neg62.8%
*-inverses62.8%
metadata-eval62.8%
Simplified62.8%
if 3.49999999999999997e-43 < C < 2.1999999999999999e40Initial program 37.9%
Taylor expanded in A around -inf 48.1%
Taylor expanded in B around 0 51.1%
associate-*r/51.3%
Simplified51.3%
if 5.2000000000000001e91 < C Initial program 10.5%
Taylor expanded in C around inf 55.4%
Taylor expanded in B around inf 79.0%
Final simplification68.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan 1.0) PI))))
(if (<= C -500000000000.0)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= C -2.6e-92)
t_0
(if (<= C -1.9e-231)
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))
(if (<= C 2.9e-227) t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(1.0) / ((double) M_PI));
double tmp;
if (C <= -500000000000.0) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (C <= -2.6e-92) {
tmp = t_0;
} else if (C <= -1.9e-231) {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
} else if (C <= 2.9e-227) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((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 (C <= -500000000000.0) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (C <= -2.6e-92) {
tmp = t_0;
} else if (C <= -1.9e-231) {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
} else if (C <= 2.9e-227) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(1.0) / math.pi) tmp = 0 if C <= -500000000000.0: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif C <= -2.6e-92: tmp = t_0 elif C <= -1.9e-231: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) elif C <= 2.9e-227: tmp = t_0 else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(1.0) / pi)) tmp = 0.0 if (C <= -500000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (C <= -2.6e-92) tmp = t_0; elseif (C <= -1.9e-231) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); elseif (C <= 2.9e-227) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(1.0) / pi); tmp = 0.0; if (C <= -500000000000.0) tmp = 180.0 * (atan((C / B)) / pi); elseif (C <= -2.6e-92) tmp = t_0; elseif (C <= -1.9e-231) tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); elseif (C <= 2.9e-227) tmp = t_0; else tmp = 180.0 * (atan((-0.5 * (B / C))) / 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[C, -500000000000.0], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -2.6e-92], t$95$0, If[LessEqual[C, -1.9e-231], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.9e-227], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{if}\;C \leq -500000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -2.6 \cdot 10^{-92}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;C \leq -1.9 \cdot 10^{-231}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.9 \cdot 10^{-227}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -5e11Initial program 80.8%
Simplified95.4%
Taylor expanded in B around inf 85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in C around inf 75.2%
if -5e11 < C < -2.6e-92 or -1.90000000000000007e-231 < C < 2.90000000000000011e-227Initial program 56.3%
Taylor expanded in B around -inf 44.8%
if -2.6e-92 < C < -1.90000000000000007e-231Initial program 58.3%
Taylor expanded in A around inf 45.0%
if 2.90000000000000011e-227 < C Initial program 35.8%
Taylor expanded in C around inf 33.3%
Taylor expanded in B around inf 53.5%
Final simplification55.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan 1.0) PI))))
(if (<= C -880000000000.0)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C -7.8e-92)
t_0
(if (<= C -6.1e-232)
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))
(if (<= C 1.36e-227)
t_0
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(1.0) / ((double) M_PI));
double tmp;
if (C <= -880000000000.0) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= -7.8e-92) {
tmp = t_0;
} else if (C <= -6.1e-232) {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
} else if (C <= 1.36e-227) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((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 (C <= -880000000000.0) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= -7.8e-92) {
tmp = t_0;
} else if (C <= -6.1e-232) {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
} else if (C <= 1.36e-227) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(1.0) / math.pi) tmp = 0 if C <= -880000000000.0: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= -7.8e-92: tmp = t_0 elif C <= -6.1e-232: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) elif C <= 1.36e-227: tmp = t_0 else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(1.0) / pi)) tmp = 0.0 if (C <= -880000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= -7.8e-92) tmp = t_0; elseif (C <= -6.1e-232) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); elseif (C <= 1.36e-227) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(1.0) / pi); tmp = 0.0; if (C <= -880000000000.0) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= -7.8e-92) tmp = t_0; elseif (C <= -6.1e-232) tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); elseif (C <= 1.36e-227) tmp = t_0; else tmp = 180.0 * (atan((-0.5 * (B / C))) / 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[C, -880000000000.0], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -7.8e-92], t$95$0, If[LessEqual[C, -6.1e-232], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.36e-227], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{if}\;C \leq -880000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -7.8 \cdot 10^{-92}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;C \leq -6.1 \cdot 10^{-232}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.36 \cdot 10^{-227}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -8.8e11Initial program 80.8%
Taylor expanded in C around -inf 75.6%
if -8.8e11 < C < -7.7999999999999993e-92 or -6.1000000000000001e-232 < C < 1.35999999999999996e-227Initial program 56.3%
Taylor expanded in B around -inf 44.8%
if -7.7999999999999993e-92 < C < -6.1000000000000001e-232Initial program 58.3%
Taylor expanded in A around inf 45.0%
if 1.35999999999999996e-227 < C Initial program 35.8%
Taylor expanded in C around inf 33.3%
Taylor expanded in B around inf 53.5%
Final simplification56.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))
(if (<= C -1.05e+44)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C -6.2e-290)
t_0
(if (<= C 1.12e-231)
(* 180.0 (/ (atan 1.0) PI))
(if (<= C 5.7e-58) t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
double tmp;
if (C <= -1.05e+44) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= -6.2e-290) {
tmp = t_0;
} else if (C <= 1.12e-231) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (C <= 5.7e-58) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
double tmp;
if (C <= -1.05e+44) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= -6.2e-290) {
tmp = t_0;
} else if (C <= 1.12e-231) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (C <= 5.7e-58) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) tmp = 0 if C <= -1.05e+44: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= -6.2e-290: tmp = t_0 elif C <= 1.12e-231: tmp = 180.0 * (math.atan(1.0) / math.pi) elif C <= 5.7e-58: tmp = t_0 else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)) tmp = 0.0 if (C <= -1.05e+44) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= -6.2e-290) tmp = t_0; elseif (C <= 1.12e-231) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (C <= 5.7e-58) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((-1.0 - (A / B))) / pi); tmp = 0.0; if (C <= -1.05e+44) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= -6.2e-290) tmp = t_0; elseif (C <= 1.12e-231) tmp = 180.0 * (atan(1.0) / pi); elseif (C <= 5.7e-58) tmp = t_0; else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.05e+44], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -6.2e-290], t$95$0, If[LessEqual[C, 1.12e-231], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 5.7e-58], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -1.05 \cdot 10^{+44}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -6.2 \cdot 10^{-290}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;C \leq 1.12 \cdot 10^{-231}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;C \leq 5.7 \cdot 10^{-58}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.04999999999999993e44Initial program 82.2%
Taylor expanded in C around -inf 80.1%
if -1.04999999999999993e44 < C < -6.1999999999999998e-290 or 1.11999999999999997e-231 < C < 5.70000000000000032e-58Initial program 61.0%
Simplified80.0%
Taylor expanded in B around inf 57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in C around 0 54.9%
associate-*r/54.9%
distribute-lft-in54.9%
mul-1-neg54.9%
sub-neg54.9%
mul-1-neg54.9%
Simplified54.9%
Taylor expanded in A around 0 54.9%
mul-1-neg54.9%
distribute-neg-frac54.9%
distribute-neg-out54.9%
neg-mul-154.9%
sub-neg54.9%
sub-neg54.9%
neg-mul-154.9%
distribute-neg-out54.9%
+-commutative54.9%
distribute-neg-out54.9%
mul-1-neg54.9%
sub-neg54.9%
div-sub54.9%
mul-1-neg54.9%
distribute-frac-neg54.9%
*-inverses54.9%
metadata-eval54.9%
Simplified54.9%
if -6.1999999999999998e-290 < C < 1.11999999999999997e-231Initial program 51.5%
Taylor expanded in B around -inf 50.7%
if 5.70000000000000032e-58 < C Initial program 24.0%
Taylor expanded in C around inf 42.5%
Taylor expanded in B around inf 60.4%
Final simplification61.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI))))
(if (<= B -3e-40)
t_0
(if (<= B -4e-101)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(if (<= B -5e-203) t_0 (* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((C + (B - A)) / B)) / ((double) M_PI));
double tmp;
if (B <= -3e-40) {
tmp = t_0;
} else if (B <= -4e-101) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else if (B <= -5e-203) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
double tmp;
if (B <= -3e-40) {
tmp = t_0;
} else if (B <= -4e-101) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else if (B <= -5e-203) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi) tmp = 0 if B <= -3e-40: tmp = t_0 elif B <= -4e-101: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) elif B <= -5e-203: tmp = t_0 else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi)) tmp = 0.0 if (B <= -3e-40) tmp = t_0; elseif (B <= -4e-101) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); elseif (B <= -5e-203) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((C + (B - A)) / B)) / pi); tmp = 0.0; if (B <= -3e-40) tmp = t_0; elseif (B <= -4e-101) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); elseif (B <= -5e-203) tmp = t_0; else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3e-40], t$95$0, If[LessEqual[B, -4e-101], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -5e-203], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -3 \cdot 10^{-40}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq -4 \cdot 10^{-101}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq -5 \cdot 10^{-203}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -3.0000000000000002e-40 or -4.00000000000000021e-101 < B < -5.0000000000000002e-203Initial program 52.8%
Simplified79.6%
Taylor expanded in B around -inf 77.5%
neg-mul-177.5%
unsub-neg77.5%
Simplified77.5%
if -3.0000000000000002e-40 < B < -4.00000000000000021e-101Initial program 22.9%
Taylor expanded in C around inf 35.1%
Taylor expanded in B around inf 54.9%
if -5.0000000000000002e-203 < B Initial program 57.7%
Simplified71.7%
Taylor expanded in B around inf 64.8%
+-commutative64.8%
Simplified64.8%
Final simplification68.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI))))
(if (<= B -1.6e-40)
t_0
(if (<= B -4e-101)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(if (<= B -1e-198) t_0 (/ (* 180.0 (atan (/ (- C (+ A B)) B))) PI))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((C + (B - A)) / B)) / ((double) M_PI));
double tmp;
if (B <= -1.6e-40) {
tmp = t_0;
} else if (B <= -4e-101) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else if (B <= -1e-198) {
tmp = t_0;
} else {
tmp = (180.0 * atan(((C - (A + B)) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
double tmp;
if (B <= -1.6e-40) {
tmp = t_0;
} else if (B <= -4e-101) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else if (B <= -1e-198) {
tmp = t_0;
} else {
tmp = (180.0 * Math.atan(((C - (A + B)) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi) tmp = 0 if B <= -1.6e-40: tmp = t_0 elif B <= -4e-101: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) elif B <= -1e-198: tmp = t_0 else: tmp = (180.0 * math.atan(((C - (A + B)) / B))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi)) tmp = 0.0 if (B <= -1.6e-40) tmp = t_0; elseif (B <= -4e-101) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); elseif (B <= -1e-198) tmp = t_0; else tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - Float64(A + B)) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((C + (B - A)) / B)) / pi); tmp = 0.0; if (B <= -1.6e-40) tmp = t_0; elseif (B <= -4e-101) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); elseif (B <= -1e-198) tmp = t_0; else tmp = (180.0 * atan(((C - (A + B)) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.6e-40], t$95$0, If[LessEqual[B, -4e-101], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1e-198], t$95$0, N[(N[(180.0 * N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -1.6 \cdot 10^{-40}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq -4 \cdot 10^{-101}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq -1 \cdot 10^{-198}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -1.60000000000000001e-40 or -4.00000000000000021e-101 < B < -9.9999999999999991e-199Initial program 52.8%
Simplified79.6%
Taylor expanded in B around -inf 77.5%
neg-mul-177.5%
unsub-neg77.5%
Simplified77.5%
if -1.60000000000000001e-40 < B < -4.00000000000000021e-101Initial program 22.9%
Taylor expanded in C around inf 35.1%
Taylor expanded in B around inf 54.9%
if -9.9999999999999991e-199 < B Initial program 57.7%
Simplified71.7%
Taylor expanded in B around inf 64.8%
+-commutative64.8%
Simplified64.8%
associate-*r/64.8%
+-commutative64.8%
Applied egg-rr64.8%
Final simplification68.8%
(FPCore (A B C)
:precision binary64
(if (<= C -1250000000000.0)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C 5.5e-217)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= C 1.6e-57)
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1250000000000.0) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= 5.5e-217) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (C <= 1.6e-57) {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1250000000000.0) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= 5.5e-217) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (C <= 1.6e-57) {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1250000000000.0: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= 5.5e-217: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif C <= 1.6e-57: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1250000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= 5.5e-217) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (C <= 1.6e-57) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1250000000000.0) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= 5.5e-217) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (C <= 1.6e-57) tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1250000000000.0], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 5.5e-217], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.6e-57], 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[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1250000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 5.5 \cdot 10^{-217}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.6 \cdot 10^{-57}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.25e12Initial program 80.8%
Taylor expanded in C around -inf 75.6%
if -1.25e12 < C < 5.49999999999999975e-217Initial program 57.5%
Taylor expanded in C around 0 55.5%
mul-1-neg55.5%
+-commutative55.5%
unpow255.5%
unpow255.5%
hypot-def80.0%
Simplified80.0%
Taylor expanded in B around -inf 58.2%
mul-1-neg58.2%
unsub-neg58.2%
Simplified58.2%
if 5.49999999999999975e-217 < C < 1.6e-57Initial program 62.8%
Simplified82.9%
Taylor expanded in B around inf 69.6%
+-commutative69.6%
Simplified69.6%
Taylor expanded in C around 0 68.9%
associate-*r/68.9%
distribute-lft-in68.9%
mul-1-neg68.9%
sub-neg68.9%
mul-1-neg68.9%
Simplified68.9%
Taylor expanded in A around 0 68.9%
mul-1-neg68.9%
distribute-neg-frac68.9%
distribute-neg-out68.9%
neg-mul-168.9%
sub-neg68.9%
sub-neg68.9%
neg-mul-168.9%
distribute-neg-out68.9%
+-commutative68.9%
distribute-neg-out68.9%
mul-1-neg68.9%
sub-neg68.9%
div-sub68.9%
mul-1-neg68.9%
distribute-frac-neg68.9%
*-inverses68.9%
metadata-eval68.9%
Simplified68.9%
if 1.6e-57 < C Initial program 24.0%
Taylor expanded in C around inf 42.5%
Taylor expanded in B around inf 60.4%
Final simplification64.3%
(FPCore (A B C)
:precision binary64
(if (<= B -3.8e-39)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= B -8.5e-102)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.8e-39) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (B <= -8.5e-102) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -3.8e-39) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (B <= -8.5e-102) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.8e-39: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif B <= -8.5e-102: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -3.8e-39) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (B <= -8.5e-102) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -3.8e-39) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (B <= -8.5e-102) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.8e-39], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -8.5e-102], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.8 \cdot 10^{-39}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -8.5 \cdot 10^{-102}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -3.8000000000000002e-39Initial program 51.8%
Taylor expanded in C around 0 47.5%
mul-1-neg47.5%
+-commutative47.5%
unpow247.5%
unpow247.5%
hypot-def76.0%
Simplified76.0%
Taylor expanded in B around -inf 74.2%
mul-1-neg74.2%
unsub-neg74.2%
Simplified74.2%
if -3.8000000000000002e-39 < B < -8.49999999999999973e-102Initial program 22.9%
Taylor expanded in C around inf 35.1%
Taylor expanded in B around inf 54.9%
if -8.49999999999999973e-102 < B Initial program 57.7%
Simplified71.1%
Taylor expanded in B around inf 63.1%
+-commutative63.1%
Simplified63.1%
Final simplification65.9%
(FPCore (A B C)
:precision binary64
(if (<= B -3.2e-49)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 6.0)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.2e-49) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 6.0) {
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 <= -3.2e-49) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 6.0) {
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 <= -3.2e-49: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 6.0: 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 <= -3.2e-49) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 6.0) 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 <= -3.2e-49) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 6.0) 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, -3.2e-49], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 6.0], 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 -3.2 \cdot 10^{-49}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 6:\\
\;\;\;\;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 < -3.20000000000000002e-49Initial program 50.0%
Taylor expanded in B around -inf 59.5%
if -3.20000000000000002e-49 < B < 6Initial program 55.9%
Simplified62.4%
Taylor expanded in B around inf 48.5%
+-commutative48.5%
Simplified48.5%
Taylor expanded in C around inf 32.9%
if 6 < B Initial program 55.2%
Taylor expanded in B around inf 69.0%
Final simplification49.0%
(FPCore (A B C)
:precision binary64
(if (<= B -7e-175)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.4e-16)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7e-175) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.4e-16) {
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 <= -7e-175) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.4e-16) {
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 <= -7e-175: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.4e-16: 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 <= -7e-175) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.4e-16) 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 <= -7e-175) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.4e-16) 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, -7e-175], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.4e-16], 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 -7 \cdot 10^{-175}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.4 \cdot 10^{-16}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -6.99999999999999997e-175Initial program 49.0%
Taylor expanded in B around -inf 50.5%
if -6.99999999999999997e-175 < B < 1.4000000000000001e-16Initial program 59.2%
associate-*l/59.2%
*-un-lft-identity59.2%
div-sub53.4%
unpow253.4%
unpow253.4%
hypot-def54.9%
Applied egg-rr54.9%
Taylor expanded in C around inf 9.4%
distribute-lft1-in9.4%
metadata-eval9.4%
mul0-lft25.1%
metadata-eval25.1%
Simplified25.1%
if 1.4000000000000001e-16 < B Initial program 54.1%
Taylor expanded in B around inf 64.1%
Final simplification44.5%
(FPCore (A B C) :precision binary64 (if (<= B 1.4e-16) (* 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.4e-16) {
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.4e-16) {
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.4e-16: 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.4e-16) 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.4e-16) 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.4e-16], 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.4 \cdot 10^{-16}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 1.4000000000000001e-16Initial program 53.8%
associate-*l/53.8%
*-un-lft-identity53.8%
div-sub51.0%
unpow251.0%
unpow251.0%
hypot-def64.3%
Applied egg-rr64.3%
Taylor expanded in C around inf 7.8%
distribute-lft1-in7.8%
metadata-eval7.8%
mul0-lft15.6%
metadata-eval15.6%
Simplified15.6%
if 1.4000000000000001e-16 < B Initial program 54.1%
Taylor expanded in B around inf 64.1%
Final simplification27.0%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 53.9%
Taylor expanded in B around inf 19.5%
Final simplification19.5%
herbie shell --seed 2024027
(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)))