
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (pow (sqrt (* angle_m (* PI 0.005555555555555556))) 2.0))) 2.0) (pow (* b (cos (* PI (/ angle_m 180.0)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(pow(sqrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 2.0))), 2.0) + pow((b * cos((((double) M_PI) * (angle_m / 180.0)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(Math.pow(Math.sqrt((angle_m * (Math.PI * 0.005555555555555556))), 2.0))), 2.0) + Math.pow((b * Math.cos((Math.PI * (angle_m / 180.0)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(math.pow(math.sqrt((angle_m * (math.pi * 0.005555555555555556))), 2.0))), 2.0) + math.pow((b * math.cos((math.pi * (angle_m / 180.0)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin((sqrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 2.0))) ^ 2.0) + (Float64(b * cos(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((sqrt((angle_m * (pi * 0.005555555555555556))) ^ 2.0))) ^ 2.0) + ((b * cos((pi * (angle_m / 180.0)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[Power[N[Sqrt[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left({\left(\sqrt{angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2}
\end{array}
Initial program 78.7%
add-sqr-sqrt36.9%
pow236.9%
associate-*l/36.9%
associate-*r/36.9%
div-inv36.9%
metadata-eval36.9%
Applied egg-rr36.9%
Final simplification36.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(pow
(hypot
(*
b
(cos (* (sqrt angle_m) (* (* PI 0.005555555555555556) (sqrt angle_m)))))
(* a (sin (* angle_m (* PI 0.005555555555555556)))))
2.0))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(hypot((b * cos((sqrt(angle_m) * ((((double) M_PI) * 0.005555555555555556) * sqrt(angle_m))))), (a * sin((angle_m * (((double) M_PI) * 0.005555555555555556))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow(Math.hypot((b * Math.cos((Math.sqrt(angle_m) * ((Math.PI * 0.005555555555555556) * Math.sqrt(angle_m))))), (a * Math.sin((angle_m * (Math.PI * 0.005555555555555556))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(math.hypot((b * math.cos((math.sqrt(angle_m) * ((math.pi * 0.005555555555555556) * math.sqrt(angle_m))))), (a * math.sin((angle_m * (math.pi * 0.005555555555555556))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return hypot(Float64(b * cos(Float64(sqrt(angle_m) * Float64(Float64(pi * 0.005555555555555556) * sqrt(angle_m))))), Float64(a * sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))) ^ 2.0 end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = hypot((b * cos((sqrt(angle_m) * ((pi * 0.005555555555555556) * sqrt(angle_m))))), (a * sin((angle_m * (pi * 0.005555555555555556))))) ^ 2.0; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[Power[N[Sqrt[N[(b * N[Cos[N[(N[Sqrt[angle$95$m], $MachinePrecision] * N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * N[Sqrt[angle$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(a * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\mathsf{hypot}\left(b \cdot \cos \left(\sqrt{angle\_m} \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot \sqrt{angle\_m}\right)\right), a \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}
\end{array}
Initial program 78.7%
add-sqr-sqrt36.9%
pow236.9%
associate-*l/36.9%
associate-*r/36.9%
div-inv36.9%
metadata-eval36.9%
Applied egg-rr36.9%
add-sqr-sqrt36.9%
pow236.9%
Applied egg-rr78.7%
associate-*r*78.8%
*-commutative78.8%
*-commutative78.8%
add-cube-cbrt78.7%
pow378.7%
*-commutative78.7%
*-commutative78.7%
associate-*r*78.7%
Applied egg-rr78.7%
rem-cube-cbrt78.7%
*-commutative78.7%
associate-*r*78.7%
add-sqr-sqrt36.9%
associate-*r*36.9%
Applied egg-rr36.9%
Final simplification36.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* angle_m (* PI 0.005555555555555556))) (t_1 (cos t_0))) (fma (* b (* b t_1)) t_1 (pow (* a (sin t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = angle_m * (((double) M_PI) * 0.005555555555555556);
double t_1 = cos(t_0);
return fma((b * (b * t_1)), t_1, pow((a * sin(t_0)), 2.0));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(angle_m * Float64(pi * 0.005555555555555556)) t_1 = cos(t_0) return fma(Float64(b * Float64(b * t_1)), t_1, (Float64(a * sin(t_0)) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, N[(N[(b * N[(b * t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$1 + N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := \cos t\_0\\
\mathsf{fma}\left(b \cdot \left(b \cdot t\_1\right), t\_1, {\left(a \cdot \sin t\_0\right)}^{2}\right)
\end{array}
\end{array}
Initial program 78.7%
unpow278.7%
associate-*l/78.6%
associate-/l*78.8%
unpow278.8%
Simplified78.7%
+-commutative78.7%
associate-*r/78.8%
associate-*l/78.8%
unpow278.8%
associate-*r/78.6%
associate-*l/78.7%
unpow278.7%
associate-*r*78.7%
unpow278.7%
Applied egg-rr78.7%
Final simplification78.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* angle_m (* PI 0.005555555555555556)))) (pow (hypot (* a (sin t_0)) (* b (cos t_0))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = angle_m * (((double) M_PI) * 0.005555555555555556);
return pow(hypot((a * sin(t_0)), (b * cos(t_0))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = angle_m * (Math.PI * 0.005555555555555556);
return Math.pow(Math.hypot((a * Math.sin(t_0)), (b * Math.cos(t_0))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = angle_m * (math.pi * 0.005555555555555556) return math.pow(math.hypot((a * math.sin(t_0)), (b * math.cos(t_0))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(angle_m * Float64(pi * 0.005555555555555556)) return hypot(Float64(a * sin(t_0)), Float64(b * cos(t_0))) ^ 2.0 end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = angle_m * (pi * 0.005555555555555556); tmp = hypot((a * sin(t_0)), (b * cos(t_0))) ^ 2.0; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[Power[N[Sqrt[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
{\left(\mathsf{hypot}\left(a \cdot \sin t\_0, b \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Initial program 78.7%
unpow278.7%
associate-*l/78.6%
associate-/l*78.8%
unpow278.8%
Simplified78.7%
Applied egg-rr78.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle_m PI))))
(if (<= a 2.1e+120)
(* (pow b 2.0) (pow (cos t_0) 2.0))
(pow (* a (sin t_0)) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double tmp;
if (a <= 2.1e+120) {
tmp = pow(b, 2.0) * pow(cos(t_0), 2.0);
} else {
tmp = pow((a * sin(t_0)), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (angle_m * Math.PI);
double tmp;
if (a <= 2.1e+120) {
tmp = Math.pow(b, 2.0) * Math.pow(Math.cos(t_0), 2.0);
} else {
tmp = Math.pow((a * Math.sin(t_0)), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = 0.005555555555555556 * (angle_m * math.pi) tmp = 0 if a <= 2.1e+120: tmp = math.pow(b, 2.0) * math.pow(math.cos(t_0), 2.0) else: tmp = math.pow((a * math.sin(t_0)), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(0.005555555555555556 * Float64(angle_m * pi)) tmp = 0.0 if (a <= 2.1e+120) tmp = Float64((b ^ 2.0) * (cos(t_0) ^ 2.0)); else tmp = Float64(a * sin(t_0)) ^ 2.0; end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = 0.005555555555555556 * (angle_m * pi); tmp = 0.0; if (a <= 2.1e+120) tmp = (b ^ 2.0) * (cos(t_0) ^ 2.0); else tmp = (a * sin(t_0)) ^ 2.0; end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 2.1e+120], N[(N[Power[b, 2.0], $MachinePrecision] * N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
\mathbf{if}\;a \leq 2.1 \cdot 10^{+120}:\\
\;\;\;\;{b}^{2} \cdot {\cos t\_0}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\
\end{array}
\end{array}
if a < 2.1e120Initial program 76.4%
unpow276.4%
associate-*l/76.3%
associate-/l*76.4%
unpow276.4%
Simplified76.4%
Taylor expanded in a around 0 62.3%
if 2.1e120 < a Initial program 90.2%
unpow290.2%
associate-*l/90.1%
associate-/l*90.3%
unpow290.3%
Simplified90.3%
Taylor expanded in a around inf 65.8%
unpow265.8%
*-commutative65.8%
associate-*r*65.8%
unpow265.8%
swap-sqr81.7%
unpow281.7%
associate-*r*81.6%
*-commutative81.6%
Simplified81.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (pow (hypot b (* a (sin (* angle_m (* PI 0.005555555555555556))))) 2.0))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(hypot(b, (a * sin((angle_m * (((double) M_PI) * 0.005555555555555556))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow(Math.hypot(b, (a * Math.sin((angle_m * (Math.PI * 0.005555555555555556))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(math.hypot(b, (a * math.sin((angle_m * (math.pi * 0.005555555555555556))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return hypot(b, Float64(a * sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))) ^ 2.0 end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = hypot(b, (a * sin((angle_m * (pi * 0.005555555555555556))))) ^ 2.0; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[Power[N[Sqrt[b ^ 2 + N[(a * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\mathsf{hypot}\left(b, a \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}
\end{array}
Initial program 78.7%
add-sqr-sqrt36.9%
pow236.9%
associate-*l/36.9%
associate-*r/36.9%
div-inv36.9%
metadata-eval36.9%
Applied egg-rr36.9%
add-sqr-sqrt36.9%
pow236.9%
Applied egg-rr78.7%
Taylor expanded in angle around 0 77.7%
Final simplification77.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))) (if (<= a 9.8e+120) (pow (* b (cos t_0)) 2.0) (pow (* a (sin t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double tmp;
if (a <= 9.8e+120) {
tmp = pow((b * cos(t_0)), 2.0);
} else {
tmp = pow((a * sin(t_0)), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (angle_m * Math.PI);
double tmp;
if (a <= 9.8e+120) {
tmp = Math.pow((b * Math.cos(t_0)), 2.0);
} else {
tmp = Math.pow((a * Math.sin(t_0)), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = 0.005555555555555556 * (angle_m * math.pi) tmp = 0 if a <= 9.8e+120: tmp = math.pow((b * math.cos(t_0)), 2.0) else: tmp = math.pow((a * math.sin(t_0)), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(0.005555555555555556 * Float64(angle_m * pi)) tmp = 0.0 if (a <= 9.8e+120) tmp = Float64(b * cos(t_0)) ^ 2.0; else tmp = Float64(a * sin(t_0)) ^ 2.0; end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = 0.005555555555555556 * (angle_m * pi); tmp = 0.0; if (a <= 9.8e+120) tmp = (b * cos(t_0)) ^ 2.0; else tmp = (a * sin(t_0)) ^ 2.0; end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 9.8e+120], N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
\mathbf{if}\;a \leq 9.8 \cdot 10^{+120}:\\
\;\;\;\;{\left(b \cdot \cos t\_0\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\
\end{array}
\end{array}
if a < 9.80000000000000021e120Initial program 76.4%
unpow276.4%
associate-*l/76.3%
associate-/l*76.4%
unpow276.4%
Simplified76.4%
Taylor expanded in a around 0 62.3%
*-commutative62.3%
associate-*r*62.2%
unpow262.2%
unpow262.2%
swap-sqr62.2%
unpow262.2%
associate-*r*62.3%
*-commutative62.3%
Simplified62.3%
if 9.80000000000000021e120 < a Initial program 90.2%
unpow290.2%
associate-*l/90.1%
associate-/l*90.3%
unpow290.3%
Simplified90.3%
Taylor expanded in a around inf 65.8%
unpow265.8%
*-commutative65.8%
associate-*r*65.8%
unpow265.8%
swap-sqr81.7%
unpow281.7%
associate-*r*81.6%
*-commutative81.6%
Simplified81.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 1.2e+121) (* b b) (pow (* a (sin (* 0.005555555555555556 (* angle_m PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.2e+121) {
tmp = b * b;
} else {
tmp = pow((a * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.2e+121) {
tmp = b * b;
} else {
tmp = Math.pow((a * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 1.2e+121: tmp = b * b else: tmp = math.pow((a * math.sin((0.005555555555555556 * (angle_m * math.pi)))), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1.2e+121) tmp = Float64(b * b); else tmp = Float64(a * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 2.0; end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 1.2e+121) tmp = b * b; else tmp = (a * sin((0.005555555555555556 * (angle_m * pi)))) ^ 2.0; end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.2e+121], N[(b * b), $MachinePrecision], N[Power[N[(a * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.2 \cdot 10^{+121}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 1.2e121Initial program 76.4%
unpow276.4%
associate-*l/76.3%
associate-/l*76.4%
unpow276.4%
Simplified76.4%
Taylor expanded in angle around 0 61.3%
unpow261.3%
Applied egg-rr61.3%
if 1.2e121 < a Initial program 90.2%
unpow290.2%
associate-*l/90.1%
associate-/l*90.3%
unpow290.3%
Simplified90.3%
Taylor expanded in a around inf 65.8%
unpow265.8%
*-commutative65.8%
associate-*r*65.8%
unpow265.8%
swap-sqr81.7%
unpow281.7%
associate-*r*81.6%
*-commutative81.6%
Simplified81.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 1.9e+207) (* b b) (pow (pow b 6.0) 0.3333333333333333)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.9e+207) {
tmp = b * b;
} else {
tmp = pow(pow(b, 6.0), 0.3333333333333333);
}
return tmp;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle_m
real(8) :: tmp
if (a <= 1.9d+207) then
tmp = b * b
else
tmp = (b ** 6.0d0) ** 0.3333333333333333d0
end if
code = tmp
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.9e+207) {
tmp = b * b;
} else {
tmp = Math.pow(Math.pow(b, 6.0), 0.3333333333333333);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 1.9e+207: tmp = b * b else: tmp = math.pow(math.pow(b, 6.0), 0.3333333333333333) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1.9e+207) tmp = Float64(b * b); else tmp = (b ^ 6.0) ^ 0.3333333333333333; end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 1.9e+207) tmp = b * b; else tmp = (b ^ 6.0) ^ 0.3333333333333333; end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.9e+207], N[(b * b), $MachinePrecision], N[Power[N[Power[b, 6.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.9 \cdot 10^{+207}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;{\left({b}^{6}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if a < 1.89999999999999993e207Initial program 76.9%
unpow276.9%
associate-*l/76.8%
associate-/l*76.9%
unpow276.9%
Simplified76.9%
Taylor expanded in angle around 0 57.8%
unpow257.8%
Applied egg-rr57.8%
if 1.89999999999999993e207 < a Initial program 99.7%
add-sqr-sqrt47.6%
pow247.6%
associate-*l/47.6%
associate-*r/47.6%
div-inv47.6%
metadata-eval47.6%
Applied egg-rr47.6%
add-cbrt-cube43.1%
pow1/343.1%
Applied egg-rr86.4%
Taylor expanded in angle around 0 35.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 7.4e+213) (* b b) (cbrt (pow b 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 7.4e+213) {
tmp = b * b;
} else {
tmp = cbrt(pow(b, 6.0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 7.4e+213) {
tmp = b * b;
} else {
tmp = Math.cbrt(Math.pow(b, 6.0));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 7.4e+213) tmp = Float64(b * b); else tmp = cbrt((b ^ 6.0)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 7.4e+213], N[(b * b), $MachinePrecision], N[Power[N[Power[b, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.4 \cdot 10^{+213}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{b}^{6}}\\
\end{array}
\end{array}
if a < 7.39999999999999985e213Initial program 77.0%
unpow277.0%
associate-*l/77.0%
associate-/l*77.1%
unpow277.1%
Simplified77.1%
Taylor expanded in angle around 0 57.7%
unpow257.7%
Applied egg-rr57.7%
if 7.39999999999999985e213 < a Initial program 99.7%
add-sqr-sqrt47.4%
pow247.4%
associate-*l/47.4%
associate-*r/47.4%
div-inv47.4%
metadata-eval47.4%
Applied egg-rr47.4%
add-sqr-sqrt47.4%
pow247.4%
Applied egg-rr99.8%
rem-cbrt-cube85.3%
pow-pow85.3%
Applied egg-rr85.3%
Taylor expanded in angle around 0 33.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* b b))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle_m
code = b * b
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return b * b
angle_m = abs(angle) function code(a, b, angle_m) return Float64(b * b) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = b * b; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
b \cdot b
\end{array}
Initial program 78.7%
unpow278.7%
associate-*l/78.6%
associate-/l*78.8%
unpow278.8%
Simplified78.7%
Taylor expanded in angle around 0 54.1%
unpow254.1%
Applied egg-rr54.1%
herbie shell --seed 2024185
(FPCore (a b angle)
:name "ab-angle->ABCF A"
:precision binary64
(+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))