
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin 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 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (pow (* angle_m 0.005555555555555556) 0.16666666666666666)))
(+
(pow
(*
a
(cos
(*
PI
(* t_0 (* t_0 (pow (cbrt (* angle_m 0.005555555555555556)) 2.0))))))
2.0)
(pow (* b (sin (* PI (* angle_m 0.005555555555555556)))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = pow((angle_m * 0.005555555555555556), 0.16666666666666666);
return pow((a * cos((((double) M_PI) * (t_0 * (t_0 * pow(cbrt((angle_m * 0.005555555555555556)), 2.0)))))), 2.0) + pow((b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.pow((angle_m * 0.005555555555555556), 0.16666666666666666);
return Math.pow((a * Math.cos((Math.PI * (t_0 * (t_0 * Math.pow(Math.cbrt((angle_m * 0.005555555555555556)), 2.0)))))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(angle_m * 0.005555555555555556) ^ 0.16666666666666666 return Float64((Float64(a * cos(Float64(pi * Float64(t_0 * Float64(t_0 * (cbrt(Float64(angle_m * 0.005555555555555556)) ^ 2.0)))))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 0.16666666666666666], $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[N[(Pi * N[(t$95$0 * N[(t$95$0 * N[Power[N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := {\left(angle\_m \cdot 0.005555555555555556\right)}^{0.16666666666666666}\\
{\left(a \cdot \cos \left(\pi \cdot \left(t\_0 \cdot \left(t\_0 \cdot {\left(\sqrt[3]{angle\_m \cdot 0.005555555555555556}\right)}^{2}\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
\end{array}
Initial program 78.3%
Simplified78.4%
metadata-eval78.4%
div-inv78.3%
add-cube-cbrt78.4%
pow378.4%
div-inv78.5%
metadata-eval78.5%
Applied egg-rr78.5%
cube-mult78.5%
add-sqr-sqrt39.4%
associate-*l*39.4%
pow1/339.4%
sqrt-pow139.4%
metadata-eval39.4%
pow1/339.6%
sqrt-pow139.6%
metadata-eval39.6%
pow239.6%
Applied egg-rr39.6%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (* angle_m 0.005555555555555556))))
(+
(pow (* b (sin (* PI (* angle_m 0.005555555555555556)))) 2.0)
(pow (* a (cos (* PI (* t_0 (pow t_0 2.0))))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = cbrt((angle_m * 0.005555555555555556));
return pow((b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0) + pow((a * cos((((double) M_PI) * (t_0 * pow(t_0, 2.0))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.cbrt((angle_m * 0.005555555555555556));
return Math.pow((b * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))), 2.0) + Math.pow((a * Math.cos((Math.PI * (t_0 * Math.pow(t_0, 2.0))))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = cbrt(Float64(angle_m * 0.005555555555555556)) return Float64((Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0) + (Float64(a * cos(Float64(pi * Float64(t_0 * (t_0 ^ 2.0))))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(Pi * N[(t$95$0 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{angle\_m \cdot 0.005555555555555556}\\
{\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot \left(t\_0 \cdot {t\_0}^{2}\right)\right)\right)}^{2}
\end{array}
\end{array}
Initial program 78.3%
Simplified78.4%
metadata-eval78.4%
div-inv78.3%
add-cube-cbrt78.4%
pow378.4%
div-inv78.5%
metadata-eval78.5%
Applied egg-rr78.5%
unpow378.5%
pow278.5%
Applied egg-rr78.5%
Final simplification78.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (* PI (* angle_m 0.005555555555555556)))) 2.0) (pow (* a (cos (* PI (pow (cbrt (* angle_m 0.005555555555555556)) 3.0)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0) + pow((a * cos((((double) M_PI) * pow(cbrt((angle_m * 0.005555555555555556)), 3.0)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))), 2.0) + Math.pow((a * Math.cos((Math.PI * Math.pow(Math.cbrt((angle_m * 0.005555555555555556)), 3.0)))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0) + (Float64(a * cos(Float64(pi * (cbrt(Float64(angle_m * 0.005555555555555556)) ^ 3.0)))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(Pi * N[Power[N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot {\left(\sqrt[3]{angle\_m \cdot 0.005555555555555556}\right)}^{3}\right)\right)}^{2}
\end{array}
Initial program 78.3%
Simplified78.4%
metadata-eval78.4%
div-inv78.3%
add-cube-cbrt78.4%
pow378.4%
div-inv78.5%
metadata-eval78.5%
Applied egg-rr78.5%
Final simplification78.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (cos (* PI (* angle_m 0.005555555555555556)))) 2.0) (pow (* b (sin (expm1 (log1p (* 0.005555555555555556 (* PI angle_m)))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * cos((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0) + pow((b * sin(expm1(log1p((0.005555555555555556 * (((double) M_PI) * angle_m)))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.cos((Math.PI * (angle_m * 0.005555555555555556)))), 2.0) + Math.pow((b * Math.sin(Math.expm1(Math.log1p((0.005555555555555556 * (Math.PI * angle_m)))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.cos((math.pi * (angle_m * 0.005555555555555556)))), 2.0) + math.pow((b * math.sin(math.expm1(math.log1p((0.005555555555555556 * (math.pi * angle_m)))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * cos(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0) + (Float64(b * sin(expm1(log1p(Float64(0.005555555555555556 * Float64(pi * angle_m)))))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Exp[N[Log[1 + N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\right)}^{2}
\end{array}
Initial program 78.3%
Simplified78.4%
expm1-log1p-u65.2%
associate-*r*65.2%
*-commutative65.2%
Applied egg-rr65.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* PI (* angle_m 0.005555555555555556)))) (+ (pow (* b (sin t_0)) 2.0) (pow (* a (cos t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
return pow((b * sin(t_0)), 2.0) + pow((a * cos(t_0)), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
return Math.pow((b * Math.sin(t_0)), 2.0) + Math.pow((a * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (angle_m * 0.005555555555555556) return math.pow((b * math.sin(t_0)), 2.0) + math.pow((a * math.cos(t_0)), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) return Float64((Float64(b * sin(t_0)) ^ 2.0) + (Float64(a * cos(t_0)) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = pi * (angle_m * 0.005555555555555556); tmp = ((b * sin(t_0)) ^ 2.0) + ((a * cos(t_0)) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
{\left(b \cdot \sin t\_0\right)}^{2} + {\left(a \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 78.3%
Simplified78.4%
Final simplification78.4%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* PI (* angle_m 0.005555555555555556)))) (pow (hypot (* a (cos t_0)) (* b (sin t_0))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
return pow(hypot((a * cos(t_0)), (b * sin(t_0))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
return Math.pow(Math.hypot((a * Math.cos(t_0)), (b * Math.sin(t_0))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (angle_m * 0.005555555555555556) return math.pow(math.hypot((a * math.cos(t_0)), (b * math.sin(t_0))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) return hypot(Float64(a * cos(t_0)), Float64(b * sin(t_0))) ^ 2.0 end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = pi * (angle_m * 0.005555555555555556); tmp = hypot((a * cos(t_0)), (b * sin(t_0))) ^ 2.0; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[Power[N[Sqrt[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
{\left(\mathsf{hypot}\left(a \cdot \cos t\_0, b \cdot \sin t\_0\right)\right)}^{2}
\end{array}
\end{array}
Initial program 78.3%
Simplified78.4%
metadata-eval78.4%
div-inv78.3%
add-cube-cbrt78.4%
pow378.4%
div-inv78.5%
metadata-eval78.5%
Applied egg-rr78.5%
Applied egg-rr78.4%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (pow (hypot (* a (cos (* 0.005555555555555556 (* PI angle_m)))) (* b (sin (* PI (/ angle_m 180.0))))) 2.0))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(hypot((a * cos((0.005555555555555556 * (((double) M_PI) * angle_m)))), (b * sin((((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(Math.hypot((a * Math.cos((0.005555555555555556 * (Math.PI * angle_m)))), (b * Math.sin((Math.PI * (angle_m / 180.0))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(math.hypot((a * math.cos((0.005555555555555556 * (math.pi * angle_m)))), (b * math.sin((math.pi * (angle_m / 180.0))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return hypot(Float64(a * cos(Float64(0.005555555555555556 * Float64(pi * angle_m)))), Float64(b * sin(Float64(pi * Float64(angle_m / 180.0))))) ^ 2.0 end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = hypot((a * cos((0.005555555555555556 * (pi * angle_m)))), (b * sin((pi * (angle_m / 180.0))))) ^ 2.0; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[Power[N[Sqrt[N[(a * N[Cos[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\mathsf{hypot}\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right), b \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\right)}^{2}
\end{array}
Initial program 78.3%
Simplified78.4%
metadata-eval78.4%
div-inv78.4%
add-cbrt-cube54.3%
pow1/342.1%
pow342.1%
div-inv42.1%
metadata-eval42.1%
associate-*r*42.2%
*-commutative42.2%
Applied egg-rr42.2%
unpow1/354.4%
rem-cbrt-cube78.3%
*-commutative78.3%
metadata-eval78.3%
div-inv78.3%
add-cube-cbrt78.1%
associate-/l*78.0%
pow278.0%
Applied egg-rr78.0%
*-un-lft-identity78.0%
add-sqr-sqrt78.0%
pow278.0%
Applied egg-rr78.3%
*-lft-identity78.3%
*-commutative78.3%
*-commutative78.3%
associate-*r*78.2%
associate-/l*78.3%
Simplified78.3%
Final simplification78.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (* PI (* angle_m 0.005555555555555556)))) 2.0) (pow a 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0) + pow(a, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))), 2.0) + Math.pow(a, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi * (angle_m * 0.005555555555555556)))), 2.0) + math.pow(a, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0) + (a ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi * (angle_m * 0.005555555555555556)))) ^ 2.0) + (a ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 78.3%
Simplified78.4%
Taylor expanded in angle around 0 78.2%
Final simplification78.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 1.85e-153) (pow (* b (sin (* angle_m (* PI 0.005555555555555556)))) 2.0) (+ (pow a 2.0) (pow (* b (* 0.005555555555555556 (* PI angle_m))) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.85e-153) {
tmp = pow((b * sin((angle_m * (((double) M_PI) * 0.005555555555555556)))), 2.0);
} else {
tmp = pow(a, 2.0) + pow((b * (0.005555555555555556 * (((double) M_PI) * angle_m))), 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.85e-153) {
tmp = Math.pow((b * Math.sin((angle_m * (Math.PI * 0.005555555555555556)))), 2.0);
} else {
tmp = Math.pow(a, 2.0) + Math.pow((b * (0.005555555555555556 * (Math.PI * angle_m))), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 1.85e-153: tmp = math.pow((b * math.sin((angle_m * (math.pi * 0.005555555555555556)))), 2.0) else: tmp = math.pow(a, 2.0) + math.pow((b * (0.005555555555555556 * (math.pi * angle_m))), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1.85e-153) tmp = Float64(b * sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))) ^ 2.0; else tmp = Float64((a ^ 2.0) + (Float64(b * Float64(0.005555555555555556 * Float64(pi * angle_m))) ^ 2.0)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 1.85e-153) tmp = (b * sin((angle_m * (pi * 0.005555555555555556)))) ^ 2.0; else tmp = (a ^ 2.0) + ((b * (0.005555555555555556 * (pi * angle_m))) ^ 2.0); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.85e-153], N[Power[N[(b * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.85 \cdot 10^{-153}:\\
\;\;\;\;{\left(b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 1.8500000000000001e-153Initial program 81.0%
Simplified81.0%
metadata-eval81.0%
div-inv81.0%
add-cube-cbrt81.2%
pow381.2%
div-inv81.1%
metadata-eval81.1%
Applied egg-rr81.1%
cube-mult81.2%
add-sqr-sqrt40.0%
associate-*l*39.9%
pow1/340.0%
sqrt-pow140.0%
metadata-eval40.0%
pow1/340.1%
sqrt-pow140.1%
metadata-eval40.1%
pow240.1%
Applied egg-rr40.1%
Taylor expanded in a around 0 40.3%
unpow240.3%
associate-*r*40.3%
*-commutative40.3%
*-commutative40.3%
unpow240.3%
swap-sqr48.8%
unpow248.8%
Simplified48.8%
if 1.8500000000000001e-153 < a Initial program 72.9%
Simplified73.0%
metadata-eval73.0%
div-inv73.0%
add-cube-cbrt72.8%
pow372.9%
div-inv73.1%
metadata-eval73.1%
Applied egg-rr73.1%
cube-mult73.0%
add-sqr-sqrt38.3%
associate-*l*38.4%
pow1/338.2%
sqrt-pow138.2%
metadata-eval38.2%
pow1/338.5%
sqrt-pow138.6%
metadata-eval38.6%
pow238.6%
Applied egg-rr38.6%
Taylor expanded in angle around 0 36.4%
Taylor expanded in angle around 0 68.7%
Final simplification55.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 4.8e+157) (pow (* a (cos (* PI (* angle_m 0.005555555555555556)))) 2.0) (pow (* b (sin (* angle_m (* PI 0.005555555555555556)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 4.8e+157) {
tmp = pow((a * cos((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0);
} else {
tmp = pow((b * sin((angle_m * (((double) M_PI) * 0.005555555555555556)))), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 4.8e+157) {
tmp = Math.pow((a * Math.cos((Math.PI * (angle_m * 0.005555555555555556)))), 2.0);
} else {
tmp = Math.pow((b * Math.sin((angle_m * (Math.PI * 0.005555555555555556)))), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 4.8e+157: tmp = math.pow((a * math.cos((math.pi * (angle_m * 0.005555555555555556)))), 2.0) else: tmp = math.pow((b * math.sin((angle_m * (math.pi * 0.005555555555555556)))), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 4.8e+157) tmp = Float64(a * cos(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0; else tmp = Float64(b * sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))) ^ 2.0; end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 4.8e+157) tmp = (a * cos((pi * (angle_m * 0.005555555555555556)))) ^ 2.0; else tmp = (b * sin((angle_m * (pi * 0.005555555555555556)))) ^ 2.0; end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 4.8e+157], N[Power[N[(a * N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(b * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.8 \cdot 10^{+157}:\\
\;\;\;\;{\left(a \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 4.7999999999999999e157Initial program 74.7%
Simplified74.8%
metadata-eval74.8%
div-inv74.8%
add-cube-cbrt74.9%
pow374.9%
div-inv74.9%
metadata-eval74.9%
Applied egg-rr74.9%
Taylor expanded in a around inf 59.4%
pow-prod-down59.4%
associate-*r*59.3%
*-commutative59.3%
associate-*r*59.4%
rem-cube-cbrt59.5%
Applied egg-rr59.5%
if 4.7999999999999999e157 < b Initial program 99.6%
Simplified99.6%
metadata-eval99.6%
div-inv99.6%
add-cube-cbrt99.6%
pow399.6%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
cube-mult99.6%
add-sqr-sqrt54.0%
associate-*l*54.0%
pow1/354.0%
sqrt-pow154.0%
metadata-eval54.0%
pow1/354.0%
sqrt-pow154.0%
metadata-eval54.0%
pow254.0%
Applied egg-rr54.0%
Taylor expanded in a around 0 63.0%
unpow263.0%
associate-*r*63.0%
*-commutative63.0%
*-commutative63.0%
unpow263.0%
swap-sqr91.7%
unpow291.7%
Simplified91.8%
Final simplification64.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 7.8e+157) (pow (* a (cos (* PI (* angle_m 0.005555555555555556)))) 2.0) (pow (* b (sin (* 0.005555555555555556 (* PI angle_m)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 7.8e+157) {
tmp = pow((a * cos((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0);
} else {
tmp = pow((b * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 7.8e+157) {
tmp = Math.pow((a * Math.cos((Math.PI * (angle_m * 0.005555555555555556)))), 2.0);
} else {
tmp = Math.pow((b * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 7.8e+157: tmp = math.pow((a * math.cos((math.pi * (angle_m * 0.005555555555555556)))), 2.0) else: tmp = math.pow((b * math.sin((0.005555555555555556 * (math.pi * angle_m)))), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 7.8e+157) tmp = Float64(a * cos(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0; else tmp = Float64(b * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))) ^ 2.0; end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 7.8e+157) tmp = (a * cos((pi * (angle_m * 0.005555555555555556)))) ^ 2.0; else tmp = (b * sin((0.005555555555555556 * (pi * angle_m)))) ^ 2.0; end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 7.8e+157], N[Power[N[(a * N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.8 \cdot 10^{+157}:\\
\;\;\;\;{\left(a \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 7.79999999999999941e157Initial program 74.7%
Simplified74.8%
metadata-eval74.8%
div-inv74.8%
add-cube-cbrt74.9%
pow374.9%
div-inv74.9%
metadata-eval74.9%
Applied egg-rr74.9%
Taylor expanded in a around inf 59.4%
pow-prod-down59.4%
associate-*r*59.3%
*-commutative59.3%
associate-*r*59.4%
rem-cube-cbrt59.5%
Applied egg-rr59.5%
if 7.79999999999999941e157 < b Initial program 99.6%
Simplified99.6%
Taylor expanded in a around 0 63.0%
unpow263.0%
*-commutative63.0%
unpow263.0%
swap-sqr91.8%
unpow291.8%
*-commutative91.8%
Simplified91.8%
Final simplification64.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 1.3e+169) (pow (* a (cos (* PI (* angle_m 0.005555555555555556)))) 2.0) (cbrt (pow a 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.3e+169) {
tmp = pow((a * cos((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0);
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.3e+169) {
tmp = Math.pow((a * Math.cos((Math.PI * (angle_m * 0.005555555555555556)))), 2.0);
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.3e+169) tmp = Float64(a * cos(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0; else tmp = cbrt((a ^ 6.0)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.3e+169], N[Power[N[(a * N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.3 \cdot 10^{+169}:\\
\;\;\;\;{\left(a \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if b < 1.3e169Initial program 75.1%
Simplified75.1%
metadata-eval75.1%
div-inv75.1%
add-cube-cbrt75.2%
pow375.2%
div-inv75.3%
metadata-eval75.3%
Applied egg-rr75.3%
Taylor expanded in a around inf 58.6%
pow-prod-down58.6%
associate-*r*58.5%
*-commutative58.5%
associate-*r*58.6%
rem-cube-cbrt58.7%
Applied egg-rr58.7%
if 1.3e169 < b Initial program 99.7%
Simplified99.7%
Taylor expanded in angle around 0 31.7%
add-sqr-sqrt31.7%
sqrt-unprod39.8%
pow-prod-up39.8%
metadata-eval39.8%
Applied egg-rr39.8%
add-cbrt-cube39.8%
pow1/339.8%
add-sqr-sqrt39.8%
sqrt-pow139.8%
metadata-eval39.8%
pow-prod-up39.8%
metadata-eval39.8%
Applied egg-rr39.8%
unpow1/339.8%
Simplified39.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 1.45e+169) (* a a) (cbrt (pow a 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.45e+169) {
tmp = a * a;
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.45e+169) {
tmp = a * a;
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.45e+169) tmp = Float64(a * a); else tmp = cbrt((a ^ 6.0)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.45e+169], N[(a * a), $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.45 \cdot 10^{+169}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if b < 1.45e169Initial program 75.1%
Simplified75.1%
Taylor expanded in angle around 0 59.1%
unpow259.1%
Applied egg-rr59.1%
if 1.45e169 < b Initial program 99.7%
Simplified99.7%
Taylor expanded in angle around 0 31.7%
add-sqr-sqrt31.7%
sqrt-unprod39.8%
pow-prod-up39.8%
metadata-eval39.8%
Applied egg-rr39.8%
add-cbrt-cube39.8%
pow1/339.8%
add-sqr-sqrt39.8%
sqrt-pow139.8%
metadata-eval39.8%
pow-prod-up39.8%
metadata-eval39.8%
Applied egg-rr39.8%
unpow1/339.8%
Simplified39.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* a a))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return a * a;
}
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 = a * a
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return a * a;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return a * a
angle_m = abs(angle) function code(a, b, angle_m) return Float64(a * a) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = a * a; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
a \cdot a
\end{array}
Initial program 78.3%
Simplified78.4%
Taylor expanded in angle around 0 55.4%
unpow255.4%
Applied egg-rr55.4%
herbie shell --seed 2024143
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))