fractal 
{
  mapping {
      (-4,
       -4,
        4,
        4) => (180, 160)
   }


  colors 
  {
    define 
    {
      gradient(361) 
      {
        [255 255 255] [000 064 124] [128 120 000]
      }
    }
  }

  formula 
  {
    c     = current;
    LSum  = current;
    LSum1 = [1,0];
    maxit = [164, 0];

    K     = [0.133, 0];  // Constant
    P     = K;           // Population

    temp = 0;
    
    while ($count < real(maxit) && sum_of_squares(LSum1 - LSum) > 1e-14)
    {        
      LSum1 = LSum;
      temp = [fmod($count, 4), 0];

      if (real(temp) == 0)
      {
        K = real(c);
      }       

      if (real(temp) == 1)
      {
        K = real(c);
      }       

      if (real(temp) == 2)
      {
        K = imaginary(c);
      }     

      if (real(temp) == 3)
      {
        K = imaginary(c);
      }       

      P = K*P-K*P*P-K*P*P*P;
      LSum = LSum * (K-2*K*P-3*K*P*P);  // the derivative
    }

    set_color   ( $count*(360/real(maxit)));
  }
}




