def nSwitch(order : int, theta : float) -> float:
    """
    Estimate the sample number when the first VRF diagonal elements of an EMP/FMP pair will match
    
    Uses approximate relationships to estimate the switchover point for an EMP/FMP pair when the
    0th element of the VRF diagonals will match, e.g. approximately equal noise reduction.  The 
    approximations are more accurate as theta approaches one.
    
    Arguments:
         order - polynomial filter order
         theta - FMP fading factor
         
    Returns:
        n - estimated crossover sample number
       
    """
    
    if (1.0 - theta <= 0.0) :
        return 0.0;
    if (order == 0) :
        return 2.0/(1.0-theta)
    elif (order == 1.0) :
        return 3.2/(1.0-theta)
    elif (order == 2.0) :
        return 4.3636/(1.0-theta)
    elif (order == 3.0) :
        return 5.50546/(1.0-theta)
    elif (order == 4.0) :
        return 6.6321/(1.0-theta)
    elif (order == 5.0) :
        return 7.7478/(1.0-theta)
    else :
        raise ValueError("Polynomial orders < 0.0 or > 5.0 are not supported")