
(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 14 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 (* (/ angle_m 180.0) PI))) 2.0) (pow (* b (cos (expm1 (log1p (* angle_m (* PI 0.005555555555555556)))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(expm1(log1p((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((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(Math.expm1(Math.log1p((angle_m * (Math.PI * 0.005555555555555556)))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(math.expm1(math.log1p((angle_m * (math.pi * 0.005555555555555556)))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(expm1(log1p(Float64(angle_m * Float64(pi * 0.005555555555555556)))))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Exp[N[Log[1 + N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2}
\end{array}
Initial program 81.0%
expm1-log1p-u66.8%
associate-*l/66.8%
associate-*r/66.8%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (* (pow (cos (/ 1.0 (/ 180.0 (* angle_m PI)))) 2.0) (pow b 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + (pow(cos((1.0 / (180.0 / (angle_m * ((double) M_PI))))), 2.0) * pow(b, 2.0));
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + (Math.pow(Math.cos((1.0 / (180.0 / (angle_m * Math.PI)))), 2.0) * Math.pow(b, 2.0));
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + (math.pow(math.cos((1.0 / (180.0 / (angle_m * math.pi)))), 2.0) * math.pow(b, 2.0))
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + Float64((cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi)))) ^ 2.0) * (b ^ 2.0))) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((cos((1.0 / (180.0 / (angle_m * pi)))) ^ 2.0) * (b ^ 2.0)); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[Power[N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\cos \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)}^{2} \cdot {b}^{2}
\end{array}
Initial program 81.0%
associate-*l/81.0%
clear-num81.0%
Applied egg-rr81.0%
add-exp-log44.1%
associate-/r*44.1%
Applied egg-rr44.1%
rem-exp-log44.1%
*-un-lft-identity44.1%
exp-prod44.1%
rem-exp-log44.1%
associate-/r*44.1%
Applied egg-rr44.1%
*-commutative44.1%
unpow-prod-down44.1%
pow-exp44.1%
*-un-lft-identity44.1%
add-exp-log81.0%
Applied egg-rr81.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (pow (* b (cos (/ 1.0 (/ 180.0 (* angle_m PI))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos((1.0 / (180.0 / (angle_m * math.pi))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos((1.0 / (180.0 / (angle_m * pi))))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)\right)}^{2}
\end{array}
Initial program 81.0%
associate-*l/81.0%
clear-num81.0%
Applied egg-rr81.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (/ angle_m 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((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 / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = (angle_m / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = (angle_m / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.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[(N[(angle$95$m / 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}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 81.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* angle_m (/ PI 180.0)))) (+ (pow (* a (sin t_0)) 2.0) (pow (* 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) / 180.0);
return pow((a * sin(t_0)), 2.0) + pow((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 / 180.0);
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = angle_m * (math.pi / 180.0) return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(angle_m * Float64(pi / 180.0)) return Float64((Float64(a * sin(t_0)) ^ 2.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 / 180.0); tmp = ((a * sin(t_0)) ^ 2.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 / 180.0), $MachinePrecision]), $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}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := angle\_m \cdot \frac{\pi}{180}\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 81.0%
unpow281.0%
associate-*l/80.9%
associate-/l*81.0%
unpow281.0%
Simplified81.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (pow (hypot (* a (sin (* PI (* angle_m 0.005555555555555556)))) (* b (cos (* angle_m (* PI 0.005555555555555556))))) 2.0))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(hypot((a * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))), (b * cos((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((a * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))), (b * Math.cos((angle_m * (Math.PI * 0.005555555555555556))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(math.hypot((a * math.sin((math.pi * (angle_m * 0.005555555555555556)))), (b * math.cos((angle_m * (math.pi * 0.005555555555555556))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return hypot(Float64(a * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))), Float64(b * cos(Float64(angle_m * Float64(pi * 0.005555555555555556))))) ^ 2.0 end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = hypot((a * sin((pi * (angle_m * 0.005555555555555556)))), (b * cos((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[(a * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Cos[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(a \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right), b \cdot \cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}
\end{array}
Initial program 81.0%
expm1-log1p-u66.8%
associate-*l/66.8%
associate-*r/66.8%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
add-sqr-sqrt66.8%
pow266.8%
Applied egg-rr80.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))) (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 = 0.005555555555555556 * (angle_m * ((double) M_PI));
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 = 0.005555555555555556 * (angle_m * Math.PI);
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 = 0.005555555555555556 * (angle_m * math.pi) 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(0.005555555555555556 * Float64(angle_m * pi)) 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 = 0.005555555555555556 * (angle_m * pi); 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[(0.005555555555555556 * N[(angle$95$m * Pi), $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 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
{\left(\mathsf{hypot}\left(a \cdot \sin t\_0, b \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Initial program 81.0%
unpow281.0%
associate-*l/80.9%
associate-/l*81.0%
unpow281.0%
Simplified81.0%
Taylor expanded in a around 0 74.4%
*-commutative74.4%
associate-*r*74.5%
unpow274.5%
unpow274.5%
unpow274.5%
unpow274.5%
swap-sqr81.0%
*-commutative81.0%
Simplified80.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (pow b 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow(b, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow(b, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow(b, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (b ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + (b ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 81.0%
expm1-log1p-u66.8%
associate-*l/66.8%
associate-*r/66.8%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
Taylor expanded in angle around 0 80.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI 0.005555555555555556))) (t_1 (* a t_0)))
(if (<= b 1.14e-138)
(pow (* a (sin t_0)) 2.0)
(+ (pow (* b (cos (* angle_m (/ PI 180.0)))) 2.0) (* t_1 t_1)))))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 = a * t_0;
double tmp;
if (b <= 1.14e-138) {
tmp = pow((a * sin(t_0)), 2.0);
} else {
tmp = pow((b * cos((angle_m * (((double) M_PI) / 180.0)))), 2.0) + (t_1 * t_1);
}
return tmp;
}
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);
double t_1 = a * t_0;
double tmp;
if (b <= 1.14e-138) {
tmp = Math.pow((a * Math.sin(t_0)), 2.0);
} else {
tmp = Math.pow((b * Math.cos((angle_m * (Math.PI / 180.0)))), 2.0) + (t_1 * t_1);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = angle_m * (math.pi * 0.005555555555555556) t_1 = a * t_0 tmp = 0 if b <= 1.14e-138: tmp = math.pow((a * math.sin(t_0)), 2.0) else: tmp = math.pow((b * math.cos((angle_m * (math.pi / 180.0)))), 2.0) + (t_1 * t_1) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(angle_m * Float64(pi * 0.005555555555555556)) t_1 = Float64(a * t_0) tmp = 0.0 if (b <= 1.14e-138) tmp = Float64(a * sin(t_0)) ^ 2.0; else tmp = Float64((Float64(b * cos(Float64(angle_m * Float64(pi / 180.0)))) ^ 2.0) + Float64(t_1 * t_1)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = angle_m * (pi * 0.005555555555555556); t_1 = a * t_0; tmp = 0.0; if (b <= 1.14e-138) tmp = (a * sin(t_0)) ^ 2.0; else tmp = ((b * cos((angle_m * (pi / 180.0)))) ^ 2.0) + (t_1 * t_1); end tmp_2 = tmp; 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[(a * t$95$0), $MachinePrecision]}, If[LessEqual[b, 1.14e-138], N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[Power[N[(b * N[Cos[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(t$95$1 * t$95$1), $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 := a \cdot t\_0\\
\mathbf{if}\;b \leq 1.14 \cdot 10^{-138}:\\
\;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \cos \left(angle\_m \cdot \frac{\pi}{180}\right)\right)}^{2} + t\_1 \cdot t\_1\\
\end{array}
\end{array}
if b < 1.1399999999999999e-138Initial program 81.6%
associate-*l/81.6%
clear-num81.6%
Applied egg-rr81.6%
add-exp-log41.5%
associate-/r*41.5%
Applied egg-rr41.5%
Taylor expanded in a around inf 49.6%
*-commutative49.6%
*-commutative49.6%
associate-*r*49.7%
unpow249.7%
unpow249.7%
swap-sqr52.6%
unpow252.6%
*-commutative52.6%
Simplified52.6%
if 1.1399999999999999e-138 < b Initial program 79.9%
unpow279.9%
associate-*l/80.0%
associate-/l*80.0%
unpow280.0%
Simplified79.9%
Taylor expanded in angle around 0 66.0%
*-commutative66.0%
associate-*l*66.0%
unpow266.0%
unpow266.0%
unswap-sqr66.0%
metadata-eval66.0%
swap-sqr65.9%
associate-*r*66.0%
associate-*r*65.9%
unpow265.9%
associate-*r*65.9%
*-commutative65.9%
Simplified65.9%
add-sqr-sqrt65.9%
sqrt-unprod66.0%
pow-prod-down66.0%
pow-prod-down75.8%
pow-prod-up75.8%
*-commutative75.8%
associate-*l*75.8%
metadata-eval75.8%
Applied egg-rr75.8%
associate-*r*75.8%
Simplified75.8%
sqrt-pow177.9%
metadata-eval77.9%
pow277.9%
associate-*l*78.0%
associate-*l*77.9%
Applied egg-rr77.9%
Final simplification61.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))) (if (<= a 9.6e+159) (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.6e+159) {
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.6e+159) {
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.6e+159: 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.6e+159) 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.6e+159) 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.6e+159], 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.6 \cdot 10^{+159}:\\
\;\;\;\;{\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.5999999999999999e159Initial program 79.2%
unpow279.2%
associate-*l/79.1%
associate-/l*79.2%
unpow279.2%
Simplified79.2%
Taylor expanded in a around 0 60.9%
*-commutative60.9%
*-commutative60.9%
associate-*r*60.9%
unpow260.9%
unpow260.9%
swap-sqr60.9%
unpow260.9%
*-commutative60.9%
associate-*r*60.9%
*-commutative60.9%
Simplified60.9%
if 9.5999999999999999e159 < a Initial program 96.2%
associate-*l/96.2%
clear-num96.2%
Applied egg-rr96.2%
add-cube-cbrt96.2%
pow396.2%
associate-/r/96.2%
metadata-eval96.2%
*-commutative96.2%
Applied egg-rr96.2%
add-sqr-sqrt55.4%
unpow-prod-down55.4%
pow1/355.4%
*-commutative55.4%
sqrt-pow155.4%
*-commutative55.4%
associate-*l*55.4%
metadata-eval55.4%
pow1/355.4%
*-commutative55.4%
sqrt-pow155.4%
*-commutative55.4%
associate-*l*55.4%
metadata-eval55.4%
Applied egg-rr55.4%
pow-sqr55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in a around inf 70.8%
unpow270.8%
*-commutative70.8%
associate-*r*70.8%
unpow270.8%
swap-sqr85.5%
unpow285.5%
associate-*r*85.5%
*-commutative85.5%
Simplified85.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 9.6e+159) (* 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 <= 9.6e+159) {
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 <= 9.6e+159) {
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 <= 9.6e+159: 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 <= 9.6e+159) 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 <= 9.6e+159) 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, 9.6e+159], 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 9.6 \cdot 10^{+159}:\\
\;\;\;\;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 < 9.5999999999999999e159Initial program 79.2%
unpow279.2%
associate-*l/79.1%
associate-/l*79.2%
unpow279.2%
Simplified79.2%
Taylor expanded in angle around 0 60.7%
unpow260.7%
Applied egg-rr60.7%
if 9.5999999999999999e159 < a Initial program 96.2%
associate-*l/96.2%
clear-num96.2%
Applied egg-rr96.2%
add-cube-cbrt96.2%
pow396.2%
associate-/r/96.2%
metadata-eval96.2%
*-commutative96.2%
Applied egg-rr96.2%
add-sqr-sqrt55.4%
unpow-prod-down55.4%
pow1/355.4%
*-commutative55.4%
sqrt-pow155.4%
*-commutative55.4%
associate-*l*55.4%
metadata-eval55.4%
pow1/355.4%
*-commutative55.4%
sqrt-pow155.4%
*-commutative55.4%
associate-*l*55.4%
metadata-eval55.4%
Applied egg-rr55.4%
pow-sqr55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in a around inf 70.8%
unpow270.8%
*-commutative70.8%
associate-*r*70.8%
unpow270.8%
swap-sqr85.5%
unpow285.5%
associate-*r*85.5%
*-commutative85.5%
Simplified85.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 7.5e+134) (* b b) (sqrt (pow b 4.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 7.5e+134) {
tmp = b * b;
} else {
tmp = sqrt(pow(b, 4.0));
}
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 <= 7.5d+134) then
tmp = b * b
else
tmp = sqrt((b ** 4.0d0))
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 <= 7.5e+134) {
tmp = b * b;
} else {
tmp = Math.sqrt(Math.pow(b, 4.0));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 7.5e+134: tmp = b * b else: tmp = math.sqrt(math.pow(b, 4.0)) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 7.5e+134) tmp = Float64(b * b); else tmp = sqrt((b ^ 4.0)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 7.5e+134) tmp = b * b; else tmp = sqrt((b ^ 4.0)); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 7.5e+134], N[(b * b), $MachinePrecision], N[Sqrt[N[Power[b, 4.0], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.5 \cdot 10^{+134}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{b}^{4}}\\
\end{array}
\end{array}
if a < 7.5000000000000001e134Initial program 80.2%
unpow280.2%
associate-*l/80.0%
associate-/l*80.1%
unpow280.1%
Simplified80.0%
Taylor expanded in angle around 0 61.8%
unpow261.8%
Applied egg-rr61.8%
if 7.5000000000000001e134 < a Initial program 86.9%
unpow286.9%
associate-*l/86.9%
associate-/l*87.1%
unpow287.1%
Simplified87.1%
Taylor expanded in angle around 0 29.5%
unpow229.5%
Applied egg-rr29.5%
pow229.5%
add-sqr-sqrt29.5%
sqrt-unprod41.0%
pow-prod-up41.0%
metadata-eval41.0%
Applied egg-rr41.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= angle_m 4.3e+231) (* b b) (cbrt (pow b 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (angle_m <= 4.3e+231) {
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 (angle_m <= 4.3e+231) {
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 (angle_m <= 4.3e+231) 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[angle$95$m, 4.3e+231], 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}\;angle\_m \leq 4.3 \cdot 10^{+231}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{b}^{6}}\\
\end{array}
\end{array}
if angle < 4.29999999999999976e231Initial program 82.3%
unpow282.3%
associate-*l/82.2%
associate-/l*82.3%
unpow282.3%
Simplified82.3%
Taylor expanded in angle around 0 58.9%
unpow258.9%
Applied egg-rr58.9%
if 4.29999999999999976e231 < angle Initial program 67.8%
unpow267.8%
associate-*l/67.2%
associate-/l*67.4%
unpow267.4%
Simplified67.0%
Taylor expanded in angle around 0 44.3%
unpow244.3%
Applied egg-rr44.3%
pow244.3%
add-sqr-sqrt44.3%
sqrt-unprod56.8%
pow-prod-up56.8%
metadata-eval56.8%
Applied egg-rr56.8%
add-cbrt-cube56.3%
pow1/356.3%
add-sqr-sqrt56.3%
sqrt-pow156.3%
metadata-eval56.3%
pow-prod-up56.3%
metadata-eval56.3%
Applied egg-rr56.3%
unpow1/356.3%
Simplified56.3%
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 81.0%
unpow281.0%
associate-*l/80.9%
associate-/l*81.0%
unpow281.0%
Simplified81.0%
Taylor expanded in angle around 0 57.6%
unpow257.6%
Applied egg-rr57.6%
herbie shell --seed 2024131
(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)))