src/main/java/com/billybyte/dse/models/spread/newtonraphsonforspreads/NewtonRaphson.java
public double newtraph(double seedValue)
	{ 
         double fx=0.0;
         double Fx=0.0;
         double x=0.0;
         double lowerbound = seedValue;
         double newtRoot = newtonroot(lowerbound);
         fx=floorvalue(newtRoot);
 		 if(Double.isInfinite(fx) || Double.isNaN(fx))return Double.NaN;
         if(Math.abs(fx)<=precisionvalue)return lowerbound;
         double newtDeriv = derivation(lowerbound);
		 Fx=floorvalue(newtDeriv);
	 	 if(Double.isInfinite(Fx) || Double.isNaN(Fx))return Double.NaN;
		 x=floorvalue((lowerbound-(fx/Fx)));
		if(Double.isInfinite(x) || Double.isNaN(x))return Double.NaN;
		int counter = 0;
		
		while((Math.abs(x-lowerbound)>precisionvalue&counter<iterate))
			{
				
				lowerbound=x;
				 fx=newtonroot(lowerbound);
				 Fx=derivation(lowerbound);
				 x=floorvalue((lowerbound-(fx/Fx)));
						counter++;
	}
	
		if(counter>=iterate){
			return Double.NaN;
		}
		return x;
	}
/**
	 * Main entry point to call
	 * @param seedValue - for instance, if you are seeking implied volatility, then
	 *    some volatility number would go into seed value.
	 * @return
	 */
Main entry point to call
@param seedValue - for instance, if you are seeking implied volatility, then
some volatility number would go into seed value.
@return
Main entry point to call @param seedValue - for instance if you are seeking implied volatility then some volatility number would go into seed value . @return
public double newtraph(double seedValue)
	{ 
         double fx=0.0;
         double Fx=0.0;
         double x=0.0;
         double lowerbound = seedValue;
         double newtRoot = newtonroot(lowerbound);
         fx=floorvalue(newtRoot);
 		 if(Double.isInfinite(fx) || Double.isNaN(fx))return Double.NaN;
         if(Math.abs(fx)<=precisionvalue)return lowerbound;
         double newtDeriv = derivation(lowerbound);
		 Fx=floorvalue(newtDeriv);
	 	 if(Double.isInfinite(Fx) || Double.isNaN(Fx))return Double.NaN;
		 x=floorvalue((lowerbound-(fx/Fx)));
		if(Double.isInfinite(x) || Double.isNaN(x))return Double.NaN;
		int counter = 0;
		while((Math.abs(x-lowerbound)>precisionvalue&counter<iterate))
			{
				lowerbound=x;
				 fx=newtonroot(lowerbound);
				 Fx=derivation(lowerbound);
				 x=floorvalue((lowerbound-(fx/Fx)));
						counter++;
	}
		if(counter>=iterate){
			return Double.NaN;
		}
		return x;
	}
public double newtraph ( double seedValue ) { double fx = 0.0 ; double Fx = 0.0 ; double x = 0.0 ; double lowerbound = seedValue ; double newtRoot = newtonroot ( lowerbound ) ; fx = floorvalue ( newtRoot ) ; if ( Double . isInfinite ( fx ) || Double . isNaN ( fx ) ) return Double . NaN ; if ( Math . abs ( fx ) <= precisionvalue ) return lowerbound ; double newtDeriv = derivation ( lowerbound ) ; Fx = floorvalue ( newtDeriv ) ; if ( Double . isInfinite ( Fx ) || Double . isNaN ( Fx ) ) return Double . NaN ; x = floorvalue ( ( lowerbound - ( fx / Fx ) ) ) ; if ( Double . isInfinite ( x ) || Double . isNaN ( x ) ) return Double . NaN ; int counter = 0 ; while ( ( Math . abs ( x - lowerbound ) > precisionvalue & counter < iterate ) ) { lowerbound = x ; fx = newtonroot ( lowerbound ) ; Fx = derivation ( lowerbound ) ; x = floorvalue ( ( lowerbound - ( fx / Fx ) ) ) ; counter ++ ; } if ( counter >= iterate ) { return Double . NaN ; } return x ; }
Main entry point to call
 @param seedValue - for instance, if you are seeking implied volatility, then
    some volatility number would go into seed value.
Main entry point to call @param seedValue - for instance if you are seeking implied volatility then some volatility number would go into seed value .