| 1 | // Tencent is pleased to support the open source community by making ncnn available. |
| 2 | // |
| 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. |
| 4 | // |
| 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except |
| 6 | // in compliance with the License. You may obtain a copy of the License at |
| 7 | // |
| 8 | // https://opensource.org/licenses/BSD-3-Clause |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software distributed |
| 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
| 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 13 | // specific language governing permissions and limitations under the License. |
| 14 | |
| 15 | #ifndef NCNN_SIMPLEMATH_H |
| 16 | #define NCNN_SIMPLEMATH_H |
| 17 | |
| 18 | #include "platform.h" |
| 19 | |
| 20 | #if NCNN_SIMPLEMATH |
| 21 | |
| 22 | #ifdef __cplusplus |
| 23 | extern "C" { |
| 24 | #endif |
| 25 | /* |
| 26 | * ==================================================== |
| 27 | * discrete functions |
| 28 | * ==================================================== |
| 29 | */ |
| 30 | NCNN_EXPORT float fabs(float); |
| 31 | NCNN_EXPORT float fabsf(float); |
| 32 | NCNN_EXPORT float fmod(float, float); |
| 33 | NCNN_EXPORT float floor(float); |
| 34 | NCNN_EXPORT float floorf(float); |
| 35 | NCNN_EXPORT float round(float); |
| 36 | NCNN_EXPORT float roundf(float); |
| 37 | NCNN_EXPORT float ceil(float); |
| 38 | NCNN_EXPORT float ceilf(float); |
| 39 | NCNN_EXPORT float fmaxf(float, float); |
| 40 | NCNN_EXPORT float truncf(float); |
| 41 | NCNN_EXPORT float frac(float); |
| 42 | /* |
| 43 | * ==================================================== |
| 44 | * trigonometric functions |
| 45 | * ==================================================== |
| 46 | */ |
| 47 | NCNN_EXPORT float sinf(float); |
| 48 | NCNN_EXPORT float cosf(float); |
| 49 | NCNN_EXPORT float tanf(float); |
| 50 | NCNN_EXPORT float asinf(float); |
| 51 | NCNN_EXPORT float acosf(float); |
| 52 | NCNN_EXPORT float atanf(float); |
| 53 | NCNN_EXPORT float atan2f(float, float); |
| 54 | NCNN_EXPORT float tanhf(float); |
| 55 | |
| 56 | /* |
| 57 | * ==================================================== |
| 58 | * power functions |
| 59 | * ==================================================== |
| 60 | */ |
| 61 | NCNN_EXPORT float sqrtf(float); |
| 62 | NCNN_EXPORT float sqrt(float); |
| 63 | NCNN_EXPORT float powf(float, float); |
| 64 | |
| 65 | /* |
| 66 | * ==================================================== |
| 67 | * exponential and logarithm functions |
| 68 | * ==================================================== |
| 69 | */ |
| 70 | NCNN_EXPORT float expf(float); |
| 71 | NCNN_EXPORT float frexp(float, int*); |
| 72 | NCNN_EXPORT float logf(float); |
| 73 | NCNN_EXPORT float log(float); |
| 74 | NCNN_EXPORT float log10f(float); |
| 75 | |
| 76 | /* |
| 77 | * ==================================================== |
| 78 | * probability functions |
| 79 | * ==================================================== |
| 80 | */ |
| 81 | NCNN_EXPORT float erf(float); |
| 82 | NCNN_EXPORT float erff(float); |
| 83 | NCNN_EXPORT float erfcf(float); |
| 84 | |
| 85 | /* |
| 86 | * ==================================================== |
| 87 | * other functions |
| 88 | * ==================================================== |
| 89 | */ |
| 90 | NCNN_EXPORT int msb(unsigned int); |
| 91 | NCNN_EXPORT float fmaf(float, float, float); |
| 92 | NCNN_EXPORT float copysignf(float, float); |
| 93 | NCNN_EXPORT void fesetround(int); |
| 94 | NCNN_EXPORT int fegetround(); |
| 95 | NCNN_EXPORT float nearbyintf(float); |
| 96 | |
| 97 | #ifdef __cplusplus |
| 98 | } // extern "C" |
| 99 | #endif |
| 100 | |
| 101 | #endif // NCNN_SIMPLEMATH |
| 102 | |
| 103 | #endif // NCNN_SIMPLEMATH_H |