
(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 16 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 1.2e+14) (/ (* 180.0 (atan (/ (- (- C A) (hypot (- C A) B)) B))) PI) (/ (* 180.0 (atan (/ (* B -0.5) (- C A)))) PI)))
double code(double A, double B, double C) {
double tmp;
if (C <= 1.2e+14) {
tmp = (180.0 * atan((((C - A) - hypot((C - A), B)) / B))) / ((double) M_PI);
} else {
tmp = (180.0 * atan(((B * -0.5) / (C - A)))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 1.2e+14) {
tmp = (180.0 * Math.atan((((C - A) - Math.hypot((C - A), B)) / B))) / Math.PI;
} else {
tmp = (180.0 * Math.atan(((B * -0.5) / (C - A)))) / Math.PI;
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 1.2e+14: tmp = (180.0 * math.atan((((C - A) - math.hypot((C - A), B)) / B))) / math.pi else: tmp = (180.0 * math.atan(((B * -0.5) / (C - A)))) / math.pi return tmp
function code(A, B, C) tmp = 0.0 if (C <= 1.2e+14) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(C - A), B)) / B))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * -0.5) / Float64(C - A)))) / pi); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 1.2e+14) tmp = (180.0 * atan((((C - A) - hypot((C - A), B)) / B))) / pi; else tmp = (180.0 * atan(((B * -0.5) / (C - A)))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 1.2e+14], 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], N[(N[(180.0 * N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / N[(C - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C - A}\right)}{\pi}\\
\end{array}
\end{array}
if C < 1.2e14Initial program 66.0%
Applied rewrites88.5%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites66.0%
lift--.f64N/A
lift--.f64N/A
lower-hypot.f6488.5
Applied rewrites88.5%
if 1.2e14 < C Initial program 20.1%
Applied rewrites47.1%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites20.1%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.9
Applied rewrites79.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)))))))
(if (<= t_0 -0.5)
(* 180.0 (/ (atan (+ (/ (- C A) B) -1.0)) PI))
(if (<= t_0 0.0)
(/ (* 180.0 (atan (/ (* B -0.5) (- C A)))) PI)
(/ (* 180.0 (atan (/ (+ (- C A) B) B))) PI)))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / ((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((((C - A) + B) / B))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (Math.atan((((C - A) / B) + -1.0)) / 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((((C - A) + B) / B))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) tmp = 0 if t_0 <= -0.5: tmp = 180.0 * (math.atan((((C - A) / B) + -1.0)) / 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((((C - A) + B) / B))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + -1.0)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * -0.5) / Float64(C - A)))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) + B) / B))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); tmp = 0.0; if (t_0 <= -0.5) tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / pi); elseif (t_0 <= 0.0) tmp = (180.0 * atan(((B * -0.5) / (C - A)))) / pi; else tmp = (180.0 * atan((((C - A) + B) / B))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / N[(C - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] + B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -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}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) + B}{B}\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 60.3%
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--.f6476.6
Applied rewrites76.6%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 27.6%
Applied rewrites27.6%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites27.6%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.4
Applied rewrites99.4%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 57.3%
Applied rewrites87.4%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites57.3%
Taylor expanded in B around -inf
mul-1-negN/A
lower-neg.f6477.7
Applied rewrites77.7%
Final simplification80.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* 180.0 (/ (atan (+ t_1 -1.0)) PI))
(if (<= t_0 0.0)
(/ (* 180.0 (atan (/ (* B -0.5) (- C A)))) PI)
(/ (* 180.0 (atan (+ t_1 1.0))) PI)))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (atan((t_1 + -1.0)) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = (180.0 * atan(((B * -0.5) / (C - A)))) / ((double) M_PI);
} else {
tmp = (180.0 * atan((t_1 + 1.0))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (Math.atan((t_1 + -1.0)) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = (180.0 * Math.atan(((B * -0.5) / (C - A)))) / Math.PI;
} else {
tmp = (180.0 * Math.atan((t_1 + 1.0))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = 180.0 * (math.atan((t_1 + -1.0)) / math.pi) elif t_0 <= 0.0: tmp = (180.0 * math.atan(((B * -0.5) / (C - A)))) / math.pi else: tmp = (180.0 * math.atan((t_1 + 1.0))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(180.0 * Float64(atan(Float64(t_1 + -1.0)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(B * -0.5) / Float64(C - A)))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(t_1 + 1.0))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = 180.0 * (atan((t_1 + -1.0)) / pi); elseif (t_0 <= 0.0) tmp = (180.0 * atan(((B * -0.5) / (C - A)))) / pi; else tmp = (180.0 * atan((t_1 + 1.0))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(180.0 * N[(N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / N[(C - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C - A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_1 + 1\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 60.3%
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--.f6476.6
Applied rewrites76.6%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 27.6%
Applied rewrites27.6%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites27.6%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.4
Applied rewrites99.4%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 57.3%
Applied rewrites87.4%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites57.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification80.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* 180.0 (/ (atan (+ t_1 -1.0)) PI))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* -0.5 (/ B (- C A)))) PI))
(/ (* 180.0 (atan (+ t_1 1.0))) PI)))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (atan((t_1 + -1.0)) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan((-0.5 * (B / (C - A)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((t_1 + 1.0))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (Math.atan((t_1 + -1.0)) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan((-0.5 * (B / (C - A)))) / Math.PI);
} else {
tmp = (180.0 * Math.atan((t_1 + 1.0))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = 180.0 * (math.atan((t_1 + -1.0)) / math.pi) elif t_0 <= 0.0: tmp = 180.0 * (math.atan((-0.5 * (B / (C - A)))) / math.pi) else: tmp = (180.0 * math.atan((t_1 + 1.0))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(180.0 * Float64(atan(Float64(t_1 + -1.0)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / Float64(C - A)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(t_1 + 1.0))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = 180.0 * (atan((t_1 + -1.0)) / pi); elseif (t_0 <= 0.0) tmp = 180.0 * (atan((-0.5 * (B / (C - A)))) / pi); else tmp = (180.0 * atan((t_1 + 1.0))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(180.0 * N[(N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_1 + 1\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 60.3%
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--.f6476.6
Applied rewrites76.6%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 27.6%
Applied rewrites27.6%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites27.6%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.2
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.2
Applied rewrites99.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.3%
Applied rewrites87.4%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites57.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification80.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* 180.0 (/ (atan (+ t_1 -1.0)) PI))
(if (<= t_0 0.0)
(* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI))
(/ (* 180.0 (atan (+ t_1 1.0))) PI)))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (atan((t_1 + -1.0)) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((t_1 + 1.0))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (Math.atan((t_1 + -1.0)) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = 180.0 * (Math.atan((B * (0.5 / (A - C)))) / Math.PI);
} else {
tmp = (180.0 * Math.atan((t_1 + 1.0))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = 180.0 * (math.atan((t_1 + -1.0)) / math.pi) elif t_0 <= 0.0: tmp = 180.0 * (math.atan((B * (0.5 / (A - C)))) / math.pi) else: tmp = (180.0 * math.atan((t_1 + 1.0))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(180.0 * Float64(atan(Float64(t_1 + -1.0)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(t_1 + 1.0))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = 180.0 * (atan((t_1 + -1.0)) / pi); elseif (t_0 <= 0.0) tmp = 180.0 * (atan((B * (0.5 / (A - C)))) / pi); else tmp = (180.0 * atan((t_1 + 1.0))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(180.0 * N[(N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(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[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_1 + 1\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 60.3%
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--.f6476.6
Applied rewrites76.6%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 27.6%
Applied rewrites27.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
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
remove-double-negN/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6499.2
Applied rewrites99.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.3%
Applied rewrites87.4%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites57.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification80.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* 180.0 (/ (atan (+ t_1 -1.0)) PI))
(if (<= t_0 0.0)
(/ (atan (/ B (* A 2.0))) (* PI 0.005555555555555556))
(/ (* 180.0 (atan (+ t_1 1.0))) PI)))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (atan((t_1 + -1.0)) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = atan((B / (A * 2.0))) / (((double) M_PI) * 0.005555555555555556);
} else {
tmp = (180.0 * atan((t_1 + 1.0))) / ((double) M_PI);
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (Math.atan((t_1 + -1.0)) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = Math.atan((B / (A * 2.0))) / (Math.PI * 0.005555555555555556);
} else {
tmp = (180.0 * Math.atan((t_1 + 1.0))) / Math.PI;
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = 180.0 * (math.atan((t_1 + -1.0)) / math.pi) elif t_0 <= 0.0: tmp = math.atan((B / (A * 2.0))) / (math.pi * 0.005555555555555556) else: tmp = (180.0 * math.atan((t_1 + 1.0))) / math.pi return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(180.0 * Float64(atan(Float64(t_1 + -1.0)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(atan(Float64(B / Float64(A * 2.0))) / Float64(pi * 0.005555555555555556)); else tmp = Float64(Float64(180.0 * atan(Float64(t_1 + 1.0))) / pi); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = 180.0 * (atan((t_1 + -1.0)) / pi); elseif (t_0 <= 0.0) tmp = atan((B / (A * 2.0))) / (pi * 0.005555555555555556); else tmp = (180.0 * atan((t_1 + 1.0))) / pi; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(180.0 * N[(N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[ArcTan[N[(B / N[(A * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A \cdot 2}\right)}{\pi \cdot 0.005555555555555556}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(t\_1 + 1\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 60.3%
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--.f6476.6
Applied rewrites76.6%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 27.6%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6445.6
Applied rewrites45.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
metadata-evalN/A
times-fracN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites61.3%
lift-PI.f64N/A
frac-2negN/A
lift-*.f64N/A
lift-/.f64N/A
lift-atan.f64N/A
lift-*.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites61.4%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 57.3%
Applied rewrites87.4%
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-hypot.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites57.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification75.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* 180.0 (/ (atan (+ t_1 -1.0)) PI))
(if (<= t_0 0.0)
(/ (atan (/ B (* A 2.0))) (* PI 0.005555555555555556))
(* 180.0 (/ (atan (+ t_1 1.0)) PI))))))
double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (atan((t_1 + -1.0)) / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = atan((B / (A * 2.0))) / (((double) M_PI) * 0.005555555555555556);
} else {
tmp = 180.0 * (atan((t_1 + 1.0)) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = 180.0 * (Math.atan((t_1 + -1.0)) / Math.PI);
} else if (t_0 <= 0.0) {
tmp = Math.atan((B / (A * 2.0))) / (Math.PI * 0.005555555555555556);
} else {
tmp = 180.0 * (Math.atan((t_1 + 1.0)) / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = 180.0 * (math.atan((t_1 + -1.0)) / math.pi) elif t_0 <= 0.0: tmp = math.atan((B / (A * 2.0))) / (math.pi * 0.005555555555555556) else: tmp = 180.0 * (math.atan((t_1 + 1.0)) / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(180.0 * Float64(atan(Float64(t_1 + -1.0)) / pi)); elseif (t_0 <= 0.0) tmp = Float64(atan(Float64(B / Float64(A * 2.0))) / Float64(pi * 0.005555555555555556)); else tmp = Float64(180.0 * Float64(atan(Float64(t_1 + 1.0)) / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = 180.0 * (atan((t_1 + -1.0)) / pi); elseif (t_0 <= 0.0) tmp = atan((B / (A * 2.0))) / (pi * 0.005555555555555556); else tmp = 180.0 * (atan((t_1 + 1.0)) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(180.0 * N[(N[ArcTan[N[(t$95$1 + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[ArcTan[N[(B / N[(A * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + -1\right)}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{A \cdot 2}\right)}{\pi \cdot 0.005555555555555556}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t\_1 + 1\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 60.3%
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--.f6476.6
Applied rewrites76.6%
if -0.5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 0.0Initial program 27.6%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6445.6
Applied rewrites45.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
metadata-evalN/A
times-fracN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites61.3%
lift-PI.f64N/A
frac-2negN/A
lift-*.f64N/A
lift-/.f64N/A
lift-atan.f64N/A
lift-*.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites61.4%
if 0.0 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) Initial program 57.3%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification75.1%
(FPCore (A B C)
:precision binary64
(if (<= C -2.3e+31)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C 1.36e-77)
(* 180.0 (/ (atan 1.0) PI))
(/ (atan (/ B (* C -2.0))) (* PI 0.005555555555555556)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -2.3e+31) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= 1.36e-77) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = atan((B / (C * -2.0))) / (((double) M_PI) * 0.005555555555555556);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -2.3e+31) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= 1.36e-77) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = Math.atan((B / (C * -2.0))) / (Math.PI * 0.005555555555555556);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -2.3e+31: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= 1.36e-77: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = math.atan((B / (C * -2.0))) / (math.pi * 0.005555555555555556) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -2.3e+31) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= 1.36e-77) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(atan(Float64(B / Float64(C * -2.0))) / Float64(pi * 0.005555555555555556)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -2.3e+31) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= 1.36e-77) tmp = 180.0 * (atan(1.0) / pi); else tmp = atan((B / (C * -2.0))) / (pi * 0.005555555555555556); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -2.3e+31], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.36e-77], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[N[(B / N[(C * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -2.3 \cdot 10^{+31}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.36 \cdot 10^{-77}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C \cdot -2}\right)}{\pi \cdot 0.005555555555555556}\\
\end{array}
\end{array}
if C < -2.3e31Initial program 75.4%
Taylor expanded in C around -inf
lower-*.f64N/A
lower-/.f6468.8
Applied rewrites68.8%
if -2.3e31 < C < 1.36000000000000005e-77Initial program 60.1%
Taylor expanded in B around -inf
Applied rewrites38.6%
if 1.36000000000000005e-77 < C Initial program 29.2%
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-/.f6462.8
Applied rewrites62.8%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6462.9
Applied rewrites62.9%
Applied rewrites63.0%
(FPCore (A B C)
:precision binary64
(if (<= C -2.3e+31)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C 1.36e-77)
(* 180.0 (/ (atan 1.0) PI))
(* 180.0 (/ (atan (/ B (* C -2.0))) PI)))))
double code(double A, double B, double C) {
double tmp;
if (C <= -2.3e+31) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= 1.36e-77) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((B / (C * -2.0))) / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= -2.3e+31) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= 1.36e-77) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((B / (C * -2.0))) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= -2.3e+31: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= 1.36e-77: tmp = 180.0 * (math.atan(1.0) / math.pi) else: tmp = 180.0 * (math.atan((B / (C * -2.0))) / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (C <= -2.3e+31) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= 1.36e-77) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(B / Float64(C * -2.0))) / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= -2.3e+31) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= 1.36e-77) tmp = 180.0 * (atan(1.0) / pi); else tmp = 180.0 * (atan((B / (C * -2.0))) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, -2.3e+31], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.36e-77], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(B / N[(C * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq -2.3 \cdot 10^{+31}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.36 \cdot 10^{-77}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{C \cdot -2}\right)}{\pi}\\
\end{array}
\end{array}
if C < -2.3e31Initial program 75.4%
Taylor expanded in C around -inf
lower-*.f64N/A
lower-/.f6468.8
Applied rewrites68.8%
if -2.3e31 < C < 1.36000000000000005e-77Initial program 60.1%
Taylor expanded in B around -inf
Applied rewrites38.6%
if 1.36000000000000005e-77 < C Initial program 29.2%
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-/.f6462.8
Applied rewrites62.8%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6462.9
Applied rewrites62.9%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
inv-powN/A
lift-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-atan.f64N/A
lift-PI.f64N/A
associate-*r/N/A
Applied rewrites62.9%
Final simplification54.6%
(FPCore (A B C)
:precision binary64
(if (<= C -2.3e+31)
(* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
(if (<= C 1.36e-77)
(* 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 <= -2.3e+31) {
tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
} else if (C <= 1.36e-77) {
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 <= -2.3e+31) {
tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
} else if (C <= 1.36e-77) {
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 <= -2.3e+31: tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi) elif C <= 1.36e-77: 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 <= -2.3e+31) tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi)); elseif (C <= 1.36e-77) 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 <= -2.3e+31) tmp = 180.0 * (atan((2.0 * (C / B))) / pi); elseif (C <= 1.36e-77) 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, -2.3e+31], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.36e-77], 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 -2.3 \cdot 10^{+31}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.36 \cdot 10^{-77}:\\
\;\;\;\;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 < -2.3e31Initial program 75.4%
Taylor expanded in C around -inf
lower-*.f64N/A
lower-/.f6468.8
Applied rewrites68.8%
if -2.3e31 < C < 1.36000000000000005e-77Initial program 60.1%
Taylor expanded in B around -inf
Applied rewrites38.6%
if 1.36000000000000005e-77 < C Initial program 29.2%
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-/.f6462.8
Applied rewrites62.8%
lift-/.f64N/A
+-rgt-identityN/A
*-commutativeN/A
lower-*.f6462.8
Applied rewrites62.8%
Final simplification54.6%
(FPCore (A B C)
:precision binary64
(if (<= B -3.8e-15)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 3.6e-96)
(* 180.0 (/ (atan (* B (/ 0.5 A))) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -3.8e-15) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 3.6e-96) {
tmp = 180.0 * (atan((B * (0.5 / A))) / ((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.8e-15) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 3.6e-96) {
tmp = 180.0 * (Math.atan((B * (0.5 / A))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -3.8e-15: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 3.6e-96: tmp = 180.0 * (math.atan((B * (0.5 / A))) / 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.8e-15) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 3.6e-96) tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / A))) / 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.8e-15) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 3.6e-96) tmp = 180.0 * (atan((B * (0.5 / A))) / pi); else tmp = 180.0 * (atan(-1.0) / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -3.8e-15], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.6e-96], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -3.8 \cdot 10^{-15}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 3.6 \cdot 10^{-96}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -3.8000000000000002e-15Initial program 47.8%
Taylor expanded in B around -inf
Applied rewrites68.8%
if -3.8000000000000002e-15 < B < 3.60000000000000008e-96Initial program 57.6%
Taylor expanded in A around -inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6431.7
Applied rewrites31.7%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lift-/.f64N/A
inv-powN/A
lift-*.f64N/A
pow2N/A
pow-prod-upN/A
metadata-evalN/A
unpow1N/A
lower-*.f64N/A
lower-/.f6437.6
Applied rewrites37.6%
if 3.60000000000000008e-96 < B Initial program 57.0%
Taylor expanded in B around inf
Applied rewrites51.0%
(FPCore (A B C)
:precision binary64
(if (<= B -2.05e-57)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 0.58)
(* 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 <= -2.05e-57) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 0.58) {
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 <= -2.05e-57) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 0.58) {
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 <= -2.05e-57: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 0.58: 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 <= -2.05e-57) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 0.58) 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 <= -2.05e-57) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 0.58) 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, -2.05e-57], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 0.58], 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 -2.05 \cdot 10^{-57}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 0.58:\\
\;\;\;\;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 < -2.0500000000000001e-57Initial program 47.2%
Taylor expanded in B around -inf
Applied rewrites62.0%
if -2.0500000000000001e-57 < B < 0.57999999999999996Initial program 63.8%
Taylor expanded in C around -inf
lower-*.f64N/A
lower-/.f6436.8
Applied rewrites36.8%
if 0.57999999999999996 < B Initial program 49.0%
Taylor expanded in B around inf
Applied rewrites58.2%
(FPCore (A B C) :precision binary64 (if (<= C 4.5e-17) (* 180.0 (/ (atan (+ (/ (- C A) B) 1.0)) PI)) (/ (atan (/ B (* C -2.0))) (* PI 0.005555555555555556))))
double code(double A, double B, double C) {
double tmp;
if (C <= 4.5e-17) {
tmp = 180.0 * (atan((((C - A) / B) + 1.0)) / ((double) M_PI));
} else {
tmp = atan((B / (C * -2.0))) / (((double) M_PI) * 0.005555555555555556);
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (C <= 4.5e-17) {
tmp = 180.0 * (Math.atan((((C - A) / B) + 1.0)) / Math.PI);
} else {
tmp = Math.atan((B / (C * -2.0))) / (Math.PI * 0.005555555555555556);
}
return tmp;
}
def code(A, B, C): tmp = 0 if C <= 4.5e-17: tmp = 180.0 * (math.atan((((C - A) / B) + 1.0)) / math.pi) else: tmp = math.atan((B / (C * -2.0))) / (math.pi * 0.005555555555555556) return tmp
function code(A, B, C) tmp = 0.0 if (C <= 4.5e-17) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + 1.0)) / pi)); else tmp = Float64(atan(Float64(B / Float64(C * -2.0))) / Float64(pi * 0.005555555555555556)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (C <= 4.5e-17) tmp = 180.0 * (atan((((C - A) / B) + 1.0)) / pi); else tmp = atan((B / (C * -2.0))) / (pi * 0.005555555555555556); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[C, 4.5e-17], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[N[(B / N[(C * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;C \leq 4.5 \cdot 10^{-17}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{B}{C \cdot -2}\right)}{\pi \cdot 0.005555555555555556}\\
\end{array}
\end{array}
if C < 4.49999999999999978e-17Initial program 66.7%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6467.4
Applied rewrites67.4%
if 4.49999999999999978e-17 < C Initial program 23.0%
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-/.f6469.0
Applied rewrites69.0%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6469.1
Applied rewrites69.1%
Applied rewrites69.2%
Final simplification67.9%
(FPCore (A B C)
:precision binary64
(if (<= B -5.8e-165)
(* 180.0 (/ (atan 1.0) PI))
(if (<= B 1.2e-187)
(* 180.0 (/ (atan 0.0) PI))
(* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -5.8e-165) {
tmp = 180.0 * (atan(1.0) / ((double) M_PI));
} else if (B <= 1.2e-187) {
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 <= -5.8e-165) {
tmp = 180.0 * (Math.atan(1.0) / Math.PI);
} else if (B <= 1.2e-187) {
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 <= -5.8e-165: tmp = 180.0 * (math.atan(1.0) / math.pi) elif B <= 1.2e-187: 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 <= -5.8e-165) tmp = Float64(180.0 * Float64(atan(1.0) / pi)); elseif (B <= 1.2e-187) 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 <= -5.8e-165) tmp = 180.0 * (atan(1.0) / pi); elseif (B <= 1.2e-187) 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, -5.8e-165], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.2e-187], 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 -5.8 \cdot 10^{-165}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
\mathbf{elif}\;B \leq 1.2 \cdot 10^{-187}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < -5.8e-165Initial program 51.9%
Taylor expanded in B around -inf
Applied rewrites55.2%
if -5.8e-165 < B < 1.20000000000000007e-187Initial program 57.6%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval37.2
Applied rewrites37.2%
if 1.20000000000000007e-187 < B Initial program 55.8%
Taylor expanded in B around inf
Applied rewrites45.2%
(FPCore (A B C) :precision binary64 (if (<= B 1.2e-187) (* 180.0 (/ (atan 0.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
double code(double A, double B, double C) {
double tmp;
if (B <= 1.2e-187) {
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 <= 1.2e-187) {
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 <= 1.2e-187: 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 <= 1.2e-187) 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 <= 1.2e-187) 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, 1.2e-187], 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 1.2 \cdot 10^{-187}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
\end{array}
\end{array}
if B < 1.20000000000000007e-187Initial program 54.0%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval16.2
Applied rewrites16.2%
if 1.20000000000000007e-187 < B Initial program 55.8%
Taylor expanded in B around inf
Applied rewrites45.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 54.7%
Taylor expanded in B around inf
Applied rewrites19.6%
herbie shell --seed 2024214
(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)))