
(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 11 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 -5.6e+91) (* 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 <= -5.6e+91) {
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 <= -5.6e+91) {
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 <= -5.6e+91: 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 <= -5.6e+91) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(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 <= -5.6e+91) 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, -5.6e+91], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $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 -5.6 \cdot 10^{+91}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{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 < -5.5999999999999997e91Initial program 11.3%
Taylor expanded in A around -inf 80.0%
if -5.5999999999999997e91 < A Initial program 61.3%
Simplified82.9%
Final simplification82.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))))
(if (<= A -1.4e+89)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -4.2e-197)
t_0
(if (<= A -5.5e-269)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 1.5e-35) t_0 (* 180.0 (/ (atan (* (/ A B) -2.0)) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
double tmp;
if (A <= -1.4e+89) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -4.2e-197) {
tmp = t_0;
} else if (A <= -5.5e-269) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 1.5e-35) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
double tmp;
if (A <= -1.4e+89) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -4.2e-197) {
tmp = t_0;
} else if (A <= -5.5e-269) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 1.5e-35) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) tmp = 0 if A <= -1.4e+89: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -4.2e-197: tmp = t_0 elif A <= -5.5e-269: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 1.5e-35: tmp = t_0 else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)) tmp = 0.0 if (A <= -1.4e+89) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -4.2e-197) tmp = t_0; elseif (A <= -5.5e-269) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 1.5e-35) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 + (C / B))) / pi); tmp = 0.0; if (A <= -1.4e+89) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -4.2e-197) tmp = t_0; elseif (A <= -5.5e-269) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 1.5e-35) tmp = t_0; else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.4e+89], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -4.2e-197], t$95$0, If[LessEqual[A, -5.5e-269], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.5e-35], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.4 \cdot 10^{+89}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -4.2 \cdot 10^{-197}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -5.5 \cdot 10^{-269}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 1.5 \cdot 10^{-35}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.3999999999999999e89Initial program 11.3%
Taylor expanded in A around -inf 80.0%
if -1.3999999999999999e89 < A < -4.2e-197 or -5.5000000000000001e-269 < A < 1.49999999999999994e-35Initial program 55.4%
Taylor expanded in B around -inf 54.3%
associate--l+54.3%
div-sub55.7%
Simplified55.7%
Taylor expanded in C around inf 53.0%
if -4.2e-197 < A < -5.5000000000000001e-269Initial program 37.4%
Taylor expanded in B around inf 48.0%
if 1.49999999999999994e-35 < A Initial program 80.2%
Taylor expanded in A around inf 72.2%
Final simplification62.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))))
(if (<= A -1.4e+89)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A -4.2e-201)
t_0
(if (<= A -5.5e-269)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 4.4e-33) t_0 (* 180.0 (/ (atan (- -1.0 (/ A B))) PI))))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
double tmp;
if (A <= -1.4e+89) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= -4.2e-201) {
tmp = t_0;
} else if (A <= -5.5e-269) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 4.4e-33) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
double tmp;
if (A <= -1.4e+89) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= -4.2e-201) {
tmp = t_0;
} else if (A <= -5.5e-269) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 4.4e-33) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) tmp = 0 if A <= -1.4e+89: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= -4.2e-201: tmp = t_0 elif A <= -5.5e-269: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 4.4e-33: tmp = t_0 else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)) tmp = 0.0 if (A <= -1.4e+89) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= -4.2e-201) tmp = t_0; elseif (A <= -5.5e-269) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 4.4e-33) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 + (C / B))) / pi); tmp = 0.0; if (A <= -1.4e+89) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= -4.2e-201) tmp = t_0; elseif (A <= -5.5e-269) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 4.4e-33) tmp = t_0; else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.4e+89], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -4.2e-201], t$95$0, If[LessEqual[A, -5.5e-269], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.4e-33], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.4 \cdot 10^{+89}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -4.2 \cdot 10^{-201}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;A \leq -5.5 \cdot 10^{-269}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 4.4 \cdot 10^{-33}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.3999999999999999e89Initial program 11.3%
Taylor expanded in A around -inf 80.0%
if -1.3999999999999999e89 < A < -4.20000000000000024e-201 or -5.5000000000000001e-269 < A < 4.40000000000000011e-33Initial program 55.4%
Taylor expanded in B around -inf 54.3%
associate--l+54.3%
div-sub55.7%
Simplified55.7%
Taylor expanded in C around inf 53.0%
if -4.20000000000000024e-201 < A < -5.5000000000000001e-269Initial program 37.4%
Taylor expanded in B around inf 48.0%
if 4.40000000000000011e-33 < A Initial program 80.2%
associate-*l/80.2%
*-un-lft-identity80.2%
+-commutative80.2%
unpow280.2%
unpow280.2%
hypot-udef93.4%
div-sub88.2%
hypot-udef78.4%
unpow278.4%
unpow278.4%
+-commutative78.4%
unpow278.4%
unpow278.4%
hypot-def88.2%
Applied egg-rr88.2%
Taylor expanded in C around 0 87.5%
mul-1-neg87.5%
distribute-neg-frac87.5%
Simplified87.5%
Taylor expanded in B around inf 76.6%
Taylor expanded in A around inf 76.6%
neg-sub076.6%
associate--r+76.6%
metadata-eval76.6%
Simplified76.6%
Final simplification63.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))
(if (<= B -1.2e-189)
t_0
(if (<= B -1.25e-294)
(* 180.0 (/ (atan (/ (* A 0.0) B)) PI))
(if (<= B 3.2e+19) t_0 (* 180.0 (/ (atan (- -1.0 (/ A B))) PI)))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
double tmp;
if (B <= -1.2e-189) {
tmp = t_0;
} else if (B <= -1.25e-294) {
tmp = 180.0 * (atan(((A * 0.0) / B)) / ((double) M_PI));
} else if (B <= 3.2e+19) {
tmp = t_0;
} else {
tmp = 180.0 * (atan((-1.0 - (A / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
double tmp;
if (B <= -1.2e-189) {
tmp = t_0;
} else if (B <= -1.25e-294) {
tmp = 180.0 * (Math.atan(((A * 0.0) / B)) / Math.PI);
} else if (B <= 3.2e+19) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan((-1.0 - (A / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) tmp = 0 if B <= -1.2e-189: tmp = t_0 elif B <= -1.25e-294: tmp = 180.0 * (math.atan(((A * 0.0) / B)) / math.pi) elif B <= 3.2e+19: tmp = t_0 else: tmp = 180.0 * (math.atan((-1.0 - (A / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)) tmp = 0.0 if (B <= -1.2e-189) tmp = t_0; elseif (B <= -1.25e-294) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * 0.0) / B)) / pi)); elseif (B <= 3.2e+19) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); tmp = 0.0; if (B <= -1.2e-189) tmp = t_0; elseif (B <= -1.25e-294) tmp = 180.0 * (atan(((A * 0.0) / B)) / pi); elseif (B <= 3.2e+19) tmp = t_0; else tmp = 180.0 * (atan((-1.0 - (A / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.2e-189], t$95$0, If[LessEqual[B, -1.25e-294], N[(180.0 * N[(N[ArcTan[N[(N[(A * 0.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.2e+19], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -1.2 \cdot 10^{-189}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq -1.25 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot 0}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 3.2 \cdot 10^{+19}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -1.1999999999999999e-189 or -1.2500000000000001e-294 < B < 3.2e19Initial program 57.2%
Taylor expanded in B around -inf 63.0%
associate--l+63.0%
div-sub65.2%
Simplified65.2%
if -1.1999999999999999e-189 < B < -1.2500000000000001e-294Initial program 34.6%
Taylor expanded in C around inf 55.2%
associate-*r/55.2%
distribute-rgt1-in55.2%
associate-*r*55.2%
metadata-eval55.2%
metadata-eval55.2%
metadata-eval55.2%
*-commutative55.2%
metadata-eval55.2%
Simplified55.2%
if 3.2e19 < B Initial program 40.0%
associate-*l/40.0%
*-un-lft-identity40.0%
+-commutative40.0%
unpow240.0%
unpow240.0%
hypot-udef77.5%
div-sub77.5%
hypot-udef40.0%
unpow240.0%
unpow240.0%
+-commutative40.0%
unpow240.0%
unpow240.0%
hypot-def77.5%
Applied egg-rr77.5%
Taylor expanded in C around 0 76.2%
mul-1-neg76.2%
distribute-neg-frac76.2%
Simplified76.2%
Taylor expanded in B around inf 72.6%
Taylor expanded in A around inf 72.6%
neg-sub072.6%
associate--r+72.6%
metadata-eval72.6%
Simplified72.6%
Final simplification66.2%
(FPCore (A B C)
:precision binary64
(if (<= B -2.6e-143)
(* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI))
(if (<= B -1.5e-294)
(* 180.0 (/ (atan (+ (/ (* A 0.0) B) (* -0.5 (/ B C)))) PI))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.6e-143) {
tmp = 180.0 * (atan(((C + (B - A)) / B)) / ((double) M_PI));
} else if (B <= -1.5e-294) {
tmp = 180.0 * (atan((((A * 0.0) / B) + (-0.5 * (B / C)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -2.6e-143) {
tmp = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
} else if (B <= -1.5e-294) {
tmp = 180.0 * (Math.atan((((A * 0.0) / B) + (-0.5 * (B / C)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.6e-143: tmp = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi) elif B <= -1.5e-294: tmp = 180.0 * (math.atan((((A * 0.0) / B) + (-0.5 * (B / C)))) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2.6e-143) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi)); elseif (B <= -1.5e-294) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(A * 0.0) / B) + Float64(-0.5 * Float64(B / C)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.6e-143) tmp = 180.0 * (atan(((C + (B - A)) / B)) / pi); elseif (B <= -1.5e-294) tmp = 180.0 * (atan((((A * 0.0) / B) + (-0.5 * (B / C)))) / pi); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.6e-143], N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.5e-294], N[(180.0 * N[(N[ArcTan[N[(N[(N[(A * 0.0), $MachinePrecision] / B), $MachinePrecision] + N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.6 \cdot 10^{-143}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -1.5 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot 0}{B} + -0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -2.59999999999999987e-143Initial program 54.8%
Simplified75.6%
Taylor expanded in B around -inf 72.3%
mul-1-neg72.3%
Simplified72.3%
if -2.59999999999999987e-143 < B < -1.4999999999999999e-294Initial program 29.5%
Taylor expanded in C around inf 27.8%
associate-*r/27.8%
distribute-rgt1-in27.8%
associate-*r*27.8%
metadata-eval27.8%
metadata-eval27.8%
metadata-eval27.8%
*-commutative27.8%
metadata-eval27.8%
associate-*r/27.8%
+-commutative27.8%
associate--l+29.9%
mul-1-neg29.9%
Simplified29.9%
Taylor expanded in B around 0 57.2%
if -1.4999999999999999e-294 < B Initial program 52.7%
Simplified72.1%
Taylor expanded in B around inf 68.0%
+-commutative68.0%
Simplified68.0%
Final simplification68.8%
(FPCore (A B C)
:precision binary64
(if (<= B -4.6e-190)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
(if (<= B -1.25e-294)
(* 180.0 (/ (atan (/ (* A 0.0) B)) PI))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.6e-190) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else if (B <= -1.25e-294) {
tmp = 180.0 * (atan(((A * 0.0) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -4.6e-190) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else if (B <= -1.25e-294) {
tmp = 180.0 * (Math.atan(((A * 0.0) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.6e-190: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) elif B <= -1.25e-294: tmp = 180.0 * (math.atan(((A * 0.0) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -4.6e-190) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); elseif (B <= -1.25e-294) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * 0.0) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -4.6e-190) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); elseif (B <= -1.25e-294) tmp = 180.0 * (atan(((A * 0.0) / B)) / pi); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.6e-190], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.25e-294], N[(180.0 * N[(N[ArcTan[N[(N[(A * 0.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.6 \cdot 10^{-190}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -1.25 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot 0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -4.59999999999999984e-190Initial program 53.0%
Taylor expanded in B around -inf 69.7%
associate--l+69.7%
div-sub70.6%
Simplified70.6%
if -4.59999999999999984e-190 < B < -1.2500000000000001e-294Initial program 34.6%
Taylor expanded in C around inf 55.2%
associate-*r/55.2%
distribute-rgt1-in55.2%
associate-*r*55.2%
metadata-eval55.2%
metadata-eval55.2%
metadata-eval55.2%
*-commutative55.2%
metadata-eval55.2%
Simplified55.2%
if -1.2500000000000001e-294 < B Initial program 52.7%
Simplified72.1%
Taylor expanded in B around inf 68.0%
+-commutative68.0%
Simplified68.0%
Final simplification68.2%
(FPCore (A B C)
:precision binary64
(if (<= B -4.4e-190)
(* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI))
(if (<= B -1.4e-294)
(* 180.0 (/ (atan (/ (* A 0.0) B)) PI))
(* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.4e-190) {
tmp = 180.0 * (atan(((C + (B - A)) / B)) / ((double) M_PI));
} else if (B <= -1.4e-294) {
tmp = 180.0 * (atan(((A * 0.0) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -4.4e-190) {
tmp = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
} else if (B <= -1.4e-294) {
tmp = 180.0 * (Math.atan(((A * 0.0) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.4e-190: tmp = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi) elif B <= -1.4e-294: tmp = 180.0 * (math.atan(((A * 0.0) / B)) / math.pi) else: tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -4.4e-190) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi)); elseif (B <= -1.4e-294) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * 0.0) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -4.4e-190) tmp = 180.0 * (atan(((C + (B - A)) / B)) / pi); elseif (B <= -1.4e-294) tmp = 180.0 * (atan(((A * 0.0) / B)) / pi); else tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.4e-190], N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.4e-294], N[(180.0 * N[(N[ArcTan[N[(N[(A * 0.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.4 \cdot 10^{-190}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq -1.4 \cdot 10^{-294}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot 0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if B < -4.40000000000000008e-190Initial program 53.0%
Simplified73.9%
Taylor expanded in B around -inf 70.7%
mul-1-neg70.7%
Simplified70.7%
if -4.40000000000000008e-190 < B < -1.39999999999999995e-294Initial program 34.6%
Taylor expanded in C around inf 55.2%
associate-*r/55.2%
distribute-rgt1-in55.2%
associate-*r*55.2%
metadata-eval55.2%
metadata-eval55.2%
metadata-eval55.2%
*-commutative55.2%
metadata-eval55.2%
Simplified55.2%
if -1.39999999999999995e-294 < B Initial program 52.7%
Simplified72.1%
Taylor expanded in B around inf 68.0%
+-commutative68.0%
Simplified68.0%
Final simplification68.2%
(FPCore (A B C)
:precision binary64
(if (<= A -1.9e-271)
(* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
(if (<= A 1.7e-32)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* (/ A B) -2.0)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.9e-271) {
tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
} else if (A <= 1.7e-32) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -1.9e-271) {
tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
} else if (A <= 1.7e-32) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -1.9e-271: tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi) elif A <= 1.7e-32: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -1.9e-271) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi)); elseif (A <= 1.7e-32) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -1.9e-271) tmp = 180.0 * (atan((0.5 * (B / A))) / pi); elseif (A <= 1.7e-32) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan(((A / B) * -2.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -1.9e-271], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.7e-32], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.9 \cdot 10^{-271}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.7 \cdot 10^{-32}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.90000000000000005e-271Initial program 36.4%
Taylor expanded in A around -inf 53.5%
if -1.90000000000000005e-271 < A < 1.69999999999999989e-32Initial program 56.2%
Taylor expanded in B around -inf 38.8%
if 1.69999999999999989e-32 < A Initial program 80.2%
Taylor expanded in A around inf 72.2%
Final simplification53.9%
(FPCore (A B C)
:precision binary64
(if (<= B -6900.0)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4.8e+19)
(* 180.0 (/ (atan (/ C B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -6900.0) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4.8e+19) {
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 <= -6900.0) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4.8e+19) {
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 <= -6900.0: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4.8e+19: 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 <= -6900.0) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4.8e+19) 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 <= -6900.0) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4.8e+19) 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, -6900.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.8e+19], 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 -6900:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4.8 \cdot 10^{+19}:\\
\;\;\;\;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 < -6900Initial program 52.2%
Taylor expanded in B around -inf 59.4%
if -6900 < B < 4.8e19Initial program 56.8%
associate-*l/56.8%
*-un-lft-identity56.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-udef72.2%
div-sub54.2%
hypot-udef51.4%
unpow251.4%
unpow251.4%
+-commutative51.4%
unpow251.4%
unpow251.4%
hypot-def54.2%
Applied egg-rr54.2%
Taylor expanded in C around 0 52.8%
mul-1-neg52.8%
distribute-neg-frac52.8%
Simplified52.8%
Taylor expanded in C around -inf 33.4%
if 4.8e19 < B Initial program 40.0%
Taylor expanded in B around inf 65.6%
Final simplification48.5%
(FPCore (A B C) :precision binary64 (if (<= B -2e-310) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2e-310) {
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 <= -2e-310) {
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 <= -2e-310: 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 <= -2e-310) 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 <= -2e-310) 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, -2e-310], 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 -2 \cdot 10^{-310}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -1.999999999999994e-310Initial program 51.0%
Taylor expanded in B around -inf 40.9%
if -1.999999999999994e-310 < B Initial program 52.0%
Taylor expanded in B around inf 40.4%
Final simplification40.7%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 51.5%
Taylor expanded in B around inf 20.4%
Final simplification20.4%
herbie shell --seed 2023336
(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)))