
(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 18 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}
(FPCore (a b angle)
:precision binary64
(+
(pow
(*
a
(cos
(pow (cbrt (* 0.005555555555555556 (* (cbrt (pow PI 3.0)) angle))) 3.0)))
2.0)
(pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos(pow(cbrt((0.005555555555555556 * (cbrt(pow(((double) M_PI), 3.0)) * angle))), 3.0))), 2.0) + pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos(Math.pow(Math.cbrt((0.005555555555555556 * (Math.cbrt(Math.pow(Math.PI, 3.0)) * angle))), 3.0))), 2.0) + Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * cos((cbrt(Float64(0.005555555555555556 * Float64(cbrt((pi ^ 3.0)) * angle))) ^ 3.0))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[Power[N[Power[N[(0.005555555555555556 * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left({\left(\sqrt[3]{0.005555555555555556 \cdot \left(\sqrt[3]{{\pi}^{3}} \cdot angle\right)}\right)}^{3}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
add-cube-cbrt78.7%
pow378.8%
div-inv78.8%
metadata-eval78.8%
associate-*r*78.8%
*-commutative78.8%
Applied egg-rr78.8%
add-cbrt-cube79.0%
pow379.0%
Applied egg-rr79.0%
Final simplification79.0%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0) (pow (* a (cos (pow (* (cbrt (* 0.005555555555555556 angle)) (cbrt PI)) 3.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + pow((a * cos(pow((cbrt((0.005555555555555556 * angle)) * cbrt(((double) M_PI))), 3.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0) + Math.pow((a * Math.cos(Math.pow((Math.cbrt((0.005555555555555556 * angle)) * Math.cbrt(Math.PI)), 3.0))), 2.0);
}
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + (Float64(a * cos((Float64(cbrt(Float64(0.005555555555555556 * angle)) * cbrt(pi)) ^ 3.0))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[Power[N[(N[Power[N[(0.005555555555555556 * angle), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + {\left(a \cdot \cos \left({\left(\sqrt[3]{0.005555555555555556 \cdot angle} \cdot \sqrt[3]{\pi}\right)}^{3}\right)\right)}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
add-cube-cbrt78.7%
pow378.8%
div-inv78.8%
metadata-eval78.8%
associate-*r*78.8%
*-commutative78.8%
Applied egg-rr78.8%
*-commutative78.8%
associate-*r*78.8%
*-commutative78.8%
cbrt-prod78.9%
*-commutative78.9%
Applied egg-rr78.9%
Final simplification78.9%
(FPCore (a b angle)
:precision binary64
(+
(pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0)
(pow
(*
a
(cos
(pow (pow (* angle (* 0.005555555555555556 PI)) 0.3333333333333333) 3.0)))
2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + pow((a * cos(pow(pow((angle * (0.005555555555555556 * ((double) M_PI))), 0.3333333333333333), 3.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0) + Math.pow((a * Math.cos(Math.pow(Math.pow((angle * (0.005555555555555556 * Math.PI)), 0.3333333333333333), 3.0))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle)))), 2.0) + math.pow((a * math.cos(math.pow(math.pow((angle * (0.005555555555555556 * math.pi)), 0.3333333333333333), 3.0))), 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + (Float64(a * cos(((Float64(angle * Float64(0.005555555555555556 * pi)) ^ 0.3333333333333333) ^ 3.0))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (0.005555555555555556 * angle)))) ^ 2.0) + ((a * cos((((angle * (0.005555555555555556 * pi)) ^ 0.3333333333333333) ^ 3.0))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[Power[N[Power[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + {\left(a \cdot \cos \left({\left({\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}^{0.3333333333333333}\right)}^{3}\right)\right)}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
add-cube-cbrt78.7%
pow378.8%
div-inv78.8%
metadata-eval78.8%
associate-*r*78.8%
*-commutative78.8%
Applied egg-rr78.8%
pow1/340.3%
associate-*r*40.3%
*-commutative40.3%
Applied egg-rr40.3%
Final simplification40.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0) (pow (* a (cos (pow (cbrt (* 0.005555555555555556 (* PI angle))) 3.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + pow((a * cos(pow(cbrt((0.005555555555555556 * (((double) M_PI) * angle))), 3.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0) + Math.pow((a * Math.cos(Math.pow(Math.cbrt((0.005555555555555556 * (Math.PI * angle))), 3.0))), 2.0);
}
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + (Float64(a * cos((cbrt(Float64(0.005555555555555556 * Float64(pi * angle))) ^ 3.0))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[Power[N[Power[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + {\left(a \cdot \cos \left({\left(\sqrt[3]{0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right)}^{3}\right)\right)}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
add-cube-cbrt78.7%
pow378.8%
div-inv78.8%
metadata-eval78.8%
associate-*r*78.8%
*-commutative78.8%
Applied egg-rr78.8%
Final simplification78.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0) (pow (* a (cos (* (* PI angle) (pow (cbrt 0.005555555555555556) 3.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + pow((a * cos(((((double) M_PI) * angle) * pow(cbrt(0.005555555555555556), 3.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0) + Math.pow((a * Math.cos(((Math.PI * angle) * Math.pow(Math.cbrt(0.005555555555555556), 3.0)))), 2.0);
}
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + (Float64(a * cos(Float64(Float64(pi * angle) * (cbrt(0.005555555555555556) ^ 3.0)))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * N[Power[N[Power[0.005555555555555556, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\left(\pi \cdot angle\right) \cdot {\left(\sqrt[3]{0.005555555555555556}\right)}^{3}\right)\right)}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
add-cube-cbrt78.7%
pow378.8%
div-inv78.8%
metadata-eval78.8%
associate-*r*78.8%
*-commutative78.8%
Applied egg-rr78.8%
cbrt-prod78.8%
unpow-prod-down78.8%
pow378.8%
add-cube-cbrt78.8%
Applied egg-rr78.8%
Final simplification78.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (* 0.005555555555555556 angle)))) 2.0) (pow (* b (expm1 (log1p (sin (* angle (* 0.005555555555555556 PI)))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + pow((b * expm1(log1p(sin((angle * (0.005555555555555556 * ((double) M_PI))))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.PI * (0.005555555555555556 * angle)))), 2.0) + Math.pow((b * Math.expm1(Math.log1p(Math.sin((angle * (0.005555555555555556 * Math.PI)))))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((math.pi * (0.005555555555555556 * angle)))), 2.0) + math.pow((b * math.expm1(math.log1p(math.sin((angle * (0.005555555555555556 * math.pi)))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + (Float64(b * expm1(log1p(sin(Float64(angle * Float64(0.005555555555555556 * pi)))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[(Exp[N[Log[1 + N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.7%
associate-*r/78.7%
clear-num78.6%
Applied egg-rr78.6%
associate-/r/78.7%
metadata-eval78.7%
*-commutative78.7%
associate-*r*78.8%
expm1-log1p-u78.8%
*-commutative78.8%
associate-*l*78.8%
Applied egg-rr78.8%
Final simplification78.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cos (* angle (* 0.005555555555555556 PI)))))
(+
(pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0)
(* t_0 (* a (* a t_0))))))
double code(double a, double b, double angle) {
double t_0 = cos((angle * (0.005555555555555556 * ((double) M_PI))));
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + (t_0 * (a * (a * t_0)));
}
public static double code(double a, double b, double angle) {
double t_0 = Math.cos((angle * (0.005555555555555556 * Math.PI)));
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0) + (t_0 * (a * (a * t_0)));
}
def code(a, b, angle): t_0 = math.cos((angle * (0.005555555555555556 * math.pi))) return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle)))), 2.0) + (t_0 * (a * (a * t_0)))
function code(a, b, angle) t_0 = cos(Float64(angle * Float64(0.005555555555555556 * pi))) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + Float64(t_0 * Float64(a * Float64(a * t_0)))) end
function tmp = code(a, b, angle) t_0 = cos((angle * (0.005555555555555556 * pi))); tmp = ((b * sin((pi * (0.005555555555555556 * angle)))) ^ 2.0) + (t_0 * (a * (a * t_0))); end
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(t$95$0 * N[(a * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + t\_0 \cdot \left(a \cdot \left(a \cdot t\_0\right)\right)
\end{array}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
add-sqr-sqrt38.9%
sqrt-prod78.8%
unpow278.8%
expm1-log1p-u77.8%
sqrt-pow159.9%
metadata-eval59.9%
pow159.9%
div-inv59.4%
metadata-eval59.4%
associate-*r*58.8%
*-commutative58.8%
Applied egg-rr58.8%
unpow258.8%
expm1-log1p-u58.8%
*-commutative58.8%
*-commutative58.8%
associate-*r*57.7%
*-commutative57.7%
associate-*r*57.7%
expm1-log1p-u76.0%
associate-*r*76.6%
*-commutative76.6%
*-commutative76.6%
associate-*l*78.8%
Applied egg-rr78.8%
Final simplification78.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0) (* a (* a (pow (cos (* angle (* 0.005555555555555556 PI))) 2.0)))))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + (a * (a * pow(cos((angle * (0.005555555555555556 * ((double) M_PI)))), 2.0)));
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0) + (a * (a * Math.pow(Math.cos((angle * (0.005555555555555556 * Math.PI))), 2.0)));
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle)))), 2.0) + (a * (a * math.pow(math.cos((angle * (0.005555555555555556 * math.pi))), 2.0)))
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + Float64(a * Float64(a * (cos(Float64(angle * Float64(0.005555555555555556 * pi))) ^ 2.0)))) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (0.005555555555555556 * angle)))) ^ 2.0) + (a * (a * (cos((angle * (0.005555555555555556 * pi))) ^ 2.0))); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * N[(a * N[Power[N[Cos[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + a \cdot \left(a \cdot {\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}^{2}\right)
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
add-sqr-sqrt38.9%
sqrt-prod78.8%
unpow278.8%
expm1-log1p-u77.8%
sqrt-pow159.9%
metadata-eval59.9%
pow159.9%
div-inv59.4%
metadata-eval59.4%
associate-*r*58.8%
*-commutative58.8%
Applied egg-rr58.8%
expm1-log1p-u78.8%
*-commutative78.8%
*-commutative78.8%
associate-*r*78.8%
*-commutative78.8%
unpow-prod-down78.8%
unpow278.8%
associate-*l*78.8%
*-commutative78.8%
associate-*l*78.8%
Applied egg-rr78.8%
Final simplification78.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0) (pow (* a (cos (* angle (/ PI 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + pow((a * cos((angle * (((double) M_PI) / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0) + Math.pow((a * Math.cos((angle * (Math.PI / 180.0)))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle)))), 2.0) + math.pow((a * math.cos((angle * (math.pi / 180.0)))), 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + (Float64(a * cos(Float64(angle * Float64(pi / 180.0)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (0.005555555555555556 * angle)))) ^ 2.0) + ((a * cos((angle * (pi / 180.0)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
clear-num78.7%
un-div-inv78.7%
Applied egg-rr78.7%
associate-/r/78.8%
Simplified78.8%
Final simplification78.8%
(FPCore (a b angle) :precision binary64 (pow (hypot (* a (cos (* angle (* PI -0.005555555555555556)))) (* b (sin (* 0.005555555555555556 (* PI angle))))) 2.0))
double code(double a, double b, double angle) {
return pow(hypot((a * cos((angle * (((double) M_PI) * -0.005555555555555556)))), (b * sin((0.005555555555555556 * (((double) M_PI) * angle))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(Math.hypot((a * Math.cos((angle * (Math.PI * -0.005555555555555556)))), (b * Math.sin((0.005555555555555556 * (Math.PI * angle))))), 2.0);
}
def code(a, b, angle): return math.pow(math.hypot((a * math.cos((angle * (math.pi * -0.005555555555555556)))), (b * math.sin((0.005555555555555556 * (math.pi * angle))))), 2.0)
function code(a, b, angle) return hypot(Float64(a * cos(Float64(angle * Float64(pi * -0.005555555555555556)))), Float64(b * sin(Float64(0.005555555555555556 * Float64(pi * angle))))) ^ 2.0 end
function tmp = code(a, b, angle) tmp = hypot((a * cos((angle * (pi * -0.005555555555555556)))), (b * sin((0.005555555555555556 * (pi * angle))))) ^ 2.0; end
code[a_, b_, angle_] := N[Power[N[Sqrt[N[(a * N[Cos[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(a \cdot \cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.7%
associate-*r/78.7%
clear-num78.6%
Applied egg-rr78.6%
Taylor expanded in a around 0 69.2%
Simplified78.8%
Final simplification78.8%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* PI angle)))) (pow (hypot (* a (cos t_0)) (* b (sin t_0))) 2.0)))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle);
return pow(hypot((a * cos(t_0)), (b * sin(t_0))), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (Math.PI * angle);
return Math.pow(Math.hypot((a * Math.cos(t_0)), (b * Math.sin(t_0))), 2.0);
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (math.pi * angle) return math.pow(math.hypot((a * math.cos(t_0)), (b * math.sin(t_0))), 2.0)
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(pi * angle)) return hypot(Float64(a * cos(t_0)), Float64(b * sin(t_0))) ^ 2.0 end
function tmp = code(a, b, angle) t_0 = 0.005555555555555556 * (pi * angle); tmp = hypot((a * cos(t_0)), (b * sin(t_0))) ^ 2.0; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(Pi * angle), $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}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\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.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
metadata-eval78.8%
div-inv78.8%
unpow278.8%
metadata-eval78.8%
div-inv78.7%
unpow278.7%
unpow278.7%
unpow278.7%
Applied egg-rr78.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle)))) 2.0) (pow a 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0) + pow(a, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle)))), 2.0) + Math.pow(a, 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle)))), 2.0) + math.pow(a, 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0) + (a ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (0.005555555555555556 * angle)))) ^ 2.0) + (a ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
Taylor expanded in angle around 0 78.3%
Final simplification78.3%
(FPCore (a b angle) :precision binary64 (if (<= b 4.2e+76) (pow (* a (cos (* angle (* PI -0.005555555555555556)))) 2.0) (pow (* b (sin (* 0.005555555555555556 (* PI angle)))) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (b <= 4.2e+76) {
tmp = pow((a * cos((angle * (((double) M_PI) * -0.005555555555555556)))), 2.0);
} else {
tmp = pow((b * sin((0.005555555555555556 * (((double) M_PI) * angle)))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 4.2e+76) {
tmp = Math.pow((a * Math.cos((angle * (Math.PI * -0.005555555555555556)))), 2.0);
} else {
tmp = Math.pow((b * Math.sin((0.005555555555555556 * (Math.PI * angle)))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 4.2e+76: tmp = math.pow((a * math.cos((angle * (math.pi * -0.005555555555555556)))), 2.0) else: tmp = math.pow((b * math.sin((0.005555555555555556 * (math.pi * angle)))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 4.2e+76) tmp = Float64(a * cos(Float64(angle * Float64(pi * -0.005555555555555556)))) ^ 2.0; else tmp = Float64(b * sin(Float64(0.005555555555555556 * Float64(pi * angle)))) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 4.2e+76) tmp = (a * cos((angle * (pi * -0.005555555555555556)))) ^ 2.0; else tmp = (b * sin((0.005555555555555556 * (pi * angle)))) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 4.2e+76], N[Power[N[(a * N[Cos[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.2 \cdot 10^{+76}:\\
\;\;\;\;{\left(a \cdot \cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 4.20000000000000013e76Initial program 76.7%
associate-*r/76.7%
metadata-eval76.7%
metadata-eval76.7%
distribute-neg-frac276.7%
distribute-frac-neg76.7%
distribute-rgt-neg-out76.7%
associate-/l*76.7%
neg-mul-176.7%
*-commutative76.7%
associate-/l*76.7%
metadata-eval76.7%
metadata-eval76.7%
Simplified76.7%
metadata-eval76.7%
div-inv76.7%
associate-*r/76.7%
clear-num76.6%
Applied egg-rr76.6%
Taylor expanded in a around inf 65.5%
unpow265.5%
*-commutative65.5%
associate-*l*65.5%
*-commutative65.5%
unpow265.5%
swap-sqr65.5%
unpow265.5%
Simplified65.5%
if 4.20000000000000013e76 < b Initial program 87.0%
associate-*r/87.0%
metadata-eval87.0%
metadata-eval87.0%
distribute-neg-frac287.0%
distribute-frac-neg87.0%
distribute-rgt-neg-out87.0%
associate-/l*87.0%
neg-mul-187.0%
*-commutative87.0%
associate-/l*87.0%
metadata-eval87.0%
metadata-eval87.0%
Simplified87.0%
Taylor expanded in a around 0 49.4%
unpow249.4%
*-commutative49.4%
unpow249.4%
swap-sqr68.0%
unpow268.0%
*-commutative68.0%
Simplified68.0%
Final simplification66.0%
(FPCore (a b angle) :precision binary64 (if (<= angle 2e+23) (pow (* a (cos (* PI (* 0.005555555555555556 angle)))) 2.0) (cbrt (pow a 6.0))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 2e+23) {
tmp = pow((a * cos((((double) M_PI) * (0.005555555555555556 * angle)))), 2.0);
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 2e+23) {
tmp = Math.pow((a * Math.cos((Math.PI * (0.005555555555555556 * angle)))), 2.0);
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (angle <= 2e+23) tmp = Float64(a * cos(Float64(pi * Float64(0.005555555555555556 * angle)))) ^ 2.0; else tmp = cbrt((a ^ 6.0)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[angle, 2e+23], N[Power[N[(a * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 2 \cdot 10^{+23}:\\
\;\;\;\;{\left(a \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if angle < 1.9999999999999998e23Initial program 85.0%
associate-*r/85.0%
metadata-eval85.0%
metadata-eval85.0%
distribute-neg-frac285.0%
distribute-frac-neg85.0%
distribute-rgt-neg-out85.0%
associate-/l*85.0%
neg-mul-185.0%
*-commutative85.0%
associate-/l*85.0%
metadata-eval85.0%
metadata-eval85.0%
Simplified85.0%
metadata-eval85.0%
div-inv85.0%
add-cbrt-cube66.2%
pow366.2%
pow-pow66.2%
div-inv66.2%
metadata-eval66.2%
associate-*r*66.2%
*-commutative66.2%
metadata-eval66.2%
Applied egg-rr66.2%
Taylor expanded in a around inf 60.7%
unpow260.7%
associate-*r*60.7%
*-commutative60.7%
associate-*r*60.7%
unpow260.7%
swap-sqr60.7%
unpow260.7%
associate-*r*60.7%
*-commutative60.7%
associate-*r*60.7%
associate-*r*60.7%
*-commutative60.7%
Simplified60.7%
if 1.9999999999999998e23 < angle Initial program 59.1%
associate-*r/59.4%
metadata-eval59.4%
metadata-eval59.4%
distribute-neg-frac259.4%
distribute-frac-neg59.4%
distribute-rgt-neg-out59.4%
associate-/l*59.1%
neg-mul-159.1%
*-commutative59.1%
associate-/l*59.1%
metadata-eval59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in angle around 0 51.0%
unpow251.0%
Applied egg-rr51.0%
add-cbrt-cube51.3%
pow1/351.2%
unswap-sqr51.2%
pow351.2%
metadata-eval51.2%
pow351.2%
metadata-eval51.2%
sqr-pow51.2%
Applied egg-rr51.2%
unpow1/351.3%
Simplified51.3%
(FPCore (a b angle) :precision binary64 (if (<= angle 2.9e+23) (pow (* a (cos (* angle (* PI -0.005555555555555556)))) 2.0) (cbrt (pow a 6.0))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.9e+23) {
tmp = pow((a * cos((angle * (((double) M_PI) * -0.005555555555555556)))), 2.0);
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.9e+23) {
tmp = Math.pow((a * Math.cos((angle * (Math.PI * -0.005555555555555556)))), 2.0);
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (angle <= 2.9e+23) tmp = Float64(a * cos(Float64(angle * Float64(pi * -0.005555555555555556)))) ^ 2.0; else tmp = cbrt((a ^ 6.0)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[angle, 2.9e+23], N[Power[N[(a * N[Cos[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 2.9 \cdot 10^{+23}:\\
\;\;\;\;{\left(a \cdot \cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if angle < 2.90000000000000013e23Initial program 85.0%
associate-*r/85.0%
metadata-eval85.0%
metadata-eval85.0%
distribute-neg-frac285.0%
distribute-frac-neg85.0%
distribute-rgt-neg-out85.0%
associate-/l*85.0%
neg-mul-185.0%
*-commutative85.0%
associate-/l*85.0%
metadata-eval85.0%
metadata-eval85.0%
Simplified85.0%
metadata-eval85.0%
div-inv85.0%
associate-*r/85.1%
clear-num85.0%
Applied egg-rr85.0%
Taylor expanded in a around inf 60.7%
unpow260.7%
*-commutative60.7%
associate-*l*60.7%
*-commutative60.7%
unpow260.7%
swap-sqr60.7%
unpow260.7%
Simplified60.7%
if 2.90000000000000013e23 < angle Initial program 59.1%
associate-*r/59.4%
metadata-eval59.4%
metadata-eval59.4%
distribute-neg-frac259.4%
distribute-frac-neg59.4%
distribute-rgt-neg-out59.4%
associate-/l*59.1%
neg-mul-159.1%
*-commutative59.1%
associate-/l*59.1%
metadata-eval59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in angle around 0 51.0%
unpow251.0%
Applied egg-rr51.0%
add-cbrt-cube51.3%
pow1/351.2%
unswap-sqr51.2%
pow351.2%
metadata-eval51.2%
pow351.2%
metadata-eval51.2%
sqr-pow51.2%
Applied egg-rr51.2%
unpow1/351.3%
Simplified51.3%
(FPCore (a b angle) :precision binary64 (if (<= angle 8.5e+20) (pow (* a (cos (* 0.005555555555555556 (* PI angle)))) 2.0) (cbrt (pow a 6.0))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 8.5e+20) {
tmp = pow((a * cos((0.005555555555555556 * (((double) M_PI) * angle)))), 2.0);
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 8.5e+20) {
tmp = Math.pow((a * Math.cos((0.005555555555555556 * (Math.PI * angle)))), 2.0);
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (angle <= 8.5e+20) tmp = Float64(a * cos(Float64(0.005555555555555556 * Float64(pi * angle)))) ^ 2.0; else tmp = cbrt((a ^ 6.0)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[angle, 8.5e+20], N[Power[N[(a * N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 8.5 \cdot 10^{+20}:\\
\;\;\;\;{\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if angle < 8.5e20Initial program 85.0%
associate-*r/85.0%
metadata-eval85.0%
metadata-eval85.0%
distribute-neg-frac285.0%
distribute-frac-neg85.0%
distribute-rgt-neg-out85.0%
associate-/l*85.0%
neg-mul-185.0%
*-commutative85.0%
associate-/l*85.0%
metadata-eval85.0%
metadata-eval85.0%
Simplified85.0%
Taylor expanded in a around inf 60.7%
*-commutative60.7%
unpow260.7%
unpow260.7%
swap-sqr60.7%
unpow260.7%
*-commutative60.7%
Simplified60.7%
if 8.5e20 < angle Initial program 59.1%
associate-*r/59.4%
metadata-eval59.4%
metadata-eval59.4%
distribute-neg-frac259.4%
distribute-frac-neg59.4%
distribute-rgt-neg-out59.4%
associate-/l*59.1%
neg-mul-159.1%
*-commutative59.1%
associate-/l*59.1%
metadata-eval59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in angle around 0 51.0%
unpow251.0%
Applied egg-rr51.0%
add-cbrt-cube51.3%
pow1/351.2%
unswap-sqr51.2%
pow351.2%
metadata-eval51.2%
pow351.2%
metadata-eval51.2%
sqr-pow51.2%
Applied egg-rr51.2%
unpow1/351.3%
Simplified51.3%
Final simplification58.4%
(FPCore (a b angle) :precision binary64 (if (<= b 1.75e+248) (* a a) (cbrt (pow a 6.0))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.75e+248) {
tmp = a * a;
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.75e+248) {
tmp = a * a;
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (b <= 1.75e+248) tmp = Float64(a * a); else tmp = cbrt((a ^ 6.0)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[b, 1.75e+248], N[(a * a), $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.75 \cdot 10^{+248}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if b < 1.75000000000000011e248Initial program 77.8%
associate-*r/77.9%
metadata-eval77.9%
metadata-eval77.9%
distribute-neg-frac277.9%
distribute-frac-neg77.9%
distribute-rgt-neg-out77.9%
associate-/l*77.8%
neg-mul-177.8%
*-commutative77.8%
associate-/l*77.8%
metadata-eval77.8%
metadata-eval77.8%
Simplified77.8%
Taylor expanded in angle around 0 59.0%
unpow259.0%
Applied egg-rr59.0%
if 1.75000000000000011e248 < b Initial program 99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-neg-frac299.6%
distribute-frac-neg99.6%
distribute-rgt-neg-out99.6%
associate-/l*99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in angle around 0 21.6%
unpow221.6%
Applied egg-rr21.6%
add-cbrt-cube46.6%
pow1/346.6%
unswap-sqr46.6%
pow346.6%
metadata-eval46.6%
pow346.6%
metadata-eval46.6%
sqr-pow46.6%
Applied egg-rr46.6%
unpow1/346.6%
Simplified46.6%
(FPCore (a b angle) :precision binary64 (* a a))
double code(double a, double b, double angle) {
return a * a;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = a * a
end function
public static double code(double a, double b, double angle) {
return a * a;
}
def code(a, b, angle): return a * a
function code(a, b, angle) return Float64(a * a) end
function tmp = code(a, b, angle) tmp = a * a; end
code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a
\end{array}
Initial program 78.7%
associate-*r/78.8%
metadata-eval78.8%
metadata-eval78.8%
distribute-neg-frac278.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*78.7%
neg-mul-178.7%
*-commutative78.7%
associate-/l*78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.8%
Taylor expanded in angle around 0 57.4%
unpow257.4%
Applied egg-rr57.4%
herbie shell --seed 2024165
(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)))