
(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 14 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) (hypot (- A C) B)) B)) PI))) (* 180.0 (/ (+ (pow (+ t_0 1.0) 2.0) -1.0) (+ t_0 2.0)))))
double code(double A, double B, double C) {
double t_0 = atan((((C - A) - hypot((A - C), B)) / B)) / ((double) M_PI);
return 180.0 * ((pow((t_0 + 1.0), 2.0) + -1.0) / (t_0 + 2.0));
}
public static double code(double A, double B, double C) {
double t_0 = Math.atan((((C - A) - Math.hypot((A - C), B)) / B)) / Math.PI;
return 180.0 * ((Math.pow((t_0 + 1.0), 2.0) + -1.0) / (t_0 + 2.0));
}
def code(A, B, C): t_0 = math.atan((((C - A) - math.hypot((A - C), B)) / B)) / math.pi return 180.0 * ((math.pow((t_0 + 1.0), 2.0) + -1.0) / (t_0 + 2.0))
function code(A, B, C) t_0 = Float64(atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / B)) / pi) return Float64(180.0 * Float64(Float64((Float64(t_0 + 1.0) ^ 2.0) + -1.0) / Float64(t_0 + 2.0))) end
function tmp = code(A, B, C) t_0 = atan((((C - A) - hypot((A - C), B)) / B)) / pi; tmp = 180.0 * ((((t_0 + 1.0) ^ 2.0) + -1.0) / (t_0 + 2.0)); end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]}, N[(180.0 * N[(N[(N[Power[N[(t$95$0 + 1.0), $MachinePrecision], 2.0], $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$0 + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\
180 \cdot \frac{{\left(t\_0 + 1\right)}^{2} + -1}{t\_0 + 2}
\end{array}
\end{array}
Initial program 54.4%
Applied egg-rr75.3%
flip--75.3%
Applied egg-rr71.8%
Simplified75.3%
Final simplification75.3%
(FPCore (A B C) :precision binary64 (* 180.0 (+ -1.0 (exp (log1p (/ (atan (/ (- (- C A) (hypot (- A C) B)) B)) PI))))))
double code(double A, double B, double C) {
return 180.0 * (-1.0 + exp(log1p((atan((((C - A) - hypot((A - C), B)) / B)) / ((double) M_PI)))));
}
public static double code(double A, double B, double C) {
return 180.0 * (-1.0 + Math.exp(Math.log1p((Math.atan((((C - A) - Math.hypot((A - C), B)) / B)) / Math.PI))));
}
def code(A, B, C): return 180.0 * (-1.0 + math.exp(math.log1p((math.atan((((C - A) - math.hypot((A - C), B)) / B)) / math.pi))))
function code(A, B, C) return Float64(180.0 * Float64(-1.0 + exp(log1p(Float64(atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / B)) / pi))))) end
code[A_, B_, C_] := N[(180.0 * N[(-1.0 + N[Exp[N[Log[1 + N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \left(-1 + e^{\mathsf{log1p}\left(\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\right)}\right)
\end{array}
Initial program 54.4%
Applied egg-rr75.3%
Final simplification75.3%
(FPCore (A B C) :precision binary64 (* 180.0 (+ -1.0 (+ 1.0 (/ (atan (/ (- C (+ A (hypot (- A C) B))) B)) PI)))))
double code(double A, double B, double C) {
return 180.0 * (-1.0 + (1.0 + (atan(((C - (A + hypot((A - C), B))) / B)) / ((double) M_PI))));
}
public static double code(double A, double B, double C) {
return 180.0 * (-1.0 + (1.0 + (Math.atan(((C - (A + Math.hypot((A - C), B))) / B)) / Math.PI)));
}
def code(A, B, C): return 180.0 * (-1.0 + (1.0 + (math.atan(((C - (A + math.hypot((A - C), B))) / B)) / math.pi)))
function code(A, B, C) return Float64(180.0 * Float64(-1.0 + Float64(1.0 + Float64(atan(Float64(Float64(C - Float64(A + hypot(Float64(A - C), B))) / B)) / pi)))) end
function tmp = code(A, B, C) tmp = 180.0 * (-1.0 + (1.0 + (atan(((C - (A + hypot((A - C), B))) / B)) / pi))); end
code[A_, B_, C_] := N[(180.0 * N[(-1.0 + N[(1.0 + N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \left(-1 + \left(1 + \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(A - C, B\right)\right)}{B}\right)}{\pi}\right)\right)
\end{array}
Initial program 54.4%
Applied egg-rr75.3%
sub-neg75.3%
log1p-udef75.3%
rem-exp-log75.3%
associate--l-71.8%
metadata-eval71.8%
Applied egg-rr71.8%
Final simplification71.8%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((C - (A + math.hypot(B, (A - C)))) / B)) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}
\end{array}
Initial program 54.4%
Simplified70.7%
Final simplification70.7%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (/ (- (- A) (hypot B A)) B)) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((-A - hypot(B, A)) / B)) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((-A - Math.hypot(B, A)) / B)) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((-A - math.hypot(B, A)) / B)) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - hypot(B, A)) / B)) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((-A - hypot(B, A)) / B)) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[((-A) - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(B, A\right)}{B}\right)}{\pi}
\end{array}
Initial program 54.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in C around 0 45.6%
associate-*r/45.6%
mul-1-neg45.6%
+-commutative45.6%
unpow245.6%
unpow245.6%
hypot-def60.7%
Simplified60.7%
Final simplification60.7%
(FPCore (A B C) :precision binary64 (/ (* -180.0 (atan (/ (+ A (hypot A B)) B))) PI))
double code(double A, double B, double C) {
return (-180.0 * atan(((A + hypot(A, B)) / B))) / ((double) M_PI);
}
public static double code(double A, double B, double C) {
return (-180.0 * Math.atan(((A + Math.hypot(A, B)) / B))) / Math.PI;
}
def code(A, B, C): return (-180.0 * math.atan(((A + math.hypot(A, B)) / B))) / math.pi
function code(A, B, C) return Float64(Float64(-180.0 * atan(Float64(Float64(A + hypot(A, B)) / B))) / pi) end
function tmp = code(A, B, C) tmp = (-180.0 * atan(((A + hypot(A, B)) / B))) / pi; end
code[A_, B_, C_] := N[(N[(-180.0 * N[ArcTan[N[(N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
\\
\frac{-180 \cdot \tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)}{\pi}
\end{array}
Initial program 54.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in C around 0 45.6%
associate-*r/45.6%
mul-1-neg45.6%
+-commutative45.6%
unpow245.6%
unpow245.6%
hypot-def60.7%
Simplified60.7%
expm1-log1p-u32.9%
expm1-udef32.9%
distribute-frac-neg32.9%
atan-neg32.9%
Applied egg-rr32.9%
expm1-def32.9%
expm1-log1p60.7%
associate-*r/60.7%
distribute-rgt-neg-out60.7%
distribute-lft-neg-in60.7%
metadata-eval60.7%
hypot-def45.6%
unpow245.6%
unpow245.6%
+-commutative45.6%
unpow245.6%
unpow245.6%
hypot-def60.7%
Simplified60.7%
Final simplification60.7%
(FPCore (A B C) :precision binary64 (* 180.0 (+ -1.0 (+ 1.0 (/ (atan (/ (- C B) B)) PI)))))
double code(double A, double B, double C) {
return 180.0 * (-1.0 + (1.0 + (atan(((C - B) / B)) / ((double) M_PI))));
}
public static double code(double A, double B, double C) {
return 180.0 * (-1.0 + (1.0 + (Math.atan(((C - B) / B)) / Math.PI)));
}
def code(A, B, C): return 180.0 * (-1.0 + (1.0 + (math.atan(((C - B) / B)) / math.pi)))
function code(A, B, C) return Float64(180.0 * Float64(-1.0 + Float64(1.0 + Float64(atan(Float64(Float64(C - B) / B)) / pi)))) end
function tmp = code(A, B, C) tmp = 180.0 * (-1.0 + (1.0 + (atan(((C - B) / B)) / pi))); end
code[A_, B_, C_] := N[(180.0 * N[(-1.0 + N[(1.0 + N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \left(-1 + \left(1 + \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\right)\right)
\end{array}
Initial program 54.4%
Applied egg-rr75.3%
sub-neg75.3%
log1p-udef75.3%
rem-exp-log75.3%
associate--l-71.8%
metadata-eval71.8%
Applied egg-rr71.8%
Taylor expanded in B around inf 40.7%
Final simplification40.7%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C B) A))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - B) - A))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((1.0 / B) * ((C - B) - A))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((1.0 / B) * ((C - B) - A))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - B) - A))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((1.0 / B) * ((C - B) - A))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - B), $MachinePrecision] - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - B\right) - A\right)\right)}{\pi}
\end{array}
Initial program 54.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in B around inf 51.0%
neg-mul-151.0%
unsub-neg51.0%
Simplified51.0%
Final simplification51.0%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (/ (- (- A) B) B)) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((-A - B) / B)) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((-A - B) / B)) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((-A - B) / B)) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(-A) - B) / B)) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((-A - B) / B)) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[((-A) - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - B}{B}\right)}{\pi}
\end{array}
Initial program 54.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in C around 0 45.6%
associate-*r/45.6%
mul-1-neg45.6%
+-commutative45.6%
unpow245.6%
unpow245.6%
hypot-def60.7%
Simplified60.7%
Taylor expanded in A around 0 40.4%
Final simplification40.4%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan((-2.0 * (A / B))) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan((-2.0 * (A / B))) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}
\end{array}
Initial program 54.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in A around inf 25.2%
Final simplification25.2%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (/ (- B A) B)) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan(((B - A) / B)) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan(((B - A) / B)) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan(((B - A) / B)) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(B - A) / B)) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan(((B - A) / B)) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(B - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{B - A}{B}\right)}{\pi}
\end{array}
Initial program 54.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in B around -inf 47.3%
Taylor expanded in C around 0 37.0%
Final simplification37.0%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (/ (- A) B)) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan((-A / B)) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan((-A / B)) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan((-A / B)) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan((-A / B)) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}
\end{array}
Initial program 54.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in B around -inf 47.3%
Taylor expanded in A around inf 25.2%
associate-*r/25.2%
mul-1-neg25.2%
Simplified25.2%
Final simplification25.2%
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (/ C B)) PI)))
double code(double A, double B, double C) {
return 180.0 * (atan((C / B)) / ((double) M_PI));
}
public static double code(double A, double B, double C) {
return 180.0 * (Math.atan((C / B)) / Math.PI);
}
def code(A, B, C): return 180.0 * (math.atan((C / B)) / math.pi)
function code(A, B, C) return Float64(180.0 * Float64(atan(Float64(C / B)) / pi)) end
function tmp = code(A, B, C) tmp = 180.0 * (atan((C / B)) / pi); end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}
\end{array}
Initial program 54.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in B around -inf 47.3%
Taylor expanded in C around inf 25.3%
Final simplification25.3%
(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.4%
associate--l-54.0%
Simplified54.0%
Taylor expanded in B around inf 20.6%
Final simplification20.6%
herbie shell --seed 2024033
(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)))