def hermitenorm(n, monic=False):
 if (n < 0):
  raise ValueError('n must be nonnegative.')
 if (n == 0):
  n1 = (n + 1)
 else:
  n1 = n
 (x, w, mu0) = roots_hermitenorm(n1, mu=True)
 wfunc = (lambda x: exp((((- x) * x) / 2.0)))
 if (n == 0):
  (x, w) = ([], [])
 hn = (sqrt((2 * pi)) * _gam((n + 1)))
 kn = 1.0
 p = orthopoly1d(x, w, hn, kn, wfunc=wfunc, limits=((- inf), inf), monic=monic, eval_func=(lambda x: eval_hermitenorm(n, x)))
 return p

def hermitenorm ( n , monic = False ) : if ( n < 0 ) : raise ValueError ( 'n must be nonnegative.' ) if ( n == 0 ) : n1 = ( n + 1 ) else : n1 = n ( x , w , mu0 ) = roots_hermitenorm ( n1 , mu = True ) wfunc = ( lambda x : exp ( ( ( ( - x ) * x ) / 2.0 ) ) ) if ( n == 0 ) : ( x , w ) = ( [ ] , [ ] ) hn = ( sqrt ( ( 2 * pi ) ) * _gam ( ( n + 1 ) ) ) kn = 1.0 p = orthopoly1d ( x , w , hn , kn , wfunc = wfunc , limits = ( ( - inf ) , inf ) , monic = monic , eval_func = ( lambda x : eval_hermitenorm ( n , x ) ) ) return p
normalized hermite polynomial .