
(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}
Herbie found 10 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}
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= C 1.75e+72)
(/ (* 180.0 (atan (* (/ 1.0 B_m) (- (- C A) B_m)))) PI)
(* 180.0 (/ (atan (* (/ B_m C) -0.5)) PI)))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= 1.75e+72) {
tmp = (180.0 * atan(((1.0 / B_m) * ((C - A) - B_m)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((B_m / C) * -0.5)) / ((double) M_PI));
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= 1.75e+72) {
tmp = (180.0 * Math.atan(((1.0 / B_m) * ((C - A) - B_m)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((B_m / C) * -0.5)) / Math.PI);
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if C <= 1.75e+72: tmp = (180.0 * math.atan(((1.0 / B_m) * ((C - A) - B_m)))) / math.pi else: tmp = 180.0 * (math.atan(((B_m / C) * -0.5)) / math.pi) return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (C <= 1.75e+72) tmp = Float64(Float64(180.0 * atan(Float64(Float64(1.0 / B_m) * Float64(Float64(C - A) - B_m)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B_m / C) * -0.5)) / pi)); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (C <= 1.75e+72) tmp = (180.0 * atan(((1.0 / B_m) * ((C - A) - B_m)))) / pi; else tmp = 180.0 * (atan(((B_m / C) * -0.5)) / pi); end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, 1.75e+72], N[(N[(180.0 * N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B$95$m / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;C \leq 1.75 \cdot 10^{+72}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(C - A\right) - B\_m\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < 1.75000000000000005e72Initial program 62.2%
Taylor expanded in B around inf
Applied rewrites76.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6476.3
Applied rewrites76.3%
if 1.75000000000000005e72 < C Initial program 20.1%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6471.6
Applied rewrites71.6%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6471.6
Applied rewrites71.6%
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= C -3.3e-111)
(/ (* 180.0 (atan (* (/ 1.0 B_m) (- C B_m)))) PI)
(if (<= C 1.75e+72)
(/ (* 180.0 (atan (* (/ 1.0 B_m) (- (- A) B_m)))) PI)
(* 180.0 (/ (atan (* (/ B_m C) -0.5)) PI))))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= -3.3e-111) {
tmp = (180.0 * atan(((1.0 / B_m) * (C - B_m)))) / ((double) M_PI);
} else if (C <= 1.75e+72) {
tmp = (180.0 * atan(((1.0 / B_m) * (-A - B_m)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((B_m / C) * -0.5)) / ((double) M_PI));
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= -3.3e-111) {
tmp = (180.0 * Math.atan(((1.0 / B_m) * (C - B_m)))) / Math.PI;
} else if (C <= 1.75e+72) {
tmp = (180.0 * Math.atan(((1.0 / B_m) * (-A - B_m)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((B_m / C) * -0.5)) / Math.PI);
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if C <= -3.3e-111: tmp = (180.0 * math.atan(((1.0 / B_m) * (C - B_m)))) / math.pi elif C <= 1.75e+72: tmp = (180.0 * math.atan(((1.0 / B_m) * (-A - B_m)))) / math.pi else: tmp = 180.0 * (math.atan(((B_m / C) * -0.5)) / math.pi) return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (C <= -3.3e-111) tmp = Float64(Float64(180.0 * atan(Float64(Float64(1.0 / B_m) * Float64(C - B_m)))) / pi); elseif (C <= 1.75e+72) tmp = Float64(Float64(180.0 * atan(Float64(Float64(1.0 / B_m) * Float64(Float64(-A) - B_m)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B_m / C) * -0.5)) / pi)); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (C <= -3.3e-111) tmp = (180.0 * atan(((1.0 / B_m) * (C - B_m)))) / pi; elseif (C <= 1.75e+72) tmp = (180.0 * atan(((1.0 / B_m) * (-A - B_m)))) / pi; else tmp = 180.0 * (atan(((B_m / C) * -0.5)) / pi); end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, -3.3e-111], N[(N[(180.0 * N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 1.75e+72], N[(N[(180.0 * N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[((-A) - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B$95$m / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;C \leq -3.3 \cdot 10^{-111}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(C - B\_m\right)\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.75 \cdot 10^{+72}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(-A\right) - B\_m\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < -3.3e-111Initial program 74.1%
Taylor expanded in B around inf
Applied rewrites86.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6486.3
Applied rewrites86.3%
Taylor expanded in A around 0
Applied rewrites83.3%
if -3.3e-111 < C < 1.75000000000000005e72Initial program 54.0%
Taylor expanded in B around inf
Applied rewrites69.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6469.4
Applied rewrites69.4%
Taylor expanded in A around inf
mul-1-negN/A
lift-neg.f6468.9
Applied rewrites68.9%
if 1.75000000000000005e72 < C Initial program 20.1%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6471.6
Applied rewrites71.6%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6471.6
Applied rewrites71.6%
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= C 6e+38)
(/ (* 180.0 (atan (* (/ 1.0 B_m) (- C B_m)))) PI)
(* 180.0 (/ (atan (* (/ B_m C) -0.5)) PI)))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= 6e+38) {
tmp = (180.0 * atan(((1.0 / B_m) * (C - B_m)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((B_m / C) * -0.5)) / ((double) M_PI));
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= 6e+38) {
tmp = (180.0 * Math.atan(((1.0 / B_m) * (C - B_m)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((B_m / C) * -0.5)) / Math.PI);
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if C <= 6e+38: tmp = (180.0 * math.atan(((1.0 / B_m) * (C - B_m)))) / math.pi else: tmp = 180.0 * (math.atan(((B_m / C) * -0.5)) / math.pi) return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (C <= 6e+38) tmp = Float64(Float64(180.0 * atan(Float64(Float64(1.0 / B_m) * Float64(C - B_m)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B_m / C) * -0.5)) / pi)); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (C <= 6e+38) tmp = (180.0 * atan(((1.0 / B_m) * (C - B_m)))) / pi; else tmp = 180.0 * (atan(((B_m / C) * -0.5)) / pi); end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, 6e+38], N[(N[(180.0 * N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B$95$m / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;C \leq 6 \cdot 10^{+38}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(C - B\_m\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < 6.0000000000000002e38Initial program 62.8%
Taylor expanded in B around inf
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6477.2
Applied rewrites77.2%
Taylor expanded in A around 0
Applied rewrites65.6%
if 6.0000000000000002e38 < C Initial program 22.9%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6468.7
Applied rewrites68.7%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6468.7
Applied rewrites68.7%
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= C -37000000000000.0)
(/ (* 180.0 (atan (/ (+ C C) B_m))) PI)
(if (<= C 7e+39)
(* 180.0 (/ (atan -1.0) PI))
(* 180.0 (/ (atan (* (/ B_m C) -0.5)) PI))))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= -37000000000000.0) {
tmp = (180.0 * atan(((C + C) / B_m))) / ((double) M_PI);
} else if (C <= 7e+39) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((B_m / C) * -0.5)) / ((double) M_PI));
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= -37000000000000.0) {
tmp = (180.0 * Math.atan(((C + C) / B_m))) / Math.PI;
} else if (C <= 7e+39) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((B_m / C) * -0.5)) / Math.PI);
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if C <= -37000000000000.0: tmp = (180.0 * math.atan(((C + C) / B_m))) / math.pi elif C <= 7e+39: tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = 180.0 * (math.atan(((B_m / C) * -0.5)) / math.pi) return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (C <= -37000000000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C + C) / B_m))) / pi); elseif (C <= 7e+39) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B_m / C) * -0.5)) / pi)); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (C <= -37000000000000.0) tmp = (180.0 * atan(((C + C) / B_m))) / pi; elseif (C <= 7e+39) tmp = 180.0 * (atan(-1.0) / pi); else tmp = 180.0 * (atan(((B_m / C) * -0.5)) / pi); end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, -37000000000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(C + C), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 7e+39], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B$95$m / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;C \leq -37000000000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C + C}{B\_m}\right)}{\pi}\\
\mathbf{elif}\;C \leq 7 \cdot 10^{+39}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < -3.7e13Initial program 78.0%
Taylor expanded in B around inf
Applied rewrites90.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Taylor expanded in C around -inf
associate-*r/N/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6470.7
Applied rewrites70.7%
if -3.7e13 < C < 7.0000000000000003e39Initial program 56.5%
Taylor expanded in B around inf
Applied rewrites50.7%
if 7.0000000000000003e39 < C Initial program 22.9%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6468.8
Applied rewrites68.8%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6468.8
Applied rewrites68.8%
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= A -8.5e-54)
(/ (* 180.0 (atan (* (/ B_m A) 0.5))) PI)
(if (<= A 460000.0)
(* 180.0 (/ (atan -1.0) PI))
(* (/ (atan (* (/ A B_m) -2.0)) PI) 180.0)))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (A <= -8.5e-54) {
tmp = (180.0 * atan(((B_m / A) * 0.5))) / ((double) M_PI);
} else if (A <= 460000.0) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = (atan(((A / B_m) * -2.0)) / ((double) M_PI)) * 180.0;
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (A <= -8.5e-54) {
tmp = (180.0 * Math.atan(((B_m / A) * 0.5))) / Math.PI;
} else if (A <= 460000.0) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = (Math.atan(((A / B_m) * -2.0)) / Math.PI) * 180.0;
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if A <= -8.5e-54: tmp = (180.0 * math.atan(((B_m / A) * 0.5))) / math.pi elif A <= 460000.0: tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = (math.atan(((A / B_m) * -2.0)) / math.pi) * 180.0 return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (A <= -8.5e-54) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B_m / A) * 0.5))) / pi); elseif (A <= 460000.0) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = Float64(Float64(atan(Float64(Float64(A / B_m) * -2.0)) / pi) * 180.0); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (A <= -8.5e-54) tmp = (180.0 * atan(((B_m / A) * 0.5))) / pi; elseif (A <= 460000.0) tmp = 180.0 * (atan(-1.0) / pi); else tmp = (atan(((A / B_m) * -2.0)) / pi) * 180.0; end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[A, -8.5e-54], N[(N[(180.0 * N[ArcTan[N[(N[(B$95$m / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 460000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(A / B$95$m), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;A \leq -8.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 460000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if A < -8.5e-54Initial program 28.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.5
Applied rewrites61.5%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-PI.f6461.5
Applied rewrites61.5%
if -8.5e-54 < A < 4.6e5Initial program 59.4%
Taylor expanded in B around inf
Applied rewrites52.4%
if 4.6e5 < A Initial program 76.1%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6467.9
Applied rewrites67.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= A -8.5e-54)
(* (/ (atan (* (/ B_m A) 0.5)) PI) 180.0)
(if (<= A 460000.0)
(* 180.0 (/ (atan -1.0) PI))
(* (/ (atan (* (/ A B_m) -2.0)) PI) 180.0)))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (A <= -8.5e-54) {
tmp = (atan(((B_m / A) * 0.5)) / ((double) M_PI)) * 180.0;
} else if (A <= 460000.0) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = (atan(((A / B_m) * -2.0)) / ((double) M_PI)) * 180.0;
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (A <= -8.5e-54) {
tmp = (Math.atan(((B_m / A) * 0.5)) / Math.PI) * 180.0;
} else if (A <= 460000.0) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = (Math.atan(((A / B_m) * -2.0)) / Math.PI) * 180.0;
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if A <= -8.5e-54: tmp = (math.atan(((B_m / A) * 0.5)) / math.pi) * 180.0 elif A <= 460000.0: tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = (math.atan(((A / B_m) * -2.0)) / math.pi) * 180.0 return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (A <= -8.5e-54) tmp = Float64(Float64(atan(Float64(Float64(B_m / A) * 0.5)) / pi) * 180.0); elseif (A <= 460000.0) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = Float64(Float64(atan(Float64(Float64(A / B_m) * -2.0)) / pi) * 180.0); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (A <= -8.5e-54) tmp = (atan(((B_m / A) * 0.5)) / pi) * 180.0; elseif (A <= 460000.0) tmp = 180.0 * (atan(-1.0) / pi); else tmp = (atan(((A / B_m) * -2.0)) / pi) * 180.0; end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[A, -8.5e-54], N[(N[(N[ArcTan[N[(N[(B$95$m / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[A, 460000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(A / B$95$m), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;A \leq -8.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right)}{\pi} \cdot 180\\
\mathbf{elif}\;A \leq 460000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if A < -8.5e-54Initial program 28.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.5
Applied rewrites61.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.5
Applied rewrites61.5%
if -8.5e-54 < A < 4.6e5Initial program 59.4%
Taylor expanded in B around inf
Applied rewrites52.4%
if 4.6e5 < A Initial program 76.1%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6467.9
Applied rewrites67.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= A -4.45e+173)
(/ (* 180.0 (atan (/ 0.0 B_m))) PI)
(if (<= A 460000.0)
(* 180.0 (/ (atan -1.0) PI))
(* (/ (atan (* (/ A B_m) -2.0)) PI) 180.0)))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (A <= -4.45e+173) {
tmp = (180.0 * atan((0.0 / B_m))) / ((double) M_PI);
} else if (A <= 460000.0) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = (atan(((A / B_m) * -2.0)) / ((double) M_PI)) * 180.0;
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (A <= -4.45e+173) {
tmp = (180.0 * Math.atan((0.0 / B_m))) / Math.PI;
} else if (A <= 460000.0) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = (Math.atan(((A / B_m) * -2.0)) / Math.PI) * 180.0;
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if A <= -4.45e+173: tmp = (180.0 * math.atan((0.0 / B_m))) / math.pi elif A <= 460000.0: tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = (math.atan(((A / B_m) * -2.0)) / math.pi) * 180.0 return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (A <= -4.45e+173) tmp = Float64(Float64(180.0 * atan(Float64(0.0 / B_m))) / pi); elseif (A <= 460000.0) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = Float64(Float64(atan(Float64(Float64(A / B_m) * -2.0)) / pi) * 180.0); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (A <= -4.45e+173) tmp = (180.0 * atan((0.0 / B_m))) / pi; elseif (A <= 460000.0) tmp = 180.0 * (atan(-1.0) / pi); else tmp = (atan(((A / B_m) * -2.0)) / pi) * 180.0; end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[A, -4.45e+173], N[(N[(180.0 * N[ArcTan[N[(0.0 / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 460000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(A / B$95$m), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;A \leq -4.45 \cdot 10^{+173}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B\_m}\right)}{\pi}\\
\mathbf{elif}\;A \leq 460000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if A < -4.45000000000000008e173Initial program 10.9%
Taylor expanded in B around inf
Applied rewrites17.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6417.9
Applied rewrites17.9%
Taylor expanded in A around 0
Applied rewrites18.8%
Taylor expanded in C around inf
associate-*r/N/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
mul0-lftN/A
lift-/.f64N/A
mul0-lft38.3
Applied rewrites38.3%
if -4.45000000000000008e173 < A < 4.6e5Initial program 53.4%
Taylor expanded in B around inf
Applied rewrites47.9%
if 4.6e5 < A Initial program 76.1%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6467.9
Applied rewrites67.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= C -37000000000000.0)
(/ (* 180.0 (atan (/ (+ C C) B_m))) PI)
(* 180.0 (/ (atan -1.0) PI)))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= -37000000000000.0) {
tmp = (180.0 * atan(((C + C) / B_m))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (C <= -37000000000000.0) {
tmp = (180.0 * Math.atan(((C + C) / B_m))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if C <= -37000000000000.0: tmp = (180.0 * math.atan(((C + C) / B_m))) / math.pi else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (C <= -37000000000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C + C) / B_m))) / pi); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (C <= -37000000000000.0) tmp = (180.0 * atan(((C + C) / B_m))) / pi; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, -37000000000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(C + C), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;C \leq -37000000000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C + C}{B\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if C < -3.7e13Initial program 78.0%
Taylor expanded in B around inf
Applied rewrites90.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Taylor expanded in C around -inf
associate-*r/N/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6470.7
Applied rewrites70.7%
if -3.7e13 < C Initial program 47.1%
Taylor expanded in B around inf
Applied rewrites43.0%
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
:precision binary64
(*
B_s
(if (<= B_m 1.65e-96)
(/ (* 180.0 (atan (/ 0.0 B_m))) PI)
(* 180.0 (/ (atan -1.0) PI)))))B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
double tmp;
if (B_m <= 1.65e-96) {
tmp = (180.0 * atan((0.0 / B_m))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
double tmp;
if (B_m <= 1.65e-96) {
tmp = (180.0 * Math.atan((0.0 / B_m))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return B_s * tmp;
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): tmp = 0 if B_m <= 1.65e-96: tmp = (180.0 * math.atan((0.0 / B_m))) / math.pi else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return B_s * tmp
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) tmp = 0.0 if (B_m <= 1.65e-96) tmp = Float64(Float64(180.0 * atan(Float64(0.0 / B_m))) / pi); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return Float64(B_s * tmp) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, A, B_m, C) tmp = 0.0; if (B_m <= 1.65e-96) tmp = (180.0 * atan((0.0 / B_m))) / pi; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = B_s * tmp; end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[B$95$m, 1.65e-96], N[(N[(180.0 * N[ArcTan[N[(0.0 / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;B\_m \leq 1.65 \cdot 10^{-96}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 1.64999999999999995e-96Initial program 58.7%
Taylor expanded in B around inf
Applied rewrites53.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6453.1
Applied rewrites53.1%
Taylor expanded in A around 0
Applied rewrites38.5%
Taylor expanded in C around inf
associate-*r/N/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
mul0-lftN/A
lift-/.f64N/A
mul0-lft29.7
Applied rewrites29.7%
if 1.64999999999999995e-96 < B Initial program 51.7%
Taylor expanded in B around inf
Applied rewrites54.3%
B\_m = (fabs.f64 B) B\_s = (copysign.f64 #s(literal 1 binary64) B) (FPCore (B_s A B_m C) :precision binary64 (* B_s (* 180.0 (/ (atan -1.0) PI))))
B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
return B_s * (180.0 * (atan(-1.0) / ((double) M_PI)));
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
return B_s * (180.0 * (Math.atan(-1.0) / Math.PI));
}
B\_m = math.fabs(B) B\_s = math.copysign(1.0, B) def code(B_s, A, B_m, C): return B_s * (180.0 * (math.atan(-1.0) / math.pi))
B\_m = abs(B) B\_s = copysign(1.0, B) function code(B_s, A, B_m, C) return Float64(B_s * Float64(180.0 * Float64(atan(-1.0) / pi))) end
B\_m = abs(B); B\_s = sign(B) * abs(1.0); function tmp = code(B_s, A, B_m, C) tmp = B_s * (180.0 * (atan(-1.0) / pi)); end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \left(180 \cdot \frac{\tan^{-1} -1}{\pi}\right)
\end{array}
Initial program 54.1%
Taylor expanded in B around inf
Applied rewrites40.6%
herbie shell --seed 2025122
(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)))