| 1 | /* CIVL model of math.h. Part of functions have optional assumption
|
|---|
| 2 | * models which are controlled by two macros:
|
|---|
| 3 | * 1. MATH_ELABORATE_ASSUMPTIONS: replacing a complicated assumption
|
|---|
| 4 | * expression which includes implications with a "if..else" statement.
|
|---|
| 5 | * This option reduces the complicity of the assumption expression but
|
|---|
| 6 | * increase the number of branches.
|
|---|
| 7 | * 2. MATH_NO_ASSUMPTIONS: for some cases that the return value is not
|
|---|
| 8 | * important, it's no need to add any assumption.
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 | #ifdef __CIVL_MATH__
|
|---|
| 12 | #else
|
|---|
| 13 | #define __CIVL_MATH__
|
|---|
| 14 | #include <math.h>
|
|---|
| 15 |
|
|---|
| 16 | double acos(double x) {
|
|---|
| 17 | $abstract double ACOS(double X);
|
|---|
| 18 | double result;
|
|---|
| 19 |
|
|---|
| 20 | $assert -1 <= x && x <=1 :
|
|---|
| 21 | "Argument x should be in interval[-1, 1]";
|
|---|
| 22 | result = ACOS(x);
|
|---|
| 23 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 24 | if(x == 1)
|
|---|
| 25 | return 0;
|
|---|
| 26 | else {
|
|---|
| 27 | $assume result > 0;
|
|---|
| 28 | return result;
|
|---|
| 29 | }
|
|---|
| 30 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 31 | return result;
|
|---|
| 32 | #else
|
|---|
| 33 | $assume ((x == 1 => result == 0) && (x != 1 => result > 0));
|
|---|
| 34 | return result;
|
|---|
| 35 | #endif
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | float acosf(float x) {
|
|---|
| 39 | $abstract float ACOSF(float X);
|
|---|
| 40 | double result;
|
|---|
| 41 |
|
|---|
| 42 | $assert -1 <= x && x <=1 :
|
|---|
| 43 | "Argument x should be in interval[-1, 1]";
|
|---|
| 44 | result = ACOSF(x);
|
|---|
| 45 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 46 | if(x == 1)
|
|---|
| 47 | return 0;
|
|---|
| 48 | else {
|
|---|
| 49 | $assume result > 0;
|
|---|
| 50 | return result;
|
|---|
| 51 | }
|
|---|
| 52 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 53 | return result;
|
|---|
| 54 | #else
|
|---|
| 55 | $assume ((x == 1 => result == 0) && (x != 1 => result > 0));
|
|---|
| 56 | return result;
|
|---|
| 57 | #endif
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | long double acosl(long double x) {
|
|---|
| 61 | $abstract long double ACOSL(long double X);
|
|---|
| 62 | double result;
|
|---|
| 63 |
|
|---|
| 64 | $assert -1 <= x && x <=1 :
|
|---|
| 65 | "Argument x should be in interval[-1, 1]";
|
|---|
| 66 | result = ACOSL(x);
|
|---|
| 67 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 68 | if(x == 1)
|
|---|
| 69 | return 0;
|
|---|
| 70 | else {
|
|---|
| 71 | $assume result > 0;
|
|---|
| 72 | return result;
|
|---|
| 73 | }
|
|---|
| 74 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 75 | return result;
|
|---|
| 76 | #else
|
|---|
| 77 | $assume ((x == 1 => result == 0) && (x != 1 => result > 0));
|
|---|
| 78 | return result;
|
|---|
| 79 | #endif
|
|---|
| 80 | }
|
|---|
| 81 |
|
|---|
| 82 | double asin(double x) {
|
|---|
| 83 | $abstract double ASIN(double X);
|
|---|
| 84 |
|
|---|
| 85 | $assert -1 <= x && x <= 1;
|
|---|
| 86 | "Argument x should be in interval[-1, 1]";
|
|---|
| 87 | return ASIN(x);
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | float asinf(float x) {
|
|---|
| 91 | $abstract float ASINF(float X);
|
|---|
| 92 |
|
|---|
| 93 | $assert -1 <= x && x <= 1;
|
|---|
| 94 | "Argument x should be in interval[-1, 1]";
|
|---|
| 95 | return ASINF(x);
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | long double asinl(long double x) {
|
|---|
| 99 | $abstract long double ASINL(long double X);
|
|---|
| 100 |
|
|---|
| 101 | $assert -1 <= x && x <= 1;
|
|---|
| 102 | "Argument x should be in interval[-1, 1]";
|
|---|
| 103 | return ASINL(x);
|
|---|
| 104 | }
|
|---|
| 105 |
|
|---|
| 106 | double atan(double x) {
|
|---|
| 107 | $abstract double ATAN(double X);
|
|---|
| 108 | return ATAN(x);
|
|---|
| 109 | }
|
|---|
| 110 |
|
|---|
| 111 | float atanf(float x) {
|
|---|
| 112 | $abstract float ATANF(float X);
|
|---|
| 113 | return ATANF(x);
|
|---|
| 114 | }
|
|---|
| 115 |
|
|---|
| 116 | long double atanl(long double x) {
|
|---|
| 117 | $abstract long double ATANL(long double X);
|
|---|
| 118 | return ATANL(x);
|
|---|
| 119 | }
|
|---|
| 120 |
|
|---|
| 121 | double atan2(double x, double y) {
|
|---|
| 122 | $abstract double ATAN2(double X, double Y);
|
|---|
| 123 |
|
|---|
| 124 | $assert x!=0 || y !=0 : "Arguments x and y"
|
|---|
| 125 | "should not be both 0";
|
|---|
| 126 | return ATAN2(x, y);
|
|---|
| 127 | }
|
|---|
| 128 |
|
|---|
| 129 | float atan2f(float x, float y) {
|
|---|
| 130 | $abstract float ATAN2F(float X, float Y);
|
|---|
| 131 |
|
|---|
| 132 | $assert x!=0.0 || y !=0.0 :
|
|---|
| 133 | "Arguments x and y should not be both 0";
|
|---|
| 134 | return ATAN2F(x, y);
|
|---|
| 135 | }
|
|---|
| 136 |
|
|---|
| 137 | long double atan2l(long double x, long double y) {
|
|---|
| 138 | $abstract long double ATAN2L(long double X,
|
|---|
| 139 | long double Y);
|
|---|
| 140 |
|
|---|
| 141 | $assert x!=0.0 || y !=0.0 :
|
|---|
| 142 | "Arguments x and y should not be both 0";
|
|---|
| 143 | return ATAN2L(x, y);
|
|---|
| 144 | }
|
|---|
| 145 |
|
|---|
| 146 | double cos(double x) {
|
|---|
| 147 | $abstract double COS(double X);
|
|---|
| 148 |
|
|---|
| 149 | return COS(x);
|
|---|
| 150 | }
|
|---|
| 151 |
|
|---|
| 152 | float cosf(float x) {
|
|---|
| 153 | $abstract float COSF(float X);
|
|---|
| 154 |
|
|---|
| 155 | return COSF(x);
|
|---|
| 156 | }
|
|---|
| 157 |
|
|---|
| 158 | long double cosl(long double x) {
|
|---|
| 159 | $abstract long double COSL(long double X);
|
|---|
| 160 |
|
|---|
| 161 | return COSL(x);
|
|---|
| 162 | }
|
|---|
| 163 |
|
|---|
| 164 | double sin(double x) {
|
|---|
| 165 | $abstract double SIN(double X);
|
|---|
| 166 |
|
|---|
| 167 | return SIN(x);
|
|---|
| 168 | }
|
|---|
| 169 |
|
|---|
| 170 | float sinf(float x) {
|
|---|
| 171 | $abstract float SINF(float X);
|
|---|
| 172 |
|
|---|
| 173 | return SINF(x);
|
|---|
| 174 | }
|
|---|
| 175 |
|
|---|
| 176 | long double sinl(long double x) {
|
|---|
| 177 | $abstract long double SINL(long double X);
|
|---|
| 178 |
|
|---|
| 179 | return SINL(x);
|
|---|
| 180 | }
|
|---|
| 181 |
|
|---|
| 182 | double tan(double x) {
|
|---|
| 183 | $abstract double TAN(double X);
|
|---|
| 184 |
|
|---|
| 185 | return TAN(x);
|
|---|
| 186 | }
|
|---|
| 187 |
|
|---|
| 188 | float tanf(float x) {
|
|---|
| 189 | $abstract float TANF(float X);
|
|---|
| 190 |
|
|---|
| 191 | return TANF(x);
|
|---|
| 192 | }
|
|---|
| 193 |
|
|---|
| 194 | long double tanl(long double x) {
|
|---|
| 195 | $abstract long double TANL(long double X);
|
|---|
| 196 |
|
|---|
| 197 | return TANL(x);
|
|---|
| 198 | }
|
|---|
| 199 |
|
|---|
| 200 | double acosh(double x) {
|
|---|
| 201 | $abstract double ACOSH(double X);
|
|---|
| 202 |
|
|---|
| 203 | $assert x >= 1 : "Argument x should not less than 1.";
|
|---|
| 204 | return ACOSH(x);
|
|---|
| 205 | }
|
|---|
| 206 |
|
|---|
| 207 | float acoshf(float x) {
|
|---|
| 208 | $abstract float ACOSHF(float X);
|
|---|
| 209 |
|
|---|
| 210 | $assert x >= 1 : "Argument x should not less than 1.";
|
|---|
| 211 | return ACOSHF(x);
|
|---|
| 212 | }
|
|---|
| 213 |
|
|---|
| 214 | long double acoshl(long double x) {
|
|---|
| 215 | $abstract long double ACOSHL(long double X);
|
|---|
| 216 |
|
|---|
| 217 | $assert x >= 1 : "Argument x should not less than 1.";
|
|---|
| 218 | return ACOSHL(x);
|
|---|
| 219 | }
|
|---|
| 220 |
|
|---|
| 221 | double asinh(double x) {
|
|---|
| 222 | $abstract double ASINH(double X);
|
|---|
| 223 |
|
|---|
| 224 | return ASINH(x);
|
|---|
| 225 | }
|
|---|
| 226 |
|
|---|
| 227 | float asinhf(float x) {
|
|---|
| 228 | $abstract float ASINHF(float X);
|
|---|
| 229 |
|
|---|
| 230 | return ASINHF(x);
|
|---|
| 231 | }
|
|---|
| 232 |
|
|---|
| 233 | long double asinhl(long double x) {
|
|---|
| 234 | $abstract long double ASINHL(long double X);
|
|---|
| 235 |
|
|---|
| 236 | return ASINHL(x);
|
|---|
| 237 | }
|
|---|
| 238 |
|
|---|
| 239 | double atanh(double x) {
|
|---|
| 240 | $abstract double ATANH(double X);
|
|---|
| 241 |
|
|---|
| 242 | $assert -1 < x && x < 1 :
|
|---|
| 243 | "Argument x should be in the interval (-1, 1)";
|
|---|
| 244 | return ATANH(x);
|
|---|
| 245 | }
|
|---|
| 246 |
|
|---|
| 247 | float atanhf(float x) {
|
|---|
| 248 | $abstract float ATANHF(float X);
|
|---|
| 249 |
|
|---|
| 250 | $assert -1 < x && x < 1 :
|
|---|
| 251 | "Argument x should be in the interval (-1, 1)";
|
|---|
| 252 | return ATANHF(x);
|
|---|
| 253 | }
|
|---|
| 254 |
|
|---|
| 255 | long double atanhl(long double x) {
|
|---|
| 256 | $abstract long double ATANHL(long double X);
|
|---|
| 257 |
|
|---|
| 258 | $assert -1 < x && x < 1 :
|
|---|
| 259 | "Argument x should be in the interval (-1, 1)";
|
|---|
| 260 | return ATANHL(x);
|
|---|
| 261 | }
|
|---|
| 262 |
|
|---|
| 263 | double cosh(double x) {
|
|---|
| 264 | $abstract double COSH(double X);
|
|---|
| 265 |
|
|---|
| 266 | return COSH(x);
|
|---|
| 267 | }
|
|---|
| 268 |
|
|---|
| 269 | float coshf(float x) {
|
|---|
| 270 | $abstract float COSHF(float X);
|
|---|
| 271 |
|
|---|
| 272 | return COSHF(x);
|
|---|
| 273 | }
|
|---|
| 274 |
|
|---|
| 275 | long double coshl(long double x) {
|
|---|
| 276 | $abstract long double COSHL(long double X);
|
|---|
| 277 |
|
|---|
| 278 | return COSHL(x);
|
|---|
| 279 | }
|
|---|
| 280 |
|
|---|
| 281 | double sinh(double x) {
|
|---|
| 282 | $abstract double SINH(double X);
|
|---|
| 283 |
|
|---|
| 284 | return SINH(x);
|
|---|
| 285 | }
|
|---|
| 286 |
|
|---|
| 287 | float sinhf(float x) {
|
|---|
| 288 | $abstract float SINHF(float X);
|
|---|
| 289 |
|
|---|
| 290 | return SINHF(x);
|
|---|
| 291 | }
|
|---|
| 292 |
|
|---|
| 293 | long double sinhl(long double x) {
|
|---|
| 294 | $abstract long double SINHL(long double X);
|
|---|
| 295 |
|
|---|
| 296 | return SINHL(x);
|
|---|
| 297 | }
|
|---|
| 298 |
|
|---|
| 299 | double tanh(double x) {
|
|---|
| 300 | $abstract double TANH(double X);
|
|---|
| 301 |
|
|---|
| 302 | return TANH(x);
|
|---|
| 303 | }
|
|---|
| 304 |
|
|---|
| 305 | float tanhf(float x) {
|
|---|
| 306 | $abstract float TANHF(float X);
|
|---|
| 307 |
|
|---|
| 308 | return TANHF(x);
|
|---|
| 309 | }
|
|---|
| 310 |
|
|---|
| 311 | long double tanhl(long double x) {
|
|---|
| 312 | $abstract long double TANHL(long double X);
|
|---|
| 313 |
|
|---|
| 314 | return TANHL(x);
|
|---|
| 315 | }
|
|---|
| 316 |
|
|---|
| 317 | double exp(double x) {
|
|---|
| 318 | $abstract double EXP(double X);
|
|---|
| 319 | double result = EXP(x);
|
|---|
| 320 |
|
|---|
| 321 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 322 | if(x == 0)
|
|---|
| 323 | return 1;
|
|---|
| 324 | else {
|
|---|
| 325 | $assume result > 0;
|
|---|
| 326 | return result;
|
|---|
| 327 | }
|
|---|
| 328 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 329 | return result;
|
|---|
| 330 | #else
|
|---|
| 331 | $assume ((x==0 => result == 1) && (x!=0 => result > 0));
|
|---|
| 332 | return result;
|
|---|
| 333 | #endif
|
|---|
| 334 | }
|
|---|
| 335 |
|
|---|
| 336 | float expf(float x) {
|
|---|
| 337 | $abstract float EXPF(float X);
|
|---|
| 338 | double result = EXPF(x);
|
|---|
| 339 |
|
|---|
| 340 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 341 | if(x == 0)
|
|---|
| 342 | return 1;
|
|---|
| 343 | else {
|
|---|
| 344 | $assume result > 0 ;
|
|---|
| 345 | return result;
|
|---|
| 346 | }
|
|---|
| 347 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 348 | return result;
|
|---|
| 349 | #else
|
|---|
| 350 | $assume ((x==0 => result == 1) && (x!=0 => result > 0));
|
|---|
| 351 | return result;
|
|---|
| 352 | #endif
|
|---|
| 353 | }
|
|---|
| 354 |
|
|---|
| 355 | long double expl(long double x) {
|
|---|
| 356 | $abstract long double EXPL(long double X);
|
|---|
| 357 | double result = EXPL(x);
|
|---|
| 358 |
|
|---|
| 359 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 360 | if(x == 0)
|
|---|
| 361 | return 1;
|
|---|
| 362 | else {
|
|---|
| 363 | $assume result > 0 ;
|
|---|
| 364 | return result;
|
|---|
| 365 | }
|
|---|
| 366 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 367 | return result;
|
|---|
| 368 | #else
|
|---|
| 369 | $assume ((x==0 => result == 1) && (x!=0 => result > 0));
|
|---|
| 370 | return result;
|
|---|
| 371 | #endif
|
|---|
| 372 | }
|
|---|
| 373 |
|
|---|
| 374 | double exp2(double x) {
|
|---|
| 375 | $abstract double EXP2(double X);
|
|---|
| 376 | double result = EXP2(x);
|
|---|
| 377 |
|
|---|
| 378 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 379 | if(x == 0)
|
|---|
| 380 | return 1;
|
|---|
| 381 | else {
|
|---|
| 382 | $assume result > 0 ;
|
|---|
| 383 | return result;
|
|---|
| 384 | }
|
|---|
| 385 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 386 | return result;
|
|---|
| 387 | #else
|
|---|
| 388 | $assume ((x==0 => result == 1) && (x!=0 => result > 0));
|
|---|
| 389 | return result;
|
|---|
| 390 | #endif
|
|---|
| 391 | }
|
|---|
| 392 |
|
|---|
| 393 | float exp2f(float x) {
|
|---|
| 394 | $abstract float EXP2F(float X);
|
|---|
| 395 | double result = EXP2F(x);
|
|---|
| 396 |
|
|---|
| 397 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 398 | if(x == 0)
|
|---|
| 399 | return 1;
|
|---|
| 400 | else {
|
|---|
| 401 | $assume result > 0 ;
|
|---|
| 402 | return result;
|
|---|
| 403 | }
|
|---|
| 404 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 405 | return result;
|
|---|
| 406 | #else
|
|---|
| 407 | $assume ((x==0 => result == 1) && (x!=0 => result > 0));
|
|---|
| 408 | return result;
|
|---|
| 409 | #endif
|
|---|
| 410 | }
|
|---|
| 411 |
|
|---|
| 412 | long double exp2l(long double x) {
|
|---|
| 413 | $abstract long double EXP2L(long double X);
|
|---|
| 414 | double result = EXP2L(x);
|
|---|
| 415 |
|
|---|
| 416 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 417 | if(x == 0)
|
|---|
| 418 | return 1;
|
|---|
| 419 | else {
|
|---|
| 420 | $assume result > 0 ;
|
|---|
| 421 | return result;
|
|---|
| 422 | }
|
|---|
| 423 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 424 | return result;
|
|---|
| 425 | #else
|
|---|
| 426 | $assume ((x==0 => result == 1) && (x!=0 => result > 0));
|
|---|
| 427 | return result;
|
|---|
| 428 | #endif
|
|---|
| 429 | }
|
|---|
| 430 |
|
|---|
| 431 | double expm1(double x) {
|
|---|
| 432 | $abstract double EXPM1(double X);
|
|---|
| 433 | double result = EXPM1(x);
|
|---|
| 434 |
|
|---|
| 435 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 436 | if(x == 0)
|
|---|
| 437 | return 0;
|
|---|
| 438 | else {
|
|---|
| 439 | $assume result > -1;
|
|---|
| 440 | return result;
|
|---|
| 441 | }
|
|---|
| 442 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 443 | return result;
|
|---|
| 444 | #else
|
|---|
| 445 | $assume ((x==0 => result == 0) && (x!=0 => result > -1));
|
|---|
| 446 | return result;
|
|---|
| 447 | #endif
|
|---|
| 448 | }
|
|---|
| 449 |
|
|---|
| 450 | float expm1f(float x) {
|
|---|
| 451 | $abstract float EXPM1F(float X);
|
|---|
| 452 | double result = EXPM1F(x);
|
|---|
| 453 |
|
|---|
| 454 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 455 | if(x == 0)
|
|---|
| 456 | return 0;
|
|---|
| 457 | else {
|
|---|
| 458 | $assume result > -1;
|
|---|
| 459 | return result;
|
|---|
| 460 | }
|
|---|
| 461 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 462 | return result;
|
|---|
| 463 | #else
|
|---|
| 464 | $assume ((x==0 => result == 0) && (x!=0 => result > -1));
|
|---|
| 465 | return result;
|
|---|
| 466 | #endif
|
|---|
| 467 | }
|
|---|
| 468 |
|
|---|
| 469 | long double expm1l(long double x) {
|
|---|
| 470 | $abstract long double EXPM1L(long double X);
|
|---|
| 471 | double result = EXPM1L(x);
|
|---|
| 472 |
|
|---|
| 473 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 474 | if(x == 0)
|
|---|
| 475 | return 0;
|
|---|
| 476 | else {
|
|---|
| 477 | $assume result > -1;
|
|---|
| 478 | return result;
|
|---|
| 479 | }
|
|---|
| 480 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 481 | return result;
|
|---|
| 482 | #else
|
|---|
| 483 | $assume ((x==0 => result == 0) && (x!=0 => result > -1));
|
|---|
| 484 | return result;
|
|---|
| 485 | #endif
|
|---|
| 486 | }
|
|---|
| 487 |
|
|---|
| 488 | double frexp(double x, int * exp) {
|
|---|
| 489 | $abstract double FREXP_X(double X);
|
|---|
| 490 | $abstract int FREXP_EXP(double X);
|
|---|
| 491 |
|
|---|
| 492 | (*exp) = FREXP_EXP(x);
|
|---|
| 493 | $assume (FREXP_X(x) >= 1/2 && FREXP_X(x) < 1) ||
|
|---|
| 494 | FREXP_X(x) == 0;
|
|---|
| 495 | return FREXP_X(x);
|
|---|
| 496 | }
|
|---|
| 497 |
|
|---|
| 498 | float frexpf(float x, int *exp) {
|
|---|
| 499 | $abstract float FREXPF_X(float X);
|
|---|
| 500 | $abstract int FREXPF_EXP(float X);
|
|---|
| 501 |
|
|---|
| 502 | (*exp) = FREXPF_EXP(x);
|
|---|
| 503 | $assume (FREXPF_X(x) >= 1/2 && FREXPF_X(x) < 1) ||
|
|---|
| 504 | FREXPF_X(x) == 0;
|
|---|
| 505 | return FREXPF_X(x);
|
|---|
| 506 | }
|
|---|
| 507 |
|
|---|
| 508 | long double frexpl(long double x, int *exp) {
|
|---|
| 509 | $abstract long double FREXPL_X(long double X);
|
|---|
| 510 | $abstract int FREXPL_EXP(long double X);
|
|---|
| 511 |
|
|---|
| 512 | (*exp) = FREXPL_EXP(x);
|
|---|
| 513 | $assume (FREXPL_X(x) >= 1/2 && FREXPL_X(x) < 1) ||
|
|---|
| 514 | FREXPL_X(x) == 0;
|
|---|
| 515 | return FREXPL_X(x);
|
|---|
| 516 | }
|
|---|
| 517 |
|
|---|
| 518 | int ilogb(double x) {
|
|---|
| 519 | $abstract int ILOGB(double X);
|
|---|
| 520 |
|
|---|
| 521 | //TODO: x can not be infinite or NaN neither.
|
|---|
| 522 | $assert x != 0 : "Argument x cannot be zero.";
|
|---|
| 523 | return ILOGB(x);
|
|---|
| 524 | }
|
|---|
| 525 |
|
|---|
| 526 | int ilogbf(float x) {
|
|---|
| 527 | $abstract int ILOGBF(float X);
|
|---|
| 528 |
|
|---|
| 529 | //TODO: x can not be infinite or NaN neither.
|
|---|
| 530 | $assert x != 0 : "Argument x cannot be zero.";
|
|---|
| 531 | return ILOGBF(x);
|
|---|
| 532 | }
|
|---|
| 533 |
|
|---|
| 534 | int ilogbl(long double x) {
|
|---|
| 535 | $abstract int ILOGBL(long double X);
|
|---|
| 536 |
|
|---|
| 537 | //TODO: x can not be infinite or NaN neither.
|
|---|
| 538 | $assert x != 0 : "Argument x cannot be zero.";
|
|---|
| 539 | return ILOGBL(x);
|
|---|
| 540 | }
|
|---|
| 541 |
|
|---|
| 542 | double ldexp(double x, int exp) {
|
|---|
| 543 | $abstract double LDEXP(double X, int EXP);
|
|---|
| 544 |
|
|---|
| 545 | return LDEXP(x, exp);
|
|---|
| 546 | }
|
|---|
| 547 |
|
|---|
| 548 | float ldexpf(float x, int exp) {
|
|---|
| 549 | $abstract float LDEXPF(float X, int EXP);
|
|---|
| 550 |
|
|---|
| 551 | return LDEXPF(x, exp);
|
|---|
| 552 | }
|
|---|
| 553 |
|
|---|
| 554 | long double ldexpl(long double x, int exp) {
|
|---|
| 555 | $abstract long double LDEXPL(long double X, int EXP);
|
|---|
| 556 |
|
|---|
| 557 | return LDEXPL(x, exp);
|
|---|
| 558 | }
|
|---|
| 559 |
|
|---|
| 560 | double log(double x) {
|
|---|
| 561 | $abstract double LOG(double X);
|
|---|
| 562 | double result = LOG(x);
|
|---|
| 563 |
|
|---|
| 564 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 565 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 566 | if(x == 1)
|
|---|
| 567 | return 0;
|
|---|
| 568 | else {
|
|---|
| 569 | $assume result != 0;
|
|---|
| 570 | return result;
|
|---|
| 571 | }
|
|---|
| 572 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 573 | return result;
|
|---|
| 574 | #else
|
|---|
| 575 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 576 | return result;
|
|---|
| 577 | #endif
|
|---|
| 578 | }
|
|---|
| 579 |
|
|---|
| 580 | float logf(float x) {
|
|---|
| 581 | $abstract float LOGF(float X);
|
|---|
| 582 | float result = LOGF(x);
|
|---|
| 583 |
|
|---|
| 584 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 585 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 586 | if(x == 1)
|
|---|
| 587 | return 0;
|
|---|
| 588 | else {
|
|---|
| 589 | $assume result != 0;
|
|---|
| 590 | return result;
|
|---|
| 591 | }
|
|---|
| 592 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 593 | return result;
|
|---|
| 594 | #else
|
|---|
| 595 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 596 | return result;
|
|---|
| 597 | #endif
|
|---|
| 598 | }
|
|---|
| 599 |
|
|---|
| 600 | long double logl(long double x) {
|
|---|
| 601 | $abstract long double LOGL(long double X);
|
|---|
| 602 | long double result = LOGL(x);
|
|---|
| 603 |
|
|---|
| 604 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 605 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 606 | if(x == 1)
|
|---|
| 607 | return 0;
|
|---|
| 608 | else {
|
|---|
| 609 | $assume result != 0;
|
|---|
| 610 | return result;
|
|---|
| 611 | }
|
|---|
| 612 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 613 | return result;
|
|---|
| 614 | #else
|
|---|
| 615 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 616 | return result;
|
|---|
| 617 | #endif
|
|---|
| 618 | }
|
|---|
| 619 |
|
|---|
| 620 | double log10(double x) {
|
|---|
| 621 | $abstract double LOG10(double X);
|
|---|
| 622 | double result = LOG10(x);
|
|---|
| 623 |
|
|---|
| 624 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 625 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 626 | if(x == 1)
|
|---|
| 627 | return 0;
|
|---|
| 628 | else {
|
|---|
| 629 | $assume result != 0;
|
|---|
| 630 | return result;
|
|---|
| 631 | }
|
|---|
| 632 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 633 | return result;
|
|---|
| 634 | #else
|
|---|
| 635 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 636 | return result;
|
|---|
| 637 | #endif
|
|---|
| 638 | }
|
|---|
| 639 |
|
|---|
| 640 | float log10f(float x) {
|
|---|
| 641 | $abstract float LOG10F(float X);
|
|---|
| 642 | float result = LOG10F(x);
|
|---|
| 643 |
|
|---|
| 644 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 645 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 646 | if(x == 1)
|
|---|
| 647 | return 0;
|
|---|
| 648 | else {
|
|---|
| 649 | $assume result != 0;
|
|---|
| 650 | return result;
|
|---|
| 651 | }
|
|---|
| 652 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 653 | return result;
|
|---|
| 654 | #else
|
|---|
| 655 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 656 | return result;
|
|---|
| 657 | #endif
|
|---|
| 658 | }
|
|---|
| 659 |
|
|---|
| 660 | long double log10l(long double x) {
|
|---|
| 661 | $abstract long double LOG10L(long double X);
|
|---|
| 662 | long double result = LOG10L(x);
|
|---|
| 663 |
|
|---|
| 664 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 665 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 666 | if(x == 1)
|
|---|
| 667 | return 0;
|
|---|
| 668 | else {
|
|---|
| 669 | $assume result != 0;
|
|---|
| 670 | return result;
|
|---|
| 671 | }
|
|---|
| 672 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 673 | return result;
|
|---|
| 674 | #else
|
|---|
| 675 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 676 | return result;
|
|---|
| 677 | #endif
|
|---|
| 678 | }
|
|---|
| 679 |
|
|---|
| 680 | double log1p(double x) {
|
|---|
| 681 | $abstract double LOG1P(double X);
|
|---|
| 682 |
|
|---|
| 683 | $assert x > -1 : "Argument x should be greater than -1";
|
|---|
| 684 | return LOG1P(x);
|
|---|
| 685 | }
|
|---|
| 686 |
|
|---|
| 687 | float log1pf(float x) {
|
|---|
| 688 | $abstract float LOG1PF(float X);
|
|---|
| 689 |
|
|---|
| 690 | $assert x > -1 : "Argument x should be greater than -1";
|
|---|
| 691 | return LOG1PF(x);
|
|---|
| 692 | }
|
|---|
| 693 |
|
|---|
| 694 | long double log1pl(long double x) {
|
|---|
| 695 | $abstract long double LOG1PL(long double X);
|
|---|
| 696 |
|
|---|
| 697 | $assert x > -1 : "Argument x should be greater than -1";
|
|---|
| 698 | return LOG1PL(x);
|
|---|
| 699 | }
|
|---|
| 700 |
|
|---|
| 701 | double log2(double x) {
|
|---|
| 702 | $abstract double LOG2(double X);
|
|---|
| 703 | double result = LOG2(x);
|
|---|
| 704 |
|
|---|
| 705 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 706 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 707 | if(x == 1)
|
|---|
| 708 | return 0;
|
|---|
| 709 | else {
|
|---|
| 710 | $assume result != 0;
|
|---|
| 711 | return result;
|
|---|
| 712 | }
|
|---|
| 713 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 714 | return result;
|
|---|
| 715 | #else
|
|---|
| 716 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 717 | return result;
|
|---|
| 718 | #endif
|
|---|
| 719 | }
|
|---|
| 720 |
|
|---|
| 721 | float log2f(float x) {
|
|---|
| 722 | $abstract float LOG2F(float X);
|
|---|
| 723 | float result = LOG2F(x);
|
|---|
| 724 |
|
|---|
| 725 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 726 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 727 | if(x == 1)
|
|---|
| 728 | return 0;
|
|---|
| 729 | else {
|
|---|
| 730 | $assume result != 0;
|
|---|
| 731 | return result;
|
|---|
| 732 | }
|
|---|
| 733 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 734 | return result;
|
|---|
| 735 | #else
|
|---|
| 736 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 737 | return result;
|
|---|
| 738 | #endif
|
|---|
| 739 | }
|
|---|
| 740 |
|
|---|
| 741 | long double log2l(long double x) {
|
|---|
| 742 | $abstract long double LOG2L(long double X);
|
|---|
| 743 | long double result = LOG2L(x);
|
|---|
| 744 |
|
|---|
| 745 | $assert x > 0 : "Argument x should be greater than 0";
|
|---|
| 746 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 747 | if(x == 1)
|
|---|
| 748 | return 0;
|
|---|
| 749 | else {
|
|---|
| 750 | $assume result != 0;
|
|---|
| 751 | return result;
|
|---|
| 752 | }
|
|---|
| 753 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 754 | return result;
|
|---|
| 755 | #else
|
|---|
| 756 | $assume ((x==1) => (result==0)) && ((x!=1) => (result!=0));
|
|---|
| 757 | return result;
|
|---|
| 758 | #endif
|
|---|
| 759 | }
|
|---|
| 760 |
|
|---|
| 761 | double logb(double x) {
|
|---|
| 762 | $abstract double LOGB(double X);
|
|---|
| 763 |
|
|---|
| 764 | $assert x != 0 : "Argument x should not equal to 0";
|
|---|
| 765 | return LOGB(x);
|
|---|
| 766 | }
|
|---|
| 767 |
|
|---|
| 768 | float logbf(float x) {
|
|---|
| 769 | $abstract float LOGBF(float X);
|
|---|
| 770 |
|
|---|
| 771 | $assert x != 0 : "Argument x should not equal to 0";
|
|---|
| 772 | return LOGBF(x);
|
|---|
| 773 | }
|
|---|
| 774 |
|
|---|
| 775 | long double logbl(long double x) {
|
|---|
| 776 | $abstract long double LOGBL(long double X);
|
|---|
| 777 |
|
|---|
| 778 | $assert x != 0 : "Argument x should not equal to 0";
|
|---|
| 779 | return LOGBL(x);
|
|---|
| 780 | }
|
|---|
| 781 |
|
|---|
| 782 | double modf(double value, double *iptr) {
|
|---|
| 783 | $abstract double MODF_VALUE(double v);
|
|---|
| 784 | $abstract double MODF_EXP(double v);
|
|---|
| 785 |
|
|---|
| 786 | (*iptr) = MODF_EXP(value);
|
|---|
| 787 | return MODF_VALUE(value);
|
|---|
| 788 | }
|
|---|
| 789 |
|
|---|
| 790 | float modff(float value, float *iptr) {
|
|---|
| 791 | $abstract float MODFF_VALUE(float v);
|
|---|
| 792 | $abstract float MODFF_EXP(float v);
|
|---|
| 793 |
|
|---|
| 794 | (*iptr) = MODFF_EXP(value);
|
|---|
| 795 | return MODFF_VALUE(value);
|
|---|
| 796 | }
|
|---|
| 797 |
|
|---|
| 798 | long double modfl(long double value, long double *iptr) {
|
|---|
| 799 | $abstract long double MODFL_VALUE(long double v);
|
|---|
| 800 | $abstract long double MODFL_EXP(long double v);
|
|---|
| 801 |
|
|---|
| 802 | (*iptr) = MODFL_EXP(value);
|
|---|
| 803 | return MODFL_VALUE(value);
|
|---|
| 804 | }
|
|---|
| 805 |
|
|---|
| 806 | double scalbn(double x, int n) {
|
|---|
| 807 | $abstract double SCALBN(double x, int n);
|
|---|
| 808 |
|
|---|
| 809 | return SCALBN(x, n);
|
|---|
| 810 | }
|
|---|
| 811 |
|
|---|
| 812 | float scalbnf(float x, int n) {
|
|---|
| 813 | $abstract float SCALBNF(float x, int n);
|
|---|
| 814 |
|
|---|
| 815 | return SCALBNF(x, n);
|
|---|
| 816 | }
|
|---|
| 817 |
|
|---|
| 818 | long double scalbnl(long double x, int n) {
|
|---|
| 819 | $abstract long double SCALBNL(long double x, int n);
|
|---|
| 820 |
|
|---|
| 821 | return SCALBNL(x, n);
|
|---|
| 822 | }
|
|---|
| 823 |
|
|---|
| 824 | double scalbln(double x, int n) {
|
|---|
| 825 | $abstract double SCALBLN(double x, int n);
|
|---|
| 826 |
|
|---|
| 827 | return SCALBLN(x, n);
|
|---|
| 828 | }
|
|---|
| 829 |
|
|---|
| 830 | float scalblnf(float x, int n) {
|
|---|
| 831 | $abstract float SCALBLNF(float x, int n);
|
|---|
| 832 |
|
|---|
| 833 | return SCALBLNF(x, n);
|
|---|
| 834 | }
|
|---|
| 835 |
|
|---|
| 836 | long double scalblnl(long double x, int n) {
|
|---|
| 837 | $abstract long double SCALBLNL(long double x, int n);
|
|---|
| 838 |
|
|---|
| 839 | return SCALBLNL(x, n);
|
|---|
| 840 | }
|
|---|
| 841 |
|
|---|
| 842 | double cbrt(double x) {
|
|---|
| 843 | $abstract double CBRT(double x);
|
|---|
| 844 |
|
|---|
| 845 | return CBRT(x);
|
|---|
| 846 | }
|
|---|
| 847 |
|
|---|
| 848 | float cbrtf(float x) {
|
|---|
| 849 | $abstract float CBRTF(float x);
|
|---|
| 850 |
|
|---|
| 851 | return CBRTF(x);
|
|---|
| 852 | }
|
|---|
| 853 |
|
|---|
| 854 | long double cbrtl(long double x) {
|
|---|
| 855 | $abstract long double CBRTL(long double x);
|
|---|
| 856 |
|
|---|
| 857 | return CBRTL(x);
|
|---|
| 858 | }
|
|---|
| 859 |
|
|---|
| 860 | double fabs(double x) {
|
|---|
| 861 | #ifdef MATH_NO_ASSUMPTIONS
|
|---|
| 862 | if(x >= 0)
|
|---|
| 863 | return x;
|
|---|
| 864 | else
|
|---|
| 865 | return -x;
|
|---|
| 866 | #else
|
|---|
| 867 | $abstract double FABS(double x);
|
|---|
| 868 | $assume FABS(x) >= 0;
|
|---|
| 869 | return FABS(x);
|
|---|
| 870 | #endif
|
|---|
| 871 | }
|
|---|
| 872 |
|
|---|
| 873 | float fabsf(float x) {
|
|---|
| 874 | #ifdef MATH_NO_ASSUMPTIONS
|
|---|
| 875 | if(x >= 0)
|
|---|
| 876 | return x;
|
|---|
| 877 | else
|
|---|
| 878 | return -x;
|
|---|
| 879 | #else
|
|---|
| 880 | $abstract double FABSF(double x);
|
|---|
| 881 | $assume FABSF(x) >= 0;
|
|---|
| 882 | return FABSF(x);
|
|---|
| 883 | #endif
|
|---|
| 884 | }
|
|---|
| 885 |
|
|---|
| 886 | long double fabsl(long double x) {
|
|---|
| 887 | #ifdef MATH_NO_ASSUMPTIONS
|
|---|
| 888 | if(x >= 0)
|
|---|
| 889 | return x;
|
|---|
| 890 | else
|
|---|
| 891 | return -x;
|
|---|
| 892 | #else
|
|---|
| 893 | $abstract double FABSL(double x);
|
|---|
| 894 | $assume FABSL(x) >= 0;
|
|---|
| 895 | return FABSL(x);
|
|---|
| 896 | #endif
|
|---|
| 897 | }
|
|---|
| 898 |
|
|---|
| 899 | double sqrt(double x) {
|
|---|
| 900 | $abstract double SQRT(double x);
|
|---|
| 901 | double result;
|
|---|
| 902 |
|
|---|
| 903 | $assert x >= 0 : "Argument x should be greater than 0.";
|
|---|
| 904 | result = SQRT(x);
|
|---|
| 905 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 906 | if(x == 0)
|
|---|
| 907 | return 0;
|
|---|
| 908 | else {
|
|---|
| 909 | $assume result > 0;
|
|---|
| 910 | return result;
|
|---|
| 911 | }
|
|---|
| 912 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 913 | return result;
|
|---|
| 914 | #else
|
|---|
| 915 | $assume (x == 0 => result == 0) && (x > 0 => result > 0);
|
|---|
| 916 | return result;
|
|---|
| 917 | #endif
|
|---|
| 918 | }
|
|---|
| 919 |
|
|---|
| 920 | float sqrtf(float x) {
|
|---|
| 921 | $abstract float SQRTF(float x);
|
|---|
| 922 | double result;
|
|---|
| 923 |
|
|---|
| 924 | $assert x >= 0 : "Argument x should be greater than 0.";
|
|---|
| 925 | result = SQRTF(x);
|
|---|
| 926 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 927 | if(x == 0)
|
|---|
| 928 | return 0;
|
|---|
| 929 | else {
|
|---|
| 930 | $assume result > 0;
|
|---|
| 931 | return result;
|
|---|
| 932 | }
|
|---|
| 933 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 934 | return result;
|
|---|
| 935 | #else
|
|---|
| 936 | $assume (x == 0 => result == 0) && (x > 0 => result > 0);
|
|---|
| 937 | return result;
|
|---|
| 938 | #endif
|
|---|
| 939 | }
|
|---|
| 940 |
|
|---|
| 941 | long double sqrtl(long double x) {
|
|---|
| 942 | $abstract long double SQRTL(long double x);
|
|---|
| 943 | double result;
|
|---|
| 944 |
|
|---|
| 945 | $assert x >= 0 : "Argument x should be greater than 0.";
|
|---|
| 946 | result = SQRTL(x);
|
|---|
| 947 | #ifdef MATH_ELABORATE_ASSUMPTIONS
|
|---|
| 948 | if(x == 0)
|
|---|
| 949 | return 0;
|
|---|
| 950 | else {
|
|---|
| 951 | $assume result > 0;
|
|---|
| 952 | return result;
|
|---|
| 953 | }
|
|---|
| 954 | #elif defined(MATH_NO_ASSUMPTIONS)
|
|---|
| 955 | return result;
|
|---|
| 956 | #else
|
|---|
| 957 | $assume (x == 0 => result == 0) && (x > 0 => result > 0);
|
|---|
| 958 | return result;
|
|---|
| 959 | #endif
|
|---|
| 960 | }
|
|---|
| 961 |
|
|---|
| 962 | double hypot(double x, double y) {
|
|---|
| 963 | double xsqrPLUSysqr = x*x + y*y;
|
|---|
| 964 |
|
|---|
| 965 | return sqrt(xsqrPLUSysqr);
|
|---|
| 966 | }
|
|---|
| 967 |
|
|---|
| 968 | float hypotf(float x, float y) {
|
|---|
| 969 | double xsqrPLUSysqr = x*x + y*y;
|
|---|
| 970 |
|
|---|
| 971 | return sqrtf(xsqrPLUSysqr);
|
|---|
| 972 | }
|
|---|
| 973 |
|
|---|
| 974 | long double hypotl(long double x, long double y) {
|
|---|
| 975 | double xsqrPLUSysqr = x*x + y*y;
|
|---|
| 976 |
|
|---|
| 977 | return sqrtl(xsqrPLUSysqr);
|
|---|
| 978 | }
|
|---|
| 979 |
|
|---|
| 980 | double pow(double x, double y) {
|
|---|
| 981 | $abstract double POW(double x, double y);
|
|---|
| 982 |
|
|---|
| 983 | $assert x != 0 || y > 0 : "It's invalid that argument x "
|
|---|
| 984 | "is 0 and y is no greater than 0.";
|
|---|
| 985 | return POW(x, y);
|
|---|
| 986 | }
|
|---|
| 987 |
|
|---|
| 988 | float powf(float x, float y) {
|
|---|
| 989 | $abstract float POWF(float x, float y);
|
|---|
| 990 |
|
|---|
| 991 | $assert x != 0 || y > 0 : "It's invalid that argument x "
|
|---|
| 992 | "is 0 and y is no greater than 0.";
|
|---|
| 993 | return POWF(x, y);
|
|---|
| 994 | }
|
|---|
| 995 |
|
|---|
| 996 | long double powl(long double x, long double y) {
|
|---|
| 997 | $abstract long double POWL(long double x,
|
|---|
| 998 | long double y);
|
|---|
| 999 |
|
|---|
| 1000 | $assert x != 0 || y > 0 : "It's invalid that argument x "
|
|---|
| 1001 | "is 0 and y is no greater than 0.";
|
|---|
| 1002 | return POWL(x, y);
|
|---|
| 1003 | }
|
|---|
| 1004 |
|
|---|
| 1005 | double erf(double x) {
|
|---|
| 1006 | $abstract double ERF(double x);
|
|---|
| 1007 |
|
|---|
| 1008 | return ERF(x);
|
|---|
| 1009 | }
|
|---|
| 1010 |
|
|---|
| 1011 | float erff(float x) {
|
|---|
| 1012 | $abstract float ERFF(float x);
|
|---|
| 1013 |
|
|---|
| 1014 | return ERFF(x);
|
|---|
| 1015 | }
|
|---|
| 1016 |
|
|---|
| 1017 | long double erfl(long double x) {
|
|---|
| 1018 | $abstract long double ERFL(long double x);
|
|---|
| 1019 |
|
|---|
| 1020 | return ERFL(x);
|
|---|
| 1021 | }
|
|---|
| 1022 |
|
|---|
| 1023 | double erfc(double x) {
|
|---|
| 1024 | $abstract double ERFC(double x);
|
|---|
| 1025 |
|
|---|
| 1026 | return ERFC(x);
|
|---|
| 1027 | }
|
|---|
| 1028 |
|
|---|
| 1029 | float erfcf(float x) {
|
|---|
| 1030 | $abstract float ERFCF(float x);
|
|---|
| 1031 |
|
|---|
| 1032 | return ERFCF(x);
|
|---|
| 1033 | }
|
|---|
| 1034 |
|
|---|
| 1035 | long double erfcl(long double x) {
|
|---|
| 1036 | $abstract long double ERFCL(long double x);
|
|---|
| 1037 |
|
|---|
| 1038 | return ERFCL(x);
|
|---|
| 1039 | }
|
|---|
| 1040 |
|
|---|
| 1041 | double lgamma(double x) {
|
|---|
| 1042 | $abstract double LGAMMA(double x);
|
|---|
| 1043 |
|
|---|
| 1044 | $assert(x > 0) :"Argument x should be greater than 0";
|
|---|
| 1045 | return LGAMMA(x);
|
|---|
| 1046 | }
|
|---|
| 1047 |
|
|---|
| 1048 | float lgammaf(float x) {
|
|---|
| 1049 | $abstract float LGAMMAF(float x);
|
|---|
| 1050 |
|
|---|
| 1051 | $assert(x > 0) :"Argument x should be greater than 0";
|
|---|
| 1052 | return LGAMMAF(x);
|
|---|
| 1053 | }
|
|---|
| 1054 |
|
|---|
| 1055 | long double lgammal(long double x) {
|
|---|
| 1056 | $abstract long double LGAMMAL(long double x);
|
|---|
| 1057 |
|
|---|
| 1058 | $assert(x > 0) :"Argument x should be greater than 0";
|
|---|
| 1059 | return LGAMMAL(x);
|
|---|
| 1060 | }
|
|---|
| 1061 |
|
|---|
| 1062 | double tgamma(double x) {
|
|---|
| 1063 | $abstract double TGAMMA(double x);
|
|---|
| 1064 |
|
|---|
| 1065 | $assert(x > 0) :"Argument x should be greater than 0";
|
|---|
| 1066 | return TGAMMA(x);
|
|---|
| 1067 | }
|
|---|
| 1068 |
|
|---|
| 1069 | float tgammaf(float x) {
|
|---|
| 1070 | $abstract float TGAMMAF(float x);
|
|---|
| 1071 |
|
|---|
| 1072 | $assert(x > 0) :"Argument x should be greater than 0";
|
|---|
| 1073 | return TGAMMAF(x);
|
|---|
| 1074 | }
|
|---|
| 1075 |
|
|---|
| 1076 | long double tgammal(long double x) {
|
|---|
| 1077 | $abstract long double TGAMMAL(long double x);
|
|---|
| 1078 |
|
|---|
| 1079 | $assert(x > 0) :"Argument x should be greater than 0";
|
|---|
| 1080 | return TGAMMAL(x);
|
|---|
| 1081 | }
|
|---|
| 1082 |
|
|---|
| 1083 | double ceil(double x) {
|
|---|
| 1084 | $abstract double CEIL(double x);
|
|---|
| 1085 |
|
|---|
| 1086 | $assume CEIL(x) >= x && CEIL(x) < (x + 1);
|
|---|
| 1087 | return CEIL(x);
|
|---|
| 1088 | }
|
|---|
| 1089 |
|
|---|
| 1090 | float ceilf(float x) {
|
|---|
| 1091 | $abstract float CEILF(float x);
|
|---|
| 1092 |
|
|---|
| 1093 | $assume CEILF(x) >= x && CEILF(x) < (x + 1);
|
|---|
| 1094 | return CEILF(x);
|
|---|
| 1095 | }
|
|---|
| 1096 |
|
|---|
| 1097 | long double ceill(long double x) {
|
|---|
| 1098 | $abstract long double CEILL(long double x);
|
|---|
| 1099 |
|
|---|
| 1100 | $assume CEILL(x) >= x && CEILL(x) < (x + 1);
|
|---|
| 1101 | return CEILL(x);
|
|---|
| 1102 | }
|
|---|
| 1103 |
|
|---|
| 1104 | double floor(double x) {
|
|---|
| 1105 | $abstract double FLOOR(double x);
|
|---|
| 1106 |
|
|---|
| 1107 | $assume FLOOR(x) <= x && FLOOR(x) > (x - 1);
|
|---|
| 1108 | return FLOOR(x);
|
|---|
| 1109 | }
|
|---|
| 1110 |
|
|---|
| 1111 | float floorf(float x) {
|
|---|
| 1112 | $abstract float FLOORF(float x);
|
|---|
| 1113 |
|
|---|
| 1114 | $assume FLOORF(x) <= x && FLOORF(x) > (x - 1);
|
|---|
| 1115 | return FLOORF(x);
|
|---|
| 1116 | }
|
|---|
| 1117 |
|
|---|
| 1118 | long double floorl(long double x) {
|
|---|
| 1119 | $abstract long double FLOORL(long double x);
|
|---|
| 1120 |
|
|---|
| 1121 | $assume FLOORL(x) <= x && FLOORL(x) > (x - 1);
|
|---|
| 1122 | return FLOORL(x);
|
|---|
| 1123 | }
|
|---|
| 1124 |
|
|---|
| 1125 | double nearbyint(double x) {
|
|---|
| 1126 | $abstract double NEARBYINT(double x);
|
|---|
| 1127 |
|
|---|
| 1128 | $assume NEARBYINT(x) < (x+1) && NEARBYINT(x) > (x-1);
|
|---|
| 1129 | return NEARBYINT(x);
|
|---|
| 1130 | }
|
|---|
| 1131 |
|
|---|
| 1132 | float nearbyintf(float x) {
|
|---|
| 1133 | $abstract float NEARBYINTF(float x);
|
|---|
| 1134 |
|
|---|
| 1135 | $assume NEARBYINTF(x) < (x+1) && NEARBYINTF(x) > (x-1);
|
|---|
| 1136 | return NEARBYINTF(x);
|
|---|
| 1137 | }
|
|---|
| 1138 |
|
|---|
| 1139 | long double nearbyintl(long double x) {
|
|---|
| 1140 | $abstract long double NEARBYINTL(long double x);
|
|---|
| 1141 |
|
|---|
| 1142 | $assume NEARBYINTL(x) < (x+1) && NEARBYINTL(x) > (x-1);
|
|---|
| 1143 | return NEARBYINTL(x);
|
|---|
| 1144 | }
|
|---|
| 1145 |
|
|---|
| 1146 | double rint(double x) {
|
|---|
| 1147 | $abstract double RINT(double x);
|
|---|
| 1148 |
|
|---|
| 1149 | $assume RINT(x) < (x+1) && RINT(x) > (x-1);
|
|---|
| 1150 | return RINT(x);
|
|---|
| 1151 | }
|
|---|
| 1152 |
|
|---|
| 1153 | float rintf(float x) {
|
|---|
| 1154 | $abstract float RINTF(float x);
|
|---|
| 1155 |
|
|---|
| 1156 | $assume RINTF(x) < (x+1) && RINTF(x) > (x-1);
|
|---|
| 1157 | return RINTF(x);
|
|---|
| 1158 | }
|
|---|
| 1159 |
|
|---|
| 1160 | long double rintl(long double x) {
|
|---|
| 1161 | $abstract long double RINTL(long double x);
|
|---|
| 1162 |
|
|---|
| 1163 | $assume RINTL(x) < (x+1) && RINTL(x) > (x-1);
|
|---|
| 1164 | return RINTL(x);
|
|---|
| 1165 | }
|
|---|
| 1166 |
|
|---|
| 1167 | long int lrint(double x) {
|
|---|
| 1168 | $abstract long int LRINT(double x);
|
|---|
| 1169 |
|
|---|
| 1170 | $assume LRINT(x) < (x+1) && LRINT(x) > (x-1);
|
|---|
| 1171 | return LRINT(x);
|
|---|
| 1172 | }
|
|---|
| 1173 |
|
|---|
| 1174 | long int lrintf(float x) {
|
|---|
| 1175 | $abstract long int LRINTF(float x);
|
|---|
| 1176 |
|
|---|
| 1177 | $assume LRINTF(x) < (x+1) && LRINTF(x) > (x-1);
|
|---|
| 1178 | return LRINTF(x);
|
|---|
| 1179 | }
|
|---|
| 1180 |
|
|---|
| 1181 | long int lrintl(long double x) {
|
|---|
| 1182 | $abstract long int LRINTL(long double x);
|
|---|
| 1183 |
|
|---|
| 1184 | $assume LRINTL(x) < (x+1) && LRINTL(x) > (x-1);
|
|---|
| 1185 | return LRINTL(x);
|
|---|
| 1186 | }
|
|---|
| 1187 |
|
|---|
| 1188 | long long int llrint(double x) {
|
|---|
| 1189 | $abstract long long int LLRINT(double x);
|
|---|
| 1190 |
|
|---|
| 1191 | $assume LLRINT(x) < (x+1) && LLRINT(x) > (x-1);
|
|---|
| 1192 | return LLRINT(x);
|
|---|
| 1193 | }
|
|---|
| 1194 |
|
|---|
| 1195 | long long int llrintf(float x) {
|
|---|
| 1196 | $abstract long long int LLRINTF(float x);
|
|---|
| 1197 |
|
|---|
| 1198 | $assume LLRINTF(x) < (x+1) && LLRINTF(x) > (x-1);
|
|---|
| 1199 | return LLRINTF(x);
|
|---|
| 1200 | }
|
|---|
| 1201 |
|
|---|
| 1202 | long long int llrintl(long double x) {
|
|---|
| 1203 | $abstract long long int LLRINTL(long double x);
|
|---|
| 1204 |
|
|---|
| 1205 | $assume LLRINTL(x) < (x+1) && LLRINTL(x) > (x-1);
|
|---|
| 1206 | return LLRINTL(x);
|
|---|
| 1207 | }
|
|---|
| 1208 |
|
|---|
| 1209 | double round(double x) {
|
|---|
| 1210 | $abstract double ROUND(double x);
|
|---|
| 1211 |
|
|---|
| 1212 | $assume ROUND(x) < (x+1) && ROUND(x) > (x-1);
|
|---|
| 1213 | return ROUND(x);
|
|---|
| 1214 | }
|
|---|
| 1215 |
|
|---|
| 1216 | float roundf(float x) {
|
|---|
| 1217 | $abstract float ROUNDF(float x);
|
|---|
| 1218 |
|
|---|
| 1219 | $assume ROUNDF(x) < (x+1) && ROUNDF(x) > (x-1);
|
|---|
| 1220 | return ROUNDF(x);
|
|---|
| 1221 | }
|
|---|
| 1222 |
|
|---|
| 1223 | long double roundl(long double x) {
|
|---|
| 1224 | $abstract long double ROUNDL(long double x);
|
|---|
| 1225 |
|
|---|
| 1226 | $assume ROUNDL(x) < (x+1) && ROUNDL(x) > (x-1);
|
|---|
| 1227 | return ROUNDL(x);
|
|---|
| 1228 | }
|
|---|
| 1229 |
|
|---|
| 1230 | long int lround(double x) {
|
|---|
| 1231 | $abstract long int LROUND(double x);
|
|---|
| 1232 |
|
|---|
| 1233 | $assume LROUND(x) < (x+1) && LROUND(x) > (x-1);
|
|---|
| 1234 | return LROUND(x);
|
|---|
| 1235 | }
|
|---|
| 1236 |
|
|---|
| 1237 | long int lroundf(float x) {
|
|---|
| 1238 | $abstract long int LROUNDF(float x);
|
|---|
| 1239 |
|
|---|
| 1240 | $assume LROUNDF(x) < (x+1) && LROUNDF(x) > (x-1);
|
|---|
| 1241 | return LROUNDF(x);
|
|---|
| 1242 | }
|
|---|
| 1243 |
|
|---|
| 1244 | long int lroundl(long double x) {
|
|---|
| 1245 | $abstract long int LROUNDL(long double x);
|
|---|
| 1246 |
|
|---|
| 1247 | $assume LROUNDL(x) < (x+1) && LROUNDL(x) > (x-1);
|
|---|
| 1248 | return LROUNDL(x);
|
|---|
| 1249 | }
|
|---|
| 1250 |
|
|---|
| 1251 | long long int llround(double x) {
|
|---|
| 1252 | $abstract long long int LLROUND(double x);
|
|---|
| 1253 |
|
|---|
| 1254 | $assume LLROUND(x) < (x+1) && LLROUND(x) > (x-1);
|
|---|
| 1255 | return LLROUND(x);
|
|---|
| 1256 | }
|
|---|
| 1257 |
|
|---|
| 1258 | long long int llroundf(float x) {
|
|---|
| 1259 | $abstract long long int LLROUNDF(float x);
|
|---|
| 1260 |
|
|---|
| 1261 | $assume LLROUNDF(x) < (x+1) && LLROUNDF(x) > (x-1);
|
|---|
| 1262 | return LLROUNDF(x);
|
|---|
| 1263 | }
|
|---|
| 1264 |
|
|---|
| 1265 | long long int llroundl(long double x) {
|
|---|
| 1266 | $abstract long long int LLROUNDL(long double x);
|
|---|
| 1267 |
|
|---|
| 1268 | $assume LLROUNDL(x) < (x+1) && LLROUNDL(x) > (x-1);
|
|---|
| 1269 | return LLROUNDL(x);
|
|---|
| 1270 | }
|
|---|
| 1271 |
|
|---|
| 1272 | double trunc(double x) {
|
|---|
| 1273 | $abstract double TRUNC(double x);
|
|---|
| 1274 |
|
|---|
| 1275 | $assume TRUNC(x) < (x) && TRUNC(x) > (x-1);
|
|---|
| 1276 | return TRUNC(x);
|
|---|
| 1277 | }
|
|---|
| 1278 |
|
|---|
| 1279 | float truncf(float x) {
|
|---|
| 1280 | $abstract float TRUNCF(float x);
|
|---|
| 1281 |
|
|---|
| 1282 | $assume TRUNCF(x) < (x) && TRUNCF(x) > (x-1);
|
|---|
| 1283 | return TRUNCF(x);
|
|---|
| 1284 | }
|
|---|
| 1285 |
|
|---|
| 1286 | long double truncl(long double x) {
|
|---|
| 1287 | $abstract long double TRUNCL(long double x);
|
|---|
| 1288 |
|
|---|
| 1289 | $assume TRUNCL(x) < (x) && TRUNCL(x) > (x-1);
|
|---|
| 1290 | return TRUNCL(x);
|
|---|
| 1291 | }
|
|---|
| 1292 |
|
|---|
| 1293 | double fmod(double x, double y) {
|
|---|
| 1294 | $abstract double FMOD(double x, double y);
|
|---|
| 1295 |
|
|---|
| 1296 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1297 | return FMOD(x,y);
|
|---|
| 1298 | }
|
|---|
| 1299 |
|
|---|
| 1300 | float fmodf(float x, float y) {
|
|---|
| 1301 | $abstract float FMODF(float x, float y);
|
|---|
| 1302 |
|
|---|
| 1303 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1304 | return FMODF(x,y);
|
|---|
| 1305 | }
|
|---|
| 1306 |
|
|---|
| 1307 | long double fmodl(long double x, long double y) {
|
|---|
| 1308 | $abstract long double FMODL(long double x, long double y);
|
|---|
| 1309 |
|
|---|
| 1310 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1311 | return FMODL(x,y);
|
|---|
| 1312 | }
|
|---|
| 1313 |
|
|---|
| 1314 | double remainder(double x, double y) {
|
|---|
| 1315 | $abstract double REMAINDER(double x, double y);
|
|---|
| 1316 |
|
|---|
| 1317 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1318 | return REMAINDER(x,y);
|
|---|
| 1319 | }
|
|---|
| 1320 |
|
|---|
| 1321 | float remainderf(float x, float y) {
|
|---|
| 1322 | $abstract float REMAINDERF(float x, float y);
|
|---|
| 1323 |
|
|---|
| 1324 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1325 | return REMAINDERF(x,y);
|
|---|
| 1326 | }
|
|---|
| 1327 |
|
|---|
| 1328 | long double remainderl(long double x, long double y) {
|
|---|
| 1329 | $abstract long double REMAINDERL(long double x, long double y);
|
|---|
| 1330 |
|
|---|
| 1331 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1332 | return REMAINDERL(x,y);
|
|---|
| 1333 | }
|
|---|
| 1334 |
|
|---|
| 1335 |
|
|---|
| 1336 | double remquo(double x, double y, int *quo) {
|
|---|
| 1337 | $abstract double REMQUO(double x, double y);
|
|---|
| 1338 | $abstract int REMQUO_QUO(double x, double y);
|
|---|
| 1339 |
|
|---|
| 1340 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1341 | (*quo) = REMQUO_QUO(x, y);
|
|---|
| 1342 | return REMQUO(x,y);
|
|---|
| 1343 | }
|
|---|
| 1344 |
|
|---|
| 1345 | float remquof(float x, float y, int *quo) {
|
|---|
| 1346 | $abstract float REMQUOF(float x, float y);
|
|---|
| 1347 | $abstract int REMQUOF_QUO(float x, float y);
|
|---|
| 1348 |
|
|---|
| 1349 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1350 | (*quo) = REMQUOF_QUO(x, y);
|
|---|
| 1351 | return REMQUOF(x,y);
|
|---|
| 1352 | }
|
|---|
| 1353 |
|
|---|
| 1354 | long double remquol(long double x, long double y, int *quo) {
|
|---|
| 1355 | $abstract long double REMQUOL(long double x, long double y);
|
|---|
| 1356 | $abstract int REMQUOL_QUO(long double x, long double y);
|
|---|
| 1357 |
|
|---|
| 1358 | $assert y != 0 : "Argument y should not be 0";
|
|---|
| 1359 | (*quo) = REMQUOL_QUO(x, y);
|
|---|
| 1360 | return REMQUOL(x,y);
|
|---|
| 1361 | }
|
|---|
| 1362 |
|
|---|
| 1363 | double copysign(double x, double y) {
|
|---|
| 1364 | $abstract double COPYSIGN(double x, double y);
|
|---|
| 1365 |
|
|---|
| 1366 | return COPYSIGN(x,y);
|
|---|
| 1367 | }
|
|---|
| 1368 |
|
|---|
| 1369 | float copysignf(float x, float y) {
|
|---|
| 1370 | $abstract float COPYSIGNF(float x, float y);
|
|---|
| 1371 |
|
|---|
| 1372 | return COPYSIGNF(x,y);
|
|---|
| 1373 | }
|
|---|
| 1374 |
|
|---|
| 1375 | long double copysignl(long double x, long double y) {
|
|---|
| 1376 | $abstract long double COPYSIGNL(long double x, long double y);
|
|---|
| 1377 |
|
|---|
| 1378 | return COPYSIGNL(x,y);
|
|---|
| 1379 | }
|
|---|
| 1380 |
|
|---|
| 1381 | double nan(const char *tagp) {
|
|---|
| 1382 | // changed by sfsiegel from NAN to CNAN
|
|---|
| 1383 | // since NAN is already used
|
|---|
| 1384 | $abstract double CNAN(const char *tagp);
|
|---|
| 1385 |
|
|---|
| 1386 | return CNAN(tagp);
|
|---|
| 1387 | }
|
|---|
| 1388 |
|
|---|
| 1389 | float nanf(const char *tagp) {
|
|---|
| 1390 | $abstract float NANF(const char *tagp);
|
|---|
| 1391 |
|
|---|
| 1392 | return NANF(tagp);
|
|---|
| 1393 | }
|
|---|
| 1394 |
|
|---|
| 1395 | long double nanl(const char *tagp) {
|
|---|
| 1396 | $abstract long double NANL(const char *tagp);
|
|---|
| 1397 |
|
|---|
| 1398 | return NANL(tagp);
|
|---|
| 1399 | }
|
|---|
| 1400 |
|
|---|
| 1401 | double nextafter(double x, double y) {
|
|---|
| 1402 | $abstract double NEXTAFTER(double x, double y);
|
|---|
| 1403 |
|
|---|
| 1404 | return NEXTAFTER(x,y);
|
|---|
| 1405 | }
|
|---|
| 1406 |
|
|---|
| 1407 | float nextafterf(float x, float y) {
|
|---|
| 1408 | $abstract float NEXTAFTERF(float x, float y);
|
|---|
| 1409 |
|
|---|
| 1410 | return NEXTAFTERF(x,y);
|
|---|
| 1411 | }
|
|---|
| 1412 |
|
|---|
| 1413 | long double nextafterl(long double x, long double y) {
|
|---|
| 1414 | $abstract long double NEXTAFTERL(long double x, long double y);
|
|---|
| 1415 |
|
|---|
| 1416 | return NEXTAFTERL(x,y);
|
|---|
| 1417 | }
|
|---|
| 1418 |
|
|---|
| 1419 | double nexttoward(double x, long double y) {
|
|---|
| 1420 | $abstract double NEXTTOWARD(double x, long double y);
|
|---|
| 1421 |
|
|---|
| 1422 | return NEXTTOWARD(x,y);
|
|---|
| 1423 | }
|
|---|
| 1424 |
|
|---|
| 1425 | float nexttowardf(float x, long double y) {
|
|---|
| 1426 | $abstract float NEXTTOWARDF(float x, long double y);
|
|---|
| 1427 |
|
|---|
| 1428 | return NEXTTOWARDF(x,y);
|
|---|
| 1429 | }
|
|---|
| 1430 |
|
|---|
| 1431 | long double nexttowardl(long double x, long double y) {
|
|---|
| 1432 | $abstract long double NEXTTOWARDL(long double x, long double y);
|
|---|
| 1433 |
|
|---|
| 1434 | return NEXTTOWARDL(x,y);
|
|---|
| 1435 | }
|
|---|
| 1436 |
|
|---|
| 1437 | double fdim(double x, double y) {
|
|---|
| 1438 | return (x>y)?(x-y):0;
|
|---|
| 1439 | }
|
|---|
| 1440 |
|
|---|
| 1441 | float fdimf(float x, float y) {
|
|---|
| 1442 | return (x>y)?(x-y):0;
|
|---|
| 1443 | }
|
|---|
| 1444 |
|
|---|
| 1445 | long double fdiml(long double x, long double y) {
|
|---|
| 1446 | return (x>y)?(x-y):0;
|
|---|
| 1447 | }
|
|---|
| 1448 |
|
|---|
| 1449 | double fmax(double x, double y) {
|
|---|
| 1450 | return (x>y)?(x):(y);
|
|---|
| 1451 | }
|
|---|
| 1452 |
|
|---|
| 1453 | float fmaxf(float x, float y) {
|
|---|
| 1454 | return (x>y)?(x):(y);
|
|---|
| 1455 | }
|
|---|
| 1456 |
|
|---|
| 1457 | long double fmaxl(long double x, long double y) {
|
|---|
| 1458 | return (x>y)?(x):(y);
|
|---|
| 1459 | }
|
|---|
| 1460 |
|
|---|
| 1461 | double fmin(double x, double y) {
|
|---|
| 1462 | return (x<y)?(x):(y);
|
|---|
| 1463 | }
|
|---|
| 1464 |
|
|---|
| 1465 | float fminf(float x, float y) {
|
|---|
| 1466 | return (x<y)?(x):(y);
|
|---|
| 1467 | }
|
|---|
| 1468 |
|
|---|
| 1469 | long double fminl(long double x, long double y) {
|
|---|
| 1470 | return (x<y)?(x):(y);
|
|---|
| 1471 | }
|
|---|
| 1472 |
|
|---|
| 1473 | double fma(double x, double y, double z) {
|
|---|
| 1474 | $abstract double FMA(double x, double y, double z);
|
|---|
| 1475 |
|
|---|
| 1476 | return FMA(x,y,z);
|
|---|
| 1477 | }
|
|---|
| 1478 |
|
|---|
| 1479 | float fmaf(float x, float y, float z) {
|
|---|
| 1480 | $abstract float FMAF(float x, float y, float z);
|
|---|
| 1481 |
|
|---|
| 1482 | return FMAF(x,y,z);
|
|---|
| 1483 | }
|
|---|
| 1484 |
|
|---|
| 1485 | long double fmal(long double x, long double y, long double z) {
|
|---|
| 1486 | $abstract long double FMAL(long double x,
|
|---|
| 1487 | long double y, long double z);
|
|---|
| 1488 |
|
|---|
| 1489 | return FMAL(x,y,z);
|
|---|
| 1490 | }
|
|---|
| 1491 |
|
|---|
| 1492 | #define isgreater(X,Y) ((X)>(Y))
|
|---|
| 1493 | #define isgreaterequal(X,Y) ((X)>=(Y))
|
|---|
| 1494 | #define isless(X,Y) ((X)<(Y))
|
|---|
| 1495 | #define islessequal(X,Y) ((X)<=(Y))
|
|---|
| 1496 | #define islessgreater(X,Y) ((X)<(Y))||((X)>(Y))
|
|---|
| 1497 | #define isunordered(X,Y) (X>Y)?1:0
|
|---|
| 1498 |
|
|---|
| 1499 | #endif
|
|---|
| 1500 |
|
|---|
| 1501 |
|
|---|