
(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 17 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 (<= C 2.5e-57) (/ (* 180.0 (atan (* (- (- C A) (hypot (- A C) B)) (/ 1.0 B)))) PI) (/ (* 180.0 (atan (* -0.5 (/ B C)))) PI)))
double code(double A, double B, double C) {
double tmp;
if (C <= 2.5e-57) {
tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) * (1.0 / B)))) / ((double) M_PI);
} else {
tmp = (180.0 * atan((-0.5 * (B / C)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 2.5e-57) {
tmp = (180.0 * Math.atan((((C - A) - Math.hypot((A - C), B)) * (1.0 / B)))) / Math.PI;
} else {
tmp = (180.0 * Math.atan((-0.5 * (B / C)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 2.5e-57: tmp = (180.0 * math.atan((((C - A) - math.hypot((A - C), B)) * (1.0 / B)))) / math.pi else: tmp = (180.0 * math.atan((-0.5 * (B / C)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= 2.5e-57) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) * Float64(1.0 / B)))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(-0.5 * Float64(B / C)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 2.5e-57) tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) * (1.0 / B)))) / pi; else tmp = (180.0 * atan((-0.5 * (B / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 2.5e-57], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 2.5 \cdot 10^{-57}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)\right) \cdot \frac{1}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 2.5000000000000001e-57Initial program 66.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites84.9%
lift-pow.f64N/A
inv-powN/A
lift-/.f6484.9
Applied rewrites84.9%
if 2.5000000000000001e-57 < C Initial program 23.9%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6475.7
Applied rewrites75.7%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6475.7
Applied rewrites75.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites75.7%
Final simplification82.5%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))))
(if (<= t_0 -4e-93)
(/ (* 180.0 (atan (* (- (- C A) B) (/ 1.0 B)))) PI)
(if (<= t_0 5.0)
(* 180.0 (/ (atan (* (/ B C) -0.5)) PI))
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (- B)))) PI))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
double tmp;
if (t_0 <= -4e-93) {
tmp = (180.0 * atan((((C - A) - B) * (1.0 / B)))) / ((double) M_PI);
} else if (t_0 <= 5.0) {
tmp = 180.0 * (atan(((B / C) * -0.5)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - -B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
double tmp;
if (t_0 <= -4e-93) {
tmp = (180.0 * Math.atan((((C - A) - B) * (1.0 / B)))) / Math.PI;
} else if (t_0 <= 5.0) {
tmp = 180.0 * (Math.atan(((B / C) * -0.5)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - -B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) tmp = 0 if t_0 <= -4e-93: tmp = (180.0 * math.atan((((C - A) - B) * (1.0 / B)))) / math.pi elif t_0 <= 5.0: tmp = 180.0 * (math.atan(((B / C) * -0.5)) / math.pi) else: tmp = 180.0 * (math.atan(((1.0 / B) * ((C - A) - -B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) tmp = 0.0 if (t_0 <= -4e-93) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - B) * Float64(1.0 / B)))) / pi); elseif (t_0 <= 5.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / C) * -0.5)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - Float64(-B)))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); tmp = 0.0; if (t_0 <= -4e-93) tmp = (180.0 * atan((((C - A) - B) * (1.0 / B)))) / pi; elseif (t_0 <= 5.0) tmp = 180.0 * (atan(((B / C) * -0.5)) / pi); else tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - -B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-93], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - B), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 5.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - (-B)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-93}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\left(C - A\right) - B\right) \cdot \frac{1}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \left(-B\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -3.9999999999999996e-93Initial program 63.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites86.3%
lift-pow.f64N/A
inv-powN/A
lift-/.f6486.3
Applied rewrites86.3%
Taylor expanded in B around inf
Applied rewrites76.6%
if -3.9999999999999996e-93 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < 5Initial program 19.3%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6457.2
Applied rewrites57.2%
if 5 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) Initial program 60.6%
Taylor expanded in B around -inf
mul-1-negN/A
lower-neg.f6476.2
Applied rewrites76.2%
Final simplification73.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))))
(if (<= t_0 -4e-93)
(/ (* 180.0 (atan (* (- (- C A) B) (/ 1.0 B)))) PI)
(if (<= t_0 5.0)
(* 180.0 (/ (atan (* (/ B C) -0.5)) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
double tmp;
if (t_0 <= -4e-93) {
tmp = (180.0 * atan((((C - A) - B) * (1.0 / B)))) / ((double) M_PI);
} else if (t_0 <= 5.0) {
tmp = 180.0 * (atan(((B / C) * -0.5)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
double tmp;
if (t_0 <= -4e-93) {
tmp = (180.0 * Math.atan((((C - A) - B) * (1.0 / B)))) / Math.PI;
} else if (t_0 <= 5.0) {
tmp = 180.0 * (Math.atan(((B / C) * -0.5)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) tmp = 0 if t_0 <= -4e-93: tmp = (180.0 * math.atan((((C - A) - B) * (1.0 / B)))) / math.pi elif t_0 <= 5.0: tmp = 180.0 * (math.atan(((B / C) * -0.5)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) tmp = 0.0 if (t_0 <= -4e-93) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - B) * Float64(1.0 / B)))) / pi); elseif (t_0 <= 5.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / C) * -0.5)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); tmp = 0.0; if (t_0 <= -4e-93) tmp = (180.0 * atan((((C - A) - B) * (1.0 / B)))) / pi; elseif (t_0 <= 5.0) tmp = 180.0 * (atan(((B / C) * -0.5)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-93], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - B), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 5.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $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}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-93}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\left(C - A\right) - B\right) \cdot \frac{1}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -3.9999999999999996e-93Initial program 63.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites86.3%
lift-pow.f64N/A
inv-powN/A
lift-/.f6486.3
Applied rewrites86.3%
Taylor expanded in B around inf
Applied rewrites76.6%
if -3.9999999999999996e-93 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < 5Initial program 19.3%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6457.2
Applied rewrites57.2%
if 5 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) Initial program 60.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.2
Applied rewrites76.2%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))))
(if (<= t_0 -4e-93)
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) B))) PI))
(if (<= t_0 5.0)
(* 180.0 (/ (atan (* (/ B C) -0.5)) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
double tmp;
if (t_0 <= -4e-93) {
tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - B))) / ((double) M_PI));
} else if (t_0 <= 5.0) {
tmp = 180.0 * (atan(((B / C) * -0.5)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
double tmp;
if (t_0 <= -4e-93) {
tmp = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - B))) / Math.PI);
} else if (t_0 <= 5.0) {
tmp = 180.0 * (Math.atan(((B / C) * -0.5)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) tmp = 0 if t_0 <= -4e-93: tmp = 180.0 * (math.atan(((1.0 / B) * ((C - A) - B))) / math.pi) elif t_0 <= 5.0: tmp = 180.0 * (math.atan(((B / C) * -0.5)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) tmp = 0.0 if (t_0 <= -4e-93) tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - B))) / pi)); elseif (t_0 <= 5.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / C) * -0.5)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); tmp = 0.0; if (t_0 <= -4e-93) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - B))) / pi); elseif (t_0 <= 5.0) tmp = 180.0 * (atan(((B / C) * -0.5)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-93], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $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}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-93}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - B\right)\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -3.9999999999999996e-93Initial program 63.3%
Taylor expanded in B around inf
Applied rewrites76.6%
if -3.9999999999999996e-93 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < 5Initial program 19.3%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6457.2
Applied rewrites57.2%
if 5 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) Initial program 60.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.2
Applied rewrites76.2%
Final simplification73.4%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))))
(if (<= t_0 -4e-93)
(/ (* 180.0 (atan (* (- C B) (/ 1.0 B)))) PI)
(if (<= t_0 5.0)
(* 180.0 (/ (atan (* (/ B C) -0.5)) PI))
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))))
double code(double A, double B, double C) {
double t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
double tmp;
if (t_0 <= -4e-93) {
tmp = (180.0 * atan(((C - B) * (1.0 / B)))) / ((double) M_PI);
} else if (t_0 <= 5.0) {
tmp = 180.0 * (atan(((B / C) * -0.5)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
double tmp;
if (t_0 <= -4e-93) {
tmp = (180.0 * Math.atan(((C - B) * (1.0 / B)))) / Math.PI;
} else if (t_0 <= 5.0) {
tmp = 180.0 * (Math.atan(((B / C) * -0.5)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi) tmp = 0 if t_0 <= -4e-93: tmp = (180.0 * math.atan(((C - B) * (1.0 / B)))) / math.pi elif t_0 <= 5.0: tmp = 180.0 * (math.atan(((B / C) * -0.5)) / math.pi) else: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) tmp = 0.0 if (t_0 <= -4e-93) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - B) * Float64(1.0 / B)))) / pi); elseif (t_0 <= 5.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / C) * -0.5)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); tmp = 0.0; if (t_0 <= -4e-93) tmp = (180.0 * atan(((C - B) * (1.0 / B)))) / pi; elseif (t_0 <= 5.0) tmp = 180.0 * (atan(((B / C) * -0.5)) / pi); else tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-93], N[(N[(180.0 * N[ArcTan[N[(N[(C - B), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 5.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $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}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-93}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(C - B\right) \cdot \frac{1}{B}\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < -3.9999999999999996e-93Initial program 63.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites86.3%
lift-pow.f64N/A
inv-powN/A
lift-/.f6486.3
Applied rewrites86.3%
Taylor expanded in B around inf
Applied rewrites76.6%
Taylor expanded in A around 0
Applied rewrites64.0%
if -3.9999999999999996e-93 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) < 5Initial program 19.3%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6457.2
Applied rewrites57.2%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6457.2
Applied rewrites57.2%
if 5 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))) (PI.f64))) Initial program 60.6%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6476.2
Applied rewrites76.2%
(FPCore (A B C)
:precision binary64
(if (<= C -9e+62)
(/ (* 180.0 (atan (* (- C (hypot B C)) (/ 1.0 B)))) PI)
(if (<= C 2.5e-57)
(/ (* 180.0 (atan (/ (+ (hypot B A) A) (- B)))) PI)
(/ (* 180.0 (atan (* -0.5 (/ B C)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -9e+62) {
tmp = (180.0 * atan(((C - hypot(B, C)) * (1.0 / B)))) / ((double) M_PI);
} else if (C <= 2.5e-57) {
tmp = (180.0 * atan(((hypot(B, A) + A) / -B))) / ((double) M_PI);
} else {
tmp = (180.0 * atan((-0.5 * (B / C)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -9e+62) {
tmp = (180.0 * Math.atan(((C - Math.hypot(B, C)) * (1.0 / B)))) / Math.PI;
} else if (C <= 2.5e-57) {
tmp = (180.0 * Math.atan(((Math.hypot(B, A) + A) / -B))) / Math.PI;
} else {
tmp = (180.0 * Math.atan((-0.5 * (B / C)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -9e+62: tmp = (180.0 * math.atan(((C - math.hypot(B, C)) * (1.0 / B)))) / math.pi elif C <= 2.5e-57: tmp = (180.0 * math.atan(((math.hypot(B, A) + A) / -B))) / math.pi else: tmp = (180.0 * math.atan((-0.5 * (B / C)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= -9e+62) tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - hypot(B, C)) * Float64(1.0 / B)))) / pi); elseif (C <= 2.5e-57) tmp = Float64(Float64(180.0 * atan(Float64(Float64(hypot(B, A) + A) / Float64(-B)))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(-0.5 * Float64(B / C)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -9e+62) tmp = (180.0 * atan(((C - hypot(B, C)) * (1.0 / B)))) / pi; elseif (C <= 2.5e-57) tmp = (180.0 * atan(((hypot(B, A) + A) / -B))) / pi; else tmp = (180.0 * atan((-0.5 * (B / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -9e+62], N[(N[(180.0 * N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 2.5e-57], N[(N[(180.0 * N[ArcTan[N[(N[(N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision] + A), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -9 \cdot 10^{+62}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(C - \mathsf{hypot}\left(B, C\right)\right) \cdot \frac{1}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.5 \cdot 10^{-57}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\mathsf{hypot}\left(B, A\right) + A}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -8.99999999999999997e62Initial program 85.1%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites98.4%
lift-pow.f64N/A
inv-powN/A
lift-/.f6498.4
Applied rewrites98.4%
Taylor expanded in A around 0
lower--.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6495.0
Applied rewrites95.0%
if -8.99999999999999997e62 < C < 2.5000000000000001e-57Initial program 58.0%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites79.0%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
pow2N/A
lower-hypot.f6475.2
Applied rewrites75.2%
if 2.5000000000000001e-57 < C Initial program 23.9%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6475.7
Applied rewrites75.7%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6475.7
Applied rewrites75.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites75.7%
Final simplification79.8%
(FPCore (A B C)
:precision binary64
(if (<= C -3e+143)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
(if (<= C 2.5e-57)
(/ (* 180.0 (atan (/ (+ (hypot B A) A) (- B)))) PI)
(/ (* 180.0 (atan (* -0.5 (/ B C)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -3e+143) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else if (C <= 2.5e-57) {
tmp = (180.0 * atan(((hypot(B, A) + A) / -B))) / ((double) M_PI);
} else {
tmp = (180.0 * atan((-0.5 * (B / C)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -3e+143) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else if (C <= 2.5e-57) {
tmp = (180.0 * Math.atan(((Math.hypot(B, A) + A) / -B))) / Math.PI;
} else {
tmp = (180.0 * Math.atan((-0.5 * (B / C)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -3e+143: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) elif C <= 2.5e-57: tmp = (180.0 * math.atan(((math.hypot(B, A) + A) / -B))) / math.pi else: tmp = (180.0 * math.atan((-0.5 * (B / C)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= -3e+143) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); elseif (C <= 2.5e-57) tmp = Float64(Float64(180.0 * atan(Float64(Float64(hypot(B, A) + A) / Float64(-B)))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(-0.5 * Float64(B / C)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -3e+143) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); elseif (C <= 2.5e-57) tmp = (180.0 * atan(((hypot(B, A) + A) / -B))) / pi; else tmp = (180.0 * atan((-0.5 * (B / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -3e+143], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.5e-57], N[(N[(180.0 * N[ArcTan[N[(N[(N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision] + A), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -3 \cdot 10^{+143}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.5 \cdot 10^{-57}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\mathsf{hypot}\left(B, A\right) + A}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -3.0000000000000001e143Initial program 94.0%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6497.5
Applied rewrites97.5%
if -3.0000000000000001e143 < C < 2.5000000000000001e-57Initial program 58.4%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites80.6%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
pow2N/A
lower-hypot.f6475.3
Applied rewrites75.3%
if 2.5000000000000001e-57 < C Initial program 23.9%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6475.7
Applied rewrites75.7%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6475.7
Applied rewrites75.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites75.7%
Final simplification79.0%
(FPCore (A B C)
:precision binary64
(if (<= C -3e+143)
(* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
(if (<= C 2.5e-57)
(* 180.0 (/ (atan (/ (+ (hypot A B) A) (- B))) PI))
(/ (* 180.0 (atan (* -0.5 (/ B C)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -3e+143) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else if (C <= 2.5e-57) {
tmp = 180.0 * (atan(((hypot(A, B) + A) / -B)) / ((double) M_PI));
} else {
tmp = (180.0 * atan((-0.5 * (B / C)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -3e+143) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else if (C <= 2.5e-57) {
tmp = 180.0 * (Math.atan(((Math.hypot(A, B) + A) / -B)) / Math.PI);
} else {
tmp = (180.0 * Math.atan((-0.5 * (B / C)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -3e+143: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) elif C <= 2.5e-57: tmp = 180.0 * (math.atan(((math.hypot(A, B) + A) / -B)) / math.pi) else: tmp = (180.0 * math.atan((-0.5 * (B / C)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= -3e+143) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); elseif (C <= 2.5e-57) tmp = Float64(180.0 * Float64(atan(Float64(Float64(hypot(A, B) + A) / Float64(-B))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(-0.5 * Float64(B / C)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -3e+143) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); elseif (C <= 2.5e-57) tmp = 180.0 * (atan(((hypot(A, B) + A) / -B)) / pi); else tmp = (180.0 * atan((-0.5 * (B / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -3e+143], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.5e-57], N[(180.0 * N[(N[ArcTan[N[(N[(N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision] + A), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -3 \cdot 10^{+143}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 2.5 \cdot 10^{-57}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{hypot}\left(A, B\right) + A}{-B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -3.0000000000000001e143Initial program 94.0%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6497.5
Applied rewrites97.5%
if -3.0000000000000001e143 < C < 2.5000000000000001e-57Initial program 58.4%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.3
Applied rewrites75.3%
if 2.5000000000000001e-57 < C Initial program 23.9%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6475.7
Applied rewrites75.7%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6475.7
Applied rewrites75.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites75.7%
Final simplification79.0%
(FPCore (A B C)
:precision binary64
(if (<= B -4.9e-188)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 8.5e-273)
(/ (* (atan 0.0) 180.0) PI)
(if (<= B 2.8e-65)
(/ (* 180.0 (atan (/ C B))) PI)
(* 180.0 (/ (atan -1.0) PI))))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.9e-188) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 8.5e-273) {
tmp = (atan(0.0) * 180.0) / ((double) M_PI);
} else if (B <= 2.8e-65) {
tmp = (180.0 * atan((C / B))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -4.9e-188) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 8.5e-273) {
tmp = (Math.atan(0.0) * 180.0) / Math.PI;
} else if (B <= 2.8e-65) {
tmp = (180.0 * Math.atan((C / B))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.9e-188: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 8.5e-273: tmp = (math.atan(0.0) * 180.0) / math.pi elif B <= 2.8e-65: tmp = (180.0 * math.atan((C / B))) / math.pi else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -4.9e-188) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 8.5e-273) tmp = Float64(Float64(atan(0.0) * 180.0) / pi); elseif (B <= 2.8e-65) tmp = Float64(Float64(180.0 * atan(Float64(C / B))) / pi); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -4.9e-188) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 8.5e-273) tmp = (atan(0.0) * 180.0) / pi; elseif (B <= 2.8e-65) tmp = (180.0 * atan((C / B))) / pi; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.9e-188], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8.5e-273], N[(N[(N[ArcTan[0.0], $MachinePrecision] * 180.0), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[B, 2.8e-65], N[(N[(180.0 * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.9 \cdot 10^{-188}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 8.5 \cdot 10^{-273}:\\
\;\;\;\;\frac{\tan^{-1} 0 \cdot 180}{\pi}\\
\mathbf{elif}\;B \leq 2.8 \cdot 10^{-65}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.90000000000000004e-188Initial program 56.6%
Taylor expanded in B around -inf
Applied rewrites50.5%
if -4.90000000000000004e-188 < B < 8.5000000000000008e-273Initial program 40.9%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites72.4%
lift-pow.f64N/A
inv-powN/A
lift-/.f6472.4
Applied rewrites72.4%
Taylor expanded in C around inf
associate-*r/N/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
mul0-lftN/A
lift-/.f64N/A
mul0-lft46.7
Applied rewrites46.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.7
inv-pow46.7
lift-/.f64N/A
div046.7
Applied rewrites46.7%
if 8.5000000000000008e-273 < B < 2.8e-65Initial program 61.4%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites79.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6456.5
Applied rewrites56.5%
Taylor expanded in C around inf
lower-/.f6442.4
Applied rewrites42.4%
if 2.8e-65 < B Initial program 56.4%
Taylor expanded in B around inf
Applied rewrites54.2%
Final simplification49.7%
(FPCore (A B C)
:precision binary64
(if (<= C -6.5e+63)
(* 180.0 (/ (atan (* (/ C B) 2.0)) PI))
(if (<= C 1.75e-62)
(/ (* 180.0 (atan (- 1.0 (/ A B)))) PI)
(/ (* 180.0 (atan (* -0.5 (/ B C)))) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -6.5e+63) {
tmp = 180.0 * (atan(((C / B) * 2.0)) / ((double) M_PI));
} else if (C <= 1.75e-62) {
tmp = (180.0 * atan((1.0 - (A / B)))) / ((double) M_PI);
} else {
tmp = (180.0 * atan((-0.5 * (B / C)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -6.5e+63) {
tmp = 180.0 * (Math.atan(((C / B) * 2.0)) / Math.PI);
} else if (C <= 1.75e-62) {
tmp = (180.0 * Math.atan((1.0 - (A / B)))) / Math.PI;
} else {
tmp = (180.0 * Math.atan((-0.5 * (B / C)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -6.5e+63: tmp = 180.0 * (math.atan(((C / B) * 2.0)) / math.pi) elif C <= 1.75e-62: tmp = (180.0 * math.atan((1.0 - (A / B)))) / math.pi else: tmp = (180.0 * math.atan((-0.5 * (B / C)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= -6.5e+63) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) * 2.0)) / pi)); elseif (C <= 1.75e-62) tmp = Float64(Float64(180.0 * atan(Float64(1.0 - Float64(A / B)))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(-0.5 * Float64(B / C)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -6.5e+63) tmp = 180.0 * (atan(((C / B) * 2.0)) / pi); elseif (C <= 1.75e-62) tmp = (180.0 * atan((1.0 - (A / B)))) / pi; else tmp = (180.0 * atan((-0.5 * (B / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -6.5e+63], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.75e-62], N[(N[(180.0 * N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -6.5 \cdot 10^{+63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.75 \cdot 10^{-62}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < -6.49999999999999992e63Initial program 85.1%
Taylor expanded in C around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6480.5
Applied rewrites80.5%
if -6.49999999999999992e63 < C < 1.7500000000000001e-62Initial program 57.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites78.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6453.1
Applied rewrites53.1%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6449.1
Applied rewrites49.1%
if 1.7500000000000001e-62 < C Initial program 25.0%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6474.8
Applied rewrites74.8%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6474.8
Applied rewrites74.8%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites74.9%
Final simplification62.9%
(FPCore (A B C)
:precision binary64
(if (<= C -6.5e+63)
(* 180.0 (/ (atan (* (/ C B) 2.0)) PI))
(if (<= C 1.75e-62)
(/ (* 180.0 (atan (- 1.0 (/ A B)))) PI)
(* 180.0 (/ (atan (* (/ B C) -0.5)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -6.5e+63) {
tmp = 180.0 * (atan(((C / B) * 2.0)) / ((double) M_PI));
} else if (C <= 1.75e-62) {
tmp = (180.0 * atan((1.0 - (A / B)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((B / C) * -0.5)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -6.5e+63) {
tmp = 180.0 * (Math.atan(((C / B) * 2.0)) / Math.PI);
} else if (C <= 1.75e-62) {
tmp = (180.0 * Math.atan((1.0 - (A / B)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((B / C) * -0.5)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -6.5e+63: tmp = 180.0 * (math.atan(((C / B) * 2.0)) / math.pi) elif C <= 1.75e-62: tmp = (180.0 * math.atan((1.0 - (A / B)))) / math.pi else: tmp = 180.0 * (math.atan(((B / C) * -0.5)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -6.5e+63) tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) * 2.0)) / pi)); elseif (C <= 1.75e-62) tmp = Float64(Float64(180.0 * atan(Float64(1.0 - Float64(A / B)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / C) * -0.5)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -6.5e+63) tmp = 180.0 * (atan(((C / B) * 2.0)) / pi); elseif (C <= 1.75e-62) tmp = (180.0 * atan((1.0 - (A / B)))) / pi; else tmp = 180.0 * (atan(((B / C) * -0.5)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -6.5e+63], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.75e-62], N[(N[(180.0 * N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -6.5 \cdot 10^{+63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.75 \cdot 10^{-62}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < -6.49999999999999992e63Initial program 85.1%
Taylor expanded in C around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6480.5
Applied rewrites80.5%
if -6.49999999999999992e63 < C < 1.7500000000000001e-62Initial program 57.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites78.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6453.1
Applied rewrites53.1%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6449.1
Applied rewrites49.1%
if 1.7500000000000001e-62 < C Initial program 25.0%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6474.8
Applied rewrites74.8%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6474.8
Applied rewrites74.8%
Final simplification62.9%
(FPCore (A B C)
:precision binary64
(if (<= C -6.5e+63)
(/ (* 180.0 (atan (/ C B))) PI)
(if (<= C 1.75e-62)
(/ (* 180.0 (atan (- 1.0 (/ A B)))) PI)
(* 180.0 (/ (atan (* (/ B C) -0.5)) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -6.5e+63) {
tmp = (180.0 * atan((C / B))) / ((double) M_PI);
} else if (C <= 1.75e-62) {
tmp = (180.0 * atan((1.0 - (A / B)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((B / C) * -0.5)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -6.5e+63) {
tmp = (180.0 * Math.atan((C / B))) / Math.PI;
} else if (C <= 1.75e-62) {
tmp = (180.0 * Math.atan((1.0 - (A / B)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((B / C) * -0.5)) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -6.5e+63: tmp = (180.0 * math.atan((C / B))) / math.pi elif C <= 1.75e-62: tmp = (180.0 * math.atan((1.0 - (A / B)))) / math.pi else: tmp = 180.0 * (math.atan(((B / C) * -0.5)) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -6.5e+63) tmp = Float64(Float64(180.0 * atan(Float64(C / B))) / pi); elseif (C <= 1.75e-62) tmp = Float64(Float64(180.0 * atan(Float64(1.0 - Float64(A / B)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / C) * -0.5)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -6.5e+63) tmp = (180.0 * atan((C / B))) / pi; elseif (C <= 1.75e-62) tmp = (180.0 * atan((1.0 - (A / B)))) / pi; else tmp = 180.0 * (atan(((B / C) * -0.5)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -6.5e+63], N[(N[(180.0 * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 1.75e-62], N[(N[(180.0 * N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -6.5 \cdot 10^{+63}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.75 \cdot 10^{-62}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot -0.5\right)}{\pi}\\
\end{array}
\end{array}
if C < -6.49999999999999992e63Initial program 85.1%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites98.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6484.7
Applied rewrites84.7%
Taylor expanded in C around inf
lower-/.f6480.3
Applied rewrites80.3%
if -6.49999999999999992e63 < C < 1.7500000000000001e-62Initial program 57.7%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites78.8%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6453.1
Applied rewrites53.1%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6449.1
Applied rewrites49.1%
if 1.7500000000000001e-62 < C Initial program 25.0%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6474.8
Applied rewrites74.8%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6474.8
Applied rewrites74.8%
Final simplification62.9%
(FPCore (A B C)
:precision binary64
(if (<= C -6.5e+63)
(/ (* 180.0 (atan (/ C B))) PI)
(if (<= C 3.9e+73)
(/ (* 180.0 (atan (- 1.0 (/ A B)))) PI)
(/ (* (atan 0.0) 180.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (C <= -6.5e+63) {
tmp = (180.0 * atan((C / B))) / ((double) M_PI);
} else if (C <= 3.9e+73) {
tmp = (180.0 * atan((1.0 - (A / B)))) / ((double) M_PI);
} else {
tmp = (atan(0.0) * 180.0) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -6.5e+63) {
tmp = (180.0 * Math.atan((C / B))) / Math.PI;
} else if (C <= 3.9e+73) {
tmp = (180.0 * Math.atan((1.0 - (A / B)))) / Math.PI;
} else {
tmp = (Math.atan(0.0) * 180.0) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -6.5e+63: tmp = (180.0 * math.atan((C / B))) / math.pi elif C <= 3.9e+73: tmp = (180.0 * math.atan((1.0 - (A / B)))) / math.pi else: tmp = (math.atan(0.0) * 180.0) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= -6.5e+63) tmp = Float64(Float64(180.0 * atan(Float64(C / B))) / pi); elseif (C <= 3.9e+73) tmp = Float64(Float64(180.0 * atan(Float64(1.0 - Float64(A / B)))) / pi); else tmp = Float64(Float64(atan(0.0) * 180.0) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -6.5e+63) tmp = (180.0 * atan((C / B))) / pi; elseif (C <= 3.9e+73) tmp = (180.0 * atan((1.0 - (A / B)))) / pi; else tmp = (atan(0.0) * 180.0) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -6.5e+63], N[(N[(180.0 * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 3.9e+73], N[(N[(180.0 * N[ArcTan[N[(1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(N[ArcTan[0.0], $MachinePrecision] * 180.0), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -6.5 \cdot 10^{+63}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 3.9 \cdot 10^{+73}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} 0 \cdot 180}{\pi}\\
\end{array}
\end{array}
if C < -6.49999999999999992e63Initial program 85.1%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites98.4%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6484.7
Applied rewrites84.7%
Taylor expanded in C around inf
lower-/.f6480.3
Applied rewrites80.3%
if -6.49999999999999992e63 < C < 3.9000000000000001e73Initial program 55.6%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites74.9%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6449.3
Applied rewrites49.3%
Taylor expanded in C around 0
lower--.f64N/A
lower-/.f6445.9
Applied rewrites45.9%
if 3.9000000000000001e73 < C Initial program 16.9%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites58.2%
lift-pow.f64N/A
inv-powN/A
lift-/.f6458.2
Applied rewrites58.2%
Taylor expanded in C around inf
associate-*r/N/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
mul0-lftN/A
lift-/.f64N/A
mul0-lft40.9
Applied rewrites40.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.9
inv-pow40.9
lift-/.f64N/A
div040.9
Applied rewrites40.9%
Final simplification52.8%
(FPCore (A B C) :precision binary64 (if (<= C 1.75e-62) (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI)) (/ (* 180.0 (atan (* -0.5 (/ B C)))) PI)))
double code(double A, double B, double C) {
double tmp;
if (C <= 1.75e-62) {
tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((-0.5 * (B / C)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 1.75e-62) {
tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
} else {
tmp = (180.0 * Math.atan((-0.5 * (B / C)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 1.75e-62: tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi) else: tmp = (180.0 * math.atan((-0.5 * (B / C)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= 1.75e-62) tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(-0.5 * Float64(B / C)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 1.75e-62) tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi); else tmp = (180.0 * atan((-0.5 * (B / C)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 1.75e-62], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.75 \cdot 10^{-62}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\end{array}
\end{array}
if C < 1.7500000000000001e-62Initial program 66.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f6462.8
Applied rewrites62.8%
if 1.7500000000000001e-62 < C Initial program 25.0%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6474.8
Applied rewrites74.8%
Taylor expanded in A around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6474.8
Applied rewrites74.8%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites74.9%
Final simplification66.0%
(FPCore (A B C)
:precision binary64
(if (<= B -4.9e-188)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 7e-201)
(/ (* (atan 0.0) 180.0) PI)
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.9e-188) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 7e-201) {
tmp = (atan(0.0) * 180.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 <= -4.9e-188) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 7e-201) {
tmp = (Math.atan(0.0) * 180.0) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.9e-188: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 7e-201: tmp = (math.atan(0.0) * 180.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 <= -4.9e-188) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 7e-201) tmp = Float64(Float64(atan(0.0) * 180.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 <= -4.9e-188) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 7e-201) tmp = (atan(0.0) * 180.0) / pi; else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.9e-188], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7e-201], N[(N[(N[ArcTan[0.0], $MachinePrecision] * 180.0), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.9 \cdot 10^{-188}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 7 \cdot 10^{-201}:\\
\;\;\;\;\frac{\tan^{-1} 0 \cdot 180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -4.90000000000000004e-188Initial program 56.6%
Taylor expanded in B around -inf
Applied rewrites50.5%
if -4.90000000000000004e-188 < B < 7.00000000000000016e-201Initial program 50.5%
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
Applied rewrites79.0%
lift-pow.f64N/A
inv-powN/A
lift-/.f6479.0
Applied rewrites79.0%
Taylor expanded in C around inf
associate-*r/N/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
mul0-lftN/A
lift-/.f64N/A
mul0-lft40.6
Applied rewrites40.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.6
inv-pow40.6
lift-/.f64N/A
div040.6
Applied rewrites40.6%
if 7.00000000000000016e-201 < B Initial program 56.9%
Taylor expanded in B around inf
Applied rewrites45.8%
Final simplification46.4%
(FPCore (A B C) :precision binary64 (if (<= B -2.85e-308) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.85e-308) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -2.85e-308) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.85e-308: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan(-1.0) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2.85e-308) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(-1.0) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.85e-308) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.85e-308], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.85 \cdot 10^{-308}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -2.85000000000000019e-308Initial program 52.9%
Taylor expanded in B around -inf
Applied rewrites40.6%
if -2.85000000000000019e-308 < B Initial program 57.7%
Taylor expanded in B around inf
Applied rewrites38.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 55.3%
Taylor expanded in B around inf
Applied rewrites20.5%
herbie shell --seed 2025085
(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)))