1 /* 2 * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 18 19 20 #define SGN_MASK_D 0x8000000000000000 21 22 #define INT2DBL_HI_D 0x4330000000000000 23 #define INT2DBL_LO_D 0x0000000080000000 24 #define INT2DBL_D 0x4330000080000000 25 26 27 #define UPPERBOUND_1_D 0x4086232B00000000 28 #define UPPERBOUND_2_D 0x4087480000000000 29 #define ZERO_D 0.0 30 #define INF_D 0x7FF0000000000000 31 #define HI_ABS_MASK_D 0x7FFFFFFF00000000 32 #define ABS_MASK_D 0x7FFFFFFFFFFFFFFF 33 #define MULT_CONST_D 0x3FF0000000000000 34 35 #define D52_D 52 36 37 #define HI_MASK_D 0xFFFFFFFF00000000 38 #define SGN_EXP_MASK_D 0x7FF0000000000000 39 #define NEG_ONE_D -1.0 40 #define HALF_D 0.5 41 #define SGN_MASK_D 0x8000000000000000 42 #define INF_FAKE_D 0x7FF00000FFFFFFFF 43 #define NAN_MASK_D 0xFFF8000000000000 44 #define NEG_ONE_CONST_D 0x3FF0000000000000 45 46 #define TEN_23_D 1023 47 #define ELEVEN_D 11 48 49 /* log constants */ 50 #define LOG_POLY_6_D 6.6253631649203309E-2/65536.0 51 #define LOG_POLY_5_D 6.6250935587260612E-2/16384.0 52 #define LOG_POLY_4_D 7.6935437806732829E-2/4096.0 53 #define LOG_POLY_3_D 9.0908878711093280E-2/1024.0 54 #define LOG_POLY_2_D 1.1111111322892790E-1/256.0 55 #define LOG_POLY_1_D 1.4285714284546502E-1/64.0 56 #define LOG_POLY_0_D 2.0000000000003113E-1/16.0 57 58 #define CC_CONST_Y_D 3.3333333333333331E-1/4.0 59 #define CC_CONST_X_D -9.8201492846582465E-18/4.0 60 61 #define EXPO_MASK_D 0xFFF0000000000000 62 #define HI_CONST_1_D 0x800FFFFFFFFFFFFF 63 #define HI_CONST_2_D 0x3FF0000000000000 64 #define HALFIFIER_D 0x0010000000000000 65 #define HI_THRESH_D 0x3FF6A09E00000000 66 67 #define ONE_F_D 1.0 68 #define TWO_D 2.0 69 70 #define LN2_HI_D 6.9314718055994529e-1 71 #define LN2_LO_D 2.3190468138462996e-17 72 /* log constants */ 73 74 75 /* exp constants */ 76 #define L2E_D 1.4426950408889634e+0 77 #define NEG_LN2_HI_D -6.9314718055994529e-1 78 #define NEG_LN2_LO_D -2.3190468138462996e-17 79 80 #define EXP_POLY_B_D 2.5022322536502990E-008 81 #define EXP_POLY_A_D 2.7630903488173108E-007 82 #define EXP_POLY_9_D 2.7557514545882439E-006 83 #define EXP_POLY_8_D 2.4801491039099165E-005 84 #define EXP_POLY_7_D 1.9841269589115497E-004 85 #define EXP_POLY_6_D 1.3888888945916380E-003 86 #define EXP_POLY_5_D 8.3333333334550432E-003 87 #define EXP_POLY_4_D 4.1666666666519754E-002 88 #define EXP_POLY_3_D 1.6666666666666477E-001 89 #define EXP_POLY_2_D 5.0000000000000122E-001 90 #define EXP_POLY_1_D 1.0000000000000000E+000 91 #define EXP_POLY_0_D 1.0000000000000000E+000 92 93 #define DBL2INT_CVT_D 6755399441055744.0 94 /* exp constants */ 95 96 97 /* pow constants */ 98 #define ONE_D 1 99 100 #define ALL_ONES_EXPONENT_D 0x7FF0000000000000 101 /* pow constants */ 102 103 104