
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C) :precision binary64 (if (<= A -1.5e+70) (* (atan (* B (/ 0.5 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 <= -1.5e+70) {
tmp = atan((B * (0.5 / 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 <= -1.5e+70) {
tmp = Math.atan((B * (0.5 / 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 <= -1.5e+70: tmp = math.atan((B * (0.5 / 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 <= -1.5e+70) tmp = Float64(atan(Float64(B * Float64(0.5 / A))) * Float64(180.0 / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.5e+70) tmp = atan((B * (0.5 / 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, -1.5e+70], N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.5 \cdot 10^{+70}:\\
\;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.49999999999999988e70Initial program 16.3%
Taylor expanded in A around -inf 76.5%
associate-*r/76.5%
Simplified76.5%
Taylor expanded in B around 0 76.5%
associate-*r/76.7%
*-commutative76.7%
associate-/l*76.9%
associate-*r/76.9%
*-commutative76.9%
associate-*r/76.9%
Simplified76.9%
if -1.49999999999999988e70 < A Initial program 63.9%
associate-*l/63.9%
*-lft-identity63.9%
+-commutative63.9%
unpow263.9%
unpow263.9%
hypot-define86.3%
Simplified86.3%
(FPCore (A B C)
:precision binary64
(if (<= A -2.2e+71)
(* (atan (* B (/ 0.5 A))) (/ 180.0 PI))
(if (<= A 2.4e-94)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) PI))
(* -180.0 (/ (atan (/ (+ A (hypot A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.2e+71) {
tmp = atan((B * (0.5 / A))) * (180.0 / ((double) M_PI));
} else if (A <= 2.4e-94) {
tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / ((double) M_PI));
} else {
tmp = -180.0 * (atan(((A + hypot(A, B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.2e+71) {
tmp = Math.atan((B * (0.5 / A))) * (180.0 / Math.PI);
} else if (A <= 2.4e-94) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(C, B)) / B)) / Math.PI);
} else {
tmp = -180.0 * (Math.atan(((A + Math.hypot(A, B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.2e+71: tmp = math.atan((B * (0.5 / A))) * (180.0 / math.pi) elif A <= 2.4e-94: tmp = 180.0 * (math.atan(((C - math.hypot(C, B)) / B)) / math.pi) else: tmp = -180.0 * (math.atan(((A + math.hypot(A, B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.2e+71) tmp = Float64(atan(Float64(B * Float64(0.5 / A))) * Float64(180.0 / pi)); elseif (A <= 2.4e-94) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(C, B)) / B)) / pi)); else tmp = Float64(-180.0 * Float64(atan(Float64(Float64(A + hypot(A, B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.2e+71) tmp = atan((B * (0.5 / A))) * (180.0 / pi); elseif (A <= 2.4e-94) tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / pi); else tmp = -180.0 * (atan(((A + hypot(A, B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.2e+71], N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.4e-94], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(-180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.2 \cdot 10^{+71}:\\
\;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;A \leq 2.4 \cdot 10^{-94}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;-180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.19999999999999995e71Initial program 16.3%
Taylor expanded in A around -inf 76.5%
associate-*r/76.5%
Simplified76.5%
Taylor expanded in B around 0 76.5%
associate-*r/76.7%
*-commutative76.7%
associate-/l*76.9%
associate-*r/76.9%
*-commutative76.9%
associate-*r/76.9%
Simplified76.9%
if -2.19999999999999995e71 < A < 2.4e-94Initial program 57.6%
Taylor expanded in A around 0 56.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-define82.9%
Simplified82.9%
if 2.4e-94 < A Initial program 75.0%
Taylor expanded in C around 0 74.5%
associate-*r/74.5%
mul-1-neg74.5%
unpow274.5%
unpow274.5%
hypot-define85.9%
Simplified85.9%
associate-*r/85.9%
distribute-frac-neg85.9%
atan-neg85.9%
Applied egg-rr85.9%
distribute-rgt-neg-out85.9%
distribute-lft-neg-in85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in A around 0 74.5%
unpow274.5%
unpow274.5%
hypot-undefine85.9%
Simplified85.9%
(FPCore (A B C)
:precision binary64
(if (<= C -1.3e-40)
(* 180.0 (/ (atan (+ (/ C B) (- -1.0 (/ A B)))) PI))
(if (<= C 1.85e+66)
(* -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 <= -1.3e-40) {
tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / ((double) M_PI));
} else if (C <= 1.85e+66) {
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 <= -1.3e-40) {
tmp = 180.0 * (Math.atan(((C / B) + (-1.0 - (A / B)))) / Math.PI);
} else if (C <= 1.85e+66) {
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 <= -1.3e-40: tmp = 180.0 * (math.atan(((C / B) + (-1.0 - (A / B)))) / math.pi) elif C <= 1.85e+66: 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 <= -1.3e-40) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) + Float64(-1.0 - Float64(A / B)))) / pi)); elseif (C <= 1.85e+66) tmp = Float64(-180.0 * Float64(atan(Float64(Float64(A + hypot(A, B)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1.3e-40) tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / pi); elseif (C <= 1.85e+66) 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, -1.3e-40], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.85e+66], N[(-180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.3 \cdot 10^{-40}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + \left(-1 - \frac{A}{B}\right)\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.85 \cdot 10^{+66}:\\
\;\;\;\;-180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.3000000000000001e-40Initial program 75.6%
Taylor expanded in B around inf 82.5%
if -1.3000000000000001e-40 < C < 1.85e66Initial program 54.9%
Taylor expanded in C around 0 54.2%
associate-*r/54.2%
mul-1-neg54.2%
unpow254.2%
unpow254.2%
hypot-define79.3%
Simplified79.3%
associate-*r/79.3%
distribute-frac-neg79.3%
atan-neg79.3%
Applied egg-rr79.3%
distribute-rgt-neg-out79.3%
distribute-lft-neg-in79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in A around 0 54.2%
unpow254.2%
unpow254.2%
hypot-undefine79.3%
Simplified79.3%
if 1.85e66 < C Initial program 21.4%
Taylor expanded in A around 0 21.7%
+-commutative21.7%
unpow221.7%
unpow221.7%
hypot-define55.3%
Simplified55.3%
Taylor expanded in C around inf 80.6%
Final simplification80.5%
(FPCore (A B C) :precision binary64 (if (<= A -1.9e+70) (* (atan (* B (/ 0.5 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 <= -1.9e+70) {
tmp = atan((B * (0.5 / 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 <= -1.9e+70) {
tmp = Math.atan((B * (0.5 / 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 <= -1.9e+70: tmp = math.atan((B * (0.5 / 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 <= -1.9e+70) tmp = Float64(atan(Float64(B * Float64(0.5 / A))) * Float64(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 <= -1.9e+70) tmp = atan((B * (0.5 / 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, -1.9e+70], N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.9 \cdot 10^{+70}:\\
\;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{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 < -1.8999999999999999e70Initial program 16.3%
Taylor expanded in A around -inf 76.5%
associate-*r/76.5%
Simplified76.5%
Taylor expanded in B around 0 76.5%
associate-*r/76.7%
*-commutative76.7%
associate-/l*76.9%
associate-*r/76.9%
*-commutative76.9%
associate-*r/76.9%
Simplified76.9%
if -1.8999999999999999e70 < A Initial program 63.9%
Simplified86.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
(if (<= A -4.15e+71)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A -9.5e-49)
t_0
(if (<= A -6.2e-185)
(* 180.0 (/ (atan (* C (/ 2.0 B))) PI))
(if (<= A -2.4e-240)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 1.9e-47)
t_0
(* 180.0 (/ (atan (/ (* A -2.0) B)) 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 (A <= -4.15e+71) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= -9.5e-49) {
tmp = t_0;
} else if (A <= -6.2e-185) {
tmp = 180.0 * (atan((C * (2.0 / B))) / ((double) M_PI));
} else if (A <= -2.4e-240) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 1.9e-47) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((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 (A <= -4.15e+71) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= -9.5e-49) {
tmp = t_0;
} else if (A <= -6.2e-185) {
tmp = 180.0 * (Math.atan((C * (2.0 / B))) / Math.PI);
} else if (A <= -2.4e-240) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 1.9e-47) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) tmp = 0 if A <= -4.15e+71: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= -9.5e-49: tmp = t_0 elif A <= -6.2e-185: tmp = 180.0 * (math.atan((C * (2.0 / B))) / math.pi) elif A <= -2.4e-240: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 1.9e-47: tmp = t_0 else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / 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 (A <= -4.15e+71) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= -9.5e-49) tmp = t_0; elseif (A <= -6.2e-185) tmp = Float64(180.0 * Float64(atan(Float64(C * Float64(2.0 / B))) / pi)); elseif (A <= -2.4e-240) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 1.9e-47) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / 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 (A <= -4.15e+71) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= -9.5e-49) tmp = t_0; elseif (A <= -6.2e-185) tmp = 180.0 * (atan((C * (2.0 / B))) / pi); elseif (A <= -2.4e-240) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 1.9e-47) tmp = t_0; else tmp = 180.0 * (atan(((A * -2.0) / B)) / 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[A, -4.15e+71], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -9.5e-49], t$95$0, If[LessEqual[A, -6.2e-185], N[(180.0 * N[(N[ArcTan[N[(C * N[(2.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.4e-240], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.9e-47], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $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}\;A \leq -4.15 \cdot 10^{+71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -9.5 \cdot 10^{-49}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -6.2 \cdot 10^{-185}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(C \cdot \frac{2}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.4 \cdot 10^{-240}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 1.9 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.1499999999999998e71Initial program 16.5%
Taylor expanded in A around -inf 77.8%
associate-*r/77.8%
Simplified77.8%
if -4.1499999999999998e71 < A < -9.50000000000000006e-49 or -2.3999999999999999e-240 < A < 1.90000000000000007e-47Initial program 44.3%
Taylor expanded in A around 0 43.2%
+-commutative43.2%
unpow243.2%
unpow243.2%
hypot-define73.3%
Simplified73.3%
Taylor expanded in C around inf 43.7%
if -9.50000000000000006e-49 < A < -6.1999999999999994e-185Initial program 74.8%
Taylor expanded in C around -inf 41.5%
associate-*r*41.5%
mul-1-neg41.5%
associate-*r/41.5%
*-commutative41.5%
*-commutative41.5%
associate-*r/41.5%
metadata-eval41.5%
Simplified41.5%
Taylor expanded in B around -inf 41.5%
associate-/l*41.5%
associate-*r/41.5%
*-commutative41.5%
Simplified41.5%
Taylor expanded in A around 0 41.7%
if -6.1999999999999994e-185 < A < -2.3999999999999999e-240Initial program 65.8%
Taylor expanded in B around -inf 61.1%
if 1.90000000000000007e-47 < A Initial program 81.7%
associate-*l/81.7%
*-lft-identity81.7%
+-commutative81.7%
unpow281.7%
unpow281.7%
hypot-define97.0%
Simplified97.0%
Taylor expanded in A around inf 73.5%
*-commutative73.5%
Simplified73.5%
Final simplification58.8%
(FPCore (A B C)
:precision binary64
(if (<= C -2.45e-266)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= C 6e-72)
(* 180.0 (/ (atan (/ 1.0 (+ 1.0 (/ A B)))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -2.45e-266) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (C <= 6e-72) {
tmp = 180.0 * (atan((1.0 / (1.0 + (A / 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.45e-266) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (C <= 6e-72) {
tmp = 180.0 * (Math.atan((1.0 / (1.0 + (A / 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.45e-266: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif C <= 6e-72: tmp = 180.0 * (math.atan((1.0 / (1.0 + (A / 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.45e-266) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (C <= 6e-72) tmp = Float64(180.0 * Float64(atan(Float64(1.0 / Float64(1.0 + Float64(A / B)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -2.45e-266) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (C <= 6e-72) tmp = 180.0 * (atan((1.0 / (1.0 + (A / 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.45e-266], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6e-72], N[(180.0 * N[(N[ArcTan[N[(1.0 / N[(1.0 + N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -2.45 \cdot 10^{-266}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6 \cdot 10^{-72}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{1 + \frac{A}{B}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -2.4500000000000001e-266Initial program 69.9%
Taylor expanded in A around 0 65.7%
+-commutative65.7%
unpow265.7%
unpow265.7%
hypot-define82.6%
Simplified82.6%
Taylor expanded in C around 0 68.5%
if -2.4500000000000001e-266 < C < 6e-72Initial program 62.5%
associate--l-59.0%
+-commutative59.0%
unpow259.0%
unpow259.0%
hypot-undefine67.3%
associate-/r/67.3%
associate--r+80.7%
Applied egg-rr80.7%
Taylor expanded in B around -inf 43.6%
mul-1-neg43.6%
unsub-neg43.6%
Simplified43.6%
Taylor expanded in C around 0 43.0%
if 6e-72 < C Initial program 26.2%
Taylor expanded in A around 0 20.7%
+-commutative20.7%
unpow220.7%
unpow220.7%
hypot-define49.6%
Simplified49.6%
Taylor expanded in C around inf 68.4%
(FPCore (A B C)
:precision binary64
(if (<= C -1.12e-255)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= C 1.02e-51)
(* (atan (* B (/ 0.5 A))) (/ 180.0 PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1.12e-255) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (C <= 1.02e-51) {
tmp = atan((B * (0.5 / A))) * (180.0 / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1.12e-255) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (C <= 1.02e-51) {
tmp = Math.atan((B * (0.5 / A))) * (180.0 / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1.12e-255: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif C <= 1.02e-51: tmp = math.atan((B * (0.5 / A))) * (180.0 / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1.12e-255) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (C <= 1.02e-51) tmp = Float64(atan(Float64(B * Float64(0.5 / A))) * Float64(180.0 / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1.12e-255) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (C <= 1.02e-51) tmp = atan((B * (0.5 / A))) * (180.0 / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1.12e-255], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.02e-51], N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.12 \cdot 10^{-255}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.02 \cdot 10^{-51}:\\
\;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.12000000000000009e-255Initial program 70.8%
Taylor expanded in A around 0 66.6%
+-commutative66.6%
unpow266.6%
unpow266.6%
hypot-define83.9%
Simplified83.9%
Taylor expanded in C around 0 69.3%
if -1.12000000000000009e-255 < C < 1.01999999999999998e-51Initial program 59.2%
Taylor expanded in A around -inf 38.1%
associate-*r/38.1%
Simplified38.1%
Taylor expanded in B around 0 38.1%
associate-*r/38.2%
*-commutative38.2%
associate-/l*38.3%
associate-*r/38.3%
*-commutative38.3%
associate-*r/38.3%
Simplified38.3%
if 1.01999999999999998e-51 < C Initial program 26.1%
Taylor expanded in A around 0 20.1%
+-commutative20.1%
unpow220.1%
unpow220.1%
hypot-define50.5%
Simplified50.5%
Taylor expanded in C around inf 69.2%
(FPCore (A B C)
:precision binary64
(if (<= C -1.75e-255)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= C 2.4e-52)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1.75e-255) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (C <= 2.4e-52) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1.75e-255) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (C <= 2.4e-52) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1.75e-255: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif C <= 2.4e-52: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1.75e-255) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (C <= 2.4e-52) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1.75e-255) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (C <= 2.4e-52) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1.75e-255], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.4e-52], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.75 \cdot 10^{-255}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.4 \cdot 10^{-52}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.74999999999999989e-255Initial program 70.8%
Taylor expanded in A around 0 66.6%
+-commutative66.6%
unpow266.6%
unpow266.6%
hypot-define83.9%
Simplified83.9%
Taylor expanded in C around 0 69.3%
if -1.74999999999999989e-255 < C < 2.4000000000000002e-52Initial program 59.2%
Taylor expanded in A around -inf 38.1%
associate-*r/38.1%
Simplified38.1%
if 2.4000000000000002e-52 < C Initial program 26.1%
Taylor expanded in A around 0 20.1%
+-commutative20.1%
unpow220.1%
unpow220.1%
hypot-define50.5%
Simplified50.5%
Taylor expanded in C around inf 69.2%
Final simplification61.2%
(FPCore (A B C)
:precision binary64
(if (<= C -1.75e-41)
(* 180.0 (/ (atan (* C (/ 2.0 B))) PI))
(if (<= C 1.25e-251)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1.75e-41) {
tmp = 180.0 * (atan((C * (2.0 / B))) / ((double) M_PI));
} else if (C <= 1.25e-251) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1.75e-41) {
tmp = 180.0 * (Math.atan((C * (2.0 / B))) / Math.PI);
} else if (C <= 1.25e-251) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1.75e-41: tmp = 180.0 * (math.atan((C * (2.0 / B))) / math.pi) elif C <= 1.25e-251: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1.75e-41) tmp = Float64(180.0 * Float64(atan(Float64(C * Float64(2.0 / B))) / pi)); elseif (C <= 1.25e-251) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1.75e-41) tmp = 180.0 * (atan((C * (2.0 / B))) / pi); elseif (C <= 1.25e-251) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1.75e-41], N[(180.0 * N[(N[ArcTan[N[(C * N[(2.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.25e-251], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.75 \cdot 10^{-41}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(C \cdot \frac{2}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.25 \cdot 10^{-251}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.75e-41Initial program 75.6%
Taylor expanded in C around -inf 64.9%
associate-*r*64.9%
mul-1-neg64.9%
associate-*r/64.9%
*-commutative64.9%
*-commutative64.9%
associate-*r/64.9%
metadata-eval64.9%
Simplified64.9%
Taylor expanded in B around -inf 65.8%
associate-/l*65.8%
associate-*r/65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in A around 0 61.8%
if -1.75e-41 < C < 1.2500000000000001e-251Initial program 61.0%
Taylor expanded in B around -inf 34.2%
if 1.2500000000000001e-251 < C Initial program 36.8%
Taylor expanded in A around 0 27.7%
+-commutative27.7%
unpow227.7%
unpow227.7%
hypot-define51.3%
Simplified51.3%
Taylor expanded in C around inf 56.4%
(FPCore (A B C)
:precision binary64
(if (<= B -1.8e-23)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 8.8e-43)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.8e-23) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 8.8e-43) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((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.8e-23) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 8.8e-43) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.8e-23: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 8.8e-43: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / 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.8e-23) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 8.8e-43) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / 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.8e-23) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 8.8e-43) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.8e-23], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8.8e-43], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $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.8 \cdot 10^{-23}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 8.8 \cdot 10^{-43}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.7999999999999999e-23Initial program 56.0%
Taylor expanded in B around -inf 65.1%
if -1.7999999999999999e-23 < B < 8.79999999999999989e-43Initial program 52.5%
Taylor expanded in A around 0 44.4%
+-commutative44.4%
unpow244.4%
unpow244.4%
hypot-define60.0%
Simplified60.0%
Taylor expanded in C around inf 40.9%
if 8.79999999999999989e-43 < B Initial program 53.9%
Taylor expanded in B around inf 55.1%
(FPCore (A B C) :precision binary64 (if (<= C 3.4e-34) (* 180.0 (/ (atan (+ (/ C B) (- -1.0 (/ A B)))) PI)) (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 3.4e-34) {
tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / 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 <= 3.4e-34) {
tmp = 180.0 * (Math.atan(((C / B) + (-1.0 - (A / 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 <= 3.4e-34: tmp = 180.0 * (math.atan(((C / B) + (-1.0 - (A / 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 <= 3.4e-34) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) + Float64(-1.0 - Float64(A / B)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 3.4e-34) tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 3.4e-34], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 3.4 \cdot 10^{-34}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + \left(-1 - \frac{A}{B}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 3.4000000000000001e-34Initial program 66.1%
Taylor expanded in B around inf 63.3%
if 3.4000000000000001e-34 < C Initial program 25.3%
Taylor expanded in A around 0 20.4%
+-commutative20.4%
unpow220.4%
unpow220.4%
hypot-define49.8%
Simplified49.8%
Taylor expanded in C around inf 71.3%
Final simplification65.7%
(FPCore (A B C)
:precision binary64
(if (<= B -4.5e-117)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 7.4e-85)
(/ (* 180.0 (atan 0.0)) PI)
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.5e-117) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 7.4e-85) {
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 <= -4.5e-117) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 7.4e-85) {
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 <= -4.5e-117: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 7.4e-85: 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 <= -4.5e-117) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 7.4e-85) tmp = Float64(Float64(180.0 * 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 <= -4.5e-117) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 7.4e-85) 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, -4.5e-117], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.4e-85], N[(N[(180.0 * N[ArcTan[0.0], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.5 \cdot 10^{-117}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 7.4 \cdot 10^{-85}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.49999999999999969e-117Initial program 55.5%
Taylor expanded in B around -inf 54.8%
if -4.49999999999999969e-117 < B < 7.39999999999999966e-85Initial program 51.2%
Taylor expanded in C around inf 41.4%
associate-*r/41.4%
mul-1-neg41.4%
distribute-rgt1-in41.4%
metadata-eval41.4%
mul0-lft41.4%
metadata-eval41.4%
Simplified41.4%
associate-*r/41.4%
div041.4%
Applied egg-rr41.4%
if 7.39999999999999966e-85 < B Initial program 54.9%
Taylor expanded in B around inf 53.1%
(FPCore (A B C) :precision binary64 (if (<= B -1e-309) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1e-309) {
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 <= -1e-309) {
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 <= -1e-309: 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 <= -1e-309) 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 <= -1e-309) 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, -1e-309], 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 -1 \cdot 10^{-309}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.000000000000002e-309Initial program 54.0%
Taylor expanded in B around -inf 41.0%
if -1.000000000000002e-309 < B Initial program 53.4%
Taylor expanded in B around inf 36.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 53.7%
Taylor expanded in B around inf 21.0%
herbie shell --seed 2024157
(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)))