XYZ Eval(double theta,double phi, int *m)
double r = 0;
r += pow(sin(m*phi),(double)m);
r += pow(cos(m*phi),(double)m);
r += pow(sin(m*theta),(double)m);
r += pow(cos(m*theta),(double)m);
p.x = r * sin(phi) * cos(theta);
p.y = r * cos(phi);
p.z = r * sin(phi) * sin(theta);
is probably easiest to accomplish with two cascaded expressions. One
to compute radius, r, and then passed to a second one to convert to
xyz based on r, theta, and phi.
In the above, replace m[N] with in[N] (to create adjustable
parameters); replace theta with norm*TWOPI, and phi with norm
*PI (to convert our normalized X and Y axis values to normalized
radian based coordinates across the surface of the sphere), and that
should be it.
then your output expressions for xyz would be the following (where
theta and phi are replaced by the same, and r is replaced by in).
You could do with a single instance of jit.expr by replacing r with
the first expression above, but it will be more expensive to compute
for each x, y, and z rather than once for all, as I've suggested.
Quick hack example below. There's some stupid problem with updating
the float values and jit.expr, which requires banging the input
again, which I'll look into (might be some bug for jit.expr float
input), but this should give a decent example of how to convert such
stuff into jit.expr expressions.