CUDA sincospi函数精度 [英] CUDA sincospi function precision

查看:1086
本文介绍了CUDA sincospi函数精度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找,我找不到如何函数计算或使用它的PI部分。
对于我的项目,我使用一个定义的常数,精度为PI的34位小数。但是,这比PI的正常math.h定义的常数要多,这是16个小数位。

I was looking all over and I couldn't find how the function computes or uses it's PI part. For my project I am using a defined constant that has precision of 34 decimal places for PI. However, this is much more than the normal math.h defined constant for PI which is 16 decimal places.

我的问题是PI的精确性是sincospi用来计算回答?是否只是使用path常量从math.h?

My question is how precise of PI is sincospi using to compute its answer? Is it just using the PI constant from math.h?

推荐答案

sincospi()的最大ulp错误是相同的sincos()的最大ulp误差:结果与正确的圆角参考相差最多1 ulp,或者换句话说,结果与无限精确的数学结果偏差小于1.5 ulps。平均来说,超过90 +%的结果正确地四舍五入。所有CUDA数学函数的最大观察误差记录在CUDA C编程指南的附录中。 sincospi(x)的精度优于sincos(M_PI * x)所获得的精度,因为后者由于函数参数的乘法而产生额外的舍入误差。

The maximum ulp error for sincospi() is the same as the maximum ulp error for sincos(): The results differ by up to 1 ulp from a correctly rounded reference, or stated differently, the results deviate by less than 1.5 ulps from the infinitely precise mathematical result. On average, more than 90+% of results are correctly rounded. The maximum observed error for all CUDA math functions is documented in an appendix of the CUDA C Programming Guide. The accuracy of sincospi(x) is superior to the accuracy achieved by sincos(M_PI*x), as the latter incurs additional rounding error due to the multiplication of the function argument.

这篇关于CUDA sincospi函数精度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