
(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 -3.05e+62) (* 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 <= -3.05e+62) {
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 <= -3.05e+62) {
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 <= -3.05e+62: 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 <= -3.05e+62) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / 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 <= -3.05e+62) 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, -3.05e+62], 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[(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 -3.05 \cdot 10^{+62}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.0499999999999998e62Initial program 16.2%
associate-*l/16.2%
*-lft-identity16.2%
+-commutative16.2%
unpow216.2%
unpow216.2%
hypot-def45.0%
Simplified45.0%
Taylor expanded in A around -inf 86.5%
if -3.0499999999999998e62 < A Initial program 59.2%
associate-*l/59.2%
*-lft-identity59.2%
+-commutative59.2%
unpow259.2%
unpow259.2%
hypot-def80.9%
Simplified80.9%
Final simplification82.0%
(FPCore (A B C)
:precision binary64
(if (<= A -3.1e+62)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 1.25e-34)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (/ (- (- A) (hypot A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.1e+62) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 1.25e-34) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-A - hypot(A, B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.1e+62) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 1.25e-34) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-A - Math.hypot(A, B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.1e+62: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 1.25e-34: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((-A - math.hypot(A, B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.1e+62) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 1.25e-34) 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(A, B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.1e+62) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 1.25e-34) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan(((-A - hypot(A, B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.1e+62], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.25e-34], 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[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.1 \cdot 10^{+62}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.25 \cdot 10^{-34}:\\
\;\;\;\;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(A, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.10000000000000014e62Initial program 16.2%
associate-*l/16.2%
*-lft-identity16.2%
+-commutative16.2%
unpow216.2%
unpow216.2%
hypot-def45.0%
Simplified45.0%
Taylor expanded in A around -inf 86.5%
if -3.10000000000000014e62 < A < 1.2500000000000001e-34Initial program 51.5%
associate-*l/51.5%
*-lft-identity51.5%
+-commutative51.5%
unpow251.5%
unpow251.5%
hypot-def75.1%
Simplified75.1%
Taylor expanded in A around 0 48.7%
unpow248.7%
unpow248.7%
hypot-def72.2%
Simplified72.2%
if 1.2500000000000001e-34 < A Initial program 76.3%
associate-*l/76.3%
*-lft-identity76.3%
+-commutative76.3%
unpow276.3%
unpow276.3%
hypot-def94.0%
Simplified94.0%
Taylor expanded in C around 0 76.3%
mul-1-neg76.3%
+-commutative76.3%
unpow276.3%
unpow276.3%
hypot-def94.0%
Simplified94.0%
Final simplification80.4%
(FPCore (A B C)
:precision binary64
(if (<= A -3e+62)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 4.1e+22)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* (/ 180.0 PI) (atan (/ (- B A) B))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3e+62) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 4.1e+22) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((B - A) / B));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3e+62) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 4.1e+22) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan(((B - A) / B));
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3e+62: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 4.1e+22: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = (180.0 / math.pi) * math.atan(((B - A) / B)) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3e+62) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 4.1e+22) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(B - A) / B))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3e+62) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 4.1e+22) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = (180.0 / pi) * atan(((B - A) / B)); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3e+62], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.1e+22], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(B - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3 \cdot 10^{+62}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 4.1 \cdot 10^{+22}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B - A}{B}\right)\\
\end{array}
\end{array}
if A < -3e62Initial program 16.2%
associate-*l/16.2%
*-lft-identity16.2%
+-commutative16.2%
unpow216.2%
unpow216.2%
hypot-def45.0%
Simplified45.0%
Taylor expanded in A around -inf 86.5%
if -3e62 < A < 4.09999999999999979e22Initial program 53.0%
associate-*l/53.0%
*-lft-identity53.0%
+-commutative53.0%
unpow253.0%
unpow253.0%
hypot-def76.4%
Simplified76.4%
Taylor expanded in A around 0 49.1%
unpow249.1%
unpow249.1%
hypot-def72.5%
Simplified72.5%
if 4.09999999999999979e22 < A Initial program 75.9%
associate-*r/75.9%
associate-*l/75.9%
associate-*l/75.9%
*-lft-identity75.9%
sub-neg75.9%
associate-+l-75.9%
sub-neg75.9%
remove-double-neg75.9%
+-commutative75.9%
unpow275.9%
unpow275.9%
hypot-def93.1%
Simplified93.1%
Taylor expanded in B around -inf 82.9%
neg-mul-182.9%
unsub-neg82.9%
Simplified82.9%
Taylor expanded in C around 0 83.2%
Final simplification77.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- (- C B) A) B)) PI)))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= A -3e+62)
t_1
(if (<= A -1150000.0)
t_0
(if (<= A -8.8e-29)
(* (/ 180.0 PI) (atan (* -0.5 (/ (* B B) (* B C)))))
(if (<= A -1.4e-65)
(*
180.0
(/ (atan (/ (* 0.5 (* (* B (/ B A)) (+ (/ C A) 1.0))) B)) PI))
(if (<= A -2e-129)
t_1
(if (<= A -2e-162)
(* (/ 180.0 PI) (atan (/ (+ B C) B)))
(if (<= A -5e-240)
t_0
(if (<= A 1.55e+168)
(* (/ 180.0 PI) (atan (/ (+ C (- B A)) B)))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((((C - B) - A) / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (A <= -3e+62) {
tmp = t_1;
} else if (A <= -1150000.0) {
tmp = t_0;
} else if (A <= -8.8e-29) {
tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * ((B * B) / (B * C))));
} else if (A <= -1.4e-65) {
tmp = 180.0 * (atan(((0.5 * ((B * (B / A)) * ((C / A) + 1.0))) / B)) / ((double) M_PI));
} else if (A <= -2e-129) {
tmp = t_1;
} else if (A <= -2e-162) {
tmp = (180.0 / ((double) M_PI)) * atan(((B + C) / B));
} else if (A <= -5e-240) {
tmp = t_0;
} else if (A <= 1.55e+168) {
tmp = (180.0 / ((double) M_PI)) * atan(((C + (B - A)) / B));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (A <= -3e+62) {
tmp = t_1;
} else if (A <= -1150000.0) {
tmp = t_0;
} else if (A <= -8.8e-29) {
tmp = (180.0 / Math.PI) * Math.atan((-0.5 * ((B * B) / (B * C))));
} else if (A <= -1.4e-65) {
tmp = 180.0 * (Math.atan(((0.5 * ((B * (B / A)) * ((C / A) + 1.0))) / B)) / Math.PI);
} else if (A <= -2e-129) {
tmp = t_1;
} else if (A <= -2e-162) {
tmp = (180.0 / Math.PI) * Math.atan(((B + C) / B));
} else if (A <= -5e-240) {
tmp = t_0;
} else if (A <= 1.55e+168) {
tmp = (180.0 / Math.PI) * Math.atan(((C + (B - A)) / B));
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((((C - B) - A) / B)) / math.pi) t_1 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if A <= -3e+62: tmp = t_1 elif A <= -1150000.0: tmp = t_0 elif A <= -8.8e-29: tmp = (180.0 / math.pi) * math.atan((-0.5 * ((B * B) / (B * C)))) elif A <= -1.4e-65: tmp = 180.0 * (math.atan(((0.5 * ((B * (B / A)) * ((C / A) + 1.0))) / B)) / math.pi) elif A <= -2e-129: tmp = t_1 elif A <= -2e-162: tmp = (180.0 / math.pi) * math.atan(((B + C) / B)) elif A <= -5e-240: tmp = t_0 elif A <= 1.55e+168: tmp = (180.0 / math.pi) * math.atan(((C + (B - A)) / B)) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (A <= -3e+62) tmp = t_1; elseif (A <= -1150000.0) tmp = t_0; elseif (A <= -8.8e-29) tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(Float64(B * B) / Float64(B * C))))); elseif (A <= -1.4e-65) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * Float64(Float64(B * Float64(B / A)) * Float64(Float64(C / A) + 1.0))) / B)) / pi)); elseif (A <= -2e-129) tmp = t_1; elseif (A <= -2e-162) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(B + C) / B))); elseif (A <= -5e-240) tmp = t_0; elseif (A <= 1.55e+168) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C + Float64(B - A)) / B))); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((((C - B) - A) / B)) / pi); t_1 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (A <= -3e+62) tmp = t_1; elseif (A <= -1150000.0) tmp = t_0; elseif (A <= -8.8e-29) tmp = (180.0 / pi) * atan((-0.5 * ((B * B) / (B * C)))); elseif (A <= -1.4e-65) tmp = 180.0 * (atan(((0.5 * ((B * (B / A)) * ((C / A) + 1.0))) / B)) / pi); elseif (A <= -2e-129) tmp = t_1; elseif (A <= -2e-162) tmp = (180.0 / pi) * atan(((B + C) / B)); elseif (A <= -5e-240) tmp = t_0; elseif (A <= 1.55e+168) tmp = (180.0 / pi) * atan(((C + (B - A)) / B)); else tmp = 180.0 * (atan((-1.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[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -3e+62], t$95$1, If[LessEqual[A, -1150000.0], t$95$0, If[LessEqual[A, -8.8e-29], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(N[(B * B), $MachinePrecision] / N[(B * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -1.4e-65], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * N[(N[(B * N[(B / A), $MachinePrecision]), $MachinePrecision] * N[(N[(C / A), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2e-129], t$95$1, If[LessEqual[A, -2e-162], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -5e-240], t$95$0, If[LessEqual[A, 1.55e+168], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -3 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -1150000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -8.8 \cdot 10^{-29}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B \cdot B}{B \cdot C}\right)\\
\mathbf{elif}\;A \leq -1.4 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot \left(\left(B \cdot \frac{B}{A}\right) \cdot \left(\frac{C}{A} + 1\right)\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2 \cdot 10^{-129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -2 \cdot 10^{-162}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B + C}{B}\right)\\
\mathbf{elif}\;A \leq -5 \cdot 10^{-240}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 1.55 \cdot 10^{+168}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3e62 or -1.4e-65 < A < -1.9999999999999999e-129Initial program 22.7%
associate-*l/22.7%
*-lft-identity22.7%
+-commutative22.7%
unpow222.7%
unpow222.7%
hypot-def45.7%
Simplified45.7%
Taylor expanded in A around -inf 81.3%
if -3e62 < A < -1.15e6 or -1.99999999999999991e-162 < A < -5.0000000000000004e-240Initial program 50.8%
associate-*l/50.7%
*-lft-identity50.7%
+-commutative50.7%
unpow250.7%
unpow250.7%
hypot-def80.0%
Simplified80.0%
Taylor expanded in B around inf 70.0%
neg-mul-170.0%
unsub-neg70.0%
Simplified70.0%
if -1.15e6 < A < -8.79999999999999961e-29Initial program 6.6%
associate-*l/6.6%
*-lft-identity6.6%
+-commutative6.6%
unpow26.6%
unpow26.6%
hypot-def29.4%
Simplified29.4%
Taylor expanded in C around inf 33.3%
fma-def33.3%
associate--l+52.1%
unpow252.1%
fma-def52.1%
unpow252.1%
unpow252.1%
difference-of-squares52.1%
distribute-rgt1-in52.1%
metadata-eval52.1%
mul0-lft52.1%
mul-1-neg52.1%
*-commutative52.1%
associate-*r/52.1%
Simplified52.1%
Taylor expanded in B around 0 52.1%
associate-*r/52.1%
associate-/l*52.3%
associate-/r/52.3%
fma-udef52.3%
+-rgt-identity52.3%
fma-udef52.3%
unpow252.3%
+-rgt-identity52.3%
unpow252.3%
Simplified52.3%
if -8.79999999999999961e-29 < A < -1.4e-65Initial program 64.4%
associate-*l/64.4%
*-lft-identity64.4%
+-commutative64.4%
unpow264.4%
unpow264.4%
hypot-def100.0%
Simplified100.0%
Taylor expanded in A around -inf 54.4%
distribute-lft-out54.4%
associate-/l*54.4%
unpow254.4%
unpow254.4%
times-frac73.8%
unpow273.8%
Simplified73.8%
Taylor expanded in C around 0 54.4%
+-commutative54.4%
unpow254.4%
times-frac54.4%
unpow254.4%
associate-/l*73.8%
unpow273.8%
associate-/l*73.8%
*-lft-identity73.8%
distribute-rgt-out75.6%
associate-/r/75.6%
*-commutative75.6%
Simplified75.6%
if -1.9999999999999999e-129 < A < -1.99999999999999991e-162Initial program 45.4%
associate-*r/45.4%
associate-*l/45.4%
associate-*l/45.4%
*-lft-identity45.4%
sub-neg45.4%
associate-+l-45.4%
sub-neg45.4%
remove-double-neg45.4%
+-commutative45.4%
unpow245.4%
unpow245.4%
hypot-def79.4%
Simplified79.4%
Taylor expanded in B around -inf 51.2%
neg-mul-151.2%
unsub-neg51.2%
Simplified51.2%
Taylor expanded in A around 0 51.2%
if -5.0000000000000004e-240 < A < 1.54999999999999998e168Initial program 59.3%
associate-*r/59.3%
associate-*l/59.3%
associate-*l/59.3%
*-lft-identity59.3%
sub-neg59.3%
associate-+l-59.3%
sub-neg59.3%
remove-double-neg59.3%
+-commutative59.3%
unpow259.3%
unpow259.3%
hypot-def82.8%
Simplified82.8%
Taylor expanded in B around -inf 59.4%
neg-mul-159.4%
unsub-neg59.4%
Simplified59.4%
if 1.54999999999999998e168 < A Initial program 86.9%
associate-*l/86.9%
*-lft-identity86.9%
+-commutative86.9%
unpow286.9%
unpow286.9%
hypot-def96.8%
Simplified96.8%
Taylor expanded in B around inf 94.9%
neg-mul-194.9%
unsub-neg94.9%
Simplified94.9%
Taylor expanded in C around 0 94.9%
associate-*r/94.9%
neg-mul-194.9%
distribute-neg-in94.9%
sub-neg94.9%
div-sub94.9%
distribute-frac-neg94.9%
*-inverses94.9%
sub-neg94.9%
metadata-eval94.9%
+-commutative94.9%
unsub-neg94.9%
Simplified94.9%
Final simplification70.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- (- C B) A) B)) PI)))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= A -2.6e+62)
t_1
(if (<= A -2.4e-67)
t_0
(if (<= A -2e-129)
t_1
(if (<= A -1.85e-239)
t_0
(if (<= A 1e+171)
(* (/ 180.0 PI) (atan (/ (+ C (- B A)) B)))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((((C - B) - A) / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (A <= -2.6e+62) {
tmp = t_1;
} else if (A <= -2.4e-67) {
tmp = t_0;
} else if (A <= -2e-129) {
tmp = t_1;
} else if (A <= -1.85e-239) {
tmp = t_0;
} else if (A <= 1e+171) {
tmp = (180.0 / ((double) M_PI)) * atan(((C + (B - A)) / B));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (A <= -2.6e+62) {
tmp = t_1;
} else if (A <= -2.4e-67) {
tmp = t_0;
} else if (A <= -2e-129) {
tmp = t_1;
} else if (A <= -1.85e-239) {
tmp = t_0;
} else if (A <= 1e+171) {
tmp = (180.0 / Math.PI) * Math.atan(((C + (B - A)) / B));
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((((C - B) - A) / B)) / math.pi) t_1 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if A <= -2.6e+62: tmp = t_1 elif A <= -2.4e-67: tmp = t_0 elif A <= -2e-129: tmp = t_1 elif A <= -1.85e-239: tmp = t_0 elif A <= 1e+171: tmp = (180.0 / math.pi) * math.atan(((C + (B - A)) / B)) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (A <= -2.6e+62) tmp = t_1; elseif (A <= -2.4e-67) tmp = t_0; elseif (A <= -2e-129) tmp = t_1; elseif (A <= -1.85e-239) tmp = t_0; elseif (A <= 1e+171) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C + Float64(B - A)) / B))); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((((C - B) - A) / B)) / pi); t_1 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (A <= -2.6e+62) tmp = t_1; elseif (A <= -2.4e-67) tmp = t_0; elseif (A <= -2e-129) tmp = t_1; elseif (A <= -1.85e-239) tmp = t_0; elseif (A <= 1e+171) tmp = (180.0 / pi) * atan(((C + (B - A)) / B)); else tmp = 180.0 * (atan((-1.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[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -2.6e+62], t$95$1, If[LessEqual[A, -2.4e-67], t$95$0, If[LessEqual[A, -2e-129], t$95$1, If[LessEqual[A, -1.85e-239], t$95$0, If[LessEqual[A, 1e+171], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -2.6 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -2.4 \cdot 10^{-67}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -2 \cdot 10^{-129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -1.85 \cdot 10^{-239}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 10^{+171}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.59999999999999984e62 or -2.4e-67 < A < -1.9999999999999999e-129Initial program 22.7%
associate-*l/22.7%
*-lft-identity22.7%
+-commutative22.7%
unpow222.7%
unpow222.7%
hypot-def45.7%
Simplified45.7%
Taylor expanded in A around -inf 81.3%
if -2.59999999999999984e62 < A < -2.4e-67 or -1.9999999999999999e-129 < A < -1.85000000000000008e-239Initial program 45.6%
associate-*l/45.5%
*-lft-identity45.5%
+-commutative45.5%
unpow245.5%
unpow245.5%
hypot-def76.0%
Simplified76.0%
Taylor expanded in B around inf 54.3%
neg-mul-154.3%
unsub-neg54.3%
Simplified54.3%
if -1.85000000000000008e-239 < A < 9.99999999999999954e170Initial program 59.3%
associate-*r/59.3%
associate-*l/59.3%
associate-*l/59.3%
*-lft-identity59.3%
sub-neg59.3%
associate-+l-59.3%
sub-neg59.3%
remove-double-neg59.3%
+-commutative59.3%
unpow259.3%
unpow259.3%
hypot-def82.8%
Simplified82.8%
Taylor expanded in B around -inf 59.4%
neg-mul-159.4%
unsub-neg59.4%
Simplified59.4%
if 9.99999999999999954e170 < A Initial program 86.9%
associate-*l/86.9%
*-lft-identity86.9%
+-commutative86.9%
unpow286.9%
unpow286.9%
hypot-def96.8%
Simplified96.8%
Taylor expanded in B around inf 94.9%
neg-mul-194.9%
unsub-neg94.9%
Simplified94.9%
Taylor expanded in C around 0 94.9%
associate-*r/94.9%
neg-mul-194.9%
distribute-neg-in94.9%
sub-neg94.9%
div-sub94.9%
distribute-frac-neg94.9%
*-inverses94.9%
sub-neg94.9%
metadata-eval94.9%
+-commutative94.9%
unsub-neg94.9%
Simplified94.9%
Final simplification68.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* (/ 180.0 PI) (atan (/ (+ B C) B)))))
(if (<= A -4.8e-31)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -1.04e-168)
t_0
(if (<= A -4.3e-201)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A -3.4e-234)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= A 5.5e-68)
t_0
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = (180.0 / ((double) M_PI)) * atan(((B + C) / B));
double tmp;
if (A <= -4.8e-31) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -1.04e-168) {
tmp = t_0;
} else if (A <= -4.3e-201) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= -3.4e-234) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (A <= 5.5e-68) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (180.0 / Math.PI) * Math.atan(((B + C) / B));
double tmp;
if (A <= -4.8e-31) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -1.04e-168) {
tmp = t_0;
} else if (A <= -4.3e-201) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= -3.4e-234) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (A <= 5.5e-68) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (180.0 / math.pi) * math.atan(((B + C) / B)) tmp = 0 if A <= -4.8e-31: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -1.04e-168: tmp = t_0 elif A <= -4.3e-201: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= -3.4e-234: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif A <= 5.5e-68: tmp = t_0 else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(180.0 / pi) * atan(Float64(Float64(B + C) / B))) tmp = 0.0 if (A <= -4.8e-31) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -1.04e-168) tmp = t_0; elseif (A <= -4.3e-201) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= -3.4e-234) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (A <= 5.5e-68) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (180.0 / pi) * atan(((B + C) / B)); tmp = 0.0; if (A <= -4.8e-31) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -1.04e-168) tmp = t_0; elseif (A <= -4.3e-201) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= -3.4e-234) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (A <= 5.5e-68) tmp = t_0; else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -4.8e-31], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -1.04e-168], t$95$0, If[LessEqual[A, -4.3e-201], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -3.4e-234], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.5e-68], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B + C}{B}\right)\\
\mathbf{if}\;A \leq -4.8 \cdot 10^{-31}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -1.04 \cdot 10^{-168}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -4.3 \cdot 10^{-201}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq -3.4 \cdot 10^{-234}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 5.5 \cdot 10^{-68}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.8e-31Initial program 18.6%
associate-*l/18.5%
*-lft-identity18.5%
+-commutative18.5%
unpow218.5%
unpow218.5%
hypot-def48.4%
Simplified48.4%
Taylor expanded in A around -inf 71.0%
if -4.8e-31 < A < -1.04000000000000006e-168 or -3.39999999999999986e-234 < A < 5.5000000000000003e-68Initial program 55.8%
associate-*r/55.8%
associate-*l/55.8%
associate-*l/55.8%
*-lft-identity55.8%
sub-neg55.8%
associate-+l-55.8%
sub-neg55.8%
remove-double-neg55.8%
+-commutative55.8%
unpow255.8%
unpow255.8%
hypot-def76.0%
Simplified76.0%
Taylor expanded in B around -inf 52.8%
neg-mul-152.8%
unsub-neg52.8%
Simplified52.8%
Taylor expanded in A around 0 50.3%
if -1.04000000000000006e-168 < A < -4.2999999999999997e-201Initial program 53.9%
associate-*l/53.9%
*-lft-identity53.9%
+-commutative53.9%
unpow253.9%
unpow253.9%
hypot-def83.9%
Simplified83.9%
Taylor expanded in B around inf 67.5%
if -4.2999999999999997e-201 < A < -3.39999999999999986e-234Initial program 51.5%
associate-*l/51.5%
*-lft-identity51.5%
+-commutative51.5%
unpow251.5%
unpow251.5%
hypot-def76.2%
Simplified76.2%
Taylor expanded in C around -inf 39.1%
if 5.5000000000000003e-68 < A Initial program 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-def94.5%
Simplified94.5%
Taylor expanded in B around inf 77.9%
neg-mul-177.9%
unsub-neg77.9%
Simplified77.9%
Taylor expanded in C around 0 77.9%
associate-*r/77.9%
neg-mul-177.9%
distribute-neg-in77.9%
sub-neg77.9%
div-sub77.9%
distribute-frac-neg77.9%
*-inverses77.9%
sub-neg77.9%
metadata-eval77.9%
+-commutative77.9%
unsub-neg77.9%
Simplified77.9%
Final simplification63.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- (- C B) A) B)) PI)))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= A -2.6e+62)
t_1
(if (<= A -9e-68)
t_0
(if (<= A -2e-129)
t_1
(if (<= A 7.8e-17)
t_0
(if (<= A 7.5e+178)
(* (/ 180.0 PI) (atan (/ (- B A) B)))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((((C - B) - A) / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (A <= -2.6e+62) {
tmp = t_1;
} else if (A <= -9e-68) {
tmp = t_0;
} else if (A <= -2e-129) {
tmp = t_1;
} else if (A <= 7.8e-17) {
tmp = t_0;
} else if (A <= 7.5e+178) {
tmp = (180.0 / ((double) M_PI)) * atan(((B - A) / B));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (A <= -2.6e+62) {
tmp = t_1;
} else if (A <= -9e-68) {
tmp = t_0;
} else if (A <= -2e-129) {
tmp = t_1;
} else if (A <= 7.8e-17) {
tmp = t_0;
} else if (A <= 7.5e+178) {
tmp = (180.0 / Math.PI) * Math.atan(((B - A) / B));
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((((C - B) - A) / B)) / math.pi) t_1 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if A <= -2.6e+62: tmp = t_1 elif A <= -9e-68: tmp = t_0 elif A <= -2e-129: tmp = t_1 elif A <= 7.8e-17: tmp = t_0 elif A <= 7.5e+178: tmp = (180.0 / math.pi) * math.atan(((B - A) / B)) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (A <= -2.6e+62) tmp = t_1; elseif (A <= -9e-68) tmp = t_0; elseif (A <= -2e-129) tmp = t_1; elseif (A <= 7.8e-17) tmp = t_0; elseif (A <= 7.5e+178) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(B - A) / B))); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((((C - B) - A) / B)) / pi); t_1 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (A <= -2.6e+62) tmp = t_1; elseif (A <= -9e-68) tmp = t_0; elseif (A <= -2e-129) tmp = t_1; elseif (A <= 7.8e-17) tmp = t_0; elseif (A <= 7.5e+178) tmp = (180.0 / pi) * atan(((B - A) / B)); else tmp = 180.0 * (atan((-1.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[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -2.6e+62], t$95$1, If[LessEqual[A, -9e-68], t$95$0, If[LessEqual[A, -2e-129], t$95$1, If[LessEqual[A, 7.8e-17], t$95$0, If[LessEqual[A, 7.5e+178], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(B - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -2.6 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -9 \cdot 10^{-68}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -2 \cdot 10^{-129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq 7.8 \cdot 10^{-17}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 7.5 \cdot 10^{+178}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B - A}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.59999999999999984e62 or -8.99999999999999998e-68 < A < -1.9999999999999999e-129Initial program 22.7%
associate-*l/22.7%
*-lft-identity22.7%
+-commutative22.7%
unpow222.7%
unpow222.7%
hypot-def45.7%
Simplified45.7%
Taylor expanded in A around -inf 81.3%
if -2.59999999999999984e62 < A < -8.99999999999999998e-68 or -1.9999999999999999e-129 < A < 7.79999999999999979e-17Initial program 52.2%
associate-*l/52.2%
*-lft-identity52.2%
+-commutative52.2%
unpow252.2%
unpow252.2%
hypot-def78.0%
Simplified78.0%
Taylor expanded in B around inf 50.7%
neg-mul-150.7%
unsub-neg50.7%
Simplified50.7%
if 7.79999999999999979e-17 < A < 7.4999999999999995e178Initial program 65.0%
associate-*r/65.0%
associate-*l/65.0%
associate-*l/65.0%
*-lft-identity65.0%
sub-neg65.0%
associate-+l-65.0%
sub-neg65.0%
remove-double-neg65.0%
+-commutative65.0%
unpow265.0%
unpow265.0%
hypot-def88.9%
Simplified88.9%
Taylor expanded in B around -inf 76.9%
neg-mul-176.9%
unsub-neg76.9%
Simplified76.9%
Taylor expanded in C around 0 77.3%
if 7.4999999999999995e178 < A Initial program 89.3%
associate-*l/89.3%
*-lft-identity89.3%
+-commutative89.3%
unpow289.3%
unpow289.3%
hypot-def100.0%
Simplified100.0%
Taylor expanded in B around inf 98.0%
neg-mul-198.0%
unsub-neg98.0%
Simplified98.0%
Taylor expanded in C around 0 98.0%
associate-*r/98.0%
neg-mul-198.0%
distribute-neg-in98.0%
sub-neg98.0%
div-sub98.0%
distribute-frac-neg98.0%
*-inverses98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
unsub-neg98.0%
Simplified98.0%
Final simplification67.1%
(FPCore (A B C)
:precision binary64
(if (<= A -1.2e-297)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 3.8e-180)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 1.5e-69)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= A 1.1e-28)
(* 180.0 (/ (atan -1.0) PI))
(* 180.0 (/ (atan (/ (- A) B)) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.2e-297) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 3.8e-180) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 1.5e-69) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (A <= 1.1e-28) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.2e-297) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 3.8e-180) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 1.5e-69) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (A <= 1.1e-28) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.2e-297: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 3.8e-180: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 1.5e-69: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif A <= 1.1e-28: tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = 180.0 * (math.atan((-A / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.2e-297) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 3.8e-180) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 1.5e-69) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (A <= 1.1e-28) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.2e-297) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 3.8e-180) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 1.5e-69) tmp = 180.0 * (atan((C / B)) / pi); elseif (A <= 1.1e-28) tmp = 180.0 * (atan(-1.0) / pi); else tmp = 180.0 * (atan((-A / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.2e-297], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.8e-180], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.5e-69], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.1e-28], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.2 \cdot 10^{-297}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 3.8 \cdot 10^{-180}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 1.5 \cdot 10^{-69}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.1 \cdot 10^{-28}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.2e-297Initial program 34.7%
associate-*l/34.7%
*-lft-identity34.7%
+-commutative34.7%
unpow234.7%
unpow234.7%
hypot-def59.9%
Simplified59.9%
Taylor expanded in A around -inf 54.2%
if -1.2e-297 < A < 3.79999999999999999e-180Initial program 46.2%
associate-*l/46.2%
*-lft-identity46.2%
+-commutative46.2%
unpow246.2%
unpow246.2%
hypot-def76.9%
Simplified76.9%
Taylor expanded in B around -inf 33.6%
if 3.79999999999999999e-180 < A < 1.49999999999999995e-69Initial program 71.5%
associate-*l/71.5%
*-lft-identity71.5%
+-commutative71.5%
unpow271.5%
unpow271.5%
hypot-def81.9%
Simplified81.9%
Taylor expanded in B around inf 60.5%
neg-mul-160.5%
unsub-neg60.5%
Simplified60.5%
Taylor expanded in C around inf 40.7%
if 1.49999999999999995e-69 < A < 1.09999999999999998e-28Initial program 65.6%
associate-*l/65.6%
*-lft-identity65.6%
+-commutative65.6%
unpow265.6%
unpow265.6%
hypot-def100.0%
Simplified100.0%
Taylor expanded in B around inf 37.6%
if 1.09999999999999998e-28 < A Initial program 76.0%
associate-*l/76.0%
*-lft-identity76.0%
+-commutative76.0%
unpow276.0%
unpow276.0%
hypot-def93.9%
Simplified93.9%
Taylor expanded in B around inf 80.1%
neg-mul-180.1%
unsub-neg80.1%
Simplified80.1%
Taylor expanded in A around inf 70.3%
associate-*r/70.3%
mul-1-neg70.3%
Simplified70.3%
Final simplification53.4%
(FPCore (A B C)
:precision binary64
(if (<= B -3.1e-197)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 7.9e-168)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 6.4e+71)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(* 180.0 (/ (atan -1.0) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.1e-197) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 7.9e-168) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 6.4e+71) {
tmp = 180.0 * (atan((-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 <= -3.1e-197) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 7.9e-168) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 6.4e+71) {
tmp = 180.0 * (Math.atan((-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 <= -3.1e-197: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 7.9e-168: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 6.4e+71: tmp = 180.0 * (math.atan((-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 <= -3.1e-197) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 7.9e-168) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 6.4e+71) tmp = Float64(180.0 * Float64(atan(Float64(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 <= -3.1e-197) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 7.9e-168) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 6.4e+71) tmp = 180.0 * (atan((-A / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.1e-197], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.9e-168], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 6.4e+71], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.1 \cdot 10^{-197}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 7.9 \cdot 10^{-168}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 6.4 \cdot 10^{+71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.10000000000000029e-197Initial program 49.3%
associate-*l/49.3%
*-lft-identity49.3%
+-commutative49.3%
unpow249.3%
unpow249.3%
hypot-def71.0%
Simplified71.0%
Taylor expanded in B around -inf 39.4%
if -3.10000000000000029e-197 < B < 7.8999999999999999e-168Initial program 47.5%
associate-*l/47.5%
*-lft-identity47.5%
+-commutative47.5%
unpow247.5%
unpow247.5%
hypot-def76.9%
Simplified76.9%
Taylor expanded in C around inf 39.8%
distribute-rgt1-in39.8%
metadata-eval39.8%
mul0-lft39.8%
metadata-eval39.8%
Simplified39.8%
if 7.8999999999999999e-168 < B < 6.40000000000000046e71Initial program 71.3%
associate-*l/71.3%
*-lft-identity71.3%
+-commutative71.3%
unpow271.3%
unpow271.3%
hypot-def74.1%
Simplified74.1%
Taylor expanded in B around inf 70.2%
neg-mul-170.2%
unsub-neg70.2%
Simplified70.2%
Taylor expanded in A around inf 40.3%
associate-*r/40.3%
mul-1-neg40.3%
Simplified40.3%
if 6.40000000000000046e71 < B Initial program 37.6%
associate-*l/37.6%
*-lft-identity37.6%
+-commutative37.6%
unpow237.6%
unpow237.6%
hypot-def76.4%
Simplified76.4%
Taylor expanded in B around inf 68.9%
Final simplification45.7%
(FPCore (A B C)
:precision binary64
(if (<= B -3.1e-197)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 3.1e-158)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 4.5e+19)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.1e-197) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 3.1e-158) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 4.5e+19) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -3.1e-197) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 3.1e-158) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 4.5e+19) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.1e-197: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 3.1e-158: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 4.5e+19: tmp = 180.0 * (math.atan((C / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -3.1e-197) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 3.1e-158) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 4.5e+19) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -3.1e-197) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 3.1e-158) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 4.5e+19) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.1e-197], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.1e-158], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.5e+19], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.1 \cdot 10^{-197}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 3.1 \cdot 10^{-158}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{+19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.10000000000000029e-197Initial program 49.3%
associate-*l/49.3%
*-lft-identity49.3%
+-commutative49.3%
unpow249.3%
unpow249.3%
hypot-def71.0%
Simplified71.0%
Taylor expanded in B around -inf 39.4%
if -3.10000000000000029e-197 < B < 3.10000000000000018e-158Initial program 48.6%
associate-*l/48.6%
*-lft-identity48.6%
+-commutative48.6%
unpow248.6%
unpow248.6%
hypot-def77.4%
Simplified77.4%
Taylor expanded in C around inf 39.0%
distribute-rgt1-in39.0%
metadata-eval39.0%
mul0-lft39.0%
metadata-eval39.0%
Simplified39.0%
if 3.10000000000000018e-158 < B < 4.5e19Initial program 74.6%
associate-*l/74.6%
*-lft-identity74.6%
+-commutative74.6%
unpow274.6%
unpow274.6%
hypot-def78.0%
Simplified78.0%
Taylor expanded in B around inf 73.7%
neg-mul-173.7%
unsub-neg73.7%
Simplified73.7%
Taylor expanded in C around inf 45.9%
if 4.5e19 < B Initial program 39.5%
associate-*l/39.5%
*-lft-identity39.5%
+-commutative39.5%
unpow239.5%
unpow239.5%
hypot-def73.3%
Simplified73.3%
Taylor expanded in B around inf 62.0%
Final simplification45.7%
(FPCore (A B C)
:precision binary64
(if (<= B -3.1e-197)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4.4e-178)
(* 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 <= -3.1e-197) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4.4e-178) {
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 <= -3.1e-197) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4.4e-178) {
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 <= -3.1e-197: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4.4e-178: 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 <= -3.1e-197) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4.4e-178) 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 <= -3.1e-197) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4.4e-178) 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, -3.1e-197], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.4e-178], 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 -3.1 \cdot 10^{-197}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4.4 \cdot 10^{-178}:\\
\;\;\;\;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 < -3.10000000000000029e-197Initial program 49.3%
associate-*l/49.3%
*-lft-identity49.3%
+-commutative49.3%
unpow249.3%
unpow249.3%
hypot-def71.0%
Simplified71.0%
Taylor expanded in B around -inf 39.4%
if -3.10000000000000029e-197 < B < 4.4000000000000002e-178Initial program 49.5%
associate-*l/49.5%
*-lft-identity49.5%
+-commutative49.5%
unpow249.5%
unpow249.5%
hypot-def78.0%
Simplified78.0%
Taylor expanded in C around inf 41.4%
distribute-rgt1-in41.4%
metadata-eval41.4%
mul0-lft41.4%
metadata-eval41.4%
Simplified41.4%
if 4.4000000000000002e-178 < B Initial program 52.5%
associate-*l/52.5%
*-lft-identity52.5%
+-commutative52.5%
unpow252.5%
unpow252.5%
hypot-def74.9%
Simplified74.9%
Taylor expanded in B around inf 46.7%
Final simplification42.7%
(FPCore (A B C) :precision binary64 (if (<= A -1.3e-300) (* 180.0 (/ (atan (* 0.5 (/ B A))) PI)) (* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.3e-300) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.3e-300) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.3e-300: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.3e-300) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.3e-300) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.3e-300], 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[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.3 \cdot 10^{-300}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.29999999999999998e-300Initial program 34.4%
associate-*l/34.4%
*-lft-identity34.4%
+-commutative34.4%
unpow234.4%
unpow234.4%
hypot-def59.8%
Simplified59.8%
Taylor expanded in A around -inf 53.5%
if -1.29999999999999998e-300 < A Initial program 67.0%
associate-*l/67.0%
*-lft-identity67.0%
+-commutative67.0%
unpow267.0%
unpow267.0%
hypot-def87.9%
Simplified87.9%
Taylor expanded in B around inf 65.0%
neg-mul-165.0%
unsub-neg65.0%
Simplified65.0%
Taylor expanded in C around 0 57.6%
associate-*r/57.6%
neg-mul-157.6%
distribute-neg-in57.6%
sub-neg57.6%
div-sub57.6%
distribute-frac-neg57.6%
*-inverses57.6%
sub-neg57.6%
metadata-eval57.6%
+-commutative57.6%
unsub-neg57.6%
Simplified57.6%
Final simplification55.5%
(FPCore (A B C) :precision binary64 (if (<= B -9e-306) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -9e-306) {
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 <= -9e-306) {
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 <= -9e-306: 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 <= -9e-306) 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 <= -9e-306) 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, -9e-306], 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 -9 \cdot 10^{-306}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -9.00000000000000009e-306Initial program 49.8%
associate-*l/49.8%
*-lft-identity49.8%
+-commutative49.8%
unpow249.8%
unpow249.8%
hypot-def71.3%
Simplified71.3%
Taylor expanded in B around -inf 34.0%
if -9.00000000000000009e-306 < B Initial program 51.5%
associate-*l/51.5%
*-lft-identity51.5%
+-commutative51.5%
unpow251.5%
unpow251.5%
hypot-def76.3%
Simplified76.3%
Taylor expanded in B around inf 40.8%
Final simplification37.3%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 50.6%
associate-*l/50.6%
*-lft-identity50.6%
+-commutative50.6%
unpow250.6%
unpow250.6%
hypot-def73.8%
Simplified73.8%
Taylor expanded in B around inf 20.8%
Final simplification20.8%
herbie shell --seed 2023238
(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)))