def SfromL( L, nmax=25, epsilon= 2**(-50) ):
	"""	
		Compute sequence of generalized inverses from given Schroder value L.
		
		Args:
			L       (real):    main arg, range 0.0 to 1.0
			nmax    (integer): default 22.  Max length to allow for S.
			epsilon (real):    smallest change in L you don't care about.
		Returns:
			Sequence as list of integers
		
		Normally epsilon should be 2 ** -(number of significant bits in L), and for
		IEEE 64-bit that's 52 bits (the rest being sign and exponent).
		Fearing trouble with round-offs, I set the default to 50 bits.
		
		If you're using some alternative form of real numbers, say a fixed point
		format built for a fixed range like -1 to 1, or 0 to 1, then set epsilon
		to something suitable for that type.
	"""
	# Prevent accidental use of negative L, or L too close to zero
	# which can lead to infinite loop
	if L<1e-22:   # 1e-22 is a guess; no real thinking was done
		return [73]
	S = []
	while  len(S) <= nmax:
		count = 0
		while L < 0.5:
			L = 2.0*L
			count +=1
		S.append( count)
		if count > 52:
			break;
		if abs(L-0.5) < epsilon:
			break
		L = 1-L
		if L<1e-22:
			break
	return S