
(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 11 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 (<=
(*
180.0
(/
(atan
(*
(/ 1.0 B_m)
(- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0))))))
PI))
-40.0)
(* 180.0 (/ (atan (* (/ 1.0 B_m) (- (- C A) (hypot (- C A) B_m)))) PI))
(*
(* (atan (fma -1.0 (/ (+ A (* -1.0 A)) B_m) (* -0.5 (/ B_m C)))) 180.0)
(/ 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 ((180.0 * (atan(((1.0 / B_m) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / ((double) M_PI))) <= -40.0) {
tmp = 180.0 * (atan(((1.0 / B_m) * ((C - A) - hypot((C - A), B_m)))) / ((double) M_PI));
} else {
tmp = (atan(fma(-1.0, ((A + (-1.0 * A)) / B_m), (-0.5 * (B_m / C)))) * 180.0) * (1.0 / ((double) M_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 (Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B_m) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0)))))) / pi)) <= -40.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B_m) * Float64(Float64(C - A) - hypot(Float64(C - A), B_m)))) / pi)); else tmp = Float64(Float64(atan(fma(-1.0, Float64(Float64(A + Float64(-1.0 * A)) / B_m), Float64(-0.5 * Float64(B_m / C)))) * 180.0) * Float64(1.0 / pi)); end return Float64(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[N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], -40.0], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(C - A), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(-1.0 * N[(N[(A + N[(-1.0 * A), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision] + N[(-0.5 * N[(B$95$m / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision] * N[(1.0 / 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}\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)\right)}{\pi} \leq -40:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\_m\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\left(\tan^{-1} \left(\mathsf{fma}\left(-1, \frac{A + -1 \cdot A}{B\_m}, -0.5 \cdot \frac{B\_m}{C}\right)\right) \cdot 180\right) \cdot \frac{1}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -40Initial program 54.7%
lift-sqrt.f64N/A
sqrt-fabs-revN/A
lift-sqrt.f64N/A
rem-sqrt-square-revN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
sqr-neg-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites79.0%
if -40 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites67.5%
Taylor expanded in C around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6426.5
Applied rewrites26.5%
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 -1.78e+108)
(* (atan (* (/ B_m A) 0.5)) (/ 180.0 PI))
(if (<= A 5e-60)
(* 180.0 (/ (atan (* (/ 1.0 B_m) (- C (hypot C B_m)))) PI))
(* (/ (atan (- (/ (- C A) B_m) 1.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 <= -1.78e+108) {
tmp = atan(((B_m / A) * 0.5)) * (180.0 / ((double) M_PI));
} else if (A <= 5e-60) {
tmp = 180.0 * (atan(((1.0 / B_m) * (C - hypot(C, B_m)))) / ((double) M_PI));
} else {
tmp = (atan((((C - A) / B_m) - 1.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 <= -1.78e+108) {
tmp = Math.atan(((B_m / A) * 0.5)) * (180.0 / Math.PI);
} else if (A <= 5e-60) {
tmp = 180.0 * (Math.atan(((1.0 / B_m) * (C - Math.hypot(C, B_m)))) / Math.PI);
} else {
tmp = (Math.atan((((C - A) / B_m) - 1.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 <= -1.78e+108: tmp = math.atan(((B_m / A) * 0.5)) * (180.0 / math.pi) elif A <= 5e-60: tmp = 180.0 * (math.atan(((1.0 / B_m) * (C - math.hypot(C, B_m)))) / math.pi) else: tmp = (math.atan((((C - A) / B_m) - 1.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 <= -1.78e+108) tmp = Float64(atan(Float64(Float64(B_m / A) * 0.5)) * Float64(180.0 / pi)); elseif (A <= 5e-60) tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B_m) * Float64(C - hypot(C, B_m)))) / pi)); else tmp = Float64(Float64(atan(Float64(Float64(Float64(C - A) / B_m) - 1.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 <= -1.78e+108) tmp = atan(((B_m / A) * 0.5)) * (180.0 / pi); elseif (A <= 5e-60) tmp = 180.0 * (atan(((1.0 / B_m) * (C - hypot(C, B_m)))) / pi); else tmp = (atan((((C - A) / B_m) - 1.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, -1.78e+108], N[(N[ArcTan[N[(N[(B$95$m / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5e-60], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B$95$m), $MachinePrecision] - 1.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 -1.78 \cdot 10^{+108}:\\
\;\;\;\;\tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;A \leq 5 \cdot 10^{-60}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B\_m} \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B\_m} - 1\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if A < -1.78e108Initial program 54.7%
Taylor expanded in A around -inf
lower-*.f64N/A
lower-/.f6424.7
Applied rewrites24.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites24.8%
if -1.78e108 < A < 5.0000000000000001e-60Initial program 54.7%
lift-sqrt.f64N/A
sqrt-fabs-revN/A
lift-sqrt.f64N/A
rem-sqrt-square-revN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
sqr-neg-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites79.0%
Taylor expanded in A around 0
Applied rewrites73.1%
Taylor expanded in A around 0
Applied rewrites63.8%
if 5.0000000000000001e-60 < A Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.3
Applied rewrites67.5%
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 (<=
(*
180.0
(/
(atan
(*
(/ 1.0 B_m)
(- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0))))))
PI))
-40.0)
(* (* (atan (- (/ (- C A) B_m) 1.0)) 180.0) (/ 1.0 PI))
(*
180.0
(/ (atan (fma -1.0 (/ (+ A (* -1.0 A)) B_m) (* -0.5 (/ B_m C)))) 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 ((180.0 * (atan(((1.0 / B_m) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / ((double) M_PI))) <= -40.0) {
tmp = (atan((((C - A) / B_m) - 1.0)) * 180.0) * (1.0 / ((double) M_PI));
} else {
tmp = 180.0 * (atan(fma(-1.0, ((A + (-1.0 * A)) / B_m), (-0.5 * (B_m / C)))) / ((double) M_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 (Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B_m) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0)))))) / pi)) <= -40.0) tmp = Float64(Float64(atan(Float64(Float64(Float64(C - A) / B_m) - 1.0)) * 180.0) * Float64(1.0 / pi)); else tmp = Float64(180.0 * Float64(atan(fma(-1.0, Float64(Float64(A + Float64(-1.0 * A)) / B_m), Float64(-0.5 * Float64(B_m / C)))) / pi)); end return Float64(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[N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], -40.0], N[(N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B$95$m), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision] * N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(A + N[(-1.0 * A), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision] + N[(-0.5 * N[(B$95$m / C), $MachinePrecision]), $MachinePrecision]), $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}\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)\right)}{\pi} \leq -40:\\
\;\;\;\;\left(\tan^{-1} \left(\frac{C - A}{B\_m} - 1\right) \cdot 180\right) \cdot \frac{1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(-1, \frac{A + -1 \cdot A}{B\_m}, -0.5 \cdot \frac{B\_m}{C}\right)\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -40Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites67.5%
if -40 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) Initial program 54.7%
Taylor expanded in C around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6426.5
Applied rewrites26.5%
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 -1.45e+108)
(* (atan (* (/ B_m A) 0.5)) (/ 180.0 PI))
(* (* (atan (- (/ (- C A) B_m) 1.0)) 180.0) (/ 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 (A <= -1.45e+108) {
tmp = atan(((B_m / A) * 0.5)) * (180.0 / ((double) M_PI));
} else {
tmp = (atan((((C - A) / B_m) - 1.0)) * 180.0) * (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 (A <= -1.45e+108) {
tmp = Math.atan(((B_m / A) * 0.5)) * (180.0 / Math.PI);
} else {
tmp = (Math.atan((((C - A) / B_m) - 1.0)) * 180.0) * (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 A <= -1.45e+108: tmp = math.atan(((B_m / A) * 0.5)) * (180.0 / math.pi) else: tmp = (math.atan((((C - A) / B_m) - 1.0)) * 180.0) * (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 (A <= -1.45e+108) tmp = Float64(atan(Float64(Float64(B_m / A) * 0.5)) * Float64(180.0 / pi)); else tmp = Float64(Float64(atan(Float64(Float64(Float64(C - A) / B_m) - 1.0)) * 180.0) * Float64(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 (A <= -1.45e+108) tmp = atan(((B_m / A) * 0.5)) * (180.0 / pi); else tmp = (atan((((C - A) / B_m) - 1.0)) * 180.0) * (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[A, -1.45e+108], N[(N[ArcTan[N[(N[(B$95$m / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B$95$m), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision] * N[(1.0 / 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}\;A \leq -1.45 \cdot 10^{+108}:\\
\;\;\;\;\tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\left(\tan^{-1} \left(\frac{C - A}{B\_m} - 1\right) \cdot 180\right) \cdot \frac{1}{\pi}\\
\end{array}
\end{array}
if A < -1.45000000000000004e108Initial program 54.7%
Taylor expanded in A around -inf
lower-*.f64N/A
lower-/.f6424.7
Applied rewrites24.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites24.8%
if -1.45000000000000004e108 < A Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites67.5%
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 -1.45e+108)
(* (atan (* (/ B_m A) 0.5)) (/ 180.0 PI))
(* (/ (atan (- (/ (- C A) B_m) 1.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 <= -1.45e+108) {
tmp = atan(((B_m / A) * 0.5)) * (180.0 / ((double) M_PI));
} else {
tmp = (atan((((C - A) / B_m) - 1.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 <= -1.45e+108) {
tmp = Math.atan(((B_m / A) * 0.5)) * (180.0 / Math.PI);
} else {
tmp = (Math.atan((((C - A) / B_m) - 1.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 <= -1.45e+108: tmp = math.atan(((B_m / A) * 0.5)) * (180.0 / math.pi) else: tmp = (math.atan((((C - A) / B_m) - 1.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 <= -1.45e+108) tmp = Float64(atan(Float64(Float64(B_m / A) * 0.5)) * Float64(180.0 / pi)); else tmp = Float64(Float64(atan(Float64(Float64(Float64(C - A) / B_m) - 1.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 <= -1.45e+108) tmp = atan(((B_m / A) * 0.5)) * (180.0 / pi); else tmp = (atan((((C - A) / B_m) - 1.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, -1.45e+108], N[(N[ArcTan[N[(N[(B$95$m / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B$95$m), $MachinePrecision] - 1.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 -1.45 \cdot 10^{+108}:\\
\;\;\;\;\tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B\_m} - 1\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if A < -1.45000000000000004e108Initial program 54.7%
Taylor expanded in A around -inf
lower-*.f64N/A
lower-/.f6424.7
Applied rewrites24.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites24.8%
if -1.45000000000000004e108 < A Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.3
Applied rewrites67.5%
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 -1.45e+108)
(* (atan (* (/ B_m A) 0.5)) (/ 180.0 PI))
(if (<= A 3.9e+120)
(* 180.0 (/ (atan (/ (- C B_m) B_m)) PI))
(* 180.0 (/ (atan (/ (- C A) B_m)) 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 (A <= -1.45e+108) {
tmp = atan(((B_m / A) * 0.5)) * (180.0 / ((double) M_PI));
} else if (A <= 3.9e+120) {
tmp = 180.0 * (atan(((C - B_m) / B_m)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - A) / B_m)) / ((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 (A <= -1.45e+108) {
tmp = Math.atan(((B_m / A) * 0.5)) * (180.0 / Math.PI);
} else if (A <= 3.9e+120) {
tmp = 180.0 * (Math.atan(((C - B_m) / B_m)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - A) / B_m)) / 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 A <= -1.45e+108: tmp = math.atan(((B_m / A) * 0.5)) * (180.0 / math.pi) elif A <= 3.9e+120: tmp = 180.0 * (math.atan(((C - B_m) / B_m)) / math.pi) else: tmp = 180.0 * (math.atan(((C - A) / B_m)) / 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 (A <= -1.45e+108) tmp = Float64(atan(Float64(Float64(B_m / A) * 0.5)) * Float64(180.0 / pi)); elseif (A <= 3.9e+120) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B_m) / B_m)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - A) / B_m)) / 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 (A <= -1.45e+108) tmp = atan(((B_m / A) * 0.5)) * (180.0 / pi); elseif (A <= 3.9e+120) tmp = 180.0 * (atan(((C - B_m) / B_m)) / pi); else tmp = 180.0 * (atan(((C - A) / B_m)) / 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[A, -1.45e+108], N[(N[ArcTan[N[(N[(B$95$m / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.9e+120], N[(180.0 * N[(N[ArcTan[N[(N[(C - B$95$m), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - A), $MachinePrecision] / B$95$m), $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}\;A \leq -1.45 \cdot 10^{+108}:\\
\;\;\;\;\tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;A \leq 3.9 \cdot 10^{+120}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B\_m}{B\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B\_m}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.45000000000000004e108Initial program 54.7%
Taylor expanded in A around -inf
lower-*.f64N/A
lower-/.f6424.7
Applied rewrites24.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites24.8%
if -1.45000000000000004e108 < A < 3.8999999999999998e120Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
lift--.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6467.5
Applied rewrites67.5%
Taylor expanded in A around 0
Applied rewrites56.3%
if 3.8999999999999998e120 < A Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f6436.0
Applied rewrites36.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 (<= A 3.9e+120)
(* 180.0 (/ (atan (/ (- C B_m) B_m)) PI))
(* 180.0 (/ (atan (/ (- C A) B_m)) 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 (A <= 3.9e+120) {
tmp = 180.0 * (atan(((C - B_m) / B_m)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - A) / B_m)) / ((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 (A <= 3.9e+120) {
tmp = 180.0 * (Math.atan(((C - B_m) / B_m)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - A) / B_m)) / 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 A <= 3.9e+120: tmp = 180.0 * (math.atan(((C - B_m) / B_m)) / math.pi) else: tmp = 180.0 * (math.atan(((C - A) / B_m)) / 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 (A <= 3.9e+120) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B_m) / B_m)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - A) / B_m)) / 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 (A <= 3.9e+120) tmp = 180.0 * (atan(((C - B_m) / B_m)) / pi); else tmp = 180.0 * (atan(((C - A) / B_m)) / 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[A, 3.9e+120], N[(180.0 * N[(N[ArcTan[N[(N[(C - B$95$m), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - A), $MachinePrecision] / B$95$m), $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}\;A \leq 3.9 \cdot 10^{+120}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B\_m}{B\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B\_m}\right)}{\pi}\\
\end{array}
\end{array}
if A < 3.8999999999999998e120Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
lift--.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6467.5
Applied rewrites67.5%
Taylor expanded in A around 0
Applied rewrites56.3%
if 3.8999999999999998e120 < A Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f6436.0
Applied rewrites36.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 (<= A 3.9e+120)
(* 180.0 (/ (atan (- (/ C B_m) 1.0)) PI))
(* 180.0 (/ (atan (/ (- C A) B_m)) 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 (A <= 3.9e+120) {
tmp = 180.0 * (atan(((C / B_m) - 1.0)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - A) / B_m)) / ((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 (A <= 3.9e+120) {
tmp = 180.0 * (Math.atan(((C / B_m) - 1.0)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - A) / B_m)) / 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 A <= 3.9e+120: tmp = 180.0 * (math.atan(((C / B_m) - 1.0)) / math.pi) else: tmp = 180.0 * (math.atan(((C - A) / B_m)) / 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 (A <= 3.9e+120) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B_m) - 1.0)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - A) / B_m)) / 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 (A <= 3.9e+120) tmp = 180.0 * (atan(((C / B_m) - 1.0)) / pi); else tmp = 180.0 * (atan(((C - A) / B_m)) / 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[A, 3.9e+120], N[(180.0 * N[(N[ArcTan[N[(N[(C / B$95$m), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - A), $MachinePrecision] / B$95$m), $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}\;A \leq 3.9 \cdot 10^{+120}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B\_m} - 1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B\_m}\right)}{\pi}\\
\end{array}
\end{array}
if A < 3.8999999999999998e120Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
Taylor expanded in A around 0
Applied rewrites56.3%
if 3.8999999999999998e120 < A Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f6436.0
Applied rewrites36.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 3.3e+49)
(* 180.0 (/ (atan (/ (- C A) 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 <= 3.3e+49) {
tmp = 180.0 * (atan(((C - A) / 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 <= 3.3e+49) {
tmp = 180.0 * (Math.atan(((C - A) / 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 <= 3.3e+49: tmp = 180.0 * (math.atan(((C - A) / 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 <= 3.3e+49) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - A) / 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 <= 3.3e+49) tmp = 180.0 * (atan(((C - A) / 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, 3.3e+49], N[(180.0 * N[(N[ArcTan[N[(N[(C - A), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $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 3.3 \cdot 10^{+49}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 3.2999999999999998e49Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f6436.0
Applied rewrites36.0%
if 3.2999999999999998e49 < B Initial program 54.7%
Taylor expanded in B around inf
Applied rewrites40.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
(if (<= B_m 1.65e+49)
(* 180.0 (/ (atan (/ 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 (B_m <= 1.65e+49) {
tmp = 180.0 * (atan((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 (B_m <= 1.65e+49) {
tmp = 180.0 * (Math.atan((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 B_m <= 1.65e+49: tmp = 180.0 * (math.atan((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 (B_m <= 1.65e+49) tmp = Float64(180.0 * Float64(atan(Float64(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 (B_m <= 1.65e+49) tmp = 180.0 * (atan((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[B$95$m, 1.65e+49], N[(180.0 * N[(N[ArcTan[N[(C / B$95$m), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $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^{+49}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 1.6499999999999999e49Initial program 54.7%
Taylor expanded in B around inf
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
lift--.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6467.5
Applied rewrites67.5%
Taylor expanded in C around inf
lower-/.f6423.5
Applied rewrites23.5%
if 1.6499999999999999e49 < B Initial program 54.7%
Taylor expanded in B around inf
Applied rewrites40.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.7%
Taylor expanded in B around inf
Applied rewrites40.3%
herbie shell --seed 2025155
(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)))