
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C) :precision binary64 (if (<= A -1.65e+99) (* (atan (/ (* B 0.5) A)) (/ 180.0 PI)) (/ (* 180.0 (atan (/ (- (- C A) (hypot (- A C) B)) B))) PI)))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.65e+99) {
tmp = atan(((B * 0.5) / A)) * (180.0 / ((double) M_PI));
} else {
tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.65e+99) {
tmp = Math.atan(((B * 0.5) / A)) * (180.0 / Math.PI);
} else {
tmp = (180.0 * Math.atan((((C - A) - Math.hypot((A - C), B)) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.65e+99: tmp = math.atan(((B * 0.5) / A)) * (180.0 / math.pi) else: tmp = (180.0 * math.atan((((C - A) - math.hypot((A - C), B)) / B))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.65e+99) tmp = Float64(atan(Float64(Float64(B * 0.5) / A)) * Float64(180.0 / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.65e+99) tmp = atan(((B * 0.5) / A)) * (180.0 / pi); else tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.65e+99], N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.65 \cdot 10^{+99}:\\
\;\;\;\;\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.65e99Initial program 7.2%
associate-*r/7.2%
associate-*l/7.2%
*-un-lft-identity7.2%
unpow27.2%
unpow27.2%
hypot-define33.4%
Applied egg-rr33.4%
Taylor expanded in A around -inf 78.1%
associate-*r/78.1%
*-commutative78.1%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in B around 0 78.1%
associate-*r/78.1%
*-commutative78.1%
associate-*r/78.1%
*-commutative78.1%
associate-/l*78.3%
Simplified78.3%
if -1.65e99 < A Initial program 62.1%
associate-*r/62.1%
associate-*l/62.1%
*-un-lft-identity62.1%
unpow262.1%
unpow262.1%
hypot-define82.8%
Applied egg-rr82.8%
Final simplification82.1%
(FPCore (A B C)
:precision binary64
(if (<= C -6.8e-10)
(/ (* 180.0 (atan (+ (/ (- C A) B) -1.0))) PI)
(if (<= C 3.7e+118)
(* 180.0 (/ (atan (/ (+ A (hypot B A)) (- B))) PI))
(*
180.0
(/ (atan (+ (/ (- A A) B) (/ (* -0.5 (+ B (* A (/ B C)))) C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -6.8e-10) {
tmp = (180.0 * atan((((C - A) / B) + -1.0))) / ((double) M_PI);
} else if (C <= 3.7e+118) {
tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((A - A) / B) + ((-0.5 * (B + (A * (B / C)))) / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -6.8e-10) {
tmp = (180.0 * Math.atan((((C - A) / B) + -1.0))) / Math.PI;
} else if (C <= 3.7e+118) {
tmp = 180.0 * (Math.atan(((A + Math.hypot(B, A)) / -B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((A - A) / B) + ((-0.5 * (B + (A * (B / C)))) / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -6.8e-10: tmp = (180.0 * math.atan((((C - A) / B) + -1.0))) / math.pi elif C <= 3.7e+118: tmp = 180.0 * (math.atan(((A + math.hypot(B, A)) / -B)) / math.pi) else: tmp = 180.0 * (math.atan((((A - A) / B) + ((-0.5 * (B + (A * (B / C)))) / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -6.8e-10) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) / B) + -1.0))) / pi); elseif (C <= 3.7e+118) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) / Float64(-B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(A - A) / B) + Float64(Float64(-0.5 * Float64(B + Float64(A * Float64(B / C)))) / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -6.8e-10) tmp = (180.0 * atan((((C - A) / B) + -1.0))) / pi; elseif (C <= 3.7e+118) tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / pi); else tmp = 180.0 * (atan((((A - A) / B) + ((-0.5 * (B + (A * (B / C)))) / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -6.8e-10], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 3.7e+118], 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[(N[(N[(A - A), $MachinePrecision] / B), $MachinePrecision] + N[(N[(-0.5 * N[(B + N[(A * N[(B / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -6.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
\mathbf{elif}\;C \leq 3.7 \cdot 10^{+118}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A - A}{B} + \frac{-0.5 \cdot \left(B + A \cdot \frac{B}{C}\right)}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -6.8000000000000003e-10Initial program 76.0%
associate-*r/76.0%
associate-*l/76.0%
*-un-lft-identity76.0%
unpow276.0%
unpow276.0%
hypot-define90.7%
Applied egg-rr90.7%
Taylor expanded in B around inf 75.5%
+-commutative75.5%
associate--r+75.5%
div-sub75.5%
Simplified75.5%
if -6.8000000000000003e-10 < C < 3.69999999999999987e118Initial program 55.7%
Taylor expanded in C around 0 53.9%
mul-1-neg53.9%
distribute-neg-frac253.9%
+-commutative53.9%
unpow253.9%
unpow253.9%
hypot-define77.0%
Simplified77.0%
if 3.69999999999999987e118 < C Initial program 11.9%
Taylor expanded in C around inf 72.3%
Taylor expanded in C around inf 73.5%
distribute-lft-out73.5%
associate-/l*78.0%
Simplified78.0%
Final simplification76.8%
(FPCore (A B C)
:precision binary64
(if (<= C -6e-18)
(/ (* 180.0 (atan (+ (/ (- C A) B) -1.0))) PI)
(if (<= C 1.7e+118)
(/ (* 180.0 (atan (/ (+ A (hypot A B)) (- B)))) PI)
(*
180.0
(/ (atan (+ (/ (- A A) B) (/ (* -0.5 (+ B (* A (/ B C)))) C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -6e-18) {
tmp = (180.0 * atan((((C - A) / B) + -1.0))) / ((double) M_PI);
} else if (C <= 1.7e+118) {
tmp = (180.0 * atan(((A + hypot(A, B)) / -B))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((((A - A) / B) + ((-0.5 * (B + (A * (B / C)))) / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -6e-18) {
tmp = (180.0 * Math.atan((((C - A) / B) + -1.0))) / Math.PI;
} else if (C <= 1.7e+118) {
tmp = (180.0 * Math.atan(((A + Math.hypot(A, B)) / -B))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((((A - A) / B) + ((-0.5 * (B + (A * (B / C)))) / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -6e-18: tmp = (180.0 * math.atan((((C - A) / B) + -1.0))) / math.pi elif C <= 1.7e+118: tmp = (180.0 * math.atan(((A + math.hypot(A, B)) / -B))) / math.pi else: tmp = 180.0 * (math.atan((((A - A) / B) + ((-0.5 * (B + (A * (B / C)))) / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -6e-18) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) / B) + -1.0))) / pi); elseif (C <= 1.7e+118) tmp = Float64(Float64(180.0 * atan(Float64(Float64(A + hypot(A, B)) / Float64(-B)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(A - A) / B) + Float64(Float64(-0.5 * Float64(B + Float64(A * Float64(B / C)))) / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -6e-18) tmp = (180.0 * atan((((C - A) / B) + -1.0))) / pi; elseif (C <= 1.7e+118) tmp = (180.0 * atan(((A + hypot(A, B)) / -B))) / pi; else tmp = 180.0 * (atan((((A - A) / B) + ((-0.5 * (B + (A * (B / C)))) / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -6e-18], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 1.7e+118], N[(N[(180.0 * N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(A - A), $MachinePrecision] / B), $MachinePrecision] + N[(N[(-0.5 * N[(B + N[(A * N[(B / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -6 \cdot 10^{-18}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.7 \cdot 10^{+118}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A - A}{B} + \frac{-0.5 \cdot \left(B + A \cdot \frac{B}{C}\right)}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -5.99999999999999966e-18Initial program 76.0%
associate-*r/76.0%
associate-*l/76.0%
*-un-lft-identity76.0%
unpow276.0%
unpow276.0%
hypot-define90.7%
Applied egg-rr90.7%
Taylor expanded in B around inf 75.5%
+-commutative75.5%
associate--r+75.5%
div-sub75.5%
Simplified75.5%
if -5.99999999999999966e-18 < C < 1.69999999999999993e118Initial program 55.7%
associate-*r/55.7%
associate-*l/55.7%
*-un-lft-identity55.7%
unpow255.7%
unpow255.7%
hypot-define78.1%
Applied egg-rr78.1%
Taylor expanded in C around 0 53.9%
mul-1-neg53.9%
distribute-neg-frac253.9%
unpow253.9%
unpow253.9%
hypot-define77.0%
Simplified77.0%
if 1.69999999999999993e118 < C Initial program 11.9%
Taylor expanded in C around inf 72.3%
Taylor expanded in C around inf 73.5%
distribute-lft-out73.5%
associate-/l*78.0%
Simplified78.0%
Final simplification76.8%
(FPCore (A B C) :precision binary64 (if (<= A -1.5e+100) (* (atan (/ (* B 0.5) A)) (/ 180.0 PI)) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.5e+100) {
tmp = atan(((B * 0.5) / A)) * (180.0 / ((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 <= -1.5e+100) {
tmp = Math.atan(((B * 0.5) / A)) * (180.0 / 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 <= -1.5e+100: tmp = math.atan(((B * 0.5) / A)) * (180.0 / 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 <= -1.5e+100) tmp = Float64(atan(Float64(Float64(B * 0.5) / A)) * Float64(180.0 / 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 <= -1.5e+100) tmp = atan(((B * 0.5) / A)) * (180.0 / 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, -1.5e+100], N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] * N[(180.0 / 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 -1.5 \cdot 10^{+100}:\\
\;\;\;\;\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right) \cdot \frac{180}{\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 < -1.49999999999999993e100Initial program 7.2%
associate-*r/7.2%
associate-*l/7.2%
*-un-lft-identity7.2%
unpow27.2%
unpow27.2%
hypot-define33.4%
Applied egg-rr33.4%
Taylor expanded in A around -inf 78.1%
associate-*r/78.1%
*-commutative78.1%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in B around 0 78.1%
associate-*r/78.1%
*-commutative78.1%
associate-*r/78.1%
*-commutative78.1%
associate-/l*78.3%
Simplified78.3%
if -1.49999999999999993e100 < A Initial program 62.1%
Simplified82.6%
Final simplification81.9%
(FPCore (A B C) :precision binary64 (if (<= A -5.5e+98) (* (atan (/ (* B 0.5) A)) (/ 180.0 PI)) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.5e+98) {
tmp = atan(((B * 0.5) / A)) * (180.0 / ((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 <= -5.5e+98) {
tmp = Math.atan(((B * 0.5) / A)) * (180.0 / 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 <= -5.5e+98: tmp = math.atan(((B * 0.5) / A)) * (180.0 / 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 <= -5.5e+98) tmp = Float64(atan(Float64(Float64(B * 0.5) / A)) * Float64(180.0 / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5.5e+98) tmp = atan(((B * 0.5) / A)) * (180.0 / 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, -5.5e+98], N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.5 \cdot 10^{+98}:\\
\;\;\;\;\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.49999999999999946e98Initial program 7.2%
associate-*r/7.2%
associate-*l/7.2%
*-un-lft-identity7.2%
unpow27.2%
unpow27.2%
hypot-define33.4%
Applied egg-rr33.4%
Taylor expanded in A around -inf 78.1%
associate-*r/78.1%
*-commutative78.1%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in B around 0 78.1%
associate-*r/78.1%
*-commutative78.1%
associate-*r/78.1%
*-commutative78.1%
associate-/l*78.3%
Simplified78.3%
if -5.49999999999999946e98 < A Initial program 62.1%
associate-*l/62.1%
*-lft-identity62.1%
+-commutative62.1%
unpow262.1%
unpow262.1%
hypot-define82.8%
Simplified82.8%
Final simplification82.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (* 180.0 (atan (/ (* 0.5 (+ B (* B (/ C A)))) A))) PI)))
(if (<= B -1.65e+69)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -9.6e-5)
t_0
(if (<= B -1.25e-90)
(* (/ 180.0 PI) (atan (* B (/ -0.5 C))))
(if (<= B -3.2e-111)
t_0
(/ (* 180.0 (atan (+ (/ (- C A) B) -1.0))) PI)))))))
double code(double A, double B, double C) {
double t_0 = (180.0 * atan(((0.5 * (B + (B * (C / A)))) / A))) / ((double) M_PI);
double tmp;
if (B <= -1.65e+69) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -9.6e-5) {
tmp = t_0;
} else if (B <= -1.25e-90) {
tmp = (180.0 / ((double) M_PI)) * atan((B * (-0.5 / C)));
} else if (B <= -3.2e-111) {
tmp = t_0;
} else {
tmp = (180.0 * atan((((C - A) / B) + -1.0))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (180.0 * Math.atan(((0.5 * (B + (B * (C / A)))) / A))) / Math.PI;
double tmp;
if (B <= -1.65e+69) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -9.6e-5) {
tmp = t_0;
} else if (B <= -1.25e-90) {
tmp = (180.0 / Math.PI) * Math.atan((B * (-0.5 / C)));
} else if (B <= -3.2e-111) {
tmp = t_0;
} else {
tmp = (180.0 * Math.atan((((C - A) / B) + -1.0))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = (180.0 * math.atan(((0.5 * (B + (B * (C / A)))) / A))) / math.pi tmp = 0 if B <= -1.65e+69: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -9.6e-5: tmp = t_0 elif B <= -1.25e-90: tmp = (180.0 / math.pi) * math.atan((B * (-0.5 / C))) elif B <= -3.2e-111: tmp = t_0 else: tmp = (180.0 * math.atan((((C - A) / B) + -1.0))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(Float64(180.0 * atan(Float64(Float64(0.5 * Float64(B + Float64(B * Float64(C / A)))) / A))) / pi) tmp = 0.0 if (B <= -1.65e+69) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -9.6e-5) tmp = t_0; elseif (B <= -1.25e-90) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(-0.5 / C)))); elseif (B <= -3.2e-111) tmp = t_0; else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) / B) + -1.0))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (180.0 * atan(((0.5 * (B + (B * (C / A)))) / A))) / pi; tmp = 0.0; if (B <= -1.65e+69) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -9.6e-5) tmp = t_0; elseif (B <= -1.25e-90) tmp = (180.0 / pi) * atan((B * (-0.5 / C))); elseif (B <= -3.2e-111) tmp = t_0; else tmp = (180.0 * atan((((C - A) / B) + -1.0))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(180.0 * N[ArcTan[N[(N[(0.5 * N[(B + N[(B * N[(C / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, If[LessEqual[B, -1.65e+69], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -9.6e-5], t$95$0, If[LessEqual[B, -1.25e-90], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -3.2e-111], t$95$0, N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot \left(B + B \cdot \frac{C}{A}\right)}{A}\right)}{\pi}\\
\mathbf{if}\;B \leq -1.65 \cdot 10^{+69}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -9.6 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq -1.25 \cdot 10^{-90}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\
\mathbf{elif}\;B \leq -3.2 \cdot 10^{-111}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
\end{array}
\end{array}
if B < -1.6499999999999999e69Initial program 40.7%
Taylor expanded in B around -inf 81.5%
if -1.6499999999999999e69 < B < -9.6000000000000002e-5 or -1.25000000000000005e-90 < B < -3.1999999999999998e-111Initial program 48.2%
associate-*r/48.2%
associate-*l/48.2%
*-un-lft-identity48.2%
unpow248.2%
unpow248.2%
hypot-define49.5%
Applied egg-rr49.5%
Taylor expanded in A around -inf 64.5%
associate-*r/64.5%
distribute-lft-out64.5%
associate-*r*64.5%
metadata-eval64.5%
associate-/l*66.5%
Simplified66.5%
if -9.6000000000000002e-5 < B < -1.25000000000000005e-90Initial program 49.8%
Taylor expanded in C around inf 49.6%
Taylor expanded in A around inf 49.6%
Simplified49.8%
if -3.1999999999999998e-111 < B Initial program 59.0%
associate-*r/59.0%
associate-*l/59.0%
*-un-lft-identity59.0%
unpow259.0%
unpow259.0%
hypot-define78.8%
Applied egg-rr78.8%
Taylor expanded in B around inf 65.6%
+-commutative65.6%
associate--r+65.6%
div-sub66.3%
Simplified66.3%
Final simplification67.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (+ B (* B (/ C A)))))
(if (<= B -2.6e+69)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -0.00019)
(* 180.0 (/ (atan (/ (* -0.5 t_0) (- A))) PI))
(if (<= B -2.4e-90)
(* (/ 180.0 PI) (atan (* B (/ -0.5 C))))
(if (<= B -3.8e-111)
(/ (* 180.0 (atan (/ (* 0.5 t_0) A))) PI)
(/ (* 180.0 (atan (+ (/ (- C A) B) -1.0))) PI)))))))
double code(double A, double B, double C) {
double t_0 = B + (B * (C / A));
double tmp;
if (B <= -2.6e+69) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -0.00019) {
tmp = 180.0 * (atan(((-0.5 * t_0) / -A)) / ((double) M_PI));
} else if (B <= -2.4e-90) {
tmp = (180.0 / ((double) M_PI)) * atan((B * (-0.5 / C)));
} else if (B <= -3.8e-111) {
tmp = (180.0 * atan(((0.5 * t_0) / A))) / ((double) M_PI);
} else {
tmp = (180.0 * atan((((C - A) / B) + -1.0))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = B + (B * (C / A));
double tmp;
if (B <= -2.6e+69) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -0.00019) {
tmp = 180.0 * (Math.atan(((-0.5 * t_0) / -A)) / Math.PI);
} else if (B <= -2.4e-90) {
tmp = (180.0 / Math.PI) * Math.atan((B * (-0.5 / C)));
} else if (B <= -3.8e-111) {
tmp = (180.0 * Math.atan(((0.5 * t_0) / A))) / Math.PI;
} else {
tmp = (180.0 * Math.atan((((C - A) / B) + -1.0))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = B + (B * (C / A)) tmp = 0 if B <= -2.6e+69: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -0.00019: tmp = 180.0 * (math.atan(((-0.5 * t_0) / -A)) / math.pi) elif B <= -2.4e-90: tmp = (180.0 / math.pi) * math.atan((B * (-0.5 / C))) elif B <= -3.8e-111: tmp = (180.0 * math.atan(((0.5 * t_0) / A))) / math.pi else: tmp = (180.0 * math.atan((((C - A) / B) + -1.0))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(B + Float64(B * Float64(C / A))) tmp = 0.0 if (B <= -2.6e+69) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -0.00019) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-0.5 * t_0) / Float64(-A))) / pi)); elseif (B <= -2.4e-90) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(-0.5 / C)))); elseif (B <= -3.8e-111) tmp = Float64(Float64(180.0 * atan(Float64(Float64(0.5 * t_0) / A))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) / B) + -1.0))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = B + (B * (C / A)); tmp = 0.0; if (B <= -2.6e+69) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -0.00019) tmp = 180.0 * (atan(((-0.5 * t_0) / -A)) / pi); elseif (B <= -2.4e-90) tmp = (180.0 / pi) * atan((B * (-0.5 / C))); elseif (B <= -3.8e-111) tmp = (180.0 * atan(((0.5 * t_0) / A))) / pi; else tmp = (180.0 * atan((((C - A) / B) + -1.0))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(B + N[(B * N[(C / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -2.6e+69], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -0.00019], N[(180.0 * N[(N[ArcTan[N[(N[(-0.5 * t$95$0), $MachinePrecision] / (-A)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.4e-90], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -3.8e-111], N[(N[(180.0 * N[ArcTan[N[(N[(0.5 * t$95$0), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := B + B \cdot \frac{C}{A}\\
\mathbf{if}\;B \leq -2.6 \cdot 10^{+69}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -0.00019:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-0.5 \cdot t\_0}{-A}\right)}{\pi}\\
\mathbf{elif}\;B \leq -2.4 \cdot 10^{-90}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\
\mathbf{elif}\;B \leq -3.8 \cdot 10^{-111}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot t\_0}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
\end{array}
\end{array}
if B < -2.6000000000000002e69Initial program 40.7%
Taylor expanded in B around -inf 81.5%
if -2.6000000000000002e69 < B < -1.9000000000000001e-4Initial program 54.3%
Taylor expanded in A around -inf 56.3%
mul-1-neg56.3%
distribute-neg-frac256.3%
distribute-lft-out56.3%
associate-/l*58.8%
Simplified58.8%
if -1.9000000000000001e-4 < B < -2.4000000000000002e-90Initial program 49.8%
Taylor expanded in C around inf 49.6%
Taylor expanded in A around inf 49.6%
Simplified49.8%
if -2.4000000000000002e-90 < B < -3.80000000000000022e-111Initial program 22.8%
associate-*r/22.8%
associate-*l/22.8%
*-un-lft-identity22.8%
unpow222.8%
unpow222.8%
hypot-define25.2%
Applied egg-rr25.2%
Taylor expanded in A around -inf 99.4%
associate-*r/99.4%
distribute-lft-out99.4%
associate-*r*99.4%
metadata-eval99.4%
associate-/l*99.4%
Simplified99.4%
if -3.80000000000000022e-111 < B Initial program 59.0%
associate-*r/59.0%
associate-*l/59.0%
*-un-lft-identity59.0%
unpow259.0%
unpow259.0%
hypot-define78.8%
Applied egg-rr78.8%
Taylor expanded in B around inf 65.6%
+-commutative65.6%
associate--r+65.6%
div-sub66.3%
Simplified66.3%
Final simplification67.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))
(t_1 (* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))
(if (<= B -3.4e-34)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -1.5e-125)
t_0
(if (<= B 4.8e-307)
t_1
(if (<= B 9.8e-187)
t_0
(if (<= B 1.35e-30) t_1 (* 180.0 (/ (atan -1.0) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
double t_1 = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
double tmp;
if (B <= -3.4e-34) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -1.5e-125) {
tmp = t_0;
} else if (B <= 4.8e-307) {
tmp = t_1;
} else if (B <= 9.8e-187) {
tmp = t_0;
} else if (B <= 1.35e-30) {
tmp = t_1;
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
double t_1 = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
double tmp;
if (B <= -3.4e-34) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -1.5e-125) {
tmp = t_0;
} else if (B <= 4.8e-307) {
tmp = t_1;
} else if (B <= 9.8e-187) {
tmp = t_0;
} else if (B <= 1.35e-30) {
tmp = t_1;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) t_1 = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) tmp = 0 if B <= -3.4e-34: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -1.5e-125: tmp = t_0 elif B <= 4.8e-307: tmp = t_1 elif B <= 9.8e-187: tmp = t_0 elif B <= 1.35e-30: tmp = t_1 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)) tmp = 0.0 if (B <= -3.4e-34) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -1.5e-125) tmp = t_0; elseif (B <= 4.8e-307) tmp = t_1; elseif (B <= 9.8e-187) tmp = t_0; elseif (B <= 1.35e-30) tmp = t_1; else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((-0.5 * (B / C))) / pi); t_1 = 180.0 * (atan((-2.0 * (A / B))) / pi); tmp = 0.0; if (B <= -3.4e-34) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -1.5e-125) tmp = t_0; elseif (B <= 4.8e-307) tmp = t_1; elseif (B <= 9.8e-187) tmp = t_0; elseif (B <= 1.35e-30) tmp = t_1; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.4e-34], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.5e-125], t$95$0, If[LessEqual[B, 4.8e-307], t$95$1, If[LessEqual[B, 9.8e-187], t$95$0, If[LessEqual[B, 1.35e-30], t$95$1, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -3.4 \cdot 10^{-34}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -1.5 \cdot 10^{-125}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 4.8 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq 9.8 \cdot 10^{-187}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 1.35 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.4000000000000001e-34Initial program 45.4%
Taylor expanded in B around -inf 66.1%
if -3.4000000000000001e-34 < B < -1.49999999999999995e-125 or 4.80000000000000036e-307 < B < 9.8000000000000008e-187Initial program 49.2%
Taylor expanded in C around inf 47.3%
Taylor expanded in A around inf 47.3%
if -1.49999999999999995e-125 < B < 4.80000000000000036e-307 or 9.8000000000000008e-187 < B < 1.34999999999999994e-30Initial program 70.9%
Taylor expanded in A around inf 51.5%
if 1.34999999999999994e-30 < B Initial program 48.7%
Taylor expanded in B around inf 58.6%
Final simplification56.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
(if (<= B -6.2e-35)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -5.9e-207)
t_0
(if (<= B 1.45e-252)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= B 2.3e-184)
t_0
(if (<= B 4.5e-28)
(* 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.5 * (B / C))) / ((double) M_PI));
double tmp;
if (B <= -6.2e-35) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -5.9e-207) {
tmp = t_0;
} else if (B <= 1.45e-252) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (B <= 2.3e-184) {
tmp = t_0;
} else if (B <= 4.5e-28) {
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.5 * (B / C))) / Math.PI);
double tmp;
if (B <= -6.2e-35) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -5.9e-207) {
tmp = t_0;
} else if (B <= 1.45e-252) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (B <= 2.3e-184) {
tmp = t_0;
} else if (B <= 4.5e-28) {
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.5 * (B / C))) / math.pi) tmp = 0 if B <= -6.2e-35: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -5.9e-207: tmp = t_0 elif B <= 1.45e-252: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif B <= 2.3e-184: tmp = t_0 elif B <= 4.5e-28: 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.5 * Float64(B / C))) / pi)) tmp = 0.0 if (B <= -6.2e-35) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -5.9e-207) tmp = t_0; elseif (B <= 1.45e-252) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (B <= 2.3e-184) tmp = t_0; elseif (B <= 4.5e-28) 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.5 * (B / C))) / pi); tmp = 0.0; if (B <= -6.2e-35) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -5.9e-207) tmp = t_0; elseif (B <= 1.45e-252) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (B <= 2.3e-184) tmp = t_0; elseif (B <= 4.5e-28) 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.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -6.2e-35], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -5.9e-207], t$95$0, If[LessEqual[B, 1.45e-252], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.3e-184], t$95$0, If[LessEqual[B, 4.5e-28], 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(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{if}\;B \leq -6.2 \cdot 10^{-35}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -5.9 \cdot 10^{-207}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 1.45 \cdot 10^{-252}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.3 \cdot 10^{-184}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-28}:\\
\;\;\;\;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.20000000000000024e-35Initial program 45.4%
Taylor expanded in B around -inf 66.1%
if -6.20000000000000024e-35 < B < -5.89999999999999971e-207 or 1.45e-252 < B < 2.2999999999999999e-184Initial program 45.3%
Taylor expanded in C around inf 47.5%
Taylor expanded in A around inf 47.5%
if -5.89999999999999971e-207 < B < 1.45e-252Initial program 80.8%
Taylor expanded in C around -inf 64.7%
if 2.2999999999999999e-184 < B < 4.4999999999999998e-28Initial program 68.0%
Taylor expanded in A around inf 41.3%
if 4.4999999999999998e-28 < B Initial program 48.7%
Taylor expanded in B around inf 58.6%
Final simplification57.2%
(FPCore (A B C)
:precision binary64
(if (<= B -2.75e-40)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4.5e-31)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.75e-40) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4.5e-31) {
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 tmp;
if (B <= -2.75e-40) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4.5e-31) {
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): tmp = 0 if B <= -2.75e-40: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4.5e-31: 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) tmp = 0.0 if (B <= -2.75e-40) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4.5e-31) 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) tmp = 0.0; if (B <= -2.75e-40) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4.5e-31) 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_] := If[LessEqual[B, -2.75e-40], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.5e-31], 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}
\mathbf{if}\;B \leq -2.75 \cdot 10^{-40}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-31}:\\
\;\;\;\;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 < -2.75000000000000001e-40Initial program 44.9%
Taylor expanded in B around -inf 65.3%
if -2.75000000000000001e-40 < B < 4.5000000000000004e-31Initial program 62.5%
Taylor expanded in A around inf 41.2%
if 4.5000000000000004e-31 < B Initial program 48.7%
Taylor expanded in B around inf 58.6%
Final simplification52.9%
(FPCore (A B C)
:precision binary64
(if (<= B -2.6e-161)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.02e-200)
(* 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 <= -2.6e-161) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.02e-200) {
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 <= -2.6e-161) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.02e-200) {
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 <= -2.6e-161: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.02e-200: 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 <= -2.6e-161) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.02e-200) 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 <= -2.6e-161) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.02e-200) 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, -2.6e-161], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.02e-200], 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.6 \cdot 10^{-161}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.02 \cdot 10^{-200}:\\
\;\;\;\;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.59999999999999995e-161Initial program 46.3%
Taylor expanded in B around -inf 51.1%
if -2.59999999999999995e-161 < B < 1.02e-200Initial program 68.0%
Taylor expanded in C around inf 29.3%
associate-*r/29.3%
distribute-rgt1-in29.3%
metadata-eval29.3%
mul0-lft29.3%
metadata-eval29.3%
Simplified29.3%
if 1.02e-200 < B Initial program 54.2%
Taylor expanded in B around inf 44.8%
Final simplification44.3%
(FPCore (A B C) :precision binary64 (if (<= B -2.15e-38) (* 180.0 (/ (atan 1.0) PI)) (/ (* 180.0 (atan (+ (/ (- C A) B) -1.0))) PI)))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.15e-38) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = (180.0 * atan((((C - A) / B) + -1.0))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -2.15e-38) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = (180.0 * Math.atan((((C - A) / B) + -1.0))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.15e-38: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = (180.0 * math.atan((((C - A) / B) + -1.0))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2.15e-38) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) / B) + -1.0))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.15e-38) tmp = 180.0 * (atan(1.0) / pi); else tmp = (180.0 * atan((((C - A) / B) + -1.0))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.15e-38], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.15 \cdot 10^{-38}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
\end{array}
\end{array}
if B < -2.1500000000000001e-38Initial program 44.9%
Taylor expanded in B around -inf 65.3%
if -2.1500000000000001e-38 < B Initial program 57.4%
associate-*r/57.4%
associate-*l/57.4%
*-un-lft-identity57.4%
unpow257.4%
unpow257.4%
hypot-define75.3%
Applied egg-rr75.3%
Taylor expanded in B around inf 63.3%
+-commutative63.3%
associate--r+63.3%
div-sub63.9%
Simplified63.9%
Final simplification64.3%
(FPCore (A B C) :precision binary64 (if (<= B -2e-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 <= -2e-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 <= -2e-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 <= -2e-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 <= -2e-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 <= -2e-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, -2e-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 -2 \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 < -1.999999999999994e-310Initial program 52.5%
Taylor expanded in B around -inf 42.5%
if -1.999999999999994e-310 < B Initial program 55.0%
Taylor expanded in B around inf 39.7%
Final simplification41.1%
(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.7%
Taylor expanded in B around inf 19.9%
Final simplification19.9%
herbie shell --seed 2024060
(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)))