Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
1e2fea63
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
接近 2 年 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1e2fea63
编写于
3月 20, 2012
作者:
N
nsz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix a cbrtl.c regression and remove x87 precision setting
上级
03c52e13
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
27 deletion
+6
-27
src/math/cbrtl.c
src/math/cbrtl.c
+6
-27
未找到文件。
src/math/cbrtl.c
浏览文件 @
1e2fea63
...
@@ -23,9 +23,9 @@ long double cbrtl(long double x)
...
@@ -23,9 +23,9 @@ long double cbrtl(long double x)
return
cbrt
(
x
);
return
cbrt
(
x
);
}
}
#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
#define BIAS (LDBL_MAX_EXP - 1)
static
const
unsigned
#define BIAS (LDBL_MAX_EXP - 1)
B1
=
709958130
;
/* B1 = (127-127.0/3-0.03306235651)*2**23 */
static
const
unsigned
B1
=
709958130
;
/* B1 = (127-127.0/3-0.03306235651)*2**23 */
long
double
cbrtl
(
long
double
x
)
long
double
cbrtl
(
long
double
x
)
{
{
...
@@ -48,25 +48,10 @@ long double cbrtl(long double x)
...
@@ -48,25 +48,10 @@ long double cbrtl(long double x)
if
(
k
==
BIAS
+
LDBL_MAX_EXP
)
if
(
k
==
BIAS
+
LDBL_MAX_EXP
)
return
x
+
x
;
return
x
+
x
;
// FIXME: extended precision is default on linux..
#undef __i386__
#ifdef __i386__
fp_prec_t
oprec
;
oprec
=
fpgetprec
();
if
(
oprec
!=
FP_PE
)
fpsetprec
(
FP_PE
);
#endif
if
(
k
==
0
)
{
if
(
k
==
0
)
{
/* If x = +-0, then cbrt(x) = +-0. */
/* If x = +-0, then cbrt(x) = +-0. */
if
((
u
.
bits
.
manh
|
u
.
bits
.
manl
)
==
0
)
{
if
((
u
.
bits
.
manh
|
u
.
bits
.
manl
)
==
0
)
#ifdef __i386__
return
x
;
if
(
oprec
!=
FP_PE
)
fpsetprec
(
oprec
);
#endif
return
(
x
);
}
/* Adjust subnormal numbers. */
/* Adjust subnormal numbers. */
u
.
e
*=
0x1
.
0
p514
;
u
.
e
*=
0x1
.
0
p514
;
k
=
u
.
bits
.
exp
;
k
=
u
.
bits
.
exp
;
...
@@ -118,7 +103,7 @@ long double cbrtl(long double x)
...
@@ -118,7 +103,7 @@ long double cbrtl(long double x)
* Round it away from zero to 32 bits (32 so that t*t is exact, and
* Round it away from zero to 32 bits (32 so that t*t is exact, and
* away from zero for technical reasons).
* away from zero for technical reasons).
*/
*/
t
=
dt
+
(
0x1
.
0
p32L
+
0x1
.
0
p
-
3
2
L
)
-
0x1
.
0
p32
;
t
=
dt
+
(
0x1
.
0
p32L
+
0x1
.
0
p
-
3
1
L
)
-
0x1
.
0
p32
;
#elif LDBL_MANT_DIG == 113
#elif LDBL_MANT_DIG == 113
/*
/*
* Round dt away from zero to 47 bits. Since we don't trust the 47,
* Round dt away from zero to 47 bits. Since we don't trust the 47,
...
@@ -129,8 +114,6 @@ long double cbrtl(long double x)
...
@@ -129,8 +114,6 @@ long double cbrtl(long double x)
* dt is much more accurate than needed.
* dt is much more accurate than needed.
*/
*/
t
=
dt
+
0x2
.
0
p
-
46
+
0x1
.
0
p60L
-
0x1
.
0
p60
;
t
=
dt
+
0x2
.
0
p
-
46
+
0x1
.
0
p60L
-
0x1
.
0
p60
;
#else
#error "Unsupported long double format"
#endif
#endif
/*
/*
...
@@ -144,10 +127,6 @@ long double cbrtl(long double x)
...
@@ -144,10 +127,6 @@ long double cbrtl(long double x)
t
=
t
+
t
*
r
;
/* error <= 0.5 + 0.5/3 + epsilon */
t
=
t
+
t
*
r
;
/* error <= 0.5 + 0.5/3 + epsilon */
t
*=
v
.
e
;
t
*=
v
.
e
;
#ifdef __i386__
if
(
oprec
!=
FP_PE
)
fpsetprec
(
oprec
);
#endif
return
t
;
return
t
;
}
}
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录