def roots_sh_jacobi(n, p1, q1, mu=False):
 if (((p1 - q1) <= (-1)) or (q1 <= 0)):
  raise ValueError('(p - q) must be greater than -1, and q must be greater than 0.')
 (x, w, m) = roots_jacobi(n, (p1 - q1), (q1 - 1), True)
 x = ((x + 1) / 2)
 scale = (2.0 ** p1)
 w /= scale
 m /= scale
 if mu:
  return (x, w, m)
 else:
  return (x, w)

def roots_sh_jacobi ( n , p1 , q1 , mu = False ) : if ( ( ( p1 - q1 ) <= ( - 1 ) ) or ( q1 <= 0 ) ) : raise ValueError ( '(p - q) must be greater than -1, and q must be greater than 0.' ) ( x , w , m ) = roots_jacobi ( n , ( p1 - q1 ) , ( q1 - 1 ) , True ) x = ( ( x + 1 ) / 2 ) scale = ( 2.0 ** p1 ) w /= scale m /= scale if mu : return ( x , w , m ) else : return ( x , w )
gauss-jacobi quadrature .