double root = ( -b + Math.sqrt(discriminant) ) / 2.0;
double f1 = root*BW/2.0;
double f2 = f1*f1 - prod;
Complex C = new Complex( f1 ).plus( Complex.sqrt( new Complex(f2) ) );
double[] t0 = { C.conjugate().times(C).real(), -2.0*C.real(), 1.0 };
retval[0] = new Polynomial( t0 );
root = ( -b -Math.sqrt(discriminant) ) / 2.0;
f1 = root*BW/2.0;
f2 = f1*f1 - prod;
C = new Complex( f1 ).plus( Complex.sqrt( new Complex(f2) ) );
double[] t1 = { C.conjugate().times(C).real(), -2.0*C.real(), 1.0 };
retval[1] = new Polynomial( t1 );
}
else {
Complex root = new Complex( -b/2.0, Math.sqrt( -discriminant ) / 2.0 );
Complex f1 = root.times( BW/2.0 );
Complex f2 = (f1.times(f1)).minus( prod );
Complex C = f1.plus( Complex.sqrt( f2 ) );
double[] t0 = { C.conjugate().times(C).real(), -2.0*C.real(), 1.0 };
retval[0] = new Polynomial( t0 );
C = f1.minus( Complex.sqrt( f2 ) );
double[] t1 = { C.conjugate().times(C).real(), -2.0*C.real(), 1.0 };
retval[1] = new Polynomial( t1 );
}
return retval;
}