def getBrackets(dumFunc,midVal):
	"""find bracketing intervals of roots 

	NOTE: there are two roots and val lies in between them.
	So, this is a simple routine to find the intervals that
	bracket both roots

	Input:
	dumFunc		-- function that changes sign at roots
	val		-- value that is located in betwee roots

	Returns: (lBrack,rBrack)
	lBrack,rBrack	-- left/right interval containing root
	"""
	fac=0.01	# factor used to modify value of midVal
			# so as to bracket an interval that 
			# contains a root of the objective function
	
	midF = dumFunc(midVal)
	lVal=midVal*(1-fac)
	lF  =dumFunc(lVal)
	while(lF*midF>0.):
		lVal*=(1.-fac)
		midF=lF
		lF=dumFunc(lVal)
	lBrack=[lVal,midVal]

	midF = dumFunc(midVal)
	rVal=midVal*(1+fac)
	rF  =dumFunc(rVal)
	while(rF*midF>0.):
		rVal*=(1.-fac)
		midF=rF
		rF=dumFunc(rVal)
	rBrack=[midVal,rVal]

	return lBrack,rBrack