
(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}
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.14e+136) (* (/ (atan (/ (* 0.5 (fma (/ C A) B B)) A)) PI) 180.0) (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (hypot (- A C) B)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -1.14e+136) {
tmp = (atan(((0.5 * fma((C / A), B, B)) / A)) / ((double) M_PI)) * 180.0;
} else {
tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - hypot((A - C), B)))) / ((double) M_PI));
}
return tmp;
}
function code(A, B, C) tmp = 0.0 if (A <= -1.14e+136) tmp = Float64(Float64(atan(Float64(Float64(0.5 * fma(Float64(C / A), B, B)) / A)) / pi) * 180.0); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - hypot(Float64(A - C), B)))) / pi)); end return tmp end
code[A_, B_, C_] := If[LessEqual[A, -1.14e+136], N[(N[(N[ArcTan[N[(N[(0.5 * N[(N[(C / A), $MachinePrecision] * B + B), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.14 \cdot 10^{+136}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{0.5 \cdot \mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if A < -1.14e136Initial program 14.2%
Taylor expanded in A around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6476.5
Applied rewrites76.5%
Applied rewrites76.5%
if -1.14e136 < A Initial program 59.7%
lift-sqrt.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f64N/A
lift--.f6481.6
Applied rewrites81.6%
(FPCore (A B C) :precision binary64 (if (<= A -4.8e+47) (* (/ (atan (/ (* 0.5 (fma (/ C A) B B)) A)) PI) 180.0) (* 180.0 (/ (atan (* (/ 1.0 B) (- C (hypot (- A C) B)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.8e+47) {
tmp = (atan(((0.5 * fma((C / A), B, B)) / A)) / ((double) M_PI)) * 180.0;
} else {
tmp = 180.0 * (atan(((1.0 / B) * (C - hypot((A - C), B)))) / ((double) M_PI));
}
return tmp;
}
function code(A, B, C) tmp = 0.0 if (A <= -4.8e+47) tmp = Float64(Float64(atan(Float64(Float64(0.5 * fma(Float64(C / A), B, B)) / A)) / pi) * 180.0); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(C - hypot(Float64(A - C), B)))) / pi)); end return tmp end
code[A_, B_, C_] := If[LessEqual[A, -4.8e+47], N[(N[(N[ArcTan[N[(N[(0.5 * N[(N[(C / A), $MachinePrecision] * B + B), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(C - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.8 \cdot 10^{+47}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{0.5 \cdot \mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(C - \mathsf{hypot}\left(A - C, B\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.80000000000000037e47Initial program 21.5%
Taylor expanded in A around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.4
Applied rewrites67.4%
Applied rewrites67.4%
if -4.80000000000000037e47 < A Initial program 61.9%
lift-sqrt.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f64N/A
lift--.f6483.4
Applied rewrites83.4%
Taylor expanded in A around 0
Applied rewrites82.6%
(FPCore (A B C)
:precision binary64
(if (<= A -4.8e+47)
(* (/ (atan (/ (* 0.5 (fma (/ C A) B B)) A)) PI) 180.0)
(if (<= A 4.8e+91)
(* 180.0 (/ (atan (* (/ 1.0 B) (- C (hypot (- C) B)))) PI))
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- A) (hypot A B)))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.8e+47) {
tmp = (atan(((0.5 * fma((C / A), B, B)) / A)) / ((double) M_PI)) * 180.0;
} else if (A <= 4.8e+91) {
tmp = 180.0 * (atan(((1.0 / B) * (C - hypot(-C, B)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((1.0 / B) * (-A - hypot(A, B)))) / ((double) M_PI));
}
return tmp;
}
function code(A, B, C) tmp = 0.0 if (A <= -4.8e+47) tmp = Float64(Float64(atan(Float64(Float64(0.5 * fma(Float64(C / A), B, B)) / A)) / pi) * 180.0); elseif (A <= 4.8e+91) tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(C - hypot(Float64(-C), B)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(-A) - hypot(A, B)))) / pi)); end return tmp end
code[A_, B_, C_] := If[LessEqual[A, -4.8e+47], N[(N[(N[ArcTan[N[(N[(0.5 * N[(N[(C / A), $MachinePrecision] * B + B), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[A, 4.8e+91], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(C - N[Sqrt[(-C) ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[((-A) - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.8 \cdot 10^{+47}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{0.5 \cdot \mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A}\right)}{\pi} \cdot 180\\
\mathbf{elif}\;A \leq 4.8 \cdot 10^{+91}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(C - \mathsf{hypot}\left(-C, B\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(-A\right) - \mathsf{hypot}\left(A, B\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.80000000000000037e47Initial program 21.5%
Taylor expanded in A around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.4
Applied rewrites67.4%
Applied rewrites67.4%
if -4.80000000000000037e47 < A < 4.79999999999999966e91Initial program 56.6%
lift-sqrt.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f64N/A
lift--.f6480.0
Applied rewrites80.0%
Taylor expanded in A around 0
Applied rewrites79.5%
Taylor expanded in A around 0
mul-1-negN/A
lower-neg.f6475.1
Applied rewrites75.1%
if 4.79999999999999966e91 < A Initial program 80.9%
lift-sqrt.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f64N/A
lift--.f6495.5
Applied rewrites95.5%
Taylor expanded in A around inf
Applied rewrites92.2%
Taylor expanded in A around inf
mul-1-negN/A
lower-neg.f6491.5
Applied rewrites91.5%
(FPCore (A B C)
:precision binary64
(if (<= A -4.8e+47)
(* (/ (atan (/ (* 0.5 (fma (/ C A) B B)) A)) PI) 180.0)
(if (<= A 3.5e+58)
(* 180.0 (/ (atan (* (/ 1.0 B) (- C (hypot (- C) B)))) PI))
(/ (* 180.0 (atan (* (- (- C A) B) (/ 1.0 B)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -4.8e+47) {
tmp = (atan(((0.5 * fma((C / A), B, B)) / A)) / ((double) M_PI)) * 180.0;
} else if (A <= 3.5e+58) {
tmp = 180.0 * (atan(((1.0 / B) * (C - hypot(-C, B)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((((C - A) - B) * (1.0 / B)))) / ((double) M_PI);
}
return tmp;
}
function code(A, B, C) tmp = 0.0 if (A <= -4.8e+47) tmp = Float64(Float64(atan(Float64(Float64(0.5 * fma(Float64(C / A), B, B)) / A)) / pi) * 180.0); elseif (A <= 3.5e+58) tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(C - hypot(Float64(-C), B)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - B) * Float64(1.0 / B)))) / pi); end return tmp end
code[A_, B_, C_] := If[LessEqual[A, -4.8e+47], N[(N[(N[ArcTan[N[(N[(0.5 * N[(N[(C / A), $MachinePrecision] * B + B), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[A, 3.5e+58], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(C - N[Sqrt[(-C) ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - B), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.8 \cdot 10^{+47}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{0.5 \cdot \mathsf{fma}\left(\frac{C}{A}, B, B\right)}{A}\right)}{\pi} \cdot 180\\
\mathbf{elif}\;A \leq 3.5 \cdot 10^{+58}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(C - \mathsf{hypot}\left(-C, B\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\left(C - A\right) - B\right) \cdot \frac{1}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -4.80000000000000037e47Initial program 21.5%
Taylor expanded in A around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.4
Applied rewrites67.4%
Applied rewrites67.4%
if -4.80000000000000037e47 < A < 3.4999999999999997e58Initial program 56.0%
lift-sqrt.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f64N/A
lift--.f6479.6
Applied rewrites79.6%
Taylor expanded in A around 0
Applied rewrites79.0%
Taylor expanded in A around 0
mul-1-negN/A
lower-neg.f6475.5
Applied rewrites75.5%
if 3.4999999999999997e58 < A Initial program 79.5%
Taylor expanded in B around inf
Applied rewrites82.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites82.3%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))))
(if (<= t_0 -40.0)
(/ (* 180.0 (atan (* (- (- C A) B) (/ 1.0 B)))) PI)
(if (<= t_0 0.0005)
(/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
double tmp;
if (t_0 <= -40.0) {
tmp = (180.0 * atan((((C - A) - B) * (1.0 / B)))) / ((double) M_PI);
} else if (t_0 <= 0.0005) {
tmp = (180.0 * atan(((B / A) * 0.5))) / ((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 t_0 = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
double tmp;
if (t_0 <= -40.0) {
tmp = (180.0 * Math.atan((((C - A) - B) * (1.0 / B)))) / Math.PI;
} else if (t_0 <= 0.0005) {
tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) tmp = 0 if t_0 <= -40.0: tmp = (180.0 * math.atan((((C - A) - B) * (1.0 / B)))) / math.pi elif t_0 <= 0.0005: tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) t_0 = 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)) tmp = 0.0 if (t_0 <= -40.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - B) * Float64(1.0 / B)))) / pi); elseif (t_0 <= 0.0005) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / 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) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); tmp = 0.0; if (t_0 <= -40.0) tmp = (180.0 * atan((((C - A) - B) * (1.0 / B)))) / pi; elseif (t_0 <= 0.0005) tmp = (180.0 * atan(((B / A) * 0.5))) / pi; else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -40.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - B), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0005], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $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}
t_0 := 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}\\
\mathbf{if}\;t\_0 \leq -40:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\left(C - A\right) - B\right) \cdot \frac{1}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0.0005:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64))) < -40Initial program 58.9%
Taylor expanded in B around inf
Applied rewrites76.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites76.2%
if -40 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64))) < 5.0000000000000001e-4Initial program 16.9%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.7
Applied rewrites47.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.7%
if 5.0000000000000001e-4 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64))) Initial program 59.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.1
Applied rewrites76.1%
(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 (<= t_0 -0.02)
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- A) B))) PI))
(if (<= t_0 1e-5)
(/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))))
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.02) {
tmp = 180.0 * (atan(((1.0 / B) * (-A - B))) / ((double) M_PI));
} else if (t_0 <= 1e-5) {
tmp = (180.0 * atan(((B / A) * 0.5))) / ((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 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.02) {
tmp = 180.0 * (Math.atan(((1.0 / B) * (-A - B))) / Math.PI);
} else if (t_0 <= 1e-5) {
tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
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.02: tmp = 180.0 * (math.atan(((1.0 / B) * (-A - B))) / math.pi) elif t_0 <= 1e-5: tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) 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.02) tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(-A) - B))) / pi)); elseif (t_0 <= 1e-5) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / 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) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); tmp = 0.0; if (t_0 <= -0.02) tmp = 180.0 * (atan(((1.0 / B) * (-A - B))) / pi); elseif (t_0 <= 1e-5) tmp = (180.0 * atan(((B / A) * 0.5))) / pi; else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); 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[LessEqual[t$95$0, -0.02], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[((-A) - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-5], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $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}
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.02:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(-A\right) - B\right)\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 10^{-5}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\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.0200000000000000004Initial program 58.8%
Taylor expanded in B around inf
Applied rewrites76.1%
Taylor expanded in A around inf
mul-1-negN/A
lower-neg.f6463.2
Applied rewrites63.2%
if -0.0200000000000000004 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 1.00000000000000008e-5Initial program 16.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.9
Applied rewrites47.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.9%
if 1.00000000000000008e-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)))))) Initial program 59.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.1
Applied rewrites76.1%
(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 (<= t_0 -0.5)
(* 180.0 (/ (atan (* (/ 1.0 B) (- C B))) PI))
(if (<= t_0 1e-5)
(/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))))
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) {
tmp = 180.0 * (atan(((1.0 / B) * (C - B))) / ((double) M_PI));
} else if (t_0 <= 1e-5) {
tmp = (180.0 * atan(((B / A) * 0.5))) / ((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 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) {
tmp = 180.0 * (Math.atan(((1.0 / B) * (C - B))) / Math.PI);
} else if (t_0 <= 1e-5) {
tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
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: tmp = 180.0 * (math.atan(((1.0 / B) * (C - B))) / math.pi) elif t_0 <= 1e-5: tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) 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) tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(C - B))) / pi)); elseif (t_0 <= 1e-5) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / 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) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); tmp = 0.0; if (t_0 <= -0.5) tmp = 180.0 * (atan(((1.0 / B) * (C - B))) / pi); elseif (t_0 <= 1e-5) tmp = (180.0 * atan(((B / A) * 0.5))) / pi; else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); 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[LessEqual[t$95$0, -0.5], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(C - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-5], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $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}
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:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(C - B\right)\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 10^{-5}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\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.5Initial program 58.9%
Taylor expanded in B around inf
Applied rewrites76.2%
Taylor expanded in A around 0
Applied rewrites63.5%
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)))))) < 1.00000000000000008e-5Initial program 16.8%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.7
Applied rewrites47.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.7%
if 1.00000000000000008e-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)))))) Initial program 59.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.1
Applied rewrites76.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)))
(t_1
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(if (<= t_1 -50.0)
t_0
(if (<= t_1 -0.02)
(* 180.0 (/ (atan -1.0) PI))
(if (<= t_1 1e-5) (/ (* 180.0 (atan (* (/ B A) 0.5))) PI) t_0)))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
double t_1 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double tmp;
if (t_1 <= -50.0) {
tmp = t_0;
} else if (t_1 <= -0.02) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (t_1 <= 1e-5) {
tmp = (180.0 * atan(((B / A) * 0.5))) / ((double) M_PI);
} else {
tmp = t_0;
}
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 t_1 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double tmp;
if (t_1 <= -50.0) {
tmp = t_0;
} else if (t_1 <= -0.02) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (t_1 <= 1e-5) {
tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
} else {
tmp = t_0;
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) t_1 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) tmp = 0 if t_1 <= -50.0: tmp = t_0 elif t_1 <= -0.02: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif t_1 <= 1e-5: tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi else: tmp = t_0 return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)) t_1 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) tmp = 0.0 if (t_1 <= -50.0) tmp = t_0; elseif (t_1 <= -0.02) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (t_1 <= 1e-5) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / pi); else tmp = t_0; end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); t_1 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); tmp = 0.0; if (t_1 <= -50.0) tmp = t_0; elseif (t_1 <= -0.02) tmp = 180.0 * (atan(-1.0) / pi); elseif (t_1 <= 1e-5) tmp = (180.0 * atan(((B / A) * 0.5))) / pi; else tmp = t_0; 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]}, Block[{t$95$1 = 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[LessEqual[t$95$1, -50.0], t$95$0, If[LessEqual[t$95$1, -0.02], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-5], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t\_1 \leq -50:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq -0.02:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;t\_1 \leq 10^{-5}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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)))))) < -50 or 1.00000000000000008e-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)))))) Initial program 55.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6462.5
Applied rewrites62.5%
if -50 < (*.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.0200000000000000004Initial program 99.1%
Taylor expanded in B around inf
Applied rewrites95.6%
if -0.0200000000000000004 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 1.00000000000000008e-5Initial program 16.7%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.9
Applied rewrites47.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.9%
(FPCore (A B C)
:precision binary64
(if (<= A -3.3e-274)
(/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
(if (<= A 1.05e+91)
(/ (* 180.0 (atan (/ (+ C C) B))) PI)
(* (/ (atan (* (/ A B) -2.0)) PI) 180.0))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.3e-274) {
tmp = (180.0 * atan(((B / A) * 0.5))) / ((double) M_PI);
} else if (A <= 1.05e+91) {
tmp = (180.0 * atan(((C + C) / B))) / ((double) M_PI);
} else {
tmp = (atan(((A / B) * -2.0)) / ((double) M_PI)) * 180.0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.3e-274) {
tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
} else if (A <= 1.05e+91) {
tmp = (180.0 * Math.atan(((C + C) / B))) / Math.PI;
} else {
tmp = (Math.atan(((A / B) * -2.0)) / Math.PI) * 180.0;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.3e-274: tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi elif A <= 1.05e+91: tmp = (180.0 * math.atan(((C + C) / B))) / math.pi else: tmp = (math.atan(((A / B) * -2.0)) / math.pi) * 180.0 return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.3e-274) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / pi); elseif (A <= 1.05e+91) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C + C) / B))) / pi); else tmp = Float64(Float64(atan(Float64(Float64(A / B) * -2.0)) / pi) * 180.0); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.3e-274) tmp = (180.0 * atan(((B / A) * 0.5))) / pi; elseif (A <= 1.05e+91) tmp = (180.0 * atan(((C + C) / B))) / pi; else tmp = (atan(((A / B) * -2.0)) / pi) * 180.0; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.3e-274], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 1.05e+91], N[(N[(180.0 * N[ArcTan[N[(N[(C + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.3 \cdot 10^{-274}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
\mathbf{elif}\;A \leq 1.05 \cdot 10^{+91}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C + C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if A < -3.2999999999999998e-274Initial program 37.8%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6448.4
Applied rewrites48.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites48.4%
if -3.2999999999999998e-274 < A < 1.05000000000000004e91Initial program 60.7%
Taylor expanded in C around -inf
associate-*r/N/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6427.3
Applied rewrites27.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites27.3%
if 1.05000000000000004e91 < A Initial program 80.9%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.3
Applied rewrites77.3%
(FPCore (A B C)
:precision binary64
(if (<= A -3.3e-274)
(* (/ (atan (* (/ B A) 0.5)) PI) 180.0)
(if (<= A 1.05e+91)
(/ (* 180.0 (atan (/ (+ C C) B))) PI)
(* (/ (atan (* (/ A B) -2.0)) PI) 180.0))))
double code(double A, double B, double C) {
double tmp;
if (A <= -3.3e-274) {
tmp = (atan(((B / A) * 0.5)) / ((double) M_PI)) * 180.0;
} else if (A <= 1.05e+91) {
tmp = (180.0 * atan(((C + C) / B))) / ((double) M_PI);
} else {
tmp = (atan(((A / B) * -2.0)) / ((double) M_PI)) * 180.0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -3.3e-274) {
tmp = (Math.atan(((B / A) * 0.5)) / Math.PI) * 180.0;
} else if (A <= 1.05e+91) {
tmp = (180.0 * Math.atan(((C + C) / B))) / Math.PI;
} else {
tmp = (Math.atan(((A / B) * -2.0)) / Math.PI) * 180.0;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -3.3e-274: tmp = (math.atan(((B / A) * 0.5)) / math.pi) * 180.0 elif A <= 1.05e+91: tmp = (180.0 * math.atan(((C + C) / B))) / math.pi else: tmp = (math.atan(((A / B) * -2.0)) / math.pi) * 180.0 return tmp
function code(A, B, C) tmp = 0.0 if (A <= -3.3e-274) tmp = Float64(Float64(atan(Float64(Float64(B / A) * 0.5)) / pi) * 180.0); elseif (A <= 1.05e+91) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C + C) / B))) / pi); else tmp = Float64(Float64(atan(Float64(Float64(A / B) * -2.0)) / pi) * 180.0); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -3.3e-274) tmp = (atan(((B / A) * 0.5)) / pi) * 180.0; elseif (A <= 1.05e+91) tmp = (180.0 * atan(((C + C) / B))) / pi; else tmp = (atan(((A / B) * -2.0)) / pi) * 180.0; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -3.3e-274], N[(N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[A, 1.05e+91], N[(N[(180.0 * N[ArcTan[N[(N[(C + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.3 \cdot 10^{-274}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi} \cdot 180\\
\mathbf{elif}\;A \leq 1.05 \cdot 10^{+91}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C + C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if A < -3.2999999999999998e-274Initial program 37.8%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6448.4
Applied rewrites48.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6448.4
pow248.4
pow248.4
Applied rewrites48.4%
if -3.2999999999999998e-274 < A < 1.05000000000000004e91Initial program 60.7%
Taylor expanded in C around -inf
associate-*r/N/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6427.3
Applied rewrites27.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites27.3%
if 1.05000000000000004e91 < A Initial program 80.9%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.3
Applied rewrites77.3%
(FPCore (A B C)
:precision binary64
(if (<= B -2.3e+64)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 5.4e-26)
(* (/ (atan (* (/ B A) 0.5)) PI) 180.0)
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.3e+64) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 5.4e-26) {
tmp = (atan(((B / A) * 0.5)) / ((double) M_PI)) * 180.0;
} 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.3e+64) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 5.4e-26) {
tmp = (Math.atan(((B / A) * 0.5)) / Math.PI) * 180.0;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.3e+64: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 5.4e-26: tmp = (math.atan(((B / A) * 0.5)) / math.pi) * 180.0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2.3e+64) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 5.4e-26) tmp = Float64(Float64(atan(Float64(Float64(B / A) * 0.5)) / pi) * 180.0); 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.3e+64) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 5.4e-26) tmp = (atan(((B / A) * 0.5)) / pi) * 180.0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.3e+64], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.4e-26], N[(N[(N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.3 \cdot 10^{+64}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 5.4 \cdot 10^{-26}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.3e64Initial program 43.8%
Taylor expanded in B around -inf
Applied rewrites68.5%
if -2.3e64 < B < 5.39999999999999963e-26Initial program 58.8%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6430.2
Applied rewrites30.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6430.2
pow230.2
pow230.2
Applied rewrites30.2%
if 5.39999999999999963e-26 < B Initial program 49.5%
Taylor expanded in B around inf
Applied rewrites59.5%
(FPCore (A B C)
:precision binary64
(if (<= B -9.2e+123)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 6.4e-66)
(* (/ (atan (/ (+ C C) B)) PI) 180.0)
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -9.2e+123) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 6.4e-66) {
tmp = (atan(((C + C) / B)) / ((double) M_PI)) * 180.0;
} 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 <= -9.2e+123) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 6.4e-66) {
tmp = (Math.atan(((C + C) / B)) / Math.PI) * 180.0;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -9.2e+123: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 6.4e-66: tmp = (math.atan(((C + C) / B)) / math.pi) * 180.0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -9.2e+123) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 6.4e-66) tmp = Float64(Float64(atan(Float64(Float64(C + C) / B)) / pi) * 180.0); 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 <= -9.2e+123) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 6.4e-66) tmp = (atan(((C + C) / B)) / pi) * 180.0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -9.2e+123], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 6.4e-66], N[(N[(N[ArcTan[N[(N[(C + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -9.2 \cdot 10^{+123}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 6.4 \cdot 10^{-66}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C + C}{B}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -9.19999999999999962e123Initial program 34.9%
Taylor expanded in B around -inf
Applied rewrites75.2%
if -9.19999999999999962e123 < B < 6.39999999999999963e-66Initial program 59.9%
Taylor expanded in C around -inf
associate-*r/N/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6430.8
Applied rewrites30.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6430.8
pow230.8
pow230.8
Applied rewrites30.8%
if 6.39999999999999963e-66 < B Initial program 50.4%
Taylor expanded in B around inf
Applied rewrites56.0%
(FPCore (A B C) :precision binary64 (if (<= B -5e-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 <= -5e-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 <= -5e-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 <= -5e-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 <= -5e-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 <= -5e-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, -5e-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 -5 \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 < -4.999999999999985e-310Initial program 53.4%
Taylor expanded in B around -inf
Applied rewrites40.2%
if -4.999999999999985e-310 < B Initial program 53.1%
Taylor expanded in B around inf
Applied rewrites40.1%
(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.3%
Taylor expanded in B around inf
Applied rewrites20.8%
herbie shell --seed 2025110
(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)))