Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9fd9ebcb
Commit
9fd9ebcb
authored
Apr 03, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use the cosh() implementation from the bundled musl library.
With the changes from
60d178b4
.
parent
66bef6db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
43 deletions
+5
-43
math.c
dlls/msvcrt/math.c
+0
-43
cosh.c
libs/musl/src/math/cosh.c
+5
-0
No files found.
dlls/msvcrt/math.c
View file @
9fd9ebcb
...
...
@@ -2155,49 +2155,6 @@ double CDECL cos( double x )
extern
double
__expo2
(
double
x
,
double
sign
);
/*********************************************************************
* cosh (MSVCRT.@)
*
* Copied from musl: src/math/cosh.c
*/
double
CDECL
cosh
(
double
x
)
{
UINT64
ux
=
*
(
UINT64
*
)
&
x
;
UINT64
sign
=
ux
&
0x8000000000000000ULL
;
UINT32
w
;
double
t
;
/* |x| */
ux
&=
(
uint64_t
)
-
1
/
2
;
x
=
*
(
double
*
)
&
ux
;
w
=
ux
>>
32
;
/* |x| < log(2) */
if
(
w
<
0x3fe62e42
)
{
if
(
w
<
0x3ff00000
-
(
26
<<
20
))
{
fp_barrier
(
x
+
0x1
p120f
);
return
1
;
}
t
=
expm1
(
x
);
return
1
+
t
*
t
/
(
2
*
(
1
+
t
));
}
/* |x| < log(DBL_MAX) */
if
(
w
<
0x40862e42
)
{
t
=
exp
(
x
);
/* note: if x>log(0x1p26) then the 1/t is not needed */
return
0
.
5
*
(
t
+
1
/
t
);
}
/* |x| > log(DBL_MAX) or nan */
/* note: the result is stored to handle overflow */
if
(
ux
>
0x7ff0000000000000ULL
)
*
(
UINT64
*
)
&
t
=
ux
|
sign
|
0x0008000000000000ULL
;
else
t
=
__expo2
(
x
,
1
.
0
);
return
t
;
}
/* Copied from musl: src/math/exp_data.c */
static
const
UINT64
exp_T
[]
=
{
0x0ULL
,
0x3ff0000000000000ULL
,
...
...
libs/musl/src/math/cosh.c
View file @
9fd9ebcb
...
...
@@ -7,6 +7,7 @@
double
__cdecl
cosh
(
double
x
)
{
union
{
double
f
;
uint64_t
i
;}
u
=
{.
f
=
x
};
uint64_t
sign
=
u
.
i
&
0x8000000000000000ULL
;
uint32_t
w
;
double
t
;
...
...
@@ -35,6 +36,10 @@ double __cdecl cosh(double x)
/* |x| > log(DBL_MAX) or nan */
/* note: the result is stored to handle overflow */
if
(
w
>
0x7ff00000
)
{
u
.
i
|=
sign
|
0x0008000000000000ULL
;
return
u
.
f
;
}
t
=
__expo2
(
x
,
1
.
0
);
return
t
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment