jdk/test/java/lang/StrictMath/HyperbolicTests.java
author plevart
Fri, 17 May 2013 14:41:39 +0200
changeset 17698 ab37c47ff886
parent 5506 202f599c92aa
permissions -rw-r--r--
8014477: (str) Race condition in String.contentEquals when comparing with StringBuffer Reviewed-by: alanb, mduigou, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1826
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1826
diff changeset
     2
 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
1826
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
     4
 *
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
     7
 * published by the Free Software Foundation.
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
     8
 *
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    13
 * accompanied this code).
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    14
 *
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1826
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1826
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1826
diff changeset
    21
 * questions.
1826
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    22
 */
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    23
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    24
/*
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    25
 * @test
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    26
 * @bug 4851625
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    27
 * @summary Tests for StrictMath.{sinh, cosh, tanh}
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    28
 * @author Joseph D. Darcy
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    29
 */
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    30
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    31
/**
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    32
 * The tests in ../Math/HyperbolicTests.java test properties that
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    33
 * should hold for any implementation of the hyperbolic functions
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    34
 * sinh, cos, and tanh, including the FDLIBM-based ones required by
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    35
 * the StrictMath class.  Therefore, the test cases in
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    36
 * ../Math/HyperbolicTests.java are run against both the Math and
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    37
 * StrictMath versions of the hyperbolic methods.  The role of this
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    38
 * test is to verify that the FDLIBM algorithms are being used by
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    39
 * running golden file tests on values that may vary from one
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    40
 * conforming implementation of the hyperbolics to another.
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    41
 */
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    42
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    43
public class HyperbolicTests {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    44
    private HyperbolicTests(){}
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    45
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    46
    static int testSinhCase(double input, double expected) {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    47
        return Tests.test("StrictMath.sinh(double)", input,
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    48
                          StrictMath.sinh(input), expected);
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    49
    }
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    50
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    51
    static int testCoshCase(double input, double expected) {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    52
        return Tests.test("StrictMath.cosh(double)", input,
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    53
                          StrictMath.cosh(input), expected);
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    54
    }
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    55
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    56
    static int testTanhCase(double input, double expected) {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    57
        return Tests.test("StrictMath.tanh(double)", input,
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    58
                          StrictMath.tanh(input), expected);
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    59
    }
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    60
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    61
    static int testSinh() {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    62
        int failures = 0;
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    63
        double [][] testCases = {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    64
            {0x1.5798ee2308c3ap-27,     0x1.5798ee2308c3bp-27},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    65
            {0x1.ffffffffffff8p-26,     0x1.ffffffffffffap-26},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    66
            {0x1.ffffffffffffep-26,     0x1.0p-25},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    67
            {0x1.ffffffffffff8p-25,     0x1.ffffffffffffep-25},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    68
            {0x1.ffffffffffffap-25,     0x1.0p-24},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    69
            {0x1.ad7f29abcaf47p-24,     0x1.ad7f29abcaf53p-24},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    70
            {0x1.ad7f29abcaf48p-24,     0x1.ad7f29abcaf54p-24},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    71
            {0x1.fffffffffffeap-24,     0x1.0p-23},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    72
            {0x1.ffffffffffff8p-24,     0x1.0000000000007p-23},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    73
            {0x1.fffffffffffaap-23,     0x1.0p-22},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    74
            {0x1.ffffffffffff8p-23,     0x1.0000000000027p-22},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    75
            {0x1.ffffffffffeaap-22,     0x1.0p-21},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    76
            {0x1.ffffffffffff8p-22,     0x1.00000000000a7p-21},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    77
            {0x1.ffffffffffaaap-21,     0x1.0p-20},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    78
            {0x1.ffffffffffff8p-21,     0x1.00000000002a7p-20},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    79
            {0x1.0c6f7a0b5ed8cp-20,     0x1.0c6f7a0b5f09fp-20},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    80
            {0x1.0c6f7a0b5ed8dp-20,     0x1.0c6f7a0b5f0ap-20},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    81
            {0x1.fffffffffeaaap-20,     0x1.0p-19},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    82
            {0x1.ffffffffffff8p-20,     0x1.0000000000aa7p-19},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    83
            {0x1.ffffffffffff8p-19,     0x1.0000000002aa7p-18},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    84
            {0x1.ffffffffffff7p-18,     0x1.000000000aaa6p-17},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    85
            {0x1.4f8b588e368d9p-17,     0x1.4f8b588e4e928p-17},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    86
            {0x1.ffffffffffffep-17,     0x1.000000002aaa9p-16},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    87
            {0x1.0p-16,                 0x1.000000002aaaap-16},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    88
            {0x1.fffffffffffffp-16,     0x1.00000000aaaabp-15},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    89
            {0x1.fffffffffeaaap-15,     0x1.00000002aap-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    90
            {0x1.ffffffffffffep-15,     0x1.00000002aaaa9p-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    91
            {0x1.0p-14,                 0x1.00000002aaaaap-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    92
            {0x1.a36e2eb1c3dd4p-14,     0x1.a36e2ebd7e43ap-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    93
            {0x1.a36e2eb1c3f8cp-14,     0x1.a36e2ebd7e5f1p-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    94
            {0x1.a36e2eb1c432cp-14,     0x1.a36e2ebd7e991p-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    95
            {0x1.fffffffffffffp-14,     0x1.0000000aaaaabp-13},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    96
            {0x1.ffffffffffffep-13,     0x1.0000002aaaaa9p-12},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    97
            {0x1.0p-12,                 0x1.0000002aaaaaap-12},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    98
            {0x1.ffffffffff7f9p-12,     0x1.000000aaaa6a9p-11},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
    99
            {0x1.fffffffffffffp-12,     0x1.000000aaaaaadp-11},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   100
            {0x1.ffffffffffffep-11,     0x1.000002aaaaacbp-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   101
            {0x1.0p-10,                 0x1.000002aaaaaccp-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   102
            {0x1.0624dd2f1a79p-10,      0x1.0624e00c1c776p-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   103
            {0x1.0624dd2f1a8c9p-10,     0x1.0624e00c1c8bp-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   104
            {0x1.0624dd2f1a9fcp-10,     0x1.0624e00c1c9e3p-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   105
            {0x1.ffffffffffffep-10,     0x1.00000aaaaaccbp-9},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   106
            {0x1.0p-9,                  0x1.00000aaaaacccp-9},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   107
            {0x1.ffffffffffe4ap-9,      0x1.00002aaaacbf2p-8},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   108
            {0x1.fffffffffffffp-9,      0x1.00002aaaacccdp-8},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   109
            {0x1.fffffffffff9dp-8,      0x1.0000aaaaccc9bp-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   110
            {0x1.ffffffffffffep-8,      0x1.0000aaaacccccp-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   111
            {0x1.0p-7,                  0x1.0000aaaaccccdp-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   112
            {0x1.47ae147ae146fp-7,      0x1.47af7a654e9e2p-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   113
            {0x1.47ae147ae147ap-7,      0x1.47af7a654e9eep-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   114
            {0x1.47ae147ae147bp-7,      0x1.47af7a654e9efp-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   115
            {0x1.fffffffffffb6p-7,      0x1.0002aaaccccb4p-6},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   116
            {0x1.fffffffffffcap-7,      0x1.0002aaaccccbep-6},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   117
            {0x1.ffffffffffff7p-7,      0x1.0002aaaccccd5p-6},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   118
            {0x1.fffffffffffe9p-6,      0x1.000aaacccd001p-5},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   119
            {0x1.ffffffffffff7p-6,      0x1.000aaacccd008p-5},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   120
            {0x1.fffffffffffffp-6,      0x1.000aaacccd00dp-5},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   121
            {0x1.ffffffffffff6p-5,      0x1.002aacccd9cd7p-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   122
            {0x1.ffffffffffff8p-5,      0x1.002aacccd9cd9p-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   123
            {0x1.0p-4,                  0x1.002aacccd9cddp-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   124
            {0x1.9999999999995p-4,      0x1.9a487337b59afp-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   125
            {0x1.9999999999996p-4,      0x1.9a487337b59afp-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   126
            {0x1.9999999999998p-4,      0x1.9a487337b59b1p-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   127
            {0x1.ffffffffffffap-4,      0x1.00aaccd00d2edp-3},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   128
            {0x1.ffffffffffffcp-4,      0x1.00aaccd00d2efp-3},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   129
            {0x1.ffffffffffff3p-3,      0x1.02accd9d080fbp-2},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   130
            {0x1.ffffffffffffdp-3,      0x1.02accd9d08101p-2},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   131
            {0x1.fffffffffffffp-3,      0x1.02accd9d08101p-2},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   132
            {0x1.fffffffffffecp-2,      0x1.0acd00fe63b8cp-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   133
            {0x1.ffffffffffffcp-2,      0x1.0acd00fe63b94p-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   134
            {0x1.0p-1,                  0x1.0acd00fe63b97p-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   135
            {0x1.ffffffffffff6p-1,      0x1.2cd9fc44eb97ap0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   136
            {0x1.ffffffffffffep-1,      0x1.2cd9fc44eb981p0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   137
            {0x1.fffffffffffffp0,       0x1.d03cf63b6e19ep1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   138
            {0x1.0p1,                   0x1.d03cf63b6e1ap1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   139
            {0x1.fffffffffffffp1,       0x1.b4a380370362dp4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   140
            {0x1.0p2,                   0x1.b4a380370363p4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   141
            {0x1.ffffffffffffcp2,       0x1.749ea514eca4ep10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   142
            {0x1.0p3,                   0x1.749ea514eca66p10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   143
            {0x1.fffffffffffffp3,       0x1.0f2ebd0a7ffdcp22},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   144
            {0x1.0p4,                   0x1.0f2ebd0a7ffe4p22},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   145
            {0x1.fffffffffff68p4,       0x1.1f43fcc4b5b83p45},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   146
            {0x1.fffffffffffd4p4,       0x1.1f43fcc4b6316p45},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   147
            {0x1.0p5,                   0x1.1f43fcc4b662cp45},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   148
        };
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   149
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   150
        for (double[] testCase: testCases)
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   151
            failures+=testSinhCase(testCase[0], testCase[1]);
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   152
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   153
        return failures;
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   154
    }
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   155
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   156
    static int testCosh() {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   157
        int failures = 0;
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   158
        double [][] testCases = {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   159
            {0x1.fffffffffb49fp-8,      0x1.00020000aaaabp0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   160
            {0x1.47ae147ae0e45p-7,      0x1.000346de27853p0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   161
            {0x1.fffffffffd9f3p-7,      0x1.0008000aaab05p0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   162
            {0x1.ffffffffff9f1p-7,      0x1.0008000aaab05p0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   163
            {0x1.fffffffffe27dp-6,      0x1.002000aaac169p0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   164
            {0x1.ffffffffff27bp-6,      0x1.002000aaac16bp0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   165
            {0x1.ffffffffffb9cp-5,      0x1.00800aab05b1ep0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   166
            {0x1.ffffffffffd9dp-5,      0x1.00800aab05b1fp0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   167
            {0x1.9999999999368p-4,      0x1.0147f40224b2ep0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   168
            {0x1.9999999999727p-4,      0x1.0147f40224b35p0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   169
            {0x1.ffffffffffed1p-4,      0x1.0200aac16db6cp0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   170
            {0x1.fffffffffffd1p-4,      0x1.0200aac16db6ep0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   171
            {0x1.ffffffffffeb4p-3,      0x1.080ab05ca613bp0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   172
            {0x1.ffffffffffff2p-3,      0x1.080ab05ca6146p0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   173
            {0x1.ffffffffffff3p-2,      0x1.20ac1862ae8cep0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   174
            {0x1.ffffffffffff9p-2,      0x1.20ac1862ae8dp0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   175
            {0x1.0p0,                   0x1.8b07551d9f551p0},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   176
            {0x1.ffffffffffffbp0,       0x1.e18fa0df2d9b3p1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   177
            {0x1.ffffffffffffep0,       0x1.e18fa0df2d9b8p1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   178
            {0x1.fffffffffffffp0,       0x1.e18fa0df2d9bap1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   179
            {0x1.ffffffffffff9p1,       0x1.b4ee858de3e68p4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   180
            {0x1.ffffffffffffep1,       0x1.b4ee858de3e7ap4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   181
            {0x1.fffffffffffffp1,       0x1.b4ee858de3e7dp4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   182
            {0x1.ffffffffffffcp2,       0x1.749eaa93f4e5ep10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   183
            {0x1.ffffffffffffdp2,       0x1.749eaa93f4e64p10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   184
            {0x1.0p3,                   0x1.749eaa93f4e76p10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   185
            {0x1.fffffffffff6fp3,       0x1.0f2ebd0a7fb9p22},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   186
            {0x1.0p4,                   0x1.0f2ebd0a8005cp22},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   187
            {0x1.fffffffffffd4p4,       0x1.1f43fcc4b6316p45},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   188
            {0x1.0p5,                   0x1.1f43fcc4b662cp45},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   189
        };
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   190
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   191
        for (double[] testCase: testCases)
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   192
            failures+=testCoshCase(testCase[0], testCase[1]);
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   193
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   194
        return failures;
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   195
    }
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   196
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   197
    static int testTanh() {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   198
        int failures = 0;
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   199
        double [][] testCases = {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   200
            {0x1.5798ee2308c36p-27,     0x1.5798ee2308c36p-27},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   201
            {0x1.ffffffffffffep-26,     0x1.ffffffffffffbp-26},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   202
            {0x1.ffffffffffffep-25,     0x1.ffffffffffff3p-25},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   203
            {0x1.ad7f29abcaf47p-24,     0x1.ad7f29abcaf2dp-24},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   204
            {0x1.ad7f29abcaf48p-24,     0x1.ad7f29abcaf2ep-24},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   205
            {0x1.ffffffffffffep-24,     0x1.fffffffffffd3p-24},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   206
            {0x1.ffffffffffffep-23,     0x1.fffffffffff53p-23},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   207
            {0x1.ffffffffffffep-22,     0x1.ffffffffffd53p-22},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   208
            {0x1.ffffffffffffep-21,     0x1.ffffffffff553p-21},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   209
            {0x1.0c6f7a0b5ed8dp-20,     0x1.0c6f7a0b5e767p-20},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   210
            {0x1.ffffffffffffep-20,     0x1.fffffffffd553p-20},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   211
            {0x1.ffffffffffffep-19,     0x1.fffffffff5553p-19},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   212
            {0x1.fffffffffffffp-18,     0x1.ffffffffd5555p-18},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   213
            {0x1.0p-17,                 0x1.ffffffffd5556p-18},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   214
            {0x1.4f8b588e368edp-17,     0x1.4f8b588e0685p-17},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   215
            {0x1.fffffffffffffp-17,     0x1.ffffffff55554p-17},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   216
            {0x1.fffffffffffffp-16,     0x1.fffffffd55555p-16},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   217
            {0x1.0p-15,                 0x1.fffffffd55556p-16},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   218
            {0x1.fffffffffe5ddp-15,     0x1.fffffff553b33p-15},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   219
            {0x1.fffffffffffffp-15,     0x1.fffffff555554p-15},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   220
            {0x1.a36e2eb1c432dp-14,     0x1.a36e2e9a4f663p-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   221
            {0x1.ffffffffffffep-14,     0x1.ffffffd555553p-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   222
            {0x1.0p-13,                 0x1.ffffffd555555p-14},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   223
            {0x1.ffffffffffd51p-13,     0x1.ffffff55552aap-13},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   224
            {0x1.fffffffffffffp-13,     0x1.ffffff5555559p-13},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   225
            {0x1.ffffffffffffep-12,     0x1.fffffd5555597p-12},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   226
            {0x1.0p-11,                 0x1.fffffd5555599p-12},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   227
            {0x1.fffffffffff1p-11,      0x1.fffff555558a9p-11},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   228
            {0x1.0p-10,                 0x1.fffff5555599ap-11},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   229
            {0x1.0624dd2f1a9c6p-10,     0x1.0624d77516cabp-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   230
            {0x1.0624dd2f1a9f8p-10,     0x1.0624d77516cdep-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   231
            {0x1.fffffffffffddp-10,     0x1.ffffd55559976p-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   232
            {0x1.fffffffffffffp-10,     0x1.ffffd55559999p-10},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   233
            {0x1.ffffffffffffcp-9,      0x1.ffff555599993p-9},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   234
            {0x1.ffffffffffffep-9,      0x1.ffff555599996p-9},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   235
            {0x1.ffffffffffff8p-8,      0x1.fffd555999924p-8},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   236
            {0x1.ffffffffffffep-8,      0x1.fffd555999929p-8},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   237
            {0x1.47ae147ae1458p-7,      0x1.47ab48ae4593cp-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   238
            {0x1.47ae147ae1464p-7,      0x1.47ab48ae45947p-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   239
            {0x1.ffffffffffffep-7,      0x1.fff5559997df6p-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   240
            {0x1.fffffffffffffp-7,      0x1.fff5559997df8p-7},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   241
            {0x1.ffffffffffff9p-6,      0x1.ffd559992b1d8p-6},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   242
            {0x1.ffffffffffffep-6,      0x1.ffd559992b1dcp-6},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   243
            {0x1.ffffffffffff9p-5,      0x1.ff55997e030d1p-5},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   244
            {0x1.fffffffffffffp-5,      0x1.ff55997e030d6p-5},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   245
            {0x1.9999999999996p-4,      0x1.983d7795f4137p-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   246
            {0x1.9999999999997p-4,      0x1.983d7795f4137p-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   247
            {0x1.fffffffffffffp-4,      0x1.fd5992bc4b834p-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   248
            {0x1.0p-3,                  0x1.fd5992bc4b834p-4},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   249
            {0x1.fffffffffffffp-3,      0x1.f597ea69a1c86p-3},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   250
            {0x1.ffffffffffffcp-2,      0x1.d9353d7568aefp-2},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   251
            {0x1.ffffffffffffep-2,      0x1.d9353d7568af3p-2},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   252
            {0x1.ffffffffffffbp-1,      0x1.85efab514f393p-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   253
            {0x1.ffffffffffffep-1,      0x1.85efab514f393p-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   254
            {0x1.fffffffffffd3p0,       0x1.ed9505e1bc3cep-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   255
            {0x1.fffffffffffe1p0,       0x1.ed9505e1bc3cfp-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   256
            {0x1.ffffffffffed8p1,       0x1.ffa81708a0b4p-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   257
            {0x1.fffffffffff92p1,       0x1.ffa81708a0b41p-1},
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   258
        };
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   259
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   260
        for (double[] testCase: testCases)
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   261
            failures+=testTanhCase(testCase[0], testCase[1]);
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   262
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   263
        return failures;
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   264
    }
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   265
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   266
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   267
    public static void main(String [] argv) {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   268
        int failures = 0;
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   269
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   270
        failures += testSinh();
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   271
        failures += testCosh();
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   272
        failures += testTanh();
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   273
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   274
        if (failures > 0) {
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   275
            System.err.println("Testing the hyperbolics incurred "
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   276
                               + failures + " failures.");
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   277
            throw new RuntimeException();
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   278
        }
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   279
    }
39d505a353e8 6601457: Move wrapper class tests from closed to open
darcy
parents:
diff changeset
   280
}