
(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 (if (<= A -6.2e+14) (* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI)) (/ (* 180.0 (atan (/ (- (- C A) (hypot (- C A) B)) B))) PI)))
double code(double A, double B, double C) {
double tmp;
if (A <= -6.2e+14) {
tmp = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((((C - A) - hypot((C - A), B)) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -6.2e+14) {
tmp = 180.0 * (Math.atan((B * (0.5 / (A - C)))) / Math.PI);
} else {
tmp = (180.0 * Math.atan((((C - A) - Math.hypot((C - A), B)) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -6.2e+14: tmp = 180.0 * (math.atan((B * (0.5 / (A - C)))) / math.pi) else: tmp = (180.0 * math.atan((((C - A) - math.hypot((C - A), B)) / B))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (A <= -6.2e+14) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(C - A), B)) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -6.2e+14) tmp = 180.0 * (atan((B * (0.5 / (A - C)))) / pi); else tmp = (180.0 * atan((((C - A) - hypot((C - A), B)) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -6.2e+14], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(C - A), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -6.2 \cdot 10^{+14}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -6.2e14Initial program 15.5%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites46.6%
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--.f6482.5
Applied rewrites82.5%
if -6.2e14 < A Initial program 61.8%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites85.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites61.8%
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lower-hypot.f6485.5
Applied rewrites85.5%
(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 -1.0)
(/ (* 180.0 (atan (+ -1.0 t_1))) PI)
(if (<= t_0 0.0)
(/ (* 180.0 (atan (/ (* B -0.5) (- C A)))) PI)
(*
180.0
(/ (atan (- 1.0 (/ (fma -0.5 (* (- C A) t_1) (- A C)) 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 t_1 = (C - A) / B;
double tmp;
if (t_0 <= -1.0) {
tmp = (180.0 * atan((-1.0 + t_1))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 * atan(((B * -0.5) / (C - A)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((1.0 - (fma(-0.5, ((C - A) * t_1), (A - C)) / B))) / ((double) M_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 <= -1.0) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 + t_1))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * -0.5) / Float64(C - A)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(fma(-0.5, Float64(Float64(C - A) * t_1), Float64(A - C)) / B))) / pi)); end return 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, -1.0], N[(N[(180.0 * N[ArcTan[N[(-1.0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / N[(C - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 - N[(N[(-0.5 * N[(N[(C - A), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(A - C), $MachinePrecision]), $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)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -1:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 + t\_1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C - A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{\mathsf{fma}\left(-0.5, \left(C - A\right) \cdot t\_1, A - C\right)}{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)))))) < -1Initial program 54.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites54.0%
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--.f6473.5
Applied rewrites73.5%
if -1 < (*.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 16.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites19.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites16.0%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6496.2
Applied rewrites96.2%
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 57.9%
Taylor expanded in B around inf
Applied rewrites1.9%
Taylor expanded in B around -inf
mul-1-negN/A
unsub-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
Applied rewrites74.5%
Final simplification76.3%
(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 -1.0)
(/ (* 180.0 (atan (+ -1.0 t_1))) PI)
(if (<= t_0 0.0)
(/ (* 180.0 (atan (/ (* B -0.5) (- C 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 <= -1.0) {
tmp = (180.0 * atan((-1.0 + t_1))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 * atan(((B * -0.5) / (C - 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 <= -1.0) {
tmp = (180.0 * Math.atan((-1.0 + t_1))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = (180.0 * Math.atan(((B * -0.5) / (C - 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 <= -1.0: tmp = (180.0 * math.atan((-1.0 + t_1))) / math.pi elif t_0 <= 0.0: tmp = (180.0 * math.atan(((B * -0.5) / (C - 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 <= -1.0) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 + t_1))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * -0.5) / Float64(C - 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 <= -1.0) tmp = (180.0 * atan((-1.0 + t_1))) / pi; elseif (t_0 <= 0.0) tmp = (180.0 * atan(((B * -0.5) / (C - 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, -1.0], N[(N[(180.0 * N[ArcTan[N[(-1.0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / N[(C - A), $MachinePrecision]), $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 -1:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 + t\_1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C - 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)))))) < -1Initial program 54.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites54.0%
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--.f6473.5
Applied rewrites73.5%
if -1 < (*.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 16.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites19.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites16.0%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6496.2
Applied rewrites96.2%
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 57.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6472.8
Applied rewrites72.8%
Final simplification75.5%
(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 -1.0)
(/ (* 180.0 (atan (+ -1.0 t_1))) 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 <= -1.0) {
tmp = (180.0 * atan((-1.0 + t_1))) / ((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 <= -1.0) {
tmp = (180.0 * Math.atan((-1.0 + t_1))) / 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 <= -1.0: tmp = (180.0 * math.atan((-1.0 + t_1))) / 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 <= -1.0) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 + t_1))) / 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 <= -1.0) tmp = (180.0 * atan((-1.0 + t_1))) / 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, -1.0], N[(N[(180.0 * N[ArcTan[N[(-1.0 + t$95$1), $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 -1:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 + t\_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)))))) < -1Initial program 54.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites54.0%
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--.f6473.5
Applied rewrites73.5%
if -1 < (*.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 16.0%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites19.8%
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--.f6496.2
Applied rewrites96.2%
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 57.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6472.8
Applied rewrites72.8%
Final simplification75.5%
(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 -1e-57)
(/ (* 180.0 (atan (+ -1.0 t_1))) PI)
(if (<= t_0 0.0)
(* (/ 180.0 PI) (atan (/ B (* 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 <= -1e-57) {
tmp = (180.0 * atan((-1.0 + t_1))) / ((double) M_PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 / ((double) M_PI)) * atan((B / (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 <= -1e-57) {
tmp = (180.0 * Math.atan((-1.0 + t_1))) / Math.PI;
} else if (t_0 <= 0.0) {
tmp = (180.0 / Math.PI) * Math.atan((B / (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 <= -1e-57: tmp = (180.0 * math.atan((-1.0 + t_1))) / math.pi elif t_0 <= 0.0: tmp = (180.0 / math.pi) * math.atan((B / (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 <= -1e-57) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 + t_1))) / pi); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B / Float64(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 <= -1e-57) tmp = (180.0 * atan((-1.0 + t_1))) / pi; elseif (t_0 <= 0.0) tmp = (180.0 / pi) * atan((B / (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, -1e-57], N[(N[(180.0 * N[ArcTan[N[(-1.0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B / N[(C * -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 -1 \cdot 10^{-57}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 + t\_1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B}{C \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)))))) < -9.99999999999999955e-58Initial program 53.5%
lift-sqrt.f64N/A
lift-+.f64N/A
Applied rewrites82.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites53.5%
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--.f6472.8
Applied rewrites72.8%
if -9.99999999999999955e-58 < (*.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 16.6%
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-/.f6452.5
Applied rewrites52.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6452.5
Applied rewrites52.6%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6452.8
Applied rewrites52.8%
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 57.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6472.8
Applied rewrites72.8%
Final simplification70.9%
(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 -1e-57)
(* 180.0 (/ (atan (+ -1.0 t_1)) PI))
(if (<= t_0 0.0)
(* (/ 180.0 PI) (atan (/ B (* 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 <= -1e-57) {
tmp = 180.0 * (atan((-1.0 + t_1)) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = (180.0 / ((double) M_PI)) * atan((B / (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 <= -1e-57) {
tmp = 180.0 * (Math.atan((-1.0 + t_1)) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 / Math.PI) * Math.atan((B / (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 <= -1e-57: tmp = 180.0 * (math.atan((-1.0 + t_1)) / math.pi) elif t_0 <= 0.0: tmp = (180.0 / math.pi) * math.atan((B / (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 <= -1e-57) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 + t_1)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B / Float64(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 <= -1e-57) tmp = 180.0 * (atan((-1.0 + t_1)) / pi); elseif (t_0 <= 0.0) tmp = (180.0 / pi) * atan((B / (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, -1e-57], N[(180.0 * N[(N[ArcTan[N[(-1.0 + t$95$1), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B / N[(C * -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 -1 \cdot 10^{-57}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 + t\_1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B}{C \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)))))) < -9.99999999999999955e-58Initial program 53.5%
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--.f6472.8
Applied rewrites72.8%
if -9.99999999999999955e-58 < (*.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 16.6%
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-/.f6452.5
Applied rewrites52.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6452.5
Applied rewrites52.6%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6452.8
Applied rewrites52.8%
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 57.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6472.8
Applied rewrites72.8%
Final simplification70.9%
(FPCore (A B C)
:precision binary64
(if (<= A -7.4)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A -6.5e-231)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 2.25e-189)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 3.4e-81)
(* (/ 180.0 PI) (atan (/ B (* C -2.0))))
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -7.4) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= -6.5e-231) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 2.25e-189) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 3.4e-81) {
tmp = (180.0 / ((double) M_PI)) * atan((B / (C * -2.0)));
} 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 <= -7.4) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= -6.5e-231) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 2.25e-189) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 3.4e-81) {
tmp = (180.0 / Math.PI) * Math.atan((B / (C * -2.0)));
} else {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -7.4: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= -6.5e-231: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 2.25e-189: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 3.4e-81: tmp = (180.0 / math.pi) * math.atan((B / (C * -2.0))) else: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -7.4) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= -6.5e-231) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 2.25e-189) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 3.4e-81) tmp = Float64(Float64(180.0 / pi) * atan(Float64(B / Float64(C * -2.0)))); 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 <= -7.4) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= -6.5e-231) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 2.25e-189) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 3.4e-81) tmp = (180.0 / pi) * atan((B / (C * -2.0))); else tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -7.4], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -6.5e-231], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.25e-189], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.4e-81], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B / N[(C * -2.0), $MachinePrecision]), $MachinePrecision]], $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 -7.4:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -6.5 \cdot 10^{-231}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 2.25 \cdot 10^{-189}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 3.4 \cdot 10^{-81}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B}{C \cdot -2}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -7.4000000000000004Initial program 20.8%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6469.3
Applied rewrites69.3%
if -7.4000000000000004 < A < -6.5000000000000004e-231Initial program 48.9%
Taylor expanded in B around inf
Applied rewrites37.6%
if -6.5000000000000004e-231 < A < 2.2499999999999998e-189Initial program 63.2%
Taylor expanded in B around -inf
Applied rewrites49.0%
if 2.2499999999999998e-189 < A < 3.3999999999999999e-81Initial program 44.5%
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-/.f6452.3
Applied rewrites52.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6452.3
Applied rewrites52.4%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6452.4
Applied rewrites52.4%
if 3.3999999999999999e-81 < A Initial program 73.2%
Taylor expanded in A around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f6464.5
Applied rewrites64.5%
Final simplification56.9%
(FPCore (A B C)
:precision binary64
(if (<= A -7.4)
(* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
(if (<= A -6.5e-231)
(* 180.0 (/ (atan -1.0) PI))
(if (<= A 2.25e-189)
(* 180.0 (/ (atan 1.0) PI))
(if (<= A 3.4e-81)
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI))
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI)))))))
double code(double A, double B, double C) {
double tmp;
if (A <= -7.4) {
tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
} else if (A <= -6.5e-231) {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
} else if (A <= 2.25e-189) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (A <= 3.4e-81) {
tmp = 180.0 * (atan((B * (-0.5 / C))) / ((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 <= -7.4) {
tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
} else if (A <= -6.5e-231) {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
} else if (A <= 2.25e-189) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (A <= 3.4e-81) {
tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / 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 <= -7.4: tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi) elif A <= -6.5e-231: tmp = 180.0 * (math.atan(-1.0) / math.pi) elif A <= 2.25e-189: tmp = 180.0 * (math.atan(1.0) / math.pi) elif A <= 3.4e-81: tmp = 180.0 * (math.atan((B * (-0.5 / C))) / 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 <= -7.4) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi)); elseif (A <= -6.5e-231) tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); elseif (A <= 2.25e-189) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (A <= 3.4e-81) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / 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 <= -7.4) tmp = 180.0 * (atan(((B * 0.5) / A)) / pi); elseif (A <= -6.5e-231) tmp = 180.0 * (atan(-1.0) / pi); elseif (A <= 2.25e-189) tmp = 180.0 * (atan(1.0) / pi); elseif (A <= 3.4e-81) tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); else tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -7.4], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -6.5e-231], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.25e-189], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.4e-81], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $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 -7.4:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
\mathbf{elif}\;A \leq -6.5 \cdot 10^{-231}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\mathbf{elif}\;A \leq 2.25 \cdot 10^{-189}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;A \leq 3.4 \cdot 10^{-81}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\end{array}
\end{array}
if A < -7.4000000000000004Initial program 20.8%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6469.3
Applied rewrites69.3%
if -7.4000000000000004 < A < -6.5000000000000004e-231Initial program 48.9%
Taylor expanded in B around inf
Applied rewrites37.6%
if -6.5000000000000004e-231 < A < 2.2499999999999998e-189Initial program 63.2%
Taylor expanded in B around -inf
Applied rewrites49.0%
if 2.2499999999999998e-189 < A < 3.3999999999999999e-81Initial program 44.5%
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-/.f6452.3
Applied rewrites52.3%
Applied rewrites52.3%
if 3.3999999999999999e-81 < A Initial program 73.2%
Taylor expanded in A around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f6464.5
Applied rewrites64.5%
Final simplification56.9%
(FPCore (A B C)
:precision binary64
(if (<= B -3.7e-96)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.85e-86)
(* 180.0 (/ (atan (/ (* A -2.0) B)) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.7e-96) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.85e-86) {
tmp = 180.0 * (atan(((A * -2.0) / B)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -3.7e-96) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.85e-86) {
tmp = 180.0 * (Math.atan(((A * -2.0) / B)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.7e-96: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.85e-86: tmp = 180.0 * (math.atan(((A * -2.0) / B)) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -3.7e-96) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.85e-86) tmp = Float64(180.0 * Float64(atan(Float64(Float64(A * -2.0) / B)) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -3.7e-96) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.85e-86) tmp = 180.0 * (atan(((A * -2.0) / B)) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.7e-96], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.85e-86], N[(180.0 * N[(N[ArcTan[N[(N[(A * -2.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.7 \cdot 10^{-96}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.85 \cdot 10^{-86}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.69999999999999986e-96Initial program 48.5%
Taylor expanded in B around -inf
Applied rewrites56.2%
if -3.69999999999999986e-96 < B < 2.8500000000000002e-86Initial program 60.0%
Taylor expanded in A around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f6445.6
Applied rewrites45.6%
if 2.8500000000000002e-86 < B Initial program 47.4%
Taylor expanded in B around inf
Applied rewrites56.1%
Final simplification52.6%
(FPCore (A B C)
:precision binary64
(if (<= C -0.00075)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C 3.9e-258)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (* B (/ -0.5 C))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -0.00075) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= 3.9e-258) {
tmp = 180.0 * (atan(1.0) / ((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 <= -0.00075) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= 3.9e-258) {
tmp = 180.0 * (Math.atan(1.0) / 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 <= -0.00075: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= 3.9e-258: tmp = 180.0 * (math.atan(1.0) / 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 <= -0.00075) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= 3.9e-258) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -0.00075) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= 3.9e-258) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((B * (-0.5 / C))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -0.00075], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 3.9e-258], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -0.00075:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 3.9 \cdot 10^{-258}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -7.5000000000000002e-4Initial program 68.0%
Taylor expanded in C around -inf
lower-*.f64N/A
lower-/.f6459.9
Applied rewrites59.9%
if -7.5000000000000002e-4 < C < 3.90000000000000004e-258Initial program 56.0%
Taylor expanded in B around -inf
Applied rewrites39.1%
if 3.90000000000000004e-258 < C Initial program 41.8%
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-/.f6452.0
Applied rewrites52.0%
Applied rewrites52.0%
Final simplification50.2%
(FPCore (A B C)
:precision binary64
(if (<= B -7.7e-143)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 4.5e-72)
(* 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 <= -7.7e-143) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 4.5e-72) {
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 <= -7.7e-143) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 4.5e-72) {
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 <= -7.7e-143: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 4.5e-72: 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 <= -7.7e-143) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 4.5e-72) 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 <= -7.7e-143) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 4.5e-72) 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, -7.7e-143], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.5e-72], 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 -7.7 \cdot 10^{-143}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-72}:\\
\;\;\;\;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 < -7.69999999999999985e-143Initial program 48.8%
Taylor expanded in B around -inf
Applied rewrites51.4%
if -7.69999999999999985e-143 < B < 4.5e-72Initial program 60.8%
Taylor expanded in C around -inf
lower-*.f64N/A
lower-/.f6436.1
Applied rewrites36.1%
if 4.5e-72 < B Initial program 47.2%
Taylor expanded in B around inf
Applied rewrites57.1%
(FPCore (A B C) :precision binary64 (if (<= A -2700000000000.0) (* 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 <= -2700000000000.0) {
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 <= -2700000000000.0) {
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 <= -2700000000000.0: 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 <= -2700000000000.0) tmp = Float64(180.0 * Float64(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 <= -2700000000000.0) 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, -2700000000000.0], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2700000000000:\\
\;\;\;\;180 \cdot \frac{\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 < -2.7e12Initial program 15.5%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.0
Applied rewrites73.0%
if -2.7e12 < A Initial program 61.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6459.8
Applied rewrites59.8%
(FPCore (A B C)
:precision binary64
(if (<= B -2e-85)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 2.6e-82)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2e-85) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 2.6e-82) {
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 <= -2e-85) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 2.6e-82) {
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 <= -2e-85: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 2.6e-82: 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 <= -2e-85) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 2.6e-82) 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 <= -2e-85) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 2.6e-82) 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, -2e-85], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.6e-82], 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 \cdot 10^{-85}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{-82}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2e-85Initial program 49.5%
Taylor expanded in B around -inf
Applied rewrites57.5%
if -2e-85 < B < 2.6e-82Initial program 58.1%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval27.8
Applied rewrites27.8%
if 2.6e-82 < B Initial program 47.9%
Taylor expanded in B around inf
Applied rewrites56.7%
(FPCore (A B C) :precision binary64 (if (<= B 2.6e-82) (* 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.6e-82) {
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.6e-82) {
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.6e-82: 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.6e-82) 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.6e-82) 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.6e-82], 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.6 \cdot 10^{-82}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 2.6e-82Initial program 54.0%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval16.7
Applied rewrites16.7%
if 2.6e-82 < B Initial program 47.9%
Taylor expanded in B around inf
Applied rewrites56.7%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(-1.0) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(-1.0) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(-1.0) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(-1.0) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(-1.0) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Initial program 52.0%
Taylor expanded in B around inf
Applied rewrites21.2%
herbie shell --seed 2024216
(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)))