
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(if (or (<= t_0 -0.5) (not (<= t_0 0.0)))
(* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))
(* (atan (* B (/ 0.5 A))) (/ 180.0 PI)))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double tmp;
if ((t_0 <= -0.5) || !(t_0 <= 0.0)) {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
} else {
tmp = atan((B * (0.5 / A))) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double tmp;
if ((t_0 <= -0.5) || !(t_0 <= 0.0)) {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
} else {
tmp = Math.atan((B * (0.5 / A))) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) tmp = 0 if (t_0 <= -0.5) or not (t_0 <= 0.0): tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) else: tmp = math.atan((B * (0.5 / A))) * (180.0 / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) tmp = 0.0 if ((t_0 <= -0.5) || !(t_0 <= 0.0)) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); else tmp = Float64(atan(Float64(B * Float64(0.5 / A))) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); tmp = 0.0; if ((t_0 <= -0.5) || ~((t_0 <= 0.0))) tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); else tmp = atan((B * (0.5 / A))) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -0.5], N[Not[LessEqual[t$95$0, 0.0]], $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], N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t_0 \leq -0.5 \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -0.5 or -0.0 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) Initial program 60.5%
Simplified85.9%
if -0.5 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -0.0Initial program 13.1%
Taylor expanded in A around -inf 48.3%
associate-*r/48.3%
Simplified48.3%
add-exp-log15.8%
associate-/l*15.8%
Applied egg-rr15.8%
Taylor expanded in A around 0 48.3%
associate-*r/48.4%
associate-*l/48.4%
*-commutative48.4%
associate-*r/48.4%
associate-*l/48.3%
*-commutative48.3%
Simplified48.3%
Final simplification80.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI)))
(t_1 (* (atan (* B (/ 0.5 A))) (/ 180.0 PI))))
(if (<= A -5.9e+140)
t_1
(if (<= A -8.8e+46)
t_0
(if (<= A -2.2e+27)
t_1
(if (<= A 50000000000000.0)
t_0
(* 180.0 (/ (atan (/ (- C (+ B A)) B)) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
double t_1 = atan((B * (0.5 / A))) * (180.0 / ((double) M_PI));
double tmp;
if (A <= -5.9e+140) {
tmp = t_1;
} else if (A <= -8.8e+46) {
tmp = t_0;
} else if (A <= -2.2e+27) {
tmp = t_1;
} else if (A <= 50000000000000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((C - (B + A)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
double t_1 = Math.atan((B * (0.5 / A))) * (180.0 / Math.PI);
double tmp;
if (A <= -5.9e+140) {
tmp = t_1;
} else if (A <= -8.8e+46) {
tmp = t_0;
} else if (A <= -2.2e+27) {
tmp = t_1;
} else if (A <= 50000000000000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((C - (B + A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) t_1 = math.atan((B * (0.5 / A))) * (180.0 / math.pi) tmp = 0 if A <= -5.9e+140: tmp = t_1 elif A <= -8.8e+46: tmp = t_0 elif A <= -2.2e+27: tmp = t_1 elif A <= 50000000000000.0: tmp = t_0 else: tmp = 180.0 * (math.atan(((C - (B + A)) / B)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)) t_1 = Float64(atan(Float64(B * Float64(0.5 / A))) * Float64(180.0 / pi)) tmp = 0.0 if (A <= -5.9e+140) tmp = t_1; elseif (A <= -8.8e+46) tmp = t_0; elseif (A <= -2.2e+27) tmp = t_1; elseif (A <= 50000000000000.0) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(B + A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); t_1 = atan((B * (0.5 / A))) * (180.0 / pi); tmp = 0.0; if (A <= -5.9e+140) tmp = t_1; elseif (A <= -8.8e+46) tmp = t_0; elseif (A <= -2.2e+27) tmp = t_1; elseif (A <= 50000000000000.0) tmp = t_0; else tmp = 180.0 * (atan(((C - (B + A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -5.9e+140], t$95$1, If[LessEqual[A, -8.8e+46], t$95$0, If[LessEqual[A, -2.2e+27], t$95$1, If[LessEqual[A, 50000000000000.0], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(B + A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
t_1 := \tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}\\
\mathbf{if}\;A \leq -5.9 \cdot 10^{+140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -8.8 \cdot 10^{+46}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -2.2 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq 50000000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.9000000000000003e140 or -8.8000000000000001e46 < A < -2.1999999999999999e27Initial program 13.8%
Taylor expanded in A around -inf 73.7%
associate-*r/73.7%
Simplified73.7%
add-exp-log47.4%
associate-/l*47.4%
Applied egg-rr47.4%
Taylor expanded in A around 0 73.7%
associate-*r/73.7%
associate-*l/73.7%
*-commutative73.7%
associate-*r/73.7%
associate-*l/73.7%
*-commutative73.7%
Simplified73.7%
if -5.9000000000000003e140 < A < -8.8000000000000001e46 or -2.1999999999999999e27 < A < 5e13Initial program 57.0%
Taylor expanded in A around 0 53.8%
unpow253.8%
unpow253.8%
hypot-def78.4%
Simplified78.4%
if 5e13 < A Initial program 73.6%
Simplified89.7%
Taylor expanded in B around inf 75.6%
+-commutative75.6%
Simplified75.6%
Final simplification77.0%
(FPCore (A B C)
:precision binary64
(if (<= C -3.3e+37)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(if (<= C 6.2e+165)
(/ (* -180.0 (atan (/ (+ A (hypot A B)) B))) PI)
(* 180.0 (/ (atan (/ 0.0 B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -3.3e+37) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else if (C <= 6.2e+165) {
tmp = (-180.0 * atan(((A + hypot(A, B)) / B))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -3.3e+37) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else if (C <= 6.2e+165) {
tmp = (-180.0 * Math.atan(((A + Math.hypot(A, B)) / B))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -3.3e+37: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) elif C <= 6.2e+165: tmp = (-180.0 * math.atan(((A + math.hypot(A, B)) / B))) / math.pi else: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -3.3e+37) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); elseif (C <= 6.2e+165) tmp = Float64(Float64(-180.0 * atan(Float64(Float64(A + hypot(A, B)) / B))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -3.3e+37) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); elseif (C <= 6.2e+165) tmp = (-180.0 * atan(((A + hypot(A, B)) / B))) / pi; else tmp = 180.0 * (atan((0.0 / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -3.3e+37], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.2e+165], N[(N[(-180.0 * N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -3.3 \cdot 10^{+37}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.2 \cdot 10^{+165}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\end{array}
\end{array}
if C < -3.3000000000000001e37Initial program 71.1%
Taylor expanded in A around 0 69.5%
unpow269.5%
unpow269.5%
hypot-def92.0%
Simplified92.0%
if -3.3000000000000001e37 < C < 6.2000000000000003e165Initial program 55.2%
Taylor expanded in C around 0 52.9%
associate-*r/52.9%
mul-1-neg52.9%
+-commutative52.9%
unpow252.9%
unpow252.9%
hypot-def72.6%
Simplified72.6%
expm1-log1p-u37.1%
expm1-udef37.1%
distribute-frac-neg37.1%
atan-neg37.1%
Applied egg-rr37.1%
expm1-def37.1%
expm1-log1p72.6%
associate-*r/72.6%
distribute-rgt-neg-out72.6%
distribute-lft-neg-in72.6%
metadata-eval72.6%
hypot-def52.9%
unpow252.9%
unpow252.9%
+-commutative52.9%
unpow252.9%
unpow252.9%
hypot-def72.6%
Simplified72.6%
if 6.2000000000000003e165 < C Initial program 3.8%
Taylor expanded in C around inf 56.1%
associate-*r/56.1%
distribute-rgt1-in56.1%
metadata-eval56.1%
mul0-lft56.1%
metadata-eval56.1%
Simplified56.1%
Final simplification75.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan -1.0) PI)))
(t_1 (* 180.0 (/ (atan (* B (/ 0.5 A))) PI))))
(if (<= A -1.65e-60)
t_1
(if (<= A -1.85e-257)
t_0
(if (<= A -6.6e-305)
t_1
(if (<= A 1.1e-237)
t_0
(if (<= A 8.5e-161)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= A 1.45e-116)
t_0
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
double t_1 = 180.0 * (atan((B * (0.5 / A))) / ((double) M_PI));
double tmp;
if (A <= -1.65e-60) {
tmp = t_1;
} else if (A <= -1.85e-257) {
tmp = t_0;
} else if (A <= -6.6e-305) {
tmp = t_1;
} else if (A <= 1.1e-237) {
tmp = t_0;
} else if (A <= 8.5e-161) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (A <= 1.45e-116) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
double t_1 = 180.0 * (Math.atan((B * (0.5 / A))) / Math.PI);
double tmp;
if (A <= -1.65e-60) {
tmp = t_1;
} else if (A <= -1.85e-257) {
tmp = t_0;
} else if (A <= -6.6e-305) {
tmp = t_1;
} else if (A <= 1.1e-237) {
tmp = t_0;
} else if (A <= 8.5e-161) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (A <= 1.45e-116) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(-1.0) / math.pi) t_1 = 180.0 * (math.atan((B * (0.5 / A))) / math.pi) tmp = 0 if A <= -1.65e-60: tmp = t_1 elif A <= -1.85e-257: tmp = t_0 elif A <= -6.6e-305: tmp = t_1 elif A <= 1.1e-237: tmp = t_0 elif A <= 8.5e-161: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif A <= 1.45e-116: tmp = t_0 else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(-1.0) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / A))) / pi)) tmp = 0.0 if (A <= -1.65e-60) tmp = t_1; elseif (A <= -1.85e-257) tmp = t_0; elseif (A <= -6.6e-305) tmp = t_1; elseif (A <= 1.1e-237) tmp = t_0; elseif (A <= 8.5e-161) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (A <= 1.45e-116) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(-1.0) / pi); t_1 = 180.0 * (atan((B * (0.5 / A))) / pi); tmp = 0.0; if (A <= -1.65e-60) tmp = t_1; elseif (A <= -1.85e-257) tmp = t_0; elseif (A <= -6.6e-305) tmp = t_1; elseif (A <= 1.1e-237) tmp = t_0; elseif (A <= 8.5e-161) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (A <= 1.45e-116) tmp = t_0; else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.65e-60], t$95$1, If[LessEqual[A, -1.85e-257], t$95$0, If[LessEqual[A, -6.6e-305], t$95$1, If[LessEqual[A, 1.1e-237], t$95$0, If[LessEqual[A, 8.5e-161], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.45e-116], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.65 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -1.85 \cdot 10^{-257}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -6.6 \cdot 10^{-305}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq 1.1 \cdot 10^{-237}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq 8.5 \cdot 10^{-161}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.45 \cdot 10^{-116}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.6499999999999999e-60 or -1.84999999999999992e-257 < A < -6.59999999999999965e-305Initial program 31.5%
Taylor expanded in A around -inf 55.7%
associate-*r/55.7%
Simplified55.7%
expm1-log1p-u45.6%
expm1-udef24.6%
associate-/l*24.6%
Applied egg-rr24.6%
expm1-def45.5%
expm1-log1p55.6%
associate-/r/55.7%
Simplified55.7%
if -1.6499999999999999e-60 < A < -1.84999999999999992e-257 or -6.59999999999999965e-305 < A < 1.09999999999999999e-237 or 8.50000000000000054e-161 < A < 1.4499999999999999e-116Initial program 58.9%
Taylor expanded in B around inf 43.3%
if 1.09999999999999999e-237 < A < 8.50000000000000054e-161Initial program 90.8%
Taylor expanded in C around -inf 51.7%
if 1.4499999999999999e-116 < A Initial program 67.8%
Taylor expanded in A around inf 57.1%
Final simplification52.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- A) B)) PI)))
(t_1 (* 180.0 (/ (atan (/ C B)) PI))))
(if (<= B -9.5e-49)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 8.6e-262)
t_0
(if (<= B 2.3e-110)
t_1
(if (<= B 1.25e-60)
t_0
(if (or (<= B 11.2) (not (<= B 6.2e+21)))
(* 180.0 (/ (atan -1.0) PI))
t_1)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((-A / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan((C / B)) / ((double) M_PI));
double tmp;
if (B <= -9.5e-49) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 8.6e-262) {
tmp = t_0;
} else if (B <= 2.3e-110) {
tmp = t_1;
} else if (B <= 1.25e-60) {
tmp = t_0;
} else if ((B <= 11.2) || !(B <= 6.2e+21)) {
tmp = 180.0 * (atan(-1.0) / ((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((-A / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan((C / B)) / Math.PI);
double tmp;
if (B <= -9.5e-49) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 8.6e-262) {
tmp = t_0;
} else if (B <= 2.3e-110) {
tmp = t_1;
} else if (B <= 1.25e-60) {
tmp = t_0;
} else if ((B <= 11.2) || !(B <= 6.2e+21)) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = t_1;
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-A / B)) / math.pi) t_1 = 180.0 * (math.atan((C / B)) / math.pi) tmp = 0 if B <= -9.5e-49: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 8.6e-262: tmp = t_0 elif B <= 2.3e-110: tmp = t_1 elif B <= 1.25e-60: tmp = t_0 elif (B <= 11.2) or not (B <= 6.2e+21): tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = t_1 return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)) tmp = 0.0 if (B <= -9.5e-49) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 8.6e-262) tmp = t_0; elseif (B <= 2.3e-110) tmp = t_1; elseif (B <= 1.25e-60) tmp = t_0; elseif ((B <= 11.2) || !(B <= 6.2e+21)) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = t_1; end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((-A / B)) / pi); t_1 = 180.0 * (atan((C / B)) / pi); tmp = 0.0; if (B <= -9.5e-49) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 8.6e-262) tmp = t_0; elseif (B <= 2.3e-110) tmp = t_1; elseif (B <= 1.25e-60) tmp = t_0; elseif ((B <= 11.2) || ~((B <= 6.2e+21))) tmp = 180.0 * (atan(-1.0) / 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[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -9.5e-49], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8.6e-262], t$95$0, If[LessEqual[B, 2.3e-110], t$95$1, If[LessEqual[B, 1.25e-60], t$95$0, If[Or[LessEqual[B, 11.2], N[Not[LessEqual[B, 6.2e+21]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -9.5 \cdot 10^{-49}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 8.6 \cdot 10^{-262}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 2.3 \cdot 10^{-110}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 1.25 \cdot 10^{-60}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 11.2 \lor \neg \left(B \leq 6.2 \cdot 10^{+21}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if B < -9.50000000000000006e-49Initial program 52.2%
Taylor expanded in B around -inf 64.8%
if -9.50000000000000006e-49 < B < 8.6000000000000002e-262 or 2.3000000000000001e-110 < B < 1.25e-60Initial program 52.8%
Simplified64.9%
Taylor expanded in B around inf 49.3%
+-commutative49.3%
Simplified49.3%
Taylor expanded in A around inf 37.2%
associate-*r/37.2%
mul-1-neg37.2%
Simplified37.2%
if 8.6000000000000002e-262 < B < 2.3000000000000001e-110 or 11.199999999999999 < B < 6.2e21Initial program 61.7%
Simplified73.6%
Taylor expanded in B around inf 58.7%
+-commutative58.7%
Simplified58.7%
Taylor expanded in C around inf 53.8%
if 1.25e-60 < B < 11.199999999999999 or 6.2e21 < B Initial program 50.4%
Taylor expanded in B around inf 58.0%
Final simplification53.5%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ C B)) PI))))
(if (<= B -2.8e-48)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4e-261)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(if (<= B 2.15e-111)
t_0
(if (<= B 5.5e-60)
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI))
(if (or (<= B 4000.0) (not (<= B 1.4e+21)))
(* 180.0 (/ (atan -1.0) PI))
t_0)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((C / B)) / ((double) M_PI));
double tmp;
if (B <= -2.8e-48) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4e-261) {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
} else if (B <= 2.15e-111) {
tmp = t_0;
} else if (B <= 5.5e-60) {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
} else if ((B <= 4000.0) || !(B <= 1.4e+21)) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((C / B)) / Math.PI);
double tmp;
if (B <= -2.8e-48) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4e-261) {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
} else if (B <= 2.15e-111) {
tmp = t_0;
} else if (B <= 5.5e-60) {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
} else if ((B <= 4000.0) || !(B <= 1.4e+21)) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else {
tmp = t_0;
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((C / B)) / math.pi) tmp = 0 if B <= -2.8e-48: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4e-261: tmp = 180.0 * (math.atan((-A / B)) / math.pi) elif B <= 2.15e-111: tmp = t_0 elif B <= 5.5e-60: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) elif (B <= 4000.0) or not (B <= 1.4e+21): tmp = 180.0 * (math.atan(-1.0) / math.pi) else: tmp = t_0 return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)) tmp = 0.0 if (B <= -2.8e-48) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4e-261) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); elseif (B <= 2.15e-111) tmp = t_0; elseif (B <= 5.5e-60) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); elseif ((B <= 4000.0) || !(B <= 1.4e+21)) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); else tmp = t_0; end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((C / B)) / pi); tmp = 0.0; if (B <= -2.8e-48) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4e-261) tmp = 180.0 * (atan((-A / B)) / pi); elseif (B <= 2.15e-111) tmp = t_0; elseif (B <= 5.5e-60) tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); elseif ((B <= 4000.0) || ~((B <= 1.4e+21))) tmp = 180.0 * (atan(-1.0) / pi); else tmp = t_0; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -2.8e-48], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4e-261], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.15e-111], t$95$0, If[LessEqual[B, 5.5e-60], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[B, 4000.0], N[Not[LessEqual[B, 1.4e+21]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -2.8 \cdot 10^{-48}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4 \cdot 10^{-261}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 2.15 \cdot 10^{-111}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 5.5 \cdot 10^{-60}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\mathbf{elif}\;B \leq 4000 \lor \neg \left(B \leq 1.4 \cdot 10^{+21}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if B < -2.80000000000000005e-48Initial program 52.2%
Taylor expanded in B around -inf 64.8%
if -2.80000000000000005e-48 < B < 3.99999999999999994e-261Initial program 49.5%
Simplified65.1%
Taylor expanded in B around inf 45.2%
+-commutative45.2%
Simplified45.2%
Taylor expanded in A around inf 36.4%
associate-*r/36.4%
mul-1-neg36.4%
Simplified36.4%
if 3.99999999999999994e-261 < B < 2.1499999999999999e-111 or 4e3 < B < 1.4e21Initial program 61.7%
Simplified73.6%
Taylor expanded in B around inf 58.7%
+-commutative58.7%
Simplified58.7%
Taylor expanded in C around inf 53.8%
if 2.1499999999999999e-111 < B < 5.4999999999999997e-60Initial program 64.1%
Taylor expanded in A around inf 40.0%
if 5.4999999999999997e-60 < B < 4e3 or 1.4e21 < B Initial program 50.4%
Taylor expanded in B around inf 58.0%
Final simplification53.5%
(FPCore (A B C)
:precision binary64
(if (<= B -3.6e-56)
(* 180.0 (/ (atan (/ (+ B C) B)) PI))
(if (<= B -1.8e-173)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 4.6e-262)
(* 180.0 (/ (atan (/ (- A) B)) PI))
(if (<= B 1.85e-110)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.6e-56) {
tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
} else if (B <= -1.8e-173) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 4.6e-262) {
tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
} else if (B <= 1.85e-110) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -3.6e-56) {
tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
} else if (B <= -1.8e-173) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 4.6e-262) {
tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
} else if (B <= 1.85e-110) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.6e-56: tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi) elif B <= -1.8e-173: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 4.6e-262: tmp = 180.0 * (math.atan((-A / B)) / math.pi) elif B <= 1.85e-110: tmp = 180.0 * (math.atan((C / B)) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -3.6e-56) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi)); elseif (B <= -1.8e-173) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 4.6e-262) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)); elseif (B <= 1.85e-110) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -3.6e-56) tmp = 180.0 * (atan(((B + C) / B)) / pi); elseif (B <= -1.8e-173) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 4.6e-262) tmp = 180.0 * (atan((-A / B)) / pi); elseif (B <= 1.85e-110) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.6e-56], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.8e-173], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.6e-262], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.85e-110], N[(180.0 * N[(N[ArcTan[N[(C / B), $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 -3.6 \cdot 10^{-56}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -1.8 \cdot 10^{-173}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 4.6 \cdot 10^{-262}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{-110}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -3.59999999999999978e-56Initial program 53.5%
Simplified80.3%
Taylor expanded in B around -inf 78.5%
neg-mul-178.5%
unsub-neg78.5%
Simplified78.5%
Taylor expanded in A around 0 70.9%
if -3.59999999999999978e-56 < B < -1.79999999999999986e-173Initial program 25.5%
Taylor expanded in C around inf 39.1%
associate-*r/39.1%
distribute-rgt1-in39.1%
metadata-eval39.1%
mul0-lft39.1%
metadata-eval39.1%
Simplified39.1%
if -1.79999999999999986e-173 < B < 4.6000000000000002e-262Initial program 63.2%
Simplified75.3%
Taylor expanded in B around inf 56.1%
+-commutative56.1%
Simplified56.1%
Taylor expanded in A around inf 46.8%
associate-*r/46.8%
mul-1-neg46.8%
Simplified46.8%
if 4.6000000000000002e-262 < B < 1.85000000000000008e-110Initial program 58.6%
Simplified71.5%
Taylor expanded in B around inf 55.3%
+-commutative55.3%
Simplified55.3%
Taylor expanded in C around inf 50.1%
if 1.85000000000000008e-110 < B Initial program 54.4%
Taylor expanded in C around 0 45.7%
associate-*r/45.7%
mul-1-neg45.7%
+-commutative45.7%
unpow245.7%
unpow245.7%
hypot-def66.5%
Simplified66.5%
Taylor expanded in A around 0 64.0%
sub-neg64.0%
mul-1-neg64.0%
distribute-neg-in64.0%
+-commutative64.0%
distribute-neg-in64.0%
metadata-eval64.0%
unsub-neg64.0%
Simplified64.0%
Final simplification59.7%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* B (/ 0.5 A))) PI))))
(if (<= A -1.6e-60)
t_0
(if (<= A -2.05e-256)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A -5.5e-305) t_0 (* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((B * (0.5 / A))) / ((double) M_PI));
double tmp;
if (A <= -1.6e-60) {
tmp = t_0;
} else if (A <= -2.05e-256) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= -5.5e-305) {
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((B * (0.5 / A))) / Math.PI);
double tmp;
if (A <= -1.6e-60) {
tmp = t_0;
} else if (A <= -2.05e-256) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= -5.5e-305) {
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((B * (0.5 / A))) / math.pi) tmp = 0 if A <= -1.6e-60: tmp = t_0 elif A <= -2.05e-256: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= -5.5e-305: 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(B * Float64(0.5 / A))) / pi)) tmp = 0.0 if (A <= -1.6e-60) tmp = t_0; elseif (A <= -2.05e-256) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= -5.5e-305) 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((B * (0.5 / A))) / pi); tmp = 0.0; if (A <= -1.6e-60) tmp = t_0; elseif (A <= -2.05e-256) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= -5.5e-305) 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[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.6e-60], t$95$0, If[LessEqual[A, -2.05e-256], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -5.5e-305], 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(B \cdot \frac{0.5}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.6 \cdot 10^{-60}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -2.05 \cdot 10^{-256}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq -5.5 \cdot 10^{-305}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.6000000000000001e-60 or -2.05e-256 < A < -5.5e-305Initial program 31.5%
Taylor expanded in A around -inf 55.7%
associate-*r/55.7%
Simplified55.7%
expm1-log1p-u45.6%
expm1-udef24.6%
associate-/l*24.6%
Applied egg-rr24.6%
expm1-def45.5%
expm1-log1p55.6%
associate-/r/55.7%
Simplified55.7%
if -1.6000000000000001e-60 < A < -2.05e-256Initial program 52.2%
Taylor expanded in B around inf 38.0%
if -5.5e-305 < A Initial program 70.6%
Taylor expanded in C around 0 67.2%
associate-*r/67.2%
mul-1-neg67.2%
+-commutative67.2%
unpow267.2%
unpow267.2%
hypot-def78.4%
Simplified78.4%
Taylor expanded in A around 0 62.2%
sub-neg62.2%
mul-1-neg62.2%
distribute-neg-in62.2%
+-commutative62.2%
distribute-neg-in62.2%
metadata-eval62.2%
unsub-neg62.2%
Simplified62.2%
Final simplification56.3%
(FPCore (A B C)
:precision binary64
(if (<= A -1.65e-60)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A -3e-257)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A -1.35e-304)
(* 180.0 (/ (atan (* B (/ 0.5 A))) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.65e-60) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= -3e-257) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= -1.35e-304) {
tmp = 180.0 * (atan((B * (0.5 / A))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.65e-60) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= -3e-257) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= -1.35e-304) {
tmp = 180.0 * (Math.atan((B * (0.5 / A))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.65e-60: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= -3e-257: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= -1.35e-304: tmp = 180.0 * (math.atan((B * (0.5 / A))) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.65e-60) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= -3e-257) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= -1.35e-304) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / A))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.65e-60) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= -3e-257) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= -1.35e-304) tmp = 180.0 * (atan((B * (0.5 / A))) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.65e-60], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -3e-257], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -1.35e-304], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.65 \cdot 10^{-60}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -3 \cdot 10^{-257}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq -1.35 \cdot 10^{-304}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.6499999999999999e-60Initial program 28.0%
Taylor expanded in A around -inf 55.2%
associate-*r/55.2%
Simplified55.2%
if -1.6499999999999999e-60 < A < -2.9999999999999999e-257Initial program 52.2%
Taylor expanded in B around inf 38.0%
if -2.9999999999999999e-257 < A < -1.35000000000000005e-304Initial program 59.2%
Taylor expanded in A around -inf 59.6%
associate-*r/59.6%
Simplified59.6%
expm1-log1p-u11.8%
expm1-udef11.8%
associate-/l*11.8%
Applied egg-rr11.8%
expm1-def11.8%
expm1-log1p59.6%
associate-/r/59.6%
Simplified59.6%
if -1.35000000000000005e-304 < A Initial program 70.6%
Taylor expanded in C around 0 67.2%
associate-*r/67.2%
mul-1-neg67.2%
+-commutative67.2%
unpow267.2%
unpow267.2%
hypot-def78.4%
Simplified78.4%
Taylor expanded in A around 0 62.2%
sub-neg62.2%
mul-1-neg62.2%
distribute-neg-in62.2%
+-commutative62.2%
distribute-neg-in62.2%
metadata-eval62.2%
unsub-neg62.2%
Simplified62.2%
Final simplification56.3%
(FPCore (A B C)
:precision binary64
(if (<= B -3.7e-56)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -3.5e-228)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(if (<= B 1.95e+21)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.7e-56) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -3.5e-228) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else if (B <= 1.95e+21) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -3.7e-56) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -3.5e-228) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else if (B <= 1.95e+21) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.7e-56: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -3.5e-228: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) elif B <= 1.95e+21: tmp = 180.0 * (math.atan((C / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -3.7e-56) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -3.5e-228) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); elseif (B <= 1.95e+21) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -3.7e-56) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -3.5e-228) tmp = 180.0 * (atan((0.0 / B)) / pi); elseif (B <= 1.95e+21) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.7e-56], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -3.5e-228], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.95e+21], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.7 \cdot 10^{-56}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -3.5 \cdot 10^{-228}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.95 \cdot 10^{+21}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.7000000000000002e-56Initial program 53.5%
Taylor expanded in B around -inf 63.5%
if -3.7000000000000002e-56 < B < -3.49999999999999975e-228Initial program 35.8%
Taylor expanded in C around inf 36.1%
associate-*r/36.1%
distribute-rgt1-in36.1%
metadata-eval36.1%
mul0-lft36.1%
metadata-eval36.1%
Simplified36.1%
if -3.49999999999999975e-228 < B < 1.95e21Initial program 61.1%
Simplified68.9%
Taylor expanded in B around inf 57.0%
+-commutative57.0%
Simplified57.0%
Taylor expanded in C around inf 39.1%
if 1.95e21 < B Initial program 50.9%
Taylor expanded in B around inf 60.5%
Final simplification51.3%
(FPCore (A B C) :precision binary64 (if (<= B -5.6e-47) (* 180.0 (/ (atan (/ (+ B C) B)) PI)) (* 180.0 (/ (atan (/ (- C (+ B A)) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5.6e-47) {
tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (B + A)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -5.6e-47) {
tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (B + A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -5.6e-47: tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (B + A)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -5.6e-47) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(B + A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5.6e-47) tmp = 180.0 * (atan(((B + C) / B)) / pi); else tmp = 180.0 * (atan(((C - (B + A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -5.6e-47], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(B + A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5.6 \cdot 10^{-47}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -5.59999999999999986e-47Initial program 52.2%
Simplified79.8%
Taylor expanded in B around -inf 77.9%
neg-mul-177.9%
unsub-neg77.9%
Simplified77.9%
Taylor expanded in A around 0 71.2%
if -5.59999999999999986e-47 < B Initial program 53.7%
Simplified72.3%
Taylor expanded in B around inf 62.0%
+-commutative62.0%
Simplified62.0%
Final simplification64.6%
(FPCore (A B C) :precision binary64 (if (<= B -5e-51) (* 180.0 (/ (atan (/ (- C (- A B)) B)) PI)) (* 180.0 (/ (atan (/ (- C (+ B A)) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5e-51) {
tmp = 180.0 * (atan(((C - (A - B)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (B + A)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -5e-51) {
tmp = 180.0 * (Math.atan(((C - (A - B)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (B + A)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -5e-51: tmp = 180.0 * (math.atan(((C - (A - B)) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (B + A)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -5e-51) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A - B)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(B + A)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5e-51) tmp = 180.0 * (atan(((C - (A - B)) / B)) / pi); else tmp = 180.0 * (atan(((C - (B + A)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -5e-51], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A - B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(B + A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5 \cdot 10^{-51}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A - B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -5.00000000000000004e-51Initial program 52.2%
Simplified79.8%
Taylor expanded in B around -inf 77.9%
neg-mul-177.9%
unsub-neg77.9%
Simplified77.9%
if -5.00000000000000004e-51 < B Initial program 53.7%
Simplified72.3%
Taylor expanded in B around inf 62.0%
+-commutative62.0%
Simplified62.0%
Final simplification66.4%
(FPCore (A B C)
:precision binary64
(if (<= B -3.6e-56)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.45e-132)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.6e-56) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.45e-132) {
tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -3.6e-56) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.45e-132) {
tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.6e-56: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.45e-132: tmp = 180.0 * (math.atan((0.0 / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -3.6e-56) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.45e-132) tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -3.6e-56) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.45e-132) tmp = 180.0 * (atan((0.0 / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.6e-56], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.45e-132], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.6 \cdot 10^{-56}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.45 \cdot 10^{-132}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.59999999999999978e-56Initial program 53.5%
Taylor expanded in B around -inf 63.5%
if -3.59999999999999978e-56 < B < 1.44999999999999992e-132Initial program 50.4%
Taylor expanded in C around inf 32.3%
associate-*r/32.3%
distribute-rgt1-in32.3%
metadata-eval32.3%
mul0-lft32.3%
metadata-eval32.3%
Simplified32.3%
if 1.44999999999999992e-132 < B Initial program 55.7%
Taylor expanded in B around inf 49.9%
Final simplification47.9%
(FPCore (A B C) :precision binary64 (if (<= B -6.2e-299) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -6.2e-299) {
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 <= -6.2e-299) {
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 <= -6.2e-299: 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 <= -6.2e-299) 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 <= -6.2e-299) 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, -6.2e-299], 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 -6.2 \cdot 10^{-299}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -6.1999999999999999e-299Initial program 51.2%
Taylor expanded in B around -inf 44.7%
if -6.1999999999999999e-299 < B Initial program 55.0%
Taylor expanded in B around inf 37.6%
Final simplification40.7%
(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 21.8%
Final simplification21.8%
herbie shell --seed 2023337
(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)))