
(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}
Sampling outcomes in binary64 precision:
Herbie found 14 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 (if (<= C 5e+167) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI)) (/ 180.0 (/ PI (atan (* -0.5 (/ B C)))))))
double code(double A, double B, double C) {
double tmp;
if (C <= 5e+167) {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
} else {
tmp = 180.0 / (((double) M_PI) / atan((-0.5 * (B / C))));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 5e+167) {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
} else {
tmp = 180.0 / (Math.PI / Math.atan((-0.5 * (B / C))));
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 5e+167: tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi) else: tmp = 180.0 / (math.pi / math.atan((-0.5 * (B / C)))) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 5e+167) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); else tmp = Float64(180.0 / Float64(pi / atan(Float64(-0.5 * Float64(B / C))))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 5e+167) tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); else tmp = 180.0 / (pi / atan((-0.5 * (B / C)))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 5e+167], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 5 \cdot 10^{+167}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}}\\
\end{array}
\end{array}
if C < 4.9999999999999997e167Initial program 67.3%
associate-*l/67.3%
*-lft-identity67.3%
+-commutative67.3%
unpow267.3%
unpow267.3%
hypot-define86.1%
Simplified86.1%
if 4.9999999999999997e167 < C Initial program 5.6%
Applied egg-rr58.6%
Taylor expanded in A around 0 5.6%
unpow25.6%
unpow25.6%
hypot-define58.8%
Simplified58.8%
Taylor expanded in C around inf 88.7%
Final simplification86.3%
(FPCore (A B C)
:precision binary64
(if (<= A -2.8e+117)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 2.9e-38)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (/ (+ A (hypot B A)) (- B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.8e+117) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 2.9e-38) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.8e+117) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 2.9e-38) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A + Math.hypot(B, A)) / -B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.8e+117: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 2.9e-38: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((A + math.hypot(B, A)) / -B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.8e+117) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 2.9e-38) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) / Float64(-B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.8e+117) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 2.9e-38) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.8e+117], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.9e-38], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.8 \cdot 10^{+117}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.9 \cdot 10^{-38}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.79999999999999997e117Initial program 18.6%
Taylor expanded in A around -inf 76.1%
associate-*r/76.1%
Simplified76.1%
if -2.79999999999999997e117 < A < 2.89999999999999994e-38Initial program 57.5%
Taylor expanded in A around 0 55.2%
unpow255.2%
unpow255.2%
hypot-define80.3%
Simplified80.3%
if 2.89999999999999994e-38 < A Initial program 84.6%
Taylor expanded in C around 0 82.4%
mul-1-neg82.4%
distribute-neg-frac282.4%
+-commutative82.4%
unpow282.4%
unpow282.4%
hypot-define91.7%
Simplified91.7%
Final simplification83.4%
(FPCore (A B C)
:precision binary64
(if (<= A -3.3e+120)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 7.2e-32)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.3e+120) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 7.2e-32) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((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 tmp;
if (A <= -3.3e+120) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 7.2e-32) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.3e+120: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 7.2e-32: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.3e+120) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 7.2e-32) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / 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) tmp = 0.0; if (A <= -3.3e+120) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 7.2e-32) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.3e+120], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7.2e-32], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $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}
\mathbf{if}\;A \leq -3.3 \cdot 10^{+120}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 7.2 \cdot 10^{-32}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.29999999999999991e120Initial program 18.6%
Taylor expanded in A around -inf 76.1%
associate-*r/76.1%
Simplified76.1%
if -3.29999999999999991e120 < A < 7.19999999999999986e-32Initial program 57.7%
Taylor expanded in A around 0 55.5%
unpow255.5%
unpow255.5%
hypot-define80.0%
Simplified80.0%
if 7.19999999999999986e-32 < A Initial program 85.2%
Taylor expanded in B around -inf 84.0%
associate--l+84.0%
div-sub86.7%
Simplified86.7%
Final simplification81.6%
(FPCore (A B C) :precision binary64 (if (<= A -2.1e+48) (* 180.0 (/ (atan (/ (* B 0.5) A)) PI)) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.1e+48) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.1e+48) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.1e+48: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.1e+48) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.1e+48) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.1e+48], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.1 \cdot 10^{+48}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.0999999999999998e48Initial program 28.2%
Taylor expanded in A around -inf 67.5%
associate-*r/67.5%
Simplified67.5%
if -2.0999999999999998e48 < A Initial program 68.7%
Simplified88.0%
Final simplification84.5%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* (/ A B) -2.0)) PI))))
(if (<= B -2300000.0)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -6.4e-171)
t_0
(if (<= B 1.5e-294)
(* 180.0 (/ (atan 0.0) PI))
(if (or (<= B 2.6e-145) (and (not (<= B 1.85e-28)) (<= B 1.9e+15)))
t_0
(* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
double tmp;
if (B <= -2300000.0) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -6.4e-171) {
tmp = t_0;
} else if (B <= 1.5e-294) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if ((B <= 2.6e-145) || (!(B <= 1.85e-28) && (B <= 1.9e+15))) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
double tmp;
if (B <= -2300000.0) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -6.4e-171) {
tmp = t_0;
} else if (B <= 1.5e-294) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if ((B <= 2.6e-145) || (!(B <= 1.85e-28) && (B <= 1.9e+15))) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) tmp = 0 if B <= -2300000.0: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -6.4e-171: tmp = t_0 elif B <= 1.5e-294: tmp = 180.0 * (math.atan(0.0) / math.pi) elif (B <= 2.6e-145) or (not (B <= 1.85e-28) and (B <= 1.9e+15)): tmp = t_0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)) tmp = 0.0 if (B <= -2300000.0) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -6.4e-171) tmp = t_0; elseif (B <= 1.5e-294) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif ((B <= 2.6e-145) || (!(B <= 1.85e-28) && (B <= 1.9e+15))) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((A / B) * -2.0)) / pi); tmp = 0.0; if (B <= -2300000.0) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -6.4e-171) tmp = t_0; elseif (B <= 1.5e-294) tmp = 180.0 * (atan(0.0) / pi); elseif ((B <= 2.6e-145) || (~((B <= 1.85e-28)) && (B <= 1.9e+15))) tmp = t_0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -2300000.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -6.4e-171], t$95$0, If[LessEqual[B, 1.5e-294], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[B, 2.6e-145], And[N[Not[LessEqual[B, 1.85e-28]], $MachinePrecision], LessEqual[B, 1.9e+15]]], t$95$0, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{if}\;B \leq -2300000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -6.4 \cdot 10^{-171}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 1.5 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-145} \lor \neg \left(B \leq 1.85 \cdot 10^{-28}\right) \land B \leq 1.9 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.3e6Initial program 50.1%
Taylor expanded in B around -inf 67.2%
if -2.3e6 < B < -6.4000000000000003e-171 or 1.4999999999999999e-294 < B < 2.6e-145 or 1.8500000000000001e-28 < B < 1.9e15Initial program 72.2%
Taylor expanded in A around inf 45.9%
if -6.4000000000000003e-171 < B < 1.4999999999999999e-294Initial program 45.0%
*-commutative45.0%
associate--l-33.7%
+-commutative33.7%
unpow233.7%
unpow233.7%
hypot-undefine64.9%
associate--r+80.0%
div-inv80.0%
div-sub25.4%
Applied egg-rr25.4%
Taylor expanded in C around inf 37.0%
distribute-lft1-in37.0%
metadata-eval37.0%
mul0-lft56.8%
metadata-eval56.8%
Simplified56.8%
if 2.6e-145 < B < 1.8500000000000001e-28 or 1.9e15 < B Initial program 66.3%
Taylor expanded in B around inf 59.0%
Final simplification56.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* (/ A B) -2.0)) PI))))
(if (<= B -1750000.0)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -1.95e-169)
t_0
(if (<= B 1.2e-294)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(if (or (<= B 5.5e-143) (and (not (<= B 1.85e-28)) (<= B 1.5e+15)))
t_0
(* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
double tmp;
if (B <= -1750000.0) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -1.95e-169) {
tmp = t_0;
} else if (B <= 1.2e-294) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else if ((B <= 5.5e-143) || (!(B <= 1.85e-28) && (B <= 1.5e+15))) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
double tmp;
if (B <= -1750000.0) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -1.95e-169) {
tmp = t_0;
} else if (B <= 1.2e-294) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else if ((B <= 5.5e-143) || (!(B <= 1.85e-28) && (B <= 1.5e+15))) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) tmp = 0 if B <= -1750000.0: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -1.95e-169: tmp = t_0 elif B <= 1.2e-294: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) elif (B <= 5.5e-143) or (not (B <= 1.85e-28) and (B <= 1.5e+15)): tmp = t_0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)) tmp = 0.0 if (B <= -1750000.0) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -1.95e-169) tmp = t_0; elseif (B <= 1.2e-294) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); elseif ((B <= 5.5e-143) || (!(B <= 1.85e-28) && (B <= 1.5e+15))) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((A / B) * -2.0)) / pi); tmp = 0.0; if (B <= -1750000.0) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -1.95e-169) tmp = t_0; elseif (B <= 1.2e-294) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); elseif ((B <= 5.5e-143) || (~((B <= 1.85e-28)) && (B <= 1.5e+15))) tmp = t_0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1750000.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.95e-169], t$95$0, If[LessEqual[B, 1.2e-294], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[B, 5.5e-143], And[N[Not[LessEqual[B, 1.85e-28]], $MachinePrecision], LessEqual[B, 1.5e+15]]], t$95$0, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{if}\;B \leq -1750000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -1.95 \cdot 10^{-169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 1.2 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 5.5 \cdot 10^{-143} \lor \neg \left(B \leq 1.85 \cdot 10^{-28}\right) \land B \leq 1.5 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.75e6Initial program 50.1%
Taylor expanded in B around -inf 67.2%
if -1.75e6 < B < -1.94999999999999988e-169 or 1.19999999999999999e-294 < B < 5.50000000000000041e-143 or 1.8500000000000001e-28 < B < 1.5e15Initial program 72.2%
Taylor expanded in A around inf 45.9%
if -1.94999999999999988e-169 < B < 1.19999999999999999e-294Initial program 45.0%
Taylor expanded in C around inf 61.1%
Taylor expanded in A around inf 61.1%
if 5.50000000000000041e-143 < B < 1.8500000000000001e-28 or 1.5e15 < B Initial program 66.3%
Taylor expanded in B around inf 59.0%
Final simplification57.2%
(FPCore (A B C)
:precision binary64
(if (<= B -700000000.0)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -2.5e-156)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= B 7.8e-296)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(if (or (<= B 7.5e-142) (and (not (<= B 1.75e-28)) (<= B 9e+15)))
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))
(* 180.0 (/ (atan -1.0) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -700000000.0) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -2.5e-156) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (B <= 7.8e-296) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else if ((B <= 7.5e-142) || (!(B <= 1.75e-28) && (B <= 9e+15))) {
tmp = 180.0 * (atan(((A / B) * -2.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 <= -700000000.0) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -2.5e-156) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (B <= 7.8e-296) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else if ((B <= 7.5e-142) || (!(B <= 1.75e-28) && (B <= 9e+15))) {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -700000000.0: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -2.5e-156: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif B <= 7.8e-296: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) elif (B <= 7.5e-142) or (not (B <= 1.75e-28) and (B <= 9e+15)): tmp = 180.0 * (math.atan(((A / B) * -2.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 <= -700000000.0) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -2.5e-156) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (B <= 7.8e-296) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); elseif ((B <= 7.5e-142) || (!(B <= 1.75e-28) && (B <= 9e+15))) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.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 <= -700000000.0) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -2.5e-156) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (B <= 7.8e-296) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); elseif ((B <= 7.5e-142) || (~((B <= 1.75e-28)) && (B <= 9e+15))) tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -700000000.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.5e-156], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.8e-296], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[B, 7.5e-142], And[N[Not[LessEqual[B, 1.75e-28]], $MachinePrecision], LessEqual[B, 9e+15]]], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $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 -700000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -2.5 \cdot 10^{-156}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 7.8 \cdot 10^{-296}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 7.5 \cdot 10^{-142} \lor \neg \left(B \leq 1.75 \cdot 10^{-28}\right) \land B \leq 9 \cdot 10^{+15}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -7e8Initial program 49.4%
Taylor expanded in B around -inf 67.9%
if -7e8 < B < -2.50000000000000004e-156Initial program 70.7%
Taylor expanded in C around -inf 41.6%
if -2.50000000000000004e-156 < B < 7.80000000000000021e-296Initial program 49.3%
Taylor expanded in C around inf 59.8%
Taylor expanded in A around inf 59.8%
if 7.80000000000000021e-296 < B < 7.49999999999999958e-142 or 1.75e-28 < B < 9e15Initial program 73.8%
Taylor expanded in A around inf 50.8%
if 7.49999999999999958e-142 < B < 1.75e-28 or 9e15 < B Initial program 66.3%
Taylor expanded in B around inf 59.0%
Final simplification57.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))
(if (<= B -6.5e-175)
t_0
(if (<= B 7.4e-296)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(if (<= B 8.5e-35) t_0 (* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
double tmp;
if (B <= -6.5e-175) {
tmp = t_0;
} else if (B <= 7.4e-296) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else if (B <= 8.5e-35) {
tmp = t_0;
} 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 t_0 = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
double tmp;
if (B <= -6.5e-175) {
tmp = t_0;
} else if (B <= 7.4e-296) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else if (B <= 8.5e-35) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) tmp = 0 if B <= -6.5e-175: tmp = t_0 elif B <= 7.4e-296: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) elif B <= 8.5e-35: tmp = t_0 else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)) tmp = 0.0 if (B <= -6.5e-175) tmp = t_0; elseif (B <= 7.4e-296) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); elseif (B <= 8.5e-35) tmp = t_0; 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) t_0 = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); tmp = 0.0; if (B <= -6.5e-175) tmp = t_0; elseif (B <= 7.4e-296) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); elseif (B <= 8.5e-35) tmp = t_0; else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -6.5e-175], t$95$0, If[LessEqual[B, 7.4e-296], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8.5e-35], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -6.5 \cdot 10^{-175}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 7.4 \cdot 10^{-296}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{elif}\;B \leq 8.5 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -6.5000000000000005e-175 or 7.40000000000000053e-296 < B < 8.5000000000000001e-35Initial program 61.1%
Taylor expanded in B around -inf 67.8%
associate--l+67.8%
div-sub69.1%
Simplified69.1%
if -6.5000000000000005e-175 < B < 7.40000000000000053e-296Initial program 44.0%
Taylor expanded in C around inf 66.2%
Taylor expanded in A around inf 66.2%
if 8.5000000000000001e-35 < B Initial program 69.3%
Taylor expanded in C around 0 62.8%
mul-1-neg62.8%
distribute-neg-frac262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-define84.1%
Simplified84.1%
Taylor expanded in A around 0 82.6%
sub-neg82.6%
metadata-eval82.6%
+-commutative82.6%
mul-1-neg82.6%
unsub-neg82.6%
Simplified82.6%
Final simplification72.4%
(FPCore (A B C)
:precision binary64
(if (<= B -200000000.0)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -7e-157)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= B 1.25e-295)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -200000000.0) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -7e-157) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (B <= 1.25e-295) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((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 (B <= -200000000.0) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -7e-157) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (B <= 1.25e-295) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -200000000.0: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -7e-157: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif B <= 1.25e-295: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / 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 (B <= -200000000.0) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -7e-157) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (B <= 1.25e-295) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / 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 (B <= -200000000.0) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -7e-157) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (B <= 1.25e-295) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -200000000.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -7e-157], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.25e-295], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $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}\;B \leq -200000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -7 \cdot 10^{-157}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.25 \cdot 10^{-295}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -2e8Initial program 49.4%
Taylor expanded in B around -inf 67.9%
if -2e8 < B < -7.0000000000000004e-157Initial program 70.7%
Taylor expanded in C around -inf 41.6%
if -7.0000000000000004e-157 < B < 1.25000000000000002e-295Initial program 49.3%
Taylor expanded in C around inf 59.8%
Taylor expanded in A around inf 59.8%
if 1.25000000000000002e-295 < B Initial program 68.9%
Taylor expanded in C around 0 57.3%
mul-1-neg57.3%
distribute-neg-frac257.3%
+-commutative57.3%
unpow257.3%
unpow257.3%
hypot-define71.9%
Simplified71.9%
Taylor expanded in A around 0 66.6%
sub-neg66.6%
metadata-eval66.6%
+-commutative66.6%
mul-1-neg66.6%
unsub-neg66.6%
Simplified66.6%
Final simplification62.7%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (- C A) B)))
(if (<= B -7.5e-175)
(* 180.0 (/ (atan (+ 1.0 t_0)) PI))
(if (<= B 1.75e-295)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan (+ t_0 -1.0)) PI))))))
double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double tmp;
if (B <= -7.5e-175) {
tmp = 180.0 * (atan((1.0 + t_0)) / ((double) M_PI));
} else if (B <= 1.75e-295) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((t_0 + -1.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double tmp;
if (B <= -7.5e-175) {
tmp = 180.0 * (Math.atan((1.0 + t_0)) / Math.PI);
} else if (B <= 1.75e-295) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((t_0 + -1.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (C - A) / B tmp = 0 if B <= -7.5e-175: tmp = 180.0 * (math.atan((1.0 + t_0)) / math.pi) elif B <= 1.75e-295: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) else: tmp = 180.0 * (math.atan((t_0 + -1.0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(C - A) / B) tmp = 0.0 if (B <= -7.5e-175) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_0)) / pi)); elseif (B <= 1.75e-295) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(t_0 + -1.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (C - A) / B; tmp = 0.0; if (B <= -7.5e-175) tmp = 180.0 * (atan((1.0 + t_0)) / pi); elseif (B <= 1.75e-295) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); else tmp = 180.0 * (atan((t_0 + -1.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -7.5e-175], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.75e-295], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(t$95$0 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{C - A}{B}\\
\mathbf{if}\;B \leq -7.5 \cdot 10^{-175}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_0\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.75 \cdot 10^{-295}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_0 + -1\right)}{\pi}\\
\end{array}
\end{array}
if B < -7.50000000000000053e-175Initial program 57.4%
Taylor expanded in B around -inf 76.1%
associate--l+76.1%
div-sub76.1%
Simplified76.1%
if -7.50000000000000053e-175 < B < 1.74999999999999994e-295Initial program 44.0%
Taylor expanded in C around inf 66.2%
Taylor expanded in A around inf 66.2%
if 1.74999999999999994e-295 < B Initial program 68.9%
*-commutative68.9%
associate--l-67.1%
+-commutative67.1%
unpow267.1%
unpow267.1%
hypot-undefine82.8%
associate--r+86.3%
div-inv86.3%
div-sub79.5%
Applied egg-rr79.5%
Taylor expanded in B around inf 76.7%
+-commutative76.7%
associate--r+76.7%
div-sub78.4%
Simplified78.4%
Final simplification76.3%
(FPCore (A B C)
:precision binary64
(if (<= B -6e-171)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(if (<= B 7e-295)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -6e-171) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
} else if (B <= 7e-295) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((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 (B <= -6e-171) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / Math.PI);
} else if (B <= 7e-295) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -6e-171: tmp = 180.0 * (math.atan((1.0 - (A / B))) / math.pi) elif B <= 7e-295: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / 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 (B <= -6e-171) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / pi)); elseif (B <= 7e-295) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / 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 (B <= -6e-171) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); elseif (B <= 7e-295) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -6e-171], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7e-295], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $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}\;B \leq -6 \cdot 10^{-171}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 7 \cdot 10^{-295}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -5.9999999999999999e-171Initial program 57.5%
Taylor expanded in C around 0 46.1%
mul-1-neg46.1%
distribute-neg-frac246.1%
+-commutative46.1%
unpow246.1%
unpow246.1%
hypot-define69.3%
Simplified69.3%
Taylor expanded in B around -inf 65.2%
mul-1-neg65.2%
unsub-neg65.2%
Simplified65.2%
if -5.9999999999999999e-171 < B < 6.99999999999999977e-295Initial program 45.0%
Taylor expanded in C around inf 61.1%
Taylor expanded in A around inf 61.1%
if 6.99999999999999977e-295 < B Initial program 68.9%
Taylor expanded in C around 0 57.3%
mul-1-neg57.3%
distribute-neg-frac257.3%
+-commutative57.3%
unpow257.3%
unpow257.3%
hypot-define71.9%
Simplified71.9%
Taylor expanded in A around 0 66.6%
sub-neg66.6%
metadata-eval66.6%
+-commutative66.6%
mul-1-neg66.6%
unsub-neg66.6%
Simplified66.6%
Final simplification65.5%
(FPCore (A B C)
:precision binary64
(if (<= B -2.25e-173)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4e-167)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.25e-173) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4e-167) {
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 <= -2.25e-173) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4e-167) {
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 <= -2.25e-173: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4e-167: 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 <= -2.25e-173) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4e-167) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.25e-173) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4e-167) 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, -2.25e-173], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4e-167], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.25 \cdot 10^{-173}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4 \cdot 10^{-167}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.25000000000000009e-173Initial program 57.4%
Taylor expanded in B around -inf 48.9%
if -2.25000000000000009e-173 < B < 4.00000000000000001e-167Initial program 54.7%
*-commutative54.7%
associate--l-44.4%
+-commutative44.4%
unpow244.4%
unpow244.4%
hypot-undefine66.3%
associate--r+82.5%
div-inv82.5%
div-sub39.6%
Applied egg-rr39.6%
Taylor expanded in C around inf 21.4%
distribute-lft1-in21.4%
metadata-eval21.4%
mul0-lft44.9%
metadata-eval44.9%
Simplified44.9%
if 4.00000000000000001e-167 < B Initial program 70.2%
Taylor expanded in B around inf 52.3%
Final simplification49.4%
(FPCore (A B C) :precision binary64 (if (<= B 1.25e-167) (* 180.0 (/ (atan 0.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1.25e-167) {
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 <= 1.25e-167) {
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 <= 1.25e-167: 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 <= 1.25e-167) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 1.25e-167) 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, 1.25e-167], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.25 \cdot 10^{-167}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 1.25000000000000005e-167Initial program 56.6%
*-commutative56.6%
associate--l-53.4%
+-commutative53.4%
unpow253.4%
unpow253.4%
hypot-undefine74.7%
associate--r+81.4%
div-inv81.5%
div-sub66.4%
Applied egg-rr66.4%
Taylor expanded in C around inf 8.9%
distribute-lft1-in8.9%
metadata-eval8.9%
mul0-lft17.9%
metadata-eval17.9%
Simplified17.9%
if 1.25000000000000005e-167 < B Initial program 70.2%
Taylor expanded in B around inf 52.3%
Final simplification31.0%
(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 61.8%
Taylor expanded in B around inf 22.3%
Final simplification22.3%
herbie shell --seed 2024100
(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)))