Ejemplo n.º 1
0
def sinh(x, err=defaultError):
    """
    sinh(x [,err]) returns the hyperbolic sine of x.
    """
    if not isinstance(err, defaultError.__class__) or err <= defaultError:
        series = ExponentialPowerSeries(
            itertools.cycle((
                0,
                rational.Integer(1),
            )))
        rx = rational.Rational(x)
        if rx == 0:
            return rational.Rational(0)
        return series(rx, err)
    else:
        return rational.Rational(math.sinh(x))