System.Numerics.Tests.ComplexTests.Tanh_Basic C# (CSharp) Method

Tanh_Basic() private method

private Tanh_Basic ( double real, double imaginary ) : void
real double
imaginary double
return void
        public static void Tanh_Basic(double real, double imaginary)
        {
            // The product formula: cosh (x+iy) = sinh (x+iy) / cosh (x+iy)
            // The verification formula: Tanh (z) = (Exp(2z) -1) / (Exp(2z)+1)
            // The verification formula is used not for the boundary values
            var complex = new Complex(real, imaginary);
            Complex scale = 2 * complex;
            Complex expected = (Complex.Exp(scale) - 1) / (Complex.Exp(scale) + 1);
            Tanh_Advanced(real, imaginary, expected.Real, expected.Imaginary);
        }
ComplexTests