
(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 15 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 (<= C 2.25e+173) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI)) (/ (* 180.0 (atan (* -0.5 (/ B C)))) PI)))
double code(double A, double B, double C) {
double tmp;
if (C <= 2.25e+173) {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / 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 <= 2.25e+173) {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / 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 <= 2.25e+173: tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / 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 <= 2.25e+173) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); 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) tmp = 0.0; if (C <= 2.25e+173) tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); else tmp = (180.0 * atan((-0.5 * (B / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 2.25e+173], 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[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 2.25 \cdot 10^{+173}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 2.2500000000000001e173Initial program 58.0%
associate-*l/58.0%
*-lft-identity58.0%
+-commutative58.0%
unpow258.0%
unpow258.0%
hypot-def82.3%
Simplified82.3%
if 2.2500000000000001e173 < C Initial program 4.4%
associate-*l/4.4%
*-lft-identity4.4%
+-commutative4.4%
unpow24.4%
unpow24.4%
hypot-def36.6%
Simplified36.6%
Taylor expanded in C around inf 38.4%
fma-def38.4%
associate--l+50.3%
unpow250.3%
fma-def50.3%
unpow250.3%
unpow250.3%
difference-of-squares64.6%
distribute-rgt1-in64.6%
metadata-eval64.6%
mul0-lft64.6%
mul-1-neg64.6%
*-commutative64.6%
associate-*r/64.6%
Simplified64.6%
Taylor expanded in B around 0 64.6%
Simplified65.0%
Taylor expanded in B around 0 99.8%
Final simplification84.3%
(FPCore (A B C)
:precision binary64
(if (<= C -8.5e+107)
(* 180.0 (/ (atan (/ (- (- C B) A) B)) PI))
(if (<= C 6.2e+170)
(* 180.0 (/ (atan (/ (- (- A) (hypot A B)) B)) PI))
(/ (* 180.0 (atan (* -0.5 (/ B C)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -8.5e+107) {
tmp = 180.0 * (atan((((C - B) - A) / B)) / ((double) M_PI));
} else if (C <= 6.2e+170) {
tmp = 180.0 * (atan(((-A - hypot(A, 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 <= -8.5e+107) {
tmp = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
} else if (C <= 6.2e+170) {
tmp = 180.0 * (Math.atan(((-A - Math.hypot(A, 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 <= -8.5e+107: tmp = 180.0 * (math.atan((((C - B) - A) / B)) / math.pi) elif C <= 6.2e+170: tmp = 180.0 * (math.atan(((-A - math.hypot(A, 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 <= -8.5e+107) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)); elseif (C <= 6.2e+170) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - hypot(A, B)) / B)) / pi)); 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) tmp = 0.0; if (C <= -8.5e+107) tmp = 180.0 * (atan((((C - B) - A) / B)) / pi); elseif (C <= 6.2e+170) tmp = 180.0 * (atan(((-A - hypot(A, 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, -8.5e+107], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.2e+170], N[(180.0 * N[(N[ArcTan[N[(N[((-A) - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -8.5 \cdot 10^{+107}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.2 \cdot 10^{+170}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(A, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -8.4999999999999999e107Initial program 85.0%
associate-*l/85.0%
*-lft-identity85.0%
+-commutative85.0%
unpow285.0%
unpow285.0%
hypot-def95.9%
Simplified95.9%
Taylor expanded in B around inf 91.7%
neg-mul-191.7%
unsub-neg91.7%
Simplified91.7%
if -8.4999999999999999e107 < C < 6.2e170Initial program 51.0%
associate-*l/51.0%
*-lft-identity51.0%
+-commutative51.0%
unpow251.0%
unpow251.0%
hypot-def78.8%
Simplified78.8%
Taylor expanded in C around 0 44.7%
mul-1-neg44.7%
+-commutative44.7%
unpow244.7%
unpow244.7%
hypot-def72.7%
Simplified72.7%
if 6.2e170 < C Initial program 4.4%
associate-*l/4.4%
*-lft-identity4.4%
+-commutative4.4%
unpow24.4%
unpow24.4%
hypot-def36.6%
Simplified36.6%
Taylor expanded in C around inf 38.4%
fma-def38.4%
associate--l+50.3%
unpow250.3%
fma-def50.3%
unpow250.3%
unpow250.3%
difference-of-squares64.6%
distribute-rgt1-in64.6%
metadata-eval64.6%
mul0-lft64.6%
mul-1-neg64.6%
*-commutative64.6%
associate-*r/64.6%
Simplified64.6%
Taylor expanded in B around 0 64.6%
Simplified65.0%
Taylor expanded in B around 0 99.8%
Final simplification79.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- (- A) B) B)) PI))))
(if (<= C -1.12e-33)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= C -3.5e-119)
t_0
(if (<= C -2.25e-220)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= C 1e-258)
t_0
(if (<= C 4.8e-107)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= C 6.5e+53)
t_0
(/ (* 180.0 (atan (* -0.5 (/ B C)))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((-A - B) / B)) / ((double) M_PI));
double tmp;
if (C <= -1.12e-33) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (C <= -3.5e-119) {
tmp = t_0;
} else if (C <= -2.25e-220) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (C <= 1e-258) {
tmp = t_0;
} else if (C <= 4.8e-107) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (C <= 6.5e+53) {
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.atan(((-A - B) / B)) / Math.PI);
double tmp;
if (C <= -1.12e-33) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (C <= -3.5e-119) {
tmp = t_0;
} else if (C <= -2.25e-220) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (C <= 1e-258) {
tmp = t_0;
} else if (C <= 4.8e-107) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (C <= 6.5e+53) {
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.atan(((-A - B) / B)) / math.pi) tmp = 0 if C <= -1.12e-33: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif C <= -3.5e-119: tmp = t_0 elif C <= -2.25e-220: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif C <= 1e-258: tmp = t_0 elif C <= 4.8e-107: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif C <= 6.5e+53: 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(180.0 * Float64(atan(Float64(Float64(Float64(-A) - B) / B)) / pi)) tmp = 0.0 if (C <= -1.12e-33) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (C <= -3.5e-119) tmp = t_0; elseif (C <= -2.25e-220) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (C <= 1e-258) tmp = t_0; elseif (C <= 4.8e-107) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (C <= 6.5e+53) 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 * (atan(((-A - B) / B)) / pi); tmp = 0.0; if (C <= -1.12e-33) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (C <= -3.5e-119) tmp = t_0; elseif (C <= -2.25e-220) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (C <= 1e-258) tmp = t_0; elseif (C <= 4.8e-107) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (C <= 6.5e+53) 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[(180.0 * N[(N[ArcTan[N[(N[((-A) - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.12e-33], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -3.5e-119], t$95$0, If[LessEqual[C, -2.25e-220], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1e-258], t$95$0, If[LessEqual[C, 4.8e-107], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.5e+53], 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 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - B}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -1.12 \cdot 10^{-33}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -3.5 \cdot 10^{-119}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;C \leq -2.25 \cdot 10^{-220}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;C \leq 10^{-258}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;C \leq 4.8 \cdot 10^{-107}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.5 \cdot 10^{+53}:\\
\;\;\;\;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.11999999999999999e-33Initial program 74.1%
associate-*l/74.1%
*-lft-identity74.1%
+-commutative74.1%
unpow274.1%
unpow274.1%
hypot-def95.3%
Simplified95.3%
Taylor expanded in C around -inf 70.7%
if -1.11999999999999999e-33 < C < -3.5e-119 or -2.24999999999999984e-220 < C < 9.99999999999999954e-259 or 4.79999999999999989e-107 < C < 6.50000000000000017e53Initial program 56.5%
associate-*l/56.5%
*-lft-identity56.5%
+-commutative56.5%
unpow256.5%
unpow256.5%
hypot-def74.1%
Simplified74.1%
Taylor expanded in C around 0 56.2%
mul-1-neg56.2%
+-commutative56.2%
unpow256.2%
unpow256.2%
hypot-def73.8%
Simplified73.8%
Taylor expanded in A around 0 60.0%
if -3.5e-119 < C < -2.24999999999999984e-220Initial program 44.5%
associate-*l/44.5%
*-lft-identity44.5%
+-commutative44.5%
unpow244.5%
unpow244.5%
hypot-def76.1%
Simplified76.1%
Taylor expanded in A around -inf 48.4%
unpow248.4%
Simplified48.4%
Taylor expanded in B around 0 54.0%
associate-*r/54.2%
associate-/l*54.2%
Simplified54.2%
associate-/r/54.3%
Applied egg-rr54.3%
if 9.99999999999999954e-259 < C < 4.79999999999999989e-107Initial program 55.2%
associate-*l/55.2%
*-lft-identity55.2%
+-commutative55.2%
unpow255.2%
unpow255.2%
hypot-def84.6%
Simplified84.6%
Taylor expanded in C around 0 55.1%
mul-1-neg55.1%
+-commutative55.1%
unpow255.1%
unpow255.1%
hypot-def84.7%
Simplified84.7%
Taylor expanded in B around -inf 60.3%
mul-1-neg60.3%
unsub-neg60.3%
Simplified60.3%
if 6.50000000000000017e53 < C Initial program 17.5%
associate-*l/17.5%
*-lft-identity17.5%
+-commutative17.5%
unpow217.5%
unpow217.5%
hypot-def51.4%
Simplified51.4%
Taylor expanded in C around inf 29.1%
fma-def29.1%
associate--l+42.2%
unpow242.2%
fma-def42.2%
unpow242.2%
unpow242.2%
difference-of-squares51.1%
distribute-rgt1-in51.1%
metadata-eval51.1%
mul0-lft51.1%
mul-1-neg51.1%
*-commutative51.1%
associate-*r/51.1%
Simplified51.1%
Taylor expanded in B around 0 51.1%
Simplified51.3%
Taylor expanded in B around 0 74.7%
Final simplification66.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
(if (<= B -1.4e+168)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -1.25e-214)
t_0
(if (<= B 4.8e-195)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 5.2e-61) t_0 (* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
double tmp;
if (B <= -1.4e+168) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -1.25e-214) {
tmp = t_0;
} else if (B <= 4.8e-195) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 5.2e-61) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
double tmp;
if (B <= -1.4e+168) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -1.25e-214) {
tmp = t_0;
} else if (B <= 4.8e-195) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 5.2e-61) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) tmp = 0 if B <= -1.4e+168: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -1.25e-214: tmp = t_0 elif B <= 4.8e-195: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 5.2e-61: tmp = t_0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)) tmp = 0.0 if (B <= -1.4e+168) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -1.25e-214) tmp = t_0; elseif (B <= 4.8e-195) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 5.2e-61) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((-0.5 * (B / C))) / pi); tmp = 0.0; if (B <= -1.4e+168) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -1.25e-214) tmp = t_0; elseif (B <= 4.8e-195) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 5.2e-61) tmp = t_0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.4e+168], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.25e-214], t$95$0, If[LessEqual[B, 4.8e-195], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.2e-61], t$95$0, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{if}\;B \leq -1.4 \cdot 10^{+168}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -1.25 \cdot 10^{-214}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 4.8 \cdot 10^{-195}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 5.2 \cdot 10^{-61}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.39999999999999995e168Initial program 18.2%
associate-*l/18.2%
*-lft-identity18.2%
+-commutative18.2%
unpow218.2%
unpow218.2%
hypot-def96.0%
Simplified96.0%
Taylor expanded in B around -inf 93.2%
if -1.39999999999999995e168 < B < -1.2499999999999999e-214 or 4.8e-195 < B < 5.20000000000000021e-61Initial program 57.1%
associate-*l/57.1%
*-lft-identity57.1%
+-commutative57.1%
unpow257.1%
unpow257.1%
hypot-def66.7%
Simplified66.7%
Taylor expanded in C around inf 11.2%
fma-def11.2%
associate--l+22.2%
unpow222.2%
fma-def22.2%
unpow222.2%
unpow222.2%
difference-of-squares30.0%
distribute-rgt1-in30.0%
metadata-eval30.0%
mul0-lft30.0%
mul-1-neg30.0%
*-commutative30.0%
associate-*r/30.0%
Simplified30.0%
Taylor expanded in B around 0 30.0%
Simplified30.1%
Taylor expanded in B around 0 36.8%
if -1.2499999999999999e-214 < B < 4.8e-195Initial program 69.4%
associate-*l/69.4%
*-lft-identity69.4%
+-commutative69.4%
unpow269.4%
unpow269.4%
hypot-def95.2%
Simplified95.2%
div-sub62.6%
sub-neg62.6%
Applied egg-rr62.6%
sub-neg62.6%
Simplified62.6%
Taylor expanded in C around inf 8.4%
distribute-rgt1-in8.4%
metadata-eval8.4%
mul0-lft34.9%
metadata-eval34.9%
Simplified34.9%
if 5.20000000000000021e-61 < B Initial program 46.6%
associate-*l/46.6%
*-lft-identity46.6%
+-commutative46.6%
unpow246.6%
unpow246.6%
hypot-def75.5%
Simplified75.5%
Taylor expanded in B around inf 59.2%
Final simplification49.0%
(FPCore (A B C)
:precision binary64
(if (<= B -1.4e+168)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -2.1e-217)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(if (<= B 9.5e-165)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 5.6e-34)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(* 180.0 (/ (atan -1.0) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.4e+168) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -2.1e-217) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else if (B <= 9.5e-165) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 5.6e-34) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((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.4e+168) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -2.1e-217) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else if (B <= 9.5e-165) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 5.6e-34) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.4e+168: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -2.1e-217: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) elif B <= 9.5e-165: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 5.6e-34: tmp = 180.0 * (math.atan((0.5 * (B / A))) / 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.4e+168) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -2.1e-217) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); elseif (B <= 9.5e-165) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 5.6e-34) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / 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.4e+168) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -2.1e-217) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); elseif (B <= 9.5e-165) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 5.6e-34) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.4e+168], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.1e-217], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.5e-165], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.6e-34], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $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 -1.4 \cdot 10^{+168}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -2.1 \cdot 10^{-217}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 9.5 \cdot 10^{-165}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 5.6 \cdot 10^{-34}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.39999999999999995e168Initial program 18.2%
associate-*l/18.2%
*-lft-identity18.2%
+-commutative18.2%
unpow218.2%
unpow218.2%
hypot-def96.0%
Simplified96.0%
Taylor expanded in B around -inf 93.2%
if -1.39999999999999995e168 < B < -2.1e-217Initial program 60.3%
associate-*l/60.3%
*-lft-identity60.3%
+-commutative60.3%
unpow260.3%
unpow260.3%
hypot-def67.2%
Simplified67.2%
Taylor expanded in C around inf 10.0%
fma-def10.0%
associate--l+21.6%
unpow221.6%
fma-def21.6%
unpow221.6%
unpow221.6%
difference-of-squares30.4%
distribute-rgt1-in30.4%
metadata-eval30.4%
mul0-lft30.4%
mul-1-neg30.4%
*-commutative30.4%
associate-*r/30.4%
Simplified30.4%
Taylor expanded in B around 0 30.4%
Simplified30.4%
Taylor expanded in B around 0 38.0%
if -2.1e-217 < B < 9.49999999999999973e-165Initial program 66.1%
associate-*l/66.1%
*-lft-identity66.1%
+-commutative66.1%
unpow266.1%
unpow266.1%
hypot-def92.2%
Simplified92.2%
div-sub60.2%
sub-neg60.2%
Applied egg-rr60.2%
sub-neg60.2%
Simplified60.2%
Taylor expanded in C around inf 7.7%
distribute-rgt1-in7.7%
metadata-eval7.7%
mul0-lft34.5%
metadata-eval34.5%
Simplified34.5%
if 9.49999999999999973e-165 < B < 5.59999999999999994e-34Initial program 58.5%
associate-*l/58.5%
*-lft-identity58.5%
+-commutative58.5%
unpow258.5%
unpow258.5%
hypot-def67.3%
Simplified67.3%
Taylor expanded in A around -inf 36.8%
if 5.59999999999999994e-34 < B Initial program 42.4%
associate-*l/42.4%
*-lft-identity42.4%
+-commutative42.4%
unpow242.4%
unpow242.4%
hypot-def75.0%
Simplified75.0%
Taylor expanded in B around inf 62.5%
Final simplification49.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) PI))))
(if (<= A -1.9e+22)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -7.5e-87)
t_0
(if (<= A -5.6e-251)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(if (<= A 1.1e-276) 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) / ((double) M_PI));
double tmp;
if (A <= -1.9e+22) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -7.5e-87) {
tmp = t_0;
} else if (A <= -5.6e-251) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else if (A <= 1.1e-276) {
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) / Math.PI);
double tmp;
if (A <= -1.9e+22) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -7.5e-87) {
tmp = t_0;
} else if (A <= -5.6e-251) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else if (A <= 1.1e-276) {
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) / math.pi) tmp = 0 if A <= -1.9e+22: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -7.5e-87: tmp = t_0 elif A <= -5.6e-251: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) elif A <= 1.1e-276: 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(-1.0) / pi)) tmp = 0.0 if (A <= -1.9e+22) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -7.5e-87) tmp = t_0; elseif (A <= -5.6e-251) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); elseif (A <= 1.1e-276) 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) / pi); tmp = 0.0; if (A <= -1.9e+22) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -7.5e-87) tmp = t_0; elseif (A <= -5.6e-251) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); elseif (A <= 1.1e-276) 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[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.9e+22], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -7.5e-87], t$95$0, If[LessEqual[A, -5.6e-251], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.1e-276], 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} -1}{\pi}\\
\mathbf{if}\;A \leq -1.9 \cdot 10^{+22}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -7.5 \cdot 10^{-87}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -5.6 \cdot 10^{-251}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.1 \cdot 10^{-276}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.9000000000000002e22Initial program 23.2%
associate-*l/23.2%
*-lft-identity23.2%
+-commutative23.2%
unpow223.2%
unpow223.2%
hypot-def64.5%
Simplified64.5%
Taylor expanded in A around -inf 64.0%
if -1.9000000000000002e22 < A < -7.5000000000000002e-87 or -5.59999999999999978e-251 < A < 1.0999999999999999e-276Initial program 51.9%
associate-*l/51.9%
*-lft-identity51.9%
+-commutative51.9%
unpow251.9%
unpow251.9%
hypot-def76.8%
Simplified76.8%
Taylor expanded in B around inf 44.6%
if -7.5000000000000002e-87 < A < -5.59999999999999978e-251Initial program 55.6%
associate-*l/55.6%
*-lft-identity55.6%
+-commutative55.6%
unpow255.6%
unpow255.6%
hypot-def67.4%
Simplified67.4%
Taylor expanded in C around inf 15.8%
fma-def15.8%
associate--l+18.4%
unpow218.4%
fma-def18.4%
unpow218.4%
unpow218.4%
difference-of-squares18.4%
distribute-rgt1-in18.4%
metadata-eval18.4%
mul0-lft18.4%
mul-1-neg18.4%
*-commutative18.4%
associate-*r/18.4%
Simplified18.4%
Taylor expanded in B around 0 18.4%
Simplified18.4%
Taylor expanded in B around 0 33.5%
if 1.0999999999999999e-276 < A Initial program 67.4%
associate-*l/67.4%
*-lft-identity67.4%
+-commutative67.4%
unpow267.4%
unpow267.4%
hypot-def88.0%
Simplified88.0%
Taylor expanded in C around 0 58.2%
mul-1-neg58.2%
+-commutative58.2%
unpow258.2%
unpow258.2%
hypot-def73.8%
Simplified73.8%
Taylor expanded in B around -inf 59.4%
mul-1-neg59.4%
unsub-neg59.4%
Simplified59.4%
Final simplification54.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))
(if (<= C -4.6e-55)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= C -1.1e-180)
t_0
(if (<= C 2.15e-294)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= C 0.9) t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
double tmp;
if (C <= -4.6e-55) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (C <= -1.1e-180) {
tmp = t_0;
} else if (C <= 2.15e-294) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (C <= 0.9) {
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.atan((1.0 - (A / B))) / Math.PI);
double tmp;
if (C <= -4.6e-55) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (C <= -1.1e-180) {
tmp = t_0;
} else if (C <= 2.15e-294) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (C <= 0.9) {
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.atan((1.0 - (A / B))) / math.pi) tmp = 0 if C <= -4.6e-55: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif C <= -1.1e-180: tmp = t_0 elif C <= 2.15e-294: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif C <= 0.9: 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(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)) tmp = 0.0 if (C <= -4.6e-55) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (C <= -1.1e-180) tmp = t_0; elseif (C <= 2.15e-294) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (C <= 0.9) tmp = t_0; 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) t_0 = 180.0 * (atan((1.0 - (A / B))) / pi); tmp = 0.0; if (C <= -4.6e-55) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (C <= -1.1e-180) tmp = t_0; elseif (C <= 2.15e-294) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (C <= 0.9) 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[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -4.6e-55], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -1.1e-180], t$95$0, If[LessEqual[C, 2.15e-294], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 0.9], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -4.6 \cdot 10^{-55}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -1.1 \cdot 10^{-180}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;C \leq 2.15 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;C \leq 0.9:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -4.60000000000000023e-55Initial program 74.8%
associate-*l/74.8%
*-lft-identity74.8%
+-commutative74.8%
unpow274.8%
unpow274.8%
hypot-def95.4%
Simplified95.4%
Taylor expanded in C around -inf 70.3%
if -4.60000000000000023e-55 < C < -1.10000000000000007e-180 or 2.1500000000000001e-294 < C < 0.900000000000000022Initial program 55.5%
associate-*l/55.5%
*-lft-identity55.5%
+-commutative55.5%
unpow255.5%
unpow255.5%
hypot-def81.8%
Simplified81.8%
Taylor expanded in C around 0 54.6%
mul-1-neg54.6%
+-commutative54.6%
unpow254.6%
unpow254.6%
hypot-def81.0%
Simplified81.0%
Taylor expanded in B around -inf 54.0%
mul-1-neg54.0%
unsub-neg54.0%
Simplified54.0%
if -1.10000000000000007e-180 < C < 2.1500000000000001e-294Initial program 53.9%
associate-*l/53.9%
*-lft-identity53.9%
+-commutative53.9%
unpow253.9%
unpow253.9%
hypot-def68.4%
Simplified68.4%
Taylor expanded in A around -inf 52.2%
if 0.900000000000000022 < C Initial program 18.0%
associate-*l/18.0%
*-lft-identity18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-def50.8%
Simplified50.8%
Taylor expanded in C around inf 26.7%
fma-def26.7%
associate--l+39.9%
unpow239.9%
fma-def39.9%
unpow239.9%
unpow239.9%
difference-of-squares48.0%
distribute-rgt1-in48.0%
metadata-eval48.0%
mul0-lft48.0%
mul-1-neg48.0%
*-commutative48.0%
associate-*r/48.0%
Simplified48.0%
Taylor expanded in B around 0 48.0%
Simplified48.2%
Taylor expanded in B around 0 68.8%
Final simplification62.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))
(if (<= C -5.4e-47)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= C -1.9e-179)
t_0
(if (<= C 7e-295)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= C 0.0012) t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
double tmp;
if (C <= -5.4e-47) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (C <= -1.9e-179) {
tmp = t_0;
} else if (C <= 7e-295) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (C <= 0.0012) {
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.atan((1.0 - (A / B))) / Math.PI);
double tmp;
if (C <= -5.4e-47) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (C <= -1.9e-179) {
tmp = t_0;
} else if (C <= 7e-295) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (C <= 0.0012) {
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.atan((1.0 - (A / B))) / math.pi) tmp = 0 if C <= -5.4e-47: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif C <= -1.9e-179: tmp = t_0 elif C <= 7e-295: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif C <= 0.0012: 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(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)) tmp = 0.0 if (C <= -5.4e-47) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (C <= -1.9e-179) tmp = t_0; elseif (C <= 7e-295) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (C <= 0.0012) tmp = t_0; 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) t_0 = 180.0 * (atan((1.0 - (A / B))) / pi); tmp = 0.0; if (C <= -5.4e-47) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (C <= -1.9e-179) tmp = t_0; elseif (C <= 7e-295) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (C <= 0.0012) 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[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -5.4e-47], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -1.9e-179], t$95$0, If[LessEqual[C, 7e-295], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 0.0012], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -5.4 \cdot 10^{-47}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -1.9 \cdot 10^{-179}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;C \leq 7 \cdot 10^{-295}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;C \leq 0.0012:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -5.3999999999999996e-47Initial program 74.8%
associate-*l/74.8%
*-lft-identity74.8%
+-commutative74.8%
unpow274.8%
unpow274.8%
hypot-def95.4%
Simplified95.4%
Taylor expanded in C around -inf 70.3%
if -5.3999999999999996e-47 < C < -1.89999999999999987e-179 or 6.99999999999999977e-295 < C < 0.00119999999999999989Initial program 55.5%
associate-*l/55.5%
*-lft-identity55.5%
+-commutative55.5%
unpow255.5%
unpow255.5%
hypot-def81.8%
Simplified81.8%
Taylor expanded in C around 0 54.6%
mul-1-neg54.6%
+-commutative54.6%
unpow254.6%
unpow254.6%
hypot-def81.0%
Simplified81.0%
Taylor expanded in B around -inf 54.0%
mul-1-neg54.0%
unsub-neg54.0%
Simplified54.0%
if -1.89999999999999987e-179 < C < 6.99999999999999977e-295Initial program 53.9%
associate-*l/53.9%
*-lft-identity53.9%
+-commutative53.9%
unpow253.9%
unpow253.9%
hypot-def68.4%
Simplified68.4%
Taylor expanded in A around -inf 35.4%
unpow235.4%
Simplified35.4%
Taylor expanded in B around 0 52.2%
associate-*r/52.3%
associate-/l*50.8%
Simplified50.8%
associate-/r/52.4%
Applied egg-rr52.4%
if 0.00119999999999999989 < C Initial program 18.0%
associate-*l/18.0%
*-lft-identity18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-def50.8%
Simplified50.8%
Taylor expanded in C around inf 26.7%
fma-def26.7%
associate--l+39.9%
unpow239.9%
fma-def39.9%
unpow239.9%
unpow239.9%
difference-of-squares48.0%
distribute-rgt1-in48.0%
metadata-eval48.0%
mul0-lft48.0%
mul-1-neg48.0%
*-commutative48.0%
associate-*r/48.0%
Simplified48.0%
Taylor expanded in B around 0 48.0%
Simplified48.2%
Taylor expanded in B around 0 68.8%
Final simplification62.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (- 1.0 (/ A B))) PI))))
(if (<= C -8.2e-54)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= C -5.5e-181)
t_0
(if (<= C 4e-295)
(* (/ 180.0 PI) (atan (* 0.5 (/ B A))))
(if (<= C 0.85) t_0 (/ (* 180.0 (atan (* -0.5 (/ B C)))) PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
double tmp;
if (C <= -8.2e-54) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (C <= -5.5e-181) {
tmp = t_0;
} else if (C <= 4e-295) {
tmp = (180.0 / ((double) M_PI)) * atan((0.5 * (B / A)));
} else if (C <= 0.85) {
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.atan((1.0 - (A / B))) / Math.PI);
double tmp;
if (C <= -8.2e-54) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (C <= -5.5e-181) {
tmp = t_0;
} else if (C <= 4e-295) {
tmp = (180.0 / Math.PI) * Math.atan((0.5 * (B / A)));
} else if (C <= 0.85) {
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.atan((1.0 - (A / B))) / math.pi) tmp = 0 if C <= -8.2e-54: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif C <= -5.5e-181: tmp = t_0 elif C <= 4e-295: tmp = (180.0 / math.pi) * math.atan((0.5 * (B / A))) elif C <= 0.85: 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(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)) tmp = 0.0 if (C <= -8.2e-54) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (C <= -5.5e-181) tmp = t_0; elseif (C <= 4e-295) tmp = Float64(Float64(180.0 / pi) * atan(Float64(0.5 * Float64(B / A)))); elseif (C <= 0.85) 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 * (atan((1.0 - (A / B))) / pi); tmp = 0.0; if (C <= -8.2e-54) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (C <= -5.5e-181) tmp = t_0; elseif (C <= 4e-295) tmp = (180.0 / pi) * atan((0.5 * (B / A))); elseif (C <= 0.85) 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[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -8.2e-54], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -5.5e-181], t$95$0, If[LessEqual[C, 4e-295], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 0.85], 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 := 180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -8.2 \cdot 10^{-54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -5.5 \cdot 10^{-181}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;C \leq 4 \cdot 10^{-295}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{elif}\;C \leq 0.85:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -8.2000000000000001e-54Initial program 74.8%
associate-*l/74.8%
*-lft-identity74.8%
+-commutative74.8%
unpow274.8%
unpow274.8%
hypot-def95.4%
Simplified95.4%
Taylor expanded in C around -inf 70.3%
if -8.2000000000000001e-54 < C < -5.50000000000000033e-181 or 4.00000000000000024e-295 < C < 0.849999999999999978Initial program 55.5%
associate-*l/55.5%
*-lft-identity55.5%
+-commutative55.5%
unpow255.5%
unpow255.5%
hypot-def81.8%
Simplified81.8%
Taylor expanded in C around 0 54.6%
mul-1-neg54.6%
+-commutative54.6%
unpow254.6%
unpow254.6%
hypot-def81.0%
Simplified81.0%
Taylor expanded in B around -inf 54.0%
mul-1-neg54.0%
unsub-neg54.0%
Simplified54.0%
if -5.50000000000000033e-181 < C < 4.00000000000000024e-295Initial program 53.9%
associate-*l/53.9%
*-lft-identity53.9%
+-commutative53.9%
unpow253.9%
unpow253.9%
hypot-def68.4%
Simplified68.4%
Taylor expanded in A around -inf 35.4%
unpow235.4%
Simplified35.4%
Taylor expanded in B around 0 52.2%
associate-*r/52.3%
associate-/l*50.8%
Simplified50.8%
associate-/r/52.4%
Applied egg-rr52.4%
if 0.849999999999999978 < C Initial program 18.0%
associate-*l/18.0%
*-lft-identity18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-def50.8%
Simplified50.8%
Taylor expanded in C around inf 26.7%
fma-def26.7%
associate--l+39.9%
unpow239.9%
fma-def39.9%
unpow239.9%
unpow239.9%
difference-of-squares48.0%
distribute-rgt1-in48.0%
metadata-eval48.0%
mul0-lft48.0%
mul-1-neg48.0%
*-commutative48.0%
associate-*r/48.0%
Simplified48.0%
Taylor expanded in B around 0 48.0%
Simplified48.2%
Taylor expanded in B around 0 69.1%
Final simplification63.0%
(FPCore (A B C) :precision binary64 (if (<= B 1.25e-42) (* 180.0 (/ (atan (/ (- (+ C B) A) B)) PI)) (* 180.0 (/ (atan (/ (- (- A) B) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1.25e-42) {
tmp = 180.0 * (atan((((C + B) - A) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-A - B) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 1.25e-42) {
tmp = 180.0 * (Math.atan((((C + B) - A) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-A - B) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 1.25e-42: tmp = 180.0 * (math.atan((((C + B) - A) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((-A - B) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 1.25e-42) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - A) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - B) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 1.25e-42) tmp = 180.0 * (atan((((C + B) - A) / B)) / pi); else tmp = 180.0 * (atan(((-A - B) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 1.25e-42], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[((-A) - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.25 \cdot 10^{-42}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - B}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < 1.25000000000000001e-42Initial program 56.0%
associate-*l/56.0%
*-lft-identity56.0%
+-commutative56.0%
unpow256.0%
unpow256.0%
hypot-def78.6%
Simplified78.6%
Taylor expanded in B around -inf 61.7%
if 1.25000000000000001e-42 < B Initial program 41.9%
associate-*l/41.9%
*-lft-identity41.9%
+-commutative41.9%
unpow241.9%
unpow241.9%
hypot-def74.0%
Simplified74.0%
Taylor expanded in C around 0 36.2%
mul-1-neg36.2%
+-commutative36.2%
unpow236.2%
unpow236.2%
hypot-def66.0%
Simplified66.0%
Taylor expanded in A around 0 65.7%
Final simplification62.8%
(FPCore (A B C) :precision binary64 (if (<= B -1e-139) (* 180.0 (/ (atan (/ (- (+ C B) A) B)) PI)) (* 180.0 (/ (atan (/ (- (- C B) A) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1e-139) {
tmp = 180.0 * (atan((((C + B) - A) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((C - B) - A) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1e-139) {
tmp = 180.0 * (Math.atan((((C + B) - A) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1e-139: tmp = 180.0 * (math.atan((((C + B) - A) / B)) / math.pi) else: tmp = 180.0 * (math.atan((((C - B) - A) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1e-139) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - A) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1e-139) tmp = 180.0 * (atan((((C + B) - A) / B)) / pi); else tmp = 180.0 * (atan((((C - B) - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1e-139], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1 \cdot 10^{-139}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -1.00000000000000003e-139Initial program 47.4%
associate-*l/47.4%
*-lft-identity47.4%
+-commutative47.4%
unpow247.4%
unpow247.4%
hypot-def77.2%
Simplified77.2%
Taylor expanded in B around -inf 72.6%
if -1.00000000000000003e-139 < B Initial program 54.1%
associate-*l/54.1%
*-lft-identity54.1%
+-commutative54.1%
unpow254.1%
unpow254.1%
hypot-def77.4%
Simplified77.4%
Taylor expanded in B around inf 64.3%
neg-mul-164.3%
unsub-neg64.3%
Simplified64.3%
Final simplification66.7%
(FPCore (A B C) :precision binary64 (if (<= B 1e-134) (* (/ 180.0 PI) (atan (/ (+ C (- B A)) B))) (* 180.0 (/ (atan (/ (- (- C B) A) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1e-134) {
tmp = (180.0 / ((double) M_PI)) * atan(((C + (B - A)) / B));
} else {
tmp = 180.0 * (atan((((C - B) - A) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 1e-134) {
tmp = (180.0 / Math.PI) * Math.atan(((C + (B - A)) / B));
} else {
tmp = 180.0 * (Math.atan((((C - B) - A) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 1e-134: tmp = (180.0 / math.pi) * math.atan(((C + (B - A)) / B)) else: tmp = 180.0 * (math.atan((((C - B) - A) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 1e-134) tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(C + Float64(B - A)) / B))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 1e-134) tmp = (180.0 / pi) * atan(((C + (B - A)) / B)); else tmp = 180.0 * (atan((((C - B) - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 1e-134], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 10^{-134}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < 1.00000000000000004e-134Initial program 53.9%
associate-*r/54.0%
associate-*l/54.0%
associate-*l/54.0%
*-lft-identity54.0%
sub-neg54.0%
associate-+l-53.5%
sub-neg53.5%
remove-double-neg53.5%
+-commutative53.5%
unpow253.5%
unpow253.5%
hypot-def70.5%
Simplified70.5%
Taylor expanded in B around -inf 63.9%
neg-mul-163.9%
unsub-neg63.9%
Simplified63.9%
if 1.00000000000000004e-134 < B Initial program 49.1%
associate-*l/49.1%
*-lft-identity49.1%
+-commutative49.1%
unpow249.1%
unpow249.1%
hypot-def73.7%
Simplified73.7%
Taylor expanded in B around inf 71.4%
neg-mul-171.4%
unsub-neg71.4%
Simplified71.4%
Final simplification66.7%
(FPCore (A B C)
:precision binary64
(if (<= B -2.6e-153)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.12e-126)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.6e-153) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.12e-126) {
tmp = 180.0 * (atan(0.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 <= -2.6e-153) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.12e-126) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.6e-153: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.12e-126: tmp = 180.0 * (math.atan(0.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 <= -2.6e-153) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.12e-126) tmp = Float64(180.0 * Float64(atan(0.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 <= -2.6e-153) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.12e-126) tmp = 180.0 * (atan(0.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.6e-153], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.12e-126], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.6 \cdot 10^{-153}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.12 \cdot 10^{-126}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.6000000000000001e-153Initial program 48.8%
associate-*l/48.8%
*-lft-identity48.8%
+-commutative48.8%
unpow248.8%
unpow248.8%
hypot-def77.8%
Simplified77.8%
Taylor expanded in B around -inf 50.1%
if -2.6000000000000001e-153 < B < 1.12e-126Initial program 58.4%
associate-*l/58.4%
*-lft-identity58.4%
+-commutative58.4%
unpow258.4%
unpow258.4%
hypot-def81.3%
Simplified81.3%
div-sub54.6%
sub-neg54.6%
Applied egg-rr54.6%
sub-neg54.6%
Simplified54.6%
Taylor expanded in C around inf 7.4%
distribute-rgt1-in7.4%
metadata-eval7.4%
mul0-lft29.5%
metadata-eval29.5%
Simplified29.5%
if 1.12e-126 < B Initial program 49.0%
associate-*l/49.0%
*-lft-identity49.0%
+-commutative49.0%
unpow249.0%
unpow249.0%
hypot-def73.4%
Simplified73.4%
Taylor expanded in B around inf 53.5%
Final simplification44.4%
(FPCore (A B C) :precision binary64 (if (<= B 1.15e-126) (* 180.0 (/ (atan 0.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1.15e-126) {
tmp = 180.0 * (atan(0.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.15e-126) {
tmp = 180.0 * (Math.atan(0.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.15e-126: tmp = 180.0 * (math.atan(0.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.15e-126) tmp = Float64(180.0 * Float64(atan(0.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.15e-126) tmp = 180.0 * (atan(0.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 1.15e-126], N[(180.0 * N[(N[ArcTan[0.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 1.15 \cdot 10^{-126}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 1.15000000000000005e-126Initial program 53.9%
associate-*l/53.9%
*-lft-identity53.9%
+-commutative53.9%
unpow253.9%
unpow253.9%
hypot-def79.6%
Simplified79.6%
div-sub64.3%
sub-neg64.3%
Applied egg-rr64.3%
sub-neg64.3%
Simplified64.3%
Taylor expanded in C around inf 6.2%
distribute-rgt1-in6.2%
metadata-eval6.2%
mul0-lft18.5%
metadata-eval18.5%
Simplified18.5%
if 1.15000000000000005e-126 < B Initial program 49.0%
associate-*l/49.0%
*-lft-identity49.0%
+-commutative49.0%
unpow249.0%
unpow249.0%
hypot-def73.4%
Simplified73.4%
Taylor expanded in B around inf 53.5%
Final simplification31.2%
(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 52.1%
associate-*l/52.1%
*-lft-identity52.1%
+-commutative52.1%
unpow252.1%
unpow252.1%
hypot-def77.3%
Simplified77.3%
Taylor expanded in B around inf 22.4%
Final simplification22.4%
herbie shell --seed 2023229
(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)))