
(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 -8.5e+182) (* 180.0 (/ (atan (/ (* 0.5 B) A)) PI)) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -8.5e+182) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -8.5e+182) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -8.5e+182: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) else: tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -8.5e+182) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / 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 <= -8.5e+182) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); else tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -8.5e+182], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / 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 -8.5 \cdot 10^{+182}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\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 < -8.5e182Initial program 11.8%
Taylor expanded in A around -inf 86.6%
associate-*r/86.6%
Simplified86.6%
if -8.5e182 < A Initial program 64.4%
associate-*l/64.4%
*-lft-identity64.4%
+-commutative64.4%
unpow264.4%
unpow264.4%
hypot-def83.8%
Simplified83.8%
Final simplification84.1%
(FPCore (A B C) :precision binary64 (if (<= A -5.2e+15) (* 180.0 (/ (atan (* 0.5 (* B (+ (/ 1.0 A) (* (/ 1.0 A) (/ C A)))))) PI)) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.2e+15) {
tmp = 180.0 * (atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -5.2e+15) {
tmp = 180.0 * (Math.atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -5.2e+15: tmp = 180.0 * (math.atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -5.2e+15) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B * Float64(Float64(1.0 / A) + Float64(Float64(1.0 / A) * Float64(C / A)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5.2e+15) tmp = 180.0 * (atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / pi); else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5.2e+15], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B * N[(N[(1.0 / A), $MachinePrecision] + N[(N[(1.0 / A), $MachinePrecision] * N[(C / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 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 -5.2 \cdot 10^{+15}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(B \cdot \left(\frac{1}{A} + \frac{1}{A} \cdot \frac{C}{A}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.2e15Initial program 26.1%
Taylor expanded in A around -inf 65.6%
distribute-lft-out65.6%
associate-/l*71.0%
Simplified71.0%
Taylor expanded in B around 0 70.9%
*-un-lft-identity70.9%
unpow270.9%
times-frac70.7%
Applied egg-rr70.7%
if -5.2e15 < A Initial program 68.6%
Simplified86.7%
Final simplification82.9%
(FPCore (A B C)
:precision binary64
(if (<= A -1.8e+19)
(* 180.0 (/ (atan (* 0.5 (* B (+ (/ 1.0 A) (* (/ 1.0 A) (/ C A)))))) PI))
(if (<= A 3.1e+25)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (/ (- (- A) (hypot B A)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.8e+19) {
tmp = 180.0 * (atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / ((double) M_PI));
} else if (A <= 3.1e+25) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-A - hypot(B, A)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.8e+19) {
tmp = 180.0 * (Math.atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / Math.PI);
} else if (A <= 3.1e+25) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-A - Math.hypot(B, A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.8e+19: tmp = 180.0 * (math.atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / math.pi) elif A <= 3.1e+25: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((-A - math.hypot(B, A)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.8e+19) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B * Float64(Float64(1.0 / A) + Float64(Float64(1.0 / A) * Float64(C / A)))))) / pi)); elseif (A <= 3.1e+25) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - hypot(B, A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.8e+19) tmp = 180.0 * (atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / pi); elseif (A <= 3.1e+25) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan(((-A - hypot(B, A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.8e+19], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B * N[(N[(1.0 / A), $MachinePrecision] + N[(N[(1.0 / A), $MachinePrecision] * N[(C / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.1e+25], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[((-A) - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.8 \cdot 10^{+19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(B \cdot \left(\frac{1}{A} + \frac{1}{A} \cdot \frac{C}{A}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;A \leq 3.1 \cdot 10^{+25}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(B, A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.8e19Initial program 26.1%
Taylor expanded in A around -inf 65.6%
distribute-lft-out65.6%
associate-/l*71.0%
Simplified71.0%
Taylor expanded in B around 0 70.9%
*-un-lft-identity70.9%
unpow270.9%
times-frac70.7%
Applied egg-rr70.7%
if -1.8e19 < A < 3.0999999999999998e25Initial program 61.3%
Taylor expanded in A around 0 57.9%
unpow257.9%
unpow257.9%
hypot-def78.0%
Simplified78.0%
if 3.0999999999999998e25 < A Initial program 83.6%
Taylor expanded in C around 0 82.4%
associate-*r/82.4%
mul-1-neg82.4%
+-commutative82.4%
unpow282.4%
unpow282.4%
hypot-def92.9%
Simplified92.9%
Final simplification80.0%
(FPCore (A B C)
:precision binary64
(if (<= A -1.5e+19)
(* 180.0 (/ (atan (* 0.5 (* B (+ (/ 1.0 A) (* (/ 1.0 A) (/ C A)))))) PI))
(if (<= A 2.4e+147)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.5e+19) {
tmp = 180.0 * (atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / ((double) M_PI));
} else if (A <= 2.4e+147) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.5e+19) {
tmp = 180.0 * (Math.atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / Math.PI);
} else if (A <= 2.4e+147) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.5e+19: tmp = 180.0 * (math.atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / math.pi) elif A <= 2.4e+147: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.5e+19) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B * Float64(Float64(1.0 / A) + Float64(Float64(1.0 / A) * Float64(C / A)))))) / pi)); elseif (A <= 2.4e+147) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.5e+19) tmp = 180.0 * (atan((0.5 * (B * ((1.0 / A) + ((1.0 / A) * (C / A)))))) / pi); elseif (A <= 2.4e+147) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.5e+19], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B * N[(N[(1.0 / A), $MachinePrecision] + N[(N[(1.0 / A), $MachinePrecision] * N[(C / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.4e+147], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.5 \cdot 10^{+19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(B \cdot \left(\frac{1}{A} + \frac{1}{A} \cdot \frac{C}{A}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.4 \cdot 10^{+147}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.5e19Initial program 26.1%
Taylor expanded in A around -inf 65.6%
distribute-lft-out65.6%
associate-/l*71.0%
Simplified71.0%
Taylor expanded in B around 0 70.9%
*-un-lft-identity70.9%
unpow270.9%
times-frac70.7%
Applied egg-rr70.7%
if -1.5e19 < A < 2.40000000000000002e147Initial program 62.2%
Taylor expanded in A around 0 56.5%
unpow256.5%
unpow256.5%
hypot-def77.9%
Simplified77.9%
if 2.40000000000000002e147 < A Initial program 93.1%
Taylor expanded in B around -inf 92.2%
associate--l+92.2%
div-sub94.6%
Simplified94.6%
Final simplification78.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) PI)))
(t_1 (* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))
(if (<= C -2.4e-90)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C -8e-235)
t_0
(if (<= C 3.8e-264)
t_1
(if (<= C 1.15e-139)
t_0
(if (<= C 8.2e-85)
t_1
(if (<= C 4.4e-7)
t_0
(* 180.0 (/ (atan (/ (* B -0.5) C)) PI))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
double t_1 = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
double tmp;
if (C <= -2.4e-90) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= -8e-235) {
tmp = t_0;
} else if (C <= 3.8e-264) {
tmp = t_1;
} else if (C <= 1.15e-139) {
tmp = t_0;
} else if (C <= 8.2e-85) {
tmp = t_1;
} else if (C <= 4.4e-7) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
double t_1 = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
double tmp;
if (C <= -2.4e-90) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= -8e-235) {
tmp = t_0;
} else if (C <= 3.8e-264) {
tmp = t_1;
} else if (C <= 1.15e-139) {
tmp = t_0;
} else if (C <= 8.2e-85) {
tmp = t_1;
} else if (C <= 4.4e-7) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(-1.0) / math.pi) t_1 = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) tmp = 0 if C <= -2.4e-90: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= -8e-235: tmp = t_0 elif C <= 3.8e-264: tmp = t_1 elif C <= 1.15e-139: tmp = t_0 elif C <= 8.2e-85: tmp = t_1 elif C <= 4.4e-7: tmp = t_0 else: tmp = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(-1.0) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)) tmp = 0.0 if (C <= -2.4e-90) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= -8e-235) tmp = t_0; elseif (C <= 3.8e-264) tmp = t_1; elseif (C <= 1.15e-139) tmp = t_0; elseif (C <= 8.2e-85) tmp = t_1; elseif (C <= 4.4e-7) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(-1.0) / pi); t_1 = 180.0 * (atan((-2.0 * (A / B))) / pi); tmp = 0.0; if (C <= -2.4e-90) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= -8e-235) tmp = t_0; elseif (C <= 3.8e-264) tmp = t_1; elseif (C <= 1.15e-139) tmp = t_0; elseif (C <= 8.2e-85) tmp = t_1; elseif (C <= 4.4e-7) tmp = t_0; else tmp = 180.0 * (atan(((B * -0.5) / C)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -2.4e-90], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -8e-235], t$95$0, If[LessEqual[C, 3.8e-264], t$95$1, If[LessEqual[C, 1.15e-139], t$95$0, If[LessEqual[C, 8.2e-85], t$95$1, If[LessEqual[C, 4.4e-7], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\mathbf{if}\;C \leq -2.4 \cdot 10^{-90}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq -8 \cdot 10^{-235}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;C \leq 3.8 \cdot 10^{-264}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;C \leq 1.15 \cdot 10^{-139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;C \leq 8.2 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;C \leq 4.4 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -2.4000000000000002e-90Initial program 78.2%
Taylor expanded in C around -inf 68.2%
if -2.4000000000000002e-90 < C < -7.9999999999999997e-235 or 3.80000000000000013e-264 < C < 1.15000000000000006e-139 or 8.19999999999999987e-85 < C < 4.4000000000000002e-7Initial program 57.8%
Taylor expanded in B around inf 44.0%
if -7.9999999999999997e-235 < C < 3.80000000000000013e-264 or 1.15000000000000006e-139 < C < 8.19999999999999987e-85Initial program 67.8%
Taylor expanded in A around inf 45.3%
if 4.4000000000000002e-7 < C Initial program 22.8%
Taylor expanded in A around 0 17.1%
associate--l+17.0%
fma-def17.0%
Simplified31.5%
Taylor expanded in C around 0 35.2%
mul-1-neg35.2%
unsub-neg35.2%
Simplified35.2%
Taylor expanded in A around 0 19.0%
associate-*l/19.0%
*-lft-identity19.0%
unpow219.0%
unpow219.0%
hypot-def32.8%
div-sub48.7%
hypot-def22.8%
unpow222.8%
unpow222.8%
+-commutative22.8%
unpow222.8%
unpow222.8%
hypot-def48.7%
Simplified48.7%
Taylor expanded in C around inf 64.4%
associate-*r/64.4%
Simplified64.4%
Final simplification56.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) PI))))
(if (<= A -2.2e-101)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(if (<= A -5.9e-232)
t_0
(if (<= A 2.02e-277)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= A 7.1e-109)
t_0
(if (<= A 1.85e+27)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
double tmp;
if (A <= -2.2e-101) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else if (A <= -5.9e-232) {
tmp = t_0;
} else if (A <= 2.02e-277) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (A <= 7.1e-109) {
tmp = t_0;
} else if (A <= 1.85e+27) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
double tmp;
if (A <= -2.2e-101) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else if (A <= -5.9e-232) {
tmp = t_0;
} else if (A <= 2.02e-277) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (A <= 7.1e-109) {
tmp = t_0;
} else if (A <= 1.85e+27) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(-1.0) / math.pi) tmp = 0 if A <= -2.2e-101: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) elif A <= -5.9e-232: tmp = t_0 elif A <= 2.02e-277: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif A <= 7.1e-109: tmp = t_0 elif A <= 1.85e+27: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(-1.0) / pi)) tmp = 0.0 if (A <= -2.2e-101) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); elseif (A <= -5.9e-232) tmp = t_0; elseif (A <= 2.02e-277) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (A <= 7.1e-109) tmp = t_0; elseif (A <= 1.85e+27) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(-1.0) / pi); tmp = 0.0; if (A <= -2.2e-101) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); elseif (A <= -5.9e-232) tmp = t_0; elseif (A <= 2.02e-277) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (A <= 7.1e-109) tmp = t_0; elseif (A <= 1.85e+27) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -2.2e-101], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -5.9e-232], t$95$0, If[LessEqual[A, 2.02e-277], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7.1e-109], t$95$0, If[LessEqual[A, 1.85e+27], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{if}\;A \leq -2.2 \cdot 10^{-101}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -5.9 \cdot 10^{-232}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 2.02 \cdot 10^{-277}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 7.1 \cdot 10^{-109}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 1.85 \cdot 10^{+27}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.1999999999999999e-101Initial program 32.5%
Taylor expanded in A around -inf 61.5%
associate-*r/61.5%
Simplified61.5%
if -2.1999999999999999e-101 < A < -5.90000000000000017e-232 or 2.02e-277 < A < 7.0999999999999999e-109Initial program 65.5%
Taylor expanded in B around inf 44.1%
if -5.90000000000000017e-232 < A < 2.02e-277Initial program 69.0%
Taylor expanded in C around -inf 38.9%
if 7.0999999999999999e-109 < A < 1.85000000000000001e27Initial program 58.9%
Taylor expanded in B around -inf 42.0%
if 1.85000000000000001e27 < A Initial program 84.7%
Taylor expanded in A around inf 79.1%
Final simplification58.1%
(FPCore (A B C)
:precision binary64
(if (<= A -9e-103)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(if (or (<= A -2.3e-231) (and (not (<= A 3.3e-274)) (<= A 4.4e-231)))
(* 180.0 (/ (atan -1.0) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -9e-103) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else if ((A <= -2.3e-231) || (!(A <= 3.3e-274) && (A <= 4.4e-231))) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -9e-103) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else if ((A <= -2.3e-231) || (!(A <= 3.3e-274) && (A <= 4.4e-231))) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -9e-103: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) elif (A <= -2.3e-231) or (not (A <= 3.3e-274) and (A <= 4.4e-231)): tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -9e-103) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); elseif ((A <= -2.3e-231) || (!(A <= 3.3e-274) && (A <= 4.4e-231))) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -9e-103) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); elseif ((A <= -2.3e-231) || (~((A <= 3.3e-274)) && (A <= 4.4e-231))) tmp = 180.0 * (atan(-1.0) / pi); else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -9e-103], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[A, -2.3e-231], And[N[Not[LessEqual[A, 3.3e-274]], $MachinePrecision], LessEqual[A, 4.4e-231]]], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -9 \cdot 10^{-103}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.3 \cdot 10^{-231} \lor \neg \left(A \leq 3.3 \cdot 10^{-274}\right) \land A \leq 4.4 \cdot 10^{-231}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -9e-103Initial program 32.5%
Taylor expanded in A around -inf 61.5%
associate-*r/61.5%
Simplified61.5%
if -9e-103 < A < -2.3e-231 or 3.2999999999999998e-274 < A < 4.40000000000000018e-231Initial program 60.1%
Taylor expanded in B around inf 52.7%
if -2.3e-231 < A < 3.2999999999999998e-274 or 4.40000000000000018e-231 < A Initial program 76.0%
Taylor expanded in B around -inf 73.8%
associate--l+73.8%
div-sub74.6%
Simplified74.6%
Final simplification66.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* 2.0 (/ C B))) PI))))
(if (<= B -3.35e+19)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -2.05e-196)
t_0
(if (<= B 4.2e-155)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(if (<= B 3.4e-115) t_0 (* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
double tmp;
if (B <= -3.35e+19) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -2.05e-196) {
tmp = t_0;
} else if (B <= 4.2e-155) {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
} else if (B <= 3.4e-115) {
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((2.0 * (C / B))) / Math.PI);
double tmp;
if (B <= -3.35e+19) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -2.05e-196) {
tmp = t_0;
} else if (B <= 4.2e-155) {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
} else if (B <= 3.4e-115) {
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((2.0 * (C / B))) / math.pi) tmp = 0 if B <= -3.35e+19: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -2.05e-196: tmp = t_0 elif B <= 4.2e-155: tmp = 180.0 * (math.atan((-A / B)) / math.pi) elif B <= 3.4e-115: 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(2.0 * Float64(C / B))) / pi)) tmp = 0.0 if (B <= -3.35e+19) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -2.05e-196) tmp = t_0; elseif (B <= 4.2e-155) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); elseif (B <= 3.4e-115) 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((2.0 * (C / B))) / pi); tmp = 0.0; if (B <= -3.35e+19) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -2.05e-196) tmp = t_0; elseif (B <= 4.2e-155) tmp = 180.0 * (atan((-A / B)) / pi); elseif (B <= 3.4e-115) 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[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.35e+19], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.05e-196], t$95$0, If[LessEqual[B, 4.2e-155], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.4e-115], 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(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -3.35 \cdot 10^{+19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -2.05 \cdot 10^{-196}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 4.2 \cdot 10^{-155}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.4 \cdot 10^{-115}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.35e19Initial program 51.6%
Taylor expanded in B around -inf 64.3%
if -3.35e19 < B < -2.05000000000000011e-196 or 4.2000000000000003e-155 < B < 3.3999999999999998e-115Initial program 68.3%
Taylor expanded in C around -inf 45.5%
if -2.05000000000000011e-196 < B < 4.2000000000000003e-155Initial program 56.2%
Taylor expanded in A around 0 41.4%
associate--l+41.4%
fma-def41.4%
Simplified38.1%
Taylor expanded in C around 0 34.5%
mul-1-neg34.5%
unsub-neg34.5%
Simplified34.5%
Taylor expanded in A around inf 32.9%
associate-*l/32.9%
associate-*r*32.9%
associate-*r/32.9%
neg-mul-132.9%
Simplified32.9%
Taylor expanded in B around inf 41.4%
mul-1-neg41.4%
distribute-neg-frac41.4%
Simplified41.4%
if 3.3999999999999998e-115 < B Initial program 58.7%
Taylor expanded in B around inf 58.5%
Final simplification53.2%
(FPCore (A B C)
:precision binary64
(if (<= B -2.1e-299)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
(if (<= B 5e-307)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.1e-299) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else if (B <= 5e-307) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -2.1e-299) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else if (B <= 5e-307) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.1e-299: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) elif B <= 5e-307: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2.1e-299) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); elseif (B <= 5e-307) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.1e-299) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); elseif (B <= 5e-307) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.1e-299], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5e-307], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.1 \cdot 10^{-299}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 5 \cdot 10^{-307}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -2.1000000000000001e-299Initial program 59.2%
Taylor expanded in B around -inf 69.9%
associate--l+69.9%
div-sub71.6%
Simplified71.6%
if -2.1000000000000001e-299 < B < 5.00000000000000014e-307Initial program 34.3%
Taylor expanded in A around -inf 85.1%
associate-*r/85.1%
Simplified85.1%
if 5.00000000000000014e-307 < B Initial program 59.5%
Simplified74.9%
Taylor expanded in B around inf 70.3%
+-commutative70.3%
Simplified70.3%
Final simplification71.3%
(FPCore (A B C)
:precision binary64
(if (<= B -7e-162)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.9e-121)
(* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7e-162) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.9e-121) {
tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -7e-162) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.9e-121) {
tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -7e-162: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.9e-121: tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -7e-162) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.9e-121) tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -7e-162) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.9e-121) tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -7e-162], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.9e-121], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -7 \cdot 10^{-162}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.9 \cdot 10^{-121}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -6.9999999999999998e-162Initial program 57.2%
Taylor expanded in B around -inf 49.8%
if -6.9999999999999998e-162 < B < 1.9e-121Initial program 59.6%
Taylor expanded in A around inf 38.4%
if 1.9e-121 < B Initial program 59.3%
Taylor expanded in B around inf 56.7%
Final simplification49.3%
(FPCore (A B C)
:precision binary64
(if (<= B -7.5e-162)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4.4e-120)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7.5e-162) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4.4e-120) {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -7.5e-162) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4.4e-120) {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -7.5e-162: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4.4e-120: tmp = 180.0 * (math.atan((-A / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -7.5e-162) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4.4e-120) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -7.5e-162) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4.4e-120) tmp = 180.0 * (atan((-A / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -7.5e-162], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.4e-120], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -7.5 \cdot 10^{-162}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4.4 \cdot 10^{-120}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -7.49999999999999972e-162Initial program 57.2%
Taylor expanded in B around -inf 49.8%
if -7.49999999999999972e-162 < B < 4.40000000000000025e-120Initial program 59.6%
Taylor expanded in A around 0 47.3%
associate--l+47.3%
fma-def47.3%
Simplified44.5%
Taylor expanded in C around 0 37.3%
mul-1-neg37.3%
unsub-neg37.3%
Simplified37.3%
Taylor expanded in A around inf 35.9%
associate-*l/35.9%
associate-*r*35.9%
associate-*r/35.9%
neg-mul-135.9%
Simplified35.9%
Taylor expanded in B around inf 38.4%
mul-1-neg38.4%
distribute-neg-frac38.4%
Simplified38.4%
if 4.40000000000000025e-120 < B Initial program 59.3%
Taylor expanded in B around inf 56.7%
Final simplification49.3%
(FPCore (A B C)
:precision binary64
(if (<= B -4.8e-160)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.6e-142)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.8e-160) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.6e-142) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -4.8e-160) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.6e-142) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.8e-160: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.6e-142: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -4.8e-160) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.6e-142) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -4.8e-160) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.6e-142) tmp = 180.0 * (atan((0.0 / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.8e-160], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.6e-142], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.8 \cdot 10^{-160}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.6 \cdot 10^{-142}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.79999999999999982e-160Initial program 57.8%
Taylor expanded in B around -inf 50.4%
if -4.79999999999999982e-160 < B < 1.5999999999999999e-142Initial program 57.0%
Taylor expanded in C around inf 31.0%
associate-*r/31.0%
distribute-rgt1-in31.0%
metadata-eval31.0%
mul0-lft31.0%
metadata-eval31.0%
Simplified31.0%
if 1.5999999999999999e-142 < B Initial program 60.5%
Taylor expanded in B around inf 55.5%
Final simplification47.3%
(FPCore (A B C) :precision binary64 (if (<= B -4e-303) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4e-303) {
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 <= -4e-303) {
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 <= -4e-303: 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 <= -4e-303) 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 <= -4e-303) 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, -4e-303], 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 -4 \cdot 10^{-303}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.99999999999999972e-303Initial program 58.8%
Taylor expanded in B around -inf 39.7%
if -3.99999999999999972e-303 < B Initial program 58.5%
Taylor expanded in B around inf 43.9%
Final simplification41.9%
(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 58.7%
Taylor expanded in B around inf 24.0%
Final simplification24.0%
herbie shell --seed 2023311
(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)))