
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C) :precision binary64 (if (<= A -1.95e+57) (/ (* 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 <= -1.95e+57) {
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 <= -1.95e+57) {
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 <= -1.95e+57: 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 <= -1.95e+57) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.95e+57) 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, -1.95e+57], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.95 \cdot 10^{+57}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.94999999999999984e57Initial program 18.7%
Applied egg-rr42.5%
Taylor expanded in A around -inf 66.7%
if -1.94999999999999984e57 < A Initial program 67.1%
Simplified86.7%
Final simplification82.5%
(FPCore (A B C) :precision binary64 (if (<= C 1.95e+92) (* 180.0 (/ (atan (/ (- (- A) (hypot (- A C) B)) B)) PI)) (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 1.95e+92) {
tmp = 180.0 * (atan(((-A - hypot((A - C), B)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 1.95e+92) {
tmp = 180.0 * (Math.atan(((-A - Math.hypot((A - C), B)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 1.95e+92: tmp = 180.0 * (math.atan(((-A - math.hypot((A - C), B)) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 1.95e+92) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - hypot(Float64(A - C), B)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 1.95e+92) tmp = 180.0 * (atan(((-A - hypot((A - C), B)) / B)) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 1.95e+92], N[(180.0 * N[(N[ArcTan[N[(N[((-A) - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.95 \cdot 10^{+92}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 1.95000000000000006e92Initial program 65.5%
associate-*l/65.5%
*-un-lft-identity65.5%
+-commutative65.5%
unpow265.5%
unpow265.5%
hypot-udef83.3%
div-sub80.5%
hypot-udef64.6%
unpow264.6%
unpow264.6%
+-commutative64.6%
unpow264.6%
unpow264.6%
hypot-def80.5%
Applied egg-rr80.5%
Taylor expanded in C around 0 78.5%
mul-1-neg78.5%
distribute-neg-frac78.5%
Simplified78.5%
sub-neg78.5%
distribute-frac-neg78.5%
distribute-neg-out78.5%
add-sqr-sqrt50.4%
sqrt-unprod75.9%
sqr-neg75.9%
sqrt-unprod28.9%
add-sqr-sqrt60.4%
div-inv62.6%
div-inv60.4%
distribute-rgt-out61.5%
add-sqr-sqrt28.9%
sqrt-unprod75.9%
sqr-neg75.9%
sqrt-unprod50.4%
add-sqr-sqrt82.6%
Applied egg-rr82.6%
associate-*l/82.6%
*-lft-identity82.6%
distribute-neg-frac82.6%
Simplified82.6%
if 1.95000000000000006e92 < C Initial program 15.6%
Taylor expanded in C around inf 29.3%
associate-*r/29.3%
distribute-rgt1-in29.3%
associate-*r*29.3%
metadata-eval29.3%
metadata-eval29.3%
metadata-eval29.3%
*-commutative29.3%
metadata-eval29.3%
associate-*r/29.2%
+-commutative29.2%
associate--l+37.9%
mul-1-neg37.9%
Simplified37.9%
add-sqr-sqrt37.9%
unpow237.9%
difference-of-squares38.4%
unpow238.4%
sqr-neg38.4%
sqrt-prod14.0%
add-sqr-sqrt27.1%
unpow227.1%
sqr-neg27.1%
sqrt-prod9.6%
add-sqr-sqrt51.0%
Applied egg-rr51.0%
Taylor expanded in A around 0 78.5%
Final simplification82.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) PI)))
(t_1 (* 180.0 (/ (atan (/ (* 0.5 B) A)) PI)))
(t_2 (* 180.0 (/ (atan 1.0) PI))))
(if (<= A -1.55e-97)
t_1
(if (<= A -1.2e-195)
t_0
(if (<= A -1.7e-261)
t_1
(if (<= A 1.5e-137)
t_2
(if (<= A 6.4e-93)
t_0
(if (<= A 2.35e-91)
t_2
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
double t_1 = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
double t_2 = 180.0 * (atan(1.0) / ((double) M_PI));
double tmp;
if (A <= -1.55e-97) {
tmp = t_1;
} else if (A <= -1.2e-195) {
tmp = t_0;
} else if (A <= -1.7e-261) {
tmp = t_1;
} else if (A <= 1.5e-137) {
tmp = t_2;
} else if (A <= 6.4e-93) {
tmp = t_0;
} else if (A <= 2.35e-91) {
tmp = t_2;
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
double t_1 = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
double t_2 = 180.0 * (Math.atan(1.0) / Math.PI);
double tmp;
if (A <= -1.55e-97) {
tmp = t_1;
} else if (A <= -1.2e-195) {
tmp = t_0;
} else if (A <= -1.7e-261) {
tmp = t_1;
} else if (A <= 1.5e-137) {
tmp = t_2;
} else if (A <= 6.4e-93) {
tmp = t_0;
} else if (A <= 2.35e-91) {
tmp = t_2;
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(-1.0) / math.pi) t_1 = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) t_2 = 180.0 * (math.atan(1.0) / math.pi) tmp = 0 if A <= -1.55e-97: tmp = t_1 elif A <= -1.2e-195: tmp = t_0 elif A <= -1.7e-261: tmp = t_1 elif A <= 1.5e-137: tmp = t_2 elif A <= 6.4e-93: tmp = t_0 elif A <= 2.35e-91: tmp = t_2 else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(-1.0) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)) t_2 = Float64(180.0 * Float64(atan(1.0) / pi)) tmp = 0.0 if (A <= -1.55e-97) tmp = t_1; elseif (A <= -1.2e-195) tmp = t_0; elseif (A <= -1.7e-261) tmp = t_1; elseif (A <= 1.5e-137) tmp = t_2; elseif (A <= 6.4e-93) tmp = t_0; elseif (A <= 2.35e-91) tmp = t_2; else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(-1.0) / pi); t_1 = 180.0 * (atan(((0.5 * B) / A)) / pi); t_2 = 180.0 * (atan(1.0) / pi); tmp = 0.0; if (A <= -1.55e-97) tmp = t_1; elseif (A <= -1.2e-195) tmp = t_0; elseif (A <= -1.7e-261) tmp = t_1; elseif (A <= 1.5e-137) tmp = t_2; elseif (A <= 6.4e-93) tmp = t_0; elseif (A <= 2.35e-91) tmp = t_2; else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.55e-97], t$95$1, If[LessEqual[A, -1.2e-195], t$95$0, If[LessEqual[A, -1.7e-261], t$95$1, If[LessEqual[A, 1.5e-137], t$95$2, If[LessEqual[A, 6.4e-93], t$95$0, If[LessEqual[A, 2.35e-91], t$95$2, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
t_2 := 180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{if}\;A \leq -1.55 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -1.2 \cdot 10^{-195}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -1.7 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq 1.5 \cdot 10^{-137}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;A \leq 6.4 \cdot 10^{-93}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 2.35 \cdot 10^{-91}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.55000000000000001e-97 or -1.2e-195 < A < -1.7e-261Initial program 30.1%
Taylor expanded in A around -inf 57.3%
associate-*r/57.3%
*-commutative57.3%
Simplified57.3%
if -1.55000000000000001e-97 < A < -1.2e-195 or 1.4999999999999999e-137 < A < 6.3999999999999997e-93Initial program 65.0%
Taylor expanded in B around inf 57.7%
if -1.7e-261 < A < 1.4999999999999999e-137 or 6.3999999999999997e-93 < A < 2.35000000000000003e-91Initial program 68.9%
Taylor expanded in B around -inf 44.4%
if 2.35000000000000003e-91 < A Initial program 78.8%
Taylor expanded in A around inf 70.3%
Final simplification59.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan 1.0) PI))) (t_1 (* 180.0 (/ (atan -1.0) PI))))
(if (<= A -3.7e-96)
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
(if (<= A -1.05e-197)
t_1
(if (<= A -6.8e-261)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(if (<= A 2.6e-137)
t_0
(if (<= A 3.8e-93)
t_1
(if (<= A 1.15e-91)
t_0
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(1.0) / ((double) M_PI));
double t_1 = 180.0 * (atan(-1.0) / ((double) M_PI));
double tmp;
if (A <= -3.7e-96) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else if (A <= -1.05e-197) {
tmp = t_1;
} else if (A <= -6.8e-261) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else if (A <= 2.6e-137) {
tmp = t_0;
} else if (A <= 3.8e-93) {
tmp = t_1;
} else if (A <= 1.15e-91) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(1.0) / Math.PI);
double t_1 = 180.0 * (Math.atan(-1.0) / Math.PI);
double tmp;
if (A <= -3.7e-96) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else if (A <= -1.05e-197) {
tmp = t_1;
} else if (A <= -6.8e-261) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else if (A <= 2.6e-137) {
tmp = t_0;
} else if (A <= 3.8e-93) {
tmp = t_1;
} else if (A <= 1.15e-91) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(1.0) / math.pi) t_1 = 180.0 * (math.atan(-1.0) / math.pi) tmp = 0 if A <= -3.7e-96: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi elif A <= -1.05e-197: tmp = t_1 elif A <= -6.8e-261: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) elif A <= 2.6e-137: tmp = t_0 elif A <= 3.8e-93: tmp = t_1 elif A <= 1.15e-91: tmp = t_0 else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(1.0) / pi)) t_1 = Float64(180.0 * Float64(atan(-1.0) / pi)) tmp = 0.0 if (A <= -3.7e-96) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); elseif (A <= -1.05e-197) tmp = t_1; elseif (A <= -6.8e-261) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); elseif (A <= 2.6e-137) tmp = t_0; elseif (A <= 3.8e-93) tmp = t_1; elseif (A <= 1.15e-91) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(1.0) / pi); t_1 = 180.0 * (atan(-1.0) / pi); tmp = 0.0; if (A <= -3.7e-96) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; elseif (A <= -1.05e-197) tmp = t_1; elseif (A <= -6.8e-261) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); elseif (A <= 2.6e-137) tmp = t_0; elseif (A <= 3.8e-93) tmp = t_1; elseif (A <= 1.15e-91) tmp = t_0; else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -3.7e-96], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -1.05e-197], t$95$1, If[LessEqual[A, -6.8e-261], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.6e-137], t$95$0, If[LessEqual[A, 3.8e-93], t$95$1, If[LessEqual[A, 1.15e-91], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} 1}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{if}\;A \leq -3.7 \cdot 10^{-96}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -1.05 \cdot 10^{-197}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -6.8 \cdot 10^{-261}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.6 \cdot 10^{-137}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 3.8 \cdot 10^{-93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq 1.15 \cdot 10^{-91}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.69999999999999986e-96Initial program 26.8%
Applied egg-rr49.1%
Taylor expanded in A around -inf 57.3%
if -3.69999999999999986e-96 < A < -1.05e-197 or 2.6e-137 < A < 3.7999999999999999e-93Initial program 65.0%
Taylor expanded in B around inf 57.7%
if -1.05e-197 < A < -6.8e-261Initial program 62.0%
Taylor expanded in A around -inf 58.2%
associate-*r/58.2%
*-commutative58.2%
Simplified58.2%
if -6.8e-261 < A < 2.6e-137 or 3.7999999999999999e-93 < A < 1.14999999999999998e-91Initial program 68.9%
Taylor expanded in B around -inf 44.4%
if 1.14999999999999998e-91 < A Initial program 78.8%
Taylor expanded in A around inf 70.3%
Final simplification59.4%
(FPCore (A B C)
:precision binary64
(if (<= B -5.3e-76)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 90000.0)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5.3e-76) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 90000.0) {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -5.3e-76) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 90000.0) {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -5.3e-76: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 90000.0: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -5.3e-76) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 90000.0) tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5.3e-76) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 90000.0) tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -5.3e-76], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 90000.0], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5.3 \cdot 10^{-76}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 90000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -5.3e-76Initial program 55.0%
Taylor expanded in B around -inf 58.2%
if -5.3e-76 < B < 9e4Initial program 64.6%
Taylor expanded in A around inf 43.9%
if 9e4 < B Initial program 47.5%
Taylor expanded in B around inf 62.3%
Final simplification53.2%
(FPCore (A B C)
:precision binary64
(if (<= A -8.6e+17)
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
(if (<= A 0.033)
(/ (* 180.0 (atan (+ 1.0 (/ C B)))) PI)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -8.6e+17) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else if (A <= 0.033) {
tmp = (180.0 * atan((1.0 + (C / B)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -8.6e+17) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else if (A <= 0.033) {
tmp = (180.0 * Math.atan((1.0 + (C / B)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -8.6e+17: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi elif A <= 0.033: tmp = (180.0 * math.atan((1.0 + (C / B)))) / math.pi else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -8.6e+17) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); elseif (A <= 0.033) tmp = Float64(Float64(180.0 * atan(Float64(1.0 + Float64(C / B)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -8.6e+17) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; elseif (A <= 0.033) tmp = (180.0 * atan((1.0 + (C / B)))) / pi; else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -8.6e+17], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 0.033], N[(N[(180.0 * N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -8.6 \cdot 10^{+17}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 0.033:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.6e17Initial program 22.2%
Applied egg-rr45.2%
Taylor expanded in A around -inf 63.6%
if -8.6e17 < A < 0.033000000000000002Initial program 62.7%
Applied egg-rr83.6%
Taylor expanded in B around -inf 54.5%
Taylor expanded in B around 0 54.6%
associate--l+54.6%
div-sub54.6%
Simplified54.6%
Taylor expanded in A around 0 53.5%
if 0.033000000000000002 < A Initial program 80.2%
Taylor expanded in A around inf 73.5%
Final simplification61.6%
(FPCore (A B C)
:precision binary64
(if (<= A -6.8e+20)
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
(if (<= A 2.9e-93)
(/ (* 180.0 (atan (+ 1.0 (/ C B)))) PI)
(/ (* 180.0 (atan (/ (- B A) B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -6.8e+20) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else if (A <= 2.9e-93) {
tmp = (180.0 * atan((1.0 + (C / B)))) / ((double) M_PI);
} else {
tmp = (180.0 * atan(((B - A) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -6.8e+20) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else if (A <= 2.9e-93) {
tmp = (180.0 * Math.atan((1.0 + (C / B)))) / Math.PI;
} else {
tmp = (180.0 * Math.atan(((B - A) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6.8e+20: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi elif A <= 2.9e-93: tmp = (180.0 * math.atan((1.0 + (C / B)))) / math.pi else: tmp = (180.0 * math.atan(((B - A) / B))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6.8e+20) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); elseif (A <= 2.9e-93) tmp = Float64(Float64(180.0 * atan(Float64(1.0 + Float64(C / B)))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(B - A) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -6.8e+20) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; elseif (A <= 2.9e-93) tmp = (180.0 * atan((1.0 + (C / B)))) / pi; else tmp = (180.0 * atan(((B - A) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6.8e+20], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 2.9e-93], N[(N[(180.0 * N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(B - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.8 \cdot 10^{+20}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.9 \cdot 10^{-93}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -6.8e20Initial program 22.2%
Applied egg-rr45.2%
Taylor expanded in A around -inf 63.6%
if -6.8e20 < A < 2.8999999999999998e-93Initial program 60.9%
Applied egg-rr82.0%
Taylor expanded in B around -inf 51.3%
Taylor expanded in B around 0 51.3%
associate--l+51.3%
div-sub51.3%
Simplified51.3%
Taylor expanded in A around 0 51.4%
if 2.8999999999999998e-93 < A Initial program 79.1%
Applied egg-rr96.7%
Taylor expanded in B around -inf 81.5%
Taylor expanded in C around 0 81.4%
Final simplification64.8%
(FPCore (A B C) :precision binary64 (if (<= A -4.4e+17) (/ (* 180.0 (atan (* 0.5 (/ B A)))) PI) (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.4e+17) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -4.4e+17) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -4.4e+17: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -4.4e+17) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -4.4e+17) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -4.4e+17], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.4 \cdot 10^{+17}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.4e17Initial program 22.2%
Applied egg-rr45.2%
Taylor expanded in A around -inf 63.6%
if -4.4e17 < A Initial program 69.2%
Taylor expanded in B around -inf 65.1%
associate--l+65.1%
div-sub65.1%
Simplified65.1%
Final simplification64.7%
(FPCore (A B C) :precision binary64 (if (<= A -1.75e+19) (/ (* 180.0 (atan (* 0.5 (/ B A)))) PI) (/ (* 180.0 (atan (+ 1.0 (/ (- C A) B)))) PI)))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.75e+19) {
tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
} else {
tmp = (180.0 * atan((1.0 + ((C - A) / B)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.75e+19) {
tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
} else {
tmp = (180.0 * Math.atan((1.0 + ((C - A) / B)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.75e+19: tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi else: tmp = (180.0 * math.atan((1.0 + ((C - A) / B)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.75e+19) tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(1.0 + Float64(Float64(C - A) / B)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.75e+19) tmp = (180.0 * atan((0.5 * (B / A)))) / pi; else tmp = (180.0 * atan((1.0 + ((C - A) / B)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.75e+19], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.75 \cdot 10^{+19}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.75e19Initial program 22.2%
Applied egg-rr45.2%
Taylor expanded in A around -inf 63.6%
if -1.75e19 < A Initial program 69.2%
Applied egg-rr88.7%
Taylor expanded in B around -inf 65.1%
Taylor expanded in B around 0 65.1%
associate--l+65.1%
div-sub65.1%
Simplified65.1%
Final simplification64.8%
(FPCore (A B C)
:precision binary64
(if (<= B -1.25e-77)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1200000.0)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.25e-77) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1200000.0) {
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 <= -1.25e-77) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1200000.0) {
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 <= -1.25e-77: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1200000.0: 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 <= -1.25e-77) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1200000.0) 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 <= -1.25e-77) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1200000.0) 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, -1.25e-77], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1200000.0], 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 -1.25 \cdot 10^{-77}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1200000:\\
\;\;\;\;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 < -1.24999999999999991e-77Initial program 55.0%
Taylor expanded in B around -inf 58.2%
if -1.24999999999999991e-77 < B < 1.2e6Initial program 64.6%
Simplified70.8%
+-commutative70.8%
add-sqr-sqrt68.0%
fma-def67.9%
Applied egg-rr67.9%
Taylor expanded in A around inf 43.3%
mul-1-neg43.3%
Simplified43.3%
if 1.2e6 < B Initial program 47.5%
Taylor expanded in B around inf 62.3%
Final simplification52.9%
(FPCore (A B C)
:precision binary64
(if (<= B -1.15e-97)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 640000.0)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.15e-97) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 640000.0) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1.15e-97) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 640000.0) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.15e-97: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 640000.0: tmp = 180.0 * (math.atan((C / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1.15e-97) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 640000.0) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1.15e-97) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 640000.0) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.15e-97], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 640000.0], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.15 \cdot 10^{-97}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 640000:\\
\;\;\;\;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 < -1.14999999999999997e-97Initial program 58.1%
Taylor expanded in B around -inf 57.3%
if -1.14999999999999997e-97 < B < 6.4e5Initial program 62.5%
Simplified69.1%
+-commutative69.1%
add-sqr-sqrt66.1%
fma-def66.0%
Applied egg-rr66.0%
Taylor expanded in C around inf 40.0%
if 6.4e5 < B Initial program 47.5%
Taylor expanded in B around inf 62.3%
Final simplification51.7%
(FPCore (A B C) :precision binary64 (if (<= B -5e-310) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5e-310) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -5e-310) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -5e-310: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -5e-310) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5e-310) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -5e-310], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.999999999999985e-310Initial program 58.9%
Taylor expanded in B around -inf 47.0%
if -4.999999999999985e-310 < B Initial program 55.6%
Taylor expanded in B around inf 37.9%
Final simplification42.0%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 57.1%
Taylor expanded in B around inf 21.9%
Final simplification21.9%
herbie shell --seed 2023301
(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)))