Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
0c0915e9
Commit
0c0915e9
authored
3 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
ntdll: Copy log() implementation from msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
90bd0487
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/ntdll/math.c
+367
-2
367 additions, 2 deletions
dlls/ntdll/math.c
with
367 additions
and
2 deletions
dlls/ntdll/math.c
+
367
−
2
View file @
0c0915e9
...
...
@@ -773,10 +773,375 @@ double CDECL floor( double x )
/*********************************************************************
* log (NTDLL.@)
*
* Copied from musl: src/math/log.c src/math/log_data.c
*/
double
CDECL
log
(
double
d
)
double
CDECL
log
(
double
x
)
{
return
unix_funcs
->
log
(
d
);
static
const
double
Ln2hi
=
0x1
.62e42
fefa3800p
-
1
,
Ln2lo
=
0x1
.
ef35793c76730p
-
45
;
static
const
double
A
[]
=
{
-
0x1
.
0000000000001
p
-
1
,
0x1
.
555555551305
bp
-
2
,
-
0x1
.
fffffffeb459p
-
3
,
0x1
.
999
b324f10111p
-
3
,
-
0x1
.55575e506
c89fp
-
3
};
static
const
double
B
[]
=
{
-
0x1
p
-
1
,
0x1
.
5555555555577
p
-
2
,
-
0x1
.
ffffffffffdcbp
-
3
,
0x1
.
999999995
dd0cp
-
3
,
-
0x1
.
55555556745
a7p
-
3
,
0x1
.
24924
a344de3p
-
3
,
-
0x1
.
fffffa4423d65p
-
4
,
0x1
.
c7184282ad6cap
-
4
,
-
0x1
.
999
eb43b068ffp
-
4
,
0x1
.
78182
f7afd085p
-
4
,
-
0x1
.
5521375
d145cdp
-
4
};
static
const
struct
{
double
invc
,
logc
;
}
T
[]
=
{
{
0x1
.
734
f0c3e0de9fp
+
0
,
-
0x1
.
7
cc7f79e69000p
-
2
},
{
0x1
.
713786
a2ce91fp
+
0
,
-
0x1
.
76
feec20d0000p
-
2
},
{
0x1
.
6
f26008fab5a0p
+
0
,
-
0x1
.713e31351
e000p
-
2
},
{
0x1
.
6
d1a61f138c7dp
+
0
,
-
0x1
.
6
b85b38287800p
-
2
},
{
0x1
.
6
b1490bc5b4d1p
+
0
,
-
0x1
.
65
d5590807800p
-
2
},
{
0x1
.
69147332
f0cbap
+
0
,
-
0x1
.
602
d076180000p
-
2
},
{
0x1
.
6719
f18224223p
+
0
,
-
0x1
.
5
a8ca86909000p
-
2
},
{
0x1
.
6524
f99a51ed9p
+
0
,
-
0x1
.
54
f4356035000p
-
2
},
{
0x1
.
63356
aa8f24c4p
+
0
,
-
0x1
.
4
f637c36b4000p
-
2
},
{
0x1
.
614
b36b9ddc14p
+
0
,
-
0x1
.
49
da7fda85000p
-
2
},
{
0x1
.
5
f66452c65c4cp
+
0
,
-
0x1
.
445923989
a800p
-
2
},
{
0x1
.
5
d867b5912c4fp
+
0
,
-
0x1
.
3
edf439b0b800p
-
2
},
{
0x1
.
5
babccb5b90dep
+
0
,
-
0x1
.
396
ce448f7000p
-
2
},
{
0x1
.
59
d61f2d91a78p
+
0
,
-
0x1
.3401e17
bda000p
-
2
},
{
0x1
.
5805612465687
p
+
0
,
-
0x1
.2e9
e2ef468000p
-
2
},
{
0x1
.
56397
cee76bd3p
+
0
,
-
0x1
.
2941
b3830e000p
-
2
},
{
0x1
.54725e2
a77f93p
+
0
,
-
0x1
.
23
ec58cda8800p
-
2
},
{
0x1
.
52
aff42064583p
+
0
,
-
0x1
.1e9
e129279000p
-
2
},
{
0x1
.
50
f22dbb2bddfp
+
0
,
-
0x1
.
1956
d2b48f800p
-
2
},
{
0x1
.
4
f38f4734ded7p
+
0
,
-
0x1
.
141679
ab9f800p
-
2
},
{
0x1
.
4
d843cfde2840p
+
0
,
-
0x1
.
0
edd094ef9800p
-
2
},
{
0x1
.
4
bd3ec078a3c8p
+
0
,
-
0x1
.
09
aa518db1000p
-
2
},
{
0x1
.
4
a27fc3e0258ap
+
0
,
-
0x1
.047e65263
b800p
-
2
},
{
0x1
.
4880524
d48434p
+
0
,
-
0x1
.
feb224586f000p
-
3
},
{
0x1
.
46
dce1b192d0bp
+
0
,
-
0x1
.
f474a7517b000p
-
3
},
{
0x1
.
453
d9d3391854p
+
0
,
-
0x1
.
ea4443d103000p
-
3
},
{
0x1
.
43
a2744b4845ap
+
0
,
-
0x1
.
e020d44e9b000p
-
3
},
{
0x1
.
420
b54115f8fbp
+
0
,
-
0x1
.
d60a22977f000p
-
3
},
{
0x1
.
40782
da3ef4b1p
+
0
,
-
0x1
.
cc00104959000p
-
3
},
{
0x1
.
3
ee8f5d57fe8fp
+
0
,
-
0x1
.
c202956891000p
-
3
},
{
0x1
.
3
d5d9a00b4ce9p
+
0
,
-
0x1
.
b81178d811000p
-
3
},
{
0x1
.
3
bd60c010c12bp
+
0
,
-
0x1
.
ae2c9ccd3d000p
-
3
},
{
0x1
.
3
a5242b75dab8p
+
0
,
-
0x1
.
a45402e129000p
-
3
},
{
0x1
.
38
d22cd9fd002p
+
0
,
-
0x1
.
9
a877681df000p
-
3
},
{
0x1
.
3755
bc5847a1cp
+
0
,
-
0x1
.
90
c6d69483000p
-
3
},
{
0x1
.
35
dce49ad36e2p
+
0
,
-
0x1
.
87120
a645c000p
-
3
},
{
0x1
.
34679984
dd440p
+
0
,
-
0x1
.
7
d68fb4143000p
-
3
},
{
0x1
.
32
f5cceffcb24p
+
0
,
-
0x1
.
73
cb83c627000p
-
3
},
{
0x1
.
3187775
a10d49p
+
0
,
-
0x1
.
6
a39a9b376000p
-
3
},
{
0x1
.
301
c8373e3990p
+
0
,
-
0x1
.
60
b3154b7a000p
-
3
},
{
0x1
.
2
eb4ebb95f841p
+
0
,
-
0x1
.
5737
d76243000p
-
3
},
{
0x1
.
2
d50a0219a9d1p
+
0
,
-
0x1
.
4
dc7b8fc23000p
-
3
},
{
0x1
.
2
bef9a8b7fd2ap
+
0
,
-
0x1
.
4462
c51d20000p
-
3
},
{
0x1
.
2
a91c7a0c1babp
+
0
,
-
0x1
.
3
b08abc830000p
-
3
},
{
0x1
.
293726014
b530p
+
0
,
-
0x1
.
31
b996b490000p
-
3
},
{
0x1
.
27
dfa5757a1f5p
+
0
,
-
0x1
.
2875490
a44000p
-
3
},
{
0x1
.
268
b39b1d3bbfp
+
0
,
-
0x1
.
1
f3b9f879a000p
-
3
},
{
0x1
.
2539
d838ff5bdp
+
0
,
-
0x1
.
160
c8252ca000p
-
3
},
{
0x1
.
23
eb7aac9083bp
+
0
,
-
0x1
.
0
ce7f57f72000p
-
3
},
{
0x1
.
22
a012ba940b6p
+
0
,
-
0x1
.
03
cdc49fea000p
-
3
},
{
0x1
.
2157996
cc4132p
+
0
,
-
0x1
.
f57bdbc4b8000p
-
4
},
{
0x1
.
201201
dd2fc9bp
+
0
,
-
0x1
.
e370896404000p
-
4
},
{
0x1
.
1
ecf4494d480bp
+
0
,
-
0x1
.
d17983ef94000p
-
4
},
{
0x1
.
1
d8f5528f6569p
+
0
,
-
0x1
.
bf9674ed8a000p
-
4
},
{
0x1
.
1
c52311577e7cp
+
0
,
-
0x1
.
adc79202f6000p
-
4
},
{
0x1
.
1
b17c74cb26e9p
+
0
,
-
0x1
.
9
c0c3e7288000p
-
4
},
{
0x1
.19e010
c2c1ab6p
+
0
,
-
0x1
.
8
a646b372c000p
-
4
},
{
0x1
.
18
ab07bb670bdp
+
0
,
-
0x1
.
78
d01b3ac0000p
-
4
},
{
0x1
.
1778
a25efbcb6p
+
0
,
-
0x1
.
674
f145380000p
-
4
},
{
0x1
.
1648
d354c31dap
+
0
,
-
0x1
.55e0
e6d878000p
-
4
},
{
0x1
.
151
b990275fddp
+
0
,
-
0x1
.
4485
cdea1e000p
-
4
},
{
0x1
.
13
f0ea432d24cp
+
0
,
-
0x1
.
333
d94d6aa000p
-
4
},
{
0x1
.
12
c8b7210f9dap
+
0
,
-
0x1
.
22079
f8c56000p
-
4
},
{
0x1
.
11
a3028ecb531p
+
0
,
-
0x1
.10e4698622000
p
-
4
},
{
0x1
.
107
fbda8434afp
+
0
,
-
0x1
.
ffa6c6ad20000p
-
5
},
{
0x1
.
0
f5ee0f4e6bb3p
+
0
,
-
0x1
.
dda8d4a774000p
-
5
},
{
0x1
.0e4065
d2a9fcep
+
0
,
-
0x1
.
bbcece4850000p
-
5
},
{
0x1
.
0
d244632ca521p
+
0
,
-
0x1
.
9
a1894012c000p
-
5
},
{
0x1
.
0
c0a77ce2981ap
+
0
,
-
0x1
.
788583302
c000p
-
5
},
{
0x1
.
0
af2f83c636d1p
+
0
,
-
0x1
.5715e67
d68000p
-
5
},
{
0x1
.
09
ddb98a01339p
+
0
,
-
0x1
.
35
c8a49658000p
-
5
},
{
0x1
.
08
cabaf52e7dfp
+
0
,
-
0x1
.149e364154000
p
-
5
},
{
0x1
.
07
b9f2f4e28fbp
+
0
,
-
0x1
.
e72c082eb8000p
-
6
},
{
0x1
.
06
ab58c358f19p
+
0
,
-
0x1
.
a55f152528000p
-
6
},
{
0x1
.
05
9
eea5ecf92cp
+
0
,
-
0x1
.
63
d62cf818000p
-
6
},
{
0x1
.
04
949
cdd12c90p
+
0
,
-
0x1
.
228
fb8caa0000p
-
6
},
{
0x1
.
03
8
c6c6f0ada9p
+
0
,
-
0x1
.
c317b20f90000p
-
7
},
{
0x1
.
02
865137932
a9p
+
0
,
-
0x1
.
419355
daa0000p
-
7
},
{
0x1
.
01
82427
ea7348p
+
0
,
-
0x1
.
81203
c2ec0000p
-
8
},
{
0x1
.
00
8040614
b195p
+
0
,
-
0x1
.
0040
979240000
p
-
9
},
{
0x1
.
fe01ff726fa1ap
-
1
,
0x1
.
feff384900000p
-
9
},
{
0x1
.
fa11cc261ea74p
-
1
,
0x1
.
7
dc41353d0000p
-
7
},
{
0x1
.
f6310b081992ep
-
1
,
0x1
.
3
cea3c4c28000p
-
6
},
{
0x1
.
f25f63ceeadcdp
-
1
,
0x1
.
b9fc114890000p
-
6
},
{
0x1
.
ee9c8039113e7p
-
1
,
0x1
.
1
b0d8ce110000p
-
5
},
{
0x1
.
eae8078cbb1abp
-
1
,
0x1
.
58
a5bd001c000p
-
5
},
{
0x1
.
e741aa29d0c9bp
-
1
,
0x1
.
95
c8340d88000p
-
5
},
{
0x1
.
e3a91830a99b5p
-
1
,
0x1
.
d276aef578000p
-
5
},
{
0x1
.
e01e009609a56p
-
1
,
0x1
.07598e598
c000p
-
4
},
{
0x1
.
dca01e577bb98p
-
1
,
0x1
.
253
f5e30d2000p
-
4
},
{
0x1
.
d92f20b7c9103p
-
1
,
0x1
.
42
edd8b380000p
-
4
},
{
0x1
.
d5cac66fb5ccep
-
1
,
0x1
.
606598757
c000p
-
4
},
{
0x1
.
d272caa5ede9dp
-
1
,
0x1
.
7
da76356a0000p
-
4
},
{
0x1
.
cf26e3e6b2ccdp
-
1
,
0x1
.
9
ab434e1c6000p
-
4
},
{
0x1
.
cbe6da2a77902p
-
1
,
0x1
.
b78c7bb0d6000p
-
4
},
{
0x1
.
c8b266d37086dp
-
1
,
0x1
.
d431332e72000p
-
4
},
{
0x1
.
c5894bd5d5804p
-
1
,
0x1
.
f0a3171de6000p
-
4
},
{
0x1
.
c26b533bb9f8cp
-
1
,
0x1
.
067152
b914000p
-
3
},
{
0x1
.
bf583eeece73fp
-
1
,
0x1
.
147858292
b000p
-
3
},
{
0x1
.
bc4fd75db96c1p
-
1
,
0x1
.
2266
ecdca3000p
-
3
},
{
0x1
.
b951e0c864a28p
-
1
,
0x1
.
303
d7a6c55000p
-
3
},
{
0x1
.
b65e2c5ef3e2cp
-
1
,
0x1
.
3
dfc33c331000p
-
3
},
{
0x1
.
b374867c9888bp
-
1
,
0x1
.
4
ba366b7a8000p
-
3
},
{
0x1
.
b094b211d304ap
-
1
,
0x1
.
5933928
d1f000p
-
3
},
{
0x1
.
adbe885f2ef7ep
-
1
,
0x1
.
66
acd2418f000p
-
3
},
{
0x1
.
aaf1d31603da2p
-
1
,
0x1
.
740
f8ec669000p
-
3
},
{
0x1
.
a82e63fd358a7p
-
1
,
0x1
.
815
c0f51af000p
-
3
},
{
0x1
.
a5740ef09738bp
-
1
,
0x1
.8e92954
f68000p
-
3
},
{
0x1
.
a2c2a90ab4b27p
-
1
,
0x1
.
9
bb3602f84000p
-
3
},
{
0x1
.
a01a01393f2d1p
-
1
,
0x1
.
a8bed1c2c0000p
-
3
},
{
0x1
.
9
d79f24db3c1bp
-
1
,
0x1
.
b5b515c01d000p
-
3
},
{
0x1
.
9
ae2505c7b190p
-
1
,
0x1
.
c2967ccbcc000p
-
3
},
{
0x1
.
9852
ef297ce2fp
-
1
,
0x1
.
cf635d5486000p
-
3
},
{
0x1
.
95
cbaeea44b75p
-
1
,
0x1
.
dc1bd3446c000p
-
3
},
{
0x1
.
934
c69de74838p
-
1
,
0x1
.
e8c01b8cfe000p
-
3
},
{
0x1
.
90
d4f2f6752e6p
-
1
,
0x1
.
f5509c0179000p
-
3
},
{
0x1
.8e6528
effd79dp
-
1
,
0x1
.00e6
c121fb800p
-
2
},
{
0x1
.
8
bfce9fcc007cp
-
1
,
0x1
.
071
b80e93d000p
-
2
},
{
0x1
.
899
c0dabec30ep
-
1
,
0x1
.
0
d46b9e867000p
-
2
},
{
0x1
.
87427
aa2317fbp
-
1
,
0x1
.
13687334
bd000p
-
2
},
{
0x1
.
84
f00acb39a08p
-
1
,
0x1
.
1980
d67234800p
-
2
},
{
0x1
.
82
a49e8653e55p
-
1
,
0x1
.
1
f8ffe0cc8000p
-
2
},
{
0x1
.
8060195
f40260p
-
1
,
0x1
.
2595
fd7636800p
-
2
},
{
0x1
.7e22563
e0a329p
-
1
,
0x1
.
2
b9300914a800p
-
2
},
{
0x1
.
7
beb377dcb5adp
-
1
,
0x1
.
3187210436000
p
-
2
},
{
0x1
.
79
baa679725c2p
-
1
,
0x1
.
377266
dec1800p
-
2
},
{
0x1
.
77907
f2170657p
-
1
,
0x1
.
3
d54ffbaf3000p
-
2
},
{
0x1
.
756
cadbd6130cp
-
1
,
0x1
.
432
eee32fe000p
-
2
}
};
static
const
struct
{
double
chi
,
clo
;
}
T2
[]
=
{
{
0x1
.
61000014
fb66bp
-
1
,
0x1
.
e026c91425b3cp
-
56
},
{
0x1
.
63000034
db495p
-
1
,
0x1
.
dbfea48005d41p
-
55
},
{
0x1
.
650000
d94d478p
-
1
,
0x1
.
e7fa786d6a5b7p
-
55
},
{
0x1
.67000074e6
fadp
-
1
,
0x1
.
1
fcea6b54254cp
-
57
},
{
0x1
.
68
ffffedf0faep
-
1
,
-
0x1
.
c7e274c590efdp
-
56
},
{
0x1
.
6
b0000763c5bcp
-
1
,
-
0x1
.
ac16848dcda01p
-
55
},
{
0x1
.
6
d0001e5cc1f6p
-
1
,
0x1
.
33
f1c9d499311p
-
55
},
{
0x1
.
6
efffeb05f63ep
-
1
,
-
0x1
.
e80041ae22d53p
-
56
},
{
0x1
.710000e86978
p
-
1
,
0x1
.
bff6671097952p
-
56
},
{
0x1
.
72
ffffc67e912p
-
1
,
0x1
.
c00e226bd8724p
-
55
},
{
0x1
.
74
fffdf81116ap
-
1
,
-
0x1
.
e02916ef101d2p
-
57
},
{
0x1
.
770000
f679c9p
-
1
,
-
0x1
.
7
fc71cd549c74p
-
57
},
{
0x1
.
78
ffffa7ec835p
-
1
,
0x1
.
1
bec19ef50483p
-
55
},
{
0x1
.
7
affffe20c2e6p
-
1
,
-
0x1
.07e1729
cc6465p
-
56
},
{
0x1
.
7
cfffed3fc9p
-
1
,
-
0x1
.
08072087
b8b1cp
-
55
},
{
0x1
.
7
efffe9261a76p
-
1
,
0x1
.
dc0286d9df9aep
-
55
},
{
0x1
.
81000049
ca3e8p
-
1
,
0x1
.
97
fd251e54c33p
-
55
},
{
0x1
.
8300017932
c8fp
-
1
,
-
0x1
.
afee9b630f381p
-
55
},
{
0x1
.
850000633739
cp
-
1
,
0x1
.
9
bfbf6b6535bcp
-
55
},
{
0x1
.
87000204289
c6p
-
1
,
-
0x1
.
bbf65f3117b75p
-
55
},
{
0x1
.
88
fffebf57904p
-
1
,
-
0x1
.
9006
ea23dcb57p
-
55
},
{
0x1
.
8
b00022bc04dfp
-
1
,
-
0x1
.
d00df38e04b0ap
-
56
},
{
0x1
.
8
cfffe50c1b8ap
-
1
,
-
0x1
.
8007146
ff9f05p
-
55
},
{
0x1
.
8
effffc918e43p
-
1
,
0x1
.
3817
bd07a7038p
-
55
},
{
0x1
.
910001
efa5fc7p
-
1
,
0x1
.93e9176
dfb403p
-
55
},
{
0x1
.
9300013467
bb9p
-
1
,
0x1
.
f804e4b980276p
-
56
},
{
0x1
.
94
fffe6ee076fp
-
1
,
-
0x1
.
f7ef0d9ff622ep
-
55
},
{
0x1
.
96
fffde3c12d1p
-
1
,
-
0x1
.
082
aa962638bap
-
56
},
{
0x1
.
98
ffff4458a0dp
-
1
,
-
0x1
.
7801
b9164a8efp
-
55
},
{
0x1
.
9
afffdd982e3ep
-
1
,
-
0x1
.740e08
a5a9337p
-
55
},
{
0x1
.
9
cfffed49fb66p
-
1
,
0x1
.
fce08c19bep
-
60
},
{
0x1
.
9
f00020f19c51p
-
1
,
-
0x1
.
a3faa27885b0ap
-
55
},
{
0x1
.
a10001145b006p
-
1
,
0x1
.
4
ff489958da56p
-
56
},
{
0x1
.
a300007bbf6fap
-
1
,
0x1
.
cbeab8a2b6d18p
-
55
},
{
0x1
.
a500010971d79p
-
1
,
0x1
.
8
fecadd78793p
-
55
},
{
0x1
.
a70001df52e48p
-
1
,
-
0x1
.
f41763dd8abdbp
-
55
},
{
0x1
.
a90001c593352p
-
1
,
-
0x1
.
ebf0284c27612p
-
55
},
{
0x1
.
ab0002a4f3e4bp
-
1
,
-
0x1
.
9
fd043cff3f5fp
-
57
},
{
0x1
.
acfffd7ae1ed1p
-
1
,
-
0x1
.
23
ee7129070b4p
-
55
},
{
0x1
.
aefffee510478p
-
1
,
0x1
.
a063ee00edea3p
-
57
},
{
0x1
.
b0fffdb650d5bp
-
1
,
0x1
.
a06c8381f0ab9p
-
58
},
{
0x1
.
b2ffffeaaca57p
-
1
,
-
0x1
.9011e74233
c1dp
-
56
},
{
0x1
.
b4fffd995badcp
-
1
,
-
0x1
.
9
ff1068862a9fp
-
56
},
{
0x1
.
b7000249e659cp
-
1
,
0x1
.
aff45d0864f3ep
-
55
},
{
0x1
.
b8ffff987164p
-
1
,
0x1
.
cfe7796c2c3f9p
-
56
},
{
0x1
.
bafffd204cb4fp
-
1
,
-
0x1
.
3
ff27eef22bc4p
-
57
},
{
0x1
.
bcfffd2415c45p
-
1
,
-
0x1
.
cffb7ee3bea21p
-
57
},
{
0x1
.
beffff86309dfp
-
1
,
-
0x1
.14103972e0
b5cp
-
55
},
{
0x1
.
c0fffe1b57653p
-
1
,
0x1
.
bc16494b76a19p
-
55
},
{
0x1
.
c2ffff1fa57e3p
-
1
,
-
0x1
.
4
feef8d30c6edp
-
57
},
{
0x1
.
c4fffdcbfe424p
-
1
,
-
0x1
.
43
f68bcec4775p
-
55
},
{
0x1
.
c6fffed54b9f7p
-
1
,
0x1
.
47
ea3f053e0ecp
-
55
},
{
0x1
.
c8fffeb998fd5p
-
1
,
0x1
.
383068
df992f1p
-
56
},
{
0x1
.
cb0002125219ap
-
1
,
-
0x1
.
8
fd8e64180e04p
-
57
},
{
0x1
.
ccfffdd94469cp
-
1
,
0x1
.
e7ebe1cc7ea72p
-
55
},
{
0x1
.
cefffeafdc476p
-
1
,
0x1
.
ebe39ad9f88fep
-
55
},
{
0x1
.
d1000169af82bp
-
1
,
0x1
.
57
d91a8b95a71p
-
56
},
{
0x1
.
d30000d0ff71dp
-
1
,
0x1
.
9
c1906970c7dap
-
55
},
{
0x1
.
d4fffea790fc4p
-
1
,
-
0x1
.80e37
c558fe0cp
-
58
},
{
0x1
.
d70002edc87e5p
-
1
,
-
0x1
.
f80d64dc10f44p
-
56
},
{
0x1
.
d900021dc82aap
-
1
,
-
0x1
.
47
c8f94fd5c5cp
-
56
},
{
0x1
.
dafffd86b0283p
-
1
,
0x1
.
c7f1dc521617ep
-
55
},
{
0x1
.
dd000296c4739p
-
1
,
0x1
.
8019
eb2ffb153p
-
55
},
{
0x1
.
defffe54490f5p
-
1
,
0x1
.
e00d2c652cc89p
-
57
},
{
0x1
.
e0fffcdabf694p
-
1
,
-
0x1
.
f8340202d69d2p
-
56
},
{
0x1
.
e2fffdb52c8ddp
-
1
,
0x1
.
b00c1ca1b0864p
-
56
},
{
0x1
.
e4ffff24216efp
-
1
,
0x1
.
2
ffa8b094ab51p
-
56
},
{
0x1
.
e6fffe88a5e11p
-
1
,
-
0x1
.
7
f673b1efbe59p
-
58
},
{
0x1
.
e9000119eff0dp
-
1
,
-
0x1
.
4808
d5e0bc801p
-
55
},
{
0x1
.
eafffdfa51744p
-
1
,
0x1
.
80006
d54320b5p
-
56
},
{
0x1
.
ed0001a127fa1p
-
1
,
-
0x1
.
002
f860565c92p
-
58
},
{
0x1
.
ef00007babcc4p
-
1
,
-
0x1
.
540445
d35e611p
-
55
},
{
0x1
.
f0ffff57a8d02p
-
1
,
-
0x1
.
ffb3139ef9105p
-
59
},
{
0x1
.
f30001ee58ac7p
-
1
,
0x1
.
a81acf2731155p
-
55
},
{
0x1
.
f4ffff5823494p
-
1
,
0x1
.
a3f41d4d7c743p
-
55
},
{
0x1
.
f6ffffca94c6bp
-
1
,
-
0x1
.
202
f41c987875p
-
57
},
{
0x1
.
f8fffe1f9c441p
-
1
,
0x1
.
77
dd1f477e74bp
-
56
},
{
0x1
.
fafffd2e0e37ep
-
1
,
-
0x1
.
f01199a7ca331p
-
57
},
{
0x1
.
fd0001c77e49ep
-
1
,
0x1
.
181
ee4bceacb1p
-
56
},
{
0x1
.
feffff7e0c331p
-
1
,
-
0x1
.
e05370170875ap
-
57
},
{
0x1
.
00
ffff465606ep
+
0
,
-
0x1
.
a7ead491c0adap
-
55
},
{
0x1
.
02
ffff3867a58p
+
0
,
-
0x1
.
77
f69c3fcb2ep
-
54
},
{
0x1
.
04
ffffdfc0d17p
+
0
,
0x1
.
7
bffe34cb945bp
-
54
},
{
0x1
.
0700003
cd4d82p
+
0
,
0x1
.
20083
c0e456cbp
-
55
},
{
0x1
.
08
ffff9f2cbe8p
+
0
,
-
0x1
.
dffdfbe37751ap
-
57
},
{
0x1
.
0
b000010cda65p
+
0
,
-
0x1
.
13
f7faee626ebp
-
54
},
{
0x1
.
0
d00001a4d338p
+
0
,
0x1
.
07
dfa79489ff7p
-
55
},
{
0x1
.
0
effffadafdfdp
+
0
,
-
0x1
.
7040570
d66bcp
-
56
},
{
0x1
.
110000
bbafd96p
+
0
,
0x1
.
e80d4846d0b62p
-
55
},
{
0x1
.
12
ffffae5f45dp
+
0
,
0x1
.
dbffa64fd36efp
-
54
},
{
0x1
.
150000
dd59ad9p
+
0
,
0x1
.
a0077701250aep
-
54
},
{
0x1
.
170000
f21559ap
+
0
,
0x1
.
dfdf9e2e3deeep
-
55
},
{
0x1
.
18
ffffc275426p
+
0
,
0x1
.
10030
dc3b7273p
-
54
},
{
0x1
.
1
b000123d3c59p
+
0
,
0x1
.
97
f7980030188p
-
54
},
{
0x1
.
1
cffff8299eb7p
+
0
,
-
0x1
.
5
f932ab9f8c67p
-
57
},
{
0x1
.
1
effff48ad4p
+
0
,
0x1
.
37
fbf9da75bebp
-
54
},
{
0x1
.
210000
c8b86a4p
+
0
,
0x1
.
f806b91fd5b22p
-
54
},
{
0x1
.
2300003854303
p
+
0
,
0x1
.
3
ffc2eb9fbf33p
-
54
},
{
0x1
.
24
fffffbcf684p
+
0
,
0x1
.601e77
e2e2e72p
-
56
},
{
0x1
.
26
ffff52921d9p
+
0
,
0x1
.
ffcbb767f0c61p
-
56
},
{
0x1
.
2900014933
a3cp
+
0
,
-
0x1
.
202
ca3c02412bp
-
56
},
{
0x1
.
2
b00014556313p
+
0
,
-
0x1
.
2808233
f21f02p
-
54
},
{
0x1
.
2
cfffebfe523bp
+
0
,
-
0x1
.
8
ff7e384fdcf2p
-
55
},
{
0x1
.
2
f0000bb8ad96p
+
0
,
-
0x1
.
5
ff51503041c5p
-
55
},
{
0x1
.
30
ffffb7ae2afp
+
0
,
-
0x1
.10071885e289
dp
-
55
},
{
0x1
.
32
ffffeac5f7fp
+
0
,
-
0x1
.
1
ff5d3fb7b715p
-
54
},
{
0x1
.
350000
ca66756p
+
0
,
0x1
.
57
f82228b82bdp
-
54
},
{
0x1
.
3700011
fbf721p
+
0
,
0x1
.
000
bac40dd5ccp
-
55
},
{
0x1
.
38
ffff9592fb9p
+
0
,
-
0x1
.
43
f9d2db2a751p
-
54
},
{
0x1
.
3
b00004ddd242p
+
0
,
0x1
.
57
f6b707638e1p
-
55
},
{
0x1
.
3
cffff5b2c957p
+
0
,
0x1
.
a023a10bf1231p
-
56
},
{
0x1
.
3
efffeab0b418p
+
0
,
0x1
.
87
f6d66b152bp
-
54
},
{
0x1
.
410001532
aff4p
+
0
,
0x1
.
7
f8375f198524p
-
57
},
{
0x1
.
4300017478
b29p
+
0
,
0x1
.301e672
dc5143p
-
55
},
{
0x1
.
44
fffe795b463p
+
0
,
0x1
.
9
ff69b8b2895ap
-
55
},
{
0x1
.
46
fffe80475ep
+
0
,
-
0x1
.
5
c0b19bc2f254p
-
54
},
{
0x1
.
48
fffef6fc1e7p
+
0
,
0x1
.
b4009f23a2a72p
-
54
},
{
0x1
.
4
afffe5bea704p
+
0
,
-
0x1
.
4
ffb7bf0d7d45p
-
54
},
{
0x1
.
4
d000171027dep
+
0
,
-
0x1
.
9
c06471dc6a3dp
-
54
},
{
0x1
.
4
f0000ff03ee2p
+
0
,
0x1
.
77
f890b85531cp
-
54
},
{
0x1
.
5100012
dc4bd1p
+
0
,
0x1
.
004657166
a436p
-
57
},
{
0x1
.
530001605277
ap
+
0
,
-
0x1
.
6
bfcece233209p
-
54
},
{
0x1
.
54
fffecdb704cp
+
0
,
-
0x1
.
902720505
a1d7p
-
55
},
{
0x1
.
56
fffef5f54a9p
+
0
,
0x1
.
bbfe60ec96412p
-
54
},
{
0x1
.5900017e61012
p
+
0
,
0x1
.
87
ec581afef9p
-
55
},
{
0x1
.
5
b00003c93e92p
+
0
,
-
0x1
.
f41080abf0ccp
-
54
},
{
0x1
.
5
d0001d4919bcp
+
0
,
-
0x1
.
8812
afb254729p
-
54
},
{
0x1
.
5
efffe7b87a89p
+
0
,
-
0x1
.
47
eb780ed6904p
-
54
}
};
double
w
,
z
,
r
,
r2
,
r3
,
y
,
invc
,
logc
,
kd
,
hi
,
lo
;
UINT64
ix
,
iz
,
tmp
;
UINT32
top
;
int
k
,
i
;
ix
=
*
(
UINT64
*
)
&
x
;
top
=
ix
>>
48
;
if
(
ix
-
0x3fee000000000000ULL
<
0x3090000000000ULL
)
{
double
rhi
,
rlo
;
/* Handle close to 1.0 inputs separately. */
/* Fix sign of zero with downward rounding when x==1. */
if
(
ix
==
0x3ff0000000000000ULL
)
return
0
;
r
=
x
-
1
.
0
;
r2
=
r
*
r
;
r3
=
r
*
r2
;
y
=
r3
*
(
B
[
1
]
+
r
*
B
[
2
]
+
r2
*
B
[
3
]
+
r3
*
(
B
[
4
]
+
r
*
B
[
5
]
+
r2
*
B
[
6
]
+
r3
*
(
B
[
7
]
+
r
*
B
[
8
]
+
r2
*
B
[
9
]
+
r3
*
B
[
10
])));
/* Worst-case error is around 0.507 ULP. */
w
=
r
*
0x1
p27
;
rhi
=
r
+
w
-
w
;
rlo
=
r
-
rhi
;
w
=
rhi
*
rhi
*
B
[
0
];
/* B[0] == -0.5. */
hi
=
r
+
w
;
lo
=
r
-
hi
+
w
;
lo
+=
B
[
0
]
*
rlo
*
(
rhi
+
r
);
y
+=
lo
;
y
+=
hi
;
return
y
;
}
if
(
top
-
0x0010
>=
0x7ff0
-
0x0010
)
{
/* x < 0x1p-1022 or inf or nan. */
if
(
ix
*
2
==
0
)
return
(
top
&
0x8000
?
1
.
0
:
-
1
.
0
)
/
x
;
if
(
ix
==
0x7ff0000000000000ULL
)
/* log(inf) == inf. */
return
x
;
if
((
top
&
0x7ff0
)
==
0x7ff0
&&
(
ix
&
0xfffffffffffffULL
))
return
x
;
if
(
top
&
0x8000
)
return
(
x
-
x
)
/
(
x
-
x
);
/* x is subnormal, normalize it. */
x
*=
0x1
p52
;
ix
=
*
(
UINT64
*
)
&
x
;
ix
-=
52ULL
<<
52
;
}
/* x = 2^k z; where z is in range [OFF,2*OFF) and exact.
The range is split into N subintervals.
The ith subinterval contains z and c is near its center. */
tmp
=
ix
-
0x3fe6000000000000ULL
;
i
=
(
tmp
>>
(
52
-
7
))
%
(
1
<<
7
);
k
=
(
INT64
)
tmp
>>
52
;
/* arithmetic shift */
iz
=
ix
-
(
tmp
&
0xfffULL
<<
52
);
invc
=
T
[
i
].
invc
;
logc
=
T
[
i
].
logc
;
z
=
*
(
double
*
)
&
iz
;
/* log(x) = log1p(z/c-1) + log(c) + k*Ln2. */
/* r ~= z/c - 1, |r| < 1/(2*N). */
r
=
(
z
-
T2
[
i
].
chi
-
T2
[
i
].
clo
)
*
invc
;
kd
=
(
double
)
k
;
/* hi + lo = r + log(c) + k*Ln2. */
w
=
kd
*
Ln2hi
+
logc
;
hi
=
w
+
r
;
lo
=
w
-
hi
+
r
+
kd
*
Ln2lo
;
/* log(x) = lo + (log1p(r) - r) + hi. */
r2
=
r
*
r
;
/* rounding error: 0x1p-54/N^2. */
/* Worst case error if |y| > 0x1p-5:
0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma)
Worst case error if |y| > 0x1p-4:
0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */
y
=
lo
+
r2
*
A
[
0
]
+
r
*
r2
*
(
A
[
1
]
+
r
*
A
[
2
]
+
r2
*
(
A
[
3
]
+
r
*
A
[
4
]))
+
hi
;
return
y
;
}
/*********************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment