Mercurial > projects > ldc
comparison lphobos/std/math.d @ 473:373489eeaf90
Applied downs' lphobos update
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 04 Aug 2008 19:28:49 +0200 |
parents | 288fe1029e1f |
children |
comparison
equal
deleted
inserted
replaced
472:15c804b6ce77 | 473:373489eeaf90 |
---|---|
188 * ) | 188 * ) |
189 * Bugs: | 189 * Bugs: |
190 * Results are undefined if |x| >= $(POWER 2,64). | 190 * Results are undefined if |x| >= $(POWER 2,64). |
191 */ | 191 */ |
192 | 192 |
193 pragma(LLVM_internal, "intrinsic", "llvm.cos.f32") | 193 pragma(intrinsic, "llvm.cos.f32") |
194 float cos(float x); | 194 float cos(float x); |
195 | 195 |
196 pragma(LLVM_internal, "intrinsic", "llvm.cos.f64") { | 196 pragma(intrinsic, "llvm.cos.f64") |
197 double cos(double x); // ditto | 197 double cos(double x); // ditto |
198 | |
199 pragma(intrinsic, "llvm.cos.f80") | |
198 real cos(real x); /// ditto | 200 real cos(real x); /// ditto |
199 } | |
200 | 201 |
201 | 202 |
202 /*********************************** | 203 /*********************************** |
203 * Returns sine of x. x is in radians. | 204 * Returns sine of x. x is in radians. |
204 * | 205 * |
210 * ) | 211 * ) |
211 * Bugs: | 212 * Bugs: |
212 * Results are undefined if |x| >= $(POWER 2,64). | 213 * Results are undefined if |x| >= $(POWER 2,64). |
213 */ | 214 */ |
214 | 215 |
215 pragma(LLVM_internal, "intrinsic", "llvm.sin.f32") | 216 pragma(intrinsic, "llvm.sin.f32") |
216 float sin(float x); | 217 float sin(float x); |
217 | 218 |
218 pragma(LLVM_internal, "intrinsic", "llvm.sin.f64") { | 219 pragma(intrinsic, "llvm.sin.f64") |
219 double sin(double x); // ditto | 220 double sin(double x); // ditto |
221 | |
222 pragma(intrinsic, "llvm.sin.f80") | |
220 real sin(real x); /// ditto | 223 real sin(real x); /// ditto |
221 } | |
222 | 224 |
223 | 225 |
224 /**************************************************************************** | 226 /**************************************************************************** |
225 * Returns tangent of x. x is in radians. | 227 * Returns tangent of x. x is in radians. |
226 * | 228 * |
551 * $(TR $(TD $(LT)0.0) $(TD $(NAN)) $(TD yes)) | 553 * $(TR $(TD $(LT)0.0) $(TD $(NAN)) $(TD yes)) |
552 * $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) $(TD no)) | 554 * $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) $(TD no)) |
553 * ) | 555 * ) |
554 */ | 556 */ |
555 | 557 |
556 pragma(LLVM_internal, "intrinsic", "llvm.sqrt.f32") | 558 pragma(intrinsic, "llvm.sqrt.f32") |
557 float sqrt(float x); /* intrinsic */ | 559 float sqrt(float x); /* intrinsic */ |
558 | 560 |
559 pragma(LLVM_internal, "intrinsic", "llvm.sqrt.f64") { | 561 pragma(intrinsic, "llvm.sqrt.f64") |
560 double sqrt(double x); /* intrinsic */ /// ditto | 562 double sqrt(double x); /* intrinsic */ /// ditto |
563 | |
564 pragma(intrinsic, "llvm.sqrt.f80") | |
561 real sqrt(real x); /* intrinsic */ /// ditto | 565 real sqrt(real x); /* intrinsic */ /// ditto |
562 } | |
563 | 566 |
564 creal sqrt(creal z) | 567 creal sqrt(creal z) |
565 { | 568 { |
566 creal c; | 569 creal c; |
567 real x,y,w,r; | 570 real x,y,w,r; |
1497 | 1500 |
1498 /******************************************************************* | 1501 /******************************************************************* |
1499 * Fast integral powers. | 1502 * Fast integral powers. |
1500 */ | 1503 */ |
1501 | 1504 |
1502 pragma(LLVM_internal, "intrinsic", "llvm.powi.f32") | 1505 pragma(intrinsic, "llvm.powi.f32") |
1503 { | 1506 { |
1504 float pow(float x, uint n); | 1507 float pow(float x, uint n); |
1505 /// ditto | 1508 /// ditto |
1506 float pow(float x, int n); | 1509 float pow(float x, int n); |
1507 } | 1510 } |
1508 | 1511 |
1509 pragma(LLVM_internal, "intrinsic", "llvm.powi.f64") | 1512 pragma(intrinsic, "llvm.powi.f64") |
1510 { | 1513 { |
1511 /// ditto | 1514 /// ditto |
1512 double pow(double x, uint n); | 1515 double pow(double x, uint n); |
1513 /// ditto | 1516 /// ditto |
1514 double pow(double x, int n); | 1517 double pow(double x, int n); |
1518 } | |
1519 | |
1520 pragma(intrinsic, "llvm.powi.f80") | |
1521 { | |
1515 /// ditto | 1522 /// ditto |
1516 real pow(real x, uint n); | 1523 real pow(real x, uint n); |
1517 /// ditto | 1524 /// ditto |
1518 real pow(real x, int n); | 1525 real pow(real x, int n); |
1519 } | 1526 } |
1604 * $(TR | 1611 * $(TR |
1605 * $(TD $(PLUSMN)0.0) $(TD $(GT) 0.0, not odd integer) $(TD +0.0) $(TD no) $(TD no) ) | 1612 * $(TD $(PLUSMN)0.0) $(TD $(GT) 0.0, not odd integer) $(TD +0.0) $(TD no) $(TD no) ) |
1606 * ) | 1613 * ) |
1607 */ | 1614 */ |
1608 | 1615 |
1609 pragma(LLVM_internal, "intrinsic", "llvm.pow.f32") | 1616 pragma(intrinsic, "llvm.pow.f32") |
1610 float pow(float x, float y); | 1617 float pow(float x, float y); |
1611 | 1618 |
1612 pragma(LLVM_internal, "intrinsic", "llvm.pow.f64") | 1619 pragma(intrinsic, "llvm.pow.f64") |
1613 { | |
1614 /// ditto | |
1615 double pow(double x, double y); | 1620 double pow(double x, double y); |
1616 /// ditto | 1621 |
1622 pragma(intrinsic, "llvm.pow.f80") | |
1617 real pow(real x, real y); | 1623 real pow(real x, real y); |
1618 } | |
1619 | 1624 |
1620 /+ | 1625 /+ |
1621 real pow(real x, real y); | 1626 real pow(real x, real y); |
1622 { | 1627 { |
1623 version (linux) // C pow() often does not handle special values correctly | 1628 version (linux) // C pow() often does not handle special values correctly |