home *** CD-ROM | disk | FTP | other *** search
/ Mega A/V / mega_av.zip / mega_av / GRAPHUTL / WINS1651.ZIP / FRACTALS.C < prev    next >
C/C++ Source or Header  |  1991-07-07  |  111KB  |  3,467 lines

  1. /*
  2. FRACTALS.C and CALCFRAC.C actually calculate the fractal images (well,
  3. SOMEBODY had to do it!).  The modules are set up so that all logic that
  4. is independent of any fractal-specific code is in CALCFRAC.C, and the
  5. code that IS fractal-specific is in FRACTALS.C. Original author Tim Wegner,
  6. but just about ALL the authors have contributed SOME code to this routine
  7. at one time or another, or contributed to one of the many massive
  8. restructurings.
  9.  
  10. The Fractal-specific routines are divided into three categories:
  11.  
  12. 1. Routines that are called once-per-orbit to calculate the orbit
  13.    value. These have names like "XxxxFractal", and their function
  14.    pointers are stored in fractalspecific[fractype].orbitcalc. EVERY
  15.    new fractal type needs one of these. Return 0 to continue iterations,
  16.    1 if we're done. Results for integer fractals are left in 'lnew.x' and
  17.    'lnew.y', for floating point fractals in 'new.x' and 'new.y'.
  18.  
  19. 2. Routines that are called once per pixel to set various variables
  20.    prior to the orbit calculation. These have names like xxx_per_pixel
  21.    and are fairly generic - chances are one is right for your new type.
  22.    They are stored in fractalspecific[fractype].per_pixel.
  23.  
  24. 3. Routines that are called once per screen to set various variables.
  25.    These have names like XxxxSetup, and are stored in
  26.    fractalspecific[fractype].per_image.
  27.  
  28. 4. The main fractal routine. Usually this will be StandardFractal(),
  29.    but if you have written a stand-alone fractal routine independent
  30.    of the StandardFractal mechanisms, your routine name goes here,
  31.    stored in fractalspecific[fractype].calctype.per_image.
  32.  
  33. Adding a new fractal type should be simply a matter of adding an item
  34. to the 'fractalspecific' structure, writing (or re-using one of the existing)
  35. an appropriate setup, per_image, per_pixel, and orbit routines.
  36.  
  37. --------------------------------------------------------------------   */
  38.  
  39.  
  40. #include <stdio.h>
  41. #include <stdlib.h>
  42. #include <float.h>
  43. #include <limits.h>
  44. #include <string.h>
  45. #include <malloc.h>
  46. #include "fractint.h"
  47. #include "mpmath.h"
  48. #include "helpdefs.h"
  49. #include "fractype.h"
  50.  
  51. #define NEWTONDEGREELIMIT  100
  52.  
  53. extern struct complex  initorbit;
  54. extern struct lcomplex linitorbit;
  55. extern char useinitorbit;
  56. extern double fgLimit;
  57.  
  58. extern void (*ltrig0)();
  59. extern void (*ltrig1)();
  60. extern void (*ltrig2)();
  61. extern void (*ltrig3)();
  62. extern void (*dtrig0)();
  63. extern void (*dtrig1)();
  64. extern void (*dtrig2)();
  65. extern void (*dtrig3)();
  66.  
  67. /* -------------------------------------------------------------------- */
  68. /*   The following #defines allow the complex transcendental functions    */
  69. /*   in parser.c to be used here thus avoiding duplicated code.     */
  70. /* -------------------------------------------------------------------- */
  71.  
  72. #define CMPLXmod(z)      (sqr((z).x)+sqr((z).y))
  73. #define CMPLXconj(z)    ((z).y =  -((z).y))
  74. #define LCMPLXmod(z)       (lsqr((z).x)+lsqr((z).y))
  75. #define LCMPLXconj(z)    ((z).y =  -((z).y))
  76.  
  77.  
  78. #define LCMPLXtrig0(arg,out) Arg1->l = (arg); ltrig0(); (out)=Arg1->l
  79. #define LCMPLXtrig1(arg,out) Arg1->l = (arg); ltrig1(); (out)=Arg1->l
  80. #define LCMPLXtrig2(arg,out) Arg1->l = (arg); ltrig2(); (out)=Arg1->l
  81. #define LCMPLXtrig3(arg,out) Arg1->l = (arg); ltrig3(); (out)=Arg1->l
  82.  
  83. #define  CMPLXtrig0(arg,out) Arg1->d = (arg); dtrig0(); (out)=Arg1->d
  84. #define  CMPLXtrig1(arg,out) Arg1->d = (arg); dtrig1(); (out)=Arg1->d
  85. #define  CMPLXtrig2(arg,out) Arg1->d = (arg); dtrig2(); (out)=Arg1->d
  86. #define  CMPLXtrig3(arg,out) Arg1->d = (arg); dtrig3(); (out)=Arg1->d
  87.  
  88.  
  89. #define LCMPLXsin(arg,out)   Arg1->l = (arg); lStkSin();  (out) = Arg1->l
  90. #define LCMPLXcos(arg,out)   Arg1->l = (arg); lStkCos();  (out) = Arg1->l
  91. #define LCMPLXsinh(arg,out)  Arg1->l = (arg); lStkSinh(); (out) = Arg1->l
  92. #define LCMPLXcosh(arg,out)  Arg1->l = (arg); lStkCosh(); (out) = Arg1->l
  93. #define LCMPLXlog(arg,out)   Arg1->l = (arg); lStkLog();  (out) = Arg1->l
  94. #define LCMPLXexp(arg,out)   Arg1->l = (arg); lStkExp();  (out) = Arg1->l
  95. /*
  96. #define LCMPLXsqr(arg,out)   Arg1->l = (arg); lStkSqr();  (out) = Arg1->l
  97. */
  98. #define LCMPLXsqr(arg,out)   \
  99.    (out).x = lsqr((arg).x) - lsqr((arg).y);\
  100.    (out).y = multiply((arg).x, (arg).y, bitshiftless1)
  101. #define LCMPLXsqr_old(out)     \
  102.    (out).y = multiply(lold.x, lold.y, bitshiftless1);\
  103.    (out).x = ltempsqrx - ltempsqry\
  104.  
  105. #define LCMPLXpwr(arg1,arg2,out)    Arg2->l = (arg1); Arg1->l = (arg2);\
  106.      lStkPwr(); Arg1++; Arg2++; (out) = Arg2->l
  107. #define LCMPLXmult(arg1,arg2,out)    Arg2->l = (arg1); Arg1->l = (arg2);\
  108.      lStkMul(); Arg1++; Arg2++; (out) = Arg2->l
  109. #define LCMPLXadd(arg1,arg2,out)    \
  110.     (out).x = (arg1).x + (arg2).x; (out).y = (arg1).y + (arg2).y
  111. #define LCMPLXsub(arg1,arg2,out)    \
  112.     (out).x = (arg1).x - (arg2).x; (out).y = (arg1).y - (arg2).y
  113.  
  114. #define LCMPLXtimesreal(arg,real,out)    \
  115.     (out).x = multiply((arg).x,(real),bitshift);\
  116.     (out).y = multiply((arg).y,(real),bitshift)
  117.  
  118. #define LCMPLXrecip(arg,out)    \
  119. { long denom; denom = lsqr((arg).x) + lsqr((arg).y);\
  120. if(denom==0L) overflow=1; else {(out).x = divide((arg).x,denom,bitshift);\
  121. (out).y = -divide((arg).y,denom,bitshift);}}
  122.  
  123. #define CMPLXsin(arg,out)    Arg1->d = (arg); dStkSin();  (out) = Arg1->d
  124. #define CMPLXcos(arg,out)    Arg1->d = (arg); dStkCos();  (out) = Arg1->d
  125. #define CMPLXsinh(arg,out)   Arg1->d = (arg); dStkSinh(); (out) = Arg1->d
  126. #define CMPLXcosh(arg,out)   Arg1->d = (arg); dStkCosh(); (out) = Arg1->d
  127. #define CMPLXlog(arg,out)    Arg1->d = (arg); dStkLog();  (out) = Arg1->d
  128. #define CMPLXexp(arg,out)    FPUcplxexp(&(arg), &(out))
  129. /*
  130. #define CMPLXsqr(arg,out)    Arg1->d = (arg); dStkSqr();  (out) = Arg1->d
  131. */
  132. #define CMPLXsqr(arg,out)    \
  133.    (out).x = sqr((arg).x) - sqr((arg).y);\
  134.    (out).y = ((arg).x+(arg).x) * (arg).y
  135. #define CMPLXsqr_old(out)    \
  136.    (out).y = (old.x+old.x) * old.y;\
  137.    (out).x = tempsqrx - tempsqry
  138.  
  139. #define CMPLXpwr(arg1,arg2,out)   (out)= ComplexPower((arg1), (arg2))
  140. #define CMPLXmult1(arg1,arg2,out)    Arg2->d = (arg1); Arg1->d = (arg2);\
  141.      dStkMul(); Arg1++; Arg2++; (out) = Arg2->d
  142. #define CMPLXmult(arg1,arg2,out)  \
  143.     {\
  144.        CMPLX TmP;\
  145.        TmP.x = (arg1).x*(arg2).x - (arg1).y*(arg2).y;\
  146.        TmP.y = (arg1).x*(arg2).y + (arg1).y*(arg2).x;\
  147.        (out) = TmP;\
  148.      }
  149. #define CMPLXadd(arg1,arg2,out)    \
  150.     (out).x = (arg1).x + (arg2).x; (out).y = (arg1).y + (arg2).y
  151. #define CMPLXsub(arg1,arg2,out)    \
  152.     (out).x = (arg1).x - (arg2).x; (out).y = (arg1).y - (arg2).y
  153. #define CMPLXtimesreal(arg,real,out)   \
  154.     (out).x = (arg).x*(real);\
  155.     (out).y = (arg).y*(real)
  156.  
  157. #define CMPLXrecip(arg,out)    \
  158.    { double denom; denom = sqr((arg).x) + sqr((arg).y);\
  159.      if(denom==0.0) {(out).x = 1.0e10;(out).y = 1.0e10;}else\
  160.     { (out).x =  (arg).x/denom;\
  161.      (out).y = -(arg).y/denom;}}
  162.  
  163. extern int xshift, yshift;
  164. long Exp086(long);
  165. double fmod(double,double);
  166. extern int biomorph;
  167. extern int forcesymmetry;
  168. extern int symmetry;
  169. LCMPLX lcoefficient,lold,lnew,lparm, linit,ltmp,ltmp2,lparm2;
  170. long ltempsqrx,ltempsqry;
  171. extern int decomp[];
  172. extern double param[];
  173. extern int potflag;                   /* potential enabled? */
  174. extern double f_radius,f_xcenter,f_ycenter;    /* inversion radius, center */
  175. extern double xxmin,xxmax,yymin,yymax;           /* corners */
  176. extern int overflow;
  177. extern int integerfractal;    /* TRUE if fractal uses integer math */
  178.  
  179. int maxcolor;
  180. int root, degree,basin;
  181. double floatmin,floatmax;
  182. double roverd, d1overd, threshold;
  183. CMPLX tmp2;
  184. extern CMPLX init,tmp,old,new,saved,ComplexPower();
  185. CMPLX    staticroots[16]; /* roots array for degree 16 or less */
  186. CMPLX    *roots = staticroots;
  187. struct MPC    *MPCroots;
  188. extern int color, row, col;
  189. extern int invert;
  190. extern double far *dx0, far *dy0;
  191. extern double far *dx1, far *dy1;
  192. long FgHalf;
  193.  
  194. CMPLX one;
  195. CMPLX pwr;
  196. CMPLX Coefficient;
  197.  
  198. extern int    colors;             /* maximum colors available */
  199. extern int    inside;             /* "inside" color to use    */
  200. extern int    outside;            /* "outside" color to use   */
  201. extern int    finattract;
  202. extern int    fractype;            /* fractal type */
  203. extern int    debugflag;            /* for debugging purposes */
  204.  
  205. extern double    param[];        /* parameters */
  206. extern long    far *lx0, far *ly0;        /* X, Y points */
  207. extern long    far *lx1, far *ly1;        /* X, Y points */
  208. extern long    delx,dely;            /* X, Y increments */
  209. extern long    delmin;             /* min(max(dx),max(dy) */
  210. extern long    ddelmin;            /* min(max(dx),max(dy) */
  211. extern long    fudge;                /* fudge factor (2**n) */
  212. extern int    bitshift;            /* bit shift for fudge */
  213. int    bitshiftless1;            /* bit shift less 1 */
  214.  
  215. #ifndef sqr
  216. #define sqr(x) ((x)*(x))
  217. #endif
  218.  
  219. #ifndef lsqr
  220. #define lsqr(x) (multiply((x),(x),bitshift))
  221. #endif
  222.  
  223. #define modulus(z)     (sqr((z).x)+sqr((z).y))
  224. #define conjugate(pz)    ((pz)->y = 0.0 - (pz)->y)
  225. #define distance(z1,z2)  (sqr((z1).x-(z2).x)+sqr((z1).y-(z2).y))
  226. #define pMPsqr(z) (*pMPmul((z),(z)))
  227. #define MPdistance(z1,z2)  (*pMPadd(pMPsqr(*pMPsub((z1).x,(z2).x)),pMPsqr(*pMPsub((z1).y,(z2).y))))
  228.  
  229. double twopi = PI*2.0;
  230. static int c_exp;
  231.  
  232.  
  233. /* These are local but I don't want to pass them as parameters */
  234. CMPLX lambda;
  235. extern double magnitude, rqlim, rqlim2;
  236. CMPLX parm,parm2;
  237. CMPLX *floatparm;
  238. LCMPLX *longparm; /* used here and in jb.c */
  239. extern int (*calctype)();
  240. extern unsigned long lm;        /* magnitude limit (CALCMAND) */
  241.  
  242. /* -------------------------------------------------------------------- */
  243. /*        These variables are external for speed's sake only      */
  244. /* -------------------------------------------------------------------- */
  245.  
  246. double sinx,cosx,sinhx,coshx;
  247. double siny,cosy,sinhy,coshy;
  248. double tmpexp;
  249. double tempsqrx,tempsqry;
  250.  
  251. double foldxinitx,foldyinity,foldxinity,foldyinitx;
  252. long oldxinitx,oldyinity,oldxinity,oldyinitx;
  253. long longtmp;
  254. extern long lmagnitud, llimit, llimit2, l16triglim;
  255. extern periodicitycheck;
  256. extern char floatflag;
  257.  
  258. extern int StandardFractal();
  259. extern int NewtonFractal2(); /* Lee Crocker's Newton code */
  260.  
  261. /* these are in mpmath_c.c */
  262. extern int ComplexNewtonSetup(void);
  263. extern int ComplexNewton(void), ComplexBasin(void), MarksCplxMand(void);
  264. extern int MarksCplxMandperp(void);
  265.  
  266. /* these are in (I think) JB.C */
  267. extern int Std4dFractal(), JulibrotSetup(), jb_per_pixel();
  268.  
  269. extern int Lsystem();
  270.  
  271. /* temporary variables for trig use */
  272. long lcosx, lcoshx, lsinx, lsinhx;
  273. long lcosy, lcoshy, lsiny, lsinhy;
  274.  
  275. /*
  276. **  details of finite attractors (required for Magnet Fractals)
  277. **  (can also be used in "coloring in" the lakes of Julia types)
  278. */
  279. extern          int      attractors; /* number of finite attractors   */
  280. extern CMPLX  attr[];       /* finite attractor values (f.p) */
  281. extern LCMPLX lattr[];      /* finite attractor values (int) */
  282.  
  283. /*
  284. **  pre-calculated values for fractal types Magnet2M & Magnet2J
  285. */
  286. CMPLX    T_Cm1;          /* 3 * (floatparm - 1)            */
  287. CMPLX    T_Cm2;          /* 3 * (floatparm - 2)            */
  288. CMPLX    T_Cm1Cm2;     /* (floatparm - 1) * (floatparm - 2) */
  289.  
  290. void FloatPreCalcMagnet2() /* precalculation for Magnet2 (M & J) for speed */
  291.   {
  292.     T_Cm1.x = floatparm->x - 1.0;   T_Cm1.y = floatparm->y;
  293.     T_Cm2.x = floatparm->x - 2.0;   T_Cm2.y = floatparm->y;
  294.     T_Cm1Cm2.x = (T_Cm1.x * T_Cm2.x) - (T_Cm1.y * T_Cm2.y);
  295.     T_Cm1Cm2.y = (T_Cm1.x * T_Cm2.y) + (T_Cm1.y * T_Cm2.x);
  296.     T_Cm1.x += T_Cm1.x + T_Cm1.x;   T_Cm1.y += T_Cm1.y + T_Cm1.y;
  297.     T_Cm2.x += T_Cm2.x + T_Cm2.x;   T_Cm2.y += T_Cm2.y + T_Cm2.y;
  298.   }
  299.  
  300. /* -------------------------------------------------------------------- */
  301. /*        Stand-alone routines                                            */
  302. /* -------------------------------------------------------------------- */
  303.  
  304. extern int orbit2dfloat();
  305. extern int orbit2dlong();
  306. extern int kamtorusfloatorbit();
  307. extern int kamtoruslongorbit();
  308.  
  309. /* functions defined elswhere needed for fractalspecific */
  310. extern int orbit3dfloat();
  311. extern int orbit3dlong();
  312. extern int lorenz3dlongorbit();
  313. extern int orbit3dlongsetup();
  314. extern int lorenz3dfloatorbit();
  315. extern int orbit3dfloatsetup();
  316. extern int rosslerfloatorbit();
  317. extern int rosslerlongorbit();
  318. extern int henonfloatorbit();
  319. extern int henonlongorbit();
  320. extern int pickoverfloatorbit();
  321. extern int gingerbreadfloatorbit();
  322. extern int diffusion();
  323. extern int plasma();
  324. extern int test();
  325. extern int ifs();
  326. extern int Bifurcation(void);
  327. extern int BifurcVerhulst(void);
  328. extern int LongBifurcVerhulst(void);
  329. extern int BifurcLambda(void);
  330. extern int LongBifurcLambda(void);
  331. extern int BifurcAddSinPi(void);
  332. extern int LongBifurcAddSinPi(void);
  333. extern int BifurcSetSinPi(void);
  334. extern int LongBifurcSetSinPi(void);
  335. extern int popcorn(void);
  336.  
  337. /* -------------------------------------------------------------------- */
  338. /*        Bailout Routines Macros                                                 */
  339. /* -------------------------------------------------------------------- */
  340.  
  341. static int near floatbailout()
  342. {
  343.    if ( ( magnitude = ( tempsqrx=sqr(new.x) )
  344.             + ( tempsqry=sqr(new.y) ) ) >= rqlim ) return(1);
  345.    old = new;
  346.    return(0);
  347. }
  348.  
  349. /* longbailout() is equivalent to next */
  350. #define LONGBAILOUT()    \
  351.    ltempsqrx = lsqr(lnew.x); ltempsqry = lsqr(lnew.y);\
  352.    lmagnitud = ltempsqrx + ltempsqry;\
  353.    if (lmagnitud >= llimit || lmagnitud < 0 || labs(lnew.x) > llimit2\
  354.      || labs(lnew.y) > llimit2 || overflow) \
  355.            { overflow=0;return(1);}\
  356.    lold = lnew;
  357.  
  358. #define FLOATTRIGBAILOUT()  \
  359.    if (fabs(old.y) >= rqlim2) return(1);
  360.  
  361. #define LONGTRIGBAILOUT()  \
  362.    if(labs(lold.y) >= llimit2 || overflow) { overflow=0;return(1);}
  363.  
  364. #define LONGXYTRIGBAILOUT()  \
  365.    if(labs(lold.x) >= llimit2 || labs(lold.y) >= llimit2 || overflow)\
  366.     { overflow=0;return(1);}
  367.  
  368. #define FLOATXYTRIGBAILOUT()  \
  369.    if (fabs(old.x) >= rqlim2 || fabs(old.y) >= rqlim2) return(1);
  370.  
  371. #define FLOATHTRIGBAILOUT()  \
  372.    if (fabs(old.x) >= rqlim2) return(1);
  373.  
  374. #define LONGHTRIGBAILOUT()  \
  375.    if(labs(lold.x) >= llimit2 || overflow) { overflow=0;return(1);}
  376.  
  377. #define TRIG16CHECK(X)    \
  378.       if(labs((X)) > l16triglim || overflow) { overflow=0;return(1);}
  379.  
  380. #define FLOATEXPBAILOUT()  \
  381.    if (fabs(old.y) >= 1.0e8) return(1);\
  382.    if (fabs(old.x) >= 6.4e2) return(1);
  383.  
  384. #define LONGEXPBAILOUT()  \
  385.    if (labs(lold.y) >= (1000L<<bitshift)) return(1);\
  386.    if (labs(lold.x) >=      (8L<<bitshift)) return(1);
  387.  
  388. #if 0
  389. /* this define uses usual trig instead of fast trig */
  390. #define FPUsincos(px,psinx,pcosx) \
  391.    *(psinx) = sin(*(px));\
  392.    *(pcosx) = cos(*(px));
  393.  
  394. #define FPUsinhcosh(px,psinhx,pcoshx) \
  395.    *(psinhx) = sinh(*(px));\
  396.    *(pcoshx) = cosh(*(px));
  397. #endif
  398.  
  399. #define LTRIGARG(X)    \
  400.    if(labs((X)) > l16triglim)\
  401.    {\
  402.       double tmp;\
  403.       tmp = (X);\
  404.       tmp /= fudge;\
  405.       tmp = fmod(tmp,twopi);\
  406.       tmp *= fudge;\
  407.       (X) = tmp;\
  408.    }\
  409.  
  410. /* -------------------------------------------------------------------- */
  411. /*        Fractal (once per iteration) routines            */
  412. /* -------------------------------------------------------------------- */
  413. static double xt, yt, t2;
  414.  
  415. /* Raise complex number (base) to the (exp) power, storing the result
  416. ** in complex (result).
  417. */
  418. void cpower(CMPLX *base, int exp, CMPLX *result)
  419. {
  420.     xt = base->x;   yt = base->y;
  421.  
  422.     if (exp & 1)
  423.     {
  424.        result->x = xt;
  425.        result->y = yt;
  426.     }
  427.     else
  428.     {
  429.        result->x = 1.0;
  430.        result->y = 0.0;
  431.     }
  432.  
  433.     exp >>= 1;
  434.     while (exp)
  435.     {
  436.     t2 = xt * xt - yt * yt;
  437.     yt = 2 * xt * yt;
  438.     xt = t2;
  439.  
  440.     if (exp & 1)
  441.     {
  442.         t2 = xt * result->x - yt * result->y;
  443.         result->y = result->y * xt + yt * result->x;
  444.         result->x = t2;
  445.     }
  446.     exp >>= 1;
  447.     }
  448. }
  449. /* long version */
  450. static long lxt, lyt, lt2;
  451. lcpower(LCMPLX *base, int exp, LCMPLX *result, int bitshift)
  452. {
  453.     static long maxarg;
  454.     maxarg = 64L<<bitshift;
  455.  
  456.     overflow = 0;
  457.     lxt = base->x;   lyt = base->y;
  458.  
  459.     if (exp & 1)
  460.     {
  461.        result->x = lxt;
  462.        result->y = lyt;
  463.     }
  464.     else
  465.     {
  466.        result->x = 1L<<bitshift;
  467.        result->y = 0L;
  468.     }
  469.  
  470.     exp >>= 1;
  471.     while (exp)
  472.     {
  473.     /*
  474.     if(labs(lxt) >= maxarg || labs(lyt) >= maxarg)
  475.        return(-1);
  476.     */
  477.     lt2 = multiply(lxt, lxt, bitshift) - multiply(lyt,lyt,bitshift);
  478.     lyt = multiply(lxt,lyt,bitshiftless1);
  479.     if(overflow)
  480.        return(overflow);
  481.     lxt = lt2;
  482.  
  483.     if (exp & 1)
  484.     {
  485.         lt2 = multiply(lxt,result->x, bitshift) - multiply(lyt,result->y,bitshift);
  486.         result->y = multiply(result->y,lxt,bitshift) + multiply(lyt,result->x,bitshift);
  487.         result->x = lt2;
  488.     }
  489.     exp >>= 1;
  490.     }
  491.     if(result->x == 0 && result->y == 0)
  492.        overflow = 1;
  493.     return(overflow);
  494. }
  495.  
  496. z_to_the_z(CMPLX *z, CMPLX *out)
  497. {
  498.     static CMPLX tmp1,tmp2;
  499.     /* raises complex z to the z power */
  500.     int errno_xxx;
  501.     errno_xxx = 0;
  502.  
  503.     if(fabs(z->x) < DBL_EPSILON) return(-1);
  504.  
  505.     /* log(x + iy) = 1/2(log(x*x + y*y) + i(arc_tan(y/x)) */
  506.     tmp1.x = .5*log(sqr(z->x)+sqr(z->y));
  507.  
  508.     /* the fabs in next line added to prevent discontinuity in image */
  509.     tmp1.y = atan(fabs(z->y/z->x));
  510.  
  511.     /* log(z)*z */
  512.     tmp2.x = tmp1.x * z->x - tmp1.y * z->y;
  513.     tmp2.y = tmp1.x * z->y + tmp1.y * z->x;
  514.  
  515.     /* z*z = e**(log(z)*z) */
  516.     /* e**(x + iy) =  e**x * (cos(y) + isin(y)) */
  517.  
  518.     tmpexp = exp(tmp2.x);
  519.  
  520.     FPUsincos(&tmp2.y,&siny,&cosy);
  521.     out->x = tmpexp*cosy;
  522.     out->y = tmpexp*siny;
  523.     return(errno_xxx);
  524. }
  525.  
  526. /* Distance of complex z from unit circle */
  527. #define DIST1(z) (((z).x-1.0)*((z).x-1.0)+((z).y)*((z).y))
  528. #define LDIST1(z) (lsqr((((z).x)-fudge)) + lsqr(((z).y)))
  529.  
  530. #ifdef NEWTON
  531. complex_mult(CMPLX arg1,CMPLX arg2,CMPLX *pz);
  532. complex_div(CMPLX arg1,CMPLX arg2,CMPLX *pz);
  533.  
  534. int NewtonFractal()
  535. {
  536.     static char start=1;
  537.     if(start)
  538.     {
  539.        start = 0;
  540.     }
  541.     cpower(&old, degree-1, &tmp);
  542.     complex_mult(tmp, old, &new);
  543.  
  544.     if (DIST1(new) < threshold)
  545.     {
  546.        if(fractype==NEWTBASIN)
  547.        {
  548.       int tmpcolor;
  549.       int i;
  550.       tmpcolor = -1;
  551.       /* this code determines which degree-th root of root the
  552.          Newton formula converges to. The roots of a 1 are
  553.          distributed on a circle of radius 1 about the origin. */
  554.       for(i=0;i<degree;i++)
  555.          /* color in alternating shades with iteration according to
  556.         which root of 1 it converged to */
  557.           if(distance(roots[i],old) < threshold)
  558.           {
  559.            /*    tmpcolor = 1+(i&7)+((color&1)<<3); */
  560.            tmpcolor = 1+i;
  561.            break;
  562.           }
  563.        if(tmpcolor == -1)
  564.           color = maxcolor;
  565.        else
  566.           color = tmpcolor;
  567.        }
  568.        return(1);
  569.     }
  570.     new.x = d1overd * new.x + roverd;
  571.     new.y *= d1overd;
  572.  
  573.     /* Watch for divide underflow */
  574.     if ((t2 = tmp.x * tmp.x + tmp.y * tmp.y) < FLT_MIN)
  575.       return(1);
  576.     else
  577.     {
  578.     t2 = 1.0 / t2;
  579.     old.x = t2 * (new.x * tmp.x + new.y * tmp.y);
  580.     old.y = t2 * (new.y * tmp.x - new.x * tmp.y);
  581.     }
  582.     return(0);
  583. }
  584.  
  585.  
  586. complex_mult(arg1,arg2,pz)
  587. CMPLX arg1,arg2,*pz;
  588. {
  589.    pz->x = arg1.x*arg2.x - arg1.y*arg2.y;
  590.    pz->y = arg1.x*arg2.y+arg1.y*arg2.x;
  591.    return(0);
  592. }
  593.  
  594. complex_div(numerator,denominator,pout)
  595. CMPLX numerator,denominator,*pout;
  596. {
  597.    double mod;
  598.    if((mod = modulus(denominator)) < FLT_MIN)
  599.       return(1);
  600.    conjugate(&denominator);
  601.    complex_mult(numerator,denominator,pout);
  602.    pout->x = pout->x/mod;
  603.    pout->y = pout->y/mod;
  604.    return(0);
  605. }
  606.  
  607.  
  608. lcomplex_mult(arg1,arg2,pz,bitshift)
  609. LCMPLX arg1,arg2,*pz;
  610. int bitshift;
  611. {
  612.    overflow = 0;
  613.    pz->x = multiply(arg1.x,arg2.x,bitshift) - multiply(arg1.y,arg2.y,bitshift);
  614.    pz->y = multiply(arg1.x,arg2.y,bitshift) + multiply(arg1.y,arg2.x,bitshift);
  615.    return(overflow);
  616. }
  617.  
  618. #endif
  619.  
  620. #define MPCmod(m) (*pMPadd(*pMPmul((m).x, (m).x), *pMPmul((m).y, (m).y)))
  621. struct MPC mpcold, mpcnew, mpctmp, mpctmp1;
  622. struct MP mproverd, mpd1overd, mpthreshold,sqrmpthreshold;
  623. struct MP mpt2;
  624. struct MP mpone;
  625. extern struct MPC MPCone;
  626. extern int MPOverflow;
  627. int MPCNewtonFractal()
  628. {
  629.     MPOverflow = 0;
  630.     mpctmp   = MPCpow(mpcold,degree-1);
  631.  
  632.     mpcnew.x = *pMPsub(*pMPmul(mpctmp.x,mpcold.x),*pMPmul(mpctmp.y,mpcold.y));
  633.     mpcnew.y = *pMPadd(*pMPmul(mpctmp.x,mpcold.y),*pMPmul(mpctmp.y,mpcold.x));
  634.  
  635.     mpctmp1.x = *pMPsub(mpcnew.x, MPCone.x);
  636.     mpctmp1.y = *pMPsub(mpcnew.y, MPCone.y);
  637.  
  638.     if(pMPcmp(MPCmod(mpctmp1),mpthreshold)< 0)
  639.     {
  640.       if(fractype==MPNEWTBASIN)
  641.       {
  642.      int tmpcolor;
  643.      int i;
  644.      tmpcolor = -1;
  645.      for(i=0;i<degree;i++)
  646.          if(pMPcmp(MPdistance(MPCroots[i],mpcold),mpthreshold) < 0)
  647.          {
  648.         if(basin==2)
  649.            tmpcolor = 1+(i&7) + ((color&1)<<3);
  650.         else
  651.            tmpcolor = 1+i;
  652.             break;
  653.          }
  654.       if(tmpcolor == -1)
  655.          color = maxcolor;
  656.       else
  657.          color = tmpcolor;
  658.       }
  659.        return(1);
  660.     }
  661.  
  662.     mpcnew.x = *pMPadd(*pMPmul(mpd1overd,mpcnew.x),mproverd);
  663.     mpcnew.y = *pMPmul(mpcnew.y,mpd1overd);
  664.  
  665.     mpt2 = MPCmod(mpctmp);
  666.     mpt2 = *pMPdiv(mpone,mpt2);
  667.  
  668.     mpcold.x = *pMPmul(mpt2,(*pMPadd(*pMPmul(mpcnew.x,mpctmp.x),*pMPmul(mpcnew.y,mpctmp.y))));
  669.     mpcold.y = *pMPmul(mpt2,(*pMPsub(*pMPmul(mpcnew.y,mpctmp.x),*pMPmul(mpcnew.x,mpctmp.y))));
  670.  
  671.     new.x = *pMP2d(mpcold.x);
  672.     new.y = *pMP2d(mpcold.y);
  673.     return(MPOverflow);
  674. }
  675.  
  676.  
  677. Barnsley1Fractal()
  678. {
  679.    /* Barnsley's Mandelbrot type M1 from "Fractals
  680.    Everywhere" by Michael Barnsley, p. 322 */
  681.  
  682.    /* calculate intermediate products */
  683.    oldxinitx   = multiply(lold.x, longparm->x, bitshift);
  684.    oldyinity   = multiply(lold.y, longparm->y, bitshift);
  685.    oldxinity   = multiply(lold.x, longparm->y, bitshift);
  686.    oldyinitx   = multiply(lold.y, longparm->x, bitshift);
  687.    /* orbit calculation */
  688.    if(lold.x >= 0)
  689.    {
  690.       lnew.x = (oldxinitx - longparm->x - oldyinity);
  691.       lnew.y = (oldyinitx - longparm->y + oldxinity);
  692.    }
  693.    else
  694.    {
  695.       lnew.x = (oldxinitx + longparm->x - oldyinity);
  696.       lnew.y = (oldyinitx + longparm->y + oldxinity);
  697.    }
  698.    return(longbailout());
  699. }
  700.  
  701. Barnsley1FPFractal()
  702. {
  703.    /* Barnsley's Mandelbrot type M1 from "Fractals
  704.    Everywhere" by Michael Barnsley, p. 322 */
  705.    /* note that fast >= 287 equiv in fracsuba.asm must be kept in step */
  706.  
  707.    /* calculate intermediate products */
  708.    foldxinitx = old.x * floatparm->x;
  709.    foldyinity = old.y * floatparm->y;
  710.    foldxinity = old.x * floatparm->y;
  711.    foldyinitx = old.y * floatparm->x;
  712.    /* orbit calculation */
  713.    if(old.x >= 0)
  714.    {
  715.       new.x = (foldxinitx - floatparm->x - foldyinity);
  716.       new.y = (foldyinitx - floatparm->y + foldxinity);
  717.    }
  718.    else
  719.    {
  720.       new.x = (foldxinitx + floatparm->x - foldyinity);
  721.       new.y = (foldyinitx + floatparm->y + foldxinity);
  722.    }
  723.    return(floatbailout());
  724. }
  725.  
  726. Barnsley2Fractal()
  727. {
  728.    /* An unnamed Mandelbrot/Julia function from "Fractals
  729.    Everywhere" by Michael Barnsley, p. 331, example 4.2 */
  730.    /* note that fast >= 287 equiv in fracsuba.asm must be kept in step */
  731.  
  732.    /* calculate intermediate products */
  733.    oldxinitx   = multiply(lold.x, longparm->x, bitshift);
  734.    oldyinity   = multiply(lold.y, longparm->y, bitshift);
  735.    oldxinity   = multiply(lold.x, longparm->y, bitshift);
  736.    oldyinitx   = multiply(lold.y, longparm->x, bitshift);
  737.  
  738.    /* orbit calculation */
  739.    if(oldxinity + oldyinitx >= 0)
  740.    {
  741.       lnew.x = oldxinitx - longparm->x - oldyinity;
  742.       lnew.y = oldyinitx - longparm->y + oldxinity;
  743.    }
  744.    else
  745.    {
  746.       lnew.x = oldxinitx + longparm->x - oldyinity;
  747.       lnew.y = oldyinitx + longparm->y + oldxinity;
  748.    }
  749.    return(longbailout());
  750. }
  751.  
  752. Barnsley2FPFractal()
  753. {
  754.    /* An unnamed Mandelbrot/Julia function from "Fractals
  755.    Everywhere" by Michael Barnsley, p. 331, example 4.2 */
  756.  
  757.    /* calculate intermediate products */
  758.    foldxinitx = old.x * floatparm->x;
  759.    foldyinity = old.y * floatparm->y;
  760.    foldxinity = old.x * floatparm->y;
  761.    foldyinitx = old.y * floatparm->x;
  762.  
  763.    /* orbit calculation */
  764.    if(foldxinity + foldyinitx >= 0)
  765.    {
  766.       new.x = foldxinitx - floatparm->x - foldyinity;
  767.       new.y = foldyinitx - floatparm->y + foldxinity;
  768.    }
  769.    else
  770.    {
  771.       new.x = foldxinitx + floatparm->x - foldyinity;
  772.       new.y = foldyinitx + floatparm->y + foldxinity;
  773.    }
  774.    return(floatbailout());
  775. }
  776.  
  777. JuliaFractal()
  778. {
  779.    /* used for C prototype of fast integer math routines for classic
  780.       Mandelbrot and Julia */
  781.    lnew.x  = ltempsqrx - ltempsqry + longparm->x;
  782.    lnew.y = multiply(lold.x, lold.y, bitshiftless1) + longparm->y;
  783.    return(longbailout());
  784. }
  785.  
  786. JuliafpFractal()
  787. {
  788.    /* floating point version of classical Mandelbrot/Julia */
  789.    /* note that fast >= 287 equiv in fracsuba.asm must be kept in step */
  790.    new.x = tempsqrx - tempsqry + floatparm->x;
  791.    new.y = 2.0 * old.x * old.y + floatparm->y;
  792.    return(floatbailout());
  793. }
  794.  
  795. LambdaFPFractal()
  796. {
  797.    /* variation of classical Mandelbrot/Julia */
  798.    /* note that fast >= 287 equiv in fracsuba.asm must be kept in step */
  799.  
  800.    tempsqrx = old.x - old.x * old.x + old.y * old.y;
  801.    tempsqry = old.y - old.y * old.x * 2;
  802.  
  803.    new.x = floatparm->x * tempsqrx - floatparm->y * tempsqry;
  804.    new.y = floatparm->x * tempsqry + floatparm->y * tempsqrx;
  805.    return(floatbailout());
  806. }
  807.  
  808. LambdaFractal()
  809. {
  810.    /* variation of classical Mandelbrot/Julia */
  811.  
  812.    /* in complex math) temp = Z * (1-Z) */
  813.    ltempsqrx = lold.x - ltempsqrx + ltempsqry;
  814.    ltempsqry = lold.y
  815.          - multiply(lold.y, lold.x, bitshiftless1);
  816.    /* (in complex math) Z = Lambda * Z */
  817.    lnew.x = multiply(longparm->x, ltempsqrx, bitshift)
  818.     - multiply(longparm->y, ltempsqry, bitshift);
  819.    lnew.y = multiply(longparm->x, ltempsqry, bitshift)
  820.     + multiply(longparm->y, ltempsqrx, bitshift);
  821.    return(longbailout());
  822. }
  823.  
  824. SierpinskiFractal()
  825. {
  826.    /* following code translated from basic - see "Fractals
  827.    Everywhere" by Michael Barnsley, p. 251, Program 7.1.1 */
  828.    lnew.x = (lold.x << 1);        /* new.x = 2 * old.x  */
  829.    lnew.y = (lold.y << 1);        /* new.y = 2 * old.y  */
  830.    if(lold.y > ltmp.y)    /* if old.y > .5 */
  831.       lnew.y = lnew.y - ltmp.x; /* new.y = 2 * old.y - 1 */
  832.    else if(lold.x > ltmp.y)    /* if old.x > .5 */
  833.       lnew.x = lnew.x - ltmp.x; /* new.x = 2 * old.x - 1 */
  834.    /* end barnsley code */
  835.    return(longbailout());
  836. }
  837.  
  838. SierpinskiFPFractal()
  839. {
  840.    /* following code translated from basic - see "Fractals
  841.    Everywhere" by Michael Barnsley, p. 251, Program 7.1.1 */
  842.  
  843.    new.x = old.x + old.x;
  844.    new.y = old.y + old.y;
  845.    if(old.y > .5)
  846.       new.y = new.y - 1;
  847.    else if (old.x > .5)
  848.       new.x = new.x - 1;
  849.  
  850.    /* end barnsley code */
  851.    return(floatbailout());
  852. }
  853.  
  854. LambdaexponentFractal()
  855. {
  856.    /* found this in  "Science of Fractal Images" */
  857.    FLOATEXPBAILOUT();
  858.    FPUsincos  (&old.y,&siny,&cosy);
  859.  
  860.    if (old.x >= rqlim && cosy >= 0.0) return(1);
  861.    tmpexp = exp(old.x);
  862.    tmp.x = tmpexp*cosy;
  863.    tmp.y = tmpexp*siny;
  864.  
  865.    /*multiply by lamda */
  866.    new.x = floatparm->x*tmp.x - floatparm->y*tmp.y;
  867.    new.y = floatparm->y*tmp.x + floatparm->x*tmp.y;
  868.    old = new;
  869.    return(0);
  870. }
  871.  
  872. LongLambdaexponentFractal()
  873. {
  874.    /* found this in  "Science of Fractal Images" */
  875.    LONGEXPBAILOUT();
  876.  
  877.    SinCos086  (lold.y, &lsiny,    &lcosy);
  878.  
  879.    if (lold.x >= llimit && lcosy >= 0L) return(1);
  880.    longtmp = Exp086(lold.x);
  881.  
  882.    ltmp.x = multiply(longtmp,       lcosy,   bitshift);
  883.    ltmp.y = multiply(longtmp,       lsiny,   bitshift);
  884.  
  885.    lnew.x  = multiply(longparm->x, ltmp.x, bitshift)
  886.        - multiply(longparm->y, ltmp.y, bitshift);
  887.    lnew.y  = multiply(longparm->x, ltmp.y, bitshift)
  888.        + multiply(longparm->y, ltmp.x, bitshift);
  889.    lold = lnew;
  890.    return(0);
  891. }
  892.  
  893. FloatTrigPlusExponentFractal()
  894. {
  895.    /* another Scientific American biomorph type */
  896.    /* z(n+1) = e**z(n) + trig(z(n)) + C */
  897.  
  898.    if (fabs(old.x) >= 6.4e2) return(1); /* DOMAIN errors */
  899.    tmpexp = exp(old.x);
  900.    FPUsincos  (&old.y,&siny,&cosy);
  901.    CMPLXtrig0(old,new);
  902.  
  903.    /*new =   trig(old) + e**old + C  */
  904.    new.x += tmpexp*cosy + floatparm->x;
  905.    new.y += tmpexp*siny + floatparm->y;
  906.    return(floatbailout());
  907. }
  908.  
  909.  
  910. LongTrigPlusExponentFractal()
  911. {
  912.    /* calculate exp(z) */
  913.  
  914.    /* domain check for fast transcendental functions */
  915.    TRIG16CHECK(lold.x);
  916.    TRIG16CHECK(lold.y);
  917.  
  918.    longtmp = Exp086(lold.x);
  919.    SinCos086  (lold.y, &lsiny,    &lcosy);
  920.    LCMPLXtrig0(lold,lnew);
  921.    lnew.x += multiply(longtmp,      lcosy,   bitshift) + longparm->x;
  922.    lnew.y += multiply(longtmp,      lsiny,   bitshift) + longparm->y;
  923.    return(longbailout());
  924. }
  925.  
  926. MarksLambdaFractal()
  927. {
  928.    /* Mark Peterson's variation of "lambda" function */
  929.  
  930.    /* Z1 = (C^(exp-1) * Z**2) + C */
  931.    ltmp.x = ltempsqrx - ltempsqry;
  932.    ltmp.y = multiply(lold.x ,lold.y ,bitshiftless1);
  933.  
  934.    lnew.x = multiply(lcoefficient.x, ltmp.x, bitshift)
  935.     - multiply(lcoefficient.y, ltmp.y, bitshift) + longparm->x;
  936.    lnew.y = multiply(lcoefficient.x, ltmp.y, bitshift)
  937.     + multiply(lcoefficient.y, ltmp.x, bitshift) + longparm->y;
  938.  
  939.    return(longbailout());
  940. }
  941.  
  942.  
  943. long XXOne, FgOne, FgTwo;
  944.  
  945. UnityFractal()
  946. {
  947.    /* brought to you by Mark Peterson - you won't find this in any fractal
  948.       books unless they saw it here first - Mark invented it! */
  949.    XXOne = multiply(lold.x, lold.x, bitshift) + multiply(lold.y, lold.y, bitshift);
  950.    if((XXOne > FgTwo) || (labs(XXOne - FgOne) < delmin))
  951.       return(1);
  952.    lold.y = multiply(FgTwo - XXOne, lold.x, bitshift);
  953.    lold.x = multiply(FgTwo - XXOne, lold.y, bitshift);
  954.    lnew=lold;  /* TW added this line */
  955.    return(0);
  956. }
  957.  
  958. #define XXOne new.x
  959.  
  960. UnityfpFractal()
  961. {
  962.    /* brought to you by Mark Peterson - you won't find this in any fractal
  963.       books unless they saw it here first - Mark invented it! */
  964.  
  965.    XXOne = sqr(old.x) + sqr(old.y);
  966.    if((XXOne > 2.0) || (fabs(XXOne - 1.0) < ddelmin))
  967.       return(1);
  968.    old.y = (2.0 - XXOne)* old.x;
  969.    old.x = (2.0 - XXOne)* old.y;
  970.    new=old;  /* TW added this line */
  971.    return(0);
  972. }
  973.  
  974. #undef XXOne
  975.  
  976. Mandel4Fractal()
  977. {
  978.    /* By writing this code, Bert has left behind the excuse "don't
  979.       know what a fractal is, just know how to make'em go fast".
  980.       Bert is hereby declared a bonafide fractal expert! Supposedly
  981.       this routine calculates the Mandelbrot/Julia set based on the
  982.       polynomial z**4 + lambda, but I wouldn't know -- can't follow
  983.       all that integer math speedup stuff - Tim */
  984.  
  985.    /* first, compute (x + iy)**2 */
  986.    lnew.x  = ltempsqrx - ltempsqry;
  987.    lnew.y = multiply(lold.x, lold.y, bitshiftless1);
  988.    if (longbailout()) return(1);
  989.  
  990.    /* then, compute ((x + iy)**2)**2 + lambda */
  991.    lnew.x  = ltempsqrx - ltempsqry + longparm->x;
  992.    lnew.y = multiply(lold.x, lold.y, bitshiftless1) + longparm->y;
  993.    return(longbailout());
  994. }
  995.  
  996. floatZtozPluszpwrFractal()
  997. {
  998.    cpower(&old,(int)param[2],&new);
  999.    old = ComplexPower(old,old);
  1000.    new.x = new.x + old.x +floatparm->x;
  1001.    new.y = new.y + old.y +floatparm->y;
  1002.    return(floatbailout());
  1003. }
  1004.  
  1005. longZpowerFractal()
  1006. {
  1007.    if(lcpower(&lold,c_exp,&lnew,bitshift))
  1008.       lnew.x = lnew.y = 8L<<bitshift;
  1009.    lnew.x += longparm->x;
  1010.    lnew.y += longparm->y;
  1011.    return(longbailout());
  1012. }
  1013.  
  1014. longCmplxZpowerFractal()
  1015. {
  1016.    struct complex x, y;
  1017.  
  1018.    x.x = (double)lold.x / fudge;
  1019.    x.y = (double)lold.y / fudge;
  1020.    y.x = (double)lparm2.x / fudge;
  1021.    y.y = (double)lparm2.y / fudge;
  1022.    x = ComplexPower(x, y);
  1023.    if(fabs(x.x) < fgLimit && fabs(x.y) < fgLimit) {
  1024.       lnew.x = (long)(x.x * fudge);
  1025.       lnew.y = (long)(x.y * fudge);
  1026.    }
  1027.    else
  1028.       overflow = 1;
  1029.    lnew.x += longparm->x;
  1030.    lnew.y += longparm->y;
  1031.    return(longbailout());
  1032. }
  1033.  
  1034. floatZpowerFractal()
  1035. {
  1036.    cpower(&old,c_exp,&new);
  1037.    new.x += floatparm->x;
  1038.    new.y += floatparm->y;
  1039.    return(floatbailout());
  1040. }
  1041.  
  1042. floatCmplxZpowerFractal()
  1043. {
  1044.    new = ComplexPower(old, parm2);
  1045.    new.x += floatparm->x;
  1046.    new.y += floatparm->y;
  1047.    return(floatbailout());
  1048. }
  1049.  
  1050. Barnsley3Fractal()
  1051. {
  1052.    /* An unnamed Mandelbrot/Julia function from "Fractals
  1053.    Everywhere" by Michael Barnsley, p. 292, example 4.1 */
  1054.  
  1055.    /* calculate intermediate products */
  1056.    oldxinitx   = multiply(lold.x, lold.x, bitshift);
  1057.    oldyinity   = multiply(lold.y, lold.y, bitshift);
  1058.    oldxinity   = multiply(lold.x, lold.y, bitshift);
  1059.  
  1060.    /* orbit calculation */
  1061.    if(lold.x > 0)
  1062.    {
  1063.       lnew.x = oldxinitx   - oldyinity - fudge;
  1064.       lnew.y = oldxinity << 1;
  1065.    }
  1066.    else
  1067.    {
  1068.       lnew.x = oldxinitx - oldyinity - fudge
  1069.        + multiply(longparm->x,lold.x,bitshift);
  1070.       lnew.y = oldxinity <<1;
  1071.  
  1072.       /* This term added by Tim Wegner to make dependent on the
  1073.      imaginary part of the parameter. (Otherwise Mandelbrot
  1074.      is uninteresting. */
  1075.       lnew.y += multiply(longparm->y,lold.x,bitshift);
  1076.    }
  1077.    return(longbailout());
  1078. }
  1079.  
  1080. Barnsley3FPFractal()
  1081. {
  1082.    /* An unnamed Mandelbrot/Julia function from "Fractals
  1083.    Everywhere" by Michael Barnsley, p. 292, example 4.1 */
  1084.  
  1085.  
  1086.    /* calculate intermediate products */
  1087.    foldxinitx  = old.x * old.x;
  1088.    foldyinity  = old.y * old.y;
  1089.    foldxinity  = old.x * old.y;
  1090.  
  1091.    /* orbit calculation */
  1092.    if(old.x > 0)
  1093.    {
  1094.       new.x = foldxinitx - foldyinity - 1.0;
  1095.       new.y = foldxinity * 2;
  1096.    }
  1097.    else
  1098.    {
  1099.       new.x = foldxinitx - foldyinity -1.0 + floatparm->x * old.x;
  1100.       new.y = foldxinity * 2;
  1101.  
  1102.       /* This term added by Tim Wegner to make dependent on the
  1103.      imaginary part of the parameter. (Otherwise Mandelbrot
  1104.      is uninteresting. */
  1105.       new.y += floatparm->y * old.x;
  1106.    }
  1107.    return(floatbailout());
  1108. }
  1109.  
  1110. TrigPlusZsquaredFractal()
  1111. {
  1112.    /* From Scientific American, July 1989 */
  1113.    /* A Biomorph              */
  1114.    /* z(n+1) = trig(z(n))+z(n)**2+C      */
  1115.    LCMPLXtrig0(lold,lnew);
  1116.    lnew.x += ltempsqrx - ltempsqry + longparm->x;
  1117.    lnew.y += multiply(lold.x, lold.y, bitshiftless1) + longparm->y;
  1118.    return(longbailout());
  1119. }
  1120.  
  1121. TrigPlusZsquaredfpFractal()
  1122. {
  1123.    /* From Scientific American, July 1989 */
  1124.    /* A Biomorph              */
  1125.    /* z(n+1) = trig(z(n))+z(n)**2+C      */
  1126.  
  1127.    CMPLXtrig0(old,new);
  1128.    new.x += tempsqrx - tempsqry + floatparm->x;
  1129.    new.y += 2.0 * old.x * old.y + floatparm->y;
  1130.    return(floatbailout());
  1131. }
  1132.  
  1133. Richard8fpFractal()
  1134. {
  1135.    /*  Richard8 {c = z = pixel: z=sin(z)+sin(pixel),|z|<=50} */
  1136.    CMPLXtrig0(old,new);
  1137. /*   CMPLXtrig1(*floatparm,tmp); */
  1138.    new.x += tmp.x;
  1139.    new.y += tmp.y;
  1140.    return(floatbailout());
  1141. }
  1142.  
  1143. Richard8Fractal()
  1144. {
  1145.    /*  Richard8 {c = z = pixel: z=sin(z)+sin(pixel),|z|<=50} */
  1146.    LCMPLXtrig0(lold,lnew);
  1147. /*   LCMPLXtrig1(*longparm,ltmp); */
  1148.    lnew.x += ltmp.x;
  1149.    lnew.y += ltmp.y;
  1150.    return(longbailout());
  1151. }
  1152.  
  1153. PopcornFractal()
  1154. {
  1155.    extern int row;
  1156.    tmp = old;
  1157.    tmp.x *= 3.0;
  1158.    tmp.y *= 3.0;
  1159.    FPUsincos(&tmp.x,&sinx,&cosx);
  1160.    FPUsincos(&tmp.y,&siny,&cosy);
  1161.    tmp.x = sinx/cosx + old.x;
  1162.    tmp.y = siny/cosy + old.y;
  1163.    FPUsincos(&tmp.x,&sinx,&cosx);
  1164.    FPUsincos(&tmp.y,&siny,&cosy);
  1165.    new.x = old.x - parm.x*siny;
  1166.    new.y = old.y - parm.x*sinx;
  1167.    /*
  1168.    new.x = old.x - parm.x*sin(old.y+tan(3*old.y));
  1169.    new.y = old.y - parm.x*sin(old.x+tan(3*old.x));
  1170.    */
  1171.    if(plot == noplot)
  1172.    {
  1173.       plot_orbit(new.x,new.y,1+row%colors);
  1174.       old = new;
  1175.    }
  1176.    else
  1177.    /* FLOATBAILOUT(); */
  1178.    /* PB The above line was weird, not what it seems to be!  But, bracketing
  1179.      it or always doing it (either of which seem more likely to be what
  1180.      was intended) changes the image for the worse, so I'm not touching it.
  1181.      Same applies to int form in next routine. */
  1182.    /* PB later: recoded inline, still leaving it weird */
  1183.       tempsqrx = sqr(new.x);
  1184.    tempsqry = sqr(new.y);
  1185.    if((magnitude = tempsqrx + tempsqry) >= rqlim) return(1);
  1186.    old = new;
  1187.    return(0);
  1188. }
  1189.  
  1190. LPopcornFractal()
  1191. {
  1192.    extern int row;
  1193.    ltmp = lold;
  1194.    ltmp.x *= 3L;
  1195.    ltmp.y *= 3L;
  1196.    LTRIGARG(ltmp.x);
  1197.    LTRIGARG(ltmp.y);
  1198.    SinCos086(ltmp.x,&lsinx,&lcosx);
  1199.    SinCos086(ltmp.y,&lsiny,&lcosy);
  1200.    ltmp.x = divide(lsinx,lcosx,bitshift) + lold.x;
  1201.    ltmp.y = divide(lsiny,lcosy,bitshift) + lold.y;
  1202.    LTRIGARG(ltmp.x);
  1203.    LTRIGARG(ltmp.y);
  1204.    SinCos086(ltmp.x,&lsinx,&lcosx);
  1205.    SinCos086(ltmp.y,&lsiny,&lcosy);
  1206.    lnew.x = lold.x - multiply(lparm.x,lsiny,bitshift);
  1207.    lnew.y = lold.y - multiply(lparm.x,lsinx,bitshift);
  1208.    if(plot == noplot)
  1209.    {
  1210.       iplot_orbit(lnew.x,lnew.y,1+row%colors);
  1211.       lold = lnew;
  1212.    }
  1213.    else
  1214.       LONGBAILOUT();
  1215.    /* PB above still the old way, is weird, see notes in FP popcorn case */
  1216.    return(0);
  1217. }
  1218.  
  1219. int MarksCplxMand(void)
  1220. {
  1221.    tmp.x = tempsqrx - tempsqry;
  1222.    tmp.y = 2*old.x*old.y;
  1223.    FPUcplxmul(&tmp, &Coefficient, &new);
  1224.    new.x += floatparm->x;
  1225.    new.y += floatparm->y;
  1226.    return(floatbailout());
  1227. }
  1228.  
  1229. int SpiderfpFractal(void)
  1230. {
  1231.    /* Spider(XAXIS) { c=z=pixel: z=z*z+c; c=c/2+z, |z|<=4 } */
  1232.    new.x = tempsqrx - tempsqry + tmp.x;
  1233.    new.y = 2 * old.x * old.y + tmp.y;
  1234.    tmp.x = tmp.x/2 + new.x;
  1235.    tmp.y = tmp.y/2 + new.y;
  1236.    return(floatbailout());
  1237. }
  1238.  
  1239. SpiderFractal(void)
  1240. {
  1241.    /* Spider(XAXIS) { c=z=pixel: z=z*z+c; c=c/2+z, |z|<=4 } */
  1242.    lnew.x  = ltempsqrx - ltempsqry + ltmp.x;
  1243.    lnew.y = multiply(lold.x, lold.y, bitshiftless1) + ltmp.y;
  1244.    ltmp.x = (ltmp.x >> 1) + lnew.x;
  1245.    ltmp.y = (ltmp.y >> 1) + lnew.y;
  1246.    return(longbailout());
  1247. }
  1248.  
  1249. TetratefpFractal()
  1250. {
  1251.    /* Tetrate(XAXIS) { c=z=pixel: z=c^z, |z|<=(P1+3) } */
  1252.    new = ComplexPower(*floatparm,old);
  1253.    return(floatbailout());
  1254. }
  1255.  
  1256. ZXTrigPlusZFractal()
  1257. {
  1258.    /* z = (p1*z*trig(z))+p2*z */
  1259.    LCMPLXtrig0(lold,ltmp);        /* ltmp  = trig(old)         */
  1260.    LCMPLXmult(lparm,ltmp,ltmp);      /* ltmp  = p1*trig(old)          */
  1261.    LCMPLXmult(lold,ltmp,ltmp2);      /* ltmp2 = p1*old*trig(old)      */
  1262.    LCMPLXmult(lparm2,lold,ltmp);     /* ltmp  = p2*old              */
  1263.    LCMPLXadd(ltmp2,ltmp,lnew);         /* lnew  = p1*trig(old) + p2*old */
  1264.    return(longbailout());
  1265. }
  1266.  
  1267. ScottZXTrigPlusZFractal()
  1268. {
  1269.    /* z = (z*trig(z))+z */
  1270.    LCMPLXtrig0(lold,ltmp);        /* ltmp  = trig(old)       */
  1271.    LCMPLXmult(lold,ltmp,lnew);         /* lnew  = old*trig(old)    */
  1272.    LCMPLXadd(lnew,lold,lnew);         /* lnew  = trig(old) + old */
  1273.    return(longbailout());
  1274. }
  1275.  
  1276. SkinnerZXTrigSubZFractal()
  1277. {
  1278.    /* z = (z*trig(z))-z */
  1279.    LCMPLXtrig0(lold,ltmp);        /* ltmp  = trig(old)       */
  1280.    LCMPLXmult(lold,ltmp,lnew);         /* lnew  = old*trig(old)    */
  1281.    LCMPLXsub(lnew,lold,lnew);         /* lnew  = trig(old) - old */
  1282.    return(longbailout());
  1283. }
  1284.  
  1285. ZXTrigPlusZfpFractal()
  1286. {
  1287.    /* z = (p1*z*trig(z))+p2*z */
  1288.    CMPLXtrig0(old,tmp);      /* tmp  = trig(old)         */
  1289.    CMPLXmult(parm,tmp,tmp);     /* tmp  = p1*trig(old)      */
  1290.    CMPLXmult(old,tmp,tmp2);     /* tmp2 = p1*old*trig(old)     */
  1291.    CMPLXmult(parm2,old,tmp);     /* tmp  = p2*old         */
  1292.    CMPLXadd(tmp2,tmp,new);     /* new  = p1*trig(old) + p2*old */
  1293.    return(floatbailout());
  1294. }
  1295.  
  1296. ScottZXTrigPlusZfpFractal()
  1297. {
  1298.    /* z = (z*trig(z))+z */
  1299.    CMPLXtrig0(old,tmp);     /* tmp    = trig(old)      */
  1300.    CMPLXmult(old,tmp,new);     /* new  = old*trig(old)   */
  1301.    CMPLXadd(new,old,new);     /* new  = trig(old) + old */
  1302.    return(floatbailout());
  1303. }
  1304.  
  1305. SkinnerZXTrigSubZfpFractal()
  1306. {
  1307.    /* z = (z*trig(z))-z */
  1308.    CMPLXtrig0(old,tmp);     /* tmp    = trig(old)      */
  1309.    CMPLXmult(old,tmp,new);     /* new  = old*trig(old)   */
  1310.    CMPLXsub(new,old,new);     /* new  = trig(old) - old */
  1311.    return(floatbailout());
  1312. }
  1313.  
  1314. Sqr1overTrigFractal()
  1315. {
  1316.    /* z = sqr(1/trig(z)) */
  1317.    LCMPLXtrig0(lold,lold);
  1318.    LCMPLXrecip(lold,lold);
  1319.    LCMPLXsqr(lold,lnew);
  1320.    return(longbailout());
  1321. }
  1322.  
  1323. Sqr1overTrigfpFractal()
  1324. {
  1325.    /* z = sqr(1/trig(z)) */
  1326.    CMPLXtrig0(old,old);
  1327.    CMPLXrecip(old,old);
  1328.    CMPLXsqr(old,new);
  1329.    return(floatbailout());
  1330. }
  1331.  
  1332. TrigPlusTrigFractal()
  1333. {
  1334.    /* z = trig(0,z)*p1+trig1(z)*p2 */
  1335.    LCMPLXtrig0(lold,ltmp);
  1336.    LCMPLXmult(lparm,ltmp,ltmp);
  1337.    LCMPLXtrig1(lold,ltmp2);
  1338.    LCMPLXmult(lparm2,ltmp2,lold);
  1339.    LCMPLXadd(ltmp,lold,lnew);
  1340.    return(longbailout());
  1341. }
  1342.  
  1343. TrigPlusTrigfpFractal()
  1344. {
  1345.    /* z = trig0(z)*p1+trig1(z)*p2 */
  1346.    CMPLXtrig0(old,tmp);
  1347.    CMPLXmult(parm,tmp,tmp);
  1348.    CMPLXtrig1(old,old);
  1349.    CMPLXmult(parm2,old,old);
  1350.    CMPLXadd(tmp,old,new);
  1351.    return(floatbailout());
  1352. }
  1353.  
  1354.  
  1355. ScottTrigPlusTrigFractal()
  1356. {
  1357.    /* z = trig0(z)+trig1(z) */
  1358.    LCMPLXtrig0(lold,ltmp);
  1359.    LCMPLXtrig1(lold,lold);
  1360.    LCMPLXadd(ltmp,lold,lnew);
  1361.    return(longbailout());
  1362. }
  1363.  
  1364. ScottTrigPlusTrigfpFractal()
  1365. {
  1366.    /* z = trig0(z)+trig1(z) */
  1367.    CMPLXtrig0(old,tmp);
  1368.    CMPLXtrig1(old,tmp2);
  1369.    CMPLXadd(tmp,tmp2,new);
  1370.    return(floatbailout());
  1371. }
  1372.  
  1373. SkinnerTrigSubTrigFractal()
  1374. {
  1375.    /* z = trig(0,z)-trig1(z) */
  1376.    LCMPLXtrig0(lold,ltmp);
  1377.    LCMPLXtrig1(lold,ltmp2);
  1378.    LCMPLXsub(ltmp,ltmp2,lnew);
  1379.    return(longbailout());
  1380. }
  1381.  
  1382. SkinnerTrigSubTrigfpFractal()
  1383. {
  1384.    /* z = trig0(z)-trig1(z) */
  1385.    CMPLXtrig0(old,tmp);
  1386.    CMPLXtrig1(old,tmp2);
  1387.    CMPLXsub(tmp,tmp2,new);
  1388.    return(floatbailout());
  1389. }
  1390.  
  1391.  
  1392. TrigXTrigfpFractal()
  1393. {
  1394.    /* z = trig0(z)*trig1(z) */
  1395.    CMPLXtrig0(old,tmp);
  1396.    CMPLXtrig1(old,old);
  1397.    CMPLXmult(tmp,old,new);
  1398.    return(floatbailout());
  1399. }
  1400.  
  1401. TrigXTrigFractal()
  1402. {
  1403.    LCMPLX ltmp2;
  1404.    /* z = trig0(z)*trig1(z) */
  1405.    LCMPLXtrig0(lold,ltmp);
  1406.    LCMPLXtrig1(lold,ltmp2);
  1407.    LCMPLXmult(ltmp,ltmp2,lnew);
  1408.    if(overflow)
  1409.       TryFloatFractal(TrigXTrigfpFractal);
  1410.    return(longbailout());
  1411. }
  1412.  
  1413.  /* call float version of fractal if integer math overflow */
  1414. TryFloatFractal(int (*fpFractal)())
  1415. {
  1416.    overflow=0;
  1417.    /* lold had better not be changed! */
  1418.    old.x = lold.x; old.x /= fudge;
  1419.    old.y = lold.y; old.y /= fudge;
  1420.    tempsqrx = sqr(old.x);
  1421.    tempsqry = sqr(old.y);
  1422.    fpFractal();
  1423.    lnew.x = new.x/fudge;
  1424.    lnew.y = new.y/fudge;
  1425.    return(0);
  1426. }
  1427.  
  1428. /********************************************************************/
  1429. /*  Next six orbit functions are one type - extra functions are     */
  1430. /*    special cases written for speed.                    */
  1431. /********************************************************************/
  1432.  
  1433. TrigPlusSqrFractal() /* generalization of Scott and Skinner types */
  1434. {
  1435.    /* { z=pixel: z=(p1,p2)*trig(z)+(p3,p4)*sqr(z), |z|<BAILOUT } */
  1436.    LCMPLXtrig0(lold,ltmp);     /* ltmp = trig(lold)               */
  1437.    LCMPLXmult(lparm,ltmp,lnew); /* lnew = lparm*trig(lold)            */
  1438.    LCMPLXsqr_old(ltmp);     /* ltmp = sqr(lold)                */
  1439.    LCMPLXmult(lparm2,ltmp,ltmp);/* ltmp = lparm2*sqr(lold)            */
  1440.    LCMPLXadd(lnew,ltmp,lnew);    /* lnew = lparm*trig(lold)+lparm2*sqr(lold) */
  1441.    return(longbailout());
  1442. }
  1443.  
  1444. TrigPlusSqrfpFractal() /* generalization of Scott and Skinner types */
  1445. {
  1446.    /* { z=pixel: z=(p1,p2)*trig(z)+(p3,p4)*sqr(z), |z|<BAILOUT } */
  1447.    CMPLXtrig0(old,tmp);     /* tmp = trig(old)               */
  1448.    CMPLXmult(parm,tmp,new); /* new = parm*trig(old)           */
  1449.    CMPLXsqr_old(tmp);         /* tmp = sqr(old)                */
  1450.    CMPLXmult(parm2,tmp,tmp2); /* tmp = parm2*sqr(old)             */
  1451.    CMPLXadd(new,tmp2,new);    /* new = parm*trig(old)+parm2*sqr(old) */
  1452.    return(floatbailout());
  1453. }
  1454.  
  1455. ScottTrigPlusSqrFractal()
  1456. {
  1457.    /*  { z=pixel: z=trig(z)+sqr(z), |z|<BAILOUT } */
  1458.    LCMPLXtrig0(lold,lnew);    /* lnew = trig(lold)         */
  1459.    LCMPLXsqr_old(ltmp);        /* lold = sqr(lold)          */
  1460.    LCMPLXadd(ltmp,lnew,lnew);  /* lnew = trig(lold)+sqr(lold) */
  1461.    return(longbailout());
  1462. }
  1463.  
  1464. ScottTrigPlusSqrfpFractal() /* float version */
  1465. {
  1466.    /* { z=pixel: z=sin(z)+sqr(z), |z|<BAILOUT } */
  1467.    CMPLXtrig0(old,new);       /* new = trig(old)      */
  1468.    CMPLXsqr_old(tmp);           /* tmp = sqr(old)       */
  1469.    CMPLXadd(new,tmp,new);      /* new = trig(old)+sqr(old) */
  1470.    return(floatbailout());
  1471. }
  1472.  
  1473. SkinnerTrigSubSqrFractal()
  1474. {
  1475.    /* { z=pixel: z=sin(z)-sqr(z), |z|<BAILOUT }           */
  1476.    LCMPLXtrig0(lold,lnew);    /* lnew = trig(lold)         */
  1477.    LCMPLXsqr_old(ltmp);        /* lold = sqr(lold)          */
  1478.    LCMPLXsub(lnew,ltmp,lnew);  /* lnew = trig(lold)-sqr(lold) */
  1479.    return(longbailout());
  1480. }
  1481.  
  1482. SkinnerTrigSubSqrfpFractal()
  1483. {
  1484.    /* { z=pixel: z=sin(z)-sqr(z), |z|<BAILOUT } */
  1485.    CMPLXtrig0(old,new);       /* new = trig(old) */
  1486.    CMPLXsqr_old(tmp);           /* old = sqr(old)  */
  1487.    CMPLXsub(new,tmp,new);      /* new = trig(old)-sqr(old) */
  1488.    return(floatbailout());
  1489. }
  1490.  
  1491. TrigZsqrdfpFractal()
  1492. {
  1493.    /* { z=pixel: z=trig(z*z), |z|<TEST } */
  1494.    CMPLXsqr_old(tmp);
  1495.    CMPLXtrig0(tmp,new);
  1496.    return(floatbailout());
  1497. }
  1498.  
  1499. TrigZsqrdFractal() /* this doesn't work very well */
  1500. {
  1501.    /* { z=pixel: z=trig(z*z), |z|<TEST } */
  1502.    LCMPLXsqr_old(ltmp);
  1503.    LCMPLXtrig0(ltmp,lnew);
  1504.    if(overflow)
  1505.       TryFloatFractal(TrigZsqrdfpFractal);
  1506.    return(longbailout());
  1507. }
  1508.  
  1509. SqrTrigFractal()
  1510. {
  1511.    /* { z=pixel: z=sqr(trig(z)), |z|<TEST} */
  1512.    LCMPLXtrig0(lold,ltmp);
  1513.    LCMPLXsqr(ltmp,lnew);
  1514.    return(longbailout());
  1515. }
  1516.  
  1517. SqrTrigfpFractal()
  1518. {
  1519.    /* SZSB(XYAXIS) { z=pixel, TEST=(p1+3): z=sin(z)*sin(z), |z|<TEST} */
  1520.    CMPLXtrig0(old,tmp);
  1521.    CMPLXsqr(tmp,new);
  1522.    return(floatbailout());
  1523. }
  1524.  
  1525.  
  1526. Magnet1Fractal()    /*      Z = ((Z**2 + C - 1)/(2Z + C - 2))**2      */
  1527.   {              /*  In "Beauty of Fractals", code by Kev Allen. */
  1528.     CMPLX top, bot, tmp;
  1529.     double div;
  1530.  
  1531.     top.x = tempsqrx - tempsqry + floatparm->x - 1; /* top = Z**2+C-1 */
  1532.     top.y = old.x * old.y;
  1533.     top.y = top.y + top.y + floatparm->y;
  1534.  
  1535.     bot.x = old.x + old.x + floatparm->x - 2;        /* bot = 2*Z+C-2  */
  1536.     bot.y = old.y + old.y + floatparm->y;
  1537.  
  1538.     div = bot.x*bot.x + bot.y*bot.y;            /* tmp = top/bot  */
  1539.     if (div < FLT_MIN) return(1);
  1540.     tmp.x = (top.x*bot.x + top.y*bot.y)/div;
  1541.     tmp.y = (top.y*bot.x - top.x*bot.y)/div;
  1542.  
  1543.     new.x = (tmp.x + tmp.y) * (tmp.x - tmp.y);        /* Z = tmp**2     */
  1544.     new.y = tmp.x * tmp.y;
  1545.     new.y += new.y;
  1546.  
  1547.     return(floatbailout());
  1548.   }
  1549.  
  1550. Magnet2Fractal()  /* Z = ((Z**3 + 3(C-1)Z + (C-1)(C-2)    ) /     */
  1551.             /*         (3Z**2 + 3(C-2)Z + (C-1)(C-2)+1) )**2  */
  1552.   {            /*     In "Beauty of Fractals", code by Kev Allen.  */
  1553.     CMPLX top, bot, tmp;
  1554.     double div;
  1555.  
  1556.     top.x = old.x * (tempsqrx-tempsqry-tempsqry-tempsqry + T_Cm1.x)
  1557.       - old.y * T_Cm1.y + T_Cm1Cm2.x;
  1558.     top.y = old.y * (tempsqrx+tempsqrx+tempsqrx-tempsqry + T_Cm1.x)
  1559.       + old.x * T_Cm1.y + T_Cm1Cm2.y;
  1560.  
  1561.     bot.x = tempsqrx - tempsqry;
  1562.     bot.x = bot.x + bot.x + bot.x
  1563.       + old.x * T_Cm2.x - old.y * T_Cm2.y
  1564.       + T_Cm1Cm2.x + 1.0;
  1565.     bot.y = old.x * old.y;
  1566.     bot.y += bot.y;
  1567.     bot.y = bot.y + bot.y + bot.y
  1568.       + old.x * T_Cm2.y + old.y * T_Cm2.x
  1569.       + T_Cm1Cm2.y;
  1570.  
  1571.     div = bot.x*bot.x + bot.y*bot.y;            /* tmp = top/bot  */
  1572.     if (div < FLT_MIN) return(1);
  1573.     tmp.x = (top.x*bot.x + top.y*bot.y)/div;
  1574.     tmp.y = (top.y*bot.x - top.x*bot.y)/div;
  1575.  
  1576.     new.x = (tmp.x + tmp.y) * (tmp.x - tmp.y);        /* Z = tmp**2     */
  1577.     new.y = tmp.x * tmp.y;
  1578.     new.y += new.y;
  1579.  
  1580.     return(floatbailout());
  1581.   }
  1582.  
  1583. LambdaTrigFractal()
  1584. {
  1585.    LONGXYTRIGBAILOUT();
  1586.    LCMPLXtrig0(lold,ltmp);         /* ltmp = trig(lold)        */
  1587.    LCMPLXmult(*longparm,ltmp,lnew);   /* lnew = longparm*trig(lold)  */
  1588.    lold = lnew;
  1589.    return(0);
  1590. }
  1591.  
  1592. LambdaTrigfpFractal()
  1593. {
  1594.    FLOATXYTRIGBAILOUT();
  1595.    CMPLXtrig0(old,tmp);          /* tmp = trig(old)       */
  1596.    CMPLXmult(*floatparm,tmp,new);   /* new = longparm*trig(old)  */
  1597.    old = new;
  1598.    return(0);
  1599. }
  1600.  
  1601. /* bailouts are different for different trig functions */
  1602. LambdaTrigFractal1()
  1603. {
  1604.    LONGTRIGBAILOUT(); /* sin,cos */
  1605.    LCMPLXtrig0(lold,ltmp);         /* ltmp = trig(lold)        */
  1606.    LCMPLXmult(*longparm,ltmp,lnew);   /* lnew = longparm*trig(lold)  */
  1607.    lold = lnew;
  1608.    return(0);
  1609. }
  1610.  
  1611. LambdaTrigfpFractal1()
  1612. {
  1613.    FLOATTRIGBAILOUT(); /* sin,cos */
  1614.    CMPLXtrig0(old,tmp);          /* tmp = trig(old)       */
  1615.    CMPLXmult(*floatparm,tmp,new);   /* new = longparm*trig(old)  */
  1616.    old = new;
  1617.    return(0);
  1618. }
  1619.  
  1620. LambdaTrigFractal2()
  1621. {
  1622.    LONGHTRIGBAILOUT(); /* sinh,cosh */
  1623.    LCMPLXtrig0(lold,ltmp);         /* ltmp = trig(lold)        */
  1624.    LCMPLXmult(*longparm,ltmp,lnew);   /* lnew = longparm*trig(lold)  */
  1625.    lold = lnew;
  1626.    return(0);
  1627. }
  1628.  
  1629. LambdaTrigfpFractal2()
  1630. {
  1631.    FLOATHTRIGBAILOUT(); /* sinh,cosh */
  1632.    CMPLXtrig0(old,tmp);          /* tmp = trig(old)       */
  1633.    CMPLXmult(*floatparm,tmp,new);   /* new = longparm*trig(old)  */
  1634.    old = new;
  1635.    return(0);
  1636. }
  1637.  
  1638. ManOWarFractal()
  1639. {
  1640.    /* From Art Matrix via Lee Skinner */
  1641.    lnew.x  = ltempsqrx - ltempsqry + ltmp.x + longparm->x;
  1642.    lnew.y = multiply(lold.x, lold.y, bitshiftless1) + ltmp.y + longparm->y;
  1643.    ltmp = lold;
  1644.    return(longbailout());
  1645. }
  1646.  
  1647. ManOWarfpFractal()
  1648. {
  1649.    /* From Art Matrix via Lee Skinner */
  1650.    /* note that fast >= 287 equiv in fracsuba.asm must be kept in step */
  1651.    new.x = tempsqrx - tempsqry + tmp.x + floatparm->x;
  1652.    new.y = 2.0 * old.x * old.y + tmp.y + floatparm->y;
  1653.    tmp = old;
  1654.    return(floatbailout());
  1655. }
  1656.  
  1657. /*
  1658.    MarksMandelPwr (XAXIS) {
  1659.       z = pixel, c = z ^ (z - 1):
  1660.      z = c * sqr(z) + pixel,
  1661.       |z| <= 4
  1662.    }
  1663. */
  1664.  
  1665. MarksMandelPwrfpFractal()
  1666. {
  1667.    CMPLXtrig0(old,new);
  1668.    CMPLXmult(tmp,new,new);
  1669.    new.x += floatparm->x;
  1670.    new.y += floatparm->y;
  1671.    return(floatbailout());
  1672. }
  1673.  
  1674. MarksMandelPwrFractal()
  1675. {
  1676.    LCMPLXtrig0(lold,lnew);
  1677.    LCMPLXmult(ltmp,lnew,lnew);
  1678.    lnew.x += longparm->x;
  1679.    lnew.y += longparm->y;
  1680.    return(longbailout());
  1681. }
  1682.  
  1683. /* I was coding Marksmandelpower and failed to use some temporary
  1684.    variables. The result was nice, and since my name is not on any fractal,
  1685.    I thought I would immortalize myself with this error!
  1686.         Tim Wegner */
  1687.  
  1688.  
  1689. TimsErrorfpFractal()
  1690. {
  1691.    CMPLXtrig0(old,new);
  1692.    new.x = new.x * tmp.x - new.y * tmp.y;
  1693.    new.y = new.x * tmp.y - new.y * tmp.x;
  1694.    new.x += floatparm->x;
  1695.    new.y += floatparm->y;
  1696.    return(floatbailout());
  1697. }
  1698. TimsErrorFractal()
  1699. {
  1700.    LCMPLXtrig0(lold,lnew);
  1701.    lnew.x = multiply(lnew.x,ltmp.x,bitshift)-multiply(lnew.y,ltmp.y,bitshift);
  1702.    lnew.y = multiply(lnew.x,ltmp.y,bitshift)-multiply(lnew.y,ltmp.x,bitshift);
  1703.    lnew.x += longparm->x;
  1704.    lnew.y += longparm->y;
  1705.    return(longbailout());
  1706. }
  1707.  
  1708. /* -------------------------------------------------------------------- */
  1709. /*        Initialization (once per pixel) routines                        */
  1710. /* -------------------------------------------------------------------- */
  1711.  
  1712. #if 0
  1713. /* this code translated to asm - lives in newton.asm */
  1714. /* transform points with reciprocal function */
  1715. void invertz1(CMPLX *z)
  1716. {
  1717.    z->x = dx0[col]+dx1[row];
  1718.    z->y = dy0[row]+dy1[col];
  1719.    z->x -= f_xcenter; z->y -= f_ycenter;  /* Normalize values to center of circle */
  1720.  
  1721.    tempsqrx = sqr(z->x) + sqr(z->y);  /* Get old radius */
  1722.    if(fabs(tempsqrx) > FLT_MIN)
  1723.       tempsqrx = f_radius / tempsqrx;
  1724.    else
  1725.       tempsqrx = FLT_MAX;   /* a big number, but not TOO big */
  1726.    z->x *= tempsqrx;      z->y *= tempsqrx;     /* Perform inversion */
  1727.    z->x += f_xcenter; z->y += f_ycenter; /* Renormalize */
  1728. }
  1729. #endif
  1730.  
  1731. int long_julia_per_pixel()
  1732. {
  1733.    /* integer julia types */
  1734.    /* lambda */
  1735.    /* barnsleyj1 */
  1736.    /* barnsleyj2 */
  1737.    /* sierpinski */
  1738.    if(invert)
  1739.    {
  1740.       /* invert */
  1741.       invertz2(&old);
  1742.  
  1743.       /* watch out for overflow */
  1744.       if(sqr(old.x)+sqr(old.y) >= 127)
  1745.       {
  1746.      old.x = 8;  /* value to bail out in one iteration */
  1747.      old.y = 8;
  1748.       }
  1749.  
  1750.       /* convert to fudged longs */
  1751.       lold.x = old.x*fudge;
  1752.       lold.y = old.y*fudge;
  1753.    }
  1754.    else
  1755.    {
  1756.       lold.x = lx0[col]+lx1[row];
  1757.       lold.y = ly0[row]+ly1[col];
  1758.    }
  1759.    return(0);
  1760. }
  1761.  
  1762. int long_richard8_per_pixel()
  1763. {
  1764.     long_mandel_per_pixel();
  1765.     LCMPLXtrig1(*longparm,ltmp);
  1766.     LCMPLXmult(ltmp,lparm2,ltmp);
  1767.     return(1);
  1768. }
  1769.  
  1770. int long_mandel_per_pixel()
  1771. {
  1772.    /* integer mandel types */
  1773.    /* barnsleym1 */
  1774.    /* barnsleym2 */
  1775.    linit.x = lx0[col]+lx1[row];
  1776.  
  1777.    if(invert)
  1778.    {
  1779.       /* invert */
  1780.       invertz2(&init);
  1781.  
  1782.       /* watch out for overflow */
  1783.       if(sqr(init.x)+sqr(init.y) >= 127)
  1784.       {
  1785.      init.x = 8;  /* value to bail out in one iteration */
  1786.      init.y = 8;
  1787.       }
  1788.  
  1789.       /* convert to fudged longs */
  1790.       linit.x = init.x*fudge;
  1791.       linit.y = init.y*fudge;
  1792.    }
  1793.  
  1794.    if(useinitorbit == 1)
  1795.       lold = linitorbit;
  1796.    else
  1797.       lold = linit;
  1798.  
  1799.    lold.x += lparm.x;     /* initial pertubation of parameters set */
  1800.    lold.y += lparm.y;
  1801.    return(1); /* 1st iteration has been done */
  1802. }
  1803.  
  1804. int julia_per_pixel()
  1805. {
  1806.    /* julia */
  1807.  
  1808.    if(invert)
  1809.    {
  1810.       /* invert */
  1811.       invertz2(&old);
  1812.  
  1813.       /* watch out for overflow */
  1814.       if(bitshift <= 24)
  1815.      if (sqr(old.x)+sqr(old.y) >= 127)
  1816.      {
  1817.         old.x = 8;    /* value to bail out in one iteration */
  1818.         old.y = 8;
  1819.      }
  1820.       if(bitshift >  24)
  1821.      if (sqr(old.x)+sqr(old.y) >= 4.0)
  1822.      {
  1823.         old.x = 2;    /* value to bail out in one iteration */
  1824.         old.y = 2;
  1825.      }
  1826.  
  1827.       /* convert to fudged longs */
  1828.       lold.x = old.x*fudge;
  1829.       lold.y = old.y*fudge;
  1830.    }
  1831.    else
  1832.    {
  1833.       lold.x = lx0[col]+lx1[row];
  1834.       lold.y = ly0[row]+ly1[col];
  1835.    }
  1836.  
  1837.    ltempsqrx = multiply(lold.x, lold.x, bitshift);
  1838.    ltempsqry = multiply(lold.y, lold.y, bitshift);
  1839.    ltmp = lold;
  1840.    return(0);
  1841. }
  1842.  
  1843. marks_mandelpwr_per_pixel()
  1844. {
  1845.    mandel_per_pixel();
  1846.    ltmp = lold;
  1847.    ltmp.x -= fudge;
  1848.    LCMPLXpwr(lold,ltmp,ltmp);
  1849.    return(1);
  1850. }
  1851.  
  1852. int mandel_per_pixel()
  1853. {
  1854.    /* mandel */
  1855.  
  1856.    if(invert)
  1857.    {
  1858.       invertz2(&init);
  1859.  
  1860.       /* watch out for overflow */
  1861.       if(bitshift <= 24)
  1862.      if (sqr(init.x)+sqr(init.y) >= 127)
  1863.      {
  1864.         init.x = 8;  /* value to bail out in one iteration */
  1865.         init.y = 8;
  1866.      }
  1867.       if(bitshift >  24)
  1868.      if (sqr(init.x)+sqr(init.y) >= 4)
  1869.      {
  1870.         init.x = 2;  /* value to bail out in one iteration */
  1871.         init.y = 2;
  1872.      }
  1873.  
  1874.       /* convert to fudged longs */
  1875.       linit.x = init.x*fudge;
  1876.       linit.y = init.y*fudge;
  1877.    }
  1878.    else
  1879.       linit.x = lx0[col]+lx1[row];
  1880.    switch (fractype)
  1881.      {
  1882.     case MANDELLAMBDA:        /* Critical Value 0.5 + 0.0i  */
  1883.         lold.x = FgHalf;
  1884.         lold.y = 0;
  1885.         break;
  1886.     default:
  1887.         lold = linit;
  1888.         break;
  1889.       }
  1890.  
  1891.    /* alter init value */
  1892.    if(useinitorbit == 1)
  1893.       lold = linitorbit;
  1894.    else if(useinitorbit == 2)
  1895.       lold = linit;
  1896.  
  1897.    if(inside == -60 || inside == -61)
  1898.    {
  1899.       /* kludge to match "Beauty of Fractals" picture since we start
  1900.      Mandelbrot iteration with init rather than 0 */
  1901.       lold.x = lparm.x; /* initial pertubation of parameters set */
  1902.       lold.y = lparm.y;
  1903.       color = -1;
  1904.    }
  1905.    else
  1906.    {
  1907.       lold.x += lparm.x; /* initial pertubation of parameters set */
  1908.       lold.y += lparm.y;
  1909.    }
  1910.    ltmp = linit; /* for spider */
  1911.    ltempsqrx = multiply(lold.x, lold.x, bitshift);
  1912.    ltempsqry = multiply(lold.y, lold.y, bitshift);
  1913.    return(1); /* 1st iteration has been done */
  1914. }
  1915.  
  1916.  
  1917. int marksmandel_per_pixel()
  1918. {
  1919.    /* marksmandel */
  1920.  
  1921.    if(invert)
  1922.    {
  1923.       invertz2(&init);
  1924.  
  1925.       /* watch out for overflow */
  1926.       if(sqr(init.x)+sqr(init.y) >= 127)
  1927.       {
  1928.      init.x = 8;  /* value to bail out in one iteration */
  1929.      init.y = 8;
  1930.       }
  1931.  
  1932.       /* convert to fudged longs */
  1933.       linit.x = init.x*fudge;
  1934.       linit.y = init.y*fudge;
  1935.    }
  1936.    else
  1937.       linit.x = lx0[col]+lx1[row];
  1938.  
  1939.    if(useinitorbit == 1)
  1940.       lold = linitorbit;
  1941.    else
  1942.       lold = linit;
  1943.  
  1944.    lold.x += lparm.x;     /* initial pertubation of parameters set */
  1945.    lold.y += lparm.y;
  1946.  
  1947.    if(c_exp > 3)
  1948.       lcpower(&lold,c_exp-1,&lcoefficient,bitshift);
  1949.    else if(c_exp == 3) {
  1950.       lcoefficient.x = multiply(lold.x, lold.x, bitshift)
  1951.      - multiply(lold.y, lold.y, bitshift);
  1952.       lcoefficient.y = multiply(lold.x, lold.y, bitshiftless1);
  1953.    }
  1954.    else if(c_exp == 2)
  1955.       lcoefficient = lold;
  1956.    else if(c_exp < 2) {
  1957.       lcoefficient.x = 1L << bitshift;
  1958.       lcoefficient.y = 0L;
  1959.    }
  1960.  
  1961.    ltempsqrx = multiply(lold.x, lold.x, bitshift);
  1962.    ltempsqry = multiply(lold.y, lold.y, bitshift);
  1963.    return(1); /* 1st iteration has been done */
  1964. }
  1965.  
  1966. marks_mandelpwrfp_per_pixel()
  1967. {
  1968.    mandelfp_per_pixel();
  1969.    tmp = old;
  1970.    tmp.x -= 1;
  1971.    CMPLXpwr(old,tmp,tmp);
  1972.    return(1);
  1973. }
  1974.  
  1975. int mandelfp_per_pixel()
  1976. {
  1977.    /* floating point mandelbrot */
  1978.    /* mandelfp */
  1979.  
  1980.    if(invert)
  1981.       invertz2(&init);
  1982.    else
  1983.       init.x = dx0[col]+dx1[row];
  1984.     switch (fractype)
  1985.       {
  1986.     case MAGNET2M:
  1987.         FloatPreCalcMagnet2();
  1988.     case MAGNET1M:         /* Crit Val Zero both, but neither   */
  1989.         old.x = old.y = 0.0; /* is of the form f(Z,C) = Z*g(Z)+C  */
  1990.         break;
  1991.     case MANDELLAMBDAFP:        /* Critical Value 0.5 + 0.0i  */
  1992.         old.x = 0.5;
  1993.         old.y = 0.0;
  1994.         break;
  1995.     default:
  1996.         old = init;
  1997.         break;
  1998.       }
  1999.  
  2000.    /* alter init value */
  2001.    if(useinitorbit == 1)
  2002.       old = initorbit;
  2003.    else if(useinitorbit == 2)
  2004.       old = init;
  2005.  
  2006.    if(inside == -60 || inside == -61)
  2007.    {
  2008.       /* kludge to match "Beauty of Fractals" picture since we start
  2009.      Mandelbrot iteration with init rather than 0 */
  2010.       old.x = parm.x; /* initial pertubation of parameters set */
  2011.       old.y = parm.y;
  2012.       color = -1;
  2013.    }
  2014.    else
  2015.    {
  2016.      old.x += parm.x;
  2017.      old.y += parm.y;
  2018.    }
  2019.    tmp = init; /* for spider */
  2020.    tempsqrx = sqr(old.x);  /* precalculated value for regular Mandelbrot */
  2021.    tempsqry = sqr(old.y);
  2022.    return(1); /* 1st iteration has been done */
  2023. }
  2024.  
  2025. int juliafp_per_pixel()
  2026. {
  2027.    /* floating point julia */
  2028.    /* juliafp */
  2029.    if(invert)
  2030.       invertz2(&old);
  2031.    else
  2032.    {
  2033.      old.x = dx0[col]+dx1[row];
  2034.      old.y = dy0[row]+dy1[col];
  2035.    }
  2036.    tempsqrx = sqr(old.x);  /* precalculated value for regular Julia */
  2037.    tempsqry = sqr(old.y);
  2038.    tmp = old;
  2039.    return(0);
  2040. }
  2041.  
  2042. int MPCjulia_per_pixel()
  2043. {
  2044.    /* floating point julia */
  2045.    /* juliafp */
  2046.    if(invert)
  2047.       invertz2(&old);
  2048.    else
  2049.    {
  2050.      old.x = dx0[col]+dx1[row];
  2051.      old.y = dy0[row]+dy1[col];
  2052.    }
  2053.    mpcold.x = *pd2MP(old.x);
  2054.    mpcold.y = *pd2MP(old.y);
  2055.    return(0);
  2056. }
  2057.  
  2058. otherrichard8fp_per_pixel()
  2059. {
  2060.     othermandelfp_per_pixel();
  2061.     CMPLXtrig1(*floatparm,tmp);
  2062.     CMPLXmult(tmp,parm2,tmp);
  2063.     return(1);
  2064. }
  2065.  
  2066. int othermandelfp_per_pixel()
  2067. {
  2068.    if(invert)
  2069.       invertz2(&init);
  2070.    else
  2071.       init.x = dx0[col]+dx1[row];
  2072.  
  2073.    if(useinitorbit == 1)
  2074.       old = initorbit;
  2075.    else
  2076.       old = init;
  2077.  
  2078.    old.x += parm.x;     /* initial pertubation of parameters set */
  2079.    old.y += parm.y;
  2080.  
  2081.    return(1); /* 1st iteration has been done */
  2082. }
  2083.  
  2084. int otherjuliafp_per_pixel()
  2085. {
  2086.    if(invert)
  2087.       invertz2(&old);
  2088.    else
  2089.    {
  2090.       old.x = dx0[col]+dx1[row];
  2091.       old.y = dy0[row]+dy1[col];
  2092.    }
  2093.    return(0);
  2094. }
  2095.  
  2096. int trigmandelfp_per_pixel()
  2097. {
  2098.    if(invert)
  2099.       invertz2(&init);
  2100.    else
  2101.       init.x = dx0[col]+dx1[row];
  2102.  
  2103.    if(useinitorbit == 1)
  2104.       old = initorbit;
  2105.    else
  2106.       old = init;
  2107.  
  2108.    old.x += parm.x;     /* initial pertubation of parameters set */
  2109.    old.y += parm.y;
  2110.    CMPLXtrig0(old,old);
  2111.    return(1); /* 1st iteration has been done */
  2112. }
  2113.  
  2114. int trigjuliafp_per_pixel()
  2115. {
  2116.    /* for tetrated types */
  2117.    if(invert)
  2118.       invertz2(&old);
  2119.    else
  2120.    {
  2121.       old.x = dx0[col]+dx1[row];
  2122.       old.y = dy0[row]+dy1[col];
  2123.    }
  2124.    CMPLXtrig0(old,old);
  2125.    return(0);
  2126. }
  2127.  
  2128. int trigXtrigmandelfp_per_pixel()
  2129. {
  2130.    if(invert)
  2131.       invertz2(&init);
  2132.    else
  2133.       init.x = dx0[col]+dx1[row];
  2134.  
  2135.    if(useinitorbit == 1)
  2136.       old = initorbit;
  2137.    else
  2138.       old = init;
  2139.  
  2140.    old.x += parm.x;     /* initial pertubation of parameters set */
  2141.    old.y += parm.y;
  2142.    CMPLXtrig0(old,tmp);
  2143.    CMPLXtrig1(old,tmp2);
  2144.    CMPLXmult(tmp,tmp2,old);
  2145.    return(1); /* 1st iteration has been done */
  2146. }
  2147.  
  2148. int trigXtrigjuliafp_per_pixel()
  2149. {
  2150.    if(invert)
  2151.       invertz2(&old);
  2152.    else
  2153.    {
  2154.       old.x = dx0[col]+dx1[row];
  2155.       old.y = dy0[row]+dy1[col];
  2156.    }
  2157.    CMPLXtrig0(old,tmp);
  2158.    CMPLXtrig1(old,tmp2);
  2159.    CMPLXmult(tmp,tmp2,old);
  2160.    return(0);
  2161. }
  2162.  
  2163. int MarksCplxMandperp(void)
  2164. {
  2165.    if(invert)
  2166.       invertz2(&init);
  2167.    else
  2168.       init.x = dx0[col]+dx1[row];
  2169.    old.x = init.x + parm.x; /* initial pertubation of parameters set */
  2170.    old.y = init.y + parm.y;
  2171.    tempsqrx = sqr(old.x);  /* precalculated value */
  2172.    tempsqry = sqr(old.y);
  2173.    Coefficient = ComplexPower(init, pwr);
  2174.    return(1);
  2175. }
  2176.  
  2177. /* -------------------------------------------------------------------- */
  2178. /*        Setup (once per fractal image) routines         */
  2179. /* -------------------------------------------------------------------- */
  2180.  
  2181. MandelSetup()        /* Mandelbrot Routine */
  2182. {
  2183.    if (debugflag != 90 && ! invert && decomp[0] == 0 && rqlim <= 4.0
  2184.        && bitshift == 29 && potflag == 0
  2185.        && biomorph == -1 && inside != -60 && inside != -59
  2186.        && inside != -61 && outside == -1 && useinitorbit != 1)
  2187.       calctype = calcmand; /* the normal case - use CALCMAND */
  2188.    else
  2189.    {
  2190.       /* special case: use the main processing loop */
  2191.       calctype = StandardFractal;
  2192.       longparm = &linit;
  2193.    }
  2194.    return(1);
  2195. }
  2196.  
  2197. JuliaSetup()        /* Julia Routine */
  2198. {
  2199.    if (debugflag != 90 && ! invert && decomp[0] == 0 && rqlim <= 4.0
  2200.        && bitshift == 29 && potflag == 0
  2201.        && biomorph == -1 && inside != -60 && inside != -59
  2202.        && inside != -61 && outside == -1 && !finattract)
  2203.       calctype = calcmand; /* the normal case - use CALCMAND */
  2204.    else
  2205.    {
  2206.       /* special case: use the main processing loop */
  2207.       calctype = StandardFractal;
  2208.       longparm = &lparm;
  2209.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2210.    }
  2211.    return(1);
  2212. }
  2213.  
  2214. NewtonSetup()        /* Newton/NewtBasin Routines */
  2215. {
  2216.    int i;
  2217.    extern int basin;
  2218.    extern int fpu;
  2219.    if (debugflag != 1010)
  2220.    {
  2221.       if(fpu != 0)
  2222.       {
  2223.      if(fractype == MPNEWTON)
  2224.         fractype = NEWTON;
  2225.      else if(fractype == MPNEWTBASIN)
  2226.         fractype = NEWTBASIN;
  2227.       }
  2228.       else
  2229.       {
  2230.      if(fractype == NEWTON)
  2231.            fractype = MPNEWTON;
  2232.      else if(fractype == NEWTBASIN)
  2233.            fractype = MPNEWTBASIN;
  2234.       }
  2235.       curfractalspecific = &fractalspecific[fractype];
  2236.    }
  2237.  
  2238.    /* set up table of roots of 1 along unit circle */
  2239.    degree = (int)parm.x;
  2240.    if(degree < 2)
  2241.       degree = 3;   /* defaults to 3, but 2 is possible */
  2242.    root = 1;
  2243.  
  2244.    /* precalculated values */
  2245.    roverd    = (double)root / (double)degree;
  2246.    d1overd    = (double)(degree - 1) / (double)degree;
  2247.    maxcolor    = 0;
  2248.    threshold    = .3*PI/degree; /* less than half distance between roots */
  2249.    if (fractype == MPNEWTON || fractype == MPNEWTBASIN) {
  2250.       mproverd       = *pd2MP(roverd);
  2251.       mpd1overd    = *pd2MP(d1overd);
  2252.       mpthreshold  = *pd2MP(threshold);
  2253.       mpone       = *pd2MP(1.0);
  2254.    }
  2255.  
  2256.    floatmin = FLT_MIN;
  2257.    floatmax = FLT_MAX;
  2258.  
  2259.    basin = 0;
  2260.    if(roots != staticroots) {
  2261.       free(roots);
  2262.       roots = staticroots;
  2263.    }
  2264.  
  2265.    if (fractype==NEWTBASIN)
  2266.    {
  2267.       if(parm.y)
  2268.      basin = 2; /*stripes */
  2269.       else
  2270.      basin = 1;
  2271.       if(degree > 16)
  2272.       {
  2273.      if((roots=(CMPLX *)malloc(degree*sizeof(CMPLX)))==NULL)
  2274.      {
  2275.         roots = staticroots;
  2276.         degree = 16;
  2277.      }
  2278.       }
  2279.       else
  2280.      roots = staticroots;
  2281.  
  2282.       /* list of roots to discover where we converged for newtbasin */
  2283.       for(i=0;i<degree;i++)
  2284.       {
  2285.      roots[i].x = cos(i*PI*2.0/(double)degree);
  2286.      roots[i].y = sin(i*PI*2.0/(double)degree);
  2287.       }
  2288.    }
  2289.    else if (fractype==MPNEWTBASIN)
  2290.    {
  2291.      if(parm.y)
  2292.      basin = 2; /*stripes */
  2293.       else
  2294.      basin = 1;
  2295.  
  2296.       if(degree > 16)
  2297.       {
  2298.      if((MPCroots=(struct MPC *)malloc(degree*sizeof(struct MPC)))==NULL)
  2299.      {
  2300.         MPCroots = (struct MPC *)staticroots;
  2301.         degree = 16;
  2302.      }
  2303.       }
  2304.       else
  2305.      MPCroots = (struct MPC *)staticroots;
  2306.  
  2307.       /* list of roots to discover where we converged for newtbasin */
  2308.       for(i=0;i<degree;i++)
  2309.       {
  2310.      MPCroots[i].x = *pd2MP(cos(i*PI*2.0/(double)degree));
  2311.      MPCroots[i].y = *pd2MP(sin(i*PI*2.0/(double)degree));
  2312.       }
  2313.    }
  2314.  
  2315.    if (degree%4 == 0)
  2316.       symmetry = XYAXIS;
  2317.    else
  2318.       symmetry = XAXIS;
  2319.  
  2320.    calctype=StandardFractal;
  2321.    if (fractype == MPNEWTON || fractype == MPNEWTBASIN)
  2322.       setMPfunctions();
  2323.    return(1);
  2324. }
  2325.  
  2326.  
  2327. StandaloneSetup()
  2328. {
  2329.    timer(0,curfractalspecific->calctype);
  2330.    return(0);        /* effectively disable solid-guessing */
  2331. }
  2332.  
  2333. UnitySetup()
  2334. {
  2335.    periodicitycheck = 0;
  2336.    FgOne = (1L << bitshift);
  2337.    FgTwo = FgOne + FgOne;
  2338.    return(1);
  2339. }
  2340.  
  2341. MandelfpSetup()
  2342. {
  2343.    c_exp = param[2];
  2344.    pwr.x = param[2] - 1.0;
  2345.    pwr.y = param[3];
  2346.    floatparm = &init;
  2347.    switch (fractype)
  2348.    {
  2349.    case FPMANDELZPOWER:
  2350.       if(c_exp < 1)
  2351.          c_exp = 1;
  2352.       if(c_exp & 1) /* odd exponents */
  2353.          symmetry = XYAXIS_NOPARM;
  2354.       if(param[3] != 0 || (double)c_exp != param[2])
  2355.          symmetry = NOSYM;
  2356.       if(param[4] == 0.0 && debugflag != 6000 && (double)c_exp == param[2])
  2357.           fractalspecific[fractype].orbitcalc = floatZpowerFractal;
  2358.       else
  2359.           fractalspecific[fractype].orbitcalc = floatCmplxZpowerFractal;
  2360.       break;
  2361.    case MAGNET1M:
  2362.    case MAGNET2M:
  2363.       attr[0].x = 1.0;        /* 1.0 + 0.0i always attracts */
  2364.       attr[0].y = 0.0;        /* - both MAGNET1 and MAGNET2 */
  2365.       attractors = 1;
  2366.       break;
  2367.    case SPIDERFP:
  2368.       if(periodicitycheck==1) /* if not user set */
  2369.      periodicitycheck=4;
  2370.       break;
  2371.    case MANDELEXP:
  2372.       symmetry = XAXIS_NOPARM;
  2373.       break;
  2374.    default:
  2375.       break;
  2376.    }
  2377.    return(1);
  2378. }
  2379.  
  2380. JuliafpSetup()
  2381. {
  2382.    c_exp = param[2];
  2383.    floatparm = &parm;
  2384.    if(fractype==COMPLEXMARKSJUL)
  2385.    {
  2386.       pwr.x = param[2] - 1.0;
  2387.       pwr.y = param[3];
  2388.       Coefficient = ComplexPower(*floatparm, pwr);
  2389.    }
  2390.    switch (fractype)
  2391.    {
  2392.    case FPJULIAZPOWER:
  2393.       if((c_exp & 1) || param[3] != 0.0 || (double)c_exp != param[2] )
  2394.          symmetry = NOSYM;
  2395.       else if(c_exp < 1)
  2396.          c_exp = 1;
  2397.       if(param[4] == 0.0 && debugflag != 6000 && (double)c_exp == param[2])
  2398.           fractalspecific[fractype].orbitcalc = floatZpowerFractal;
  2399.       else
  2400.           fractalspecific[fractype].orbitcalc = floatCmplxZpowerFractal;
  2401.       break;
  2402.    case MAGNET2J:
  2403.       FloatPreCalcMagnet2();
  2404.    case MAGNET1J:
  2405.       attr[0].x = 1.0;        /* 1.0 + 0.0i always attracts */
  2406.       attr[0].y = 0.0;        /* - both MAGNET1 and MAGNET2 */
  2407.       attractors = 1;
  2408.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2409.       break;
  2410.    case LAMBDAFP:
  2411.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2412.       get_julia_attractor (0.5, 0.0);    /* another attractor? */
  2413.       break;
  2414.    case LAMBDAEXP:
  2415.       if(parm.y == 0.0)
  2416.      symmetry=XAXIS;
  2417.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2418.       break;
  2419.    default:
  2420.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2421.       break;
  2422.    }
  2423.    return(1);
  2424. }
  2425.  
  2426. MandellongSetup()
  2427. {
  2428.    FgHalf = fudge >> 1;
  2429.    c_exp = param[2];
  2430.    if(fractype==MARKSMANDEL && c_exp < 1)
  2431.       c_exp = 1;
  2432.    if(fractype==LMANDELZPOWER && c_exp < 1)
  2433.       c_exp = 1;
  2434.    if((fractype==MARKSMANDEL   && !(c_exp & 1)) ||
  2435.        (fractype==LMANDELZPOWER && c_exp & 1))
  2436.       symmetry = XYAXIS_NOPARM;    /* odd exponents */
  2437.    if((fractype==MARKSMANDEL && (c_exp & 1)) || fractype==LMANDELEXP)
  2438.       symmetry = XAXIS_NOPARM;
  2439.    if(fractype==SPIDER && periodicitycheck==1)
  2440.       periodicitycheck=4;
  2441.    longparm = &linit;
  2442.    if(fractype==LMANDELZPOWER)
  2443.    {
  2444.       if(param[4] == 0.0 && debugflag != 6000  && (double)c_exp == param[2])
  2445.           fractalspecific[fractype].orbitcalc = longZpowerFractal;
  2446.       else
  2447.           fractalspecific[fractype].orbitcalc = longCmplxZpowerFractal;
  2448.       if(param[3] != 0 || (double)c_exp != param[2] )
  2449.          symmetry = NOSYM;
  2450.     }
  2451.  
  2452.    return(1);
  2453. }
  2454.  
  2455. JulialongSetup()
  2456. {
  2457.    c_exp = param[2];
  2458.    longparm = &lparm;
  2459.    switch (fractype)
  2460.    {
  2461.    case LJULIAZPOWER:
  2462.       if((c_exp & 1) || param[3] != 0.0 || (double)c_exp != param[2])
  2463.          symmetry = NOSYM;
  2464.       else if(c_exp < 1)
  2465.          c_exp = 1;
  2466.       if(param[4] == 0.0 && debugflag != 6000 && (double)c_exp == param[2])
  2467.           fractalspecific[fractype].orbitcalc = longZpowerFractal;
  2468.       else
  2469.           fractalspecific[fractype].orbitcalc = longCmplxZpowerFractal;
  2470.       break;
  2471.    case LAMBDA:
  2472.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2473.       get_julia_attractor (0.5, 0.0);    /* another attractor? */
  2474.       break;
  2475.    case LLAMBDAEXP:
  2476.       if(lparm.y == 0)
  2477.      symmetry = XAXIS;
  2478.       break;
  2479.    default:
  2480.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2481.       break;
  2482.    }
  2483.    return(1);
  2484. }
  2485.  
  2486. TrigPlusSqrlongSetup()
  2487. {
  2488.    curfractalspecific->per_pixel =  julia_per_pixel;
  2489.    curfractalspecific->orbitcalc =  TrigPlusSqrFractal;
  2490.    if(lparm.x == fudge && lparm.y == 0L && lparm2.y == 0L && debugflag != 90)
  2491.    {
  2492.       if(lparm2.x == fudge)       /* Scott variant */
  2493.      curfractalspecific->orbitcalc =  ScottTrigPlusSqrFractal;
  2494.       else if(lparm2.x == -fudge)  /* Skinner variant */
  2495.      curfractalspecific->orbitcalc =  SkinnerTrigSubSqrFractal;
  2496.    }
  2497.    return(JulialongSetup());
  2498. }
  2499.  
  2500. TrigPlusSqrfpSetup()
  2501. {
  2502.    curfractalspecific->per_pixel =  juliafp_per_pixel;
  2503.    curfractalspecific->orbitcalc =  TrigPlusSqrfpFractal;
  2504.    if(parm.x == 1.0 && parm.y == 0.0 && parm2.y == 0.0 && debugflag != 90)
  2505.    {
  2506.       if(parm2.x == 1.0)    /* Scott variant */
  2507.      curfractalspecific->orbitcalc =  ScottTrigPlusSqrfpFractal;
  2508.       else if(parm2.x == -1.0)    /* Skinner variant */
  2509.      curfractalspecific->orbitcalc =  SkinnerTrigSubSqrfpFractal;
  2510.    }
  2511.    return(JuliafpSetup());
  2512. }
  2513.  
  2514. TrigPlusTriglongSetup()
  2515. {
  2516.    FnPlusFnSym();
  2517.    if(trigndx[1] == SQR)
  2518.       return(TrigPlusSqrlongSetup());
  2519.    curfractalspecific->per_pixel =  long_julia_per_pixel;
  2520.    curfractalspecific->orbitcalc =  TrigPlusTrigFractal;
  2521.    if(lparm.x == fudge && lparm.y == 0L && lparm2.y == 0L && debugflag != 90)
  2522.    {
  2523.       if(lparm2.x == fudge)       /* Scott variant */
  2524.      curfractalspecific->orbitcalc =  ScottTrigPlusTrigFractal;
  2525.       else if(lparm2.x == -fudge)  /* Skinner variant */
  2526.      curfractalspecific->orbitcalc =  SkinnerTrigSubTrigFractal;
  2527.    }
  2528.    return(JulialongSetup());
  2529. }
  2530.  
  2531. TrigPlusTrigfpSetup()
  2532. {
  2533.    FnPlusFnSym();
  2534.    if(trigndx[1] == SQR)
  2535.       return(TrigPlusSqrfpSetup());
  2536.    curfractalspecific->per_pixel =  otherjuliafp_per_pixel;
  2537.    curfractalspecific->orbitcalc =  TrigPlusTrigfpFractal;
  2538.    if(parm.x == 1.0 && parm.y == 0.0 && parm2.y == 0.0 && debugflag != 90)
  2539.    {
  2540.       if(parm2.x == 1.0)    /* Scott variant */
  2541.      curfractalspecific->orbitcalc =  ScottTrigPlusTrigfpFractal;
  2542.       else if(parm2.x == -1.0)    /* Skinner variant */
  2543.      curfractalspecific->orbitcalc =  SkinnerTrigSubTrigfpFractal;
  2544.    }
  2545.    return(JuliafpSetup());
  2546. }
  2547.  
  2548. FnPlusFnSym() /* set symmetry matrix for fn+fn type */
  2549. {
  2550.    static char far fnplusfn[7][7] =
  2551.    {/* fn2 ->sin     cos    sinh    cosh   sqr      exp     log  */
  2552.    /* fn1 */
  2553.    /* sin */ {PI_SYM,XAXIS, XYAXIS, XAXIS, XAXIS, XAXIS, XAXIS},
  2554.    /* cos */ {XAXIS, PI_SYM,XAXIS,  XYAXIS,XAXIS, XAXIS, XAXIS},
  2555.    /* sinh*/ {XYAXIS,XAXIS, XYAXIS, XAXIS, XAXIS, XAXIS, XAXIS},
  2556.    /* cosh*/ {XAXIS, XYAXIS,XAXIS,  XYAXIS,XAXIS, XAXIS, XAXIS},
  2557.    /* sqr */ {XAXIS, XYAXIS,XAXIS,  XAXIS, XYAXIS,XAXIS, XAXIS},
  2558.    /* exp */ {XAXIS, XAXIS, XAXIS,  XAXIS, XAXIS, XAXIS, XAXIS},
  2559.    /* log */ {XAXIS, XAXIS, XAXIS,  XAXIS, XAXIS, XAXIS, XYAXIS}
  2560.    };
  2561.    if(parm.y == 0.0 && parm2.y == 0.0)
  2562.       symmetry = fnplusfn[trigndx[0]][trigndx[1]];
  2563.    else
  2564.       symmetry = NOSYM;
  2565.    return(0);
  2566. }
  2567.  
  2568. ZXTrigPlusZSetup()
  2569. {
  2570.    static char far ZXTrigPlusZSym1[] =
  2571.    /* fn1 ->  sin   cos    sinh  cosh    sqr    exp   log  */
  2572.          {XAXIS,XYAXIS,XAXIS,XYAXIS,XYAXIS,XAXIS,XAXIS};
  2573.    static char far ZXTrigPlusZSym2[] =
  2574.    /* fn1 ->  sin   cos    sinh  cosh    sqr    exp   log  */
  2575.          {NOSYM,ORIGIN,NOSYM,ORIGIN,XYAXIS,NOSYM,NOSYM};
  2576.    if(param[1] == 0.0 && param[3] == 0.0)
  2577.       symmetry = ZXTrigPlusZSym1[trigndx[0]];
  2578.    else
  2579.       symmetry = ZXTrigPlusZSym2[trigndx[0]];
  2580.  
  2581.    if(curfractalspecific->isinteger)
  2582.    {
  2583.       curfractalspecific->orbitcalc =  ZXTrigPlusZFractal;
  2584.       if(lparm.x == fudge && lparm.y == 0L && lparm2.y == 0L && debugflag != 90)
  2585.       {
  2586.      if(lparm2.x == fudge)       /* Scott variant */
  2587.          curfractalspecific->orbitcalc =  ScottZXTrigPlusZFractal;
  2588.      else if(lparm2.x == -fudge)  /* Skinner variant */
  2589.          curfractalspecific->orbitcalc =  SkinnerZXTrigSubZFractal;
  2590.       }
  2591.       return(JulialongSetup());
  2592.    }
  2593.    else
  2594.    {
  2595.       curfractalspecific->orbitcalc =  ZXTrigPlusZfpFractal;
  2596.       if(parm.x == 1.0 && parm.y == 0.0 && parm2.y == 0.0 && debugflag != 90)
  2597.       {
  2598.      if(parm2.x == 1.0)    /* Scott variant */
  2599.          curfractalspecific->orbitcalc =  ScottZXTrigPlusZfpFractal;
  2600.      else if(parm2.x == -1.0)    /* Skinner variant */
  2601.          curfractalspecific->orbitcalc =  SkinnerZXTrigSubZfpFractal;
  2602.       }
  2603.    }
  2604.    return(JuliafpSetup());
  2605. }
  2606.  
  2607. LambdaTrigSetup()
  2608. {
  2609.    int isinteger;
  2610.    if((isinteger = curfractalspecific->isinteger))
  2611.       curfractalspecific->orbitcalc =  LambdaTrigFractal;
  2612.    else
  2613.       curfractalspecific->orbitcalc =  LambdaTrigfpFractal;
  2614.    switch(trigndx[0])
  2615.    {
  2616.    case SIN:
  2617.    case COS:
  2618.       symmetry = PI_SYM;
  2619.       if(isinteger)
  2620.      curfractalspecific->orbitcalc =  LambdaTrigFractal1;
  2621.       else
  2622.      curfractalspecific->orbitcalc =  LambdaTrigfpFractal1;
  2623.       break;
  2624.    case SINH:
  2625.    case COSH:
  2626.       symmetry = ORIGIN;
  2627.       if(isinteger)
  2628.      curfractalspecific->orbitcalc =  LambdaTrigFractal2;
  2629.       else
  2630.      curfractalspecific->orbitcalc =  LambdaTrigfpFractal2;
  2631.       break;
  2632.    case SQR:
  2633.       symmetry = ORIGIN;
  2634.       break;
  2635.    case EXP:
  2636.       if(isinteger)
  2637.      curfractalspecific->orbitcalc =  LongLambdaexponentFractal;
  2638.       else
  2639.      curfractalspecific->orbitcalc =  LambdaexponentFractal;
  2640.       symmetry = XAXIS;
  2641.       break;
  2642.    case LOG:
  2643.       symmetry = NOSYM;
  2644.       break;
  2645.    }
  2646.    if(isinteger)
  2647.       return(JulialongSetup());
  2648.    else
  2649.       return(JuliafpSetup());
  2650. }
  2651.  
  2652. JuliafnPlusZsqrdSetup()
  2653. {
  2654.    static char far fnpluszsqrd[] =
  2655.    /* fn1 ->  sin   cos    sinh  cosh    sqr    exp   log  */
  2656.    /* sin */ {NOSYM,ORIGIN,NOSYM,ORIGIN,ORIGIN,NOSYM,NOSYM};
  2657.  
  2658.    symmetry = fnpluszsqrd[trigndx[0]];
  2659.    if(curfractalspecific->isinteger)
  2660.       return(JulialongSetup());
  2661.    else
  2662.       return(JuliafpSetup());
  2663. }
  2664.  
  2665. SqrTrigSetup()
  2666. {
  2667.    static char far SqrTrigSym[] =
  2668.    /* fn1 ->  sin    cos    sinh   cosh   sqr     exp   log  */
  2669.          {PI_SYM,PI_SYM,XYAXIS,XYAXIS,XYAXIS,XAXIS,XAXIS};
  2670.    symmetry = SqrTrigSym[trigndx[0]];
  2671.    if(curfractalspecific->isinteger)
  2672.       return(JulialongSetup());
  2673.    else
  2674.       return(JuliafpSetup());
  2675. }
  2676.  
  2677. FnXFnSetup()
  2678. {
  2679.    static char far fnxfn[7][7] =
  2680.    {/* fn2 ->sin     cos    sinh    cosh   sqr      exp     log  */
  2681.    /* fn1 */
  2682.    /* sin */ {PI_SYM,YAXIS, XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2683.    /* cos */ {YAXIS, PI_SYM,XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2684.    /* sinh*/ {XYAXIS,XYAXIS,XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2685.    /* cosh*/ {XYAXIS,XYAXIS,XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2686.    /* sqr */ {XYAXIS,XYAXIS,XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2687.    /* exp */ {XAXIS, XAXIS, XAXIS, XAXIS, XAXIS, XAXIS, XAXIS},
  2688.    /* log */ {XAXIS, XAXIS, XAXIS, XAXIS, XAXIS, XAXIS, XAXIS},
  2689.    };
  2690.    /*
  2691.    if(trigndx[0]==EXP || trigndx[0]==LOG || trigndx[1]==EXP || trigndx[1]==LOG)
  2692.       symmetry = XAXIS;
  2693.    else if((trigndx[0]==SIN && trigndx[1]==SIN)||(trigndx[0]==COS && trigndx[1]==COS))
  2694.       symmetry = PI_SYM;
  2695.    else if((trigndx[0]==SIN && trigndx[1]==COS)||(trigndx[0]==COS && trigndx[1]==SIN))
  2696.       symmetry = YAXIS;
  2697.    else
  2698.       symmetry = XYAXIS;
  2699.    */
  2700.    symmetry = fnxfn[trigndx[0]][trigndx[1]];
  2701.    if(curfractalspecific->isinteger)
  2702.       return(JulialongSetup());
  2703.    else
  2704.       return(JuliafpSetup());
  2705. }
  2706.  
  2707. MandelTrigSetup()
  2708. {
  2709.    int isinteger;
  2710.    if((isinteger = curfractalspecific->isinteger))
  2711.       curfractalspecific->orbitcalc =  LambdaTrigFractal;
  2712.    else
  2713.       curfractalspecific->orbitcalc =  LambdaTrigfpFractal;
  2714.    symmetry = XYAXIS_NOPARM;
  2715.    switch(trigndx[0])
  2716.    {
  2717.    case SIN:
  2718.    case COS:
  2719.       if(isinteger)
  2720.      curfractalspecific->orbitcalc =  LambdaTrigFractal1;
  2721.       else
  2722.      curfractalspecific->orbitcalc =  LambdaTrigfpFractal1;
  2723.       break;
  2724.    case SINH:
  2725.    case COSH:
  2726.       if(isinteger)
  2727.      curfractalspecific->orbitcalc =  LambdaTrigFractal2;
  2728.       else
  2729.      curfractalspecific->orbitcalc =  LambdaTrigfpFractal2;
  2730.       break;
  2731.    case EXP:
  2732.       symmetry = XAXIS_NOPARM;
  2733.       if(isinteger)
  2734.      curfractalspecific->orbitcalc =  LongLambdaexponentFractal;
  2735.       else
  2736.      curfractalspecific->orbitcalc =  LambdaexponentFractal;
  2737.       break;
  2738.    case LOG:
  2739.       symmetry = XAXIS_NOPARM;
  2740.       break;
  2741.    }
  2742.    if(isinteger)
  2743.       return(MandellongSetup());
  2744.    else
  2745.       return(MandelfpSetup());
  2746. }
  2747.  
  2748. MarksJuliaSetup()
  2749. {
  2750.    c_exp = param[2];
  2751.    longparm = &lparm;
  2752.    lold = *longparm;
  2753.    if(c_exp > 2)
  2754.       lcpower(&lold,c_exp,&lcoefficient,bitshift);
  2755.    else if(c_exp == 2)
  2756.    {
  2757.       lcoefficient.x = multiply(lold.x,lold.x,bitshift) - multiply(lold.y,lold.y,bitshift);
  2758.       lcoefficient.y = multiply(lold.x,lold.y,bitshiftless1);
  2759.    }
  2760.    else if(c_exp < 2)
  2761.       lcoefficient = lold;
  2762.    return(1);
  2763. }
  2764.  
  2765. SierpinskiSetup()
  2766. {
  2767.    /* sierpinski */
  2768.    periodicitycheck = 0;        /* disable periodicity checks */
  2769.    ltmp.x = 1;
  2770.    ltmp.x = ltmp.x << bitshift; /* ltmp.x = 1 */
  2771.    ltmp.y = ltmp.x >> 1;            /* ltmp.y = .5 */
  2772.    return(1);
  2773. }
  2774.  
  2775. SierpinskiFPSetup()
  2776. {
  2777.    /* sierpinski */
  2778.    periodicitycheck = 0;        /* disable periodicity checks */
  2779.    tmp.x = 1;
  2780.    tmp.y = 0.5;
  2781.    return(1);
  2782. }
  2783.  
  2784.  
  2785. StandardSetup()
  2786. {
  2787.    if(fractype==UNITYFP)
  2788.       periodicitycheck=0;
  2789.    return(1);
  2790. }
  2791.  
  2792.  
  2793. /* parameter descriptions */
  2794. /* for Mandelbrots */
  2795. static char realz0[] = "Real Perturbation of Z(0)";
  2796. static char imagz0[] = "Imaginary Perturbation of Z(0)";
  2797.  
  2798. /* for Julias */
  2799. static char realparm[] = "Real Part of Parameter";
  2800. static char imagparm[] = "Imaginary Part of Parameter";
  2801.  
  2802. /* for Newtons */
  2803. static char newtdegree[] = "Polynomial Degree (> 2)";
  2804.  
  2805. /* for MarksMandel/Julia */
  2806. static char exponent[]   = "Real part of Exponent";
  2807. static char imexponent[] = "Imag part of Exponent";
  2808.  
  2809. /* for Complex Newton */
  2810. static char realroot[]     = "Real part of Root";
  2811. static char imagroot[]     = "Imag part of Root";
  2812. static char realdegree[] = "Real part of Degree";
  2813. static char imagdegree[] = "Imag part of Degree";
  2814.  
  2815. /* for Lorenz */
  2816. static char timestep[]       = "Time Step";
  2817.  
  2818. /* for formula */
  2819. static char p1real[] = "Real portion of p1";
  2820. static char p2real[] = "Real portion of p2";
  2821. static char p1imag[] = "Imaginary portion of p1";
  2822. static char p2imag[] = "Imaginary portion of p2";
  2823.  
  2824. /* trig functions */
  2825. static char recoeftrg1[] = "Real Coefficient First Function";
  2826. static char imcoeftrg1[] = "Imag Coefficient First Function";
  2827. static char recoeftrg2[] = "Real Coefficient Second Function";
  2828. static char imcoeftrg2[] = "Imag Coefficient Second Function";
  2829.  
  2830. /* MCP 7-7-91
  2831. static char recoefsqr[] = "Real Coefficient Square Term";
  2832. static char imcoefsqr[] = "Imag Coefficient Square Term";
  2833. */
  2834.  
  2835. static char recoef2nd[] = "Real Coefficient Second Term";
  2836. static char imcoef2nd[] = "Imag Coefficient Second Term";
  2837.  
  2838. /* KAM Torus */
  2839. static char kamangle[] = "Angle (radians)";
  2840. static char kamstep[] =  "Step size";
  2841. static char kamstop[] =  "Stop value";
  2842. static char pointsperorbit[] = "Points per orbit";
  2843.  
  2844. /* Newtbasin */
  2845. static char stripes[] = "Enter non-zero value for stripes";
  2846.  
  2847. /* Gingerbreadman */
  2848. static char initx[] = "Initial x";
  2849. static char inity[] = "Initial y";
  2850.  
  2851. /* popcorn */
  2852. static char step[] = "Step size";
  2853.  
  2854. /* bailout defines */
  2855. #define FTRIGBAILOUT 2500.0
  2856. #define LTRIGBAILOUT   64.0
  2857. #define STDBAILOUT        4.0
  2858. #define NOBAILOUT    0.0
  2859.  
  2860. struct fractalspecificstuff far fractalspecific[] =
  2861. {
  2862.    /*
  2863.      fractal name, parameter text strings, parameter values,
  2864.      helptext, helpformula, flags,
  2865.      xmin  xmax  ymin  ymax int tojulia   tomandel tofloat  symmetry
  2866.    |------|-----|-----|-----|--|--------|---------|--------|---------|
  2867.      orbit fnct     per_pixel fnct  per_image fnct  calctype fcnt    bailout
  2868.    |---------------|---------------|---------------|----------------|-------|
  2869.    */
  2870.  
  2871.    "mandel",      realz0, imagz0,"","",0,0,0,0,
  2872.    HT_MANDEL, HF_MANDEL, WINFRAC,
  2873.    -2.5,  1.5, -1.5,  1.5, 1, JULIA,     NOFRACTAL, MANDELFP, XAXIS_NOPARM,
  2874.    JuliaFractal,  mandel_per_pixel,MandelSetup,    calcmand,        STDBAILOUT,
  2875.  
  2876.    "julia",       realparm, imagparm,"","",0.3,0.6,0,0,
  2877.    HT_JULIA, HF_JULIA, WINFRAC,
  2878.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MANDEL, JULIAFP,  ORIGIN,
  2879.    JuliaFractal,   julia_per_pixel, JuliaSetup,    calcmand,        STDBAILOUT,
  2880.  
  2881.    "*newtbasin",   newtdegree,"", "","",3,0,0,0,
  2882.    HT_NEWTBAS, HF_NEWTBAS, WINFRAC,
  2883.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTBASIN,   NOSYM,
  2884.    NewtonFractal2, otherjuliafp_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  2885.  
  2886.    "lambda",      realparm, imagparm,"","",0.85,0.6,0,0,
  2887.    HT_LAMBDA, HF_LAMBDA, WINFRAC,
  2888.    -1.5,  2.5, -1.5,  1.5, 1, NOFRACTAL, MANDELLAMBDA, LAMBDAFP,  NOSYM,
  2889.    LambdaFractal,   julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  2890.  
  2891.    "*mandel",    realz0, imagz0,"","",0,0,0,0,
  2892.    HT_MANDEL, HF_MANDEL, WINFRAC,
  2893.    -2.5,  1.5, -1.5,  1.5, 0, JULIAFP,     NOFRACTAL, MANDEL,  XAXIS_NOPARM,
  2894.    JuliafpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  2895.  
  2896.    "*newton",      newtdegree,stripes, "","",3,0,0,0,
  2897.    HT_NEWT, HF_NEWT, WINFRAC,
  2898.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTON,    XAXIS,
  2899.    NewtonFractal2, otherjuliafp_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  2900.  
  2901.    "*julia",     realparm, imagparm,"","",0.3,0.6,0,0,
  2902.    HT_JULIA, HF_JULIA, WINFRAC,
  2903.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, MANDELFP, JULIA,  ORIGIN,
  2904.    JuliafpFractal, juliafp_per_pixel,  JuliafpSetup,StandardFractal,STDBAILOUT,
  2905.  
  2906.    "plasma",      "Graininess Factor (.1 to 50, default is 2)","","","",2,0,0,0,
  2907.    HT_PLASMA, HF_PLASMA, NOZOOM+NOGUESS+NOTRACE+NORESUME+WINFRAC,
  2908.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  2909.    NULL,       NULL,   StandaloneSetup,     plasma,      NOBAILOUT,
  2910.  
  2911.    "*mandelfn",  realz0, imagz0,"","",0,0,0,0,
  2912.    HT_MANDFN, HF_MANDFN, TRIG1+WINFRAC,
  2913.    -8.0,  8.0, -6.0,  6.0, 0, LAMBDATRIGFP,NOFRACTAL, MANDELTRIG, XYAXIS_NOPARM,
  2914.    LambdaTrigfpFractal,othermandelfp_per_pixel,MandelTrigSetup,StandardFractal,FTRIGBAILOUT,
  2915.  
  2916.    "*manowar",    realz0, imagz0,"","",0,0,0,0,
  2917.    HT_SCOTSKIN, HF_MANOWAR, WINFRAC,
  2918.    -2.5,  1.5, -1.5,  1.5, 0, MANOWARJFP, NOFRACTAL, MANOWAR,  XAXIS_NOPARM,
  2919.    ManOWarfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  2920.  
  2921.    "manowar",    realz0, imagz0,"","",0,0,0,0,
  2922.    HT_SCOTSKIN, HF_MANOWAR, WINFRAC,
  2923.    -2.5,  1.5, -1.5,  1.5, 1, MANOWARJ, NOFRACTAL, MANOWARFP, XAXIS_NOPARM,
  2924.    ManOWarFractal,mandel_per_pixel, MandellongSetup,StandardFractal,STDBAILOUT,
  2925.  
  2926.    "test","(testpt Param #1)","(testpt param #2)","(testpt param #3)","(testpt param #4)",0,0,0,0,
  2927.    HT_TEST, HF_TEST, 0,
  2928.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  2929.    NULL,      NULL,         StandaloneSetup, test,    STDBAILOUT,
  2930.  
  2931.    "sierpinski",  "","","","",0,0,0,0,
  2932.    HT_SIER, HF_SIER, WINFRAC,
  2933.    -0.9,  1.7, -0.9,  1.7, 1, NOFRACTAL, NOFRACTAL, SIERPINSKIFP,   NOSYM,
  2934.    SierpinskiFractal,long_julia_per_pixel, SierpinskiSetup,StandardFractal,127.0,
  2935.  
  2936.    "barnsleym1",  realz0, imagz0,"","",0,0,0,0,
  2937.    HT_BARNS, HF_BARNSM1, WINFRAC,
  2938.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ1,NOFRACTAL, BARNSLEYM1FP,  XYAXIS_NOPARM,
  2939.    Barnsley1Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2940.  
  2941.    "barnsleyj1",  realparm, imagparm,"","",0.6,1.1,0,0,
  2942.    HT_BARNS, HF_BARNSJ1, WINFRAC,
  2943.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, BARNSLEYM1, BARNSLEYJ1FP,  ORIGIN,
  2944.    Barnsley1Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  2945.  
  2946.    "barnsleym2",  realz0, imagz0,"","",0,0,0,0,
  2947.    HT_BARNS, HF_BARNSM2, WINFRAC,
  2948.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ2,NOFRACTAL, BARNSLEYM2FP,  YAXIS_NOPARM,
  2949.    Barnsley2Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2950.  
  2951.    "barnsleyj2",  realparm, imagparm,"","",0.6,1.1,0,0,
  2952.    HT_BARNS, HF_BARNSJ2, WINFRAC,
  2953.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, BARNSLEYM2, BARNSLEYJ2FP,  ORIGIN,
  2954.    Barnsley2Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  2955.  
  2956.    "sqr(fn)", "","","","",0,0,0,0,
  2957.    HT_SCOTSKIN, HF_SQRFN, TRIG1+WINFRAC,
  2958.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, SQRTRIGFP,XYAXIS,
  2959.    SqrTrigFractal,   long_julia_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  2960.  
  2961.    "*sqr(fn)", "","","","",0,0,0,0,
  2962.    HT_SCOTSKIN, HF_SQRFN, TRIG1+WINFRAC,
  2963.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, SQRTRIG,XYAXIS,
  2964.    SqrTrigfpFractal,   otherjuliafp_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  2965.  
  2966.    "fn+fn", recoeftrg1, imcoeftrg1,recoeftrg2, imcoeftrg2,1,0,1,0,
  2967.    HT_SCOTSKIN, HF_FNPLUSFN, TRIG2+WINFRAC,
  2968.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, TRIGPLUSTRIGFP,XAXIS,
  2969.    TrigPlusTrigFractal,   long_julia_per_pixel, TrigPlusTriglongSetup,    StandardFractal,LTRIGBAILOUT,
  2970.  
  2971.    "mandellambda",realz0, imagz0,"","",0,0,0,0,
  2972.    HT_MLAMBDA, HF_MLAMBDA, WINFRAC,
  2973.    -3.0,  5.0, -3.0,  3.0, 1, LAMBDA,     NOFRACTAL, MANDELLAMBDAFP,  XAXIS_NOPARM,
  2974.    LambdaFractal,mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2975.  
  2976.    "marksmandel", realz0, imagz0, exponent,"",0,0,1,0,
  2977.    HT_MARKS, HF_MARKSMAND, WINFRAC,
  2978.    -2.0,  2.0, -1.5,  1.5, 1, MARKSJULIA, NOFRACTAL, NOFRACTAL,  NOSYM,
  2979.    MarksLambdaFractal,marksmandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2980.  
  2981.    "marksjulia", realparm, imagparm, exponent,"",0.1,0.9,0,0,
  2982.    HT_MARKS, HF_MARKSJULIA, WINFRAC,
  2983.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MARKSMANDEL, NOFRACTAL,   ORIGIN,
  2984.    MarksLambdaFractal,julia_per_pixel,MarksJuliaSetup,StandardFractal,STDBAILOUT,
  2985.  
  2986.    "unity", "","","","",0,0,0,0,
  2987.    HT_UNITY, HF_UNITY, WINFRAC,
  2988.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, UNITYFP,   XYAXIS,
  2989.    UnityFractal, long_julia_per_pixel,UnitySetup,StandardFractal,NOBAILOUT,
  2990.  
  2991.    "mandel4", realz0, imagz0,"","",0,0,0,0,
  2992.    HT_MANDJUL4, HF_MANDEL4, WINFRAC,
  2993.    -2.0,  2.0, -1.5,  1.5, 1, JULIA4,      NOFRACTAL, NOFRACTAL,  XAXIS_NOPARM,
  2994.    Mandel4Fractal,  mandel_per_pixel, MandellongSetup, StandardFractal,  STDBAILOUT,
  2995.  
  2996.    "julia4", realparm, imagparm,"","",0.6,0.55,0,0,
  2997.    HT_MANDJUL4, HF_JULIA4, WINFRAC,
  2998.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MANDEL4, NOFRACTAL, ORIGIN,
  2999.    Mandel4Fractal,   julia_per_pixel, JulialongSetup,StandardFractal,     STDBAILOUT,
  3000.  
  3001.    "ifs",    "","","","",0,0,0,0,
  3002.    HT_IFS, -1, NOGUESS+NOTRACE+NORESUME+WINFRAC,
  3003.    -8.0,  8.0, -1.0, 11.0, 16, NOFRACTAL, NOFRACTAL, NOFRACTAL,  NOSYM,
  3004.    NULL,      NULL,      StandaloneSetup, ifs,    NOBAILOUT,
  3005.  
  3006.    "*ifs3d", "","","","",0,0,0,0,
  3007.    HT_IFS, -1, NOGUESS+NOTRACE+NORESUME+WINFRAC+PARMS3D,
  3008.    -11.0,  11.0, -11.0, 11.0, 16, NOFRACTAL, NOFRACTAL, NOFRACTAL,   NOSYM,
  3009.    NULL,      NULL,      StandaloneSetup, ifs,    NOBAILOUT,
  3010.  
  3011.    "barnsleym3",  realz0, imagz0,"","",0,0,0,0,
  3012.    HT_BARNS, HF_BARNSM3, WINFRAC,
  3013.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ3,NOFRACTAL, BARNSLEYM3FP,  XAXIS_NOPARM,
  3014.    Barnsley3Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  3015.  
  3016.    "barnsleyj3",  realparm, imagparm,"","",0.1,0.36,0,0,
  3017.    HT_BARNS, HF_BARNSJ3, WINFRAC,
  3018.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, BARNSLEYM3, BARNSLEYJ3FP,  NOSYM,
  3019.    Barnsley3Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  3020.  
  3021.    "fn(z*z)", "","","","",0,0,0,0,
  3022.    HT_SCOTSKIN, HF_FNZTIMESZ, TRIG1+WINFRAC,
  3023.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, TRIGSQRFP,XYAXIS,
  3024.    TrigZsqrdFractal,   julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  3025.  
  3026.    "*fn(z*z)", "","","","",0,0,0,0,
  3027.    HT_SCOTSKIN, HF_FNZTIMESZ, TRIG1+WINFRAC,
  3028.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, TRIGSQR,XYAXIS,
  3029.    TrigZsqrdfpFractal,     juliafp_per_pixel, JuliafpSetup,  StandardFractal,STDBAILOUT,
  3030.  
  3031.    "*bifurcation","", "","","",0,0,0,0,
  3032.    HT_BIF, HF_BIFURCATION, NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3033.    1.9,  3.0, 0,  1.34, 0, NOFRACTAL, NOFRACTAL, LBIFURCATION, NOSYM,
  3034.    BifurcVerhulst, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3035.  
  3036.    "*fn+fn",recoeftrg1,imcoeftrg1,recoeftrg2,imcoeftrg2,1,0,1,0,
  3037.    HT_SCOTSKIN, HF_FNPLUSFN, TRIG2+WINFRAC,
  3038.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, TRIGPLUSTRIG,XAXIS,
  3039.    TrigPlusTrigfpFractal, otherjuliafp_per_pixel, TrigPlusTrigfpSetup,    StandardFractal,LTRIGBAILOUT,
  3040.  
  3041.    "fn*fn", "","","","",0,0,0,0,
  3042.    HT_SCOTSKIN, HF_FNTIMESFN, TRIG2+WINFRAC,
  3043.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, TRIGXTRIGFP,PI,
  3044.    TrigXTrigFractal, long_julia_per_pixel, FnXFnSetup,    StandardFractal,LTRIGBAILOUT,
  3045.  
  3046.    "*fn*fn", "","","","",0,0,0,0,
  3047.    HT_SCOTSKIN, HF_FNTIMESFN, TRIG2+WINFRAC,
  3048.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, TRIGXTRIG,PI,
  3049.    TrigXTrigfpFractal, otherjuliafp_per_pixel, FnXFnSetup,  StandardFractal,LTRIGBAILOUT,
  3050.  
  3051.    "sqr(1/fn)","","","","",0,0,0,0,
  3052.    HT_SCOTSKIN, HF_SQROVFN, TRIG1+WINFRAC,
  3053.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, SQR1OVERTRIGFP,NOSYM,
  3054.    Sqr1overTrigFractal, long_julia_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  3055.  
  3056.    "*sqr(1/fn)","","","","",0,0,0,0,
  3057.    HT_SCOTSKIN, HF_SQROVFN, TRIG1+WINFRAC,
  3058.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, SQR1OVERTRIG,NOSYM,
  3059.    Sqr1overTrigfpFractal, otherjuliafp_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  3060.  
  3061.    "fn*z+z",recoeftrg1, imcoeftrg1, recoef2nd,imcoef2nd,1,0,1,0,
  3062.    HT_SCOTSKIN, HF_FNXZPLUSZ, TRIG1+WINFRAC,
  3063.    -4.0,  4.0, -3.0,  3.0, 1, NOFRACTAL, NOFRACTAL, ZXTRIGPLUSZFP,XAXIS,
  3064.    ZXTrigPlusZFractal,julia_per_pixel,ZXTrigPlusZSetup,  StandardFractal,LTRIGBAILOUT,
  3065.  
  3066.    "*fn*z+z",recoeftrg1, imcoeftrg2, recoef2nd,imcoef2nd,1,0,1,0,
  3067.    HT_SCOTSKIN, HF_FNXZPLUSZ, TRIG1+WINFRAC,
  3068.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, ZXTRIGPLUSZ,XAXIS,
  3069.    ZXTrigPlusZfpFractal,   juliafp_per_pixel, ZXTrigPlusZSetup,  StandardFractal,LTRIGBAILOUT,
  3070.  
  3071.    "*kamtorus",kamangle,kamstep,kamstop,pointsperorbit,1.3,.05,1.5,150,
  3072.    HT_KAM, HF_KAM, NOGUESS+NOTRACE+WINFRAC,
  3073.    -1.0,  1.0, -.75, .75, 0, NOFRACTAL, NOFRACTAL, KAM,   NOSYM,
  3074.    kamtorusfloatorbit, NULL, orbit3dfloatsetup, orbit2dfloat, NOBAILOUT,
  3075.  
  3076.    "kamtorus",kamangle,kamstep,kamstop,pointsperorbit,1.3,.05,1.5,150,
  3077.    HT_KAM, HF_KAM, NOGUESS+NOTRACE+WINFRAC,
  3078.    -1.0,  1.0, -.75, .75,16, NOFRACTAL, NOFRACTAL, KAMFP, NOSYM,
  3079.    kamtoruslongorbit,  NULL, orbit3dlongsetup, orbit2dlong,   NOBAILOUT,
  3080.  
  3081.    "*kamtorus3d",kamangle,kamstep,kamstop,pointsperorbit,1.3,.05,1.5,150,
  3082.    HT_KAM, HF_KAM, NOGUESS+NOTRACE+NORESUME+WINFRAC+PARMS3D,
  3083.    -3.0,  3.0, -1, 3.5, 0, NOFRACTAL, NOFRACTAL, KAM3D,   NOSYM,
  3084.    kamtorusfloatorbit, NULL, orbit3dfloatsetup, orbit3dfloat, NOBAILOUT,
  3085.  
  3086.    "kamtorus3d",kamangle,kamstep,kamstop,pointsperorbit,1.3,.05,1.5,150,
  3087.    HT_KAM, HF_KAM, NOGUESS+NOTRACE+NORESUME+WINFRAC+PARMS3D,
  3088.    -3.0,  3.0, -1, 3.5,16, NOFRACTAL, NOFRACTAL, KAM3DFP, NOSYM,
  3089.    kamtoruslongorbit,  NULL, orbit3dlongsetup, orbit3dlong,   NOBAILOUT,
  3090.  
  3091.    "lambdafn",     realparm, imagparm,"","",1.0,0.4,0,0,
  3092.    HT_LAMBDAFN, HF_LAMBDAFN, TRIG1+WINFRAC,
  3093.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, MANDELTRIG, LAMBDATRIGFP,PI_SYM,
  3094.    LambdaTrigFractal,long_julia_per_pixel, LambdaTrigSetup,    StandardFractal,LTRIGBAILOUT,
  3095.  
  3096.    "manfn+zsqrd",  realz0, imagz0,"","",0,0,0,0,
  3097.    HT_PICKMJ, HF_MANDFNPLUSZSQRD, TRIG1+WINFRAC,
  3098.    -2.5,  1.5, -1.5,  1.5, 16, LJULTRIGPLUSZSQRD,  NOFRACTAL, FPMANTRIGPLUSZSQRD, XAXIS_NOPARM,
  3099.    TrigPlusZsquaredFractal,mandel_per_pixel,MandellongSetup,StandardFractal, STDBAILOUT,
  3100.  
  3101.    "julfn+zsqrd",  realparm, imagparm,"","",-0.5,0.5,0,0,
  3102.    HT_PICKMJ, HF_JULFNPLUSZSQRD, TRIG1+WINFRAC,
  3103.    -2.0,  2.0, -1.5,  1.5, 16, NOFRACTAL, LMANTRIGPLUSZSQRD, FPJULTRIGPLUSZSQRD,    NOSYM,
  3104.    TrigPlusZsquaredFractal,julia_per_pixel, JuliafnPlusZsqrdSetup,StandardFractal, STDBAILOUT,
  3105.  
  3106.    "*manfn+zsqrd", realz0, imagz0,"","",0,0,0,0,
  3107.    HT_PICKMJ, HF_MANDFNPLUSZSQRD, TRIG1+WINFRAC,
  3108.    -2.5,  1.5, -1.5,  1.5, 0, FPJULTRIGPLUSZSQRD,   NOFRACTAL, LMANTRIGPLUSZSQRD, XAXIS_NOPARM,
  3109.    TrigPlusZsquaredfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal, STDBAILOUT,
  3110.  
  3111.    "*julfn+zsqrd", realparm, imagparm,"","",-0.5,0.5,0,0,
  3112.    HT_PICKMJ, HF_JULFNPLUSZSQRD, TRIG1+WINFRAC,
  3113.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, FPMANTRIGPLUSZSQRD, LJULTRIGPLUSZSQRD, NOSYM,
  3114.    TrigPlusZsquaredfpFractal, juliafp_per_pixel,  JuliafnPlusZsqrdSetup,StandardFractal, STDBAILOUT,
  3115.  
  3116.    "*lambdafn",  realparm, imagparm,"","",1.0,0.4,0,0,
  3117.    HT_LAMBDAFN, HF_LAMBDAFN, TRIG1+WINFRAC,
  3118.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, MANDELTRIGFP, LAMBDATRIG, PI_SYM,
  3119.    LambdaTrigfpFractal,otherjuliafp_per_pixel,LambdaTrigSetup,StandardFractal,FTRIGBAILOUT,
  3120.  
  3121.    "mandelfn",realz0, imagz0,"","", 0,0,0,0,
  3122.    HT_MANDFN, HF_MANDFN, TRIG1+WINFRAC,
  3123.    -8.0,  8.0, -6.0,  6.0, 16, LAMBDATRIG, NOFRACTAL, MANDELTRIGFP, XYAXIS_NOPARM,
  3124.    LambdaTrigFractal,long_mandel_per_pixel,MandelTrigSetup,StandardFractal,LTRIGBAILOUT,
  3125.  
  3126.    "manzpower", realz0, imagz0, exponent,imexponent,0,0,2,0,
  3127.    HT_PICKMJ, HF_MANZPOWER, WINFRAC,
  3128.    -2.0,  2.0, -1.5,  1.5, 1, LJULIAZPOWER, NOFRACTAL, FPMANDELZPOWER,    XAXIS,
  3129.    longZpowerFractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  3130.  
  3131.    "julzpower", realparm, imagparm, exponent,imexponent,0.3,0.6,2,0,
  3132.    HT_PICKMJ, HF_JULZPOWER, WINFRAC,
  3133.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, LMANDELZPOWER, FPJULIAZPOWER,     ORIGIN,
  3134.    longZpowerFractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  3135.  
  3136.    "*manzpower", realz0, imagz0, exponent,imexponent,0,0,2,0,
  3137.    HT_PICKMJ, HF_MANZPOWER, WINFRAC,
  3138.    -2.5,  1.5, -1.5,  1.5, 0, FPJULIAZPOWER,   NOFRACTAL, LMANDELZPOWER,  XAXIS_NOPARM,
  3139.    floatZpowerFractal,othermandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  3140.  
  3141.    "*julzpower", realparm, imagparm, exponent,imexponent,0.3,0.6,2,0,
  3142.    HT_PICKMJ, HF_JULZPOWER, WINFRAC,
  3143.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, FPMANDELZPOWER, LJULIAZPOWER,    ORIGIN,
  3144.    floatZpowerFractal, otherjuliafp_per_pixel,    JuliafpSetup,StandardFractal,STDBAILOUT,
  3145.  
  3146.    "manzzpwr", realz0, imagz0, exponent,"",0,0,2,0,
  3147.    HT_PICKMJ, HF_MANZZPWR, WINFRAC,
  3148.    -2.5,  1.5, -1.5,  1.5, 0, FPJULZTOZPLUSZPWR,   NOFRACTAL, NOFRACTAL,  XAXIS_NOPARM,
  3149.    floatZtozPluszpwrFractal,othermandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  3150.  
  3151.    "julzzpwr", realparm, imagparm, exponent,"",-0.3,0.3,2,0,
  3152.    HT_PICKMJ, HF_JULZZPWR, WINFRAC,
  3153.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, FPMANZTOZPLUSZPWR, NOFRACTAL,    NOSYM,
  3154.    floatZtozPluszpwrFractal, otherjuliafp_per_pixel,  JuliafpSetup,StandardFractal,STDBAILOUT,
  3155.  
  3156.    "manfn+exp",realz0, imagz0,"","",0,0,0,0,
  3157.    HT_PICKMJ, HF_MANDFNPLUSEXP, TRIG1+WINFRAC,
  3158.    -8.0,  8.0, -6.0,  6.0, 16, LJULTRIGPLUSEXP,    NOFRACTAL,  FPMANTRIGPLUSEXP, XAXIS_NOPARM,
  3159.    LongTrigPlusExponentFractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  3160.  
  3161.    "julfn+exp", realparm, imagparm,"","",0,0,0,0,
  3162.    HT_PICKMJ, HF_JULFNPLUSEXP, TRIG1+WINFRAC,
  3163.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, LMANTRIGPLUSEXP,FPJULTRIGPLUSEXP, NOSYM,
  3164.    LongTrigPlusExponentFractal,   long_julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  3165.  
  3166.    "*manfn+exp", realz0, imagz0,"","",0,0,0,0,
  3167.    HT_PICKMJ, HF_MANDFNPLUSEXP, TRIG1+WINFRAC,
  3168.    -8.0,  8.0, -6.0,  6.0, 0, FPJULTRIGPLUSEXP, NOFRACTAL, LMANTRIGPLUSEXP,   XAXIS_NOPARM,
  3169.    FloatTrigPlusExponentFractal,othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3170.  
  3171.    "*julfn+exp", realparm, imagparm,"","",0,0,0,0,
  3172.    HT_PICKMJ, HF_JULFNPLUSEXP, TRIG1+WINFRAC,
  3173.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, FPMANTRIGPLUSEXP, LJULTRIGPLUSEXP,   NOSYM,
  3174.    FloatTrigPlusExponentFractal,otherjuliafp_per_pixel,JuliafpSetup,StandardFractal,STDBAILOUT,
  3175.  
  3176.    "*popcorn", step, "", "","",0.05,0,0,0,
  3177.    HT_POPCORN, HF_POPCORN, NOGUESS+NOTRACE+WINFRAC,
  3178.    -3.0,  3.0, -2.2,  2.2, 0, NOFRACTAL, NOFRACTAL, LPOPCORN,  NOPLOT,
  3179.    PopcornFractal, otherjuliafp_per_pixel,  JuliafpSetup,  popcorn,STDBAILOUT,
  3180.  
  3181.    "popcorn", step, "", "","",0.05,0,0,0,
  3182.    HT_POPCORN, HF_POPCORN, NOGUESS+NOTRACE+WINFRAC,
  3183.    -3.0,  3.0, -2.2,  2.2, 16, NOFRACTAL, NOFRACTAL, FPPOPCORN,  NOPLOT,
  3184.    LPopcornFractal,   long_julia_per_pixel, JulialongSetup,popcorn,STDBAILOUT,
  3185.  
  3186.    "*lorenz",timestep,"a","b", "c",.02,5,15,1,
  3187.    HT_LORENZ, HF_LORENZ, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  3188.    -15,  15, 0, 30, 0, NOFRACTAL, NOFRACTAL, LLORENZ,    NOSYM,
  3189.    lorenz3dfloatorbit, NULL,         orbit3dfloatsetup, orbit2dfloat,     NOBAILOUT,
  3190.  
  3191.    "lorenz",timestep,"a","b", "c",.02,5,15,1,
  3192.    HT_LORENZ, HF_LORENZ, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  3193.    -15,  15, 0, 30, 16, NOFRACTAL, NOFRACTAL, FPLORENZ,   NOSYM,
  3194.    lorenz3dlongorbit, NULL,        orbit3dlongsetup, orbit2dlong,    NOBAILOUT,
  3195.  
  3196.    "lorenz3d",timestep,"a","b", "c",.02,5,15,1,
  3197.    HT_LORENZ, HF_LORENZ, NOGUESS+NOTRACE+NORESUME+WINFRAC+PARMS3D,
  3198.    -30.0,  30.0,  -30.0,   30.0, 16, NOFRACTAL, NOFRACTAL, FPLORENZ3D,     NOSYM,
  3199.    lorenz3dlongorbit, NULL,        orbit3dlongsetup, orbit3dlong,    NOBAILOUT,
  3200.  
  3201.    "newton",    newtdegree,"", "","",3,0,0,0,
  3202.    HT_NEWT, HF_NEWT, WINFRAC,
  3203.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NEWTON,   XAXIS,
  3204.    MPCNewtonFractal, MPCjulia_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  3205.  
  3206.    "newtbasin", newtdegree,stripes, "","",0,0,0,0,
  3207.    HT_NEWTBAS, HF_NEWTBAS, WINFRAC,
  3208.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NEWTBASIN,     NOSYM,
  3209.    MPCNewtonFractal, MPCjulia_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  3210.  
  3211.    "complexnewton", realdegree,imagdegree,realroot,imagroot,3,0,1,0,
  3212.    HT_NEWTCMPLX, HF_COMPLEXNEWT, WINFRAC,
  3213.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  3214.    ComplexNewton, otherjuliafp_per_pixel,  ComplexNewtonSetup, StandardFractal,NOBAILOUT,
  3215.  
  3216.    "complexbasin", realdegree,imagdegree,realroot,imagroot,3,0,1,0,
  3217.    HT_NEWTCMPLX, HF_COMPLEXNEWT, WINFRAC,
  3218.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  3219.    ComplexBasin, otherjuliafp_per_pixel,  ComplexNewtonSetup,  StandardFractal, NOBAILOUT,
  3220.  
  3221.    "cmplxmarksmand", realz0, imagz0, realdegree, imagdegree,0,0,1,0,
  3222.    HT_MARKS, HF_CMPLXMARKSMAND, WINFRAC,
  3223.    -2.0,  2.0, -1.5,  1.5, 0, COMPLEXMARKSJUL, NOFRACTAL, NOFRACTAL,   NOSYM,
  3224.    MarksCplxMand, MarksCplxMandperp, MandelfpSetup, StandardFractal, STDBAILOUT,
  3225.  
  3226.    "cmplxmarksjul", realparm, imagparm, realdegree, imagdegree,0.3,0.6,1,0,
  3227.    HT_MARKS, HF_CMPLXMARKSJUL, WINFRAC,
  3228.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, COMPLEXMARKSMAND, NOFRACTAL,    NOSYM,
  3229.    MarksCplxMand, juliafp_per_pixel, JuliafpSetup, StandardFractal, STDBAILOUT,
  3230.  
  3231.    "formula", p1real, p1imag, p2real, p2imag, 0,0,0,0,
  3232.    HT_FORMULA, -2, WINFRAC,
  3233.    -2.0, 2.0, -1.5, 1.5, 1, NOFRACTAL, NOFRACTAL, FFORMULA, SETUP_SYM,
  3234.    Formula, form_per_pixel, intFormulaSetup, StandardFractal, 0,
  3235.  
  3236.    "*formula", p1real, p1imag, p2real, p2imag, 0,0,0,0,
  3237.    HT_FORMULA, -2, WINFRAC,
  3238.    -2.0, 2.0, -1.5, 1.5, 0, NOFRACTAL, NOFRACTAL, FORMULA, SETUP_SYM,
  3239.    Formula, form_per_pixel, fpFormulaSetup, StandardFractal, 0,
  3240.  
  3241.    "*sierpinski",  "","","","",0,0,0,0,
  3242.    HT_SIER, HF_SIER, WINFRAC,
  3243.    -0.9,  1.7, -0.9,  1.7, 0, NOFRACTAL, NOFRACTAL, SIERPINSKI,   NOSYM,
  3244.    SierpinskiFPFractal, otherjuliafp_per_pixel, SierpinskiFPSetup,StandardFractal,127.0,
  3245.  
  3246.    "*lambda", realparm, imagparm,"","",0.85,0.6,0,0,
  3247.    HT_LAMBDA, HF_LAMBDA, WINFRAC,
  3248.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, MANDELLAMBDAFP, LAMBDA,  NOSYM,
  3249.    LambdaFPFractal,   juliafp_per_pixel, JuliafpSetup,    StandardFractal,STDBAILOUT,
  3250.  
  3251.    "*barnsleym1", realz0, imagz0,"","",0,0,0,0,
  3252.    HT_BARNS, HF_BARNSM1, WINFRAC,
  3253.    -2.0,  2.0, -1.5,  1.5, 0, BARNSLEYJ1FP,NOFRACTAL, BARNSLEYM1,  XYAXIS_NOPARM,
  3254.    Barnsley1FPFractal, othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3255.  
  3256.    "*barnsleyj1", realparm, imagparm,"","",0.6,1.1,0,0,
  3257.    HT_BARNS, HF_BARNSJ1, WINFRAC,
  3258.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, BARNSLEYM1FP, BARNSLEYJ1,  ORIGIN,
  3259.    Barnsley1FPFractal, otherjuliafp_per_pixel,JuliafpSetup,StandardFractal,STDBAILOUT,
  3260.  
  3261.    "*barnsleym2", realz0, imagz0,"","",0,0,0,0,
  3262.    HT_BARNS, HF_BARNSM2, WINFRAC,
  3263.    -2.0,  2.0, -1.5,  1.5, 0, BARNSLEYJ2FP,NOFRACTAL, BARNSLEYM2,  YAXIS_NOPARM,
  3264.    Barnsley2FPFractal,othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3265.  
  3266.    "*barnsleyj2", realparm, imagparm,"","",0.6,1.1,0,0,
  3267.    HT_BARNS, HF_BARNSJ2, WINFRAC,
  3268.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, BARNSLEYM2FP, BARNSLEYJ2,  ORIGIN,
  3269.    Barnsley2FPFractal,otherjuliafp_per_pixel,JuliafpSetup,StandardFractal,STDBAILOUT,
  3270.  
  3271.    "*barnsleym3", realz0, imagz0,"","",0,0,0,0,
  3272.    HT_BARNS, HF_BARNSM3, WINFRAC,
  3273.    -2.0,  2.0, -1.5,  1.5, 0, BARNSLEYJ3FP, NOFRACTAL, BARNSLEYM3,  XAXIS_NOPARM,
  3274.    Barnsley3FPFractal,othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3275.  
  3276.    "*barnsleyj3", realparm, imagparm,"","",0.6,1.1,0,0,
  3277.    HT_BARNS, HF_BARNSJ3, WINFRAC,
  3278.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, BARNSLEYM3FP, BARNSLEYJ3,  XAXIS,
  3279.    Barnsley3FPFractal,otherjuliafp_per_pixel,JuliafpSetup,StandardFractal,STDBAILOUT,
  3280.  
  3281.    "*mandellambda",realz0, imagz0,"","",0,0,0,0,
  3282.    HT_MLAMBDA, HF_MLAMBDA, WINFRAC,
  3283.    -3.0,  5.0, -3.0,  3.0, 0, LAMBDAFP, NOFRACTAL, MANDELLAMBDA,  XAXIS_NOPARM,
  3284.    LambdaFPFractal,mandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3285.  
  3286.    "julibrot", "","","","",-.83,-.83,.25,-.25,
  3287.    HT_JULIBROT, -1, NOGUESS+NOTRACE+NOROTATE+NORESUME+WINFRAC,
  3288.    -2.0, 2.0, -1.5, 1.5, 1, NOFRACTAL, NOFRACTAL, NOFRACTAL, NOSYM,
  3289.    JuliaFractal, jb_per_pixel, JulibrotSetup, Std4dFractal, NOBAILOUT,
  3290.  
  3291.    "*lorenz3d",timestep,"a","b","c",.02,5,15,1,
  3292.    HT_LORENZ, HF_LORENZ, NOGUESS+NOTRACE+NORESUME+WINFRAC+PARMS3D,
  3293.    -30.0,  30.0,  -30.0,   30.0, 0, NOFRACTAL, NOFRACTAL, LLORENZ3D,   NOSYM,
  3294.    lorenz3dfloatorbit, NULL,         orbit3dfloatsetup, orbit3dfloat,     NOBAILOUT,
  3295.  
  3296.    "rossler3d",timestep,"a","b","c",.04,.2,.2,5.7,
  3297.    HT_ROSS, HF_ROSS, NOGUESS+NOTRACE+NORESUME+WINFRAC+PARMS3D,
  3298.    -30.0,  30.0,  -20.0,   40.0, 16, NOFRACTAL, NOFRACTAL, FPROSSLER,    NOSYM,
  3299.    rosslerlongorbit, NULL,       orbit3dlongsetup, orbit3dlong,    NOBAILOUT,
  3300.  
  3301.    "*rossler3d",timestep,"a","b","c",.04,.2,.2,5.7,
  3302.    HT_ROSS, HF_ROSS, NOGUESS+NOTRACE+NORESUME+WINFRAC+PARMS3D,
  3303.    -30.0,  30.0,  -20.0,   40.0, 0, NOFRACTAL, NOFRACTAL, LROSSLER,   NOSYM,
  3304.    rosslerfloatorbit, NULL,        orbit3dfloatsetup, orbit3dfloat,    NOBAILOUT,
  3305.  
  3306.    "henon","a","b","","",1.4,.3,0,0,
  3307.    HT_HENON, HF_HENON, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  3308.    -1.4,  1.4,    -.5,   .5, 16, NOFRACTAL, NOFRACTAL, FPHENON,    NOSYM,
  3309.    henonlongorbit, NULL,     orbit3dlongsetup, orbit2dlong,    NOBAILOUT,
  3310.  
  3311.    "*henon","a","b","","",1.4,.3,0,0,
  3312.    HT_HENON, HF_HENON, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  3313.    -1.4,  1.4,    -.5,   .5, 0, NOFRACTAL, NOFRACTAL, LHENON,   NOSYM,
  3314.    henonfloatorbit, NULL,      orbit3dfloatsetup, orbit2dfloat,    NOBAILOUT,
  3315.  
  3316.    "pickover","a","b","c","d",2.24,.43,-.65,-2.43,
  3317.    HT_PICK, HF_PICKOVER, NOGUESS+NOTRACE+NORESUME+WINFRAC+PARMS3D,
  3318.    -2.8,  2.8,    -2.0, 2.0, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  3319.    pickoverfloatorbit, NULL,         orbit3dfloatsetup, orbit3dfloat,     NOBAILOUT,
  3320.  
  3321.    "gingerbreadman",initx,inity,"","",-.1,0,0,0,
  3322.    HT_GINGER, HF_GINGER, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  3323.    -4.5,  8.5,    -4.5, 8.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  3324.    gingerbreadfloatorbit, NULL, orbit3dfloatsetup, orbit2dfloat,    NOBAILOUT,
  3325.  
  3326.    "diffusion", "Border size","","", "",10,0,0,0,
  3327.    HT_DIFFUS, HF_DIFFUS, NOZOOM+NOGUESS+NOTRACE+WINFRAC,
  3328.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  3329.    NULL,   NULL,     StandaloneSetup, diffusion,    NOBAILOUT,
  3330.  
  3331.    "*unity", "","","","",0,0,0,0,
  3332.    HT_UNITY, HF_UNITY, WINFRAC,
  3333.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, UNITY,   XYAXIS,
  3334.    UnityfpFractal, otherjuliafp_per_pixel,StandardSetup,StandardFractal,NOBAILOUT,
  3335.  
  3336.    "*spider", realz0, imagz0,"","",0,0,0,0,
  3337.    HT_SCOTSKIN, HF_SPIDER, WINFRAC,
  3338.    -2.5,  1.5, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, SPIDER,  XAXIS_NOPARM,
  3339.    SpiderfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  3340.  
  3341.    "spider",  realz0, imagz0,"","",0,0,0,0,
  3342.    HT_SCOTSKIN, HF_SPIDER, WINFRAC,
  3343.    -2.5,  1.5, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, SPIDERFP,  XAXIS_NOPARM,
  3344.    SpiderFractal,mandel_per_pixel, MandellongSetup,StandardFractal,STDBAILOUT,
  3345.  
  3346.    "tetrate", realz0, imagz0,"","",0,0,0,0,
  3347.    HT_SCOTSKIN, HF_TETRATE, WINFRAC,
  3348.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,    XAXIS,
  3349.    TetratefpFractal,othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3350.  
  3351.    "magnet1m", realz0, imagz0,"","",0,0,0,0,
  3352.    HT_MAGNET, HF_MAGM1, WINFRAC,
  3353.    -4.0, 4.0, -3.0, 3.0, 0, MAGNET1J,NOFRACTAL,NOFRACTAL, XAXIS_NOPARM,
  3354.    Magnet1Fractal,mandelfp_per_pixel,MandelfpSetup,StandardFractal,100.0,
  3355.  
  3356.    "magnet1j", realparm, imagparm,"","",0,0,0,0,
  3357.    HT_MAGNET, HF_MAGJ1, WINFRAC,
  3358.    -8.0,  8.0, -6.0,  6.0, 0, NOFRACTAL,MAGNET1M,NOFRACTAL, XAXIS_NOIMAG,
  3359.    Magnet1Fractal,juliafp_per_pixel,JuliafpSetup,StandardFractal,100.0,
  3360.  
  3361.    "magnet2m", realz0, imagz0,"","",0,0,0,0,
  3362.    HT_MAGNET, HF_MAGM2, WINFRAC,
  3363.    -1.5,3.7, -1.95,1.95,   0, MAGNET2J,NOFRACTAL,NOFRACTAL, XAXIS_NOPARM,
  3364.    Magnet2Fractal,mandelfp_per_pixel,MandelfpSetup,StandardFractal,100.0,
  3365.  
  3366.    "magnet2j", realparm, imagparm,"","",0,0,0,0,
  3367.    HT_MAGNET, HF_MAGJ2, WINFRAC,
  3368.    -8.0,  8.0, -6.0,  6.0, 0, NOFRACTAL,MAGNET2M,NOFRACTAL, XAXIS_NOIMAG,
  3369.    Magnet2Fractal,juliafp_per_pixel,JuliafpSetup,StandardFractal,100.0,
  3370.  
  3371.    "bifurcation", "", "","","",0,0,0,0,
  3372.    HT_BIF, HF_BIFURCATION, NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3373.    1.9,  3.0, 0,  1.34, 1, NOFRACTAL, NOFRACTAL, BIFURCATION, NOSYM,
  3374.    LongBifurcVerhulst, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3375.  
  3376.    "biflambda", "", "","","",0,0,0,0,
  3377.    HT_BIF, HF_BIFLAMBDA, NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3378.    -2.0, 4.0, -1.0, 2.0, 1, NOFRACTAL, NOFRACTAL, BIFLAMBDA,   NOSYM,
  3379.    LongBifurcLambda, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3380.  
  3381.    "*biflambda", "", "","","",0,0,0,0,
  3382.    HT_BIF, HF_BIFLAMBDA, NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3383.    -2.0, 4.0, -1.0, 2.0, 0, NOFRACTAL, NOFRACTAL, LBIFLAMBDA,  NOSYM,
  3384.    BifurcLambda, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3385.  
  3386.    "*bif+sinpi", "", "","","",0,0,0,0,
  3387.    HT_BIF, HF_BIFPLUSSINPI, NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3388.    0.275,1.45, 0.0, 2.0, 0, NOFRACTAL, NOFRACTAL, LBIFADSINPI,     NOSYM,
  3389.    BifurcAddSinPi, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3390.  
  3391.    "*bif=sinpi", "", "","","",0,0,0,0,
  3392.    HT_BIF, HF_BIFEQSINPI, NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3393.    -2.5, 2.5, -3.5, 3.5, 0, NOFRACTAL, NOFRACTAL, LBIFEQSINPI,     NOSYM,
  3394.    BifurcSetSinPi, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3395.  
  3396.    "*popcornjul", step, "", "","",0.05,0,0,0,
  3397.    HT_POPCORN, HF_POPCJUL, WINFRAC,
  3398.    -3.0,  3.0, -2.2,  2.2, 0, NOFRACTAL, NOFRACTAL, LPOPCORNJUL,  ORIGIN,
  3399.    PopcornFractal, otherjuliafp_per_pixel,  JuliafpSetup,StandardFractal,STDBAILOUT,
  3400.  
  3401.    "popcornjul", step, "", "","",0.05,0,0,0,
  3402.    HT_POPCORN, HF_POPCJUL, WINFRAC,
  3403.    -3.0,  3.0, -2.2,  2.2, 16, NOFRACTAL, NOFRACTAL, FPPOPCORNJUL,  ORIGIN,
  3404.    LPopcornFractal,   long_julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  3405.  
  3406.    "lsystem", "Order","","","",2,0,0,0,
  3407.    HT_LSYS, -3, NOZOOM+NORESUME+NOGUESS+NOTRACE+WINFRAC,
  3408.    -1, 1, -1, 1, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL, NOSYM,
  3409.    NULL, NULL, StandaloneSetup, Lsystem, NOBAILOUT,
  3410.  
  3411.    "*manowarj", realparm, imagparm,"","",0,0,0,0,
  3412.    HT_SCOTSKIN, HF_MANOWARJ, WINFRAC,
  3413.    -2.5,  1.5, -1.5, 1.5, 0, NOFRACTAL, MANOWARFP, MANOWARJ,   NOSYM,
  3414.    ManOWarfpFractal,juliafp_per_pixel, JuliafpSetup,StandardFractal,STDBAILOUT,
  3415.  
  3416.    "manowarj",  realparm, imagparm,"","",0,0,0,0,
  3417.    HT_SCOTSKIN, HF_MANOWARJ, WINFRAC,
  3418.    -2.5,  1.5, -1.5, 1.5, 1, NOFRACTAL, MANOWAR,   MANOWARJFP, NOSYM,
  3419.    ManOWarFractal,julia_per_pixel, JulialongSetup,StandardFractal,STDBAILOUT,
  3420.  
  3421.    "*fn(z)+fn(pix)", realz0,imagz0,recoeftrg2,imcoeftrg2,0,0,1,0,
  3422.    -1, HF_FNPLUSFNPIX, TRIG2,
  3423.    -2.5,  1.5, -1.5, 1.5, 0, NOFRACTAL, NOFRACTAL, FNPLUSFNPIXLONG, NOSYM,
  3424.    Richard8fpFractal,otherrichard8fp_per_pixel, MandelfpSetup,StandardFractal,LTRIGBAILOUT,
  3425.  
  3426.    "fn(z)+fn(pix)",  realz0,imagz0,recoeftrg2,imcoeftrg2,0,0,1,0,
  3427.    -1, HF_FNPLUSFNPIX, TRIG2,
  3428.    -2.5,  1.5, -1.5, 1.5, 1, NOFRACTAL, NOFRACTAL, FNPLUSFNPIXFP, NOSYM,
  3429.    Richard8Fractal,long_richard8_per_pixel, MandellongSetup,StandardFractal,LTRIGBAILOUT,
  3430.  
  3431.    "*marksmandelpwr", realz0, imagz0,"","",0,0,0,0,
  3432.    -1, HF_MARKSMANDPWR, TRIG1+WINFRAC,
  3433.    -2.5,  1.5, -1.5, 1.5, 0, NOFRACTAL, NOFRACTAL, MARKSMANDELPWR, XAXIS_NOPARM,
  3434.    MarksMandelPwrfpFractal,marks_mandelpwrfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  3435.  
  3436.    "marksmandelpwr",  realz0, imagz0,"","",0,0,0,0,
  3437.    -1, HF_MARKSMANDPWR, TRIG1+WINFRAC,
  3438.    -2.5,  1.5, -1.5,  1.5, 1, NOFRACTAL,     NOFRACTAL, MARKSMANDELPWRFP,  XAXIS_NOPARM,
  3439.    MarksMandelPwrFractal,marks_mandelpwr_per_pixel, MandelSetup,StandardFractal,STDBAILOUT,
  3440.  
  3441.    "*tim's_error",    realz0, imagz0,"","",0,0,0,0,
  3442.    -1, HF_TIMSERR, WINFRAC+TRIG1,
  3443.    -2.5,  3.0, -2.0,  2.0, 0, NOFRACTAL,     NOFRACTAL, TIMSERROR,    XAXIS_NOPARM,
  3444.    TimsErrorfpFractal,marks_mandelpwrfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  3445.  
  3446.    "tim's_error",    realz0, imagz0,"","",0,0,0,0,
  3447.    -1, HF_TIMSERR, WINFRAC+TRIG1,
  3448.    -2.5,  3.0, -2.0,  2.0, 1, NOFRACTAL,     NOFRACTAL, TIMSERRORFP,  XAXIS_NOPARM,
  3449.    TimsErrorFractal,marks_mandelpwr_per_pixel, MandelSetup,StandardFractal,STDBAILOUT,
  3450.  
  3451.    "bif=sinpi", "", "","","",0,0,0,0,
  3452.    HT_BIF, HF_BIFEQSINPI, NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3453.    -2.5, 2.5, -3.5, 3.5, 16, NOFRACTAL, NOFRACTAL, BIFEQSINPI,     NOSYM,
  3454.    LongBifurcSetSinPi, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3455.  
  3456.    "bif+sinpi", "", "","","",0,0,0,0,
  3457.    HT_BIF, HF_BIFPLUSSINPI, NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3458.    0.275,1.45, 0.0, 2.0, 16, NOFRACTAL, NOFRACTAL, BIFADSINPI,     NOSYM,
  3459.    LongBifurcAddSinPi, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3460.  
  3461.    NULL, NULL, NULL, NULL, NULL,0,0,0,0,    /* marks the END of the list */
  3462.    -1, -1, 0,
  3463.    0,  0, 0,  0, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,   NOSYM,
  3464.    NULL, NULL, NULL, NULL,0
  3465. };
  3466.  
  3467.