import math


def f2H(f, e):
    """
    Function: f2H
    Purpose: Maps true anomaly angles into hyperbolic anomaly angles.
        This function requires the orbit to be hyperbolic
    Inputs:
        f = true anomaly angle (rad)
        e = eccentricity (e > 1)
    Outputs:
        H = hyperbolic anomaly (rad)
    """
    if e > 1.0:
        H = 2.0 * math.atanh(math.sqrt((e - 1.0) / (e + 1.0)) * math.tan(f / 2.0))
        return H
    raise ValueError('Error: f2H() received e = {}, the value of e should be 0 <= e < 1'.format(str(e)))