
(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 18 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
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (+ (- A) C))
(t_2 (* 180.0 (/ (atan (/ (- t_1 (hypot t_1 B)) B)) PI))))
(if (<= t_0 -0.5)
t_2
(if (<= t_0 0.0) (* 180.0 (/ (atan (* (/ B (- C A)) -0.5)) PI)) t_2))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_1 = -A + C;
double t_2 = 180.0 * (atan(((t_1 - hypot(t_1, B)) / B)) / ((double) M_PI));
double tmp;
if (t_0 <= -0.5) {
tmp = t_2;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / ((double) M_PI));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_1 = -A + C;
double t_2 = 180.0 * (Math.atan(((t_1 - Math.hypot(t_1, B)) / B)) / Math.PI);
double tmp;
if (t_0 <= -0.5) {
tmp = t_2;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((B / (C - A)) * -0.5)) / Math.PI);
} else {
tmp = t_2;
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_1 = -A + C t_2 = 180.0 * (math.atan(((t_1 - math.hypot(t_1, B)) / B)) / math.pi) tmp = 0 if t_0 <= -0.5: tmp = t_2 elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((B / (C - A)) * -0.5)) / math.pi) else: tmp = t_2 return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_1 = Float64(Float64(-A) + C) t_2 = Float64(180.0 * Float64(atan(Float64(Float64(t_1 - hypot(t_1, B)) / B)) / pi)) tmp = 0.0 if (t_0 <= -0.5) tmp = t_2; elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / Float64(C - A)) * -0.5)) / pi)); else tmp = t_2; end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_1 = -A + C; t_2 = 180.0 * (atan(((t_1 - hypot(t_1, B)) / B)) / pi); tmp = 0.0; if (t_0 <= -0.5) tmp = t_2; elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / pi); else tmp = t_2; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[((-A) + C), $MachinePrecision]}, Block[{t$95$2 = N[(180.0 * N[(N[ArcTan[N[(N[(t$95$1 - N[Sqrt[t$95$1 ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], t$95$2, If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \left(-A\right) + C\\
t_2 := 180 \cdot \frac{\tan^{-1} \left(\frac{t\_1 - \mathsf{hypot}\left(t\_1, B\right)}{B}\right)}{\pi}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.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)))))) < -0.5 or -0.0 < (*.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)))))) Initial program 59.2%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.0%
if -0.5 < (*.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)))))) < -0.0Initial program 18.0%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites19.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6497.3
Applied rewrites97.3%
(FPCore (A B C) :precision binary64 (if (<= C 4.5e+37) (* 180.0 (/ (atan (/ (- (- C A) (hypot (- A) B)) B)) PI)) (/ (* 180.0 (atan (* (/ B (- C A)) -0.5))) PI)))
double code(double A, double B, double C) {
double tmp;
if (C <= 4.5e+37) {
tmp = 180.0 * (atan((((C - A) - hypot(-A, B)) / B)) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((B / (C - A)) * -0.5))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 4.5e+37) {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(-A, B)) / B)) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((B / (C - A)) * -0.5))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 4.5e+37: tmp = 180.0 * (math.atan((((C - A) - math.hypot(-A, B)) / B)) / math.pi) else: tmp = (180.0 * math.atan(((B / (C - A)) * -0.5))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= 4.5e+37) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(Float64(-A), B)) / B)) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / Float64(C - A)) * -0.5))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 4.5e+37) tmp = 180.0 * (atan((((C - A) - hypot(-A, B)) / B)) / pi); else tmp = (180.0 * atan(((B / (C - A)) * -0.5))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 4.5e+37], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[(-A) ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 4.5 \cdot 10^{+37}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(-A, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < 4.49999999999999962e37Initial program 62.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites83.5%
Taylor expanded in A around inf
mul-1-negN/A
lift-neg.f6482.6
Applied rewrites82.6%
Taylor expanded in C around 0
lift--.f6482.6
Applied rewrites82.6%
if 4.49999999999999962e37 < C Initial program 23.4%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites57.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6474.4
Applied rewrites74.4%
(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 -40.0)
(* 180.0 (/ (atan (/ (- (+ (- A) C) B) B)) PI))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B (- C A)) -0.5)) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C 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 <= -40.0) {
tmp = 180.0 * (atan((((-A + C) - B) / B)) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double 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 <= -40.0) {
tmp = 180.0 * (Math.atan((((-A + C) - B) / B)) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((B / (C - A)) * -0.5)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - 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 <= -40.0: tmp = 180.0 * (math.atan((((-A + C) - B) / B)) / math.pi) elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((B / (C - A)) * -0.5)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - 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 <= -40.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-A) + C) - B) / B)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / Float64(C - A)) * -0.5)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) 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 <= -40.0) tmp = 180.0 * (atan((((-A + C) - B) / B)) / pi); elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - 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, -40.0], N[(180.0 * N[(N[ArcTan[N[(N[(N[((-A) + C), $MachinePrecision] - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
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 -40:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(-A\right) + C\right) - B}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - 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))) < -40Initial program 59.5%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites86.8%
Taylor expanded in B around inf
Applied rewrites76.1%
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))) < -0.0Initial program 18.0%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites19.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6497.2
Applied rewrites97.2%
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 58.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6475.4
Applied rewrites75.4%
(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 -40.0)
(/ (* 180.0 (atan (/ (- (+ (- A) C) B) B))) PI)
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B (- C A)) -0.5)) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C 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 <= -40.0) {
tmp = (180.0 * atan((((-A + C) - B) / B))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double 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 <= -40.0) {
tmp = (180.0 * Math.atan((((-A + C) - B) / B))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((B / (C - A)) * -0.5)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - 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 <= -40.0: tmp = (180.0 * math.atan((((-A + C) - B) / B))) / math.pi elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((B / (C - A)) * -0.5)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - 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 <= -40.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(Float64(-A) + C) - B) / B))) / pi); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / Float64(C - A)) * -0.5)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) 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 <= -40.0) tmp = (180.0 * atan((((-A + C) - B) / B))) / pi; elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - 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, -40.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[((-A) + C), $MachinePrecision] - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
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 -40:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(\left(-A\right) + C\right) - B}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - 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))) < -40Initial program 59.5%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites86.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6486.8
Applied rewrites86.8%
Taylor expanded in B around inf
Applied rewrites76.1%
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))) < -0.0Initial program 18.0%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites19.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6497.2
Applied rewrites97.2%
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 58.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6475.4
Applied rewrites75.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (- C A) B))
(t_1
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_2 (atan (* (/ B (- C A)) -0.5))))
(if (<= t_1 (- INFINITY))
(/ (* 180.0 t_2) PI)
(if (<= t_1 -1000000.0)
(/ (* 180.0 (atan (+ t_0 1.0))) PI)
(if (<= t_1 -0.5)
(* 180.0 (/ (atan -1.0) PI))
(if (<= t_1 0.0)
(* 180.0 (/ t_2 PI))
(* 180.0 (/ (atan (+ 1.0 t_0)) PI))))))))
double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double t_1 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_2 = atan(((B / (C - A)) * -0.5));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (180.0 * t_2) / ((double) M_PI);
} else if (t_1 <= -1000000.0) {
tmp = (180.0 * atan((t_0 + 1.0))) / ((double) M_PI);
} else if (t_1 <= -0.5) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (t_1 <= 0.0) {
tmp = 180.0 * (t_2 / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + t_0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double t_1 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_2 = Math.atan(((B / (C - A)) * -0.5));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (180.0 * t_2) / Math.PI;
} else if (t_1 <= -1000000.0) {
tmp = (180.0 * Math.atan((t_0 + 1.0))) / Math.PI;
} else if (t_1 <= -0.5) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (t_1 <= 0.0) {
tmp = 180.0 * (t_2 / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + t_0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (C - A) / B t_1 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_2 = math.atan(((B / (C - A)) * -0.5)) tmp = 0 if t_1 <= -math.inf: tmp = (180.0 * t_2) / math.pi elif t_1 <= -1000000.0: tmp = (180.0 * math.atan((t_0 + 1.0))) / math.pi elif t_1 <= -0.5: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif t_1 <= 0.0: tmp = 180.0 * (t_2 / math.pi) else: tmp = 180.0 * (math.atan((1.0 + t_0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(C - A) / B) t_1 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_2 = atan(Float64(Float64(B / Float64(C - A)) * -0.5)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(180.0 * t_2) / pi); elseif (t_1 <= -1000000.0) tmp = Float64(Float64(180.0 * atan(Float64(t_0 + 1.0))) / pi); elseif (t_1 <= -0.5) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (t_1 <= 0.0) tmp = Float64(180.0 * Float64(t_2 / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (C - A) / B; t_1 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_2 = atan(((B / (C - A)) * -0.5)); tmp = 0.0; if (t_1 <= -Inf) tmp = (180.0 * t_2) / pi; elseif (t_1 <= -1000000.0) tmp = (180.0 * atan((t_0 + 1.0))) / pi; elseif (t_1 <= -0.5) tmp = 180.0 * (atan(-1.0) / pi); elseif (t_1 <= 0.0) tmp = 180.0 * (t_2 / pi); else tmp = 180.0 * (atan((1.0 + t_0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[ArcTan[N[(N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(180.0 * t$95$2), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$1, -1000000.0], N[(N[(180.0 * N[ArcTan[N[(t$95$0 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$1, -0.5], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(180.0 * N[(t$95$2 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{C - A}{B}\\
t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_2 := \tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{180 \cdot t\_2}{\pi}\\
\mathbf{elif}\;t\_1 \leq -1000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_0 + 1\right)}{\pi}\\
\mathbf{elif}\;t\_1 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;180 \cdot \frac{t\_2}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_0\right)}{\pi}\\
\end{array}
\end{array}
if (*.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)))))) < -inf.0Initial program 42.0%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites81.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6481.6
Applied rewrites81.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6437.2
Applied rewrites37.2%
if -inf.0 < (*.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)))))) < -1e6Initial program 96.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6495.7
Applied rewrites95.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites95.7%
if -1e6 < (*.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)))))) < -0.5Initial program 99.5%
Taylor expanded in B around inf
Applied rewrites95.3%
if -0.5 < (*.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)))))) < -0.0Initial program 18.0%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites19.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6497.3
Applied rewrites97.3%
if -0.0 < (*.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)))))) Initial program 58.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6475.4
Applied rewrites75.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (- C A) B))
(t_1
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_2 (/ (* 180.0 (atan (* (/ B (- C A)) -0.5))) PI)))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -1000000.0)
(/ (* 180.0 (atan (+ t_0 1.0))) PI)
(if (<= t_1 -0.5)
(* 180.0 (/ (atan -1.0) PI))
(if (<= t_1 0.0) t_2 (* 180.0 (/ (atan (+ 1.0 t_0)) PI))))))))
double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double t_1 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_2 = (180.0 * atan(((B / (C - A)) * -0.5))) / ((double) M_PI);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -1000000.0) {
tmp = (180.0 * atan((t_0 + 1.0))) / ((double) M_PI);
} else if (t_1 <= -0.5) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (t_1 <= 0.0) {
tmp = t_2;
} else {
tmp = 180.0 * (atan((1.0 + t_0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double t_1 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_2 = (180.0 * Math.atan(((B / (C - A)) * -0.5))) / Math.PI;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -1000000.0) {
tmp = (180.0 * Math.atan((t_0 + 1.0))) / Math.PI;
} else if (t_1 <= -0.5) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (t_1 <= 0.0) {
tmp = t_2;
} else {
tmp = 180.0 * (Math.atan((1.0 + t_0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (C - A) / B t_1 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_2 = (180.0 * math.atan(((B / (C - A)) * -0.5))) / math.pi tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -1000000.0: tmp = (180.0 * math.atan((t_0 + 1.0))) / math.pi elif t_1 <= -0.5: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif t_1 <= 0.0: tmp = t_2 else: tmp = 180.0 * (math.atan((1.0 + t_0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(C - A) / B) t_1 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_2 = Float64(Float64(180.0 * atan(Float64(Float64(B / Float64(C - A)) * -0.5))) / pi) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -1000000.0) tmp = Float64(Float64(180.0 * atan(Float64(t_0 + 1.0))) / pi); elseif (t_1 <= -0.5) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (t_1 <= 0.0) tmp = t_2; else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (C - A) / B; t_1 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_2 = (180.0 * atan(((B / (C - A)) * -0.5))) / pi; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -1000000.0) tmp = (180.0 * atan((t_0 + 1.0))) / pi; elseif (t_1 <= -0.5) tmp = 180.0 * (atan(-1.0) / pi); elseif (t_1 <= 0.0) tmp = t_2; else tmp = 180.0 * (atan((1.0 + t_0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(180.0 * N[ArcTan[N[(N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -1000000.0], N[(N[(180.0 * N[ArcTan[N[(t$95$0 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$1, -0.5], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], t$95$2, N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{C - A}{B}\\
t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_2 := \frac{180 \cdot \tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right)}{\pi}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_0 + 1\right)}{\pi}\\
\mathbf{elif}\;t\_1 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_0\right)}{\pi}\\
\end{array}
\end{array}
if (*.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)))))) < -inf.0 or -0.5 < (*.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)))))) < -0.0Initial program 34.4%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites61.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6461.9
Applied rewrites61.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6456.3
Applied rewrites56.3%
if -inf.0 < (*.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)))))) < -1e6Initial program 96.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6495.7
Applied rewrites95.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites95.7%
if -1e6 < (*.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)))))) < -0.5Initial program 99.5%
Taylor expanded in B around inf
Applied rewrites95.3%
if -0.0 < (*.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)))))) Initial program 58.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6475.4
Applied rewrites75.4%
(FPCore (A B C) :precision binary64 (if (<= C 6.1e+29) (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)) (/ (* 180.0 (atan (* (/ B C) -0.5))) PI)))
double code(double A, double B, double C) {
double tmp;
if (C <= 6.1e+29) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((B / C) * -0.5))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 6.1e+29) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((B / C) * -0.5))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 6.1e+29: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) else: tmp = (180.0 * math.atan(((B / C) * -0.5))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= 6.1e+29) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / C) * -0.5))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 6.1e+29) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); else tmp = (180.0 * atan(((B / C) * -0.5))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 6.1e+29], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 6.1 \cdot 10^{+29}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < 6.0999999999999998e29Initial program 62.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6458.4
Applied rewrites58.4%
if 6.0999999999999998e29 < C Initial program 23.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites57.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6474.0
Applied rewrites74.0%
Taylor expanded in A around 0
Applied rewrites69.1%
(FPCore (A B C) :precision binary64 (if (<= C 6.1e+29) (/ (* 180.0 (atan (+ (/ (- C A) B) 1.0))) PI) (/ (* 180.0 (atan (* (/ B C) -0.5))) PI)))
double code(double A, double B, double C) {
double tmp;
if (C <= 6.1e+29) {
tmp = (180.0 * atan((((C - A) / B) + 1.0))) / ((double) M_PI);
} else {
tmp = (180.0 * atan(((B / C) * -0.5))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 6.1e+29) {
tmp = (180.0 * Math.atan((((C - A) / B) + 1.0))) / Math.PI;
} else {
tmp = (180.0 * Math.atan(((B / C) * -0.5))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 6.1e+29: tmp = (180.0 * math.atan((((C - A) / B) + 1.0))) / math.pi else: tmp = (180.0 * math.atan(((B / C) * -0.5))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= 6.1e+29) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) / B) + 1.0))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / C) * -0.5))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 6.1e+29) tmp = (180.0 * atan((((C - A) / B) + 1.0))) / pi; else tmp = (180.0 * atan(((B / C) * -0.5))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 6.1e+29], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 6.1 \cdot 10^{+29}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < 6.0999999999999998e29Initial program 62.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6458.4
Applied rewrites58.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites58.4%
if 6.0999999999999998e29 < C Initial program 23.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites57.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6474.0
Applied rewrites74.0%
Taylor expanded in A around 0
Applied rewrites69.1%
(FPCore (A B C)
:precision binary64
(if (<= C -5e-127)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(if (<= C 6.1e+29)
(/ (* 180.0 (atan (+ (/ (- A) B) 1.0))) PI)
(/ (* 180.0 (atan (* (/ B C) -0.5))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -5e-127) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else if (C <= 6.1e+29) {
tmp = (180.0 * atan(((-A / B) + 1.0))) / ((double) M_PI);
} else {
tmp = (180.0 * atan(((B / C) * -0.5))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -5e-127) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else if (C <= 6.1e+29) {
tmp = (180.0 * Math.atan(((-A / B) + 1.0))) / Math.PI;
} else {
tmp = (180.0 * Math.atan(((B / C) * -0.5))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -5e-127: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) elif C <= 6.1e+29: tmp = (180.0 * math.atan(((-A / B) + 1.0))) / math.pi else: tmp = (180.0 * math.atan(((B / C) * -0.5))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= -5e-127) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); elseif (C <= 6.1e+29) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(-A) / B) + 1.0))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / C) * -0.5))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -5e-127) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); elseif (C <= 6.1e+29) tmp = (180.0 * atan(((-A / B) + 1.0))) / pi; else tmp = (180.0 * atan(((B / C) * -0.5))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -5e-127], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.1e+29], N[(N[(180.0 * N[ArcTan[N[(N[((-A) / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -5 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.1 \cdot 10^{+29}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-A}{B} + 1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < -4.9999999999999997e-127Initial program 71.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6471.7
Applied rewrites71.7%
Taylor expanded in A around 0
Applied rewrites68.1%
if -4.9999999999999997e-127 < C < 6.0999999999999998e29Initial program 54.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6447.3
Applied rewrites47.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.3%
Taylor expanded in A around inf
mul-1-negN/A
lift-neg.f6446.7
Applied rewrites46.7%
if 6.0999999999999998e29 < C Initial program 23.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites57.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6474.0
Applied rewrites74.0%
Taylor expanded in A around 0
Applied rewrites69.1%
(FPCore (A B C)
:precision binary64
(if (<= C -5e-127)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(if (<= C 6.1e+29)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(/ (* 180.0 (atan (* (/ B C) -0.5))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -5e-127) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else if (C <= 6.1e+29) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((B / C) * -0.5))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -5e-127) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else if (C <= 6.1e+29) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((B / C) * -0.5))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -5e-127: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) elif C <= 6.1e+29: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) else: tmp = (180.0 * math.atan(((B / C) * -0.5))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= -5e-127) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); elseif (C <= 6.1e+29) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / C) * -0.5))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -5e-127) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); elseif (C <= 6.1e+29) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = (180.0 * atan(((B / C) * -0.5))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -5e-127], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.1e+29], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -5 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.1 \cdot 10^{+29}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < -4.9999999999999997e-127Initial program 71.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6471.7
Applied rewrites71.7%
Taylor expanded in A around 0
Applied rewrites68.1%
if -4.9999999999999997e-127 < C < 6.0999999999999998e29Initial program 54.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6447.3
Applied rewrites47.3%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6446.7
Applied rewrites46.7%
if 6.0999999999999998e29 < C Initial program 23.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites57.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6474.0
Applied rewrites74.0%
Taylor expanded in A around 0
Applied rewrites69.1%
(FPCore (A B C)
:precision binary64
(if (<= A -1.3e+55)
(/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
(if (<= A 7.4e-104)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.3e+55) {
tmp = (180.0 * atan(((B / A) * 0.5))) / ((double) M_PI);
} else if (A <= 7.4e-104) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.3e+55) {
tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
} else if (A <= 7.4e-104) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.3e+55: tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi elif A <= 7.4e-104: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) else: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.3e+55) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / pi); elseif (A <= 7.4e-104) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.3e+55) tmp = (180.0 * atan(((B / A) * 0.5))) / pi; elseif (A <= 7.4e-104) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan((1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.3e+55], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 7.4e-104], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.3 \cdot 10^{+55}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 7.4 \cdot 10^{-104}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.3e55Initial program 21.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites57.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6472.1
Applied rewrites72.1%
if -1.3e55 < A < 7.3999999999999999e-104Initial program 53.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6445.7
Applied rewrites45.7%
Taylor expanded in A around 0
Applied rewrites44.8%
if 7.3999999999999999e-104 < A Initial program 73.0%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.0
Applied rewrites74.0%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6470.7
Applied rewrites70.7%
(FPCore (A B C) :precision binary64 (if (<= B 5.8e-108) (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 5.8e-108) {
tmp = 180.0 * (atan((1.0 + (C / 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 <= 5.8e-108) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 5.8e-108: tmp = 180.0 * (math.atan((1.0 + (C / 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 <= 5.8e-108) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / 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 <= 5.8e-108) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 5.8e-108], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 5.8 \cdot 10^{-108}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 5.8000000000000002e-108Initial program 54.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6461.5
Applied rewrites61.5%
Taylor expanded in A around 0
Applied rewrites49.3%
if 5.8000000000000002e-108 < B Initial program 52.2%
Taylor expanded in B around inf
Applied rewrites52.8%
(FPCore (A B C) :precision binary64 (if (<= B 5.8e-108) (/ (* 180.0 (atan (+ (/ C B) 1.0))) PI) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 5.8e-108) {
tmp = (180.0 * atan(((C / B) + 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 <= 5.8e-108) {
tmp = (180.0 * Math.atan(((C / B) + 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 <= 5.8e-108: tmp = (180.0 * math.atan(((C / B) + 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 <= 5.8e-108) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C / B) + 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 <= 5.8e-108) tmp = (180.0 * atan(((C / B) + 1.0))) / pi; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 5.8e-108], N[(N[(180.0 * N[ArcTan[N[(N[(C / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 5.8 \cdot 10^{-108}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B} + 1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 5.8000000000000002e-108Initial program 54.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6461.5
Applied rewrites61.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites61.5%
Taylor expanded in A around 0
Applied rewrites49.3%
if 5.8000000000000002e-108 < B Initial program 52.2%
Taylor expanded in B around inf
Applied rewrites52.8%
(FPCore (A B C)
:precision binary64
(if (<= B -1.75e-245)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= B 5.8e-108)
(* (/ (atan (/ (+ C C) B)) PI) 180.0)
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.75e-245) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (B <= 5.8e-108) {
tmp = (atan(((C + C) / B)) / ((double) M_PI)) * 180.0;
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1.75e-245) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (B <= 5.8e-108) {
tmp = (Math.atan(((C + C) / B)) / Math.PI) * 180.0;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.75e-245: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif B <= 5.8e-108: tmp = (math.atan(((C + C) / B)) / math.pi) * 180.0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1.75e-245) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (B <= 5.8e-108) tmp = Float64(Float64(atan(Float64(Float64(C + C) / B)) / pi) * 180.0); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1.75e-245) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (B <= 5.8e-108) tmp = (atan(((C + C) / B)) / pi) * 180.0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.75e-245], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.8e-108], N[(N[(N[ArcTan[N[(N[(C + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.75 \cdot 10^{-245}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 5.8 \cdot 10^{-108}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C + C}{B}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.75000000000000008e-245Initial program 51.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6466.5
Applied rewrites66.5%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6456.8
Applied rewrites56.8%
if -1.75000000000000008e-245 < B < 5.8000000000000002e-108Initial program 59.5%
Taylor expanded in C around -inf
associate-*r/N/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6434.8
Applied rewrites34.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6434.8
*-commutative34.8
Applied rewrites34.8%
if 5.8000000000000002e-108 < B Initial program 52.2%
Taylor expanded in B around inf
Applied rewrites52.8%
(FPCore (A B C)
:precision binary64
(if (<= B -1.75e-245)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= B 5.8e-108)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.75e-245) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (B <= 5.8e-108) {
tmp = 180.0 * (atan((C / 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 <= -1.75e-245) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (B <= 5.8e-108) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.75e-245: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif B <= 5.8e-108: tmp = 180.0 * (math.atan((C / 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 <= -1.75e-245) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (B <= 5.8e-108) tmp = Float64(180.0 * Float64(atan(Float64(C / 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 <= -1.75e-245) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (B <= 5.8e-108) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.75e-245], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.8e-108], N[(180.0 * N[(N[ArcTan[N[(C / 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 -1.75 \cdot 10^{-245}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 5.8 \cdot 10^{-108}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.75000000000000008e-245Initial program 51.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6466.5
Applied rewrites66.5%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6456.8
Applied rewrites56.8%
if -1.75000000000000008e-245 < B < 5.8000000000000002e-108Initial program 59.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6451.0
Applied rewrites51.0%
Taylor expanded in C around inf
lower-/.f6434.8
Applied rewrites34.8%
if 5.8000000000000002e-108 < B Initial program 52.2%
Taylor expanded in B around inf
Applied rewrites52.8%
(FPCore (A B C)
:precision binary64
(if (<= B -3.8e-158)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 5.8e-108)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.8e-158) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 5.8e-108) {
tmp = 180.0 * (atan((C / 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 <= -3.8e-158) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 5.8e-108) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.8e-158: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 5.8e-108: tmp = 180.0 * (math.atan((C / 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 <= -3.8e-158) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 5.8e-108) tmp = Float64(180.0 * Float64(atan(Float64(C / 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 <= -3.8e-158) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 5.8e-108) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.8e-158], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.8e-108], N[(180.0 * N[(N[ArcTan[N[(C / 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 -3.8 \cdot 10^{-158}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 5.8 \cdot 10^{-108}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.7999999999999999e-158Initial program 51.6%
Taylor expanded in B around -inf
Applied rewrites48.4%
if -3.7999999999999999e-158 < B < 5.8000000000000002e-108Initial program 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6450.4
Applied rewrites50.4%
Taylor expanded in C around inf
lower-/.f6433.8
Applied rewrites33.8%
if 5.8000000000000002e-108 < B Initial program 52.2%
Taylor expanded in B around inf
Applied rewrites52.8%
(FPCore (A B C) :precision binary64 (if (<= B -1e-309) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1e-309) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1e-309) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1e-309: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1e-309) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1e-309) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1e-309], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1 \cdot 10^{-309}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.000000000000002e-309Initial program 52.6%
Taylor expanded in B around -inf
Applied rewrites39.4%
if -1.000000000000002e-309 < B Initial program 54.3%
Taylor expanded in B around inf
Applied rewrites40.3%
(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.5%
Taylor expanded in B around inf
Applied rewrites21.1%
herbie shell --seed 2025112
(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)))