private static double yieldIteration( double DSC,
	                                      double E,
	                                      double n,
	                                      double A,
	                                      double rate,
	                                      int frequency,
	                                      double redemption,
	                                      double pr )
	{		
		/* Using Newton-Raphson, iterate over possible yield values; value is correct when		
		* f <= tolerance, defined as .000001%
		// 100 iterations, formula for PRICE
		// each trial= f(trial)/f'(trial)
		// f(trial)= price calculation
		// f'(trial): (deep breath)
		 * 
		 *  if f= price, and 
		 *  G and F are given
		 *  C= redemption
		 *  B= 100*R
		 *  E= -(n-1+F)
		 *  Ei = -(i-1+F)
		 *  x= 1+trial/frequency
		 * 
		 *  then,
		 * 
		 *  ui(trial)= B*x^Ei
		 *  f'(ui(trial))= -Ei*B*x^(Ei-1) 
		 * 			  = Ei*B*x^Ei*1/x
		 * 			  = B*x^Ei*1/x*Ei
		 * 			  = ui(trial)*Ei/x
		 *  f'(sum(ui(trial)))= sum(f'(ui))
		 * 			  = sum(ui(trial)*Ei/x
		 * 			  = 1/x*sum(ui(trial)*Ei)
		 *  
		 *   
		 *  f(trial)= C*x^E + sum(ui(trial)) - B*G
		 *  f'(trial)= f'(f(x)+sum(ui(trial))
		 * 			 = f'(x) + f'(sum(ui(trial))
		 * 			 = C*E*x^(E-1) + sum(ui(trial)*Ei/x)
		 * 			 = (C*E*x^E)*(1/x) + (1/x)*sum(ui(trial)*Ei)
		 * 			 = (C*E*x^E)*(1/x) + (1/x)*sum(B*x^Ei*Ei)
		 */
		double guess = .1;
		boolean bIsCorrect = false;
		final double TOLERANCE = 0.00000001;
		double trial = guess;
		double f;
		double F = DSC / E;
		double G = A / E;
		double R = rate / frequency;
		double Y;
		double B = R * 100;
		double Exp = (n - 1) + F;

		// N-R iteration
		double fprime; // derivative of f(x0)
		double delta = 0;
		for( int j = 0; (j < 100) && !bIsCorrect; j++ )
		{ // maximum 100 tries
			// f= f(trial)
			Y = 1 + trial / frequency;
			f = redemption / Math.pow( Y, Exp );
			fprime = 0;
			for( int i = 1; i <= n; i++ )
			{
				f += B / Math.pow( Y, (i - 1) + F );
				fprime += (B / Math.pow( Y, (i - 1) + F )) * ((i - 1) + F);
			}
			f -= (B * G);
			// pr-f =>0
			fprime /= Y;        // final 
			fprime += redemption / Math.pow( Y, Exp ) * Exp * (1 / Y);

			// N-R:  use f/fprime as iterative factor
			delta = (pr - f) / fprime;
			if( trial < delta )
			{
				trial = delta - trial;
			}
			else
			{
				trial = trial - delta;
			}
//			while (trial - delta <= 0) delta= delta/2;	// sanity check
//			trial-= delta;
			bIsCorrect = (Math.abs( pr - f ) <= TOLERANCE);
		}
		if( bIsCorrect )
		{
			return (trial);
		}
		return -1;
		/*
		MinYield = -1# 
	      MaxYield = .Rate 
	      If MaxYield = 0 Then MaxYield = 0.1 
	      Do While CalculatedPrice(BondInfo, MaxYield) > .Price 
	        MaxYield = MaxYield * 2 
	      Loop 


	      Yld = 0.5 * (MinYield + MaxYield) 
	      For i = 1 To MaxIterations 
	        Diff = CalculatedPrice(BondInfo, Yld) - .Price 
	        If Abs(Diff) < Accuracy Then Exit For 
	        'if calculated price is greater, correct yield is greater 
	        If Diff > 0 Then MinYield = Yld Else MaxYield = Yld 
	        Yld = 0.5 * (MinYield + MaxYield) 
	      Next i 
	    End If 
	    BondYield = Yld 
*/
	}