
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (hypot (- C A) B)))) PI)))
(t_1
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(if (<= t_1 -0.5)
t_0
(if (<= t_1 0.0) (* (/ 180.0 PI) (atan (/ B (* (- A C) 2.0)))) t_0))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - hypot((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 <= -0.5) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = (180.0 / ((double) M_PI)) * atan((B / ((A - C) * 2.0)));
} 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 / B) * ((C - A) - Math.hypot((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 <= -0.5) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = (180.0 / Math.PI) * Math.atan((B / ((A - C) * 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.hypot((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 <= -0.5: tmp = t_0 elif t_1 <= 0.0: tmp = (180.0 / math.pi) * math.atan((B / ((A - C) * 2.0))) else: tmp = t_0 return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - hypot(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 <= -0.5) tmp = t_0; elseif (t_1 <= 0.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B / Float64(Float64(A - C) * 2.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - hypot((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 <= -0.5) tmp = t_0; elseif (t_1 <= 0.0) tmp = (180.0 / pi) * atan((B / ((A - C) * 2.0))); else tmp = t_0; 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[(C - A), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $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, -0.5], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B / N[(N[(A - C), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\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 -0.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B}{\left(A - C\right) \cdot 2}\right)\\
\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)))))) < -0.5 or 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 64.4%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites90.2%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 28.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites28.0%
Taylor expanded in B around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-frac2N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.9
Applied rewrites97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.4
Applied rewrites99.4%
Final simplification91.7%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(/ (* 180.0 (atan (+ t_1 -1.0))) PI)
(if (<= t_0 0.0)
(* (/ 180.0 PI) (atan (/ B (* (- A C) 2.0))))
(/ 180.0 (/ PI (atan (+ 1.0 t_1))))))))
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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (180.0 * atan((t_1 + -1.0))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 / ((double) M_PI)) * atan((B / ((A - C) * 2.0)));
} else {
tmp = 180.0 / (((double) M_PI) / atan((1.0 + t_1)));
}
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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (180.0 * Math.atan((t_1 + -1.0))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = (180.0 / Math.PI) * Math.atan((B / ((A - C) * 2.0)));
} else {
tmp = 180.0 / (Math.PI / Math.atan((1.0 + t_1)));
}
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)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = (180.0 * math.atan((t_1 + -1.0))) / math.pi elif t_0 <= 0.0: tmp = (180.0 / math.pi) * math.atan((B / ((A - C) * 2.0))) else: tmp = 180.0 / (math.pi / math.atan((1.0 + t_1))) 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))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(Float64(180.0 * atan(Float64(t_1 + -1.0))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B / Float64(Float64(A - C) * 2.0)))); else tmp = Float64(180.0 / Float64(pi / atan(Float64(1.0 + t_1)))); 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)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = (180.0 * atan((t_1 + -1.0))) / pi; elseif (t_0 <= 0.0) tmp = (180.0 / pi) * atan((B / ((A - C) * 2.0))); else tmp = 180.0 / (pi / atan((1.0 + t_1))); 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]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[(180.0 * N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B / N[(N[(A - C), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(1.0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B}{\left(A - C\right) \cdot 2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(1 + t\_1\right)}}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 61.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6478.0
Applied rewrites78.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6478.0
Applied rewrites78.0%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 28.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites28.0%
Taylor expanded in B around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-frac2N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.9
Applied rewrites97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.4
Applied rewrites99.4%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 66.4%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites90.0%
Taylor expanded in B around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-frac2N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f6423.2
Applied rewrites23.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6422.7
Applied rewrites22.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
mul-1-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f6480.4
Applied rewrites80.4%
Final simplification82.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(/ (* 180.0 (atan (+ t_1 -1.0))) PI)
(if (<= t_0 0.0)
(* (/ 180.0 PI) (atan (/ B (* (- A C) 2.0))))
(* 180.0 (/ (atan (+ 1.0 t_1)) 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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (180.0 * atan((t_1 + -1.0))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 / ((double) M_PI)) * atan((B / ((A - C) * 2.0)));
} else {
tmp = 180.0 * (atan((1.0 + t_1)) / ((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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (180.0 * Math.atan((t_1 + -1.0))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = (180.0 / Math.PI) * Math.atan((B / ((A - C) * 2.0)));
} else {
tmp = 180.0 * (Math.atan((1.0 + t_1)) / 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)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = (180.0 * math.atan((t_1 + -1.0))) / math.pi elif t_0 <= 0.0: tmp = (180.0 / math.pi) * math.atan((B / ((A - C) * 2.0))) else: tmp = 180.0 * (math.atan((1.0 + t_1)) / 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))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(Float64(180.0 * atan(Float64(t_1 + -1.0))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B / Float64(Float64(A - C) * 2.0)))); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_1)) / 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)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = (180.0 * atan((t_1 + -1.0))) / pi; elseif (t_0 <= 0.0) tmp = (180.0 / pi) * atan((B / ((A - C) * 2.0))); else tmp = 180.0 * (atan((1.0 + t_1)) / 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]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[(180.0 * N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B / N[(N[(A - C), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$1), $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)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B}{\left(A - C\right) \cdot 2}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_1\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 61.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6478.0
Applied rewrites78.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6478.0
Applied rewrites78.0%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 28.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites28.0%
Taylor expanded in B around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-frac2N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.9
Applied rewrites97.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.4
Applied rewrites99.4%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 66.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6480.4
Applied rewrites80.4%
Final simplification82.6%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(/ (* 180.0 (atan (+ t_1 -1.0))) PI)
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI))
(* 180.0 (/ (atan (+ 1.0 t_1)) 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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (180.0 * atan((t_1 + -1.0))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + t_1)) / ((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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (180.0 * Math.atan((t_1 + -1.0))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan((B * (0.5 / (A - C)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + t_1)) / 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)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = (180.0 * math.atan((t_1 + -1.0))) / math.pi elif t_0 <= 0.0: tmp = 180.0 * (math.atan((B * (0.5 / (A - C)))) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + t_1)) / 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))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(Float64(180.0 * atan(Float64(t_1 + -1.0))) / pi); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_1)) / 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)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = (180.0 * atan((t_1 + -1.0))) / pi; elseif (t_0 <= 0.0) tmp = 180.0 * (atan((B * (0.5 / (A - C)))) / pi); else tmp = 180.0 * (atan((1.0 + t_1)) / 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]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[(180.0 * N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$1), $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)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_1\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 61.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6478.0
Applied rewrites78.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6478.0
Applied rewrites78.0%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 28.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites28.0%
Taylor expanded in B around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-frac2N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f6499.1
Applied rewrites99.1%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 66.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6480.4
Applied rewrites80.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(/ (* 180.0 (atan (+ t_1 -1.0))) PI)
(if (<= t_0 0.0)
(/ (* 180.0 (atan (/ (* B 0.5) A))) PI)
(* 180.0 (/ (atan (+ 1.0 t_1)) 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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (180.0 * atan((t_1 + -1.0))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 * atan(((B * 0.5) / A))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((1.0 + t_1)) / ((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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (180.0 * Math.atan((t_1 + -1.0))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = (180.0 * Math.atan(((B * 0.5) / A))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((1.0 + t_1)) / 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)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = (180.0 * math.atan((t_1 + -1.0))) / math.pi elif t_0 <= 0.0: tmp = (180.0 * math.atan(((B * 0.5) / A))) / math.pi else: tmp = 180.0 * (math.atan((1.0 + t_1)) / 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))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(Float64(180.0 * atan(Float64(t_1 + -1.0))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * 0.5) / A))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_1)) / 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)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = (180.0 * atan((t_1 + -1.0))) / pi; elseif (t_0 <= 0.0) tmp = (180.0 * atan(((B * 0.5) / A))) / pi; else tmp = 180.0 * (atan((1.0 + t_1)) / 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]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[(180.0 * N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$1), $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)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_1\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 61.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6478.0
Applied rewrites78.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6478.0
Applied rewrites78.0%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 28.0%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6467.1
Applied rewrites67.1%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 66.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6480.4
Applied rewrites80.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* 180.0 (/ (atan (+ t_1 -1.0)) PI))
(if (<= t_0 0.0)
(/ (* 180.0 (atan (/ (* B 0.5) A))) PI)
(* 180.0 (/ (atan (+ 1.0 t_1)) 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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (atan((t_1 + -1.0)) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = (180.0 * atan(((B * 0.5) / A))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((1.0 + t_1)) / ((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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (Math.atan((t_1 + -1.0)) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 * Math.atan(((B * 0.5) / A))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((1.0 + t_1)) / 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)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = 180.0 * (math.atan((t_1 + -1.0)) / math.pi) elif t_0 <= 0.0: tmp = (180.0 * math.atan(((B * 0.5) / A))) / math.pi else: tmp = 180.0 * (math.atan((1.0 + t_1)) / 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))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(180.0 * Float64(atan(Float64(t_1 + -1.0)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * 0.5) / A))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_1)) / 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)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = 180.0 * (atan((t_1 + -1.0)) / pi); elseif (t_0 <= 0.0) tmp = (180.0 * atan(((B * 0.5) / A))) / pi; else tmp = 180.0 * (atan((1.0 + t_1)) / 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]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(180.0 * N[(N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$1), $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)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_1\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 61.8%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6478.0
Applied rewrites78.0%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 28.0%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6467.1
Applied rewrites67.1%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 66.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6480.4
Applied rewrites80.4%
(FPCore (A B C)
:precision binary64
(if (<= B -3.3e-271)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(if (<= B 1.68e-233)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 40000.0)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(* 180.0 (/ (atan -1.0) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.3e-271) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else if (B <= 1.68e-233) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 40000.0) {
tmp = 180.0 * (atan((2.0 * (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 <= -3.3e-271) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else if (B <= 1.68e-233) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 40000.0) {
tmp = 180.0 * (Math.atan((2.0 * (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 <= -3.3e-271: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) elif B <= 1.68e-233: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 40000.0: tmp = 180.0 * (math.atan((2.0 * (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 <= -3.3e-271) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); elseif (B <= 1.68e-233) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 40000.0) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * 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 <= -3.3e-271) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); elseif (B <= 1.68e-233) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 40000.0) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.3e-271], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.68e-233], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 40000.0], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $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 -3.3 \cdot 10^{-271}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;B \leq 1.68 \cdot 10^{-233}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 40000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.3000000000000002e-271Initial program 63.0%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6450.8
Applied rewrites50.8%
Taylor expanded in B around -inf
Applied rewrites61.9%
if -3.3000000000000002e-271 < B < 1.67999999999999993e-233Initial program 45.7%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval57.0
Applied rewrites57.0%
if 1.67999999999999993e-233 < B < 4e4Initial program 59.8%
Taylor expanded in C around -inf
lower-*.f64N/A
lower-/.f6436.3
Applied rewrites36.3%
if 4e4 < B Initial program 53.1%
Taylor expanded in B around inf
Applied rewrites63.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))))
(if (<= B -3.3e-271)
t_0
(if (<= B 4.8e-108)
(* 180.0 (/ (atan 0.0) PI))
(if (<= B 40000.0) t_0 (* 180.0 (/ (atan -1.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 (B <= -3.3e-271) {
tmp = t_0;
} else if (B <= 4.8e-108) {
tmp = 180.0 * (atan(0.0) / ((double) M_PI));
} else if (B <= 40000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
double tmp;
if (B <= -3.3e-271) {
tmp = t_0;
} else if (B <= 4.8e-108) {
tmp = 180.0 * (Math.atan(0.0) / Math.PI);
} else if (B <= 40000.0) {
tmp = t_0;
} else {
tmp = 180.0 * (Math.atan(-1.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 B <= -3.3e-271: tmp = t_0 elif B <= 4.8e-108: tmp = 180.0 * (math.atan(0.0) / math.pi) elif B <= 40000.0: tmp = t_0 else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)) tmp = 0.0 if (B <= -3.3e-271) tmp = t_0; elseif (B <= 4.8e-108) tmp = Float64(180.0 * Float64(atan(0.0) / pi)); elseif (B <= 40000.0) tmp = t_0; else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan((1.0 + (C / B))) / pi); tmp = 0.0; if (B <= -3.3e-271) tmp = t_0; elseif (B <= 4.8e-108) tmp = 180.0 * (atan(0.0) / pi); elseif (B <= 40000.0) tmp = t_0; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.3e-271], t$95$0, If[LessEqual[B, 4.8e-108], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 40000.0], t$95$0, N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;B \leq -3.3 \cdot 10^{-271}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B \leq 4.8 \cdot 10^{-108}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{elif}\;B \leq 40000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.3000000000000002e-271 or 4.80000000000000034e-108 < B < 4e4Initial program 62.7%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6451.7
Applied rewrites51.7%
Taylor expanded in B around -inf
Applied rewrites58.9%
if -3.3000000000000002e-271 < B < 4.80000000000000034e-108Initial program 52.6%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval43.7
Applied rewrites43.7%
if 4e4 < B Initial program 53.1%
Taylor expanded in B around inf
Applied rewrites63.0%
(FPCore (A B C)
:precision binary64
(if (<= A -5.5e-32)
(/ (* 180.0 (atan (/ (* B 0.5) A))) PI)
(if (<= A 2.9e+82)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.5e-32) {
tmp = (180.0 * atan(((B * 0.5) / A))) / ((double) M_PI);
} else if (A <= 2.9e+82) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -5.5e-32) {
tmp = (180.0 * Math.atan(((B * 0.5) / A))) / Math.PI;
} else if (A <= 2.9e+82) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -5.5e-32: tmp = (180.0 * math.atan(((B * 0.5) / A))) / math.pi elif A <= 2.9e+82: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -5.5e-32) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * 0.5) / A))) / pi); elseif (A <= 2.9e+82) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5.5e-32) tmp = (180.0 * atan(((B * 0.5) / A))) / pi; elseif (A <= 2.9e+82) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5.5e-32], N[(N[(180.0 * N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 2.9e+82], 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[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.5 \cdot 10^{-32}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.9 \cdot 10^{+82}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.50000000000000024e-32Initial program 28.6%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.7
Applied rewrites64.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6464.7
Applied rewrites64.7%
if -5.50000000000000024e-32 < A < 2.9000000000000001e82Initial program 64.4%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.6
Applied rewrites58.6%
Taylor expanded in B around -inf
Applied rewrites54.8%
if 2.9000000000000001e82 < A Initial program 81.8%
Taylor expanded in A around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f6478.3
Applied rewrites78.3%
Final simplification62.2%
(FPCore (A B C)
:precision binary64
(if (<= A -5.5e-32)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A 2.9e+82)
(* 180.0 (/ (atan (+ 1.0 (/ C B))) PI))
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.5e-32) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= 2.9e+82) {
tmp = 180.0 * (atan((1.0 + (C / B))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -5.5e-32) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= 2.9e+82) {
tmp = 180.0 * (Math.atan((1.0 + (C / B))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -5.5e-32: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= 2.9e+82: tmp = 180.0 * (math.atan((1.0 + (C / B))) / math.pi) else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -5.5e-32) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= 2.9e+82) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -5.5e-32) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= 2.9e+82) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5.5e-32], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.9e+82], 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[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.5 \cdot 10^{-32}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq 2.9 \cdot 10^{+82}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.50000000000000024e-32Initial program 28.6%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.7
Applied rewrites64.7%
if -5.50000000000000024e-32 < A < 2.9000000000000001e82Initial program 64.4%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.6
Applied rewrites58.6%
Taylor expanded in B around -inf
Applied rewrites54.8%
if 2.9000000000000001e82 < A Initial program 81.8%
Taylor expanded in A around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f6478.3
Applied rewrites78.3%
Final simplification62.1%
(FPCore (A B C) :precision binary64 (if (<= A -5.5e-32) (/ (* 180.0 (atan (/ (* B 0.5) A))) PI) (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))
double code(double A, double B, double C) {
double tmp;
if (A <= -5.5e-32) {
tmp = (180.0 * atan(((B * 0.5) / A))) / ((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 <= -5.5e-32) {
tmp = (180.0 * Math.atan(((B * 0.5) / A))) / 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 <= -5.5e-32: tmp = (180.0 * math.atan(((B * 0.5) / A))) / 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 <= -5.5e-32) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * 0.5) / A))) / 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 <= -5.5e-32) tmp = (180.0 * atan(((B * 0.5) / A))) / pi; else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -5.5e-32], N[(N[(180.0 * N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $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}
\mathbf{if}\;A \leq -5.5 \cdot 10^{-32}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -5.50000000000000024e-32Initial program 28.6%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.7
Applied rewrites64.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6464.7
Applied rewrites64.7%
if -5.50000000000000024e-32 < A Initial program 69.2%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6468.4
Applied rewrites68.4%
(FPCore (A B C) :precision binary64 (if (<= C 1.1e-284) (* 180.0 (/ (atan (+ 1.0 (/ C B))) PI)) (* 180.0 (/ (atan (/ (* B -0.5) C)) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= 1.1e-284) {
tmp = 180.0 * (atan((1.0 + (C / 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 <= 1.1e-284) {
tmp = 180.0 * (Math.atan((1.0 + (C / 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 <= 1.1e-284: tmp = 180.0 * (math.atan((1.0 + (C / 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 <= 1.1e-284) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(C / B))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 1.1e-284) tmp = 180.0 * (atan((1.0 + (C / B))) / pi); else tmp = 180.0 * (atan(((B * -0.5) / C)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 1.1e-284], 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[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.1 \cdot 10^{-284}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 1.1e-284Initial program 73.8%
Taylor expanded in A around 0
lower-/.f64N/A
lower--.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.1
Applied rewrites65.1%
Taylor expanded in B around -inf
Applied rewrites65.2%
if 1.1e-284 < C Initial program 43.1%
Taylor expanded in C around inf
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6450.5
Applied rewrites50.5%
Applied rewrites50.6%
(FPCore (A B C)
:precision binary64
(if (<= B -2.05e-199)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 3.1e-62)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.05e-199) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 3.1e-62) {
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 <= -2.05e-199) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 3.1e-62) {
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 <= -2.05e-199: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 3.1e-62: 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 <= -2.05e-199) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 3.1e-62) tmp = Float64(180.0 * Float64(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 <= -2.05e-199) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 3.1e-62) 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, -2.05e-199], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.1e-62], N[(180.0 * N[(N[ArcTan[0.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.05 \cdot 10^{-199}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 3.1 \cdot 10^{-62}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.05000000000000011e-199Initial program 63.3%
Taylor expanded in B around -inf
Applied rewrites47.3%
if -2.05000000000000011e-199 < B < 3.0999999999999999e-62Initial program 54.8%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval38.9
Applied rewrites38.9%
if 3.0999999999999999e-62 < B Initial program 55.8%
Taylor expanded in B around inf
Applied rewrites55.2%
(FPCore (A B C) :precision binary64 (if (<= B 3.1e-62) (* 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.1e-62) {
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.1e-62) {
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.1e-62: 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.1e-62) tmp = Float64(180.0 * Float64(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.1e-62) 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.1e-62], N[(180.0 * N[(N[ArcTan[0.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 3.1 \cdot 10^{-62}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 3.0999999999999999e-62Initial program 59.5%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval19.3
Applied rewrites19.3%
if 3.0999999999999999e-62 < B Initial program 55.8%
Taylor expanded in B around inf
Applied rewrites55.2%
(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 58.6%
Taylor expanded in B around inf
Applied rewrites17.0%
herbie shell --seed 2024221
(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)))