
(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 19 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)))
(t_1 (+ (- A) C))
(t_2 (/ (* 180.0 (atan (/ (- t_1 (hypot t_1 B)) B))) PI)))
(if (<= t_0 -10.0)
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 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
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 <= -10.0) {
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 = 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 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 <= -10.0) {
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 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) 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 <= -10.0: 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(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) t_1 = Float64(Float64(-A) + C) t_2 = Float64(Float64(180.0 * atan(Float64(Float64(t_1 - hypot(t_1, B)) / B))) / pi) tmp = 0.0 if (t_0 <= -10.0) 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 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); t_1 = -A + C; t_2 = (180.0 * atan(((t_1 - hypot(t_1, B)) / B))) / pi; tmp = 0.0; if (t_0 <= -10.0) 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[(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]}, Block[{t$95$1 = N[((-A) + C), $MachinePrecision]}, Block[{t$95$2 = N[(N[(180.0 * N[ArcTan[N[(N[(t$95$1 - N[Sqrt[t$95$1 ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, If[LessEqual[t$95$0, -10.0], 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 := 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}\\
t_1 := \left(-A\right) + C\\
t_2 := \frac{180 \cdot \tan^{-1} \left(\frac{t\_1 - \mathsf{hypot}\left(t\_1, B\right)}{B}\right)}{\pi}\\
\mathbf{if}\;t\_0 \leq -10:\\
\;\;\;\;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 #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))) < -10 or -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.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites86.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6486.7
Applied rewrites86.7%
if -10 < (*.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.2%
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.7
Applied rewrites97.7%
(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)))
(t_1 (+ (- A) C))
(t_2 (* 180.0 (/ (atan (/ (- t_1 (hypot t_1 B)) B)) PI))))
(if (<= t_0 -10.0)
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 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
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 <= -10.0) {
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 = 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 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 <= -10.0) {
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 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) 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 <= -10.0: 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(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) 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 <= -10.0) 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 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); t_1 = -A + C; t_2 = 180.0 * (atan(((t_1 - hypot(t_1, B)) / B)) / pi); tmp = 0.0; if (t_0 <= -10.0) 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[(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]}, 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, -10.0], 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 := 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}\\
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 -10:\\
\;\;\;\;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 #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))) < -10 or -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.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites86.7%
if -10 < (*.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.2%
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.7
Applied rewrites97.7%
(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)))
(t_1 (hypot (- A) B)))
(if (<= t_0 -10.0)
(/ (* 180.0 (atan (/ (- (- C A) t_1) B))) PI)
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B (- C A)) -0.5)) PI))
(* 180.0 (/ (atan (/ (- (+ (- A) C) t_1) 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 t_1 = hypot(-A, B);
double tmp;
if (t_0 <= -10.0) {
tmp = (180.0 * atan((((C - A) - t_1) / 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((((-A + C) - t_1) / 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 t_1 = Math.hypot(-A, B);
double tmp;
if (t_0 <= -10.0) {
tmp = (180.0 * Math.atan((((C - A) - t_1) / 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((((-A + C) - t_1) / 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) t_1 = math.hypot(-A, B) tmp = 0 if t_0 <= -10.0: tmp = (180.0 * math.atan((((C - A) - t_1) / 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((((-A + C) - t_1) / 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)) t_1 = hypot(Float64(-A), B) tmp = 0.0 if (t_0 <= -10.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - t_1) / 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(Float64(Float64(Float64(-A) + C) - t_1) / 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); t_1 = hypot(-A, B); tmp = 0.0; if (t_0 <= -10.0) tmp = (180.0 * atan((((C - A) - t_1) / B))) / pi; elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / pi); else tmp = 180.0 * (atan((((-A + C) - t_1) / 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]}, Block[{t$95$1 = N[Sqrt[(-A) ^ 2 + B ^ 2], $MachinePrecision]}, If[LessEqual[t$95$0, -10.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - t$95$1), $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[(N[(N[((-A) + C), $MachinePrecision] - t$95$1), $MachinePrecision] / B), $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}\\
t_1 := \mathsf{hypot}\left(-A, B\right)\\
\mathbf{if}\;t\_0 \leq -10:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - t\_1}{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(\frac{\left(\left(-A\right) + C\right) - t\_1}{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))) < -10Initial program 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
Taylor expanded in A around inf
mul-1-negN/A
lift-neg.f6481.9
Applied rewrites81.9%
Taylor expanded in C around 0
lower--.f6481.9
Applied rewrites81.9%
if -10 < (*.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.2%
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.7
Applied rewrites97.7%
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 57.4%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites86.1%
Taylor expanded in A around inf
mul-1-negN/A
lift-neg.f6480.6
Applied rewrites80.6%
(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)))
(t_1 (/ (* 180.0 (atan (/ (- (- C A) (hypot (- A) B)) B))) PI)))
(if (<= t_0 -10.0)
t_1
(if (<= t_0 0.0) (* 180.0 (/ (atan (* (/ B (- C A)) -0.5)) PI)) t_1))))
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 t_1 = (180.0 * atan((((C - A) - hypot(-A, B)) / B))) / ((double) M_PI);
double tmp;
if (t_0 <= -10.0) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / ((double) M_PI));
} else {
tmp = t_1;
}
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 t_1 = (180.0 * Math.atan((((C - A) - Math.hypot(-A, B)) / B))) / Math.PI;
double tmp;
if (t_0 <= -10.0) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((B / (C - A)) * -0.5)) / Math.PI);
} else {
tmp = t_1;
}
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) t_1 = (180.0 * math.atan((((C - A) - math.hypot(-A, B)) / B))) / math.pi tmp = 0 if t_0 <= -10.0: tmp = t_1 elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((B / (C - A)) * -0.5)) / math.pi) else: tmp = t_1 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)) t_1 = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(-A), B)) / B))) / pi) tmp = 0.0 if (t_0 <= -10.0) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / Float64(C - A)) * -0.5)) / pi)); else tmp = t_1; 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); t_1 = (180.0 * atan((((C - A) - hypot(-A, B)) / B))) / pi; tmp = 0.0; if (t_0 <= -10.0) tmp = t_1; elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((B / (C - A)) * -0.5)) / pi); else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[(-A) ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, If[LessEqual[t$95$0, -10.0], t$95$1, 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$1]]]]
\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}\\
t_1 := \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(-A, B\right)}{B}\right)}{\pi}\\
\mathbf{if}\;t\_0 \leq -10:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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))) < -10 or -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.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites86.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6486.7
Applied rewrites86.7%
Taylor expanded in A around inf
mul-1-negN/A
lift-neg.f6481.3
Applied rewrites81.3%
Taylor expanded in C around 0
lower--.f6481.3
Applied rewrites81.3%
if -10 < (*.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.2%
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.7
Applied rewrites97.7%
(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 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.4%
Taylor expanded in B around inf
Applied rewrites76.8%
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.2%
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.7
Applied rewrites97.7%
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 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
(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 (/ (- (- C A) 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((((C - A) - 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((((C - A) - 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((((C - A) - 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(C - A) - 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((((C - A) - 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[(C - A), $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(C - A\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 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
Taylor expanded in B around inf
Applied rewrites76.8%
Taylor expanded in C around 0
lower--.f6476.8
Applied rewrites76.8%
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.2%
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.7
Applied rewrites97.7%
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 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
(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 (/ (- (- C A) 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((((C - A) - 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((((C - A) - 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((((C - A) - 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(C - A) - B) / B))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 * 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((((C - A) - 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[(C - A), $MachinePrecision] - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $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(C - A\right) - B}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \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 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
Taylor expanded in B around inf
Applied rewrites76.8%
Taylor expanded in C around 0
lower--.f6476.8
Applied rewrites76.8%
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.2%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites19.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6419.6
Applied rewrites19.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6497.7
Applied rewrites97.7%
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 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
(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 (/ (- (- C A) B) B))) PI)
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B 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((((C - A) - B) / B))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((B / 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((((C - A) - B) / B))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((B / 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((((C - A) - B) / B))) / math.pi elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((B / 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(C - A) - B) / B))) / pi); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / 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((((C - A) - B) / B))) / pi; elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((B / 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[(C - A), $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 / A), $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(C - A\right) - B}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{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 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
Taylor expanded in B around inf
Applied rewrites76.8%
Taylor expanded in C around 0
lower--.f6476.8
Applied rewrites76.8%
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.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.8
Applied rewrites49.8%
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 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
(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 (/ (- (- C A) B) B))) PI)
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B A) 0.5)) PI))
(* (/ (atan (- 1.0 (/ A B))) PI) 180.0)))))
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((((C - A) - B) / B))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((B / A) * 0.5)) / ((double) M_PI));
} else {
tmp = (atan((1.0 - (A / B))) / ((double) M_PI)) * 180.0;
}
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((((C - A) - B) / B))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / Math.PI);
} else {
tmp = (Math.atan((1.0 - (A / B))) / Math.PI) * 180.0;
}
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((((C - A) - B) / B))) / math.pi elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((B / A) * 0.5)) / math.pi) else: tmp = (math.atan((1.0 - (A / B))) / math.pi) * 180.0 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(C - A) - B) / B))) / pi); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi)); else tmp = Float64(Float64(atan(Float64(1.0 - Float64(A / B))) / pi) * 180.0); 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((((C - A) - B) / B))) / pi; elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((B / A) * 0.5)) / pi); else tmp = (atan((1.0 - (A / B))) / pi) * 180.0; 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[(C - A), $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 / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $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(C - A\right) - B}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi} \cdot 180\\
\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 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
Taylor expanded in B around inf
Applied rewrites76.8%
Taylor expanded in C around 0
lower--.f6476.8
Applied rewrites76.8%
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.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.8
Applied rewrites49.8%
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 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6461.9
Applied rewrites61.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.9
Applied rewrites61.9%
(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 (/ (- C B) B))) PI)
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* (/ B A) 0.5)) PI))
(* (/ (atan (- 1.0 (/ A B))) PI) 180.0)))))
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(((C - B) / B))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan(((B / A) * 0.5)) / ((double) M_PI));
} else {
tmp = (atan((1.0 - (A / B))) / ((double) M_PI)) * 180.0;
}
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(((C - B) / B))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / Math.PI);
} else {
tmp = (Math.atan((1.0 - (A / B))) / Math.PI) * 180.0;
}
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(((C - B) / B))) / math.pi elif t_0 <= 0.0: tmp = 180.0 * (math.atan(((B / A) * 0.5)) / math.pi) else: tmp = (math.atan((1.0 - (A / B))) / math.pi) * 180.0 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(C - B) / B))) / pi); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi)); else tmp = Float64(Float64(atan(Float64(1.0 - Float64(A / B))) / pi) * 180.0); 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(((C - B) / B))) / pi; elseif (t_0 <= 0.0) tmp = 180.0 * (atan(((B / A) * 0.5)) / pi); else tmp = (atan((1.0 - (A / B))) / pi) * 180.0; 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[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $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{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi} \cdot 180\\
\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 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
Taylor expanded in B around inf
Applied rewrites76.8%
Taylor expanded in A around 0
Applied rewrites64.2%
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.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.8
Applied rewrites49.8%
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 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6461.9
Applied rewrites61.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.9
Applied rewrites61.9%
(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 (/ (- C B) B))) PI)
(if (<= t_0 0.0)
(/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
(* (/ (atan (- 1.0 (/ A B))) PI) 180.0)))))
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(((C - B) / B))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 * atan(((B / A) * 0.5))) / ((double) M_PI);
} else {
tmp = (atan((1.0 - (A / B))) / ((double) M_PI)) * 180.0;
}
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(((C - B) / B))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
} else {
tmp = (Math.atan((1.0 - (A / B))) / Math.PI) * 180.0;
}
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(((C - B) / B))) / math.pi elif t_0 <= 0.0: tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi else: tmp = (math.atan((1.0 - (A / B))) / math.pi) * 180.0 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(C - B) / B))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / pi); else tmp = Float64(Float64(atan(Float64(1.0 - Float64(A / B))) / pi) * 180.0); 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(((C - B) / B))) / pi; elseif (t_0 <= 0.0) tmp = (180.0 * atan(((B / A) * 0.5))) / pi; else tmp = (atan((1.0 - (A / B))) / pi) * 180.0; 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[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $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{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi} \cdot 180\\
\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 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
Taylor expanded in B around inf
Applied rewrites76.8%
Taylor expanded in A around 0
Applied rewrites64.2%
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.2%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites19.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6419.6
Applied rewrites19.6%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.8
Applied rewrites49.8%
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 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6461.9
Applied rewrites61.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.9
Applied rewrites61.9%
(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 -5e-5)
(/ (* 180.0 (atan (/ (- C B) B))) PI)
(if (<= t_0 0.0)
(* (/ (atan (* -0.5 (/ B C))) PI) 180.0)
(* (/ (atan (- 1.0 (/ A B))) PI) 180.0)))))
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 <= -5e-5) {
tmp = (180.0 * atan(((C - B) / B))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (atan((-0.5 * (B / C))) / ((double) M_PI)) * 180.0;
} else {
tmp = (atan((1.0 - (A / B))) / ((double) M_PI)) * 180.0;
}
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 <= -5e-5) {
tmp = (180.0 * Math.atan(((C - B) / B))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = (Math.atan((-0.5 * (B / C))) / Math.PI) * 180.0;
} else {
tmp = (Math.atan((1.0 - (A / B))) / Math.PI) * 180.0;
}
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 <= -5e-5: tmp = (180.0 * math.atan(((C - B) / B))) / math.pi elif t_0 <= 0.0: tmp = (math.atan((-0.5 * (B / C))) / math.pi) * 180.0 else: tmp = (math.atan((1.0 - (A / B))) / math.pi) * 180.0 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 <= -5e-5) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - B) / B))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(atan(Float64(-0.5 * Float64(B / C))) / pi) * 180.0); else tmp = Float64(Float64(atan(Float64(1.0 - Float64(A / B))) / pi) * 180.0); 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 <= -5e-5) tmp = (180.0 * atan(((C - B) / B))) / pi; elseif (t_0 <= 0.0) tmp = (atan((-0.5 * (B / C))) / pi) * 180.0; else tmp = (atan((1.0 - (A / B))) / pi) * 180.0; 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, -5e-5], N[(N[(180.0 * N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $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 -5 \cdot 10^{-5}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi} \cdot 180\\
\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))) < -5.00000000000000024e-5Initial program 60.1%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites87.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6487.3
Applied rewrites87.3%
Taylor expanded in B around inf
Applied rewrites76.6%
Taylor expanded in A around 0
Applied rewrites64.0%
if -5.00000000000000024e-5 < (*.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 17.9%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6452.2
Applied rewrites52.2%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6452.2
Applied rewrites52.2%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites52.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 57.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6461.9
Applied rewrites61.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.9
Applied rewrites61.9%
(FPCore (A B C) :precision binary64 (if (<= B 7.2e-253) (* (/ (atan (- 1.0 (/ A B))) PI) 180.0) (/ (* 180.0 (atan (/ (- C B) B))) PI)))
double code(double A, double B, double C) {
double tmp;
if (B <= 7.2e-253) {
tmp = (atan((1.0 - (A / B))) / ((double) M_PI)) * 180.0;
} else {
tmp = (180.0 * atan(((C - B) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 7.2e-253) {
tmp = (Math.atan((1.0 - (A / B))) / Math.PI) * 180.0;
} else {
tmp = (180.0 * Math.atan(((C - B) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 7.2e-253: tmp = (math.atan((1.0 - (A / B))) / math.pi) * 180.0 else: tmp = (180.0 * math.atan(((C - B) / B))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (B <= 7.2e-253) tmp = Float64(Float64(atan(Float64(1.0 - Float64(A / B))) / pi) * 180.0); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - B) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 7.2e-253) tmp = (atan((1.0 - (A / B))) / pi) * 180.0; else tmp = (180.0 * atan(((C - B) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 7.2e-253], N[(N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 7.2 \cdot 10^{-253}:\\
\;\;\;\;\frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < 7.2e-253Initial program 53.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6464.5
Applied rewrites64.5%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6453.0
Applied rewrites53.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6453.0
Applied rewrites53.0%
if 7.2e-253 < B Initial program 53.4%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites77.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6477.8
Applied rewrites77.8%
Taylor expanded in B around inf
Applied rewrites68.5%
Taylor expanded in A around 0
Applied rewrites57.8%
(FPCore (A B C)
:precision binary64
(if (<= B 7.2e-253)
(* (/ (atan (- 1.0 (/ A B))) PI) 180.0)
(if (<= B 2.7e+43)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= 7.2e-253) {
tmp = (atan((1.0 - (A / B))) / ((double) M_PI)) * 180.0;
} else if (B <= 2.7e+43) {
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 <= 7.2e-253) {
tmp = (Math.atan((1.0 - (A / B))) / Math.PI) * 180.0;
} else if (B <= 2.7e+43) {
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 <= 7.2e-253: tmp = (math.atan((1.0 - (A / B))) / math.pi) * 180.0 elif B <= 2.7e+43: 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 <= 7.2e-253) tmp = Float64(Float64(atan(Float64(1.0 - Float64(A / B))) / pi) * 180.0); elseif (B <= 2.7e+43) 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 <= 7.2e-253) tmp = (atan((1.0 - (A / B))) / pi) * 180.0; elseif (B <= 2.7e+43) 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, 7.2e-253], N[(N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[B, 2.7e+43], 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 7.2 \cdot 10^{-253}:\\
\;\;\;\;\frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi} \cdot 180\\
\mathbf{elif}\;B \leq 2.7 \cdot 10^{+43}:\\
\;\;\;\;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 < 7.2e-253Initial program 53.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6464.5
Applied rewrites64.5%
Taylor expanded in C around 0
lower--.f64N/A
lift-/.f6453.0
Applied rewrites53.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6453.0
Applied rewrites53.0%
if 7.2e-253 < B < 2.7000000000000002e43Initial program 59.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6445.2
Applied rewrites45.2%
Taylor expanded in C around inf
lower-/.f6429.9
Applied rewrites29.9%
if 2.7000000000000002e43 < B Initial program 46.4%
Taylor expanded in B around inf
Applied rewrites65.2%
(FPCore (A B C)
:precision binary64
(if (<= B -1.2e-11)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 7.2e-253)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(if (<= B 2.7e+43)
(* 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.2e-11) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 7.2e-253) {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
} else if (B <= 2.7e+43) {
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.2e-11) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 7.2e-253) {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
} else if (B <= 2.7e+43) {
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.2e-11: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 7.2e-253: tmp = 180.0 * (math.atan((-A / B)) / math.pi) elif B <= 2.7e+43: 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.2e-11) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 7.2e-253) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); elseif (B <= 2.7e+43) 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.2e-11) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 7.2e-253) tmp = 180.0 * (atan((-A / B)) / pi); elseif (B <= 2.7e+43) 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.2e-11], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.2e-253], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.7e+43], 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.2 \cdot 10^{-11}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 7.2 \cdot 10^{-253}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.7 \cdot 10^{+43}:\\
\;\;\;\;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.2000000000000001e-11Initial program 46.5%
Taylor expanded in B around -inf
Applied rewrites59.5%
if -1.2000000000000001e-11 < B < 7.2e-253Initial program 59.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6454.4
Applied rewrites54.4%
Taylor expanded in A around inf
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f6431.7
Applied rewrites31.7%
if 7.2e-253 < B < 2.7000000000000002e43Initial program 59.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6445.2
Applied rewrites45.2%
Taylor expanded in C around inf
lower-/.f6429.9
Applied rewrites29.9%
if 2.7000000000000002e43 < B Initial program 46.4%
Taylor expanded in B around inf
Applied rewrites65.2%
(FPCore (A B C)
:precision binary64
(if (<= B -9.8e-127)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.7e+43)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -9.8e-127) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.7e+43) {
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 <= -9.8e-127) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.7e+43) {
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 <= -9.8e-127: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.7e+43: 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 <= -9.8e-127) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.7e+43) 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 <= -9.8e-127) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.7e+43) 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, -9.8e-127], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.7e+43], 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 -9.8 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.7 \cdot 10^{+43}:\\
\;\;\;\;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 < -9.8000000000000002e-127Initial program 49.4%
Taylor expanded in B around -inf
Applied rewrites50.6%
if -9.8000000000000002e-127 < B < 2.7000000000000002e43Initial program 60.0%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6449.0
Applied rewrites49.0%
Taylor expanded in C around inf
lower-/.f6433.5
Applied rewrites33.5%
if 2.7000000000000002e43 < B Initial program 46.4%
Taylor expanded in B around inf
Applied rewrites65.2%
(FPCore (A B C)
:precision binary64
(if (<= B -4.1e-214)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 7.1e-112)
(/ (* 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.1e-214) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 7.1e-112) {
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.1e-214) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 7.1e-112) {
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.1e-214: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 7.1e-112: 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.1e-214) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 7.1e-112) tmp = Float64(Float64(180.0 * 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.1e-214) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 7.1e-112) 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.1e-214], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.1e-112], N[(N[(180.0 * N[ArcTan[0.0], $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 -4.1 \cdot 10^{-214}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 7.1 \cdot 10^{-112}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.0999999999999997e-214Initial program 50.1%
Taylor expanded in B around -inf
Applied rewrites44.7%
if -4.0999999999999997e-214 < B < 7.09999999999999957e-112Initial program 60.7%
Taylor expanded in A around -inf
lower-atan.f64N/A
lower-/.f64N/A
Applied rewrites81.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6481.8
Applied rewrites81.8%
Taylor expanded in C around inf
associate-*r/N/A
mul-1-negN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
div030.1
Applied rewrites30.1%
if 7.09999999999999957e-112 < B Initial program 52.2%
Taylor expanded in B around inf
Applied rewrites52.4%
(FPCore (A B C) :precision binary64 (if (<= B -2.9e-305) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.9e-305) {
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 <= -2.9e-305) {
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 <= -2.9e-305: 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 <= -2.9e-305) 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 <= -2.9e-305) 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, -2.9e-305], 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 -2.9 \cdot 10^{-305}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.89999999999999988e-305Initial program 52.0%
Taylor expanded in B around -inf
Applied rewrites39.9%
if -2.89999999999999988e-305 < B Initial program 54.6%
Taylor expanded in B around inf
Applied rewrites39.9%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 53.3%
Taylor expanded in B around inf
Applied rewrites21.0%
herbie shell --seed 2025106
(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)))