/****************************************************************************
 * This formula file or any formula file derived from it cannot be used for
 * commercial purposes or to create hard copy output without the explicit
 * consent of the original author.
 ****************************************************************************/

fractal {

   // Establish the mapping between complex coordinates
   // and display coordinates

   mapping {
      (0.10114331846826950245,
       1.10571504464809788892,
       1.63392239999999744349,
       3.05502288421742607127) => (749,960)
   }


   formula
   {
      f_c    = log(current) ^ 5 - current;

      zvalue = sinh(f_c);

     
      $xmin = 0;
      $ymin = 0;
      $mmin = 0;

      $xmax = 0;
      $ymax = 0;
      $mmax = 0;

      $xtot = 0;
      $ytot = 0;
      $mtot = 0;

      zSum = [0, 0];

      while($count < 45 && ssq(zvalue - zSum) > 1e-6)
      {
         $number      = 2 * $count + 1;
         $denominator = fact($number);

         zSum += (f_c ^ $number) / $denominator;

         //value = sech(zSum);
         value = csch(zSum);

         $x = mag(value ^ 2);
         $y = mag(value ^ 3);
         $m = mag(value ^ 4);

         $xmin = min($x, $xmin);
         $ymin = min($y, $ymin);
         $mmin = min($m, $mmin);

         $xmax = max($x, $xmax);
         $ymax = max($y, $ymax);
         $mmax = max($m, $mmax);

         $xtot += $x;
         $ytot += $y;
         $mtot += $m;
      }



      $r = 0;
      $g = 0;
      $b = 0;

      if($count > 0)
      {
         $r = ($xtot / $count - $xmin) / ($xmax - $xmin);
         $g = ($ytot / $count - $ymin) / ($ymax - $ymin);
         $b = ($mtot / $count - $mmin) / ($mmax - $mmin);

         $r = get_sin_color($r, 215, 1);
         $g = get_sin_color($g, 215, 1);
         $b = get_sin_color($b, 215, 1);
      }

      set_color($r, $g, $b);
   }
}






























































