
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (* B 0.5) A)) PI))))
(if (<= A -5.1e+229)
t_0
(if (<= A -2.25e+207)
(* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))
(if (<= A -13500000.0)
t_0
(/ (* 180.0 (atan (/ (- (- C A) (hypot (- A C) B)) 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 <= -5.1e+229) {
tmp = t_0;
} else if (A <= -2.25e+207) {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
} else if (A <= -13500000.0) {
tmp = t_0;
} else {
tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / 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 <= -5.1e+229) {
tmp = t_0;
} else if (A <= -2.25e+207) {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
} else if (A <= -13500000.0) {
tmp = t_0;
} else {
tmp = (180.0 * Math.atan((((C - A) - Math.hypot((A - C), B)) / 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 <= -5.1e+229: tmp = t_0 elif A <= -2.25e+207: tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi) elif A <= -13500000.0: tmp = t_0 else: tmp = (180.0 * math.atan((((C - A) - math.hypot((A - C), B)) / B))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)) tmp = 0.0 if (A <= -5.1e+229) tmp = t_0; elseif (A <= -2.25e+207) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); elseif (A <= -13500000.0) tmp = t_0; else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / 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 <= -5.1e+229) tmp = t_0; elseif (A <= -2.25e+207) tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); elseif (A <= -13500000.0) tmp = t_0; else tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -5.1e+229], t$95$0, If[LessEqual[A, -2.25e+207], 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], If[LessEqual[A, -13500000.0], t$95$0, N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -5.1 \cdot 10^{+229}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -2.25 \cdot 10^{+207}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -13500000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.0999999999999996e229 or -2.25000000000000002e207 < A < -1.35e7Initial program 20.6%
Taylor expanded in A around -inf 80.3%
associate-*r/80.3%
Simplified80.3%
if -5.0999999999999996e229 < A < -2.25000000000000002e207Initial program 21.4%
associate-*l/21.4%
*-lft-identity21.4%
+-commutative21.4%
unpow221.4%
unpow221.4%
hypot-define100.0%
Simplified100.0%
if -1.35e7 < A Initial program 58.7%
associate-*r/58.7%
associate-*l/58.7%
*-un-lft-identity58.7%
unpow258.7%
unpow258.7%
hypot-define87.1%
Applied egg-rr87.1%
Final simplification85.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (* 180.0 (atan (/ (- (- C A) (hypot (- A C) B)) B)))))
(if (<= t_0 -1e-86)
(/ t_1 PI)
(if (<= t_0 0.0)
(/ (* -180.0 (atan (* -0.5 (/ (fma B (/ C A) B) A)))) PI)
(/ 1.0 (/ PI t_1))))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_1 = 180.0 * atan((((C - A) - hypot((A - C), B)) / B));
double tmp;
if (t_0 <= -1e-86) {
tmp = t_1 / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (-180.0 * atan((-0.5 * (fma(B, (C / A), B) / A)))) / ((double) M_PI);
} else {
tmp = 1.0 / (((double) M_PI) / t_1);
}
return tmp;
}
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_1 = Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / B))) tmp = 0.0 if (t_0 <= -1e-86) tmp = Float64(t_1 / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(-180.0 * atan(Float64(-0.5 * Float64(fma(B, Float64(C / A), B) / A)))) / pi); else tmp = Float64(1.0 / Float64(pi / t_1)); end return tmp end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-86], N[(t$95$1 / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(-180.0 * N[ArcTan[N[(-0.5 * N[(N[(B * N[(C / A), $MachinePrecision] + B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(1.0 / N[(Pi / t$95$1), $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)\\
t_1 := 180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-86}:\\
\;\;\;\;\frac{t\_1}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{\mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{t\_1}}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -1.00000000000000008e-86Initial program 52.2%
associate-*r/52.2%
associate-*l/52.2%
*-un-lft-identity52.2%
unpow252.2%
unpow252.2%
hypot-define84.5%
Applied egg-rr84.5%
if -1.00000000000000008e-86 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.0Initial program 18.4%
Taylor expanded in A around -inf 65.2%
mul-1-neg65.2%
distribute-neg-frac265.2%
distribute-lft-out65.2%
associate-/l*66.0%
Simplified66.0%
associate-*r/66.1%
distribute-frac-neg266.1%
atan-neg66.1%
+-commutative66.1%
fma-define66.1%
Applied egg-rr66.1%
distribute-rgt-neg-out66.1%
distribute-lft-neg-in66.1%
metadata-eval66.1%
associate-/l*66.1%
Simplified66.1%
if -0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 54.0%
Applied egg-rr90.3%
Final simplification84.6%
(FPCore (A B C) :precision binary64 (if (or (<= A -5.8e+229) (and (not (<= A -2.5e+203)) (<= A -7000000.0))) (* 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 <= -5.8e+229) || (!(A <= -2.5e+203) && (A <= -7000000.0))) {
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 <= -5.8e+229) || (!(A <= -2.5e+203) && (A <= -7000000.0))) {
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 <= -5.8e+229) or (not (A <= -2.5e+203) and (A <= -7000000.0)): 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 <= -5.8e+229) || (!(A <= -2.5e+203) && (A <= -7000000.0))) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if ((A <= -5.8e+229) || (~((A <= -2.5e+203)) && (A <= -7000000.0))) 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[Or[LessEqual[A, -5.8e+229], And[N[Not[LessEqual[A, -2.5e+203]], $MachinePrecision], LessEqual[A, -7000000.0]]], 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[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.8 \cdot 10^{+229} \lor \neg \left(A \leq -2.5 \cdot 10^{+203}\right) \land A \leq -7000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.79999999999999963e229 or -2.49999999999999997e203 < A < -7e6Initial program 20.6%
Taylor expanded in A around -inf 80.3%
associate-*r/80.3%
Simplified80.3%
if -5.79999999999999963e229 < A < -2.49999999999999997e203 or -7e6 < A Initial program 57.3%
associate-*l/57.3%
*-lft-identity57.3%
+-commutative57.3%
unpow257.3%
unpow257.3%
hypot-define87.5%
Simplified87.5%
Final simplification85.8%
(FPCore (A B C)
:precision binary64
(if (<= A -13500000.0)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 1.05e-33)
(/ 1.0 (/ PI (* 180.0 (atan (/ (- C (hypot B C)) B)))))
(/ (* -180.0 (atan (/ (+ A (hypot A B)) B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -13500000.0) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 1.05e-33) {
tmp = 1.0 / (((double) M_PI) / (180.0 * atan(((C - hypot(B, C)) / B))));
} else {
tmp = (-180.0 * atan(((A + hypot(A, B)) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -13500000.0) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 1.05e-33) {
tmp = 1.0 / (Math.PI / (180.0 * Math.atan(((C - Math.hypot(B, C)) / B))));
} else {
tmp = (-180.0 * Math.atan(((A + Math.hypot(A, B)) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -13500000.0: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 1.05e-33: tmp = 1.0 / (math.pi / (180.0 * math.atan(((C - math.hypot(B, C)) / B)))) else: tmp = (-180.0 * math.atan(((A + math.hypot(A, B)) / B))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (A <= -13500000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 1.05e-33) tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(Float64(C - hypot(B, C)) / B))))); else tmp = Float64(Float64(-180.0 * atan(Float64(Float64(A + hypot(A, B)) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -13500000.0) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 1.05e-33) tmp = 1.0 / (pi / (180.0 * atan(((C - hypot(B, C)) / B)))); else tmp = (-180.0 * atan(((A + hypot(A, B)) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -13500000.0], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.05e-33], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-180.0 * N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -13500000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.05 \cdot 10^{-33}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.35e7Initial program 20.7%
Taylor expanded in A around -inf 75.8%
associate-*r/75.8%
Simplified75.8%
if -1.35e7 < A < 1.05e-33Initial program 49.2%
Applied egg-rr80.7%
Taylor expanded in A around 0 47.6%
unpow247.6%
unpow247.6%
hypot-define78.8%
Simplified78.8%
if 1.05e-33 < A Initial program 72.3%
Taylor expanded in C around 0 70.7%
mul-1-neg70.7%
distribute-neg-frac270.7%
+-commutative70.7%
unpow270.7%
unpow270.7%
hypot-define88.9%
Simplified88.9%
associate-*r/88.9%
distribute-frac-neg288.9%
atan-neg88.9%
Applied egg-rr88.9%
distribute-rgt-neg-out88.9%
distribute-lft-neg-in88.9%
metadata-eval88.9%
hypot-undefine70.8%
unpow270.8%
unpow270.8%
+-commutative70.8%
unpow270.8%
unpow270.8%
hypot-define88.9%
Simplified88.9%
Final simplification81.0%
(FPCore (A B C)
:precision binary64
(if (<= A -13500000.0)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 1.25e-17)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(* 180.0 (/ (atan (+ (/ (- C A) B) -1.0)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -13500000.0) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 1.25e-17) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -13500000.0) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 1.25e-17) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((C - A) / B) + -1.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -13500000.0: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 1.25e-17: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = 180.0 * (math.atan((((C - A) / B) + -1.0)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -13500000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 1.25e-17) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + -1.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -13500000.0) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 1.25e-17) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -13500000.0], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.25e-17], 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[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -13500000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.25 \cdot 10^{-17}:\\
\;\;\;\;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{C - A}{B} + -1\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.35e7Initial program 20.7%
Taylor expanded in A around -inf 75.8%
associate-*r/75.8%
Simplified75.8%
if -1.35e7 < A < 1.25e-17Initial program 49.3%
Taylor expanded in A around 0 47.1%
unpow247.1%
unpow247.1%
hypot-define79.0%
Simplified79.0%
if 1.25e-17 < A Initial program 73.8%
+-commutative73.8%
unpow273.8%
unpow273.8%
hypot-undefine96.0%
sub-neg96.0%
distribute-lft-in90.5%
hypot-undefine73.6%
unpow273.6%
unpow273.6%
+-commutative73.6%
unpow273.6%
unpow273.6%
hypot-define90.5%
Applied egg-rr90.5%
Taylor expanded in B around inf 80.6%
+-commutative80.6%
associate--r+80.6%
div-sub80.6%
Simplified80.6%
Final simplification78.6%
(FPCore (A B C)
:precision binary64
(if (<= A -13500000.0)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 2.25e-36)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(/ (* -180.0 (atan (/ (+ A (hypot A B)) B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -13500000.0) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 2.25e-36) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else {
tmp = (-180.0 * atan(((A + hypot(A, B)) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -13500000.0) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 2.25e-36) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else {
tmp = (-180.0 * Math.atan(((A + Math.hypot(A, B)) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -13500000.0: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 2.25e-36: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) else: tmp = (-180.0 * math.atan(((A + math.hypot(A, B)) / B))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (A <= -13500000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 2.25e-36) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); else tmp = Float64(Float64(-180.0 * atan(Float64(Float64(A + hypot(A, B)) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -13500000.0) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 2.25e-36) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); else tmp = (-180.0 * atan(((A + hypot(A, B)) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -13500000.0], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.25e-36], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(-180.0 * N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -13500000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.25 \cdot 10^{-36}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.35e7Initial program 20.7%
Taylor expanded in A around -inf 75.8%
associate-*r/75.8%
Simplified75.8%
if -1.35e7 < A < 2.25000000000000012e-36Initial program 49.2%
Taylor expanded in A around 0 47.6%
unpow247.6%
unpow247.6%
hypot-define78.8%
Simplified78.8%
if 2.25000000000000012e-36 < A Initial program 72.3%
Taylor expanded in C around 0 70.7%
mul-1-neg70.7%
distribute-neg-frac270.7%
+-commutative70.7%
unpow270.7%
unpow270.7%
hypot-define88.9%
Simplified88.9%
associate-*r/88.9%
distribute-frac-neg288.9%
atan-neg88.9%
Applied egg-rr88.9%
distribute-rgt-neg-out88.9%
distribute-lft-neg-in88.9%
metadata-eval88.9%
hypot-undefine70.8%
unpow270.8%
unpow270.8%
+-commutative70.8%
unpow270.8%
unpow270.8%
hypot-define88.9%
Simplified88.9%
Final simplification81.0%
(FPCore (A B C) :precision binary64 (if (<= A -8500000.0) (* 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 <= -8500000.0) {
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 <= -8500000.0) {
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 <= -8500000.0: 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 <= -8500000.0) 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 <= -8500000.0) 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, -8500000.0], 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 -8500000:\\
\;\;\;\;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 < -8.5e6Initial program 20.7%
Taylor expanded in A around -inf 75.8%
associate-*r/75.8%
Simplified75.8%
if -8.5e6 < A Initial program 58.7%
Simplified87.0%
Final simplification84.1%
(FPCore (A B C)
:precision binary64
(if (<= B -8.2e-63)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 9.5e-226)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 2.7e-179)
(* 180.0 (/ (atan (/ A (- B))) PI))
(if (<= B 1.05e+71)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan -1.0) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -8.2e-63) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 9.5e-226) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 2.7e-179) {
tmp = 180.0 * (atan((A / -B)) / ((double) M_PI));
} else if (B <= 1.05e+71) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((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 <= -8.2e-63) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 9.5e-226) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 2.7e-179) {
tmp = 180.0 * (Math.atan((A / -B)) / Math.PI);
} else if (B <= 1.05e+71) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -8.2e-63: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 9.5e-226: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 2.7e-179: tmp = 180.0 * (math.atan((A / -B)) / math.pi) elif B <= 1.05e+71: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -8.2e-63) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 9.5e-226) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 2.7e-179) tmp = Float64(180.0 * Float64(atan(Float64(A / Float64(-B))) / pi)); elseif (B <= 1.05e+71) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / 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 <= -8.2e-63) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 9.5e-226) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 2.7e-179) tmp = 180.0 * (atan((A / -B)) / pi); elseif (B <= 1.05e+71) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -8.2e-63], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.5e-226], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.7e-179], N[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.05e+71], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -8.2 \cdot 10^{-63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 9.5 \cdot 10^{-226}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 2.7 \cdot 10^{-179}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.05 \cdot 10^{+71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -8.1999999999999995e-63Initial program 50.0%
Taylor expanded in B around -inf 60.9%
if -8.1999999999999995e-63 < B < 9.5000000000000007e-226Initial program 51.3%
+-commutative51.3%
unpow251.3%
unpow251.3%
hypot-undefine85.2%
sub-neg85.2%
distribute-lft-in46.2%
hypot-undefine44.0%
unpow244.0%
unpow244.0%
+-commutative44.0%
unpow244.0%
unpow244.0%
hypot-define46.2%
Applied egg-rr46.2%
Taylor expanded in A around -inf 14.4%
distribute-lft1-in14.4%
metadata-eval14.4%
mul0-lft41.3%
Simplified41.3%
if 9.5000000000000007e-226 < B < 2.69999999999999988e-179Initial program 72.9%
Taylor expanded in C around 0 59.3%
mul-1-neg59.3%
distribute-neg-frac259.3%
+-commutative59.3%
unpow259.3%
unpow259.3%
hypot-define60.5%
Simplified60.5%
Taylor expanded in A around 0 55.6%
Taylor expanded in A around inf 47.9%
neg-mul-147.9%
distribute-neg-frac247.9%
Simplified47.9%
if 2.69999999999999988e-179 < B < 1.04999999999999995e71Initial program 48.6%
+-commutative48.6%
unpow248.6%
unpow248.6%
hypot-undefine63.7%
sub-neg63.7%
distribute-rgt-in48.8%
div-inv48.6%
hypot-undefine48.0%
unpow248.0%
unpow248.0%
+-commutative48.0%
unpow248.0%
unpow248.0%
hypot-define48.6%
Applied egg-rr48.6%
Taylor expanded in C around inf 40.3%
if 1.04999999999999995e71 < B Initial program 36.3%
Taylor expanded in B around inf 66.8%
Final simplification52.3%
(FPCore (A B C)
:precision binary64
(if (<= B -3.1e-59)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.5e-264)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 2.35e-184)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= B 5.6e+69)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan -1.0) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.1e-59) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.5e-264) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 2.35e-184) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (B <= 5.6e+69) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((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.1e-59) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.5e-264) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 2.35e-184) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (B <= 5.6e+69) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.1e-59: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.5e-264: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 2.35e-184: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif B <= 5.6e+69: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / 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.1e-59) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.5e-264) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 2.35e-184) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (B <= 5.6e+69) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / 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.1e-59) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.5e-264) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 2.35e-184) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (B <= 5.6e+69) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.1e-59], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.5e-264], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.35e-184], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.6e+69], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.1 \cdot 10^{-59}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.5 \cdot 10^{-264}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 2.35 \cdot 10^{-184}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 5.6 \cdot 10^{+69}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.09999999999999999e-59Initial program 50.0%
Taylor expanded in B around -inf 60.9%
if -3.09999999999999999e-59 < B < 2.5e-264Initial program 51.9%
+-commutative51.9%
unpow251.9%
unpow251.9%
hypot-undefine86.6%
sub-neg86.6%
distribute-lft-in44.6%
hypot-undefine43.9%
unpow243.9%
unpow243.9%
+-commutative43.9%
unpow243.9%
unpow243.9%
hypot-define44.6%
Applied egg-rr44.6%
Taylor expanded in A around -inf 15.8%
distribute-lft1-in15.8%
metadata-eval15.8%
mul0-lft44.2%
Simplified44.2%
if 2.5e-264 < B < 2.3500000000000001e-184Initial program 65.4%
Taylor expanded in C around -inf 51.3%
if 2.3500000000000001e-184 < B < 5.59999999999999964e69Initial program 48.8%
+-commutative48.8%
unpow248.8%
unpow248.8%
hypot-undefine65.1%
sub-neg65.1%
distribute-rgt-in50.7%
div-inv50.5%
hypot-undefine48.2%
unpow248.2%
unpow248.2%
+-commutative48.2%
unpow248.2%
unpow248.2%
hypot-define50.5%
Applied egg-rr50.5%
Taylor expanded in C around inf 38.9%
if 5.59999999999999964e69 < B Initial program 36.3%
Taylor expanded in B around inf 66.8%
Final simplification53.1%
(FPCore (A B C)
:precision binary64
(if (<= A -1.85e-96)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A -3.2e-134)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 1.1e-305)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 3.7e-30)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.85e-96) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= -3.2e-134) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 1.1e-305) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 3.7e-30) {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
} 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 tmp;
if (A <= -1.85e-96) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= -3.2e-134) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 1.1e-305) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 3.7e-30) {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.85e-96: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= -3.2e-134: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 1.1e-305: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 3.7e-30: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.85e-96) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= -3.2e-134) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 1.1e-305) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 3.7e-30) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); 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) tmp = 0.0; if (A <= -1.85e-96) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= -3.2e-134) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 1.1e-305) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 3.7e-30) tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.85e-96], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -3.2e-134], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.1e-305], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.7e-30], 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[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.85 \cdot 10^{-96}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -3.2 \cdot 10^{-134}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 1.1 \cdot 10^{-305}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 3.7 \cdot 10^{-30}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.84999999999999993e-96Initial program 24.3%
Taylor expanded in A around -inf 67.2%
associate-*r/67.2%
Simplified67.2%
if -1.84999999999999993e-96 < A < -3.2000000000000001e-134Initial program 42.0%
Taylor expanded in B around -inf 57.2%
if -3.2000000000000001e-134 < A < 1.09999999999999998e-305Initial program 63.5%
Taylor expanded in B around inf 41.9%
if 1.09999999999999998e-305 < A < 3.7000000000000003e-30Initial program 45.9%
+-commutative45.9%
unpow245.9%
unpow245.9%
hypot-undefine81.5%
sub-neg81.5%
distribute-rgt-in67.1%
div-inv66.7%
hypot-undefine43.3%
unpow243.3%
unpow243.3%
+-commutative43.3%
unpow243.3%
unpow243.3%
hypot-define66.7%
Applied egg-rr66.7%
Taylor expanded in C around inf 39.8%
if 3.7000000000000003e-30 < A Initial program 73.4%
Taylor expanded in A around inf 63.8%
Final simplification57.0%
(FPCore (A B C)
:precision binary64
(if (<= A -1.85e-96)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A -3.7e-135)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 3.8e-306)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 1.55e-88)
(* 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 (A <= -1.85e-96) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= -3.7e-135) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 3.8e-306) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 1.55e-88) {
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 (A <= -1.85e-96) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= -3.7e-135) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 3.8e-306) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 1.55e-88) {
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 A <= -1.85e-96: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= -3.7e-135: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 3.8e-306: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 1.55e-88: 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 (A <= -1.85e-96) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= -3.7e-135) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 3.8e-306) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 1.55e-88) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); else tmp = Float64(Float64(-180.0 * 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.85e-96) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= -3.7e-135) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 3.8e-306) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 1.55e-88) 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[A, -1.85e-96], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -3.7e-135], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.8e-306], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.55e-88], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(-180.0 * N[ArcTan[N[(1.0 + N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.85 \cdot 10^{-96}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -3.7 \cdot 10^{-135}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 3.8 \cdot 10^{-306}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 1.55 \cdot 10^{-88}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(1 + \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.84999999999999993e-96Initial program 24.3%
Taylor expanded in A around -inf 67.2%
associate-*r/67.2%
Simplified67.2%
if -1.84999999999999993e-96 < A < -3.6999999999999997e-135Initial program 42.0%
Taylor expanded in B around -inf 57.2%
if -3.6999999999999997e-135 < A < 3.8e-306Initial program 63.5%
Taylor expanded in B around inf 41.9%
if 3.8e-306 < A < 1.5499999999999999e-88Initial program 46.1%
+-commutative46.1%
unpow246.1%
unpow246.1%
hypot-undefine81.1%
sub-neg81.1%
distribute-rgt-in66.2%
div-inv65.8%
hypot-undefine42.8%
unpow242.8%
unpow242.8%
+-commutative42.8%
unpow242.8%
unpow242.8%
hypot-define65.8%
Applied egg-rr65.8%
Taylor expanded in C around inf 39.2%
if 1.5499999999999999e-88 < A Initial program 69.2%
Taylor expanded in C around 0 67.8%
mul-1-neg67.8%
distribute-neg-frac267.8%
+-commutative67.8%
unpow267.8%
unpow267.8%
hypot-define85.7%
Simplified85.7%
Taylor expanded in A around 0 74.7%
associate-*r/74.7%
distribute-frac-neg274.7%
atan-neg74.7%
Applied egg-rr74.7%
distribute-rgt-neg-out74.7%
distribute-lft-neg-in74.7%
metadata-eval74.7%
+-commutative74.7%
remove-double-neg74.7%
mul-1-neg74.7%
sub-neg74.7%
div-sub74.7%
*-inverses74.7%
associate-*r/74.7%
cancel-sign-sub-inv74.7%
metadata-eval74.7%
*-lft-identity74.7%
Simplified74.7%
Final simplification61.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan 0.0) PI))))
(if (<= B -3.3e-61)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1e-225)
t_0
(if (<= B 1.85e-180)
(* 180.0 (/ (atan (/ A (- B))) PI))
(if (<= B 3.25e-44) t_0 (* 180.0 (/ (atan -1.0) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(0.0) / ((double) M_PI));
double tmp;
if (B <= -3.3e-61) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1e-225) {
tmp = t_0;
} else if (B <= 1.85e-180) {
tmp = 180.0 * (atan((A / -B)) / ((double) M_PI));
} else if (B <= 3.25e-44) {
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(0.0) / Math.PI);
double tmp;
if (B <= -3.3e-61) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1e-225) {
tmp = t_0;
} else if (B <= 1.85e-180) {
tmp = 180.0 * (Math.atan((A / -B)) / Math.PI);
} else if (B <= 3.25e-44) {
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(0.0) / math.pi) tmp = 0 if B <= -3.3e-61: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1e-225: tmp = t_0 elif B <= 1.85e-180: tmp = 180.0 * (math.atan((A / -B)) / math.pi) elif B <= 3.25e-44: 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(0.0) / pi)) tmp = 0.0 if (B <= -3.3e-61) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1e-225) tmp = t_0; elseif (B <= 1.85e-180) tmp = Float64(180.0 * Float64(atan(Float64(A / Float64(-B))) / pi)); elseif (B <= 3.25e-44) 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(0.0) / pi); tmp = 0.0; if (B <= -3.3e-61) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1e-225) tmp = t_0; elseif (B <= 1.85e-180) tmp = 180.0 * (atan((A / -B)) / pi); elseif (B <= 3.25e-44) 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[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.3e-61], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1e-225], t$95$0, If[LessEqual[B, 1.85e-180], N[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.25e-44], 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} 0}{\pi}\\
\mathbf{if}\;B \leq -3.3 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 10^{-225}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{-180}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.25 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.29999999999999996e-61Initial program 50.0%
Taylor expanded in B around -inf 60.9%
if -3.29999999999999996e-61 < B < 9.9999999999999996e-226 or 1.85000000000000008e-180 < B < 3.25e-44Initial program 47.1%
+-commutative47.1%
unpow247.1%
unpow247.1%
hypot-undefine79.9%
sub-neg79.9%
distribute-lft-in44.5%
hypot-undefine41.7%
unpow241.7%
unpow241.7%
+-commutative41.7%
unpow241.7%
unpow241.7%
hypot-define44.5%
Applied egg-rr44.5%
Taylor expanded in A around -inf 13.1%
distribute-lft1-in13.1%
metadata-eval13.1%
mul0-lft38.0%
Simplified38.0%
if 9.9999999999999996e-226 < B < 1.85000000000000008e-180Initial program 77.7%
Taylor expanded in C around 0 63.3%
mul-1-neg63.3%
distribute-neg-frac263.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-define57.6%
Simplified57.6%
Taylor expanded in A around 0 52.4%
Taylor expanded in A around inf 51.2%
neg-mul-151.2%
distribute-neg-frac251.2%
Simplified51.2%
if 3.25e-44 < B Initial program 43.8%
Taylor expanded in B around inf 54.4%
Final simplification50.2%
(FPCore (A B C) :precision binary64 (if (<= A -0.0125) (* 180.0 (/ (atan (/ (* B 0.5) A)) PI)) (* 180.0 (/ (atan (+ (/ (- C A) B) -1.0)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -0.0125) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -0.0125) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((C - A) / B) + -1.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -0.0125: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) else: tmp = 180.0 * (math.atan((((C - A) / B) + -1.0)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -0.0125) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + -1.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -0.0125) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); else tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -0.0125], 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[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -0.0125:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
\end{array}
\end{array}
if A < -0.012500000000000001Initial program 21.9%
Taylor expanded in A around -inf 75.0%
associate-*r/75.0%
Simplified75.0%
if -0.012500000000000001 < A Initial program 58.5%
+-commutative58.5%
unpow258.5%
unpow258.5%
hypot-undefine87.0%
sub-neg87.0%
distribute-lft-in79.7%
hypot-undefine57.7%
unpow257.7%
unpow257.7%
+-commutative57.7%
unpow257.7%
unpow257.7%
hypot-define79.7%
Applied egg-rr79.7%
Taylor expanded in B around inf 60.6%
+-commutative60.6%
associate--r+60.6%
div-sub60.6%
Simplified60.6%
Final simplification64.5%
(FPCore (A B C)
:precision binary64
(if (<= B -4.6e-63)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.2e-42)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.6e-63) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.2e-42) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -4.6e-63) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.2e-42) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.6e-63: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.2e-42: tmp = 180.0 * (math.atan(0.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -4.6e-63) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.2e-42) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -4.6e-63) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.2e-42) tmp = 180.0 * (atan(0.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.6e-63], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.2e-42], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.6 \cdot 10^{-63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.2 \cdot 10^{-42}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.6e-63Initial program 50.0%
Taylor expanded in B around -inf 60.9%
if -4.6e-63 < B < 2.20000000000000005e-42Initial program 51.1%
+-commutative51.1%
unpow251.1%
unpow251.1%
hypot-undefine80.5%
sub-neg80.5%
distribute-lft-in48.2%
hypot-undefine45.8%
unpow245.8%
unpow245.8%
+-commutative45.8%
unpow245.8%
unpow245.8%
hypot-define48.2%
Applied egg-rr48.2%
Taylor expanded in A around -inf 12.4%
distribute-lft1-in12.4%
metadata-eval12.4%
mul0-lft35.0%
Simplified35.0%
if 2.20000000000000005e-42 < B Initial program 43.8%
Taylor expanded in B around inf 54.4%
Final simplification48.3%
(FPCore (A B C) :precision binary64 (if (<= B 3.25e-44) (* 180.0 (/ (atan 0.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 3.25e-44) {
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 <= 3.25e-44) {
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 <= 3.25e-44: 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 <= 3.25e-44) 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 <= 3.25e-44) 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, 3.25e-44], 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 3.25 \cdot 10^{-44}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 3.25e-44Initial program 50.6%
+-commutative50.6%
unpow250.6%
unpow250.6%
hypot-undefine80.0%
sub-neg80.0%
distribute-lft-in61.0%
hypot-undefine47.5%
unpow247.5%
unpow247.5%
+-commutative47.5%
unpow247.5%
unpow247.5%
hypot-define61.0%
Applied egg-rr61.0%
Taylor expanded in A around -inf 8.7%
distribute-lft1-in8.7%
metadata-eval8.7%
mul0-lft22.0%
Simplified22.0%
if 3.25e-44 < B Initial program 43.8%
Taylor expanded in B around inf 54.4%
Final simplification31.6%
(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 48.6%
Taylor expanded in B around inf 20.2%
Final simplification20.2%
herbie shell --seed 2024075
(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)))