projects
/
libm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5b0b420
)
use different const in __expo2
author
nsz
<nsz@port70.net>
Tue, 13 Mar 2012 04:52:37 +0000
(
05:52
+0100)
committer
nsz
<nsz@port70.net>
Tue, 13 Mar 2012 04:52:37 +0000
(
05:52
+0100)
src/math/__expo2.c
patch
|
blob
|
history
src/math/__expo2f.c
patch
|
blob
|
history
diff --git
a/src/math/__expo2.c
b/src/math/__expo2.c
index
61ae7fd
..
7009306
100644
(file)
--- a/
src/math/__expo2.c
+++ b/
src/math/__expo2.c
@@
-1,10
+1,10
@@
#include "libm.h"
#include "libm.h"
-/* k
minimizes |exp(k ln2) - 2**k|, see cmath/__cexp.c
*/
-static const uint32_t k =
1799
;
-static const double kln2 =
1246.97177782734161156
;
+/* k
is such that k*ln2 has minimal error
*/
+static const uint32_t k =
2043
;
+static const double kln2 =
0x1.62066151add8bp+10
;
-/* exp(x)/2
for large x
*/
+/* exp(x)/2
when x >= log(DBL_MAX)
*/
double __expo2(double x)
{
double scale;
double __expo2(double x)
{
double scale;
diff --git
a/src/math/__expo2f.c
b/src/math/__expo2f.c
index
d35f440
..
7e61ba7
100644
(file)
--- a/
src/math/__expo2f.c
+++ b/
src/math/__expo2f.c
@@
-1,6
+1,6
@@
#include "libm.h"
#include "libm.h"
-/* k
minimizes |exp(k ln2) - 2**k|, see cmath/__cexpf.c
*/
+/* k
is such that k*ln2 has minimal error
*/
static const uint32_t k = 235;
static const float kln2 = 162.88958740f;
static const uint32_t k = 235;
static const float kln2 = 162.88958740f;