Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
c9399ae7
Commit
c9399ae7
authored
Mar 31, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use the acosf() implementation from the bundled musl library.
With the changes from
9c8f8e71
.
parent
221f8918
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
57 deletions
+11
-57
math.c
dlls/msvcrt/math.c
+0
-47
acosf.c
libs/musl/src/math/acosf.c
+11
-10
No files found.
dlls/msvcrt/math.c
View file @
c9399ae7
...
...
@@ -306,53 +306,6 @@ static float asinf_R(float z)
}
/*********************************************************************
* acosf (MSVCRT.@)
*
* Copied from musl: src/math/acosf.c
*/
float
CDECL
acosf
(
float
x
)
{
static
const
double
pio2_lo
=
6.12323399573676603587e-17
;
static
const
double
pio2_hi
=
1.57079632679489655800e+00
;
float
z
,
w
,
s
,
c
,
df
;
unsigned
int
hx
,
ix
;
hx
=
*
(
unsigned
int
*
)
&
x
;
ix
=
hx
&
0x7fffffff
;
/* |x| >= 1 or nan */
if
(
ix
>=
0x3f800000
)
{
if
(
ix
==
0x3f800000
)
{
if
(
hx
>>
31
)
return
M_PI
;
return
0
;
}
if
(
isnan
(
x
))
return
x
;
return
math_error
(
_DOMAIN
,
"acosf"
,
x
,
0
,
0
/
(
x
-
x
));
}
/* |x| < 0.5 */
if
(
ix
<
0x3f000000
)
{
if
(
ix
<=
0x32800000
)
/* |x| < 2**-26 */
return
M_PI_2
;
return
pio2_hi
-
(
x
-
(
pio2_lo
-
x
*
asinf_R
(
x
*
x
)));
}
/* x < -0.5 */
if
(
hx
>>
31
)
{
z
=
(
1
+
x
)
*
0
.
5
f
;
s
=
sqrtf
(
z
);
return
2
*
(
pio2_hi
-
(
s
+
(
asinf_R
(
z
)
*
s
-
pio2_lo
)));
}
/* x > 0.5 */
z
=
(
1
-
x
)
*
0
.
5
f
;
s
=
sqrtf
(
z
);
hx
=
*
(
unsigned
int
*
)
&
s
&
0xffff0000
;
df
=
*
(
float
*
)
&
hx
;
c
=
(
z
-
df
*
df
)
/
(
s
+
df
);
w
=
asinf_R
(
z
)
*
s
+
c
;
return
2
*
(
df
+
w
);
}
/*********************************************************************
* asinf (MSVCRT.@)
*
* Copied from musl: src/math/asinf.c
...
...
libs/musl/src/math/acosf.c
View file @
c9399ae7
...
...
@@ -18,15 +18,16 @@
static
const
float
pio2_hi
=
1.5707962513e+00
,
/* 0x3fc90fda */
pio2_lo
=
7.5497894159e-08
,
/* 0x33a22168 */
pS0
=
1.6666586697e-01
,
pS1
=
-
4.2743422091e-02
,
pS2
=
-
8.6563630030e-03
,
qS1
=
-
7.0662963390e-01
;
pS0
=
1.66666672e-01
,
pS1
=
-
5.11644611e-02
,
pS2
=
-
1.21124933e-02
,
pS3
=
-
3.58742251e-03
,
qS1
=
-
7.56982703e-01
;
static
float
R
(
float
z
)
{
float_t
p
,
q
;
p
=
z
*
(
pS0
+
z
*
(
pS1
+
z
*
pS2
));
p
=
z
*
(
pS0
+
z
*
(
pS1
+
z
*
(
pS2
+
z
*
pS3
)
));
q
=
1
.
0
f
+
z
*
qS1
;
return
p
/
q
;
}
...
...
@@ -42,23 +43,23 @@ float __cdecl acosf(float x)
if
(
ix
>=
0x3f800000
)
{
if
(
ix
==
0x3f800000
)
{
if
(
hx
>>
31
)
return
2
*
pio2_hi
+
0x1
p
-
120
f
;
return
M_PI
;
return
0
;
}
return
0
/
(
x
-
x
);
if
(
isnan
(
x
))
return
x
;
return
math_error
(
_DOMAIN
,
"acosf"
,
x
,
0
,
0
/
(
x
-
x
));
}
/* |x| < 0.5 */
if
(
ix
<
0x3f000000
)
{
if
(
ix
<=
0x32800000
)
/* |x| < 2**-26 */
return
pio2_hi
+
0x1
p
-
120
f
;
return
M_PI_2
;
return
pio2_hi
-
(
x
-
(
pio2_lo
-
x
*
R
(
x
*
x
)));
}
/* x < -0.5 */
if
(
hx
>>
31
)
{
z
=
(
1
+
x
)
*
0
.
5
f
;
s
=
sqrtf
(
z
);
w
=
R
(
z
)
*
s
-
pio2_lo
;
return
2
*
(
pio2_hi
-
(
s
+
w
));
return
2
*
(
pio2_hi
-
(
s
+
(
R
(
z
)
*
s
-
pio2_lo
)));
}
/* x > 0.5 */
z
=
(
1
-
x
)
*
0
.
5
f
;
...
...
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