Smooth Curves with "createPath" expression
I'm using the "createPath()" function in an expression to generate a parametric curve in after effects and it is quite detailed. I'm not placing very many points to keep it running fast, but unfortunately that means that it looks pretty jagged:

I can solve this by increasing the number of points I use, but this seriously slows down the whole project and is less than ideal. I know that this could be done with fewer points by setting tangents, but naturally those would be very difficult to calculate and highly depend on the particular curve that I"m using (I think I would have to use calculus to differentiate it to calculate the tangents). I'm hoping there's a more general technique to smooth the curve so that it looks something like this:

without taking the performance hit from increasing the number of points too much.
Is there a faster way to smooth the curve, or must I increase the number of points / calculate the tangents with calculus?
This is my expression, if you're curious. The layer is a 4K solid in a 28 second 60fps composition:
P=[];
var height = 2160
var width = 3840
var R = 320
var pi = Math.PI;
for (i=0;i<R;i++)
{
var z = pi*(2*i/(R-1) - 1);
var tt = 2*time*Math.PI/56;
var xp = 1500*Math.sin(7*pi*z + tt)*Math.cos(4*pi*z - tt) + width/2;
var yp = 1500*Math.sin(5*pi*z - tt)*Math.cos(4*pi*z + tt) + height/2;
P.push([xp,yp]);
}
createPath(P,[],[], false)
