
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(if (or (<= t_0 -0.5) (not (<= t_0 0.0)))
(* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))
(* (/ 180.0 PI) (atan (* B (/ 0.5 A)))))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double tmp;
if ((t_0 <= -0.5) || !(t_0 <= 0.0)) {
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan((B * (0.5 / A)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double tmp;
if ((t_0 <= -0.5) || !(t_0 <= 0.0)) {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan((B * (0.5 / A)));
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) tmp = 0 if (t_0 <= -0.5) or not (t_0 <= 0.0): tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi) else: tmp = (180.0 / math.pi) * math.atan((B * (0.5 / A))) return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) tmp = 0.0 if ((t_0 <= -0.5) || !(t_0 <= 0.0)) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(0.5 / A)))); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); tmp = 0.0; if ((t_0 <= -0.5) || ~((t_0 <= 0.0))) tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi); else tmp = (180.0 / pi) * atan((B * (0.5 / A))); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -0.5], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t\_0 \leq -0.5 \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\
\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)))))) < -0.5 or 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 56.0%
associate-*l/56.0%
*-lft-identity56.0%
+-commutative56.0%
unpow256.0%
unpow256.0%
hypot-define87.2%
Simplified87.2%
if -0.5 < (*.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 29.0%
Taylor expanded in A around -inf 70.4%
associate-*r/70.4%
Simplified70.4%
clear-num68.3%
inv-pow68.3%
*-commutative68.3%
Applied egg-rr68.3%
unpow-168.3%
associate-/l*68.2%
Simplified68.2%
Taylor expanded in B around 0 70.4%
associate-*r/70.4%
associate-*r/70.4%
*-commutative70.4%
associate-*r/70.5%
associate-*l/70.7%
Simplified70.7%
Final simplification85.1%
(FPCore (A B C)
:precision binary64
(if (<= C -1.1e-54)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) PI))
(if (<= C 6.4e+128)
(* 180.0 (/ (atan (/ (+ A (hypot A B)) (- B))) PI))
(* (/ 180.0 PI) (atan (* B (/ -0.5 C)))))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1.1e-54) {
tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / ((double) M_PI));
} else if (C <= 6.4e+128) {
tmp = 180.0 * (atan(((A + hypot(A, B)) / -B)) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan((B * (-0.5 / C)));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -1.1e-54) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(C, B)) / B)) / Math.PI);
} else if (C <= 6.4e+128) {
tmp = 180.0 * (Math.atan(((A + Math.hypot(A, B)) / -B)) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan((B * (-0.5 / C)));
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -1.1e-54: tmp = 180.0 * (math.atan(((C - math.hypot(C, B)) / B)) / math.pi) elif C <= 6.4e+128: tmp = 180.0 * (math.atan(((A + math.hypot(A, B)) / -B)) / math.pi) else: tmp = (180.0 / math.pi) * math.atan((B * (-0.5 / C))) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -1.1e-54) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(C, B)) / B)) / pi)); elseif (C <= 6.4e+128) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(A, B)) / Float64(-B))) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(-0.5 / C)))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -1.1e-54) tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / pi); elseif (C <= 6.4e+128) tmp = 180.0 * (atan(((A + hypot(A, B)) / -B)) / pi); else tmp = (180.0 / pi) * atan((B * (-0.5 / C))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1.1e-54], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.4e+128], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.1 \cdot 10^{-54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 6.4 \cdot 10^{+128}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\
\end{array}
\end{array}
if C < -1.1e-54Initial program 77.0%
Taylor expanded in A around 0 75.7%
+-commutative75.7%
unpow275.7%
unpow275.7%
hypot-define90.6%
Simplified90.6%
if -1.1e-54 < C < 6.39999999999999971e128Initial program 47.3%
Taylor expanded in C around 0 44.1%
associate-*r/44.1%
mul-1-neg44.1%
unpow244.1%
unpow244.1%
hypot-define75.3%
Simplified75.3%
if 6.39999999999999971e128 < C Initial program 15.9%
*-commutative15.9%
associate--l-15.9%
+-commutative15.9%
unpow215.9%
unpow215.9%
hypot-undefine56.5%
div-inv56.5%
clear-num56.5%
un-div-inv56.5%
Applied egg-rr56.7%
Taylor expanded in A around 0 15.9%
+-commutative15.9%
unpow215.9%
unpow215.9%
hypot-undefine51.7%
Simplified51.7%
Taylor expanded in C around inf 78.4%
Taylor expanded in B around 0 79.3%
associate-*r/79.5%
associate-*l/79.5%
*-commutative79.5%
associate-*r/79.5%
*-commutative79.5%
associate-/l*79.5%
Simplified79.5%
Final simplification81.0%
(FPCore (A B C)
:precision binary64
(if (<= A -3.5e+53)
(* (/ 180.0 PI) (atan (* B (/ 0.5 A))))
(if (<= A 3.6e+99)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.5e+53) {
tmp = (180.0 / ((double) M_PI)) * atan((B * (0.5 / A)));
} else if (A <= 3.6e+99) {
tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.5e+53) {
tmp = (180.0 / Math.PI) * Math.atan((B * (0.5 / A)));
} else if (A <= 3.6e+99) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(C, B)) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.5e+53: tmp = (180.0 / math.pi) * math.atan((B * (0.5 / A))) elif A <= 3.6e+99: tmp = 180.0 * (math.atan(((C - math.hypot(C, B)) / B)) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.5e+53) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(0.5 / A)))); elseif (A <= 3.6e+99) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(C, B)) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.5e+53) tmp = (180.0 / pi) * atan((B * (0.5 / A))); elseif (A <= 3.6e+99) tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.5e+53], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.6e+99], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.5 \cdot 10^{+53}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\
\mathbf{elif}\;A \leq 3.6 \cdot 10^{+99}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.50000000000000019e53Initial program 27.4%
Taylor expanded in A around -inf 71.9%
associate-*r/71.9%
Simplified71.9%
clear-num71.9%
inv-pow71.9%
*-commutative71.9%
Applied egg-rr71.9%
unpow-171.9%
associate-/l*71.8%
Simplified71.8%
Taylor expanded in B around 0 71.9%
associate-*r/71.9%
associate-*r/71.9%
*-commutative71.9%
associate-*r/71.9%
associate-*l/72.1%
Simplified72.1%
if -3.50000000000000019e53 < A < 3.6000000000000002e99Initial program 56.4%
Taylor expanded in A around 0 54.0%
+-commutative54.0%
unpow254.0%
unpow254.0%
hypot-define80.3%
Simplified80.3%
if 3.6000000000000002e99 < A Initial program 70.2%
Taylor expanded in C around 0 70.2%
associate-*r/70.2%
mul-1-neg70.2%
unpow270.2%
unpow270.2%
hypot-define90.4%
Simplified90.4%
Taylor expanded in A around 0 81.8%
+-commutative81.8%
Simplified81.8%
Taylor expanded in B around 0 81.8%
associate-*r/81.8%
distribute-lft-out81.8%
+-commutative81.8%
mul-1-neg81.8%
sub-neg81.8%
div-sub81.8%
associate-/l*81.8%
*-inverses81.8%
metadata-eval81.8%
Simplified81.8%
(FPCore (A B C) :precision binary64 (if (<= A -4.8e+39) (* (/ 180.0 PI) (atan (* B (/ 0.5 A)))) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.8e+39) {
tmp = (180.0 / ((double) M_PI)) * atan((B * (0.5 / A)));
} 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.8e+39) {
tmp = (180.0 / Math.PI) * Math.atan((B * (0.5 / A)));
} 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.8e+39: tmp = (180.0 / math.pi) * math.atan((B * (0.5 / A))) 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.8e+39) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(0.5 / A)))); 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.8e+39) tmp = (180.0 / pi) * atan((B * (0.5 / A))); 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.8e+39], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $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.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\
\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.8000000000000002e39Initial program 28.5%
Taylor expanded in A around -inf 71.4%
associate-*r/71.4%
Simplified71.4%
clear-num70.3%
inv-pow70.3%
*-commutative70.3%
Applied egg-rr70.3%
unpow-170.3%
associate-/l*70.2%
Simplified70.2%
Taylor expanded in B around 0 71.4%
associate-*r/71.4%
associate-*r/71.4%
*-commutative71.4%
associate-*r/71.4%
associate-*l/71.6%
Simplified71.6%
if -4.8000000000000002e39 < A Initial program 59.8%
Simplified86.2%
(FPCore (A B C)
:precision binary64
(if (<= B -1.32e+17)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B -5.9e-189)
(* 180.0 (/ (atan (/ A (- B))) PI))
(if (<= B 1.3e-5)
(* 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.32e+17) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= -5.9e-189) {
tmp = 180.0 * (atan((A / -B)) / ((double) M_PI));
} else if (B <= 1.3e-5) {
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.32e+17) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= -5.9e-189) {
tmp = 180.0 * (Math.atan((A / -B)) / Math.PI);
} else if (B <= 1.3e-5) {
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.32e+17: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= -5.9e-189: tmp = 180.0 * (math.atan((A / -B)) / math.pi) elif B <= 1.3e-5: 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.32e+17) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= -5.9e-189) tmp = Float64(180.0 * Float64(atan(Float64(A / Float64(-B))) / pi)); elseif (B <= 1.3e-5) 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.32e+17) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= -5.9e-189) tmp = 180.0 * (atan((A / -B)) / pi); elseif (B <= 1.3e-5) 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.32e+17], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -5.9e-189], N[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.3e-5], 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.32 \cdot 10^{+17}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq -5.9 \cdot 10^{-189}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.3 \cdot 10^{-5}:\\
\;\;\;\;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.32e17Initial program 36.0%
Taylor expanded in B around -inf 67.5%
if -1.32e17 < B < -5.9e-189Initial program 60.9%
Taylor expanded in B around -inf 56.3%
associate--l+56.3%
div-sub58.7%
Simplified58.7%
Taylor expanded in A around inf 41.1%
associate-*r/41.1%
mul-1-neg41.1%
Simplified41.1%
if -5.9e-189 < B < 1.29999999999999992e-5Initial program 60.4%
Taylor expanded in B around -inf 47.1%
associate--l+47.1%
div-sub49.3%
Simplified49.3%
Taylor expanded in C around inf 41.2%
if 1.29999999999999992e-5 < B Initial program 49.0%
Taylor expanded in B around inf 70.0%
Final simplification53.9%
(FPCore (A B C)
:precision binary64
(if (<= A -1.2e-44)
(* (/ 180.0 PI) (atan (* B (/ 0.5 A))))
(if (<= A 2.9e-126)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.2e-44) {
tmp = (180.0 / ((double) M_PI)) * atan((B * (0.5 / A)));
} else if (A <= 2.9e-126) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.2e-44) {
tmp = (180.0 / Math.PI) * Math.atan((B * (0.5 / A)));
} else if (A <= 2.9e-126) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.2e-44: tmp = (180.0 / math.pi) * math.atan((B * (0.5 / A))) elif A <= 2.9e-126: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.2e-44) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(0.5 / A)))); elseif (A <= 2.9e-126) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.2e-44) tmp = (180.0 / pi) * atan((B * (0.5 / A))); elseif (A <= 2.9e-126) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.2e-44], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.9e-126], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.2 \cdot 10^{-44}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\
\mathbf{elif}\;A \leq 2.9 \cdot 10^{-126}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.20000000000000004e-44Initial program 27.6%
Taylor expanded in A around -inf 63.9%
associate-*r/63.9%
Simplified63.9%
clear-num63.0%
inv-pow63.0%
*-commutative63.0%
Applied egg-rr63.0%
unpow-163.0%
associate-/l*62.9%
Simplified62.9%
Taylor expanded in B around 0 63.9%
associate-*r/63.9%
associate-*r/63.9%
*-commutative63.9%
associate-*r/64.0%
associate-*l/64.1%
Simplified64.1%
if -1.20000000000000004e-44 < A < 2.89999999999999988e-126Initial program 58.9%
Taylor expanded in B around -inf 55.2%
associate--l+55.2%
div-sub55.2%
Simplified55.2%
Taylor expanded in A around 0 55.3%
if 2.89999999999999988e-126 < A Initial program 65.7%
Taylor expanded in C around 0 64.9%
associate-*r/64.9%
mul-1-neg64.9%
unpow264.9%
unpow264.9%
hypot-define85.8%
Simplified85.8%
Taylor expanded in A around 0 71.4%
+-commutative71.4%
Simplified71.4%
Taylor expanded in B around 0 71.4%
associate-*r/71.4%
distribute-lft-out71.4%
+-commutative71.4%
mul-1-neg71.4%
sub-neg71.4%
div-sub71.4%
associate-/l*71.4%
*-inverses71.4%
metadata-eval71.4%
Simplified71.4%
(FPCore (A B C)
:precision binary64
(if (<= A -3.4e-44)
(* 180.0 (/ (atan (* B (/ 0.5 A))) PI))
(if (<= A 7.2e-127)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.4e-44) {
tmp = 180.0 * (atan((B * (0.5 / A))) / ((double) M_PI));
} else if (A <= 7.2e-127) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.4e-44) {
tmp = 180.0 * (Math.atan((B * (0.5 / A))) / Math.PI);
} else if (A <= 7.2e-127) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.4e-44: tmp = 180.0 * (math.atan((B * (0.5 / A))) / math.pi) elif A <= 7.2e-127: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.4e-44) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / A))) / pi)); elseif (A <= 7.2e-127) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.4e-44) tmp = 180.0 * (atan((B * (0.5 / A))) / pi); elseif (A <= 7.2e-127) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.4e-44], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7.2e-127], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.4 \cdot 10^{-44}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 7.2 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -3.40000000000000016e-44Initial program 27.6%
Taylor expanded in A around -inf 63.9%
associate-*r/63.9%
Simplified63.9%
Taylor expanded in B around 0 63.9%
associate-*r/63.9%
*-commutative63.9%
associate-/l*63.9%
Simplified63.9%
if -3.40000000000000016e-44 < A < 7.1999999999999999e-127Initial program 58.9%
Taylor expanded in B around -inf 55.2%
associate--l+55.2%
div-sub55.2%
Simplified55.2%
Taylor expanded in A around 0 55.3%
if 7.1999999999999999e-127 < A Initial program 65.7%
Taylor expanded in C around 0 64.9%
associate-*r/64.9%
mul-1-neg64.9%
unpow264.9%
unpow264.9%
hypot-define85.8%
Simplified85.8%
Taylor expanded in A around 0 71.4%
+-commutative71.4%
Simplified71.4%
Taylor expanded in B around 0 71.4%
associate-*r/71.4%
distribute-lft-out71.4%
+-commutative71.4%
mul-1-neg71.4%
sub-neg71.4%
div-sub71.4%
associate-/l*71.4%
*-inverses71.4%
metadata-eval71.4%
Simplified71.4%
(FPCore (A B C)
:precision binary64
(if (<= A -9.5e-44)
(* 180.0 (/ (atan (* B (/ 0.5 A))) PI))
(if (<= A 6.2e+61)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(* 180.0 (/ (atan (/ A (- B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -9.5e-44) {
tmp = 180.0 * (atan((B * (0.5 / A))) / ((double) M_PI));
} else if (A <= 6.2e+61) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((A / -B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -9.5e-44) {
tmp = 180.0 * (Math.atan((B * (0.5 / A))) / Math.PI);
} else if (A <= 6.2e+61) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((A / -B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -9.5e-44: tmp = 180.0 * (math.atan((B * (0.5 / A))) / math.pi) elif A <= 6.2e+61: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) else: tmp = 180.0 * (math.atan((A / -B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -9.5e-44) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / A))) / pi)); elseif (A <= 6.2e+61) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(A / Float64(-B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -9.5e-44) tmp = 180.0 * (atan((B * (0.5 / A))) / pi); elseif (A <= 6.2e+61) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan((A / -B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -9.5e-44], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 6.2e+61], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -9.5 \cdot 10^{-44}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 6.2 \cdot 10^{+61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -9.49999999999999924e-44Initial program 27.6%
Taylor expanded in A around -inf 63.9%
associate-*r/63.9%
Simplified63.9%
Taylor expanded in B around 0 63.9%
associate-*r/63.9%
*-commutative63.9%
associate-/l*63.9%
Simplified63.9%
if -9.49999999999999924e-44 < A < 6.1999999999999998e61Initial program 59.6%
Taylor expanded in B around -inf 55.7%
associate--l+55.7%
div-sub55.7%
Simplified55.7%
Taylor expanded in A around 0 54.2%
if 6.1999999999999998e61 < A Initial program 68.7%
Taylor expanded in B around -inf 66.5%
associate--l+66.5%
div-sub68.3%
Simplified68.3%
Taylor expanded in A around inf 62.8%
associate-*r/62.8%
mul-1-neg62.8%
Simplified62.8%
Final simplification59.0%
(FPCore (A B C)
:precision binary64
(if (<= C -8.5e-57)
(* 180.0 (/ (atan (/ C B)) PI))
(if (<= C 8.2e-113)
(* 180.0 (/ (atan (* B (/ 0.5 A))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -8.5e-57) {
tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
} else if (C <= 8.2e-113) {
tmp = 180.0 * (atan((B * (0.5 / A))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -8.5e-57) {
tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
} else if (C <= 8.2e-113) {
tmp = 180.0 * (Math.atan((B * (0.5 / A))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -8.5e-57: tmp = 180.0 * (math.atan((C / B)) / math.pi) elif C <= 8.2e-113: tmp = 180.0 * (math.atan((B * (0.5 / A))) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -8.5e-57) tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi)); elseif (C <= 8.2e-113) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / A))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -8.5e-57) tmp = 180.0 * (atan((C / B)) / pi); elseif (C <= 8.2e-113) tmp = 180.0 * (atan((B * (0.5 / A))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -8.5e-57], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 8.2e-113], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -8.5 \cdot 10^{-57}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 8.2 \cdot 10^{-113}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -8.49999999999999955e-57Initial program 77.7%
Taylor expanded in B around -inf 74.2%
associate--l+74.2%
div-sub76.6%
Simplified76.6%
Taylor expanded in C around inf 66.7%
if -8.49999999999999955e-57 < C < 8.1999999999999999e-113Initial program 48.3%
Taylor expanded in A around -inf 39.5%
associate-*r/39.5%
Simplified39.5%
Taylor expanded in B around 0 39.5%
associate-*r/39.5%
*-commutative39.5%
associate-/l*39.5%
Simplified39.5%
if 8.1999999999999999e-113 < C Initial program 28.1%
Taylor expanded in A around 0 24.7%
+-commutative24.7%
unpow224.7%
unpow224.7%
hypot-define57.4%
Simplified57.4%
Taylor expanded in C around inf 58.9%
(FPCore (A B C)
:precision binary64
(if (<= B -1.3e+18)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.95e-5)
(* 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.3e+18) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.95e-5) {
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.3e+18) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.95e-5) {
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.3e+18: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.95e-5: 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.3e+18) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.95e-5) 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.3e+18) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.95e-5) 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.3e+18], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.95e-5], 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.3 \cdot 10^{+18}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.95 \cdot 10^{-5}:\\
\;\;\;\;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.3e18Initial program 36.0%
Taylor expanded in B around -inf 67.5%
if -1.3e18 < B < 2.9499999999999999e-5Initial program 60.5%
Taylor expanded in B around -inf 50.0%
associate--l+50.0%
div-sub52.3%
Simplified52.3%
Taylor expanded in C around inf 37.7%
if 2.9499999999999999e-5 < B Initial program 49.0%
Taylor expanded in B around inf 70.0%
(FPCore (A B C)
:precision binary64
(if (<= B -4.8e-153)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.65e-75)
(* 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 <= -4.8e-153) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.65e-75) {
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 <= -4.8e-153) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.65e-75) {
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 <= -4.8e-153: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.65e-75: 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 <= -4.8e-153) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.65e-75) 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 <= -4.8e-153) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.65e-75) 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, -4.8e-153], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.65e-75], 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 -4.8 \cdot 10^{-153}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.65 \cdot 10^{-75}:\\
\;\;\;\;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 < -4.8000000000000004e-153Initial program 47.3%
Taylor expanded in B around -inf 48.7%
if -4.8000000000000004e-153 < B < 1.65e-75Initial program 57.6%
Taylor expanded in C around inf 34.1%
associate-*r/34.1%
mul-1-neg34.1%
distribute-rgt1-in34.1%
metadata-eval34.1%
mul0-lft34.1%
metadata-eval34.1%
Simplified34.1%
if 1.65e-75 < B Initial program 52.7%
Taylor expanded in B around inf 62.7%
(FPCore (A B C) :precision binary64 (if (<= B -5e-155) (* 180.0 (/ (atan (/ (- (+ B C) A) B)) PI)) (/ 180.0 (/ PI (atan (+ -1.0 (/ (- C A) B)))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5e-155) {
tmp = 180.0 * (atan((((B + C) - A) / B)) / ((double) M_PI));
} else {
tmp = 180.0 / (((double) M_PI) / atan((-1.0 + ((C - A) / B))));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -5e-155) {
tmp = 180.0 * (Math.atan((((B + C) - A) / B)) / Math.PI);
} else {
tmp = 180.0 / (Math.PI / Math.atan((-1.0 + ((C - A) / B))));
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -5e-155: tmp = 180.0 * (math.atan((((B + C) - A) / B)) / math.pi) else: tmp = 180.0 / (math.pi / math.atan((-1.0 + ((C - A) / B)))) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -5e-155) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(B + C) - A) / B)) / pi)); else tmp = Float64(180.0 / Float64(pi / atan(Float64(-1.0 + Float64(Float64(C - A) / B))))); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -5e-155) tmp = 180.0 * (atan((((B + C) - A) / B)) / pi); else tmp = 180.0 / (pi / atan((-1.0 + ((C - A) / B)))); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -5e-155], N[(180.0 * N[(N[ArcTan[N[(N[(N[(B + C), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(-1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5 \cdot 10^{-155}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(-1 + \frac{C - A}{B}\right)}}\\
\end{array}
\end{array}
if B < -4.9999999999999999e-155Initial program 47.3%
Taylor expanded in B around -inf 70.9%
associate--l+70.9%
div-sub72.0%
Simplified72.0%
Taylor expanded in B around 0 72.0%
+-commutative72.0%
Simplified72.0%
if -4.9999999999999999e-155 < B Initial program 55.4%
*-commutative55.4%
associate--l-52.1%
+-commutative52.1%
unpow252.1%
unpow252.1%
hypot-undefine72.6%
div-inv72.6%
clear-num72.6%
un-div-inv72.6%
Applied egg-rr81.2%
Taylor expanded in B around inf 61.9%
+-commutative61.9%
associate--r+61.9%
div-sub63.2%
sub-neg63.2%
metadata-eval63.2%
Simplified63.2%
Final simplification66.3%
(FPCore (A B C) :precision binary64 (if (<= B 9e-58) (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)) (* 180.0 (/ (atan (/ (- C B) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 9e-58) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 9e-58) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 9e-58: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) else: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= 9e-58) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 9e-58) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); else tmp = 180.0 * (atan(((C - B) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 9e-58], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9 \cdot 10^{-58}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < 9.0000000000000006e-58Initial program 52.9%
Taylor expanded in B around -inf 58.2%
associate--l+58.2%
div-sub59.9%
Simplified59.9%
if 9.0000000000000006e-58 < B Initial program 51.3%
Taylor expanded in A around 0 50.1%
+-commutative50.1%
unpow250.1%
unpow250.1%
hypot-define80.8%
Simplified80.8%
Taylor expanded in C around 0 79.2%
(FPCore (A B C) :precision binary64 (if (<= B -5.4e-307) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5.4e-307) {
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 <= -5.4e-307) {
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 <= -5.4e-307: 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 <= -5.4e-307) 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 <= -5.4e-307) 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, -5.4e-307], 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 -5.4 \cdot 10^{-307}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -5.39999999999999971e-307Initial program 49.3%
Taylor expanded in B around -inf 39.2%
if -5.39999999999999971e-307 < B Initial program 55.3%
Taylor expanded in B around inf 40.3%
(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 52.5%
Taylor expanded in B around inf 22.1%
herbie shell --seed 2024172
(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)))