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
d37e76a9
Commit
d37e76a9
authored
Aug 06, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import asinf from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
25cc6ff6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
4 deletions
+43
-4
math.c
dlls/msvcrt/math.c
+43
-4
No files found.
dlls/msvcrt/math.c
View file @
d37e76a9
...
...
@@ -280,13 +280,52 @@ float CDECL MSVCRT_acosf( float x )
/*********************************************************************
* MSVCRT_asinf (MSVCRT.@)
*
* Copied from musl: src/math/asinf.c
*/
static
float
asinf_R
(
float
z
)
{
/* coefficients for R(x^2) */
static
const
float
pS0
=
1.6666586697e-01
,
pS1
=
-
4.2743422091e-02
,
pS2
=
-
8.6563630030e-03
,
qS1
=
-
7.0662963390e-01
;
float_t
p
,
q
;
p
=
z
*
(
pS0
+
z
*
(
pS1
+
z
*
pS2
));
q
=
1
.
0
f
+
z
*
qS1
;
return
p
/
q
;
}
float
CDECL
MSVCRT_asinf
(
float
x
)
{
float
ret
=
atan2f
(
x
,
sqrtf
((
1
-
x
)
*
(
1
+
x
)));
if
(
x
<
-
1
.
0
||
x
>
1
.
0
||
!
finitef
(
x
))
return
math_error
(
_DOMAIN
,
"asinf"
,
x
,
0
,
ret
);
return
ret
;
static
const
double
pio2
=
1.570796326794896558e+00
;
double
s
;
float
z
;
unsigned
int
hx
,
ix
;
hx
=
*
(
unsigned
int
*
)
&
x
;
ix
=
hx
&
0x7fffffff
;
if
(
ix
>=
0x3f800000
)
{
/* |x| >= 1 */
if
(
ix
==
0x3f800000
)
/* |x| == 1 */
return
x
*
pio2
+
7.5231638453e-37
;
/* asin(+-1) = +-pi/2 with inexact */
if
(
MSVCRT__isnanf
(
x
))
return
x
;
return
math_error
(
_DOMAIN
,
"asinf"
,
x
,
0
,
0
/
(
x
-
x
));
}
if
(
ix
<
0x3f000000
)
{
/* |x| < 0.5 */
/* if 0x1p-126 <= |x| < 0x1p-12, avoid raising underflow */
if
(
ix
<
0x39800000
&&
ix
>=
0x00800000
)
return
x
;
return
x
+
x
*
asinf_R
(
x
*
x
);
}
/* 1 > |x| >= 0.5 */
z
=
(
1
-
fabsf
(
x
))
*
0
.
5
f
;
s
=
sqrt
(
z
);
x
=
pio2
-
2
*
(
s
+
s
*
asinf_R
(
z
));
if
(
hx
>>
31
)
return
-
x
;
return
x
;
}
/*********************************************************************
...
...
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