
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C) :precision binary64 (if (<= C 6.5e+159) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI)) (* 180.0 (/ (atan (/ -1.0 (/ (* C 2.0) B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 6.5e+159) {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 6.5e+159) {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 / ((C * 2.0) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 6.5e+159: tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 / ((C * 2.0) / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 6.5e+159) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(C * 2.0) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 6.5e+159) tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); else tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 6.5e+159], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 6.5 \cdot 10^{+159}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{C \cdot 2}{B}}\right)}{\pi}\\
\end{array}
\end{array}
if C < 6.5000000000000001e159Initial program 60.6%
Simplified84.0%
if 6.5000000000000001e159 < C Initial program 8.7%
associate--l-8.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-undefine47.3%
associate-/r/47.3%
frac-2neg47.3%
metadata-eval47.3%
associate--r+54.3%
hypot-undefine8.7%
unpow28.7%
unpow28.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-define54.3%
Applied egg-rr54.3%
Simplified19.6%
Taylor expanded in C around inf 31.4%
Taylor expanded in B around inf 88.9%
*-commutative88.9%
associate-*l/88.9%
Simplified88.9%
Final simplification84.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))))
(if (<= A -1e+155)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -2.4e-245)
t_0
(if (<= A -9.5e-269)
(* 180.0 (/ (atan (/ -1.0 (/ (* C 2.0) B))) PI))
(if (<= A 2.05e+114)
t_0
(* 180.0 (/ (atan (/ -1.0 (/ 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 tmp;
if (A <= -1e+155) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -2.4e-245) {
tmp = t_0;
} else if (A <= -9.5e-269) {
tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / ((double) M_PI));
} else if (A <= 2.05e+114) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-1.0 / (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 tmp;
if (A <= -1e+155) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -2.4e-245) {
tmp = t_0;
} else if (A <= -9.5e-269) {
tmp = 180.0 * (Math.atan((-1.0 / ((C * 2.0) / B))) / Math.PI);
} else if (A <= 2.05e+114) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-1.0 / (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) tmp = 0 if A <= -1e+155: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -2.4e-245: tmp = t_0 elif A <= -9.5e-269: tmp = 180.0 * (math.atan((-1.0 / ((C * 2.0) / B))) / math.pi) elif A <= 2.05e+114: tmp = t_0 else: tmp = 180.0 * (math.atan((-1.0 / (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)) tmp = 0.0 if (A <= -1e+155) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -2.4e-245) tmp = t_0; elseif (A <= -9.5e-269) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(C * 2.0) / B))) / pi)); elseif (A <= 2.05e+114) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(B / Float64(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); tmp = 0.0; if (A <= -1e+155) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -2.4e-245) tmp = t_0; elseif (A <= -9.5e-269) tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / pi); elseif (A <= 2.05e+114) tmp = t_0; else tmp = 180.0 * (atan((-1.0 / (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]}, If[LessEqual[A, -1e+155], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.4e-245], t$95$0, If[LessEqual[A, -9.5e-269], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.05e+114], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(B / N[(A + B), $MachinePrecision]), $MachinePrecision]), $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}\\
\mathbf{if}\;A \leq -1 \cdot 10^{+155}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.4 \cdot 10^{-245}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -9.5 \cdot 10^{-269}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{C \cdot 2}{B}}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.05 \cdot 10^{+114}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{B}{A + B}}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.00000000000000001e155Initial program 13.1%
Taylor expanded in A around -inf 73.9%
if -1.00000000000000001e155 < A < -2.4e-245 or -9.5000000000000006e-269 < A < 2.05e114Initial program 55.9%
Taylor expanded in A around 0 51.5%
unpow251.5%
unpow251.5%
hypot-define78.8%
Simplified78.8%
if -2.4e-245 < A < -9.5000000000000006e-269Initial program 25.8%
associate--l-25.8%
+-commutative25.8%
unpow225.8%
unpow225.8%
hypot-undefine26.2%
associate-/r/26.2%
frac-2neg26.2%
metadata-eval26.2%
associate--r+26.2%
hypot-undefine25.8%
unpow225.8%
unpow225.8%
+-commutative25.8%
unpow225.8%
unpow225.8%
hypot-define26.2%
Applied egg-rr26.2%
Simplified24.9%
Taylor expanded in C around inf 38.0%
Taylor expanded in B around inf 79.7%
*-commutative79.7%
associate-*l/79.7%
Simplified79.7%
if 2.05e114 < A Initial program 89.8%
associate--l-89.8%
+-commutative89.8%
unpow289.8%
unpow289.8%
hypot-undefine98.0%
associate-/r/98.0%
frac-2neg98.0%
metadata-eval98.0%
associate--r+98.0%
hypot-undefine89.8%
unpow289.8%
unpow289.8%
+-commutative89.8%
unpow289.8%
unpow289.8%
hypot-define98.0%
Applied egg-rr98.0%
Simplified96.1%
Taylor expanded in B around inf 92.7%
Final simplification80.8%
(FPCore (A B C)
:precision binary64
(if (<= A -4.2e+154)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -2.4e-245)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(if (<= A -9.5e-269)
(* 180.0 (/ (atan (/ -1.0 (/ (* C 2.0) B))) PI))
(* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.2e+154) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -2.4e-245) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else if (A <= -9.5e-269) {
tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / ((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 <= -4.2e+154) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -2.4e-245) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else if (A <= -9.5e-269) {
tmp = 180.0 * (Math.atan((-1.0 / ((C * 2.0) / B))) / 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 <= -4.2e+154: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -2.4e-245: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) elif A <= -9.5e-269: tmp = 180.0 * (math.atan((-1.0 / ((C * 2.0) / B))) / 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 <= -4.2e+154) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -2.4e-245) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); elseif (A <= -9.5e-269) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(C * 2.0) / B))) / 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 <= -4.2e+154) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -2.4e-245) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); elseif (A <= -9.5e-269) tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / 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, -4.2e+154], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.4e-245], 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[A, -9.5e-269], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]), $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 -4.2 \cdot 10^{+154}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -2.4 \cdot 10^{-245}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -9.5 \cdot 10^{-269}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{C \cdot 2}{B}}\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 < -4.19999999999999989e154Initial program 13.1%
Taylor expanded in A around -inf 73.9%
if -4.19999999999999989e154 < A < -2.4e-245Initial program 51.7%
Taylor expanded in A around 0 49.3%
unpow249.3%
unpow249.3%
hypot-define74.7%
Simplified74.7%
if -2.4e-245 < A < -9.5000000000000006e-269Initial program 25.8%
associate--l-25.8%
+-commutative25.8%
unpow225.8%
unpow225.8%
hypot-undefine26.2%
associate-/r/26.2%
frac-2neg26.2%
metadata-eval26.2%
associate--r+26.2%
hypot-undefine25.8%
unpow225.8%
unpow225.8%
+-commutative25.8%
unpow225.8%
unpow225.8%
hypot-define26.2%
Applied egg-rr26.2%
Simplified24.9%
Taylor expanded in C around inf 38.0%
Taylor expanded in B around inf 79.7%
*-commutative79.7%
associate-*l/79.7%
Simplified79.7%
if -9.5000000000000006e-269 < A Initial program 69.8%
Simplified91.1%
Final simplification83.7%
(FPCore (A B C)
:precision binary64
(if (<= C -1.02e-55)
(* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
(if (<= C 2.05e+159)
(* 180.0 (/ (atan (/ (+ A (hypot B A)) (- B))) PI))
(* 180.0 (/ (atan (/ -1.0 (/ (* C 2.0) B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1.02e-55) {
tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
} else if (C <= 2.05e+159) {
tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1.02e-55) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
} else if (C <= 2.05e+159) {
tmp = 180.0 * (Math.atan(((A + Math.hypot(B, A)) / -B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 / ((C * 2.0) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1.02e-55: tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi) elif C <= 2.05e+159: tmp = 180.0 * (math.atan(((A + math.hypot(B, A)) / -B)) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 / ((C * 2.0) / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1.02e-55) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi)); elseif (C <= 2.05e+159) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) / Float64(-B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(C * 2.0) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1.02e-55) tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi); elseif (C <= 2.05e+159) tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / pi); else tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1.02e-55], 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, 2.05e+159], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.02 \cdot 10^{-55}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.05 \cdot 10^{+159}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{C \cdot 2}{B}}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.02e-55Initial program 77.4%
Taylor expanded in A around 0 75.6%
unpow275.6%
unpow275.6%
hypot-define85.7%
Simplified85.7%
if -1.02e-55 < C < 2.05000000000000007e159Initial program 52.9%
Taylor expanded in C around 0 50.3%
associate-*r/50.3%
mul-1-neg50.3%
+-commutative50.3%
unpow250.3%
unpow250.3%
hypot-define78.2%
Simplified78.2%
if 2.05000000000000007e159 < C Initial program 8.7%
associate--l-8.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-undefine47.3%
associate-/r/47.3%
frac-2neg47.3%
metadata-eval47.3%
associate--r+54.3%
hypot-undefine8.7%
unpow28.7%
unpow28.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-define54.3%
Applied egg-rr54.3%
Simplified19.6%
Taylor expanded in C around inf 31.4%
Taylor expanded in B around inf 88.9%
*-commutative88.9%
associate-*l/88.9%
Simplified88.9%
Final simplification81.5%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (+ A (hypot B A))))
(if (<= C -7e-78)
(* 180.0 (/ (atan (/ (- C t_0) B)) PI))
(if (<= C 6.7e+159)
(* 180.0 (/ (atan (/ t_0 (- B))) PI))
(* 180.0 (/ (atan (/ -1.0 (/ (* C 2.0) B))) PI))))))
double code(double A, double B, double C) {
double t_0 = A + hypot(B, A);
double tmp;
if (C <= -7e-78) {
tmp = 180.0 * (atan(((C - t_0) / B)) / ((double) M_PI));
} else if (C <= 6.7e+159) {
tmp = 180.0 * (atan((t_0 / -B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = A + Math.hypot(B, A);
double tmp;
if (C <= -7e-78) {
tmp = 180.0 * (Math.atan(((C - t_0) / B)) / Math.PI);
} else if (C <= 6.7e+159) {
tmp = 180.0 * (Math.atan((t_0 / -B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 / ((C * 2.0) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = A + math.hypot(B, A) tmp = 0 if C <= -7e-78: tmp = 180.0 * (math.atan(((C - t_0) / B)) / math.pi) elif C <= 6.7e+159: tmp = 180.0 * (math.atan((t_0 / -B)) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 / ((C * 2.0) / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(A + hypot(B, A)) tmp = 0.0 if (C <= -7e-78) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - t_0) / B)) / pi)); elseif (C <= 6.7e+159) tmp = Float64(180.0 * Float64(atan(Float64(t_0 / Float64(-B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(C * 2.0) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = A + hypot(B, A); tmp = 0.0; if (C <= -7e-78) tmp = 180.0 * (atan(((C - t_0) / B)) / pi); elseif (C <= 6.7e+159) tmp = 180.0 * (atan((t_0 / -B)) / pi); else tmp = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -7e-78], N[(180.0 * N[(N[ArcTan[N[(N[(C - t$95$0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.7e+159], N[(180.0 * N[(N[ArcTan[N[(t$95$0 / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := A + \mathsf{hypot}\left(B, A\right)\\
\mathbf{if}\;C \leq -7 \cdot 10^{-78}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - t\_0}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.7 \cdot 10^{+159}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{t\_0}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{C \cdot 2}{B}}\right)}{\pi}\\
\end{array}
\end{array}
if C < -6.9999999999999999e-78Initial program 74.0%
Simplified85.0%
Taylor expanded in C around 0 73.0%
+-commutative73.0%
unpow273.0%
unpow273.0%
hypot-define84.7%
Simplified84.7%
if -6.9999999999999999e-78 < C < 6.70000000000000018e159Initial program 53.0%
Taylor expanded in C around 0 50.9%
associate-*r/50.9%
mul-1-neg50.9%
+-commutative50.9%
unpow250.9%
unpow250.9%
hypot-define79.0%
Simplified79.0%
if 6.70000000000000018e159 < C Initial program 8.7%
associate--l-8.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-undefine47.3%
associate-/r/47.3%
frac-2neg47.3%
metadata-eval47.3%
associate--r+54.3%
hypot-undefine8.7%
unpow28.7%
unpow28.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-define54.3%
Applied egg-rr54.3%
Simplified19.6%
Taylor expanded in C around inf 31.4%
Taylor expanded in B around inf 88.9%
*-commutative88.9%
associate-*l/88.9%
Simplified88.9%
Final simplification81.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ -1.0 (/ (* C 2.0) B))) PI)))
(t_1 (* 180.0 (/ (atan (/ (+ C B) B)) PI)))
(t_2 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= A -9e+149)
t_2
(if (<= A -3.1e+41)
t_1
(if (<= A -2.9e-43)
t_2
(if (<= A -2.4e-245)
t_1
(if (<= A -9.5e-269)
t_0
(if (<= A 1.8e-304)
t_1
(if (<= A 4.8e-287)
t_0
(if (<= A 1e-158)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(if (<= A 1e-48)
t_1
(* 180.0 (/ (atan (/ -1.0 (/ B (+ A B)))) PI)))))))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / ((double) M_PI));
double t_1 = 180.0 * (atan(((C + B) / B)) / ((double) M_PI));
double t_2 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (A <= -9e+149) {
tmp = t_2;
} else if (A <= -3.1e+41) {
tmp = t_1;
} else if (A <= -2.9e-43) {
tmp = t_2;
} else if (A <= -2.4e-245) {
tmp = t_1;
} else if (A <= -9.5e-269) {
tmp = t_0;
} else if (A <= 1.8e-304) {
tmp = t_1;
} else if (A <= 4.8e-287) {
tmp = t_0;
} else if (A <= 1e-158) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else if (A <= 1e-48) {
tmp = t_1;
} else {
tmp = 180.0 * (atan((-1.0 / (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((-1.0 / ((C * 2.0) / B))) / Math.PI);
double t_1 = 180.0 * (Math.atan(((C + B) / B)) / Math.PI);
double t_2 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (A <= -9e+149) {
tmp = t_2;
} else if (A <= -3.1e+41) {
tmp = t_1;
} else if (A <= -2.9e-43) {
tmp = t_2;
} else if (A <= -2.4e-245) {
tmp = t_1;
} else if (A <= -9.5e-269) {
tmp = t_0;
} else if (A <= 1.8e-304) {
tmp = t_1;
} else if (A <= 4.8e-287) {
tmp = t_0;
} else if (A <= 1e-158) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else if (A <= 1e-48) {
tmp = t_1;
} else {
tmp = 180.0 * (Math.atan((-1.0 / (B / (A + B)))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((-1.0 / ((C * 2.0) / B))) / math.pi) t_1 = 180.0 * (math.atan(((C + B) / B)) / math.pi) t_2 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if A <= -9e+149: tmp = t_2 elif A <= -3.1e+41: tmp = t_1 elif A <= -2.9e-43: tmp = t_2 elif A <= -2.4e-245: tmp = t_1 elif A <= -9.5e-269: tmp = t_0 elif A <= 1.8e-304: tmp = t_1 elif A <= 4.8e-287: tmp = t_0 elif A <= 1e-158: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) elif A <= 1e-48: tmp = t_1 else: tmp = 180.0 * (math.atan((-1.0 / (B / (A + B)))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(C * 2.0) / B))) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(Float64(C + B) / B)) / pi)) t_2 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (A <= -9e+149) tmp = t_2; elseif (A <= -3.1e+41) tmp = t_1; elseif (A <= -2.9e-43) tmp = t_2; elseif (A <= -2.4e-245) tmp = t_1; elseif (A <= -9.5e-269) tmp = t_0; elseif (A <= 1.8e-304) tmp = t_1; elseif (A <= 4.8e-287) tmp = t_0; elseif (A <= 1e-158) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); elseif (A <= 1e-48) tmp = t_1; else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(B / Float64(A + B)))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((-1.0 / ((C * 2.0) / B))) / pi); t_1 = 180.0 * (atan(((C + B) / B)) / pi); t_2 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (A <= -9e+149) tmp = t_2; elseif (A <= -3.1e+41) tmp = t_1; elseif (A <= -2.9e-43) tmp = t_2; elseif (A <= -2.4e-245) tmp = t_1; elseif (A <= -9.5e-269) tmp = t_0; elseif (A <= 1.8e-304) tmp = t_1; elseif (A <= 4.8e-287) tmp = t_0; elseif (A <= 1e-158) tmp = 180.0 * (atan(((C - B) / B)) / pi); elseif (A <= 1e-48) tmp = t_1; else tmp = 180.0 * (atan((-1.0 / (B / (A + B)))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(N[(C + B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -9e+149], t$95$2, If[LessEqual[A, -3.1e+41], t$95$1, If[LessEqual[A, -2.9e-43], t$95$2, If[LessEqual[A, -2.4e-245], t$95$1, If[LessEqual[A, -9.5e-269], t$95$0, If[LessEqual[A, 1.8e-304], t$95$1, If[LessEqual[A, 4.8e-287], t$95$0, If[LessEqual[A, 1e-158], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1e-48], t$95$1, N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(B / N[(A + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{C \cdot 2}{B}}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C + B}{B}\right)}{\pi}\\
t_2 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -9 \cdot 10^{+149}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;A \leq -3.1 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -2.9 \cdot 10^{-43}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;A \leq -2.4 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -9.5 \cdot 10^{-269}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq 1.8 \cdot 10^{-304}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq 4.8 \cdot 10^{-287}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq 10^{-158}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{B}{A + B}}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.99999999999999965e149 or -3.1e41 < A < -2.9000000000000001e-43Initial program 16.5%
Taylor expanded in A around -inf 66.0%
if -8.99999999999999965e149 < A < -3.1e41 or -2.9000000000000001e-43 < A < -2.4e-245 or -9.5000000000000006e-269 < A < 1.8000000000000001e-304 or 1.00000000000000006e-158 < A < 9.9999999999999997e-49Initial program 59.3%
Simplified81.7%
Taylor expanded in C around 0 53.3%
+-commutative53.3%
unpow253.3%
unpow253.3%
hypot-define76.4%
Simplified76.4%
Taylor expanded in B around -inf 70.4%
mul-1-neg70.4%
Simplified70.4%
if -2.4e-245 < A < -9.5000000000000006e-269 or 1.8000000000000001e-304 < A < 4.79999999999999999e-287Initial program 19.4%
associate--l-19.4%
+-commutative19.4%
unpow219.4%
unpow219.4%
hypot-undefine25.2%
associate-/r/25.2%
frac-2neg25.2%
metadata-eval25.2%
associate--r+25.2%
hypot-undefine19.4%
unpow219.4%
unpow219.4%
+-commutative19.4%
unpow219.4%
unpow219.4%
hypot-define25.2%
Applied egg-rr25.2%
Simplified24.7%
Taylor expanded in C around inf 39.7%
Taylor expanded in B around inf 79.6%
*-commutative79.6%
associate-*l/79.6%
Simplified79.6%
if 4.79999999999999999e-287 < A < 1.00000000000000006e-158Initial program 64.0%
Simplified90.1%
Taylor expanded in C around 0 63.9%
+-commutative63.9%
unpow263.9%
unpow263.9%
hypot-define86.3%
Simplified86.3%
Taylor expanded in A around 0 52.4%
if 9.9999999999999997e-49 < A Initial program 81.7%
associate--l-81.7%
+-commutative81.7%
unpow281.7%
unpow281.7%
hypot-undefine97.5%
associate-/r/97.5%
frac-2neg97.5%
metadata-eval97.5%
associate--r+97.5%
hypot-undefine81.7%
unpow281.7%
unpow281.7%
+-commutative81.7%
unpow281.7%
unpow281.7%
hypot-define97.5%
Applied egg-rr97.5%
Simplified95.1%
Taylor expanded in B around inf 82.4%
Final simplification71.5%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan 1.0) PI)))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI)))
(t_2 (* 180.0 (/ (atan (/ (- C B) B)) PI))))
(if (<= A -9e+149)
t_1
(if (<= A -2.8e+136)
t_0
(if (<= A -2.5e-131)
t_1
(if (<= A -9.2e-248)
t_2
(if (<= A -1.55e-305)
t_0
(if (<= A 1.38e-155)
t_2
(if (<= A 3.8e-102)
t_0
(if (<= A 7.5e+89)
t_2
(* 180.0 (/ (atan (/ (* A -2.0) B)) 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((0.5 * (B / A))) / ((double) M_PI));
double t_2 = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
double tmp;
if (A <= -9e+149) {
tmp = t_1;
} else if (A <= -2.8e+136) {
tmp = t_0;
} else if (A <= -2.5e-131) {
tmp = t_1;
} else if (A <= -9.2e-248) {
tmp = t_2;
} else if (A <= -1.55e-305) {
tmp = t_0;
} else if (A <= 1.38e-155) {
tmp = t_2;
} else if (A <= 3.8e-102) {
tmp = t_0;
} else if (A <= 7.5e+89) {
tmp = t_2;
} else {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(1.0) / Math.PI);
double t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double t_2 = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
double tmp;
if (A <= -9e+149) {
tmp = t_1;
} else if (A <= -2.8e+136) {
tmp = t_0;
} else if (A <= -2.5e-131) {
tmp = t_1;
} else if (A <= -9.2e-248) {
tmp = t_2;
} else if (A <= -1.55e-305) {
tmp = t_0;
} else if (A <= 1.38e-155) {
tmp = t_2;
} else if (A <= 3.8e-102) {
tmp = t_0;
} else if (A <= 7.5e+89) {
tmp = t_2;
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / 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((0.5 * (B / A))) / math.pi) t_2 = 180.0 * (math.atan(((C - B) / B)) / math.pi) tmp = 0 if A <= -9e+149: tmp = t_1 elif A <= -2.8e+136: tmp = t_0 elif A <= -2.5e-131: tmp = t_1 elif A <= -9.2e-248: tmp = t_2 elif A <= -1.55e-305: tmp = t_0 elif A <= 1.38e-155: tmp = t_2 elif A <= 3.8e-102: tmp = t_0 elif A <= 7.5e+89: tmp = t_2 else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / 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(0.5 * Float64(B / A))) / pi)) t_2 = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)) tmp = 0.0 if (A <= -9e+149) tmp = t_1; elseif (A <= -2.8e+136) tmp = t_0; elseif (A <= -2.5e-131) tmp = t_1; elseif (A <= -9.2e-248) tmp = t_2; elseif (A <= -1.55e-305) tmp = t_0; elseif (A <= 1.38e-155) tmp = t_2; elseif (A <= 3.8e-102) tmp = t_0; elseif (A <= 7.5e+89) tmp = t_2; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / 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((0.5 * (B / A))) / pi); t_2 = 180.0 * (atan(((C - B) / B)) / pi); tmp = 0.0; if (A <= -9e+149) tmp = t_1; elseif (A <= -2.8e+136) tmp = t_0; elseif (A <= -2.5e-131) tmp = t_1; elseif (A <= -9.2e-248) tmp = t_2; elseif (A <= -1.55e-305) tmp = t_0; elseif (A <= 1.38e-155) tmp = t_2; elseif (A <= 3.8e-102) tmp = t_0; elseif (A <= 7.5e+89) tmp = t_2; else tmp = 180.0 * (atan(((A * -2.0) / B)) / 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[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -9e+149], t$95$1, If[LessEqual[A, -2.8e+136], t$95$0, If[LessEqual[A, -2.5e-131], t$95$1, If[LessEqual[A, -9.2e-248], t$95$2, If[LessEqual[A, -1.55e-305], t$95$0, If[LessEqual[A, 1.38e-155], t$95$2, If[LessEqual[A, 3.8e-102], t$95$0, If[LessEqual[A, 7.5e+89], t$95$2, N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $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(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
t_2 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -9 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -2.8 \cdot 10^{+136}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -2.5 \cdot 10^{-131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -9.2 \cdot 10^{-248}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;A \leq -1.55 \cdot 10^{-305}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq 1.38 \cdot 10^{-155}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;A \leq 3.8 \cdot 10^{-102}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq 7.5 \cdot 10^{+89}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.99999999999999965e149 or -2.8000000000000002e136 < A < -2.5000000000000002e-131Initial program 27.6%
Taylor expanded in A around -inf 58.1%
if -8.99999999999999965e149 < A < -2.8000000000000002e136 or -9.2000000000000001e-248 < A < -1.5499999999999999e-305 or 1.38000000000000007e-155 < A < 3.80000000000000026e-102Initial program 38.2%
Taylor expanded in B around -inf 67.1%
if -2.5000000000000002e-131 < A < -9.2000000000000001e-248 or -1.5499999999999999e-305 < A < 1.38000000000000007e-155 or 3.80000000000000026e-102 < A < 7.49999999999999947e89Initial program 65.2%
Simplified86.1%
Taylor expanded in C around 0 63.9%
+-commutative63.9%
unpow263.9%
unpow263.9%
hypot-define80.2%
Simplified80.2%
Taylor expanded in A around 0 57.2%
if 7.49999999999999947e89 < A Initial program 89.2%
Taylor expanded in A around inf 88.1%
associate-*r/88.1%
*-commutative88.1%
Simplified88.1%
Final simplification65.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan 1.0) PI)))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= A -9e+149)
t_1
(if (<= A -2.8e+136)
t_0
(if (<= A -8.6e-133)
t_1
(if (<= A -1.2e-222)
(* 180.0 (/ (atan (/ (* C 2.0) B)) PI))
(if (<= A -1.9e-247)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 3.6e+18)
t_0
(* 180.0 (/ (atan (/ (* A -2.0) B)) 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((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (A <= -9e+149) {
tmp = t_1;
} else if (A <= -2.8e+136) {
tmp = t_0;
} else if (A <= -8.6e-133) {
tmp = t_1;
} else if (A <= -1.2e-222) {
tmp = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
} else if (A <= -1.9e-247) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 3.6e+18) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(1.0) / Math.PI);
double t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (A <= -9e+149) {
tmp = t_1;
} else if (A <= -2.8e+136) {
tmp = t_0;
} else if (A <= -8.6e-133) {
tmp = t_1;
} else if (A <= -1.2e-222) {
tmp = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
} else if (A <= -1.9e-247) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 3.6e+18) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / 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((0.5 * (B / A))) / math.pi) tmp = 0 if A <= -9e+149: tmp = t_1 elif A <= -2.8e+136: tmp = t_0 elif A <= -8.6e-133: tmp = t_1 elif A <= -1.2e-222: tmp = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) elif A <= -1.9e-247: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 3.6e+18: tmp = t_0 else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / 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(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (A <= -9e+149) tmp = t_1; elseif (A <= -2.8e+136) tmp = t_0; elseif (A <= -8.6e-133) tmp = t_1; elseif (A <= -1.2e-222) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)); elseif (A <= -1.9e-247) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 3.6e+18) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / 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((0.5 * (B / A))) / pi); tmp = 0.0; if (A <= -9e+149) tmp = t_1; elseif (A <= -2.8e+136) tmp = t_0; elseif (A <= -8.6e-133) tmp = t_1; elseif (A <= -1.2e-222) tmp = 180.0 * (atan(((C * 2.0) / B)) / pi); elseif (A <= -1.9e-247) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 3.6e+18) tmp = t_0; else tmp = 180.0 * (atan(((A * -2.0) / B)) / 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[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -9e+149], t$95$1, If[LessEqual[A, -2.8e+136], t$95$0, If[LessEqual[A, -8.6e-133], t$95$1, If[LessEqual[A, -1.2e-222], N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -1.9e-247], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.6e+18], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $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(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -9 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -2.8 \cdot 10^{+136}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -8.6 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -1.2 \cdot 10^{-222}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -1.9 \cdot 10^{-247}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 3.6 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.99999999999999965e149 or -2.8000000000000002e136 < A < -8.60000000000000032e-133Initial program 27.6%
Taylor expanded in A around -inf 58.1%
if -8.99999999999999965e149 < A < -2.8000000000000002e136 or -1.89999999999999994e-247 < A < 3.6e18Initial program 51.8%
Taylor expanded in B around -inf 42.0%
if -8.60000000000000032e-133 < A < -1.19999999999999997e-222Initial program 83.9%
Simplified89.6%
Taylor expanded in C around -inf 62.2%
if -1.19999999999999997e-222 < A < -1.89999999999999994e-247Initial program 68.9%
Taylor expanded in B around inf 67.9%
if 3.6e18 < A Initial program 85.6%
Taylor expanded in A around inf 82.6%
associate-*r/82.6%
*-commutative82.6%
Simplified82.6%
Final simplification59.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI)))
(t_1 (* 180.0 (/ (atan (/ (* C 2.0) B)) PI))))
(if (<= B -7e-60)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -7.8e-203)
t_0
(if (<= B 6.9e-274)
t_1
(if (<= B 8.2e-218)
t_0
(if (<= B 4.1e+15) t_1 (* 180.0 (/ (atan -1.0) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double t_1 = 180.0 * (atan(((C * 2.0) / B)) / ((double) M_PI));
double tmp;
if (B <= -7e-60) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -7.8e-203) {
tmp = t_0;
} else if (B <= 6.9e-274) {
tmp = t_1;
} else if (B <= 8.2e-218) {
tmp = t_0;
} else if (B <= 4.1e+15) {
tmp = t_1;
} 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.5 * (B / A))) / Math.PI);
double t_1 = 180.0 * (Math.atan(((C * 2.0) / B)) / Math.PI);
double tmp;
if (B <= -7e-60) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -7.8e-203) {
tmp = t_0;
} else if (B <= 6.9e-274) {
tmp = t_1;
} else if (B <= 8.2e-218) {
tmp = t_0;
} else if (B <= 4.1e+15) {
tmp = t_1;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) t_1 = 180.0 * (math.atan(((C * 2.0) / B)) / math.pi) tmp = 0 if B <= -7e-60: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -7.8e-203: tmp = t_0 elif B <= 6.9e-274: tmp = t_1 elif B <= 8.2e-218: tmp = t_0 elif B <= 4.1e+15: tmp = t_1 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(Float64(C * 2.0) / B)) / pi)) tmp = 0.0 if (B <= -7e-60) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -7.8e-203) tmp = t_0; elseif (B <= 6.9e-274) tmp = t_1; elseif (B <= 8.2e-218) tmp = t_0; elseif (B <= 4.1e+15) tmp = t_1; 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.5 * (B / A))) / pi); t_1 = 180.0 * (atan(((C * 2.0) / B)) / pi); tmp = 0.0; if (B <= -7e-60) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -7.8e-203) tmp = t_0; elseif (B <= 6.9e-274) tmp = t_1; elseif (B <= 8.2e-218) tmp = t_0; elseif (B <= 4.1e+15) tmp = t_1; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(N[(C * 2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -7e-60], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -7.8e-203], t$95$0, If[LessEqual[B, 6.9e-274], t$95$1, If[LessEqual[B, 8.2e-218], t$95$0, If[LessEqual[B, 4.1e+15], t$95$1, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C \cdot 2}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -7 \cdot 10^{-60}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -7.8 \cdot 10^{-203}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 6.9 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq 8.2 \cdot 10^{-218}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -6.99999999999999952e-60Initial program 49.3%
Taylor expanded in B around -inf 61.7%
if -6.99999999999999952e-60 < B < -7.7999999999999998e-203 or 6.89999999999999963e-274 < B < 8.1999999999999995e-218Initial program 47.0%
Taylor expanded in A around -inf 41.4%
if -7.7999999999999998e-203 < B < 6.89999999999999963e-274 or 8.1999999999999995e-218 < B < 4.1e15Initial program 66.2%
Simplified71.5%
Taylor expanded in C around -inf 40.9%
if 4.1e15 < B Initial program 54.6%
Taylor expanded in B around inf 62.0%
Final simplification51.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI)))
(t_1 (* 180.0 (/ (atan (/ C B)) PI))))
(if (<= B -1.1e-59)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -2e-193)
t_0
(if (<= B 2.7e-274)
t_1
(if (<= B 4e-218)
t_0
(if (<= B 5.4e+22) t_1 (* 180.0 (/ (atan -1.0) PI)))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double t_1 = 180.0 * (atan((C / B)) / ((double) M_PI));
double tmp;
if (B <= -1.1e-59) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -2e-193) {
tmp = t_0;
} else if (B <= 2.7e-274) {
tmp = t_1;
} else if (B <= 4e-218) {
tmp = t_0;
} else if (B <= 5.4e+22) {
tmp = t_1;
} 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.5 * (B / A))) / Math.PI);
double t_1 = 180.0 * (Math.atan((C / B)) / Math.PI);
double tmp;
if (B <= -1.1e-59) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -2e-193) {
tmp = t_0;
} else if (B <= 2.7e-274) {
tmp = t_1;
} else if (B <= 4e-218) {
tmp = t_0;
} else if (B <= 5.4e+22) {
tmp = t_1;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) t_1 = 180.0 * (math.atan((C / B)) / math.pi) tmp = 0 if B <= -1.1e-59: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -2e-193: tmp = t_0 elif B <= 2.7e-274: tmp = t_1 elif B <= 4e-218: tmp = t_0 elif B <= 5.4e+22: tmp = t_1 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)) tmp = 0.0 if (B <= -1.1e-59) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -2e-193) tmp = t_0; elseif (B <= 2.7e-274) tmp = t_1; elseif (B <= 4e-218) tmp = t_0; elseif (B <= 5.4e+22) tmp = t_1; 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.5 * (B / A))) / pi); t_1 = 180.0 * (atan((C / B)) / pi); tmp = 0.0; if (B <= -1.1e-59) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -2e-193) tmp = t_0; elseif (B <= 2.7e-274) tmp = t_1; elseif (B <= 4e-218) tmp = t_0; elseif (B <= 5.4e+22) tmp = t_1; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $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, -1.1e-59], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2e-193], t$95$0, If[LessEqual[B, 2.7e-274], t$95$1, If[LessEqual[B, 4e-218], t$95$0, If[LessEqual[B, 5.4e+22], t$95$1, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -1.1 \cdot 10^{-59}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -2 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 2.7 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq 4 \cdot 10^{-218}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 5.4 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.0999999999999999e-59Initial program 49.3%
Taylor expanded in B around -inf 61.7%
if -1.0999999999999999e-59 < B < -2.0000000000000001e-193 or 2.7e-274 < B < 4.0000000000000001e-218Initial program 47.0%
Taylor expanded in A around -inf 41.4%
if -2.0000000000000001e-193 < B < 2.7e-274 or 4.0000000000000001e-218 < B < 5.4000000000000004e22Initial program 66.2%
Simplified71.5%
Taylor expanded in C around 0 60.9%
+-commutative60.9%
unpow260.9%
unpow260.9%
hypot-define60.9%
Simplified60.9%
Taylor expanded in C around inf 40.8%
if 5.4000000000000004e22 < B Initial program 54.6%
Taylor expanded in B around inf 62.0%
Final simplification51.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (+ C B) B)) PI)))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= A -9e+149)
t_1
(if (<= A -9.5e+41)
t_0
(if (<= A -7.5e-43)
t_1
(if (<= A 8.8e-49)
t_0
(* 180.0 (/ (atan (/ -1.0 (/ B (+ A B)))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((C + B) / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (A <= -9e+149) {
tmp = t_1;
} else if (A <= -9.5e+41) {
tmp = t_0;
} else if (A <= -7.5e-43) {
tmp = t_1;
} else if (A <= 8.8e-49) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-1.0 / (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 + B) / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (A <= -9e+149) {
tmp = t_1;
} else if (A <= -9.5e+41) {
tmp = t_0;
} else if (A <= -7.5e-43) {
tmp = t_1;
} else if (A <= 8.8e-49) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-1.0 / (B / (A + B)))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((C + B) / B)) / math.pi) t_1 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if A <= -9e+149: tmp = t_1 elif A <= -9.5e+41: tmp = t_0 elif A <= -7.5e-43: tmp = t_1 elif A <= 8.8e-49: tmp = t_0 else: tmp = 180.0 * (math.atan((-1.0 / (B / (A + B)))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C + B) / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (A <= -9e+149) tmp = t_1; elseif (A <= -9.5e+41) tmp = t_0; elseif (A <= -7.5e-43) tmp = t_1; elseif (A <= 8.8e-49) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(B / Float64(A + B)))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((C + B) / B)) / pi); t_1 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (A <= -9e+149) tmp = t_1; elseif (A <= -9.5e+41) tmp = t_0; elseif (A <= -7.5e-43) tmp = t_1; elseif (A <= 8.8e-49) tmp = t_0; else tmp = 180.0 * (atan((-1.0 / (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 + B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -9e+149], t$95$1, If[LessEqual[A, -9.5e+41], t$95$0, If[LessEqual[A, -7.5e-43], t$95$1, If[LessEqual[A, 8.8e-49], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(B / N[(A + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C + B}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -9 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -9.5 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -7.5 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq 8.8 \cdot 10^{-49}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{B}{A + B}}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.99999999999999965e149 or -9.4999999999999996e41 < A < -7.50000000000000068e-43Initial program 16.5%
Taylor expanded in A around -inf 66.0%
if -8.99999999999999965e149 < A < -9.4999999999999996e41 or -7.50000000000000068e-43 < A < 8.79999999999999959e-49Initial program 55.8%
Simplified77.2%
Taylor expanded in C around 0 51.8%
+-commutative51.8%
unpow251.8%
unpow251.8%
hypot-define72.6%
Simplified72.6%
Taylor expanded in B around -inf 58.1%
mul-1-neg58.1%
Simplified58.1%
if 8.79999999999999959e-49 < A Initial program 81.7%
associate--l-81.7%
+-commutative81.7%
unpow281.7%
unpow281.7%
hypot-undefine97.5%
associate-/r/97.5%
frac-2neg97.5%
metadata-eval97.5%
associate--r+97.5%
hypot-undefine81.7%
unpow281.7%
unpow281.7%
+-commutative81.7%
unpow281.7%
unpow281.7%
hypot-define97.5%
Applied egg-rr97.5%
Simplified95.1%
Taylor expanded in B around inf 82.4%
Final simplification67.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (/ (+ C B) B)) PI)))
(t_1 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
(if (<= A -9e+149)
t_1
(if (<= A -9e+41)
t_0
(if (<= A -7.5e-43)
t_1
(if (<= A 2.05e+114)
t_0
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((C + B) / B)) / ((double) M_PI));
double t_1 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
double tmp;
if (A <= -9e+149) {
tmp = t_1;
} else if (A <= -9e+41) {
tmp = t_0;
} else if (A <= -7.5e-43) {
tmp = t_1;
} else if (A <= 2.05e+114) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((C + B) / B)) / Math.PI);
double t_1 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
double tmp;
if (A <= -9e+149) {
tmp = t_1;
} else if (A <= -9e+41) {
tmp = t_0;
} else if (A <= -7.5e-43) {
tmp = t_1;
} else if (A <= 2.05e+114) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((C + B) / B)) / math.pi) t_1 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) tmp = 0 if A <= -9e+149: tmp = t_1 elif A <= -9e+41: tmp = t_0 elif A <= -7.5e-43: tmp = t_1 elif A <= 2.05e+114: tmp = t_0 else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C + B) / B)) / pi)) t_1 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)) tmp = 0.0 if (A <= -9e+149) tmp = t_1; elseif (A <= -9e+41) tmp = t_0; elseif (A <= -7.5e-43) tmp = t_1; elseif (A <= 2.05e+114) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((C + B) / B)) / pi); t_1 = 180.0 * (atan((0.5 * (B / A))) / pi); tmp = 0.0; if (A <= -9e+149) tmp = t_1; elseif (A <= -9e+41) tmp = t_0; elseif (A <= -7.5e-43) tmp = t_1; elseif (A <= 2.05e+114) tmp = t_0; else tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(C + B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -9e+149], t$95$1, If[LessEqual[A, -9e+41], t$95$0, If[LessEqual[A, -7.5e-43], t$95$1, If[LessEqual[A, 2.05e+114], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C + B}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -9 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq -9 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;A \leq -7.5 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;A \leq 2.05 \cdot 10^{+114}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -8.99999999999999965e149 or -9.0000000000000002e41 < A < -7.50000000000000068e-43Initial program 16.5%
Taylor expanded in A around -inf 66.0%
if -8.99999999999999965e149 < A < -9.0000000000000002e41 or -7.50000000000000068e-43 < A < 2.05e114Initial program 58.2%
Simplified81.0%
Taylor expanded in C around 0 54.8%
+-commutative54.8%
unpow254.8%
unpow254.8%
hypot-define76.4%
Simplified76.4%
Taylor expanded in B around -inf 57.4%
mul-1-neg57.4%
Simplified57.4%
if 2.05e114 < A Initial program 89.8%
Taylor expanded in A around inf 90.5%
associate-*r/90.5%
*-commutative90.5%
Simplified90.5%
Final simplification65.6%
(FPCore (A B C)
:precision binary64
(if (<= B -1.7e-147)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.4e-46)
(* 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 <= -1.7e-147) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.4e-46) {
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 <= -1.7e-147) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.4e-46) {
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 <= -1.7e-147: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.4e-46: 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 <= -1.7e-147) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.4e-46) 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 <= -1.7e-147) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.4e-46) 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, -1.7e-147], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.4e-46], 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 -1.7 \cdot 10^{-147}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.4 \cdot 10^{-46}:\\
\;\;\;\;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 < -1.69999999999999998e-147Initial program 50.7%
Taylor expanded in B around -inf 53.8%
if -1.69999999999999998e-147 < B < 1.3999999999999999e-46Initial program 57.8%
Taylor expanded in C around inf 31.6%
associate-*r/31.6%
mul-1-neg31.6%
distribute-rgt1-in31.6%
metadata-eval31.6%
mul0-lft31.6%
metadata-eval31.6%
Simplified31.6%
if 1.3999999999999999e-46 < B Initial program 58.4%
Taylor expanded in B around inf 56.1%
Final simplification46.3%
(FPCore (A B C)
:precision binary64
(if (<= B -1.75e-20)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2e+15)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -1.75e-20) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2e+15) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -1.75e-20) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2e+15) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -1.75e-20: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2e+15: tmp = 180.0 * (math.atan((C / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -1.75e-20) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2e+15) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -1.75e-20) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2e+15) tmp = 180.0 * (atan((C / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -1.75e-20], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2e+15], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.75 \cdot 10^{-20}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2 \cdot 10^{+15}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.75000000000000002e-20Initial program 46.0%
Taylor expanded in B around -inf 67.7%
if -1.75000000000000002e-20 < B < 2e15Initial program 59.7%
Simplified65.8%
Taylor expanded in C around 0 56.1%
+-commutative56.1%
unpow256.1%
unpow256.1%
hypot-define56.9%
Simplified56.9%
Taylor expanded in C around inf 33.6%
if 2e15 < B Initial program 54.6%
Taylor expanded in B around inf 62.0%
Final simplification48.4%
(FPCore (A B C) :precision binary64 (if (<= B 0.014) (* 180.0 (/ (atan (/ (- (+ C B) A) B)) PI)) (* 180.0 (/ (atan (/ -1.0 (/ B (+ A B)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 0.014) {
tmp = 180.0 * (atan((((C + B) - A) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 / (B / (A + B)))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 0.014) {
tmp = 180.0 * (Math.atan((((C + B) - A) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 / (B / (A + B)))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 0.014: tmp = 180.0 * (math.atan((((C + B) - A) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 / (B / (A + B)))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 0.014) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - A) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(B / Float64(A + B)))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 0.014) tmp = 180.0 * (atan((((C + B) - A) / B)) / pi); else tmp = 180.0 * (atan((-1.0 / (B / (A + B)))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 0.014], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(B / N[(A + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.014:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{B}{A + B}}\right)}{\pi}\\
\end{array}
\end{array}
if B < 0.0140000000000000003Initial program 55.1%
Simplified71.7%
Taylor expanded in B around -inf 63.7%
if 0.0140000000000000003 < B Initial program 54.5%
associate--l-54.5%
+-commutative54.5%
unpow254.5%
unpow254.5%
hypot-undefine83.8%
associate-/r/83.8%
frac-2neg83.8%
metadata-eval83.8%
associate--r+83.8%
hypot-undefine54.5%
unpow254.5%
unpow254.5%
+-commutative54.5%
unpow254.5%
unpow254.5%
hypot-define83.8%
Applied egg-rr83.8%
Simplified83.9%
Taylor expanded in B around inf 75.7%
Final simplification66.1%
(FPCore (A B C) :precision binary64 (if (<= B 1e-198) (* 180.0 (/ (atan (/ (- (+ C B) A) B)) PI)) (* 180.0 (/ (atan (/ (- (- C B) A) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1e-198) {
tmp = 180.0 * (atan((((C + B) - A) / 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 <= 1e-198) {
tmp = 180.0 * (Math.atan((((C + B) - A) / 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 <= 1e-198: tmp = 180.0 * (math.atan((((C + B) - A) / 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 <= 1e-198) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - A) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - B) - A) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 1e-198) tmp = 180.0 * (atan((((C + B) - A) / B)) / pi); else tmp = 180.0 * (atan((((C - B) - A) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 1e-198], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 10^{-198}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < 9.9999999999999991e-199Initial program 52.6%
Simplified70.7%
Taylor expanded in B around -inf 64.1%
if 9.9999999999999991e-199 < B Initial program 59.8%
Simplified81.1%
Taylor expanded in B around inf 75.6%
neg-mul-175.6%
unsub-neg75.6%
Simplified75.6%
Final simplification67.8%
(FPCore (A B C) :precision binary64 (if (<= B -7.5e-308) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -7.5e-308) {
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 <= -7.5e-308) {
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 <= -7.5e-308: 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 <= -7.5e-308) 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 <= -7.5e-308) 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, -7.5e-308], 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 -7.5 \cdot 10^{-308}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -7.4999999999999998e-308Initial program 52.6%
Taylor expanded in B around -inf 44.6%
if -7.4999999999999998e-308 < B Initial program 57.8%
Taylor expanded in B around inf 34.0%
Final simplification39.8%
(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 54.9%
Taylor expanded in B around inf 16.4%
Final simplification16.4%
herbie shell --seed 2024046
(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)))