public void testSin() {
        System.out.println("testSin");
        Generic_BigDecimal a_Generic_BigDecimal = new Generic_BigDecimal(1000);
        BigDecimal x;
        int decimalPlaces;
        RoundingMode roundingMode;
        BigDecimal expResult = null;
        BigDecimal result = null;
        BigDecimal aPI1000 = a_Generic_BigDecimal.get_PI();
        decimalPlaces = 30;
        roundingMode = RoundingMode.HALF_UP;
        // Test PI/4
        x = Generic_BigDecimal.divideRoundIfNecessary(
                aPI1000,
                BigInteger.valueOf(4),
                decimalPlaces + 2,
                roundingMode);
        expResult = new BigDecimal("0.707106781186547524400844362105");
        result = Generic_BigDecimal.sin(
                x,
                a_Generic_BigDecimal,
                decimalPlaces,
                roundingMode);
        assertEquals(expResult, result);
        // Test PI/60
        x = Generic_BigDecimal.divideRoundIfNecessary(
                aPI1000,
                BigInteger.valueOf(60),
                decimalPlaces + 10,
                roundingMode);
        BigDecimal sqrt30 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(30), decimalPlaces + 10, roundingMode);
        BigDecimal sqrt10 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(10), decimalPlaces + 10, roundingMode);
        BigDecimal sqrt6 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(6), decimalPlaces + 10, roundingMode);
        BigDecimal sqrt5 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(5), decimalPlaces + 10, roundingMode);
        BigDecimal sqrt2 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(2), decimalPlaces + 10, roundingMode);
        // (sqrt(30) + sqrt(10) + sqrt(20 + 4*sqrt(5)) - sqrt(6) - sqrt(2) - sqrt(60 + 12*sqrt(5)))/16
        BigDecimal splurge1 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(60).add(BigDecimal.valueOf(12).multiply(sqrt5)), decimalPlaces + 10, roundingMode);
        // (sqrt(30) + sqrt(10) + sqrt(20 + 4*sqrt(5)) - sqrt(6) - sqrt(2) - splurge1)/16
        BigDecimal splurge2 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(20).add(BigDecimal.valueOf(4).multiply(sqrt5)), decimalPlaces + 10, roundingMode);
        // (sqrt(30) + sqrt(10) + splurge2 - sqrt(6) - sqrt(2) - splurge1)/16
        BigDecimal splurge = sqrt30.add(sqrt10).add(splurge2).subtract(sqrt6).subtract(sqrt2).subtract(splurge1);
        expResult = Generic_BigDecimal.divideRoundIfNecessary(
                splurge,
                BigDecimal.valueOf(16),
                decimalPlaces,
                roundingMode);
        result = Generic_BigDecimal.sin(
                x,
                a_Generic_BigDecimal,
                decimalPlaces,
                roundingMode);
        assertEquals(expResult, result);
        // Test PI/20
        x = Generic_BigDecimal.divideRoundIfNecessary(
                aPI1000,
                BigInteger.valueOf(20),
                decimalPlaces + 10,
                roundingMode);
        BigDecimal sqrt90 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(90), decimalPlaces + 10, roundingMode);
        BigDecimal sqrt18 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(18), decimalPlaces + 10, roundingMode);
