
(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}
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))))
(if (<= t_0 -2e-15)
(* 180.0 (* (atan (- (/ C B) (+ 1.0 (/ A B)))) (/ 1.0 PI)))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (* -0.5 B) (/ 1.0 C))) PI))
(* 180.0 (* (atan (- (+ 1.0 (/ C B)) (/ A B))) (/ 1.0 PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
double tmp;
if (t_0 <= -2e-15) {
tmp = 180.0 * (atan(((C / B) - (1.0 + (A / B)))) * (1.0 / ((double) M_PI)));
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((1.0 + (C / B)) - (A / B))) * (1.0 / ((double) M_PI)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
double tmp;
if (t_0 <= -2e-15) {
tmp = 180.0 * (Math.atan(((C / B) - (1.0 + (A / B)))) * (1.0 / Math.PI));
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((-0.5 * B) * (1.0 / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((1.0 + (C / B)) - (A / B))) * (1.0 / Math.PI));
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) tmp = 0 if t_0 <= -2e-15: tmp = 180.0 * (math.atan(((C / B) - (1.0 + (A / B)))) * (1.0 / math.pi)) elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((-0.5 * B) * (1.0 / C))) / math.pi) else: tmp = 180.0 * (math.atan(((1.0 + (C / B)) - (A / B))) * (1.0 / math.pi)) return tmp
function code(A, B, C) t_0 = 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)) tmp = 0.0 if (t_0 <= -2e-15) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) - Float64(1.0 + Float64(A / B)))) * Float64(1.0 / pi))); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-0.5 * B) * Float64(1.0 / C))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 + Float64(C / B)) - Float64(A / B))) * Float64(1.0 / pi))); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); tmp = 0.0; if (t_0 <= -2e-15) tmp = 180.0 * (atan(((C / B) - (1.0 + (A / B)))) * (1.0 / pi)); elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / pi); else tmp = 180.0 * (atan(((1.0 + (C / B)) - (A / B))) * (1.0 / pi)); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -2e-15], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] - N[(1.0 + N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(N[(-0.5 * B), $MachinePrecision] * N[(1.0 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision] - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-15}:\\
\;\;\;\;180 \cdot \left(\tan^{-1} \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right) \cdot \frac{1}{\pi}\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(-0.5 \cdot B\right) \cdot \frac{1}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \left(\tan^{-1} \left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right) \cdot \frac{1}{\pi}\right)\\
\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))) < -2.0000000000000002e-15Initial program 53.0%
Applied rewrites53.0%
Applied rewrites53.0%
Taylor expanded in B around inf
Applied rewrites48.5%
if -2.0000000000000002e-15 < (*.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))) < 0.0Initial program 53.0%
Taylor expanded in C around inf
Applied rewrites26.6%
Taylor expanded in A around 0
Applied rewrites26.6%
Applied rewrites26.6%
if 0.0 < (*.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 53.0%
Applied rewrites53.0%
Applied rewrites53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))))
(if (<= t_0 -2e-15)
(* 180.0 (/ (atan (- (/ C B) (+ 1.0 (/ A B)))) PI))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (* -0.5 B) (/ 1.0 C))) PI))
(* 180.0 (* (atan (- (+ 1.0 (/ C B)) (/ A B))) (/ 1.0 PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
double tmp;
if (t_0 <= -2e-15) {
tmp = 180.0 * (atan(((C / B) - (1.0 + (A / B)))) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((1.0 + (C / B)) - (A / B))) * (1.0 / ((double) M_PI)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
double tmp;
if (t_0 <= -2e-15) {
tmp = 180.0 * (Math.atan(((C / B) - (1.0 + (A / B)))) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((-0.5 * B) * (1.0 / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((1.0 + (C / B)) - (A / B))) * (1.0 / Math.PI));
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) tmp = 0 if t_0 <= -2e-15: tmp = 180.0 * (math.atan(((C / B) - (1.0 + (A / B)))) / math.pi) elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((-0.5 * B) * (1.0 / C))) / math.pi) else: tmp = 180.0 * (math.atan(((1.0 + (C / B)) - (A / B))) * (1.0 / math.pi)) return tmp
function code(A, B, C) t_0 = 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)) tmp = 0.0 if (t_0 <= -2e-15) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) - Float64(1.0 + Float64(A / B)))) / pi)); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-0.5 * B) * Float64(1.0 / C))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 + Float64(C / B)) - Float64(A / B))) * Float64(1.0 / pi))); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); tmp = 0.0; if (t_0 <= -2e-15) tmp = 180.0 * (atan(((C / B) - (1.0 + (A / B)))) / pi); elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / pi); else tmp = 180.0 * (atan(((1.0 + (C / B)) - (A / B))) * (1.0 / pi)); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -2e-15], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] - N[(1.0 + N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(N[(-0.5 * B), $MachinePrecision] * N[(1.0 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision] - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-15}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(-0.5 \cdot B\right) \cdot \frac{1}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \left(\tan^{-1} \left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right) \cdot \frac{1}{\pi}\right)\\
\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))) < -2.0000000000000002e-15Initial program 53.0%
Taylor expanded in B around inf
Applied rewrites48.5%
if -2.0000000000000002e-15 < (*.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))) < 0.0Initial program 53.0%
Taylor expanded in C around inf
Applied rewrites26.6%
Taylor expanded in A around 0
Applied rewrites26.6%
Applied rewrites26.6%
if 0.0 < (*.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 53.0%
Applied rewrites53.0%
Applied rewrites53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))))
(if (<= t_0 -2e-15)
(* 180.0 (/ (atan (- (/ C B) (+ 1.0 (/ A B)))) PI))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (* -0.5 B) (/ 1.0 C))) PI))
(* 180.0 (/ (atan (- (+ 1.0 (/ C B)) (/ A B))) PI))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
double tmp;
if (t_0 <= -2e-15) {
tmp = 180.0 * (atan(((C / B) - (1.0 + (A / B)))) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((1.0 + (C / B)) - (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 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
double tmp;
if (t_0 <= -2e-15) {
tmp = 180.0 * (Math.atan(((C / B) - (1.0 + (A / B)))) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((-0.5 * B) * (1.0 / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((1.0 + (C / B)) - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) tmp = 0 if t_0 <= -2e-15: tmp = 180.0 * (math.atan(((C / B) - (1.0 + (A / B)))) / math.pi) elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((-0.5 * B) * (1.0 / C))) / math.pi) else: tmp = 180.0 * (math.atan(((1.0 + (C / B)) - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = 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)) tmp = 0.0 if (t_0 <= -2e-15) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) - Float64(1.0 + Float64(A / B)))) / pi)); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-0.5 * B) * Float64(1.0 / C))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 + Float64(C / B)) - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); tmp = 0.0; if (t_0 <= -2e-15) tmp = 180.0 * (atan(((C / B) - (1.0 + (A / B)))) / pi); elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / pi); else tmp = 180.0 * (atan(((1.0 + (C / B)) - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -2e-15], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] - N[(1.0 + N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(N[(-0.5 * B), $MachinePrecision] * N[(1.0 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision] - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-15}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(-0.5 \cdot B\right) \cdot \frac{1}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\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))) < -2.0000000000000002e-15Initial program 53.0%
Taylor expanded in B around inf
Applied rewrites48.5%
if -2.0000000000000002e-15 < (*.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))) < 0.0Initial program 53.0%
Taylor expanded in C around inf
Applied rewrites26.6%
Taylor expanded in A around 0
Applied rewrites26.6%
Applied rewrites26.6%
if 0.0 < (*.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 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
(FPCore (A B C) :precision binary64 (if (<= C 1.72e-19) (* 180.0 (/ (atan (- (+ 1.0 (/ C B)) (/ A B))) PI)) (* 180.0 (/ (atan (* (* -0.5 B) (/ 1.0 C))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 1.72e-19) {
tmp = 180.0 * (atan(((1.0 + (C / B)) - (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 1.72e-19) {
tmp = 180.0 * (Math.atan(((1.0 + (C / B)) - (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-0.5 * B) * (1.0 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 1.72e-19: tmp = 180.0 * (math.atan(((1.0 + (C / B)) - (A / B))) / math.pi) else: tmp = 180.0 * (math.atan(((-0.5 * B) * (1.0 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 1.72e-19) tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 + Float64(C / B)) - Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-0.5 * B) * Float64(1.0 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 1.72e-19) tmp = 180.0 * (atan(((1.0 + (C / B)) - (A / B))) / pi); else tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 1.72e-19], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision] - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(-0.5 * B), $MachinePrecision] * N[(1.0 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.72 \cdot 10^{-19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(-0.5 \cdot B\right) \cdot \frac{1}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 1.72000000000000004e-19Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
if 1.72000000000000004e-19 < C Initial program 53.0%
Taylor expanded in C around inf
Applied rewrites26.6%
Taylor expanded in A around 0
Applied rewrites26.6%
Applied rewrites26.6%
(FPCore (A B C)
:precision binary64
(if (<= C -1e+26)
(* 180.0 (/ (atan (/ (- C A) B)) PI))
(if (<= C 1.72e-19)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(* 180.0 (/ (atan (* (* -0.5 B) (/ 1.0 C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1e+26) {
tmp = 180.0 * (atan(((C - A) / B)) / ((double) M_PI));
} else if (C <= 1.72e-19) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1e+26) {
tmp = 180.0 * (Math.atan(((C - A) / B)) / Math.PI);
} else if (C <= 1.72e-19) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-0.5 * B) * (1.0 / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1e+26: tmp = 180.0 * (math.atan(((C - A) / B)) / math.pi) elif C <= 1.72e-19: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) else: tmp = 180.0 * (math.atan(((-0.5 * B) * (1.0 / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1e+26) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - A) / B)) / pi)); elseif (C <= 1.72e-19) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-0.5 * B) * Float64(1.0 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1e+26) tmp = 180.0 * (atan(((C - A) / B)) / pi); elseif (C <= 1.72e-19) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = 180.0 * (atan(((-0.5 * B) * (1.0 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1e+26], N[(180.0 * N[(N[ArcTan[N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.72e-19], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(-0.5 * B), $MachinePrecision] * N[(1.0 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1 \cdot 10^{+26}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.72 \cdot 10^{-19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(-0.5 \cdot B\right) \cdot \frac{1}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.00000000000000005e26Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
Taylor expanded in B around 0
Applied rewrites34.9%
if -1.00000000000000005e26 < C < 1.72000000000000004e-19Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
Taylor expanded in C around 0
Applied rewrites39.0%
if 1.72000000000000004e-19 < C Initial program 53.0%
Taylor expanded in C around inf
Applied rewrites26.6%
Taylor expanded in A around 0
Applied rewrites26.6%
Applied rewrites26.6%
(FPCore (A B C)
:precision binary64
(if (<= C -1e+26)
(* 180.0 (/ (atan (/ (- C A) B)) PI))
(if (<= C 1.72e-19)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1e+26) {
tmp = 180.0 * (atan(((C - A) / B)) / ((double) M_PI));
} else if (C <= 1.72e-19) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1e+26) {
tmp = 180.0 * (Math.atan(((C - A) / B)) / Math.PI);
} else if (C <= 1.72e-19) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1e+26: tmp = 180.0 * (math.atan(((C - A) / B)) / math.pi) elif C <= 1.72e-19: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1e+26) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - A) / B)) / pi)); elseif (C <= 1.72e-19) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1e+26) tmp = 180.0 * (atan(((C - A) / B)) / pi); elseif (C <= 1.72e-19) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1e+26], N[(180.0 * N[(N[ArcTan[N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.72e-19], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1 \cdot 10^{+26}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.72 \cdot 10^{-19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.00000000000000005e26Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
Taylor expanded in B around 0
Applied rewrites34.9%
if -1.00000000000000005e26 < C < 1.72000000000000004e-19Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
Taylor expanded in C around 0
Applied rewrites39.0%
if 1.72000000000000004e-19 < C Initial program 53.0%
Taylor expanded in C around inf
Applied rewrites26.6%
Taylor expanded in A around 0
Applied rewrites26.6%
(FPCore (A B C)
:precision binary64
(if (<= B -2.2e-165)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= B 7.8e-14)
(* 180.0 (/ (atan (/ (- C A) B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.2e-165) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (B <= 7.8e-14) {
tmp = 180.0 * (atan(((C - 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 <= -2.2e-165) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (B <= 7.8e-14) {
tmp = 180.0 * (Math.atan(((C - 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 <= -2.2e-165: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif B <= 7.8e-14: tmp = 180.0 * (math.atan(((C - 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 <= -2.2e-165) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (B <= 7.8e-14) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - 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 <= -2.2e-165) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (B <= 7.8e-14) tmp = 180.0 * (atan(((C - A) / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.2e-165], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.8e-14], N[(180.0 * N[(N[ArcTan[N[(N[(C - A), $MachinePrecision] / 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 -2.2 \cdot 10^{-165}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 7.8 \cdot 10^{-14}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.1999999999999999e-165Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
Taylor expanded in C around 0
Applied rewrites39.0%
if -2.1999999999999999e-165 < B < 7.7999999999999996e-14Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
Taylor expanded in B around 0
Applied rewrites34.9%
if 7.7999999999999996e-14 < B Initial program 53.0%
Taylor expanded in B around inf
Applied rewrites20.5%
(FPCore (A B C)
:precision binary64
(if (<= B 9.6e-223)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= B 2.3e-91)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= 9.6e-223) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (B <= 2.3e-91) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 9.6e-223) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (B <= 2.3e-91) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 9.6e-223: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif B <= 2.3e-91: tmp = 180.0 * (math.atan(0.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 9.6e-223) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (B <= 2.3e-91) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 9.6e-223) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (B <= 2.3e-91) tmp = 180.0 * (atan(0.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 9.6e-223], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.3e-91], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9.6 \cdot 10^{-223}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.3 \cdot 10^{-91}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 9.59999999999999941e-223Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites49.0%
Taylor expanded in C around 0
Applied rewrites39.0%
if 9.59999999999999941e-223 < B < 2.29999999999999996e-91Initial program 53.0%
Taylor expanded in C around inf
Applied rewrites13.7%
Taylor expanded in A around 0
Applied rewrites13.7%
if 2.29999999999999996e-91 < B Initial program 53.0%
Taylor expanded in B around inf
Applied rewrites20.5%
(FPCore (A B C)
:precision binary64
(if (<= B -4.8e-72)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.3e-91)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.8e-72) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.3e-91) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -4.8e-72) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.3e-91) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.8e-72: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.3e-91: tmp = 180.0 * (math.atan(0.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -4.8e-72) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.3e-91) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -4.8e-72) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.3e-91) tmp = 180.0 * (atan(0.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.8e-72], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.3e-91], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.8 \cdot 10^{-72}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.3 \cdot 10^{-91}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.8e-72Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites20.9%
if -4.8e-72 < B < 2.29999999999999996e-91Initial program 53.0%
Taylor expanded in C around inf
Applied rewrites13.7%
Taylor expanded in A around 0
Applied rewrites13.7%
if 2.29999999999999996e-91 < B Initial program 53.0%
Taylor expanded in B around inf
Applied rewrites20.5%
(FPCore (A B C) :precision binary64 (if (<= B -7e-287) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7e-287) {
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 <= -7e-287) {
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 <= -7e-287: 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 <= -7e-287) 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 <= -7e-287) 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, -7e-287], 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 -7 \cdot 10^{-287}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -7e-287Initial program 53.0%
Taylor expanded in B around -inf
Applied rewrites20.9%
if -7e-287 < B Initial program 53.0%
Taylor expanded in B around inf
Applied rewrites20.5%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 53.0%
Taylor expanded in B around inf
Applied rewrites20.5%
herbie shell --seed 2025160
(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)))