public static void cDiv(double a,double b,double c,double d,double[] results){
  long aa, bb, cc, dd, ss;
  double t;
  int ha, hb, hc, hd, hz, hw, hs;
  aa=Double.doubleToRawLongBits(a);
  bb=Double.doubleToRawLongBits(b);
  ha=(int)((aa >> 32) & 0x7fffffff);
  hb=(int)((bb >> 32) & 0x7fffffff);
  hz=(ha > hb) ? ha : hb;
  cc=Double.doubleToRawLongBits(c);
  dd=Double.doubleToRawLongBits(d);
  hc=(int)((cc >> 32) & 0x7fffffff);
  hd=(int)((dd >> 32) & 0x7fffffff);
  hw=(hc > hd) ? hc : hd;
  if (hz < 0x07200000 && hw >= 0x32800000 && hw < 0x47100000) {
    hs=(((0x47100000 - hw) >> 1) & 0xfff00000) + 0x3ff00000;
  }
 else   hs=(((hw >> 2) - hw) + 0x6fd7ffff) & 0xfff00000;
  ss=((long)hs) << 32;
  double ssd=Double.longBitsToDouble(ss);
  c*=ssd;
  d*=ssd;
  t=1.0 / (c * c + d * d);
  c*=ssd;
  d*=ssd;
  results[0]=(a * c + b * d) * t;
  results[1]=(b * c - a * d) * t;
}

public static void cDiv ( double a , double b , double c , double d , double [ ] results ) { long aa , bb , cc , dd , ss ; double t ; int ha , hb , hc , hd , hz , hw , hs ; aa = Double . doubleToRawLongBits ( a ) ; bb = Double . doubleToRawLongBits ( b ) ; ha = ( int ) ( ( aa > > 32 ) & 0x7fffffff ) ; hb = ( int ) ( ( bb > > 32 ) & 0x7fffffff ) ; hz = ( ha > hb ) ? ha : hb ; cc = Double . doubleToRawLongBits ( c ) ; dd = Double . doubleToRawLongBits ( d ) ; hc = ( int ) ( ( cc > > 32 ) & 0x7fffffff ) ; hd = ( int ) ( ( dd > > 32 ) & 0x7fffffff ) ; hw = ( hc > hd ) ? hc : hd ; if ( hz < 0x07200000 && hw >= 0x32800000 && hw < 0x47100000 ) { hs = ( ( ( 0x47100000 - hw ) > > 1 ) & 0xfff00000 ) + 0x3ff00000 ; } else hs = ( ( ( hw > > 2 ) - hw ) + 0x6fd7ffff ) & 0xfff00000 ; ss = ( ( long ) hs ) << 32 ; double ssd = Double . longBitsToDouble ( ss ) ; c *= ssd ; d *= ssd ; t = 1.0 / ( c * c + d * d ) ; c *= ssd ; d *= ssd ; results [ 0 ] = ( a * c + b * d ) * t ; results [ 1 ] = ( b * c - a * d ) * t ; }
performs a complex division operation . < br > the standard complex division performs a set of operations that is suseptible to both overflow and underflow . this method is more numerically stable while still being relatively fast to execute .
