
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C)
:precision binary64
(if (<= A -4.8e+154)
(/ (* 180.0 (atan (* B (/ 0.5 A)))) PI)
(if (or (<= A -2.4e-245) (not (<= A -9.5e-269)))
(* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.8e+154) {
tmp = (180.0 * atan((B * (0.5 / A)))) / ((double) M_PI);
} else if ((A <= -2.4e-245) || !(A <= -9.5e-269)) {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -4.8e+154) {
tmp = (180.0 * Math.atan((B * (0.5 / A)))) / Math.PI;
} else if ((A <= -2.4e-245) || !(A <= -9.5e-269)) {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -4.8e+154: tmp = (180.0 * math.atan((B * (0.5 / A)))) / math.pi elif (A <= -2.4e-245) or not (A <= -9.5e-269): tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) else: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -4.8e+154) tmp = Float64(Float64(180.0 * atan(Float64(B * Float64(0.5 / A)))) / pi); elseif ((A <= -2.4e-245) || !(A <= -9.5e-269)) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -4.8e+154) tmp = (180.0 * atan((B * (0.5 / A)))) / pi; elseif ((A <= -2.4e-245) || ~((A <= -9.5e-269))) tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); else tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -4.8e+154], N[(N[(180.0 * N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[Or[LessEqual[A, -2.4e-245], N[Not[LessEqual[A, -9.5e-269]], $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], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.8 \cdot 10^{+154}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.4 \cdot 10^{-245} \lor \neg \left(A \leq -9.5 \cdot 10^{-269}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.8000000000000003e154Initial program 13.2%
associate-*l/13.2%
*-lft-identity13.2%
+-commutative13.2%
unpow213.2%
unpow213.2%
hypot-define57.7%
Simplified57.7%
clear-num57.7%
un-div-inv57.7%
hypot-undefine13.2%
unpow213.2%
unpow213.2%
+-commutative13.2%
unpow213.2%
unpow213.2%
hypot-define57.7%
Applied egg-rr57.7%
associate-/r/57.7%
sub-neg57.7%
associate-+l-24.1%
sub-neg24.1%
remove-double-neg24.1%
hypot-undefine13.2%
unpow213.2%
unpow213.2%
+-commutative13.2%
unpow213.2%
unpow213.2%
hypot-undefine24.1%
Simplified24.1%
Taylor expanded in C around 0 13.2%
mul-1-neg13.2%
distribute-neg-in13.2%
unsub-neg13.2%
unpow213.2%
unpow213.2%
hypot-define50.4%
Simplified50.4%
Taylor expanded in A around -inf 78.8%
associate-*r/78.8%
*-commutative78.8%
associate-/l*78.7%
Simplified78.7%
associate-*l/78.8%
Applied egg-rr78.8%
if -4.8000000000000003e154 < A < -2.4e-245 or -9.5000000000000006e-269 < A Initial program 62.9%
Simplified84.7%
if -2.4e-245 < A < -9.5000000000000006e-269Initial program 25.8%
Taylor expanded in C around inf 79.5%
Taylor expanded in A around inf 79.5%
associate-*r/79.5%
*-commutative79.5%
associate-/l*79.7%
Simplified79.7%
Final simplification83.7%
(FPCore (A B C)
:precision binary64
(if (<= C -7.8e+42)
(* (/ 180.0 PI) (atan (/ (- (+ C B) A) B)))
(if (<= C 2.05e+159)
(* 180.0 (/ (atan (/ (+ A (hypot B A)) (- B))) PI))
(/ 1.0 (* 0.005555555555555556 (/ PI (atan (* B (/ -0.5 C)))))))))
double code(double A, double B, double C) {
double tmp;
if (C <= -7.8e+42) {
tmp = (180.0 / ((double) M_PI)) * atan((((C + B) - A) / B));
} else if (C <= 2.05e+159) {
tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / ((double) M_PI));
} else {
tmp = 1.0 / (0.005555555555555556 * (((double) M_PI) / atan((B * (-0.5 / C)))));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -7.8e+42) {
tmp = (180.0 / Math.PI) * Math.atan((((C + B) - A) / B));
} else if (C <= 2.05e+159) {
tmp = 180.0 * (Math.atan(((A + Math.hypot(B, A)) / -B)) / Math.PI);
} else {
tmp = 1.0 / (0.005555555555555556 * (Math.PI / Math.atan((B * (-0.5 / C)))));
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -7.8e+42: tmp = (180.0 / math.pi) * math.atan((((C + B) - A) / B)) elif C <= 2.05e+159: tmp = 180.0 * (math.atan(((A + math.hypot(B, A)) / -B)) / math.pi) else: tmp = 1.0 / (0.005555555555555556 * (math.pi / math.atan((B * (-0.5 / C))))) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -7.8e+42) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(Float64(C + B) - A) / B))); elseif (C <= 2.05e+159) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) / Float64(-B))) / pi)); else tmp = Float64(1.0 / Float64(0.005555555555555556 * Float64(pi / atan(Float64(B * Float64(-0.5 / C)))))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -7.8e+42) tmp = (180.0 / pi) * atan((((C + B) - A) / B)); elseif (C <= 2.05e+159) tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / pi); else tmp = 1.0 / (0.005555555555555556 * (pi / atan((B * (-0.5 / C))))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -7.8e+42], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.05e+159], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(0.005555555555555556 * N[(Pi / N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -7.8 \cdot 10^{+42}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{\left(C + B\right) - A}{B}\right)\\
\mathbf{elif}\;C \leq 2.05 \cdot 10^{+159}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{0.005555555555555556 \cdot \frac{\pi}{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}}\\
\end{array}
\end{array}
if C < -7.79999999999999939e42Initial program 83.3%
associate-*l/83.3%
*-lft-identity83.3%
+-commutative83.3%
unpow283.3%
unpow283.3%
hypot-define95.1%
Simplified95.1%
clear-num95.1%
un-div-inv95.1%
hypot-undefine83.3%
unpow283.3%
unpow283.3%
+-commutative83.3%
unpow283.3%
unpow283.3%
hypot-define95.1%
Applied egg-rr95.1%
associate-/r/95.1%
sub-neg95.1%
associate-+l-91.7%
sub-neg91.7%
remove-double-neg91.7%
hypot-undefine83.3%
unpow283.3%
unpow283.3%
+-commutative83.3%
unpow283.3%
unpow283.3%
hypot-undefine91.7%
Simplified91.7%
Taylor expanded in B around -inf 85.6%
if -7.79999999999999939e42 < C < 2.05000000000000007e159Initial program 51.8%
Taylor expanded in C around 0 48.4%
mul-1-neg48.4%
distribute-neg-frac248.4%
+-commutative48.4%
unpow248.4%
unpow248.4%
hypot-define74.9%
Simplified74.9%
if 2.05000000000000007e159 < C Initial program 8.7%
Taylor expanded in C around inf 88.8%
Taylor expanded in A around inf 88.8%
associate-*r/88.9%
Simplified88.9%
clear-num88.9%
inv-pow88.9%
*-un-lft-identity88.9%
times-frac89.0%
metadata-eval89.0%
Applied egg-rr89.0%
unpow-189.0%
*-commutative89.0%
associate-*l/89.0%
associate-*r/89.0%
Simplified89.0%
Final simplification78.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (+ A (hypot B A))))
(if (<= C -1.3e-77)
(* 180.0 (/ (atan (/ (- C t_0) B)) PI))
(if (<= C 3.6e+159)
(* 180.0 (/ (atan (/ t_0 (- B))) PI))
(/ 1.0 (* 0.005555555555555556 (/ PI (atan (* B (/ -0.5 C))))))))))
double code(double A, double B, double C) {
double t_0 = A + hypot(B, A);
double tmp;
if (C <= -1.3e-77) {
tmp = 180.0 * (atan(((C - t_0) / B)) / ((double) M_PI));
} else if (C <= 3.6e+159) {
tmp = 180.0 * (atan((t_0 / -B)) / ((double) M_PI));
} else {
tmp = 1.0 / (0.005555555555555556 * (((double) M_PI) / atan((B * (-0.5 / C)))));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = A + Math.hypot(B, A);
double tmp;
if (C <= -1.3e-77) {
tmp = 180.0 * (Math.atan(((C - t_0) / B)) / Math.PI);
} else if (C <= 3.6e+159) {
tmp = 180.0 * (Math.atan((t_0 / -B)) / Math.PI);
} else {
tmp = 1.0 / (0.005555555555555556 * (Math.PI / Math.atan((B * (-0.5 / C)))));
}
return tmp;
}
def code(A, B, C): t_0 = A + math.hypot(B, A) tmp = 0 if C <= -1.3e-77: tmp = 180.0 * (math.atan(((C - t_0) / B)) / math.pi) elif C <= 3.6e+159: tmp = 180.0 * (math.atan((t_0 / -B)) / math.pi) else: tmp = 1.0 / (0.005555555555555556 * (math.pi / math.atan((B * (-0.5 / C))))) return tmp
function code(A, B, C) t_0 = Float64(A + hypot(B, A)) tmp = 0.0 if (C <= -1.3e-77) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - t_0) / B)) / pi)); elseif (C <= 3.6e+159) tmp = Float64(180.0 * Float64(atan(Float64(t_0 / Float64(-B))) / pi)); else tmp = Float64(1.0 / Float64(0.005555555555555556 * Float64(pi / atan(Float64(B * Float64(-0.5 / C)))))); end return tmp end
function tmp_2 = code(A, B, C) t_0 = A + hypot(B, A); tmp = 0.0; if (C <= -1.3e-77) tmp = 180.0 * (atan(((C - t_0) / B)) / pi); elseif (C <= 3.6e+159) tmp = 180.0 * (atan((t_0 / -B)) / pi); else tmp = 1.0 / (0.005555555555555556 * (pi / atan((B * (-0.5 / C))))); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.3e-77], N[(180.0 * N[(N[ArcTan[N[(N[(C - t$95$0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 3.6e+159], N[(180.0 * N[(N[ArcTan[N[(t$95$0 / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(0.005555555555555556 * N[(Pi / N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := A + \mathsf{hypot}\left(B, A\right)\\
\mathbf{if}\;C \leq -1.3 \cdot 10^{-77}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - t\_0}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 3.6 \cdot 10^{+159}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{t\_0}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{0.005555555555555556 \cdot \frac{\pi}{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}}\\
\end{array}
\end{array}
if C < -1.3000000000000001e-77Initial program 74.3%
Simplified85.2%
Taylor expanded in C around 0 73.3%
+-commutative73.3%
unpow273.3%
unpow273.3%
hypot-define84.9%
Simplified84.9%
if -1.3000000000000001e-77 < C < 3.60000000000000037e159Initial program 51.4%
Taylor expanded in C around 0 49.2%
mul-1-neg49.2%
distribute-neg-frac249.2%
+-commutative49.2%
unpow249.2%
unpow249.2%
hypot-define76.9%
Simplified76.9%
if 3.60000000000000037e159 < C Initial program 8.7%
Taylor expanded in C around inf 88.8%
Taylor expanded in A around inf 88.8%
associate-*r/88.9%
Simplified88.9%
clear-num88.9%
inv-pow88.9%
*-un-lft-identity88.9%
times-frac89.0%
metadata-eval89.0%
Applied egg-rr89.0%
unpow-189.0%
*-commutative89.0%
associate-*l/89.0%
associate-*r/89.0%
Simplified89.0%
Final simplification80.9%
(FPCore (A B C) :precision binary64 (if (<= C 5.1e+159) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI)) (/ 1.0 (* 0.005555555555555556 (/ PI (atan (* B (/ -0.5 C))))))))
double code(double A, double B, double C) {
double tmp;
if (C <= 5.1e+159) {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
} else {
tmp = 1.0 / (0.005555555555555556 * (((double) M_PI) / atan((B * (-0.5 / C)))));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 5.1e+159) {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
} else {
tmp = 1.0 / (0.005555555555555556 * (Math.PI / Math.atan((B * (-0.5 / C)))));
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 5.1e+159: tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi) else: tmp = 1.0 / (0.005555555555555556 * (math.pi / math.atan((B * (-0.5 / C))))) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 5.1e+159) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); else tmp = Float64(1.0 / Float64(0.005555555555555556 * Float64(pi / atan(Float64(B * Float64(-0.5 / C)))))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 5.1e+159) tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); else tmp = 1.0 / (0.005555555555555556 * (pi / atan((B * (-0.5 / C))))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 5.1e+159], 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], N[(1.0 / N[(0.005555555555555556 * N[(Pi / N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 5.1 \cdot 10^{+159}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{0.005555555555555556 \cdot \frac{\pi}{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}}\\
\end{array}
\end{array}
if C < 5.09999999999999967e159Initial program 59.8%
associate-*l/59.8%
*-lft-identity59.8%
+-commutative59.8%
unpow259.8%
unpow259.8%
hypot-define82.4%
Simplified82.4%
if 5.09999999999999967e159 < C Initial program 8.7%
Taylor expanded in C around inf 88.8%
Taylor expanded in A around inf 88.8%
associate-*r/88.9%
Simplified88.9%
clear-num88.9%
inv-pow88.9%
*-un-lft-identity88.9%
times-frac89.0%
metadata-eval89.0%
Applied egg-rr89.0%
unpow-189.0%
*-commutative89.0%
associate-*l/89.0%
associate-*r/89.0%
Simplified89.0%
Final simplification83.1%
(FPCore (A B C)
:precision binary64
(if (<= C -3.1e-26)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (or (<= C 1.32e+76) (and (not (<= C 1.15e+103)) (<= C 2.3e+159)))
(* (/ 180.0 PI) (atan (- 1.0 (/ A B))))
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -3.1e-26) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if ((C <= 1.32e+76) || (!(C <= 1.15e+103) && (C <= 2.3e+159))) {
tmp = (180.0 / ((double) M_PI)) * atan((1.0 - (A / B)));
} else {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -3.1e-26) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if ((C <= 1.32e+76) || (!(C <= 1.15e+103) && (C <= 2.3e+159))) {
tmp = (180.0 / Math.PI) * Math.atan((1.0 - (A / B)));
} else {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -3.1e-26: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif (C <= 1.32e+76) or (not (C <= 1.15e+103) and (C <= 2.3e+159)): tmp = (180.0 / math.pi) * math.atan((1.0 - (A / B))) else: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -3.1e-26) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif ((C <= 1.32e+76) || (!(C <= 1.15e+103) && (C <= 2.3e+159))) tmp = Float64(Float64(180.0 / pi) * atan(Float64(1.0 - Float64(A / B)))); else tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -3.1e-26) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif ((C <= 1.32e+76) || (~((C <= 1.15e+103)) && (C <= 2.3e+159))) tmp = (180.0 / pi) * atan((1.0 - (A / B))); else tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -3.1e-26], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[C, 1.32e+76], And[N[Not[LessEqual[C, 1.15e+103]], $MachinePrecision], LessEqual[C, 2.3e+159]]], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -3.1 \cdot 10^{-26}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.32 \cdot 10^{+76} \lor \neg \left(C \leq 1.15 \cdot 10^{+103}\right) \land C \leq 2.3 \cdot 10^{+159}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -3.09999999999999983e-26Initial program 77.8%
Taylor expanded in C around -inf 73.6%
associate-*r/73.6%
Simplified73.6%
if -3.09999999999999983e-26 < C < 1.31999999999999999e76 or 1.15000000000000004e103 < C < 2.29999999999999995e159Initial program 53.7%
associate-*l/53.7%
*-lft-identity53.7%
+-commutative53.7%
unpow253.7%
unpow253.7%
hypot-define80.6%
Simplified80.6%
clear-num80.6%
un-div-inv80.6%
hypot-undefine53.7%
unpow253.7%
unpow253.7%
+-commutative53.7%
unpow253.7%
unpow253.7%
hypot-define80.6%
Applied egg-rr80.6%
associate-/r/80.6%
sub-neg80.6%
associate-+l-74.3%
sub-neg74.3%
remove-double-neg74.3%
hypot-undefine52.5%
unpow252.5%
unpow252.5%
+-commutative52.5%
unpow252.5%
unpow252.5%
hypot-undefine74.3%
Simplified74.3%
Taylor expanded in C around 0 50.4%
mul-1-neg50.4%
distribute-neg-in50.4%
unsub-neg50.4%
unpow250.4%
unpow250.4%
hypot-define77.5%
Simplified77.5%
Taylor expanded in B around -inf 55.0%
mul-1-neg55.0%
unsub-neg55.0%
Simplified55.0%
if 1.31999999999999999e76 < C < 1.15000000000000004e103 or 2.29999999999999995e159 < C Initial program 10.9%
Taylor expanded in C around inf 86.1%
Taylor expanded in A around inf 86.1%
associate-*r/86.1%
*-commutative86.1%
associate-/l*86.1%
Simplified86.1%
Final simplification64.2%
(FPCore (A B C)
:precision binary64
(if (<= C -7e-76)
(* (/ 180.0 PI) (atan (/ (- C B) B)))
(if (or (<= C 2.75e+76) (and (not (<= C 6.6e+102)) (<= C 1.8e+159)))
(* (/ 180.0 PI) (atan (- 1.0 (/ A B))))
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -7e-76) {
tmp = (180.0 / ((double) M_PI)) * atan(((C - B) / B));
} else if ((C <= 2.75e+76) || (!(C <= 6.6e+102) && (C <= 1.8e+159))) {
tmp = (180.0 / ((double) M_PI)) * atan((1.0 - (A / B)));
} else {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -7e-76) {
tmp = (180.0 / Math.PI) * Math.atan(((C - B) / B));
} else if ((C <= 2.75e+76) || (!(C <= 6.6e+102) && (C <= 1.8e+159))) {
tmp = (180.0 / Math.PI) * Math.atan((1.0 - (A / B)));
} else {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -7e-76: tmp = (180.0 / math.pi) * math.atan(((C - B) / B)) elif (C <= 2.75e+76) or (not (C <= 6.6e+102) and (C <= 1.8e+159)): tmp = (180.0 / math.pi) * math.atan((1.0 - (A / B))) else: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -7e-76) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - B) / B))); elseif ((C <= 2.75e+76) || (!(C <= 6.6e+102) && (C <= 1.8e+159))) tmp = Float64(Float64(180.0 / pi) * atan(Float64(1.0 - Float64(A / B)))); else tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -7e-76) tmp = (180.0 / pi) * atan(((C - B) / B)); elseif ((C <= 2.75e+76) || (~((C <= 6.6e+102)) && (C <= 1.8e+159))) tmp = (180.0 / pi) * atan((1.0 - (A / B))); else tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -7e-76], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[C, 2.75e+76], And[N[Not[LessEqual[C, 6.6e+102]], $MachinePrecision], LessEqual[C, 1.8e+159]]], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -7 \cdot 10^{-76}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\
\mathbf{elif}\;C \leq 2.75 \cdot 10^{+76} \lor \neg \left(C \leq 6.6 \cdot 10^{+102}\right) \land C \leq 1.8 \cdot 10^{+159}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -6.99999999999999995e-76Initial program 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-define88.0%
Simplified88.0%
clear-num88.0%
un-div-inv88.0%
hypot-undefine74.4%
unpow274.4%
unpow274.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-define88.0%
Applied egg-rr88.0%
associate-/r/88.0%
sub-neg88.0%
associate-+l-84.6%
sub-neg84.6%
remove-double-neg84.6%
hypot-undefine73.6%
unpow273.6%
unpow273.6%
+-commutative73.6%
unpow273.6%
unpow273.6%
hypot-undefine84.6%
Simplified84.6%
Taylor expanded in C around 0 73.3%
+-commutative73.3%
unpow273.3%
unpow273.3%
hypot-define84.3%
Simplified84.3%
Taylor expanded in A around 0 74.8%
if -6.99999999999999995e-76 < C < 2.75e76 or 6.59999999999999997e102 < C < 1.80000000000000018e159Initial program 53.4%
associate-*l/53.4%
*-lft-identity53.4%
+-commutative53.4%
unpow253.4%
unpow253.4%
hypot-define81.0%
Simplified81.0%
clear-num81.0%
un-div-inv81.0%
hypot-undefine53.4%
unpow253.4%
unpow253.4%
+-commutative53.4%
unpow253.4%
unpow253.4%
hypot-define81.0%
Applied egg-rr81.0%
associate-/r/81.0%
sub-neg81.0%
associate-+l-74.7%
sub-neg74.7%
remove-double-neg74.7%
hypot-undefine52.6%
unpow252.6%
unpow252.6%
+-commutative52.6%
unpow252.6%
unpow252.6%
hypot-undefine74.7%
Simplified74.7%
Taylor expanded in C around 0 50.5%
mul-1-neg50.5%
distribute-neg-in50.5%
unsub-neg50.5%
unpow250.5%
unpow250.5%
hypot-define78.4%
Simplified78.4%
Taylor expanded in B around -inf 57.1%
mul-1-neg57.1%
unsub-neg57.1%
Simplified57.1%
if 2.75e76 < C < 6.59999999999999997e102 or 1.80000000000000018e159 < C Initial program 10.9%
Taylor expanded in C around inf 86.1%
Taylor expanded in A around inf 86.1%
associate-*r/86.1%
*-commutative86.1%
associate-/l*86.1%
Simplified86.1%
Final simplification66.7%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* (/ 180.0 PI) (atan (- 1.0 (/ A B))))))
(if (<= C -1.05e-75)
(* (/ 180.0 PI) (atan (/ (- C B) B)))
(if (<= C 3.25e+78)
t_0
(if (<= C 3.65e+102)
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI))
(if (<= C 1.8e+159) t_0 (/ (* 180.0 (atan (* -0.5 (/ B C)))) PI)))))))
double code(double A, double B, double C) {
double t_0 = (180.0 / ((double) M_PI)) * atan((1.0 - (A / B)));
double tmp;
if (C <= -1.05e-75) {
tmp = (180.0 / ((double) M_PI)) * atan(((C - B) / B));
} else if (C <= 3.25e+78) {
tmp = t_0;
} else if (C <= 3.65e+102) {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
} else if (C <= 1.8e+159) {
tmp = t_0;
} else {
tmp = (180.0 * atan((-0.5 * (B / C)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (180.0 / Math.PI) * Math.atan((1.0 - (A / B)));
double tmp;
if (C <= -1.05e-75) {
tmp = (180.0 / Math.PI) * Math.atan(((C - B) / B));
} else if (C <= 3.25e+78) {
tmp = t_0;
} else if (C <= 3.65e+102) {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
} else if (C <= 1.8e+159) {
tmp = t_0;
} else {
tmp = (180.0 * Math.atan((-0.5 * (B / C)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = (180.0 / math.pi) * math.atan((1.0 - (A / B))) tmp = 0 if C <= -1.05e-75: tmp = (180.0 / math.pi) * math.atan(((C - B) / B)) elif C <= 3.25e+78: tmp = t_0 elif C <= 3.65e+102: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi) elif C <= 1.8e+159: tmp = t_0 else: tmp = (180.0 * math.atan((-0.5 * (B / C)))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(Float64(180.0 / pi) * atan(Float64(1.0 - Float64(A / B)))) tmp = 0.0 if (C <= -1.05e-75) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C - B) / B))); elseif (C <= 3.25e+78) tmp = t_0; elseif (C <= 3.65e+102) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); elseif (C <= 1.8e+159) tmp = t_0; else tmp = Float64(Float64(180.0 * atan(Float64(-0.5 * Float64(B / C)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (180.0 / pi) * atan((1.0 - (A / B))); tmp = 0.0; if (C <= -1.05e-75) tmp = (180.0 / pi) * atan(((C - B) / B)); elseif (C <= 3.25e+78) tmp = t_0; elseif (C <= 3.65e+102) tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); elseif (C <= 1.8e+159) tmp = t_0; else tmp = (180.0 * atan((-0.5 * (B / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.05e-75], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 3.25e+78], t$95$0, If[LessEqual[C, 3.65e+102], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.8e+159], t$95$0, N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\
\mathbf{if}\;C \leq -1.05 \cdot 10^{-75}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\
\mathbf{elif}\;C \leq 3.25 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;C \leq 3.65 \cdot 10^{+102}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.8 \cdot 10^{+159}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.0500000000000001e-75Initial program 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-define88.0%
Simplified88.0%
clear-num88.0%
un-div-inv88.0%
hypot-undefine74.4%
unpow274.4%
unpow274.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-define88.0%
Applied egg-rr88.0%
associate-/r/88.0%
sub-neg88.0%
associate-+l-84.6%
sub-neg84.6%
remove-double-neg84.6%
hypot-undefine73.6%
unpow273.6%
unpow273.6%
+-commutative73.6%
unpow273.6%
unpow273.6%
hypot-undefine84.6%
Simplified84.6%
Taylor expanded in C around 0 73.3%
+-commutative73.3%
unpow273.3%
unpow273.3%
hypot-define84.3%
Simplified84.3%
Taylor expanded in A around 0 74.8%
if -1.0500000000000001e-75 < C < 3.25000000000000018e78 or 3.64999999999999995e102 < C < 1.80000000000000018e159Initial program 53.4%
associate-*l/53.4%
*-lft-identity53.4%
+-commutative53.4%
unpow253.4%
unpow253.4%
hypot-define81.0%
Simplified81.0%
clear-num81.0%
un-div-inv81.0%
hypot-undefine53.4%
unpow253.4%
unpow253.4%
+-commutative53.4%
unpow253.4%
unpow253.4%
hypot-define81.0%
Applied egg-rr81.0%
associate-/r/81.0%
sub-neg81.0%
associate-+l-74.7%
sub-neg74.7%
remove-double-neg74.7%
hypot-undefine52.6%
unpow252.6%
unpow252.6%
+-commutative52.6%
unpow252.6%
unpow252.6%
hypot-undefine74.7%
Simplified74.7%
Taylor expanded in C around 0 50.5%
mul-1-neg50.5%
distribute-neg-in50.5%
unsub-neg50.5%
unpow250.5%
unpow250.5%
hypot-define78.4%
Simplified78.4%
Taylor expanded in B around -inf 57.1%
mul-1-neg57.1%
unsub-neg57.1%
Simplified57.1%
if 3.25000000000000018e78 < C < 3.64999999999999995e102Initial program 20.0%
Taylor expanded in C around inf 75.2%
Taylor expanded in A around inf 75.2%
associate-*r/75.2%
*-commutative75.2%
associate-/l*75.2%
Simplified75.2%
if 1.80000000000000018e159 < C Initial program 8.7%
Taylor expanded in C around inf 88.8%
Taylor expanded in A around inf 88.8%
associate-*r/88.9%
Simplified88.9%
Final simplification66.7%
(FPCore (A B C)
:precision binary64
(if (<= C -4.4e+25)
(* (/ 180.0 PI) (atan (/ C B)))
(if (<= C -5.5e-203)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= C 4e-85)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (C <= -4.4e+25) {
tmp = (180.0 / ((double) M_PI)) * atan((C / B));
} else if (C <= -5.5e-203) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (C <= 4e-85) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -4.4e+25) {
tmp = (180.0 / Math.PI) * Math.atan((C / B));
} else if (C <= -5.5e-203) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (C <= 4e-85) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -4.4e+25: tmp = (180.0 / math.pi) * math.atan((C / B)) elif C <= -5.5e-203: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif C <= 4e-85: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -4.4e+25) tmp = Float64(Float64(180.0 / pi) * atan(Float64(C / B))); elseif (C <= -5.5e-203) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (C <= 4e-85) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -4.4e+25) tmp = (180.0 / pi) * atan((C / B)); elseif (C <= -5.5e-203) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (C <= 4e-85) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -4.4e+25], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -5.5e-203], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 4e-85], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.4 \cdot 10^{+25}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\
\mathbf{elif}\;C \leq -5.5 \cdot 10^{-203}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;C \leq 4 \cdot 10^{-85}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -4.4000000000000001e25Initial program 83.6%
associate-*l/83.6%
*-lft-identity83.6%
+-commutative83.6%
unpow283.6%
unpow283.6%
hypot-define95.2%
Simplified95.2%
clear-num95.2%
un-div-inv95.2%
hypot-undefine83.6%
unpow283.6%
unpow283.6%
+-commutative83.6%
unpow283.6%
unpow283.6%
hypot-define95.2%
Applied egg-rr95.2%
associate-/r/95.2%
sub-neg95.2%
associate-+l-91.8%
sub-neg91.8%
remove-double-neg91.8%
hypot-undefine83.6%
unpow283.6%
unpow283.6%
+-commutative83.6%
unpow283.6%
unpow283.6%
hypot-undefine91.8%
Simplified91.8%
Taylor expanded in C around 0 83.2%
+-commutative83.2%
unpow283.2%
unpow283.2%
hypot-define91.4%
Simplified91.4%
Taylor expanded in C around inf 80.8%
if -4.4000000000000001e25 < C < -5.5000000000000002e-203Initial program 59.7%
Taylor expanded in A around -inf 38.9%
associate-*r/38.9%
Simplified38.9%
if -5.5000000000000002e-203 < C < 3.9999999999999999e-85Initial program 48.1%
Taylor expanded in B around -inf 42.0%
if 3.9999999999999999e-85 < C Initial program 32.6%
Taylor expanded in C around inf 60.2%
Taylor expanded in A around inf 60.2%
associate-*r/60.2%
*-commutative60.2%
associate-/l*60.2%
Simplified60.2%
Final simplification55.3%
(FPCore (A B C)
:precision binary64
(if (<= C -5.5e+24)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= C -7e-203)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= C 3.8e-83)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (C <= -5.5e+24) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (C <= -7e-203) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (C <= 3.8e-83) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -5.5e+24) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (C <= -7e-203) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (C <= 3.8e-83) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -5.5e+24: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif C <= -7e-203: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif C <= 3.8e-83: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -5.5e+24) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (C <= -7e-203) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (C <= 3.8e-83) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -5.5e+24) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (C <= -7e-203) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (C <= 3.8e-83) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -5.5e+24], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -7e-203], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 3.8e-83], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -5.5 \cdot 10^{+24}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -7 \cdot 10^{-203}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;C \leq 3.8 \cdot 10^{-83}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -5.5000000000000002e24Initial program 83.6%
Taylor expanded in C around -inf 80.8%
associate-*r/80.8%
Simplified80.8%
if -5.5000000000000002e24 < C < -7.0000000000000003e-203Initial program 59.7%
Taylor expanded in A around -inf 38.9%
associate-*r/38.9%
Simplified38.9%
if -7.0000000000000003e-203 < C < 3.79999999999999977e-83Initial program 48.1%
Taylor expanded in B around -inf 42.0%
if 3.79999999999999977e-83 < C Initial program 32.6%
Taylor expanded in C around inf 60.2%
Taylor expanded in A around inf 60.2%
associate-*r/60.2%
*-commutative60.2%
associate-/l*60.2%
Simplified60.2%
Final simplification55.3%
(FPCore (A B C)
:precision binary64
(if (<= C -4.4e+25)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= C -6.4e-203)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= C 2.5e-84)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (C <= -4.4e+25) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (C <= -6.4e-203) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (C <= 2.5e-84) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -4.4e+25) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (C <= -6.4e-203) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (C <= 2.5e-84) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -4.4e+25: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif C <= -6.4e-203: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif C <= 2.5e-84: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -4.4e+25) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (C <= -6.4e-203) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (C <= 2.5e-84) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -4.4e+25) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (C <= -6.4e-203) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (C <= 2.5e-84) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -4.4e+25], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -6.4e-203], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.5e-84], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.4 \cdot 10^{+25}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -6.4 \cdot 10^{-203}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;C \leq 2.5 \cdot 10^{-84}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -4.4000000000000001e25Initial program 83.6%
Taylor expanded in C around -inf 80.8%
associate-*r/80.8%
Simplified80.8%
if -4.4000000000000001e25 < C < -6.40000000000000001e-203Initial program 59.7%
associate-*l/59.7%
*-lft-identity59.7%
+-commutative59.7%
unpow259.7%
unpow259.7%
hypot-define75.6%
Simplified75.6%
clear-num75.6%
un-div-inv75.6%
hypot-undefine59.7%
unpow259.7%
unpow259.7%
+-commutative59.7%
unpow259.7%
unpow259.7%
hypot-define75.6%
Applied egg-rr75.6%
associate-/r/75.6%
sub-neg75.6%
associate-+l-68.3%
sub-neg68.3%
remove-double-neg68.3%
hypot-undefine56.4%
unpow256.4%
unpow256.4%
+-commutative56.4%
unpow256.4%
unpow256.4%
hypot-undefine68.3%
Simplified68.3%
Taylor expanded in C around 0 52.0%
mul-1-neg52.0%
distribute-neg-in52.0%
unsub-neg52.0%
unpow252.0%
unpow252.0%
hypot-define68.2%
Simplified68.2%
Taylor expanded in A around -inf 39.0%
if -6.40000000000000001e-203 < C < 2.5000000000000001e-84Initial program 48.1%
Taylor expanded in B around -inf 42.0%
if 2.5000000000000001e-84 < C Initial program 32.6%
Taylor expanded in C around inf 60.2%
Taylor expanded in A around inf 60.2%
associate-*r/60.2%
*-commutative60.2%
associate-/l*60.2%
Simplified60.2%
Final simplification55.4%
(FPCore (A B C)
:precision binary64
(if (<= C -4.2e-26)
(* (/ 180.0 PI) (atan (/ C B)))
(if (<= C 6.6e-85)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -4.2e-26) {
tmp = (180.0 / ((double) M_PI)) * atan((C / B));
} else if (C <= 6.6e-85) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -4.2e-26) {
tmp = (180.0 / Math.PI) * Math.atan((C / B));
} else if (C <= 6.6e-85) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -4.2e-26: tmp = (180.0 / math.pi) * math.atan((C / B)) elif C <= 6.6e-85: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -4.2e-26) tmp = Float64(Float64(180.0 / pi) * atan(Float64(C / B))); elseif (C <= 6.6e-85) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -4.2e-26) tmp = (180.0 / pi) * atan((C / B)); elseif (C <= 6.6e-85) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -4.2e-26], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.6e-85], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.2 \cdot 10^{-26}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\
\mathbf{elif}\;C \leq 6.6 \cdot 10^{-85}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -4.20000000000000016e-26Initial program 77.8%
associate-*l/77.8%
*-lft-identity77.8%
+-commutative77.8%
unpow277.8%
unpow277.8%
hypot-define90.3%
Simplified90.3%
clear-num90.3%
un-div-inv90.3%
hypot-undefine77.8%
unpow277.8%
unpow277.8%
+-commutative77.8%
unpow277.8%
unpow277.8%
hypot-define90.3%
Applied egg-rr90.3%
associate-/r/90.3%
sub-neg90.3%
associate-+l-87.3%
sub-neg87.3%
remove-double-neg87.3%
hypot-undefine77.8%
unpow277.8%
unpow277.8%
+-commutative77.8%
unpow277.8%
unpow277.8%
hypot-undefine87.3%
Simplified87.3%
Taylor expanded in C around 0 77.4%
+-commutative77.4%
unpow277.4%
unpow277.4%
hypot-define87.0%
Simplified87.0%
Taylor expanded in C around inf 73.6%
if -4.20000000000000016e-26 < C < 6.59999999999999945e-85Initial program 53.5%
Taylor expanded in B around -inf 38.1%
if 6.59999999999999945e-85 < C Initial program 32.6%
Taylor expanded in C around inf 60.2%
Taylor expanded in A around inf 60.2%
associate-*r/60.2%
*-commutative60.2%
associate-/l*60.2%
Simplified60.2%
Final simplification53.6%
(FPCore (A B C)
:precision binary64
(if (<= B -1.32e-145)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 9.5e-118)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.32e-145) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 9.5e-118) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1.32e-145) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 9.5e-118) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.32e-145: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 9.5e-118: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1.32e-145) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 9.5e-118) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1.32e-145) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 9.5e-118) tmp = 180.0 * (atan((0.0 / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.32e-145], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.5e-118], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.32 \cdot 10^{-145}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 9.5 \cdot 10^{-118}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.32e-145Initial program 51.2%
Taylor expanded in B around -inf 53.5%
if -1.32e-145 < B < 9.49999999999999931e-118Initial program 55.2%
Taylor expanded in C around inf 31.7%
associate-*r/31.7%
distribute-rgt1-in31.7%
metadata-eval31.7%
mul0-lft31.7%
metadata-eval31.7%
Simplified31.7%
if 9.49999999999999931e-118 < B Initial program 57.8%
Taylor expanded in B around inf 49.1%
Final simplification45.7%
(FPCore (A B C)
:precision binary64
(if (<= B -2.1e-17)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.4e+22)
(* (/ 180.0 PI) (atan (/ C B)))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.1e-17) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.4e+22) {
tmp = (180.0 / ((double) M_PI)) * atan((C / B));
} 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.1e-17) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.4e+22) {
tmp = (180.0 / Math.PI) * Math.atan((C / B));
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.1e-17: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.4e+22: tmp = (180.0 / math.pi) * math.atan((C / B)) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2.1e-17) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.4e+22) tmp = Float64(Float64(180.0 / pi) * atan(Float64(C / B))); 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.1e-17) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.4e+22) tmp = (180.0 / pi) * atan((C / B)); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.1e-17], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.4e+22], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.1 \cdot 10^{-17}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.4 \cdot 10^{+22}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.09999999999999992e-17Initial program 46.8%
Taylor expanded in B around -inf 67.1%
if -2.09999999999999992e-17 < B < 1.4e22Initial program 58.0%
associate-*l/58.0%
*-lft-identity58.0%
+-commutative58.0%
unpow258.0%
unpow258.0%
hypot-define75.5%
Simplified75.5%
clear-num75.5%
un-div-inv75.5%
hypot-undefine58.0%
unpow258.0%
unpow258.0%
+-commutative58.0%
unpow258.0%
unpow258.0%
hypot-define75.5%
Applied egg-rr75.5%
associate-/r/75.5%
sub-neg75.5%
associate-+l-64.8%
sub-neg64.8%
remove-double-neg64.8%
hypot-undefine56.8%
unpow256.8%
unpow256.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-undefine64.8%
Simplified64.8%
Taylor expanded in C around 0 55.8%
+-commutative55.8%
unpow255.8%
unpow255.8%
hypot-define56.5%
Simplified56.5%
Taylor expanded in C around inf 33.8%
if 1.4e22 < B Initial program 54.6%
Taylor expanded in B around inf 62.0%
Final simplification48.4%
(FPCore (A B C) :precision binary64 (if (<= B -1.3e-212) (* (/ 180.0 PI) (atan (- 1.0 (/ A B)))) (* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.3e-212) {
tmp = (180.0 / ((double) M_PI)) * atan((1.0 - (A / B)));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1.3e-212) {
tmp = (180.0 / Math.PI) * Math.atan((1.0 - (A / B)));
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.3e-212: tmp = (180.0 / math.pi) * math.atan((1.0 - (A / B))) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1.3e-212) tmp = Float64(Float64(180.0 / pi) * atan(Float64(1.0 - Float64(A / B)))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1.3e-212) tmp = (180.0 / pi) * atan((1.0 - (A / B))); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.3e-212], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.3 \cdot 10^{-212}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -1.3e-212Initial program 49.2%
associate-*l/49.2%
*-lft-identity49.2%
+-commutative49.2%
unpow249.2%
unpow249.2%
hypot-define76.8%
Simplified76.8%
clear-num76.8%
un-div-inv76.8%
hypot-undefine49.2%
unpow249.2%
unpow249.2%
+-commutative49.2%
unpow249.2%
unpow249.2%
hypot-define76.8%
Applied egg-rr76.8%
associate-/r/76.8%
sub-neg76.8%
associate-+l-73.5%
sub-neg73.5%
remove-double-neg73.5%
hypot-undefine49.2%
unpow249.2%
unpow249.2%
+-commutative49.2%
unpow249.2%
unpow249.2%
hypot-undefine73.5%
Simplified73.5%
Taylor expanded in C around 0 40.4%
mul-1-neg40.4%
distribute-neg-in40.4%
unsub-neg40.4%
unpow240.4%
unpow240.4%
hypot-define65.7%
Simplified65.7%
Taylor expanded in B around -inf 61.0%
mul-1-neg61.0%
unsub-neg61.0%
Simplified61.0%
if -1.3e-212 < B Initial program 58.6%
Simplified73.8%
Taylor expanded in B around inf 66.0%
+-commutative66.0%
Simplified66.0%
Final simplification63.7%
(FPCore (A B C) :precision binary64 (if (<= B 1e-198) (* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI)) (* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1e-198) {
tmp = 180.0 * (atan(((C + (B - A)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 1e-198) {
tmp = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 1e-198: tmp = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 1e-198) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 1e-198) tmp = 180.0 * (atan(((C + (B - A)) / B)) / pi); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 1e-198], N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 10^{-198}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < 9.9999999999999991e-199Initial program 51.6%
Simplified70.1%
Taylor expanded in B around -inf 64.1%
neg-mul-164.1%
unsub-neg64.1%
Simplified64.1%
if 9.9999999999999991e-199 < B Initial program 59.8%
Simplified81.1%
Taylor expanded in B around inf 75.6%
+-commutative75.6%
Simplified75.6%
Final simplification67.8%
(FPCore (A B C) :precision binary64 (if (<= B -1e-176) (* (/ 180.0 PI) (atan (/ (- (+ C B) A) B))) (* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1e-176) {
tmp = (180.0 / ((double) M_PI)) * atan((((C + B) - A) / B));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1e-176) {
tmp = (180.0 / Math.PI) * Math.atan((((C + B) - A) / B));
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1e-176: tmp = (180.0 / math.pi) * math.atan((((C + B) - A) / B)) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1e-176) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(Float64(C + B) - A) / B))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1e-176) tmp = (180.0 / pi) * atan((((C + B) - A) / B)); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1e-176], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1 \cdot 10^{-176}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{\left(C + B\right) - A}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -1e-176Initial program 49.9%
associate-*l/49.9%
*-lft-identity49.9%
+-commutative49.9%
unpow249.9%
unpow249.9%
hypot-define77.3%
Simplified77.3%
clear-num77.3%
un-div-inv77.3%
hypot-undefine49.9%
unpow249.9%
unpow249.9%
+-commutative49.9%
unpow249.9%
unpow249.9%
hypot-define77.3%
Applied egg-rr77.3%
associate-/r/77.3%
sub-neg77.3%
associate-+l-75.5%
sub-neg75.5%
remove-double-neg75.5%
hypot-undefine50.0%
unpow250.0%
unpow250.0%
+-commutative50.0%
unpow250.0%
unpow250.0%
hypot-undefine75.5%
Simplified75.5%
Taylor expanded in B around -inf 71.8%
if -1e-176 < B Initial program 57.6%
Simplified72.2%
Taylor expanded in B around inf 64.7%
+-commutative64.7%
Simplified64.7%
Final simplification67.8%
(FPCore (A B C) :precision binary64 (if (<= B -7.5e-308) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7.5e-308) {
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 <= -7.5e-308) {
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 <= -7.5e-308: 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 <= -7.5e-308) 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 <= -7.5e-308) 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, -7.5e-308], 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 -7.5 \cdot 10^{-308}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -7.4999999999999998e-308Initial program 51.9%
Taylor expanded in B around -inf 44.6%
if -7.4999999999999998e-308 < B Initial program 57.0%
Taylor expanded in B around inf 34.0%
Final simplification39.8%
(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 54.2%
Taylor expanded in B around inf 16.4%
Final simplification16.4%
herbie shell --seed 2024046
(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)))