Пример #1
0
def some_complex_irrational_f(x,y,z):
    from pyaudi import exp, log, cos, sin, tan, sqrt, cbrt, cos, sin, tan, acos, asin, atan, cosh, sinh, tanh, acosh, asinh, atanh
    from pyaudi import abs as gd_abs
    from pyaudi import sin_and_cos, sinh_and_cosh
    f = (x+y+z) / 10.
    retval = exp(f) + log(f) + f**2 + sqrt(f) + cbrt(f) + cos(f) + sin(f)
    retval += tan(f) + acos(f) + asin(f) + atan(f)  + cosh(f) + sinh(f)
    retval += tanh(f) + acosh(f) + asinh(f) + atanh(f)
    a = sin_and_cos(f)
    b = sinh_and_cosh(f)
    retval+=a[0]+a[1]+b[0]+b[1]
    return retval
Пример #2
0
def some_complex_irrational_f(x, y, z):
    from pyaudi import exp, log, cos, sin, tan, sqrt, cbrt, cos, sin, tan, acos, asin, atan, cosh, sinh, tanh, acosh, asinh, atanh
    from pyaudi import abs as gd_abs
    from pyaudi import sin_and_cos, sinh_and_cosh
    f = (x + y + z) / 10.
    retval = exp(f) + log(f) + f**2 + sqrt(f) + cbrt(f) + cos(f) + sin(f)
    retval += tan(f) + acos(f) + asin(f) + atan(f) + cosh(f) + sinh(f)
    retval += tanh(f) + acosh(f) + asinh(f) + atanh(f)
    a = sin_and_cos(f)
    b = sinh_and_cosh(f)
    retval += a[0] + a[1] + b[0] + b[1]
    return retval
Пример #3
0
    def test_sinh_and_cosh(self):
        from pyaudi import gdual_double as gdual
        from pyaudi import sinh, cosh, sinh_and_cosh
        x = gdual(2.3, "x",8);
        y = gdual(1.5, "y",8);

        p1 = x + y;

        self.assertTrue((sinh(2*p1) - 2 * sinh(p1) * cosh(p1)).is_zero(1e-12))
        self.assertTrue((cosh(2*p1) - 1 - 2*sinh(p1)*sinh(p1)).is_zero(1e-12))
        self.assertTrue((cosh(2*p1) + 1 - 2*cosh(p1)*cosh(p1)).is_zero(1e-12))
        self.assertTrue((cosh(2*p1) - cosh(p1)*cosh(p1) - sinh(p1) * sinh(p1)).is_zero(1e-12))
        self.assertTrue((- sinh(p1)*sinh(p1) + cosh(p1)*cosh(p1) - 1).is_zero(1e-12))

        res = sinh_and_cosh(p1);
        self.assertTrue((res[0] - sinh(p1)).is_zero(1e-12))
        self.assertTrue((res[1] - cosh(p1)).is_zero(1e-12))
Пример #4
0
    def test_sinh_and_cosh(self):
        from pyaudi import gdual_double as gdual
        from pyaudi import sinh, cosh, sinh_and_cosh
        x = gdual(2.3, "x", 8)
        y = gdual(1.5, "y", 8)

        p1 = x + y

        self.assertTrue(
            (sinh(2 * p1) - 2 * sinh(p1) * cosh(p1)).is_zero(1e-12))
        self.assertTrue(
            (cosh(2 * p1) - 1 - 2 * sinh(p1) * sinh(p1)).is_zero(1e-12))
        self.assertTrue(
            (cosh(2 * p1) + 1 - 2 * cosh(p1) * cosh(p1)).is_zero(1e-12))
        self.assertTrue((cosh(2 * p1) - cosh(p1) * cosh(p1) -
                         sinh(p1) * sinh(p1)).is_zero(1e-12))
        self.assertTrue(
            (-sinh(p1) * sinh(p1) + cosh(p1) * cosh(p1) - 1).is_zero(1e-12))

        res = sinh_and_cosh(p1)
        self.assertTrue((res[0] - sinh(p1)).is_zero(1e-12))
        self.assertTrue((res[1] - cosh(p1)).is_zero(1e-12))