
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}
(FPCore (A B C)
:precision binary64
(let* ((t_0
(atan
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* (atan (- t_1 1.0)) (/ 180.0 PI))
(if (<= t_0 0.0)
(* (atan (* (/ B (- C A)) -0.5)) (/ 180.0 PI))
(* (atan (+ t_1 1.0)) (/ 180.0 PI))))))
double code(double A, double B, double C) {
double t_0 = atan((((C - A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))) * (1.0 / B)));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = atan((t_1 - 1.0)) * (180.0 / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = atan(((B / (C - A)) * -0.5)) * (180.0 / ((double) M_PI));
} else {
tmp = atan((t_1 + 1.0)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = Math.atan((((C - A) - Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)))) * (1.0 / B)));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = Math.atan((t_1 - 1.0)) * (180.0 / Math.PI);
} else if (t_0 <= 0.0) {
tmp = Math.atan(((B / (C - A)) * -0.5)) * (180.0 / Math.PI);
} else {
tmp = Math.atan((t_1 + 1.0)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = math.atan((((C - A) - math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0)))) * (1.0 / B))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = math.atan((t_1 - 1.0)) * (180.0 / math.pi) elif t_0 <= 0.0: tmp = math.atan(((B / (C - A)) * -0.5)) * (180.0 / math.pi) else: tmp = math.atan((t_1 + 1.0)) * (180.0 / math.pi) return tmp
function code(A, B, C) t_0 = atan(Float64(Float64(Float64(C - A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))) * Float64(1.0 / B))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(atan(Float64(t_1 - 1.0)) * Float64(180.0 / pi)); elseif (t_0 <= 0.0) tmp = Float64(atan(Float64(Float64(B / Float64(C - A)) * -0.5)) * Float64(180.0 / pi)); else tmp = Float64(atan(Float64(t_1 + 1.0)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = atan((((C - A) - sqrt(((B ^ 2.0) + ((A - C) ^ 2.0)))) * (1.0 / B))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = atan((t_1 - 1.0)) * (180.0 / pi); elseif (t_0 <= 0.0) tmp = atan(((B / (C - A)) * -0.5)) * (180.0 / pi); else tmp = atan((t_1 + 1.0)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[ArcTan[N[(t$95$1 - 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[ArcTan[N[(N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[N[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\tan^{-1} \left(t\_1 - 1\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\tan^{-1} \left(\frac{B}{C - A} \cdot -0.5\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(t\_1 + 1\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if (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))))))) < -0.5Initial program 61.3%
Applied rewrites61.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
if -0.5 < (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))))))) < -0.0Initial program 14.2%
Applied rewrites14.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6499.2
Applied rewrites99.2%
if -0.0 < (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))))))) Initial program 58.5%
Applied rewrites58.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Final simplification79.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(atan
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* (atan (- t_1 1.0)) (/ 180.0 PI))
(if (<= t_0 0.0)
(* (/ (atan (* 0.5 (/ B A))) PI) 180.0)
(* (atan (+ t_1 1.0)) (/ 180.0 PI))))))
double code(double A, double B, double C) {
double t_0 = atan((((C - A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))) * (1.0 / B)));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = atan((t_1 - 1.0)) * (180.0 / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = (atan((0.5 * (B / A))) / ((double) M_PI)) * 180.0;
} else {
tmp = atan((t_1 + 1.0)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = Math.atan((((C - A) - Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)))) * (1.0 / B)));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = Math.atan((t_1 - 1.0)) * (180.0 / Math.PI);
} else if (t_0 <= 0.0) {
tmp = (Math.atan((0.5 * (B / A))) / Math.PI) * 180.0;
} else {
tmp = Math.atan((t_1 + 1.0)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = math.atan((((C - A) - math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0)))) * (1.0 / B))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = math.atan((t_1 - 1.0)) * (180.0 / math.pi) elif t_0 <= 0.0: tmp = (math.atan((0.5 * (B / A))) / math.pi) * 180.0 else: tmp = math.atan((t_1 + 1.0)) * (180.0 / math.pi) return tmp
function code(A, B, C) t_0 = atan(Float64(Float64(Float64(C - A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))) * Float64(1.0 / B))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(atan(Float64(t_1 - 1.0)) * Float64(180.0 / pi)); elseif (t_0 <= 0.0) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) / pi) * 180.0); else tmp = Float64(atan(Float64(t_1 + 1.0)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = atan((((C - A) - sqrt(((B ^ 2.0) + ((A - C) ^ 2.0)))) * (1.0 / B))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = atan((t_1 - 1.0)) * (180.0 / pi); elseif (t_0 <= 0.0) tmp = (atan((0.5 * (B / A))) / pi) * 180.0; else tmp = atan((t_1 + 1.0)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[ArcTan[N[(t$95$1 - 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[ArcTan[N[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\tan^{-1} \left(t\_1 - 1\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(t\_1 + 1\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if (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))))))) < -0.5Initial program 61.3%
Applied rewrites61.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
if -0.5 < (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))))))) < -0.0Initial program 14.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.7
Applied rewrites54.7%
if -0.0 < (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))))))) Initial program 58.5%
Applied rewrites58.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Final simplification75.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(atan
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* (/ (atan (- t_1 1.0)) PI) 180.0)
(if (<= t_0 0.0)
(* (/ (atan (* 0.5 (/ B A))) PI) 180.0)
(* (atan (+ t_1 1.0)) (/ 180.0 PI))))))
double code(double A, double B, double C) {
double t_0 = atan((((C - A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))) * (1.0 / B)));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (atan((t_1 - 1.0)) / ((double) M_PI)) * 180.0;
} else if (t_0 <= 0.0) {
tmp = (atan((0.5 * (B / A))) / ((double) M_PI)) * 180.0;
} else {
tmp = atan((t_1 + 1.0)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = Math.atan((((C - A) - Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)))) * (1.0 / B)));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (Math.atan((t_1 - 1.0)) / Math.PI) * 180.0;
} else if (t_0 <= 0.0) {
tmp = (Math.atan((0.5 * (B / A))) / Math.PI) * 180.0;
} else {
tmp = Math.atan((t_1 + 1.0)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = math.atan((((C - A) - math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0)))) * (1.0 / B))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = (math.atan((t_1 - 1.0)) / math.pi) * 180.0 elif t_0 <= 0.0: tmp = (math.atan((0.5 * (B / A))) / math.pi) * 180.0 else: tmp = math.atan((t_1 + 1.0)) * (180.0 / math.pi) return tmp
function code(A, B, C) t_0 = atan(Float64(Float64(Float64(C - A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))) * Float64(1.0 / B))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(Float64(atan(Float64(t_1 - 1.0)) / pi) * 180.0); elseif (t_0 <= 0.0) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) / pi) * 180.0); else tmp = Float64(atan(Float64(t_1 + 1.0)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = atan((((C - A) - sqrt(((B ^ 2.0) + ((A - C) ^ 2.0)))) * (1.0 / B))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = (atan((t_1 - 1.0)) / pi) * 180.0; elseif (t_0 <= 0.0) tmp = (atan((0.5 * (B / A))) / pi) * 180.0; else tmp = atan((t_1 + 1.0)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[(N[ArcTan[N[(t$95$1 - 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[ArcTan[N[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\pi} \cdot 180\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(t\_1 + 1\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if (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))))))) < -0.5Initial program 61.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
if -0.5 < (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))))))) < -0.0Initial program 14.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.7
Applied rewrites54.7%
if -0.0 < (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))))))) Initial program 58.5%
Applied rewrites58.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Final simplification75.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(atan
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
(t_1 (/ (- C A) B)))
(if (<= t_0 -0.5)
(* (/ (atan (- t_1 1.0)) PI) 180.0)
(if (<= t_0 0.0)
(* (/ (atan (* 0.5 (/ B A))) PI) 180.0)
(* (/ (atan (+ t_1 1.0)) PI) 180.0)))))
double code(double A, double B, double C) {
double t_0 = atan((((C - A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))) * (1.0 / B)));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (atan((t_1 - 1.0)) / ((double) M_PI)) * 180.0;
} else if (t_0 <= 0.0) {
tmp = (atan((0.5 * (B / A))) / ((double) M_PI)) * 180.0;
} else {
tmp = (atan((t_1 + 1.0)) / ((double) M_PI)) * 180.0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = Math.atan((((C - A) - Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)))) * (1.0 / B)));
double t_1 = (C - A) / B;
double tmp;
if (t_0 <= -0.5) {
tmp = (Math.atan((t_1 - 1.0)) / Math.PI) * 180.0;
} else if (t_0 <= 0.0) {
tmp = (Math.atan((0.5 * (B / A))) / Math.PI) * 180.0;
} else {
tmp = (Math.atan((t_1 + 1.0)) / Math.PI) * 180.0;
}
return tmp;
}
def code(A, B, C): t_0 = math.atan((((C - A) - math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0)))) * (1.0 / B))) t_1 = (C - A) / B tmp = 0 if t_0 <= -0.5: tmp = (math.atan((t_1 - 1.0)) / math.pi) * 180.0 elif t_0 <= 0.0: tmp = (math.atan((0.5 * (B / A))) / math.pi) * 180.0 else: tmp = (math.atan((t_1 + 1.0)) / math.pi) * 180.0 return tmp
function code(A, B, C) t_0 = atan(Float64(Float64(Float64(C - A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))) * Float64(1.0 / B))) t_1 = Float64(Float64(C - A) / B) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(Float64(atan(Float64(t_1 - 1.0)) / pi) * 180.0); elseif (t_0 <= 0.0) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) / pi) * 180.0); else tmp = Float64(Float64(atan(Float64(t_1 + 1.0)) / pi) * 180.0); end return tmp end
function tmp_2 = code(A, B, C) t_0 = atan((((C - A) - sqrt(((B ^ 2.0) + ((A - C) ^ 2.0)))) * (1.0 / B))); t_1 = (C - A) / B; tmp = 0.0; if (t_0 <= -0.5) tmp = (atan((t_1 - 1.0)) / pi) * 180.0; elseif (t_0 <= 0.0) tmp = (atan((0.5 * (B / A))) / pi) * 180.0; else tmp = (atan((t_1 + 1.0)) / pi) * 180.0; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[(N[ArcTan[N[(t$95$1 - 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[(N[ArcTan[N[(t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\right)\\
t_1 := \frac{C - A}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 - 1\right)}{\pi} \cdot 180\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(t\_1 + 1\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if (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))))))) < -0.5Initial program 61.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
if -0.5 < (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))))))) < -0.0Initial program 14.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.7
Applied rewrites54.7%
if -0.0 < (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))))))) Initial program 58.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Final simplification75.0%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(atan
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B)))))
(if (<= t_0 -0.5)
(* (atan (/ (- (+ A B)) B)) (/ 180.0 PI))
(if (<= t_0 0.0)
(* (/ (atan (* 0.5 (/ B A))) PI) 180.0)
(* (/ (atan (+ (/ (- C A) B) 1.0)) PI) 180.0)))))
double code(double A, double B, double C) {
double t_0 = atan((((C - A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))) * (1.0 / B)));
double tmp;
if (t_0 <= -0.5) {
tmp = atan((-(A + B) / B)) * (180.0 / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = (atan((0.5 * (B / A))) / ((double) M_PI)) * 180.0;
} else {
tmp = (atan((((C - A) / B) + 1.0)) / ((double) M_PI)) * 180.0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = Math.atan((((C - A) - Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)))) * (1.0 / B)));
double tmp;
if (t_0 <= -0.5) {
tmp = Math.atan((-(A + B) / B)) * (180.0 / Math.PI);
} else if (t_0 <= 0.0) {
tmp = (Math.atan((0.5 * (B / A))) / Math.PI) * 180.0;
} else {
tmp = (Math.atan((((C - A) / B) + 1.0)) / Math.PI) * 180.0;
}
return tmp;
}
def code(A, B, C): t_0 = math.atan((((C - A) - math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0)))) * (1.0 / B))) tmp = 0 if t_0 <= -0.5: tmp = math.atan((-(A + B) / B)) * (180.0 / math.pi) elif t_0 <= 0.0: tmp = (math.atan((0.5 * (B / A))) / math.pi) * 180.0 else: tmp = (math.atan((((C - A) / B) + 1.0)) / math.pi) * 180.0 return tmp
function code(A, B, C) t_0 = atan(Float64(Float64(Float64(C - A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))) * Float64(1.0 / B))) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(atan(Float64(Float64(-Float64(A + B)) / B)) * Float64(180.0 / pi)); elseif (t_0 <= 0.0) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) / pi) * 180.0); else tmp = Float64(Float64(atan(Float64(Float64(Float64(C - A) / B) + 1.0)) / pi) * 180.0); end return tmp end
function tmp_2 = code(A, B, C) t_0 = atan((((C - A) - sqrt(((B ^ 2.0) + ((A - C) ^ 2.0)))) * (1.0 / B))); tmp = 0.0; if (t_0 <= -0.5) tmp = atan((-(A + B) / B)) * (180.0 / pi); elseif (t_0 <= 0.0) tmp = (atan((0.5 * (B / A))) / pi) * 180.0; else tmp = (atan((((C - A) / B) + 1.0)) / pi) * 180.0; end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[ArcTan[N[((-N[(A + B), $MachinePrecision]) / B), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\right)\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\tan^{-1} \left(\frac{-\left(A + B\right)}{B}\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{C - A}{B} + 1\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if (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))))))) < -0.5Initial program 61.3%
Applied rewrites61.3%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.3
Applied rewrites55.3%
Taylor expanded in A around 0
Applied rewrites68.6%
if -0.5 < (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))))))) < -0.0Initial program 14.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.7
Applied rewrites54.7%
if -0.0 < (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))))))) Initial program 58.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Final simplification72.1%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
(if (<= t_0 -0.5)
(* (atan (/ (- (+ A B)) B)) (/ 180.0 PI))
(if (<= t_0 0.0)
(* (/ (atan (* 0.5 (/ B A))) PI) 180.0)
(* (atan (+ (/ (- A) B) 1.0)) (/ 180.0 PI))))))
double code(double A, double B, double C) {
double t_0 = ((C - A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))) * (1.0 / B);
double tmp;
if (t_0 <= -0.5) {
tmp = atan((-(A + B) / B)) * (180.0 / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = (atan((0.5 * (B / A))) / ((double) M_PI)) * 180.0;
} else {
tmp = atan(((-A / B) + 1.0)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = ((C - A) - Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)))) * (1.0 / B);
double tmp;
if (t_0 <= -0.5) {
tmp = Math.atan((-(A + B) / B)) * (180.0 / Math.PI);
} else if (t_0 <= 0.0) {
tmp = (Math.atan((0.5 * (B / A))) / Math.PI) * 180.0;
} else {
tmp = Math.atan(((-A / B) + 1.0)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = ((C - A) - math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0)))) * (1.0 / B) tmp = 0 if t_0 <= -0.5: tmp = math.atan((-(A + B) / B)) * (180.0 / math.pi) elif t_0 <= 0.0: tmp = (math.atan((0.5 * (B / A))) / math.pi) * 180.0 else: tmp = math.atan(((-A / B) + 1.0)) * (180.0 / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(Float64(C - A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))) * Float64(1.0 / B)) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(atan(Float64(Float64(-Float64(A + B)) / B)) * Float64(180.0 / pi)); elseif (t_0 <= 0.0) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) / pi) * 180.0); else tmp = Float64(atan(Float64(Float64(Float64(-A) / B) + 1.0)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = ((C - A) - sqrt(((B ^ 2.0) + ((A - C) ^ 2.0)))) * (1.0 / B); tmp = 0.0; if (t_0 <= -0.5) tmp = atan((-(A + B) / B)) * (180.0 / pi); elseif (t_0 <= 0.0) tmp = (atan((0.5 * (B / A))) / pi) * 180.0; else tmp = atan(((-A / B) + 1.0)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[ArcTan[N[((-N[(A + B), $MachinePrecision]) / B), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[ArcTan[N[(N[((-A) / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\tan^{-1} \left(\frac{-\left(A + B\right)}{B}\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{-A}{B} + 1\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 61.3%
Applied rewrites61.3%
Taylor expanded in C around 0
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.3
Applied rewrites55.3%
Taylor expanded in A around 0
Applied rewrites68.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 14.2%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.7
Applied rewrites54.7%
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 58.5%
Applied rewrites58.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Taylor expanded in C around 0
Applied rewrites70.4%
Final simplification67.9%
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (- (- C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))) (/ 1.0 B))))
(if (<= t_0 -0.5)
(* (atan (- (/ C B) 1.0)) (/ 180.0 PI))
(if (<= t_0 0.0)
(* (/ (atan (* (/ -0.5 C) B)) PI) 180.0)
(* (atan (+ (/ C B) 1.0)) (/ 180.0 PI))))))
double code(double A, double B, double C) {
double t_0 = ((C - A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))) * (1.0 / B);
double tmp;
if (t_0 <= -0.5) {
tmp = atan(((C / B) - 1.0)) * (180.0 / ((double) M_PI));
} else if (t_0 <= 0.0) {
tmp = (atan(((-0.5 / C) * B)) / ((double) M_PI)) * 180.0;
} else {
tmp = atan(((C / B) + 1.0)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double t_0 = ((C - A) - Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)))) * (1.0 / B);
double tmp;
if (t_0 <= -0.5) {
tmp = Math.atan(((C / B) - 1.0)) * (180.0 / Math.PI);
} else if (t_0 <= 0.0) {
tmp = (Math.atan(((-0.5 / C) * B)) / Math.PI) * 180.0;
} else {
tmp = Math.atan(((C / B) + 1.0)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): t_0 = ((C - A) - math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0)))) * (1.0 / B) tmp = 0 if t_0 <= -0.5: tmp = math.atan(((C / B) - 1.0)) * (180.0 / math.pi) elif t_0 <= 0.0: tmp = (math.atan(((-0.5 / C) * B)) / math.pi) * 180.0 else: tmp = math.atan(((C / B) + 1.0)) * (180.0 / math.pi) return tmp
function code(A, B, C) t_0 = Float64(Float64(Float64(C - A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))) * Float64(1.0 / B)) tmp = 0.0 if (t_0 <= -0.5) tmp = Float64(atan(Float64(Float64(C / B) - 1.0)) * Float64(180.0 / pi)); elseif (t_0 <= 0.0) tmp = Float64(Float64(atan(Float64(Float64(-0.5 / C) * B)) / pi) * 180.0); else tmp = Float64(atan(Float64(Float64(C / B) + 1.0)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) t_0 = ((C - A) - sqrt(((B ^ 2.0) + ((A - C) ^ 2.0)))) * (1.0 / B); tmp = 0.0; if (t_0 <= -0.5) tmp = atan(((C / B) - 1.0)) * (180.0 / pi); elseif (t_0 <= 0.0) tmp = (atan(((-0.5 / C) * B)) / pi) * 180.0; else tmp = atan(((C / B) + 1.0)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.5], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[ArcTan[N[(N[(-0.5 / C), $MachinePrecision] * B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(C - A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \frac{1}{B}\\
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} - 1\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{-0.5}{C} \cdot B\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} + 1\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5Initial program 61.3%
Applied rewrites61.3%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
Taylor expanded in C around inf
Applied rewrites57.8%
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 14.2%
Taylor expanded in C around inf
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6448.7
Applied rewrites48.7%
Applied rewrites48.7%
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 58.5%
Applied rewrites58.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Taylor expanded in C around inf
Applied rewrites63.3%
Final simplification59.3%
(FPCore (A B C)
:precision binary64
(if (<= A -2.6e-216)
(* (/ (atan (* 0.5 (/ B A))) PI) 180.0)
(if (<= A 9e-178)
(* (atan (- (/ C B) 1.0)) (/ 180.0 PI))
(* (atan (+ (/ (- A) B) 1.0)) (/ 180.0 PI)))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.6e-216) {
tmp = (atan((0.5 * (B / A))) / ((double) M_PI)) * 180.0;
} else if (A <= 9e-178) {
tmp = atan(((C / B) - 1.0)) * (180.0 / ((double) M_PI));
} else {
tmp = atan(((-A / B) + 1.0)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.6e-216) {
tmp = (Math.atan((0.5 * (B / A))) / Math.PI) * 180.0;
} else if (A <= 9e-178) {
tmp = Math.atan(((C / B) - 1.0)) * (180.0 / Math.PI);
} else {
tmp = Math.atan(((-A / B) + 1.0)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.6e-216: tmp = (math.atan((0.5 * (B / A))) / math.pi) * 180.0 elif A <= 9e-178: tmp = math.atan(((C / B) - 1.0)) * (180.0 / math.pi) else: tmp = math.atan(((-A / B) + 1.0)) * (180.0 / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.6e-216) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) / pi) * 180.0); elseif (A <= 9e-178) tmp = Float64(atan(Float64(Float64(C / B) - 1.0)) * Float64(180.0 / pi)); else tmp = Float64(atan(Float64(Float64(Float64(-A) / B) + 1.0)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.6e-216) tmp = (atan((0.5 * (B / A))) / pi) * 180.0; elseif (A <= 9e-178) tmp = atan(((C / B) - 1.0)) * (180.0 / pi); else tmp = atan(((-A / B) + 1.0)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.6e-216], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[A, 9e-178], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[N[(N[((-A) / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.6 \cdot 10^{-216}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\
\mathbf{elif}\;A \leq 9 \cdot 10^{-178}:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} - 1\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{-A}{B} + 1\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if A < -2.5999999999999999e-216Initial program 26.5%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6453.5
Applied rewrites53.5%
if -2.5999999999999999e-216 < A < 8.99999999999999957e-178Initial program 67.9%
Applied rewrites67.9%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6469.5
Applied rewrites69.5%
Taylor expanded in C around inf
Applied rewrites69.5%
if 8.99999999999999957e-178 < A Initial program 74.1%
Applied rewrites74.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6477.1
Applied rewrites77.1%
Taylor expanded in C around 0
Applied rewrites74.1%
Final simplification65.5%
(FPCore (A B C)
:precision binary64
(if (<= A -2.6e-216)
(* (/ (atan (* 0.5 (/ B A))) PI) 180.0)
(if (<= A 3e+19)
(* (atan (- (/ C B) 1.0)) (/ 180.0 PI))
(* (/ (atan (* -2.0 (/ A B))) PI) 180.0))))
double code(double A, double B, double C) {
double tmp;
if (A <= -2.6e-216) {
tmp = (atan((0.5 * (B / A))) / ((double) M_PI)) * 180.0;
} else if (A <= 3e+19) {
tmp = atan(((C / B) - 1.0)) * (180.0 / ((double) M_PI));
} else {
tmp = (atan((-2.0 * (A / B))) / ((double) M_PI)) * 180.0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (A <= -2.6e-216) {
tmp = (Math.atan((0.5 * (B / A))) / Math.PI) * 180.0;
} else if (A <= 3e+19) {
tmp = Math.atan(((C / B) - 1.0)) * (180.0 / Math.PI);
} else {
tmp = (Math.atan((-2.0 * (A / B))) / Math.PI) * 180.0;
}
return tmp;
}
def code(A, B, C): tmp = 0 if A <= -2.6e-216: tmp = (math.atan((0.5 * (B / A))) / math.pi) * 180.0 elif A <= 3e+19: tmp = math.atan(((C / B) - 1.0)) * (180.0 / math.pi) else: tmp = (math.atan((-2.0 * (A / B))) / math.pi) * 180.0 return tmp
function code(A, B, C) tmp = 0.0 if (A <= -2.6e-216) tmp = Float64(Float64(atan(Float64(0.5 * Float64(B / A))) / pi) * 180.0); elseif (A <= 3e+19) tmp = Float64(atan(Float64(Float64(C / B) - 1.0)) * Float64(180.0 / pi)); else tmp = Float64(Float64(atan(Float64(-2.0 * Float64(A / B))) / pi) * 180.0); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (A <= -2.6e-216) tmp = (atan((0.5 * (B / A))) / pi) * 180.0; elseif (A <= 3e+19) tmp = atan(((C / B) - 1.0)) * (180.0 / pi); else tmp = (atan((-2.0 * (A / B))) / pi) * 180.0; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[A, -2.6e-216], N[(N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[A, 3e+19], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.6 \cdot 10^{-216}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\
\mathbf{elif}\;A \leq 3 \cdot 10^{+19}:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} - 1\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if A < -2.5999999999999999e-216Initial program 26.5%
Taylor expanded in A around -inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6453.5
Applied rewrites53.5%
if -2.5999999999999999e-216 < A < 3e19Initial program 65.1%
Applied rewrites65.2%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.0
Applied rewrites60.0%
Taylor expanded in C around inf
Applied rewrites54.2%
if 3e19 < A Initial program 80.3%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6475.3
Applied rewrites75.3%
Final simplification60.3%
(FPCore (A B C)
:precision binary64
(if (<= B -2.35e-79)
(* (atan (+ (/ C B) 1.0)) (/ 180.0 PI))
(if (<= B 9.2e-147)
(* (/ (atan (* -2.0 (/ A B))) PI) 180.0)
(* (atan (- (/ C B) 1.0)) (/ 180.0 PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.35e-79) {
tmp = atan(((C / B) + 1.0)) * (180.0 / ((double) M_PI));
} else if (B <= 9.2e-147) {
tmp = (atan((-2.0 * (A / B))) / ((double) M_PI)) * 180.0;
} else {
tmp = atan(((C / B) - 1.0)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -2.35e-79) {
tmp = Math.atan(((C / B) + 1.0)) * (180.0 / Math.PI);
} else if (B <= 9.2e-147) {
tmp = (Math.atan((-2.0 * (A / B))) / Math.PI) * 180.0;
} else {
tmp = Math.atan(((C / B) - 1.0)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.35e-79: tmp = math.atan(((C / B) + 1.0)) * (180.0 / math.pi) elif B <= 9.2e-147: tmp = (math.atan((-2.0 * (A / B))) / math.pi) * 180.0 else: tmp = math.atan(((C / B) - 1.0)) * (180.0 / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2.35e-79) tmp = Float64(atan(Float64(Float64(C / B) + 1.0)) * Float64(180.0 / pi)); elseif (B <= 9.2e-147) tmp = Float64(Float64(atan(Float64(-2.0 * Float64(A / B))) / pi) * 180.0); else tmp = Float64(atan(Float64(Float64(C / B) - 1.0)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.35e-79) tmp = atan(((C / B) + 1.0)) * (180.0 / pi); elseif (B <= 9.2e-147) tmp = (atan((-2.0 * (A / B))) / pi) * 180.0; else tmp = atan(((C / B) - 1.0)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.35e-79], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.2e-147], N[(N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.35 \cdot 10^{-79}:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} + 1\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;B \leq 9.2 \cdot 10^{-147}:\\
\;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} - 1\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if B < -2.3500000000000001e-79Initial program 50.5%
Applied rewrites50.5%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6482.5
Applied rewrites82.5%
Taylor expanded in C around inf
Applied rewrites72.6%
if -2.3500000000000001e-79 < B < 9.19999999999999962e-147Initial program 59.1%
Taylor expanded in A around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6450.2
Applied rewrites50.2%
if 9.19999999999999962e-147 < B Initial program 55.0%
Applied rewrites55.0%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6470.3
Applied rewrites70.3%
Taylor expanded in C around inf
Applied rewrites56.5%
Final simplification59.4%
(FPCore (A B C)
:precision binary64
(if (<= B -2.6e-284)
(* (atan (+ (/ C B) 1.0)) (/ 180.0 PI))
(if (<= B 4.5e-238)
(* (/ (atan 0.0) PI) 180.0)
(* (atan (- (/ C B) 1.0)) (/ 180.0 PI)))))
double code(double A, double B, double C) {
double tmp;
if (B <= -2.6e-284) {
tmp = atan(((C / B) + 1.0)) * (180.0 / ((double) M_PI));
} else if (B <= 4.5e-238) {
tmp = (atan(0.0) / ((double) M_PI)) * 180.0;
} else {
tmp = atan(((C / B) - 1.0)) * (180.0 / ((double) M_PI));
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -2.6e-284) {
tmp = Math.atan(((C / B) + 1.0)) * (180.0 / Math.PI);
} else if (B <= 4.5e-238) {
tmp = (Math.atan(0.0) / Math.PI) * 180.0;
} else {
tmp = Math.atan(((C / B) - 1.0)) * (180.0 / Math.PI);
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -2.6e-284: tmp = math.atan(((C / B) + 1.0)) * (180.0 / math.pi) elif B <= 4.5e-238: tmp = (math.atan(0.0) / math.pi) * 180.0 else: tmp = math.atan(((C / B) - 1.0)) * (180.0 / math.pi) return tmp
function code(A, B, C) tmp = 0.0 if (B <= -2.6e-284) tmp = Float64(atan(Float64(Float64(C / B) + 1.0)) * Float64(180.0 / pi)); elseif (B <= 4.5e-238) tmp = Float64(Float64(atan(0.0) / pi) * 180.0); else tmp = Float64(atan(Float64(Float64(C / B) - 1.0)) * Float64(180.0 / pi)); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -2.6e-284) tmp = atan(((C / B) + 1.0)) * (180.0 / pi); elseif (B <= 4.5e-238) tmp = (atan(0.0) / pi) * 180.0; else tmp = atan(((C / B) - 1.0)) * (180.0 / pi); end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -2.6e-284], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.5e-238], N[(N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.6 \cdot 10^{-284}:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} + 1\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-238}:\\
\;\;\;\;\frac{\tan^{-1} 0}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} - 1\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if B < -2.6e-284Initial program 56.1%
Applied rewrites56.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6475.1
Applied rewrites75.1%
Taylor expanded in C around inf
Applied rewrites60.4%
if -2.6e-284 < B < 4.49999999999999996e-238Initial program 36.8%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval43.4
Applied rewrites43.4%
if 4.49999999999999996e-238 < B Initial program 55.9%
Applied rewrites56.0%
Taylor expanded in B around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6468.5
Applied rewrites68.5%
Taylor expanded in C around inf
Applied rewrites53.1%
Final simplification56.0%
(FPCore (A B C) :precision binary64 (if (<= B 9.5e-134) (* (atan (+ (/ C B) 1.0)) (/ 180.0 PI)) (* (/ (atan -1.0) PI) 180.0)))
double code(double A, double B, double C) {
double tmp;
if (B <= 9.5e-134) {
tmp = atan(((C / B) + 1.0)) * (180.0 / ((double) M_PI));
} else {
tmp = (atan(-1.0) / ((double) M_PI)) * 180.0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 9.5e-134) {
tmp = Math.atan(((C / B) + 1.0)) * (180.0 / Math.PI);
} else {
tmp = (Math.atan(-1.0) / Math.PI) * 180.0;
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 9.5e-134: tmp = math.atan(((C / B) + 1.0)) * (180.0 / math.pi) else: tmp = (math.atan(-1.0) / math.pi) * 180.0 return tmp
function code(A, B, C) tmp = 0.0 if (B <= 9.5e-134) tmp = Float64(atan(Float64(Float64(C / B) + 1.0)) * Float64(180.0 / pi)); else tmp = Float64(Float64(atan(-1.0) / pi) * 180.0); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 9.5e-134) tmp = atan(((C / B) + 1.0)) * (180.0 / pi); else tmp = (atan(-1.0) / pi) * 180.0; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 9.5e-134], N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9.5 \cdot 10^{-134}:\\
\;\;\;\;\tan^{-1} \left(\frac{C}{B} + 1\right) \cdot \frac{180}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\pi} \cdot 180\\
\end{array}
\end{array}
if B < 9.5000000000000008e-134Initial program 55.1%
Applied rewrites55.1%
Taylor expanded in B around -inf
associate--l+N/A
div-subN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6468.6
Applied rewrites68.6%
Taylor expanded in C around inf
Applied rewrites53.0%
if 9.5000000000000008e-134 < B Initial program 54.6%
Taylor expanded in B around inf
Applied rewrites50.4%
Final simplification52.0%
(FPCore (A B C)
:precision binary64
(if (<= B -4.4e-103)
(* (/ (atan 1.0) PI) 180.0)
(if (<= B 4.7e-141)
(* (/ (atan 0.0) PI) 180.0)
(* (/ (atan -1.0) PI) 180.0))))
double code(double A, double B, double C) {
double tmp;
if (B <= -4.4e-103) {
tmp = (atan(1.0) / ((double) M_PI)) * 180.0;
} else if (B <= 4.7e-141) {
tmp = (atan(0.0) / ((double) M_PI)) * 180.0;
} else {
tmp = (atan(-1.0) / ((double) M_PI)) * 180.0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= -4.4e-103) {
tmp = (Math.atan(1.0) / Math.PI) * 180.0;
} else if (B <= 4.7e-141) {
tmp = (Math.atan(0.0) / Math.PI) * 180.0;
} else {
tmp = (Math.atan(-1.0) / Math.PI) * 180.0;
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= -4.4e-103: tmp = (math.atan(1.0) / math.pi) * 180.0 elif B <= 4.7e-141: tmp = (math.atan(0.0) / math.pi) * 180.0 else: tmp = (math.atan(-1.0) / math.pi) * 180.0 return tmp
function code(A, B, C) tmp = 0.0 if (B <= -4.4e-103) tmp = Float64(Float64(atan(1.0) / pi) * 180.0); elseif (B <= 4.7e-141) tmp = Float64(Float64(atan(0.0) / pi) * 180.0); else tmp = Float64(Float64(atan(-1.0) / pi) * 180.0); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= -4.4e-103) tmp = (atan(1.0) / pi) * 180.0; elseif (B <= 4.7e-141) tmp = (atan(0.0) / pi) * 180.0; else tmp = (atan(-1.0) / pi) * 180.0; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, -4.4e-103], N[(N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[B, 4.7e-141], N[(N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -4.4 \cdot 10^{-103}:\\
\;\;\;\;\frac{\tan^{-1} 1}{\pi} \cdot 180\\
\mathbf{elif}\;B \leq 4.7 \cdot 10^{-141}:\\
\;\;\;\;\frac{\tan^{-1} 0}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\pi} \cdot 180\\
\end{array}
\end{array}
if B < -4.3999999999999999e-103Initial program 53.6%
Taylor expanded in B around -inf
Applied rewrites58.5%
if -4.3999999999999999e-103 < B < 4.6999999999999998e-141Initial program 56.2%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval32.9
Applied rewrites32.9%
if 4.6999999999999998e-141 < B Initial program 55.1%
Taylor expanded in B around inf
Applied rewrites50.0%
Final simplification47.7%
(FPCore (A B C) :precision binary64 (if (<= B 4.7e-141) (* (/ (atan 0.0) PI) 180.0) (* (/ (atan -1.0) PI) 180.0)))
double code(double A, double B, double C) {
double tmp;
if (B <= 4.7e-141) {
tmp = (atan(0.0) / ((double) M_PI)) * 180.0;
} else {
tmp = (atan(-1.0) / ((double) M_PI)) * 180.0;
}
return tmp;
}
public static double code(double A, double B, double C) {
double tmp;
if (B <= 4.7e-141) {
tmp = (Math.atan(0.0) / Math.PI) * 180.0;
} else {
tmp = (Math.atan(-1.0) / Math.PI) * 180.0;
}
return tmp;
}
def code(A, B, C): tmp = 0 if B <= 4.7e-141: tmp = (math.atan(0.0) / math.pi) * 180.0 else: tmp = (math.atan(-1.0) / math.pi) * 180.0 return tmp
function code(A, B, C) tmp = 0.0 if (B <= 4.7e-141) tmp = Float64(Float64(atan(0.0) / pi) * 180.0); else tmp = Float64(Float64(atan(-1.0) / pi) * 180.0); end return tmp end
function tmp_2 = code(A, B, C) tmp = 0.0; if (B <= 4.7e-141) tmp = (atan(0.0) / pi) * 180.0; else tmp = (atan(-1.0) / pi) * 180.0; end tmp_2 = tmp; end
code[A_, B_, C_] := If[LessEqual[B, 4.7e-141], N[(N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], N[(N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4.7 \cdot 10^{-141}:\\
\;\;\;\;\frac{\tan^{-1} 0}{\pi} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} -1}{\pi} \cdot 180\\
\end{array}
\end{array}
if B < 4.6999999999999998e-141Initial program 54.8%
Taylor expanded in C around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
div0N/A
metadata-eval18.1
Applied rewrites18.1%
if 4.6999999999999998e-141 < B Initial program 55.1%
Taylor expanded in B around inf
Applied rewrites50.0%
Final simplification30.6%
(FPCore (A B C) :precision binary64 (* (/ (atan -1.0) PI) 180.0))
double code(double A, double B, double C) {
return (atan(-1.0) / ((double) M_PI)) * 180.0;
}
public static double code(double A, double B, double C) {
return (Math.atan(-1.0) / Math.PI) * 180.0;
}
def code(A, B, C): return (math.atan(-1.0) / math.pi) * 180.0
function code(A, B, C) return Float64(Float64(atan(-1.0) / pi) * 180.0) end
function tmp = code(A, B, C) tmp = (atan(-1.0) / pi) * 180.0; end
code[A_, B_, C_] := N[(N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\tan^{-1} -1}{\pi} \cdot 180
\end{array}
Initial program 54.9%
Taylor expanded in B around inf
Applied rewrites21.8%
Final simplification21.8%
herbie shell --seed 2024240
(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)))