//        BigDecimal sqrt10 = Generic_BigDecimal.sqrt(
//                BigDecimal.valueOf(10), decimalPlaces + 10, roundingMode);
//        BigDecimal sqrt20 = Generic_BigDecimal.sqrt(
//                BigDecimal.valueOf(20), decimalPlaces + 10, roundingMode);
//        BigDecimal sqrt5 = Generic_BigDecimal.sqrt(
//                BigDecimal.valueOf(5), decimalPlaces + 10, roundingMode);
//        BigDecimal sqrt2 = Generic_BigDecimal.sqrt(
//                BigDecimal.valueOf(2), decimalPlaces + 10, roundingMode);
        // (sqrt(90) + sqrt(18) + sqrt(10) + sqrt(2) - sqrt(20 - 4*sqrt(5)) - sqrt(180 - 36*sqrt(5)))/5
        splurge1 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(20).subtract(BigDecimal.valueOf(4).multiply(sqrt5)), decimalPlaces + 10, roundingMode);
        // (sqrt(90) + sqrt(18) + sqrt(10) + sqrt(2) - splurge1 - sqrt(180 - 36*sqrt(5)))/5
        splurge2 = Generic_BigDecimal.sqrt(
                BigDecimal.valueOf(180).subtract(BigDecimal.valueOf(36).multiply(sqrt5)), decimalPlaces + 10, roundingMode);
        // (sqrt(90) + sqrt(18) + sqrt(10) + sqrt(2) - splurge1 - splurge2)/5
        splurge = sqrt90.add(sqrt18).add(sqrt10).add(sqrt2).subtract(splurge1).subtract(splurge2);
        expResult = Generic_BigDecimal.divideRoundIfNecessary(
                splurge,
                BigDecimal.valueOf(32),
                decimalPlaces,
                roundingMode);
        result = Generic_BigDecimal.sin(
                x,
                a_Generic_BigDecimal,
                decimalPlaces,
                roundingMode);
        assertEquals(expResult, result);
        // Test PI/12
        x = Generic_BigDecimal.divideRoundIfNecessary(
                aPI1000,
                BigInteger.valueOf(12),
                decimalPlaces + 10,
                roundingMode);
//        BigDecimal sqrt6 = Generic_BigDecimal.sqrt(
//                BigDecimal.valueOf(6), decimalPlaces + 10, roundingMode);
//        BigDecimal sqrt2 = Generic_BigDecimal.sqrt(
//                BigDecimal.valueOf(2), decimalPlaces + 10, roundingMode);
        BigDecimal sqrt6subtractsqrt2 = sqrt6.subtract(sqrt2);
        expResult = Generic_BigDecimal.divideRoundIfNecessary(
                sqrt6subtractsqrt2,
                BigDecimal.valueOf(4),
                decimalPlaces,
                roundingMode);
        result = Generic_BigDecimal.sin(
                x,
                a_Generic_BigDecimal,
                decimalPlaces,
                roundingMode);
        assertEquals(expResult, result);
        // Test PI/10
        x = Generic_BigDecimal.divideRoundIfNecessary(
                aPI1000,
                BigInteger.valueOf(10),
                decimalPlaces + 10,
                roundingMode);
//        BigDecimal sqrt5 = Generic_BigDecimal.sqrt(
//                BigDecimal.valueOf(5), decimalPlaces + 10, roundingMode);
        BigDecimal sqrtsubtract1 = sqrt5.subtract(BigDecimal.ONE);
        expResult = Generic_BigDecimal.divideRoundIfNecessary(
                sqrtsubtract1,
                BigDecimal.valueOf(4),
                decimalPlaces,
                roundingMode);
        result = Generic_BigDecimal.sin(
                x,
                a_Generic_BigDecimal,
                decimalPlaces,
                roundingMode);
        assertEquals(expResult, result);
        // Test PI/5
        x = Generic_BigDecimal.divideRoundIfNecessary(
                aPI1000,
                BigInteger.valueOf(5),
                decimalPlaces + 10,
                roundingMode);
//        BigDecimal sqrt5 = Generic_BigDecimal.sqrt(
//                BigDecimal.valueOf(5), decimalPlaces + 10, roundingMode);
        BigDecimal tenSubtractTwoTimesSqrt5 = BigDecimal.valueOf(10).subtract(
                sqrt5.multiply(BigDecimal.valueOf(2)));
        expResult = Generic_BigDecimal.sqrt(
                tenSubtractTwoTimesSqrt5,
                decimalPlaces + 5,
                roundingMode);
        expResult = Generic_BigDecimal.divideRoundIfNecessary(
                expResult,
                BigDecimal.valueOf(4),
                decimalPlaces,
                roundingMode);
        result = Generic_BigDecimal.sin(
                x,
                a_Generic_BigDecimal,
                decimalPlaces,
                roundingMode);
        assertEquals(expResult, result);
    }