
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C) :precision binary64 (if (<= A -3.5e+88) (/ (* (atan (* 0.5 (/ B A))) 180.0) PI) (/ (* 180.0 (atan (/ (- (- C A) (hypot (- A C) B)) B))) PI)))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.5e+88) {
tmp = (atan((0.5 * (B / A))) * 180.0) / ((double) M_PI);
} else {
tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.5e+88) {
tmp = (Math.atan((0.5 * (B / A))) * 180.0) / Math.PI;
} else {
tmp = (180.0 * Math.atan((((C - A) - Math.hypot((A - C), B)) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.5e+88: tmp = (math.atan((0.5 * (B / A))) * 180.0) / math.pi else: tmp = (180.0 * math.atan((((C - A) - math.hypot((A - C), B)) / B))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.5e+88) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) * 180.0) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.5e+88) tmp = (atan((0.5 * (B / A))) * 180.0) / pi; else tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.5e+88], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.5 \cdot 10^{+88}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot 180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.4999999999999998e88Initial program 17.5%
associate-*l/17.5%
*-un-lft-identity17.5%
+-commutative17.5%
unpow217.5%
unpow217.5%
hypot-udef48.5%
div-sub20.5%
hypot-udef9.8%
unpow29.8%
unpow29.8%
+-commutative9.8%
unpow29.8%
unpow29.8%
hypot-def20.5%
Applied egg-rr20.5%
associate-*r/20.6%
div-sub48.5%
*-commutative48.5%
Applied egg-rr48.5%
Taylor expanded in A around -inf 78.5%
if -3.4999999999999998e88 < A Initial program 64.9%
associate-*l/64.9%
*-un-lft-identity64.9%
+-commutative64.9%
unpow264.9%
unpow264.9%
hypot-udef85.5%
div-sub77.8%
hypot-udef60.4%
unpow260.4%
unpow260.4%
+-commutative60.4%
unpow260.4%
unpow260.4%
hypot-def77.8%
Applied egg-rr77.8%
associate-*r/77.8%
div-sub85.5%
*-commutative85.5%
Applied egg-rr85.5%
Final simplification84.3%
(FPCore (A B C) :precision binary64 (if (<= A -3.5e+90) (/ (* (atan (* 0.5 (/ B A))) 180.0) PI) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.5e+90) {
tmp = (atan((0.5 * (B / A))) * 180.0) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.5e+90) {
tmp = (Math.atan((0.5 * (B / A))) * 180.0) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.5e+90: tmp = (math.atan((0.5 * (B / A))) * 180.0) / math.pi else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.5e+90) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) * 180.0) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.5e+90) tmp = (atan((0.5 * (B / A))) * 180.0) / pi; else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.5e+90], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 180.0), $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 -3.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot 180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.4999999999999998e90Initial program 17.5%
associate-*l/17.5%
*-un-lft-identity17.5%
+-commutative17.5%
unpow217.5%
unpow217.5%
hypot-udef48.5%
div-sub20.5%
hypot-udef9.8%
unpow29.8%
unpow29.8%
+-commutative9.8%
unpow29.8%
unpow29.8%
hypot-def20.5%
Applied egg-rr20.5%
associate-*r/20.6%
div-sub48.5%
*-commutative48.5%
Applied egg-rr48.5%
Taylor expanded in A around -inf 78.5%
if -3.4999999999999998e90 < A Initial program 64.9%
Simplified84.8%
Final simplification83.7%
(FPCore (A B C)
:precision binary64
(if (<= B -5.5e-146)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
(if (<= B -1.9e-226)
(/ (* (atan (* 0.5 (/ B A))) 180.0) PI)
(if (<= B -1.85e-255)
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))
(if (<= B 1.95e-271)
(* 180.0 (/ (atan (/ (* A 0.0) B)) PI))
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) B))) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5.5e-146) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else if (B <= -1.9e-226) {
tmp = (atan((0.5 * (B / A))) * 180.0) / ((double) M_PI);
} else if (B <= -1.85e-255) {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
} else if (B <= 1.95e-271) {
tmp = 180.0 * (atan(((A * 0.0) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -5.5e-146) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else if (B <= -1.9e-226) {
tmp = (Math.atan((0.5 * (B / A))) * 180.0) / Math.PI;
} else if (B <= -1.85e-255) {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
} else if (B <= 1.95e-271) {
tmp = 180.0 * (Math.atan(((A * 0.0) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -5.5e-146: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) elif B <= -1.9e-226: tmp = (math.atan((0.5 * (B / A))) * 180.0) / math.pi elif B <= -1.85e-255: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) elif B <= 1.95e-271: tmp = 180.0 * (math.atan(((A * 0.0) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((1.0 / B) * ((C - A) - B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -5.5e-146) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); elseif (B <= -1.9e-226) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) * 180.0) / pi); elseif (B <= -1.85e-255) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); elseif (B <= 1.95e-271) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * 0.0) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5.5e-146) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); elseif (B <= -1.9e-226) tmp = (atan((0.5 * (B / A))) * 180.0) / pi; elseif (B <= -1.85e-255) tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); elseif (B <= 1.95e-271) tmp = 180.0 * (atan(((A * 0.0) / B)) / pi); else tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -5.5e-146], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.9e-226], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[B, -1.85e-255], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.95e-271], N[(180.0 * N[(N[ArcTan[N[(N[(A * 0.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5.5 \cdot 10^{-146}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -1.9 \cdot 10^{-226}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot 180}{\pi}\\
\mathbf{elif}\;B \leq -1.85 \cdot 10^{-255}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.95 \cdot 10^{-271}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot 0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - B\right)\right)}{\pi}\\
\end{array}
\end{array}
if B < -5.49999999999999998e-146Initial program 63.3%
Taylor expanded in B around -inf 77.3%
associate--l+77.3%
div-sub77.3%
Simplified77.3%
if -5.49999999999999998e-146 < B < -1.89999999999999991e-226Initial program 28.0%
associate-*l/28.0%
*-un-lft-identity28.0%
+-commutative28.0%
unpow228.0%
unpow228.0%
hypot-udef46.2%
div-sub21.3%
hypot-udef21.3%
unpow221.3%
unpow221.3%
+-commutative21.3%
unpow221.3%
unpow221.3%
hypot-def21.3%
Applied egg-rr21.3%
associate-*r/21.3%
div-sub46.2%
*-commutative46.2%
Applied egg-rr46.2%
Taylor expanded in A around -inf 75.5%
if -1.89999999999999991e-226 < B < -1.8500000000000001e-255Initial program 87.6%
Simplified86.2%
Taylor expanded in B around inf 86.2%
+-commutative86.2%
Simplified86.2%
if -1.8500000000000001e-255 < B < 1.94999999999999999e-271Initial program 63.1%
Taylor expanded in C around inf 58.3%
associate-*r/58.3%
distribute-rgt1-in58.3%
associate-*r*58.3%
metadata-eval58.3%
metadata-eval58.3%
metadata-eval58.3%
*-commutative58.3%
metadata-eval58.3%
Simplified58.3%
if 1.94999999999999999e-271 < B Initial program 52.4%
Taylor expanded in B around inf 67.2%
Final simplification71.4%
(FPCore (A B C)
:precision binary64
(if (<= B -7.2e-146)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
(if (<= B -2.9e-226)
(/ (* (atan (* 0.5 (/ B A))) 180.0) PI)
(if (or (<= B -2.4e-255) (not (<= B 1.95e-271)))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))
(* 180.0 (/ (atan (/ (* A 0.0) B)) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7.2e-146) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else if (B <= -2.9e-226) {
tmp = (atan((0.5 * (B / A))) * 180.0) / ((double) M_PI);
} else if ((B <= -2.4e-255) || !(B <= 1.95e-271)) {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A * 0.0) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -7.2e-146) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else if (B <= -2.9e-226) {
tmp = (Math.atan((0.5 * (B / A))) * 180.0) / Math.PI;
} else if ((B <= -2.4e-255) || !(B <= 1.95e-271)) {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A * 0.0) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -7.2e-146: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) elif B <= -2.9e-226: tmp = (math.atan((0.5 * (B / A))) * 180.0) / math.pi elif (B <= -2.4e-255) or not (B <= 1.95e-271): tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((A * 0.0) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -7.2e-146) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); elseif (B <= -2.9e-226) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) * 180.0) / pi); elseif ((B <= -2.4e-255) || !(B <= 1.95e-271)) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * 0.0) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -7.2e-146) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); elseif (B <= -2.9e-226) tmp = (atan((0.5 * (B / A))) * 180.0) / pi; elseif ((B <= -2.4e-255) || ~((B <= 1.95e-271))) tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); else tmp = 180.0 * (atan(((A * 0.0) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -7.2e-146], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.9e-226], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision] / Pi), $MachinePrecision], If[Or[LessEqual[B, -2.4e-255], N[Not[LessEqual[B, 1.95e-271]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A * 0.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -7.2 \cdot 10^{-146}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -2.9 \cdot 10^{-226}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot 180}{\pi}\\
\mathbf{elif}\;B \leq -2.4 \cdot 10^{-255} \lor \neg \left(B \leq 1.95 \cdot 10^{-271}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot 0}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -7.19999999999999957e-146Initial program 63.3%
Taylor expanded in B around -inf 77.3%
associate--l+77.3%
div-sub77.3%
Simplified77.3%
if -7.19999999999999957e-146 < B < -2.90000000000000002e-226Initial program 28.0%
associate-*l/28.0%
*-un-lft-identity28.0%
+-commutative28.0%
unpow228.0%
unpow228.0%
hypot-udef46.2%
div-sub21.3%
hypot-udef21.3%
unpow221.3%
unpow221.3%
+-commutative21.3%
unpow221.3%
unpow221.3%
hypot-def21.3%
Applied egg-rr21.3%
associate-*r/21.3%
div-sub46.2%
*-commutative46.2%
Applied egg-rr46.2%
Taylor expanded in A around -inf 75.5%
if -2.90000000000000002e-226 < B < -2.3999999999999998e-255 or 1.94999999999999999e-271 < B Initial program 54.5%
Simplified80.2%
Taylor expanded in B around inf 68.3%
+-commutative68.3%
Simplified68.3%
if -2.3999999999999998e-255 < B < 1.94999999999999999e-271Initial program 63.1%
Taylor expanded in C around inf 58.3%
associate-*r/58.3%
distribute-rgt1-in58.3%
associate-*r*58.3%
metadata-eval58.3%
metadata-eval58.3%
metadata-eval58.3%
*-commutative58.3%
metadata-eval58.3%
Simplified58.3%
Final simplification71.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))))
(if (<= A -8.2e-69)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -3.3e-246)
t_0
(if (<= A 1e-242)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 2.95e+109)
t_0
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
double tmp;
if (A <= -8.2e-69) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -3.3e-246) {
tmp = t_0;
} else if (A <= 1e-242) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 2.95e+109) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
double tmp;
if (A <= -8.2e-69) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -3.3e-246) {
tmp = t_0;
} else if (A <= 1e-242) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 2.95e+109) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) tmp = 0 if A <= -8.2e-69: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -3.3e-246: tmp = t_0 elif A <= 1e-242: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 2.95e+109: tmp = t_0 else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)) tmp = 0.0 if (A <= -8.2e-69) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -3.3e-246) tmp = t_0; elseif (A <= 1e-242) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 2.95e+109) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 + (C / B))) / pi); tmp = 0.0; if (A <= -8.2e-69) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -3.3e-246) tmp = t_0; elseif (A <= 1e-242) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 2.95e+109) tmp = t_0; else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -8.2e-69], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -3.3e-246], t$95$0, If[LessEqual[A, 1e-242], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.95e+109], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -8.2 \cdot 10^{-69}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -3.3 \cdot 10^{-246}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 10^{-242}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 2.95 \cdot 10^{+109}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.1999999999999998e-69Initial program 27.1%
Taylor expanded in A around -inf 61.4%
if -8.1999999999999998e-69 < A < -3.3000000000000001e-246 or 1e-242 < A < 2.9499999999999999e109Initial program 69.0%
Taylor expanded in B around -inf 62.3%
associate--l+62.3%
div-sub62.3%
Simplified62.3%
Taylor expanded in C around inf 58.2%
if -3.3000000000000001e-246 < A < 1e-242Initial program 52.0%
Taylor expanded in B around inf 58.9%
if 2.9499999999999999e109 < A Initial program 85.4%
Taylor expanded in A around inf 84.7%
Final simplification63.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))))
(if (<= A -4.8e-68)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -3.3e-246)
t_0
(if (<= A 1e-242)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 7.5e-91) t_0 (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
double tmp;
if (A <= -4.8e-68) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -3.3e-246) {
tmp = t_0;
} else if (A <= 1e-242) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 7.5e-91) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
double tmp;
if (A <= -4.8e-68) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -3.3e-246) {
tmp = t_0;
} else if (A <= 1e-242) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 7.5e-91) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) tmp = 0 if A <= -4.8e-68: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -3.3e-246: tmp = t_0 elif A <= 1e-242: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 7.5e-91: tmp = t_0 else: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)) tmp = 0.0 if (A <= -4.8e-68) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -3.3e-246) tmp = t_0; elseif (A <= 1e-242) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 7.5e-91) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 + (C / B))) / pi); tmp = 0.0; if (A <= -4.8e-68) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -3.3e-246) tmp = t_0; elseif (A <= 1e-242) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 7.5e-91) tmp = t_0; else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -4.8e-68], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -3.3e-246], t$95$0, If[LessEqual[A, 1e-242], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7.5e-91], t$95$0, N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -4.8 \cdot 10^{-68}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -3.3 \cdot 10^{-246}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 10^{-242}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 7.5 \cdot 10^{-91}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.79999999999999982e-68Initial program 27.1%
Taylor expanded in A around -inf 61.4%
if -4.79999999999999982e-68 < A < -3.3000000000000001e-246 or 1e-242 < A < 7.50000000000000051e-91Initial program 71.3%
Taylor expanded in B around -inf 66.9%
associate--l+66.9%
div-sub66.9%
Simplified66.9%
Taylor expanded in C around inf 67.1%
if -3.3000000000000001e-246 < A < 1e-242Initial program 52.0%
Taylor expanded in B around inf 58.9%
if 7.50000000000000051e-91 < A Initial program 75.4%
Taylor expanded in B around -inf 69.7%
associate--l+69.7%
div-sub69.7%
Simplified69.7%
Taylor expanded in C around 0 68.1%
mul-1-neg68.1%
Simplified68.1%
Taylor expanded in A around 0 68.1%
Final simplification64.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))))
(if (<= A -2.7e-68)
(/ (* (atan (* 0.5 (/ B A))) 180.0) PI)
(if (<= A -3.3e-246)
t_0
(if (<= A 1e-242)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 4.6e-94) t_0 (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
double tmp;
if (A <= -2.7e-68) {
tmp = (atan((0.5 * (B / A))) * 180.0) / ((double) M_PI);
} else if (A <= -3.3e-246) {
tmp = t_0;
} else if (A <= 1e-242) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 4.6e-94) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
double tmp;
if (A <= -2.7e-68) {
tmp = (Math.atan((0.5 * (B / A))) * 180.0) / Math.PI;
} else if (A <= -3.3e-246) {
tmp = t_0;
} else if (A <= 1e-242) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 4.6e-94) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) tmp = 0 if A <= -2.7e-68: tmp = (math.atan((0.5 * (B / A))) * 180.0) / math.pi elif A <= -3.3e-246: tmp = t_0 elif A <= 1e-242: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 4.6e-94: tmp = t_0 else: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)) tmp = 0.0 if (A <= -2.7e-68) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) * 180.0) / pi); elseif (A <= -3.3e-246) tmp = t_0; elseif (A <= 1e-242) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 4.6e-94) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 + (C / B))) / pi); tmp = 0.0; if (A <= -2.7e-68) tmp = (atan((0.5 * (B / A))) * 180.0) / pi; elseif (A <= -3.3e-246) tmp = t_0; elseif (A <= 1e-242) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 4.6e-94) tmp = t_0; else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -2.7e-68], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -3.3e-246], t$95$0, If[LessEqual[A, 1e-242], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.6e-94], t$95$0, N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -2.7 \cdot 10^{-68}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot 180}{\pi}\\
\mathbf{elif}\;A \leq -3.3 \cdot 10^{-246}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 10^{-242}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 4.6 \cdot 10^{-94}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.7000000000000002e-68Initial program 27.1%
associate-*l/27.1%
*-un-lft-identity27.1%
+-commutative27.1%
unpow227.1%
unpow227.1%
hypot-udef51.6%
div-sub31.7%
hypot-udef19.1%
unpow219.1%
unpow219.1%
+-commutative19.1%
unpow219.1%
unpow219.1%
hypot-def31.7%
Applied egg-rr31.7%
associate-*r/31.7%
div-sub51.6%
*-commutative51.6%
Applied egg-rr51.6%
Taylor expanded in A around -inf 61.4%
if -2.7000000000000002e-68 < A < -3.3000000000000001e-246 or 1e-242 < A < 4.5999999999999999e-94Initial program 71.3%
Taylor expanded in B around -inf 66.9%
associate--l+66.9%
div-sub66.9%
Simplified66.9%
Taylor expanded in C around inf 67.1%
if -3.3000000000000001e-246 < A < 1e-242Initial program 52.0%
Taylor expanded in B around inf 58.9%
if 4.5999999999999999e-94 < A Initial program 75.4%
Taylor expanded in B around -inf 69.7%
associate--l+69.7%
div-sub69.7%
Simplified69.7%
Taylor expanded in C around 0 68.1%
mul-1-neg68.1%
Simplified68.1%
Taylor expanded in A around 0 68.1%
Final simplification64.9%
(FPCore (A B C)
:precision binary64
(if (<= A -4.8e-68)
(/ (* (atan (* 0.5 (/ B A))) 180.0) PI)
(if (<= A -3.3e-246)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(if (<= A 1.32e-241)
(* 180.0 (/ (atan -1.0) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.8e-68) {
tmp = (atan((0.5 * (B / A))) * 180.0) / ((double) M_PI);
} else if (A <= -3.3e-246) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else if (A <= 1.32e-241) {
tmp = 180.0 * (atan(-1.0) / ((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.8e-68) {
tmp = (Math.atan((0.5 * (B / A))) * 180.0) / Math.PI;
} else if (A <= -3.3e-246) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else if (A <= 1.32e-241) {
tmp = 180.0 * (Math.atan(-1.0) / 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.8e-68: tmp = (math.atan((0.5 * (B / A))) * 180.0) / math.pi elif A <= -3.3e-246: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) elif A <= 1.32e-241: tmp = 180.0 * (math.atan(-1.0) / 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.8e-68) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) * 180.0) / pi); elseif (A <= -3.3e-246) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); elseif (A <= 1.32e-241) tmp = Float64(180.0 * Float64(atan(-1.0) / 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.8e-68) tmp = (atan((0.5 * (B / A))) * 180.0) / pi; elseif (A <= -3.3e-246) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); elseif (A <= 1.32e-241) tmp = 180.0 * (atan(-1.0) / 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.8e-68], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -3.3e-246], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.32e-241], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $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.8 \cdot 10^{-68}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot 180}{\pi}\\
\mathbf{elif}\;A \leq -3.3 \cdot 10^{-246}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.32 \cdot 10^{-241}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.79999999999999982e-68Initial program 27.1%
associate-*l/27.1%
*-un-lft-identity27.1%
+-commutative27.1%
unpow227.1%
unpow227.1%
hypot-udef51.6%
div-sub31.7%
hypot-udef19.1%
unpow219.1%
unpow219.1%
+-commutative19.1%
unpow219.1%
unpow219.1%
hypot-def31.7%
Applied egg-rr31.7%
associate-*r/31.7%
div-sub51.6%
*-commutative51.6%
Applied egg-rr51.6%
Taylor expanded in A around -inf 61.4%
if -4.79999999999999982e-68 < A < -3.3000000000000001e-246Initial program 72.4%
Taylor expanded in B around -inf 67.3%
associate--l+67.3%
div-sub67.3%
Simplified67.3%
Taylor expanded in C around inf 67.7%
if -3.3000000000000001e-246 < A < 1.31999999999999993e-241Initial program 52.0%
Taylor expanded in B around inf 58.9%
if 1.31999999999999993e-241 < A Initial program 74.0%
Taylor expanded in B around -inf 68.8%
associate--l+68.8%
div-sub68.8%
Simplified68.8%
Final simplification65.4%
(FPCore (A B C)
:precision binary64
(if (<= A -2.6e-234)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 5.2e-241)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 9.8e-139)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.6e-234) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 5.2e-241) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 9.8e-139) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.6e-234) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 5.2e-241) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 9.8e-139) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.6e-234: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 5.2e-241: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 9.8e-139: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.6e-234) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 5.2e-241) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 9.8e-139) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.6e-234) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 5.2e-241) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 9.8e-139) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.6e-234], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.2e-241], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 9.8e-139], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.6 \cdot 10^{-234}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 5.2 \cdot 10^{-241}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 9.8 \cdot 10^{-139}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.59999999999999989e-234Initial program 42.3%
Taylor expanded in A around -inf 53.0%
if -2.59999999999999989e-234 < A < 5.1999999999999998e-241Initial program 56.2%
Taylor expanded in B around inf 58.2%
if 5.1999999999999998e-241 < A < 9.80000000000000063e-139Initial program 64.4%
Taylor expanded in B around -inf 53.7%
if 9.80000000000000063e-139 < A Initial program 76.2%
Taylor expanded in A around inf 60.9%
Final simplification56.2%
(FPCore (A B C)
:precision binary64
(if (<= B -1.75e-61)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4.5e-72)
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.75e-61) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4.5e-72) {
tmp = 180.0 * (atan(((A / B) * -2.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 <= -1.75e-61) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4.5e-72) {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.75e-61: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4.5e-72: tmp = 180.0 * (math.atan(((A / B) * -2.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 <= -1.75e-61) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4.5e-72) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.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 <= -1.75e-61) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4.5e-72) tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.75e-61], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.5e-72], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $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.75 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-72}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.7500000000000002e-61Initial program 61.5%
Taylor expanded in B around -inf 53.8%
if -1.7500000000000002e-61 < B < 4.5e-72Initial program 62.0%
Taylor expanded in A around inf 33.1%
if 4.5e-72 < B Initial program 44.9%
Taylor expanded in B around inf 58.7%
Final simplification47.1%
(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 59.4%
Taylor expanded in B around -inf 39.3%
if -4.999999999999985e-310 < B Initial program 54.2%
Taylor expanded in B around inf 41.0%
Final simplification40.1%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 56.9%
Taylor expanded in B around inf 20.8%
Final simplification20.8%
herbie shell --seed 2023305
(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)))