
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C) :precision binary64 (if (<= A -1.3e+192) (/ 1.0 (/ PI (* 180.0 (atan (/ (* 0.5 (+ B (* B (/ C A)))) A))))) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.3e+192) {
tmp = 1.0 / (((double) M_PI) / (180.0 * atan(((0.5 * (B + (B * (C / A)))) / 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 <= -1.3e+192) {
tmp = 1.0 / (Math.PI / (180.0 * Math.atan(((0.5 * (B + (B * (C / A)))) / 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 <= -1.3e+192: tmp = 1.0 / (math.pi / (180.0 * math.atan(((0.5 * (B + (B * (C / A)))) / 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 <= -1.3e+192) tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(Float64(0.5 * Float64(B + Float64(B * Float64(C / A)))) / A))))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.3e+192) tmp = 1.0 / (pi / (180.0 * atan(((0.5 * (B + (B * (C / A)))) / 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, -1.3e+192], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(N[(0.5 * N[(B + N[(B * N[(C / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.3 \cdot 10^{+192}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot \left(B + B \cdot \frac{C}{A}\right)}{A}\right)}}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.30000000000000002e192Initial program 8.9%
associate-*r/8.9%
Applied egg-rr49.6%
Taylor expanded in A around -inf 69.0%
associate-*r/69.0%
distribute-lft-out69.0%
associate-*r*69.0%
metadata-eval69.0%
associate-/l*83.5%
Simplified83.5%
if -1.30000000000000002e192 < A Initial program 58.1%
associate-*l/58.2%
*-lft-identity58.2%
+-commutative58.2%
unpow258.2%
unpow258.2%
hypot-define83.5%
Simplified83.5%
(FPCore (A B C)
:precision binary64
(if (<= C -9e-42)
(* 180.0 (/ (atan (/ (- C (hypot C B)) B)) PI))
(if (<= C 8.6e+156)
(* 180.0 (/ (atan (/ (+ A (hypot A B)) (- B))) PI))
(/ (* 180.0 (atan (* B (/ -0.5 C)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -9e-42) {
tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / ((double) M_PI));
} else if (C <= 8.6e+156) {
tmp = 180.0 * (atan(((A + hypot(A, B)) / -B)) / ((double) M_PI));
} else {
tmp = (180.0 * atan((B * (-0.5 / C)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -9e-42) {
tmp = 180.0 * (Math.atan(((C - Math.hypot(C, B)) / B)) / Math.PI);
} else if (C <= 8.6e+156) {
tmp = 180.0 * (Math.atan(((A + Math.hypot(A, B)) / -B)) / Math.PI);
} else {
tmp = (180.0 * Math.atan((B * (-0.5 / C)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -9e-42: tmp = 180.0 * (math.atan(((C - math.hypot(C, B)) / B)) / math.pi) elif C <= 8.6e+156: tmp = 180.0 * (math.atan(((A + math.hypot(A, B)) / -B)) / math.pi) else: tmp = (180.0 * math.atan((B * (-0.5 / C)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= -9e-42) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(C, B)) / B)) / pi)); elseif (C <= 8.6e+156) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(A, B)) / Float64(-B))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(B * Float64(-0.5 / C)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -9e-42) tmp = 180.0 * (atan(((C - hypot(C, B)) / B)) / pi); elseif (C <= 8.6e+156) tmp = 180.0 * (atan(((A + hypot(A, B)) / -B)) / pi); else tmp = (180.0 * atan((B * (-0.5 / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -9e-42], 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, 8.6e+156], 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 * N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -9 \cdot 10^{-42}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 8.6 \cdot 10^{+156}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -9e-42Initial program 64.1%
Taylor expanded in A around 0 63.2%
+-commutative63.2%
unpow263.2%
unpow263.2%
hypot-define79.6%
Simplified79.6%
if -9e-42 < C < 8.5999999999999997e156Initial program 60.1%
Taylor expanded in C around 0 59.1%
associate-*r/59.1%
mul-1-neg59.1%
unpow259.1%
unpow259.1%
hypot-define82.3%
Simplified82.3%
if 8.5999999999999997e156 < C Initial program 9.4%
associate-*r/9.4%
Applied egg-rr60.8%
Taylor expanded in C around inf 66.0%
distribute-rgt1-in66.0%
metadata-eval66.0%
Simplified66.0%
Taylor expanded in B around 0 82.2%
associate-*r/82.2%
*-commutative82.2%
associate-/l*82.2%
Simplified82.2%
Final simplification81.5%
(FPCore (A B C)
:precision binary64
(if (<= A -1.18e+95)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(if (<= A 5.7e+51)
(* 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 <= -1.18e+95) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else if (A <= 5.7e+51) {
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 <= -1.18e+95) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else if (A <= 5.7e+51) {
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 <= -1.18e+95: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) elif A <= 5.7e+51: 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 <= -1.18e+95) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); elseif (A <= 5.7e+51) 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 <= -1.18e+95) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); elseif (A <= 5.7e+51) 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, -1.18e+95], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.7e+51], 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 -1.18 \cdot 10^{+95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 5.7 \cdot 10^{+51}:\\
\;\;\;\;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 < -1.17999999999999998e95Initial program 17.0%
Taylor expanded in A around -inf 73.4%
associate-*r/73.4%
Simplified73.4%
if -1.17999999999999998e95 < A < 5.7000000000000002e51Initial program 56.2%
Taylor expanded in A around 0 50.9%
+-commutative50.9%
unpow250.9%
unpow250.9%
hypot-define76.0%
Simplified76.0%
if 5.7000000000000002e51 < A Initial program 74.1%
Taylor expanded in C around 0 74.1%
associate-*r/74.1%
mul-1-neg74.1%
unpow274.1%
unpow274.1%
hypot-define88.1%
Simplified88.1%
Taylor expanded in B around -inf 82.8%
mul-1-neg82.8%
unsub-neg82.8%
Simplified82.8%
(FPCore (A B C) :precision binary64 (if (<= A -2.2e+95) (* 180.0 (/ (atan (/ (* 0.5 B) A)) PI)) (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.2e+95) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.2e+95) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.2e+95: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.2e+95) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.2e+95) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); else tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.2e+95], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.2 \cdot 10^{+95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -2.1999999999999999e95Initial program 17.0%
Taylor expanded in A around -inf 73.4%
associate-*r/73.4%
Simplified73.4%
if -2.1999999999999999e95 < A Initial program 61.7%
Simplified85.1%
(FPCore (A B C) :precision binary64 (if (<= A -1.05e+95) (* 180.0 (/ (atan (/ (* 0.5 B) A)) PI)) (* 180.0 (/ (atan (/ (- (- C A) (hypot C B)) B)) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.05e+95) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((C - A) - hypot(C, B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.05e+95) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(C, B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.05e+95: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) else: tmp = 180.0 * (math.atan((((C - A) - math.hypot(C, B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.05e+95) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(C, B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.05e+95) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); else tmp = 180.0 * (atan((((C - A) - hypot(C, B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.05e+95], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.05 \cdot 10^{+95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(C, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.05e95Initial program 17.0%
Taylor expanded in A around -inf 73.4%
associate-*r/73.4%
Simplified73.4%
if -1.05e95 < A Initial program 61.7%
associate-*l/61.7%
*-lft-identity61.7%
+-commutative61.7%
unpow261.7%
unpow261.7%
hypot-define85.2%
Simplified85.2%
Taylor expanded in A around 0 60.8%
+-commutative60.8%
unpow260.8%
unpow260.8%
hypot-define83.8%
Simplified83.8%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (/ (- C A) B)))
(if (<= B -4.3e-244)
(* 180.0 (/ (atan (+ 1.0 t_0)) PI))
(if (<= B -3e-285)
(/ (* 180.0 (atan 0.0)) PI)
(* (/ 180.0 PI) (atan (+ t_0 -1.0)))))))
double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double tmp;
if (B <= -4.3e-244) {
tmp = 180.0 * (atan((1.0 + t_0)) / ((double) M_PI));
} else if (B <= -3e-285) {
tmp = (180.0 * atan(0.0)) / ((double) M_PI);
} else {
tmp = (180.0 / ((double) M_PI)) * atan((t_0 + -1.0));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (C - A) / B;
double tmp;
if (B <= -4.3e-244) {
tmp = 180.0 * (Math.atan((1.0 + t_0)) / Math.PI);
} else if (B <= -3e-285) {
tmp = (180.0 * Math.atan(0.0)) / Math.PI;
} else {
tmp = (180.0 / Math.PI) * Math.atan((t_0 + -1.0));
}
return tmp;
}
def code(A, B, C): t_0 = (C - A) / B tmp = 0 if B <= -4.3e-244: tmp = 180.0 * (math.atan((1.0 + t_0)) / math.pi) elif B <= -3e-285: tmp = (180.0 * math.atan(0.0)) / math.pi else: tmp = (180.0 / math.pi) * math.atan((t_0 + -1.0)) return tmp
function code(A, B, C) t_0 = Float64(Float64(C - A) / B) tmp = 0.0 if (B <= -4.3e-244) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_0)) / pi)); elseif (B <= -3e-285) tmp = Float64(Float64(180.0 * atan(0.0)) / pi); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(t_0 + -1.0))); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (C - A) / B; tmp = 0.0; if (B <= -4.3e-244) tmp = 180.0 * (atan((1.0 + t_0)) / pi); elseif (B <= -3e-285) tmp = (180.0 * atan(0.0)) / pi; else tmp = (180.0 / pi) * atan((t_0 + -1.0)); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -4.3e-244], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -3e-285], N[(N[(180.0 * N[ArcTan[0.0], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(t$95$0 + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{C - A}{B}\\
\mathbf{if}\;B \leq -4.3 \cdot 10^{-244}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_0\right)}{\pi}\\
\mathbf{elif}\;B \leq -3 \cdot 10^{-285}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(t\_0 + -1\right)\\
\end{array}
\end{array}
if B < -4.29999999999999986e-244Initial program 56.1%
Taylor expanded in B around -inf 72.5%
associate--l+72.5%
div-sub72.5%
Simplified72.5%
if -4.29999999999999986e-244 < B < -3.00000000000000003e-285Initial program 15.5%
associate-*r/15.5%
Applied egg-rr88.1%
Taylor expanded in C around inf 76.0%
associate-*r/76.0%
distribute-rgt1-in76.0%
metadata-eval76.0%
mul0-lft76.0%
metadata-eval76.0%
Simplified76.0%
Taylor expanded in B around 0 76.0%
if -3.00000000000000003e-285 < B Initial program 52.7%
associate-*r/52.8%
Applied egg-rr79.3%
Taylor expanded in B around inf 62.7%
+-commutative62.7%
associate--r+62.7%
div-sub64.3%
Simplified64.3%
Taylor expanded in C around 0 62.7%
associate-*r/62.7%
*-commutative62.7%
associate-/l*62.7%
+-commutative62.7%
associate--r+62.7%
div-sub64.3%
sub-neg64.3%
metadata-eval64.3%
*-commutative64.3%
+-commutative64.3%
Simplified64.3%
Final simplification68.5%
(FPCore (A B C)
:precision binary64
(if (<= A -1.02e+95)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(if (<= A 4.8e-202)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.02e+95) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else if (A <= 4.8e-202) {
tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.02e+95) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else if (A <= 4.8e-202) {
tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.02e+95: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) elif A <= 4.8e-202: tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.02e+95) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); elseif (A <= 4.8e-202) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.02e+95) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); elseif (A <= 4.8e-202) tmp = 180.0 * (atan(((C - B) / B)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.02e+95], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.8e-202], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.02 \cdot 10^{+95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 4.8 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.0200000000000001e95Initial program 17.0%
Taylor expanded in A around -inf 73.4%
associate-*r/73.4%
Simplified73.4%
if -1.0200000000000001e95 < A < 4.8000000000000002e-202Initial program 56.1%
Taylor expanded in A around 0 53.7%
+-commutative53.7%
unpow253.7%
unpow253.7%
hypot-define75.0%
Simplified75.0%
Taylor expanded in C around 0 56.0%
if 4.8000000000000002e-202 < A Initial program 65.7%
Taylor expanded in B around -inf 68.1%
associate--l+68.1%
div-sub69.0%
Simplified69.0%
(FPCore (A B C)
:precision binary64
(if (<= A -1.02e+95)
(* 180.0 (/ (atan (/ (* 0.5 B) A)) PI))
(if (<= A 6.2e-202)
(* 180.0 (/ (atan (/ (- C B) B)) PI))
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.02e+95) {
tmp = 180.0 * (atan(((0.5 * B) / A)) / ((double) M_PI));
} else if (A <= 6.2e-202) {
tmp = 180.0 * (atan(((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 <= -1.02e+95) {
tmp = 180.0 * (Math.atan(((0.5 * B) / A)) / Math.PI);
} else if (A <= 6.2e-202) {
tmp = 180.0 * (Math.atan(((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 <= -1.02e+95: tmp = 180.0 * (math.atan(((0.5 * B) / A)) / math.pi) elif A <= 6.2e-202: tmp = 180.0 * (math.atan(((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 <= -1.02e+95) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * B) / A)) / pi)); elseif (A <= 6.2e-202) tmp = Float64(180.0 * Float64(atan(Float64(Float64(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 <= -1.02e+95) tmp = 180.0 * (atan(((0.5 * B) / A)) / pi); elseif (A <= 6.2e-202) tmp = 180.0 * (atan(((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, -1.02e+95], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * B), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 6.2e-202], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $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 -1.02 \cdot 10^{+95}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 6.2 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.0200000000000001e95Initial program 17.0%
Taylor expanded in A around -inf 73.4%
associate-*r/73.4%
Simplified73.4%
if -1.0200000000000001e95 < A < 6.2e-202Initial program 56.1%
Taylor expanded in A around 0 53.7%
+-commutative53.7%
unpow253.7%
unpow253.7%
hypot-define75.0%
Simplified75.0%
Taylor expanded in C around 0 56.0%
if 6.2e-202 < A Initial program 65.7%
Taylor expanded in C around 0 63.1%
associate-*r/63.1%
mul-1-neg63.1%
unpow263.1%
unpow263.1%
hypot-define78.6%
Simplified78.6%
Taylor expanded in B around -inf 67.2%
mul-1-neg67.2%
unsub-neg67.2%
Simplified67.2%
(FPCore (A B C)
:precision binary64
(if (<= C -1.25e-83)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(if (<= C 3.6e+49)
(* 180.0 (/ (atan (- 1.0 (/ A B))) PI))
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -1.25e-83) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else if (C <= 3.6e+49) {
tmp = 180.0 * (atan((1.0 - (A / B))) / ((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 <= -1.25e-83) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else if (C <= 3.6e+49) {
tmp = 180.0 * (Math.atan((1.0 - (A / B))) / 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 <= -1.25e-83: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) elif C <= 3.6e+49: tmp = 180.0 * (math.atan((1.0 - (A / B))) / 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 <= -1.25e-83) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); elseif (C <= 3.6e+49) tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / B))) / 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 <= -1.25e-83) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); elseif (C <= 3.6e+49) tmp = 180.0 * (atan((1.0 - (A / B))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -1.25e-83], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 3.6e+49], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(A / B), $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 -1.25 \cdot 10^{-83}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 3.6 \cdot 10^{+49}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -1.25e-83Initial program 64.3%
Taylor expanded in A around 0 63.4%
+-commutative63.4%
unpow263.4%
unpow263.4%
hypot-define79.3%
Simplified79.3%
Taylor expanded in B around -inf 64.6%
+-commutative64.6%
Simplified64.6%
if -1.25e-83 < C < 3.59999999999999996e49Initial program 64.8%
Taylor expanded in C around 0 64.4%
associate-*r/64.4%
mul-1-neg64.4%
unpow264.4%
unpow264.4%
hypot-define86.9%
Simplified86.9%
Taylor expanded in B around -inf 60.0%
mul-1-neg60.0%
unsub-neg60.0%
Simplified60.0%
if 3.59999999999999996e49 < C Initial program 18.1%
Taylor expanded in A around 0 13.7%
+-commutative13.7%
unpow213.7%
unpow213.7%
hypot-define50.1%
Simplified50.1%
Taylor expanded in C around inf 64.6%
Final simplification62.6%
(FPCore (A B C)
:precision binary64
(if (<= B -2.8e+71)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.4e-87)
(* 180.0 (/ (atan (/ A (- B))) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.8e+71) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.4e-87) {
tmp = 180.0 * (atan((A / -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 <= -2.8e+71) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.4e-87) {
tmp = 180.0 * (Math.atan((A / -B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.8e+71: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.4e-87: tmp = 180.0 * (math.atan((A / -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 <= -2.8e+71) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.4e-87) tmp = Float64(180.0 * Float64(atan(Float64(A / Float64(-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 <= -2.8e+71) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.4e-87) tmp = 180.0 * (atan((A / -B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.8e+71], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.4e-87], N[(180.0 * N[(N[ArcTan[N[(A / (-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 -2.8 \cdot 10^{+71}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.4 \cdot 10^{-87}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.80000000000000002e71Initial program 46.3%
Taylor expanded in B around -inf 71.3%
if -2.80000000000000002e71 < B < 1.4e-87Initial program 58.6%
associate-*l/58.6%
*-lft-identity58.6%
+-commutative58.6%
unpow258.6%
unpow258.6%
hypot-define81.2%
Simplified81.2%
Taylor expanded in A around 0 56.4%
+-commutative56.4%
unpow256.4%
unpow256.4%
hypot-define68.2%
Simplified68.2%
Taylor expanded in C around inf 35.6%
associate-*r/35.6%
mul-1-neg35.6%
Simplified35.6%
if 1.4e-87 < B Initial program 50.2%
Taylor expanded in B around inf 51.3%
Final simplification48.8%
(FPCore (A B C)
:precision binary64
(if (<= B -3.5e-102)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 5.9e-92)
(/ (* 180.0 (atan 0.0)) PI)
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.5e-102) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 5.9e-92) {
tmp = (180.0 * atan(0.0)) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -3.5e-102) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 5.9e-92) {
tmp = (180.0 * Math.atan(0.0)) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.5e-102: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 5.9e-92: tmp = (180.0 * math.atan(0.0)) / math.pi else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -3.5e-102) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 5.9e-92) tmp = Float64(Float64(180.0 * atan(0.0)) / pi); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -3.5e-102) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 5.9e-92) tmp = (180.0 * atan(0.0)) / pi; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.5e-102], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.9e-92], N[(N[(180.0 * N[ArcTan[0.0], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.5 \cdot 10^{-102}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 5.9 \cdot 10^{-92}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.49999999999999986e-102Initial program 55.3%
Taylor expanded in B around -inf 56.0%
if -3.49999999999999986e-102 < B < 5.9e-92Initial program 53.0%
associate-*r/53.0%
Applied egg-rr84.4%
Taylor expanded in C around inf 35.9%
associate-*r/35.9%
distribute-rgt1-in35.9%
metadata-eval35.9%
mul0-lft35.9%
metadata-eval35.9%
Simplified35.9%
Taylor expanded in B around 0 35.9%
if 5.9e-92 < B Initial program 50.8%
Taylor expanded in B around inf 50.9%
(FPCore (A B C) :precision binary64 (if (<= C 1e-269) (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI)) (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 1e-269) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((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 <= 1e-269) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / 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 <= 1e-269: tmp = 180.0 * (math.atan((1.0 + (C / B))) / 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 <= 1e-269) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / 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 <= 1e-269) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan((-0.5 * (B / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 1e-269], 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[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 10^{-269}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 9.9999999999999996e-270Initial program 67.3%
Taylor expanded in A around 0 57.4%
+-commutative57.4%
unpow257.4%
unpow257.4%
hypot-define73.0%
Simplified73.0%
Taylor expanded in B around -inf 54.2%
+-commutative54.2%
Simplified54.2%
if 9.9999999999999996e-270 < C Initial program 37.8%
Taylor expanded in A around 0 22.0%
+-commutative22.0%
unpow222.0%
unpow222.0%
hypot-define51.3%
Simplified51.3%
Taylor expanded in C around inf 49.4%
Final simplification51.9%
(FPCore (A B C) :precision binary64 (if (<= B -8.2e-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 <= -8.2e-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 <= -8.2e-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 <= -8.2e-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 <= -8.2e-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 <= -8.2e-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, -8.2e-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 -8.2 \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 < -8.19999999999999965e-308Initial program 54.9%
Taylor expanded in B around -inf 43.0%
if -8.19999999999999965e-308 < B Initial program 51.2%
Taylor expanded in B around inf 37.5%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 53.1%
Taylor expanded in B around inf 19.1%
herbie shell --seed 2024170
(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)))