
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C) :precision binary64 (if (<= A -6.3e+46) (* 180.0 (/ (atan (* 0.5 (+ (/ B A) (/ B (/ (pow A 2.0) C))))) PI)) (* (/ 180.0 PI) (atan (/ (- C (+ A (hypot B (- A C)))) B)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -6.3e+46) {
tmp = 180.0 * (atan((0.5 * ((B / A) + (B / (pow(A, 2.0) / C))))) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((C - (A + hypot(B, (A - C)))) / B));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -6.3e+46) {
tmp = 180.0 * (Math.atan((0.5 * ((B / A) + (B / (Math.pow(A, 2.0) / C))))) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6.3e+46: tmp = 180.0 * (math.atan((0.5 * ((B / A) + (B / (math.pow(A, 2.0) / C))))) / math.pi) else: tmp = (180.0 / math.pi) * math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6.3e+46) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(B / A) + Float64(B / Float64((A ^ 2.0) / C))))) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -6.3e+46) tmp = 180.0 * (atan((0.5 * ((B / A) + (B / ((A ^ 2.0) / C))))) / pi); else tmp = (180.0 / pi) * atan(((C - (A + hypot(B, (A - C)))) / B)); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6.3e+46], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(B / A), $MachinePrecision] + N[(B / N[(N[Power[A, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.3 \cdot 10^{+46}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(\frac{B}{A} + \frac{B}{\frac{{A}^{2}}{C}}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)\\
\end{array}
\end{array}
if A < -6.3e46Initial program 19.7%
Taylor expanded in A around -inf 73.6%
distribute-lft-out73.6%
associate-/l*73.8%
Simplified73.8%
if -6.3e46 < A Initial program 58.7%
Taylor expanded in B around 0 58.6%
Simplified79.9%
Final simplification78.5%
(FPCore (A B C) :precision binary64 (if (<= A -4.7e+46) (* 180.0 (/ (atan (* 0.5 (/ B A))) PI)) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.7e+46) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -4.7e+46) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -4.7e+46: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -4.7e+46) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -4.7e+46) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -4.7e+46], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $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 -4.7 \cdot 10^{+46}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.6999999999999996e46Initial program 19.7%
Taylor expanded in A around -inf 73.8%
if -4.6999999999999996e46 < A Initial program 58.7%
Simplified79.9%
Final simplification78.5%
(FPCore (A B C) :precision binary64 (if (<= A -9.5e+41) (* 180.0 (/ (atan (* 0.5 (/ B A))) PI)) (* (/ 180.0 PI) (atan (/ (- C (+ A (hypot B (- A C)))) B)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -9.5e+41) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((C - (A + hypot(B, (A - C)))) / B));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -9.5e+41) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -9.5e+41: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) else: tmp = (180.0 / math.pi) * math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -9.5e+41) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -9.5e+41) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); else tmp = (180.0 / pi) * atan(((C - (A + hypot(B, (A - C)))) / B)); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -9.5e+41], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -9.5 \cdot 10^{+41}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)\\
\end{array}
\end{array}
if A < -9.4999999999999996e41Initial program 19.7%
Taylor expanded in A around -inf 73.8%
if -9.4999999999999996e41 < A Initial program 58.7%
Taylor expanded in B around 0 58.6%
Simplified79.9%
Final simplification78.5%
(FPCore (A B C)
:precision binary64
(if (<= A -3.15e-27)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 1.36e-5)
(* 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 <= -3.15e-27) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 1.36e-5) {
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 <= -3.15e-27) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 1.36e-5) {
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 <= -3.15e-27: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 1.36e-5: 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 <= -3.15e-27) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 1.36e-5) 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 <= -3.15e-27) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 1.36e-5) 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, -3.15e-27], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.36e-5], 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 -3.15 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.36 \cdot 10^{-5}:\\
\;\;\;\;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 < -3.15000000000000005e-27Initial program 20.9%
Taylor expanded in A around -inf 67.2%
if -3.15000000000000005e-27 < A < 1.36000000000000002e-5Initial program 52.0%
Taylor expanded in A around 0 48.0%
unpow248.0%
unpow248.0%
hypot-def74.1%
Simplified74.1%
if 1.36000000000000002e-5 < A Initial program 79.9%
Taylor expanded in C around 0 79.9%
associate-*r/79.9%
mul-1-neg79.9%
+-commutative79.9%
unpow279.9%
unpow279.9%
hypot-def90.6%
Simplified90.6%
Final simplification76.0%
(FPCore (A B C)
:precision binary64
(if (<= A -1.4e-27)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 1.7e-5)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (/ (- (- A) B) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.4e-27) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 1.7e-5) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-A - B) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.4e-27) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 1.7e-5) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-A - B) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.4e-27: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 1.7e-5: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((-A - B) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.4e-27) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 1.7e-5) 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) - B) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.4e-27) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 1.7e-5) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan(((-A - B) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.4e-27], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.7e-5], 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) - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.4 \cdot 10^{-27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;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) - B}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.4e-27Initial program 20.9%
Taylor expanded in A around -inf 67.2%
if -1.4e-27 < A < 1.7e-5Initial program 52.0%
Taylor expanded in A around 0 48.0%
unpow248.0%
unpow248.0%
hypot-def74.1%
Simplified74.1%
if 1.7e-5 < A Initial program 79.9%
Simplified93.7%
Taylor expanded in B around inf 85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in C around 0 85.7%
associate-*r/85.7%
neg-mul-185.7%
distribute-neg-in85.7%
sub-neg85.7%
Simplified85.7%
Final simplification74.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ 0.0 B)) PI))))
(if (<= B -6.6e-9)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -8.2e-198)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(if (<= B -5e-257)
t_0
(if (<= B -2.05e-308)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= B 5.4e-254)
t_0
(if (<= B 4.2e-59)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
(* 180.0 (/ (atan -1.0) PI))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
double tmp;
if (B <= -6.6e-9) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -8.2e-198) {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
} else if (B <= -5e-257) {
tmp = t_0;
} else if (B <= -2.05e-308) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (B <= 5.4e-254) {
tmp = t_0;
} else if (B <= 4.2e-59) {
tmp = 180.0 * (atan((-2.0 * (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 t_0 = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
double tmp;
if (B <= -6.6e-9) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -8.2e-198) {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
} else if (B <= -5e-257) {
tmp = t_0;
} else if (B <= -2.05e-308) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (B <= 5.4e-254) {
tmp = t_0;
} else if (B <= 4.2e-59) {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((0.0 / B)) / math.pi) tmp = 0 if B <= -6.6e-9: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -8.2e-198: tmp = 180.0 * (math.atan((-A / B)) / math.pi) elif B <= -5e-257: tmp = t_0 elif B <= -2.05e-308: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif B <= 5.4e-254: tmp = t_0 elif B <= 4.2e-59: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)) tmp = 0.0 if (B <= -6.6e-9) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -8.2e-198) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); elseif (B <= -5e-257) tmp = t_0; elseif (B <= -2.05e-308) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (B <= 5.4e-254) tmp = t_0; elseif (B <= 4.2e-59) tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((0.0 / B)) / pi); tmp = 0.0; if (B <= -6.6e-9) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -8.2e-198) tmp = 180.0 * (atan((-A / B)) / pi); elseif (B <= -5e-257) tmp = t_0; elseif (B <= -2.05e-308) tmp = 180.0 * (atan((C / B)) / pi); elseif (B <= 5.4e-254) tmp = t_0; elseif (B <= 4.2e-59) tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -6.6e-9], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -8.2e-198], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -5e-257], t$95$0, If[LessEqual[B, -2.05e-308], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.4e-254], t$95$0, If[LessEqual[B, 4.2e-59], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -6.6 \cdot 10^{-9}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -8.2 \cdot 10^{-198}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -5 \cdot 10^{-257}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq -2.05 \cdot 10^{-308}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 5.4 \cdot 10^{-254}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 4.2 \cdot 10^{-59}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -6.60000000000000037e-9Initial program 47.6%
Taylor expanded in B around -inf 64.3%
if -6.60000000000000037e-9 < B < -8.20000000000000025e-198Initial program 65.7%
Simplified70.6%
Taylor expanded in B around inf 57.5%
+-commutative57.5%
Simplified57.5%
Taylor expanded in A around inf 42.7%
associate-*r/42.7%
neg-mul-142.7%
Simplified42.7%
if -8.20000000000000025e-198 < B < -4.99999999999999989e-257 or -2.0500000000000002e-308 < B < 5.40000000000000013e-254Initial program 35.8%
Taylor expanded in C around inf 47.5%
associate-*r/47.5%
distribute-rgt1-in47.5%
metadata-eval47.5%
mul0-lft47.5%
metadata-eval47.5%
Simplified47.5%
if -4.99999999999999989e-257 < B < -2.0500000000000002e-308Initial program 84.8%
Simplified84.3%
Taylor expanded in B around inf 75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in C around inf 67.5%
if 5.40000000000000013e-254 < B < 4.19999999999999993e-59Initial program 57.5%
Taylor expanded in A around inf 46.7%
if 4.19999999999999993e-59 < B Initial program 37.6%
Taylor expanded in B around inf 56.4%
Final simplification53.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
(if (<= A -8e-207)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 9e-187)
t_0
(if (<= A 4.3e-126)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 6.4e-78)
t_0
(if (<= A 7.8e-41)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= A 2.9e-5)
t_0
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
double tmp;
if (A <= -8e-207) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 9e-187) {
tmp = t_0;
} else if (A <= 4.3e-126) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 6.4e-78) {
tmp = t_0;
} else if (A <= 7.8e-41) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (A <= 2.9e-5) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
double tmp;
if (A <= -8e-207) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 9e-187) {
tmp = t_0;
} else if (A <= 4.3e-126) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 6.4e-78) {
tmp = t_0;
} else if (A <= 7.8e-41) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (A <= 2.9e-5) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) tmp = 0 if A <= -8e-207: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 9e-187: tmp = t_0 elif A <= 4.3e-126: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 6.4e-78: tmp = t_0 elif A <= 7.8e-41: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif A <= 2.9e-5: tmp = t_0 else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)) tmp = 0.0 if (A <= -8e-207) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 9e-187) tmp = t_0; elseif (A <= 4.3e-126) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 6.4e-78) tmp = t_0; elseif (A <= 7.8e-41) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (A <= 2.9e-5) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((-0.5 * (B / C))) / pi); tmp = 0.0; if (A <= -8e-207) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 9e-187) tmp = t_0; elseif (A <= 4.3e-126) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 6.4e-78) tmp = t_0; elseif (A <= 7.8e-41) tmp = 180.0 * (atan((C / B)) / pi); elseif (A <= 2.9e-5) tmp = t_0; else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -8e-207], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 9e-187], t$95$0, If[LessEqual[A, 4.3e-126], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 6.4e-78], t$95$0, If[LessEqual[A, 7.8e-41], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.9e-5], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{if}\;A \leq -8 \cdot 10^{-207}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 9 \cdot 10^{-187}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 4.3 \cdot 10^{-126}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 6.4 \cdot 10^{-78}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 7.8 \cdot 10^{-41}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.9 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -7.9999999999999994e-207Initial program 29.4%
Taylor expanded in A around -inf 57.7%
if -7.9999999999999994e-207 < A < 8.9999999999999996e-187 or 4.30000000000000033e-126 < A < 6.4e-78 or 7.79999999999999982e-41 < A < 2.9e-5Initial program 48.1%
Taylor expanded in C around inf 24.7%
Taylor expanded in A around 0 48.9%
Taylor expanded in A around inf 48.9%
if 8.9999999999999996e-187 < A < 4.30000000000000033e-126Initial program 58.4%
Taylor expanded in B around inf 53.5%
if 6.4e-78 < A < 7.79999999999999982e-41Initial program 78.5%
Simplified92.0%
Taylor expanded in B around inf 67.2%
+-commutative67.2%
Simplified67.2%
Taylor expanded in C around inf 51.8%
if 2.9e-5 < A Initial program 79.6%
Taylor expanded in A around inf 74.9%
Final simplification59.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
(if (<= A -3.6e-207)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 1.8e-186)
t_0
(if (<= A 8.4e-127)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 1.95e-78)
t_0
(if (<= A 8.8e-41)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= A 0.00075)
t_0
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
double tmp;
if (A <= -3.6e-207) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 1.8e-186) {
tmp = t_0;
} else if (A <= 8.4e-127) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 1.95e-78) {
tmp = t_0;
} else if (A <= 8.8e-41) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (A <= 0.00075) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
double tmp;
if (A <= -3.6e-207) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 1.8e-186) {
tmp = t_0;
} else if (A <= 8.4e-127) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 1.95e-78) {
tmp = t_0;
} else if (A <= 8.8e-41) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (A <= 0.00075) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) tmp = 0 if A <= -3.6e-207: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 1.8e-186: tmp = t_0 elif A <= 8.4e-127: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 1.95e-78: tmp = t_0 elif A <= 8.8e-41: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif A <= 0.00075: tmp = t_0 else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)) tmp = 0.0 if (A <= -3.6e-207) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 1.8e-186) tmp = t_0; elseif (A <= 8.4e-127) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 1.95e-78) tmp = t_0; elseif (A <= 8.8e-41) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (A <= 0.00075) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((-0.5 * (B / C))) / pi); tmp = 0.0; if (A <= -3.6e-207) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 1.8e-186) tmp = t_0; elseif (A <= 8.4e-127) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 1.95e-78) tmp = t_0; elseif (A <= 8.8e-41) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (A <= 0.00075) tmp = t_0; else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -3.6e-207], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.8e-186], t$95$0, If[LessEqual[A, 8.4e-127], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.95e-78], t$95$0, If[LessEqual[A, 8.8e-41], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 0.00075], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{if}\;A \leq -3.6 \cdot 10^{-207}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.8 \cdot 10^{-186}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 8.4 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 1.95 \cdot 10^{-78}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 8.8 \cdot 10^{-41}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 0.00075:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.5999999999999997e-207Initial program 29.4%
Taylor expanded in A around -inf 57.7%
if -3.5999999999999997e-207 < A < 1.7999999999999999e-186 or 8.4000000000000004e-127 < A < 1.9500000000000001e-78 or 8.7999999999999999e-41 < A < 7.5000000000000002e-4Initial program 48.1%
Taylor expanded in C around inf 24.7%
Taylor expanded in A around 0 48.9%
Taylor expanded in A around inf 48.9%
if 1.7999999999999999e-186 < A < 8.4000000000000004e-127Initial program 58.4%
Taylor expanded in B around inf 53.5%
if 1.9500000000000001e-78 < A < 8.7999999999999999e-41Initial program 78.5%
Taylor expanded in C around -inf 51.8%
if 7.5000000000000002e-4 < A Initial program 79.6%
Taylor expanded in A around inf 74.9%
Final simplification59.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- A) B)) PI)))
(t_1 (* 180.0 (/ (atan (/ 0.0 B)) PI))))
(if (<= B -6.5e-9)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -2.55e-197)
t_0
(if (<= B -8.2e-256)
t_1
(if (<= B 2.4e-303)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= B 7e-256)
t_1
(if (<= B 1.85e-57) t_0 (* 180.0 (/ (atan -1.0) PI))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((-A / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
double tmp;
if (B <= -6.5e-9) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -2.55e-197) {
tmp = t_0;
} else if (B <= -8.2e-256) {
tmp = t_1;
} else if (B <= 2.4e-303) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (B <= 7e-256) {
tmp = t_1;
} else if (B <= 1.85e-57) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((-A / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
double tmp;
if (B <= -6.5e-9) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -2.55e-197) {
tmp = t_0;
} else if (B <= -8.2e-256) {
tmp = t_1;
} else if (B <= 2.4e-303) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (B <= 7e-256) {
tmp = t_1;
} else if (B <= 1.85e-57) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-A / B)) / math.pi) t_1 = 180.0 * (math.atan((0.0 / B)) / math.pi) tmp = 0 if B <= -6.5e-9: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -2.55e-197: tmp = t_0 elif B <= -8.2e-256: tmp = t_1 elif B <= 2.4e-303: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif B <= 7e-256: tmp = t_1 elif B <= 1.85e-57: tmp = t_0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)) tmp = 0.0 if (B <= -6.5e-9) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -2.55e-197) tmp = t_0; elseif (B <= -8.2e-256) tmp = t_1; elseif (B <= 2.4e-303) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (B <= 7e-256) tmp = t_1; elseif (B <= 1.85e-57) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((-A / B)) / pi); t_1 = 180.0 * (atan((0.0 / B)) / pi); tmp = 0.0; if (B <= -6.5e-9) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -2.55e-197) tmp = t_0; elseif (B <= -8.2e-256) tmp = t_1; elseif (B <= 2.4e-303) tmp = 180.0 * (atan((C / B)) / pi); elseif (B <= 7e-256) tmp = t_1; elseif (B <= 1.85e-57) tmp = t_0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -6.5e-9], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.55e-197], t$95$0, If[LessEqual[B, -8.2e-256], t$95$1, If[LessEqual[B, 2.4e-303], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7e-256], t$95$1, If[LessEqual[B, 1.85e-57], t$95$0, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -2.55 \cdot 10^{-197}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq -8.2 \cdot 10^{-256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 2.4 \cdot 10^{-303}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 7 \cdot 10^{-256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{-57}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -6.5000000000000003e-9Initial program 47.6%
Taylor expanded in B around -inf 64.3%
if -6.5000000000000003e-9 < B < -2.5500000000000001e-197 or 7.00000000000000028e-256 < B < 1.85e-57Initial program 61.2%
Simplified67.0%
Taylor expanded in B around inf 55.9%
+-commutative55.9%
Simplified55.9%
Taylor expanded in A around inf 44.9%
associate-*r/44.9%
neg-mul-144.9%
Simplified44.9%
if -2.5500000000000001e-197 < B < -8.2e-256 or 2.4000000000000001e-303 < B < 7.00000000000000028e-256Initial program 35.8%
Taylor expanded in C around inf 47.5%
associate-*r/47.5%
distribute-rgt1-in47.5%
metadata-eval47.5%
mul0-lft47.5%
metadata-eval47.5%
Simplified47.5%
if -8.2e-256 < B < 2.4000000000000001e-303Initial program 84.8%
Simplified84.3%
Taylor expanded in B around inf 75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in C around inf 67.5%
if 1.85e-57 < B Initial program 37.6%
Taylor expanded in B around inf 56.4%
Final simplification53.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- C B) B)) PI))))
(if (<= A -1.9e-45)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -2.3e-256)
t_0
(if (<= A -3.5e-272)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A -5.8e-289)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(if (<= A 0.00165)
t_0
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
double tmp;
if (A <= -1.9e-45) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -2.3e-256) {
tmp = t_0;
} else if (A <= -3.5e-272) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= -5.8e-289) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else if (A <= 0.00165) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
double tmp;
if (A <= -1.9e-45) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -2.3e-256) {
tmp = t_0;
} else if (A <= -3.5e-272) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= -5.8e-289) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else if (A <= 0.00165) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((C - B) / B)) / math.pi) tmp = 0 if A <= -1.9e-45: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -2.3e-256: tmp = t_0 elif A <= -3.5e-272: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= -5.8e-289: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) elif A <= 0.00165: tmp = t_0 else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)) tmp = 0.0 if (A <= -1.9e-45) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -2.3e-256) tmp = t_0; elseif (A <= -3.5e-272) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= -5.8e-289) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); elseif (A <= 0.00165) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((C - B) / B)) / pi); tmp = 0.0; if (A <= -1.9e-45) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -2.3e-256) tmp = t_0; elseif (A <= -3.5e-272) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= -5.8e-289) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); elseif (A <= 0.00165) tmp = t_0; else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.9e-45], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.3e-256], t$95$0, If[LessEqual[A, -3.5e-272], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -5.8e-289], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 0.00165], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.9 \cdot 10^{-45}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.3 \cdot 10^{-256}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -3.5 \cdot 10^{-272}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq -5.8 \cdot 10^{-289}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{elif}\;A \leq 0.00165:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.89999999999999999e-45Initial program 20.6%
Taylor expanded in A around -inf 65.8%
if -1.89999999999999999e-45 < A < -2.3e-256 or -5.80000000000000012e-289 < A < 0.00165Initial program 55.6%
Simplified80.6%
Taylor expanded in B around inf 53.9%
+-commutative53.9%
Simplified53.9%
Taylor expanded in A around 0 49.7%
if -2.3e-256 < A < -3.4999999999999997e-272Initial program 56.7%
Taylor expanded in B around -inf 75.8%
if -3.4999999999999997e-272 < A < -5.80000000000000012e-289Initial program 23.8%
Taylor expanded in C around inf 24.2%
Taylor expanded in A around 0 72.7%
Taylor expanded in A around inf 72.7%
if 0.00165 < A Initial program 79.6%
Taylor expanded in A around inf 74.9%
Final simplification61.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- C B) B)) PI))))
(if (<= A -1.1e-41)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -1.4e-255)
t_0
(if (<= A -5.4e-272)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A -4.4e-289)
(* (/ 180.0 PI) (atan (* -0.5 (/ B C))))
(if (<= A 580.0) t_0 (* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
double tmp;
if (A <= -1.1e-41) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -1.4e-255) {
tmp = t_0;
} else if (A <= -5.4e-272) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= -4.4e-289) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
} else if (A <= 580.0) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
double tmp;
if (A <= -1.1e-41) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -1.4e-255) {
tmp = t_0;
} else if (A <= -5.4e-272) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= -4.4e-289) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
} else if (A <= 580.0) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((C - B) / B)) / math.pi) tmp = 0 if A <= -1.1e-41: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -1.4e-255: tmp = t_0 elif A <= -5.4e-272: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= -4.4e-289: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) elif A <= 580.0: tmp = t_0 else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)) tmp = 0.0 if (A <= -1.1e-41) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -1.4e-255) tmp = t_0; elseif (A <= -5.4e-272) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= -4.4e-289) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); elseif (A <= 580.0) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((C - B) / B)) / pi); tmp = 0.0; if (A <= -1.1e-41) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -1.4e-255) tmp = t_0; elseif (A <= -5.4e-272) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= -4.4e-289) tmp = (180.0 / pi) * atan((-0.5 * (B / C))); elseif (A <= 580.0) tmp = t_0; else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.1e-41], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -1.4e-255], t$95$0, If[LessEqual[A, -5.4e-272], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -4.4e-289], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 580.0], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.1 \cdot 10^{-41}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -1.4 \cdot 10^{-255}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -5.4 \cdot 10^{-272}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq -4.4 \cdot 10^{-289}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\mathbf{elif}\;A \leq 580:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.1e-41Initial program 20.6%
Taylor expanded in A around -inf 65.8%
if -1.1e-41 < A < -1.40000000000000006e-255 or -4.4e-289 < A < 580Initial program 55.6%
Simplified80.6%
Taylor expanded in B around inf 53.9%
+-commutative53.9%
Simplified53.9%
Taylor expanded in A around 0 49.7%
if -1.40000000000000006e-255 < A < -5.39999999999999985e-272Initial program 56.7%
Taylor expanded in B around -inf 75.8%
if -5.39999999999999985e-272 < A < -4.4e-289Initial program 23.8%
Taylor expanded in C around inf 24.2%
Taylor expanded in A around 0 72.7%
Taylor expanded in A around inf 72.7%
Simplified72.9%
if 580 < A Initial program 79.6%
Taylor expanded in A around inf 74.9%
Final simplification61.6%
(FPCore (A B C)
:precision binary64
(if (<= A -6.9e-46)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -1.4e-255)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= A -5.1e-272)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A -9e-289)
(* (/ 180.0 PI) (atan (* -0.5 (/ B C))))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -6.9e-46) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -1.4e-255) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (A <= -5.1e-272) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= -9e-289) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -6.9e-46) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -1.4e-255) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (A <= -5.1e-272) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= -9e-289) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6.9e-46: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -1.4e-255: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif A <= -5.1e-272: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= -9e-289: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6.9e-46) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -1.4e-255) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (A <= -5.1e-272) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= -9e-289) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -6.9e-46) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -1.4e-255) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (A <= -5.1e-272) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= -9e-289) tmp = (180.0 / pi) * atan((-0.5 * (B / C))); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6.9e-46], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -1.4e-255], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -5.1e-272], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -9e-289], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.9 \cdot 10^{-46}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -1.4 \cdot 10^{-255}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -5.1 \cdot 10^{-272}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq -9 \cdot 10^{-289}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -6.8999999999999998e-46Initial program 20.6%
Taylor expanded in A around -inf 65.8%
if -6.8999999999999998e-46 < A < -1.40000000000000006e-255Initial program 52.6%
Simplified77.0%
Taylor expanded in B around inf 44.3%
+-commutative44.3%
Simplified44.3%
Taylor expanded in A around 0 44.5%
if -1.40000000000000006e-255 < A < -5.0999999999999998e-272Initial program 56.7%
Taylor expanded in B around -inf 75.8%
if -5.0999999999999998e-272 < A < -9.0000000000000003e-289Initial program 23.8%
Taylor expanded in C around inf 24.2%
Taylor expanded in A around 0 72.7%
Taylor expanded in A around inf 72.7%
Simplified72.9%
if -9.0000000000000003e-289 < A Initial program 67.5%
Simplified87.6%
Taylor expanded in B around inf 71.1%
+-commutative71.1%
Simplified71.1%
Final simplification65.8%
(FPCore (A B C)
:precision binary64
(if (<= A -1.08e-40)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -2.3e-256)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= A -4.8e-272)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A -8e-289)
(* (/ 180.0 PI) (atan (* -0.5 (/ B C))))
(/ (* 180.0 (atan (/ (- (- C B) A) B))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.08e-40) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -2.3e-256) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (A <= -4.8e-272) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= -8e-289) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
} 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 <= -1.08e-40) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -2.3e-256) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (A <= -4.8e-272) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= -8e-289) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
} else {
tmp = (180.0 * Math.atan((((C - B) - A) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.08e-40: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -2.3e-256: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif A <= -4.8e-272: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= -8e-289: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) else: tmp = (180.0 * math.atan((((C - B) - A) / B))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.08e-40) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -2.3e-256) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (A <= -4.8e-272) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= -8e-289) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - B) - A) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.08e-40) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -2.3e-256) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (A <= -4.8e-272) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= -8e-289) tmp = (180.0 / pi) * atan((-0.5 * (B / C))); else tmp = (180.0 * atan((((C - B) - A) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.08e-40], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.3e-256], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -4.8e-272], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -8e-289], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.08 \cdot 10^{-40}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.3 \cdot 10^{-256}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -4.8 \cdot 10^{-272}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq -8 \cdot 10^{-289}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.08e-40Initial program 20.6%
Taylor expanded in A around -inf 65.8%
if -1.08e-40 < A < -2.3e-256Initial program 52.6%
Simplified77.0%
Taylor expanded in B around inf 44.3%
+-commutative44.3%
Simplified44.3%
Taylor expanded in A around 0 44.5%
if -2.3e-256 < A < -4.7999999999999998e-272Initial program 56.7%
Taylor expanded in B around -inf 75.8%
if -4.7999999999999998e-272 < A < -8.0000000000000001e-289Initial program 23.8%
Taylor expanded in C around inf 24.2%
Taylor expanded in A around 0 72.7%
Taylor expanded in A around inf 72.7%
Simplified72.9%
if -8.0000000000000001e-289 < A Initial program 67.5%
Simplified87.6%
Taylor expanded in B around inf 71.1%
+-commutative71.1%
Simplified71.1%
associate-*r/71.1%
associate--r+71.1%
Applied egg-rr71.1%
Final simplification65.8%
(FPCore (A B C)
:precision binary64
(if (<= A -3.35e-41)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -2.3e-256)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= A -3.5e-272)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 4.4e-252)
(* (/ 180.0 PI) (atan (* -0.5 (/ B C))))
(* 180.0 (/ (atan (/ (- (- A) B) B)) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.35e-41) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -2.3e-256) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (A <= -3.5e-272) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 4.4e-252) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
} else {
tmp = 180.0 * (atan(((-A - B) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.35e-41) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -2.3e-256) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (A <= -3.5e-272) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 4.4e-252) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
} else {
tmp = 180.0 * (Math.atan(((-A - B) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.35e-41: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -2.3e-256: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif A <= -3.5e-272: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 4.4e-252: tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C))) else: tmp = 180.0 * (math.atan(((-A - B) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.35e-41) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -2.3e-256) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (A <= -3.5e-272) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 4.4e-252) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C)))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - B) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.35e-41) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -2.3e-256) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (A <= -3.5e-272) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 4.4e-252) tmp = (180.0 / pi) * atan((-0.5 * (B / C))); else tmp = 180.0 * (atan(((-A - B) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.35e-41], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.3e-256], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -3.5e-272], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.4e-252], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[((-A) - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.35 \cdot 10^{-41}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.3 \cdot 10^{-256}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -3.5 \cdot 10^{-272}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 4.4 \cdot 10^{-252}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - B}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.34999999999999978e-41Initial program 20.6%
Taylor expanded in A around -inf 65.8%
if -3.34999999999999978e-41 < A < -2.3e-256Initial program 52.6%
Simplified77.0%
Taylor expanded in B around inf 44.3%
+-commutative44.3%
Simplified44.3%
Taylor expanded in A around 0 44.5%
if -2.3e-256 < A < -3.4999999999999997e-272Initial program 56.7%
Taylor expanded in B around -inf 75.8%
if -3.4999999999999997e-272 < A < 4.3999999999999998e-252Initial program 43.5%
Taylor expanded in C around inf 20.9%
Taylor expanded in A around 0 51.3%
Taylor expanded in A around inf 51.3%
Simplified51.3%
if 4.3999999999999998e-252 < A Initial program 69.1%
Simplified88.4%
Taylor expanded in B around inf 74.1%
+-commutative74.1%
Simplified74.1%
Taylor expanded in C around 0 71.4%
associate-*r/71.4%
neg-mul-171.4%
distribute-neg-in71.4%
sub-neg71.4%
Simplified71.4%
Final simplification64.4%
(FPCore (A B C)
:precision binary64
(if (<= C -3.6e-6)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= C 1.35e-272)
(* 180.0 (/ (atan -1.0) PI))
(if (<= C 1.1e-90)
(* 180.0 (/ (atan 1.0) PI))
(if (<= C 400.0)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (C <= -3.6e-6) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (C <= 1.35e-272) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (C <= 1.1e-90) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (C <= 400.0) {
tmp = 180.0 * (atan((-2.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 <= -3.6e-6) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (C <= 1.35e-272) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (C <= 1.1e-90) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (C <= 400.0) {
tmp = 180.0 * (Math.atan((-2.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 <= -3.6e-6: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif C <= 1.35e-272: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif C <= 1.1e-90: tmp = 180.0 * (math.atan(1.0) / math.pi) elif C <= 400.0: tmp = 180.0 * (math.atan((-2.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 <= -3.6e-6) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (C <= 1.35e-272) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (C <= 1.1e-90) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (C <= 400.0) tmp = Float64(180.0 * Float64(atan(Float64(-2.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 <= -3.6e-6) tmp = 180.0 * (atan((C / B)) / pi); elseif (C <= 1.35e-272) tmp = 180.0 * (atan(-1.0) / pi); elseif (C <= 1.1e-90) tmp = 180.0 * (atan(1.0) / pi); elseif (C <= 400.0) tmp = 180.0 * (atan((-2.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, -3.6e-6], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.35e-272], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.1e-90], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 400.0], N[(180.0 * N[(N[ArcTan[N[(-2.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 -3.6 \cdot 10^{-6}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.35 \cdot 10^{-272}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;C \leq 1.1 \cdot 10^{-90}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;C \leq 400:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \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 < -3.59999999999999984e-6Initial program 79.1%
Simplified86.6%
Taylor expanded in B around inf 79.0%
+-commutative79.0%
Simplified79.0%
Taylor expanded in C around inf 70.2%
if -3.59999999999999984e-6 < C < 1.34999999999999996e-272Initial program 55.9%
Taylor expanded in B around inf 39.1%
if 1.34999999999999996e-272 < C < 1.09999999999999993e-90Initial program 45.4%
Taylor expanded in B around -inf 36.1%
if 1.09999999999999993e-90 < C < 400Initial program 55.1%
Taylor expanded in A around inf 41.7%
if 400 < C Initial program 22.3%
Taylor expanded in C around inf 32.8%
Taylor expanded in A around 0 66.1%
Taylor expanded in A around inf 66.1%
Final simplification53.4%
(FPCore (A B C)
:precision binary64
(if (<= B -1.2e-5)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 5.6e-303)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= B 1.15e-157)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(* 180.0 (/ (atan -1.0) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.2e-5) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 5.6e-303) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (B <= 1.15e-157) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1.2e-5) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 5.6e-303) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (B <= 1.15e-157) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.2e-5: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 5.6e-303: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif B <= 1.15e-157: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1.2e-5) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 5.6e-303) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (B <= 1.15e-157) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1.2e-5) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 5.6e-303) tmp = 180.0 * (atan((C / B)) / pi); elseif (B <= 1.15e-157) tmp = 180.0 * (atan((0.0 / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.2e-5], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.6e-303], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.15e-157], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 5.6 \cdot 10^{-303}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.15 \cdot 10^{-157}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.2e-5Initial program 46.6%
Taylor expanded in B around -inf 65.2%
if -1.2e-5 < B < 5.6e-303Initial program 60.4%
Simplified66.2%
Taylor expanded in B around inf 52.9%
+-commutative52.9%
Simplified52.9%
Taylor expanded in C around inf 39.7%
if 5.6e-303 < B < 1.14999999999999994e-157Initial program 54.3%
Taylor expanded in C around inf 38.6%
associate-*r/38.6%
distribute-rgt1-in38.6%
metadata-eval38.6%
mul0-lft38.6%
metadata-eval38.6%
Simplified38.6%
if 1.14999999999999994e-157 < B Initial program 42.5%
Taylor expanded in B around inf 47.9%
Final simplification47.9%
(FPCore (A B C)
:precision binary64
(if (<= B -2e-128)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.25e-157)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2e-128) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.25e-157) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -2e-128) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.25e-157) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2e-128: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.25e-157: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2e-128) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.25e-157) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2e-128) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.25e-157) tmp = 180.0 * (atan((0.0 / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2e-128], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.25e-157], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2 \cdot 10^{-128}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.25 \cdot 10^{-157}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.00000000000000011e-128Initial program 53.5%
Taylor expanded in B around -inf 51.8%
if -2.00000000000000011e-128 < B < 1.25000000000000005e-157Initial program 55.1%
Taylor expanded in C around inf 32.7%
associate-*r/32.7%
distribute-rgt1-in32.7%
metadata-eval32.7%
mul0-lft32.7%
metadata-eval32.7%
Simplified32.7%
if 1.25000000000000005e-157 < B Initial program 42.5%
Taylor expanded in B around inf 47.9%
Final simplification44.4%
(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 54.4%
Taylor expanded in B around -inf 37.4%
if -4.999999999999985e-310 < B Initial program 45.6%
Taylor expanded in B around inf 37.8%
Final simplification37.6%
(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 49.6%
Taylor expanded in B around inf 21.7%
Final simplification21.7%
herbie shell --seed 2023319
(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)))