def _internal2external_lambda(bound):
    """
    Make a lambda function which converts a single internal (uncontrained)
    parameter to a external (constrained) parameter.
    """
    lower, upper = bound

    if lower is None and upper is None:  # no constraints
        return lambda x: x
    elif upper is None:     # only lower bound
        return lambda x: lower - 1. + sqrt(x * x + 1.)
    elif lower is None:     # only upper bound
        return lambda x: upper + 1. - sqrt(x * x + 1.)
    else:
        return lambda x: lower + ((upper - lower) / 2.) * (sin(x) + 1.)
def _internal2external_lambda ( bound ) : lower , upper = bound if lower is None and upper is None : return lambda x : x elif upper is None : return lambda x : lower - 1. + sqrt ( x * x + 1. ) elif lower is None : return lambda x : upper + 1. - sqrt ( x * x + 1. ) else : return lambda x : lower + ( ( upper - lower ) / 2. ) * ( sin ( x ) + 1. )
Make a lambda function which converts a single internal (uncontrained)
    parameter to a external (constrained) parameter.