📄 testreport.txt
字号:
TEST REPORT OF CRUNCHLIB
1. Objective
This report is to give test result and conclusion of Crunchlib.
2. Scope
The test covers of only those functions that are exported from the crunchlib
DLL as specified in crunchlibspec.txt, are covered in this document. The
following is the list of the 27 functions that are covered in the test.
<1> General Purpose Functions
double ceil(double);
double floor(double);
double fabs(double);
double sqrt(double);
double fmod(double, double);
float ceilf(float);
float floorf(float);
float fabsf(float);
float sqrtf(float);
float fmodf(float, float);
<2> Transcendental Floating-Point Functions
<<1>> Logarithmic Functions
double pow(double, double);
double log(double);
double log10(double);
double exp(double);
<<2>> Trigonometric Functions
double sin(double);
double cos(double);
double tan(double);
double asin(double);
double acos(double);
double atan(double);
double atan2(double, double);
<<3>> Hyperbolic Functions
double sinh(double);
double cosh(double);
double tanh(double);
<3> Compute the Bessel functions
double _y0( double x );
double _y1( double x );
double _yn( int n, double x );
This document keeps down the test cases and test result of them. It also
gives a summarized test conclusion of the Crunchlib. The test covers the
following aspects or cases of the test for Crunchlib.
- accuracy test
- exception test
- thread security test
- performance test
They are put in details in section 4 through 7 repectively. The conclusion
is given in section 8.
3. Introduction
The crunchlib DLL is to provide hardware replacement for the intrinsic
floating point functions in Windows CE kernel. Therefore, functions in
crunchlib must have equal calculation result, exception behavor and thread
security as their counterparts in Windows CE kernel. Meanwhile, their
performance, i.e., their speed must be higer than their counterparts in
Windows CE kernel.
The test code are divided into three seperated projects. They are accruacy
test, exception test and performance test. The thread security test is
embedded in the accuracy test as a build with MACRO MULTI_THREAD_TEST defined.
4. Accuracy Test
Accuracy test is to verify that functions in crunchlib give equal calculation
result to their counterparts in Windows CE kernel. As explained in document
crunchlibspec.txt, hard-float functions in the DLL give results that are equal
to those of their soft-float counterparts in the precision scope. That means
the result of hard-float and soft-float versions are not bit-exact. Their
difference is within a small value, which is acceptable for the users' precision
requirement.
The following is the summarized test result of mathtest.exe, the accruacy test
program. In the following description, bit N refers to the Nth bit from the
MSB. For example, bit 62 refers to the bit next to LSB. The average difference
starting bit is calculated from those results that are different from soft-float
ones. Therefore, the actual starting bit is greater than the calculated one. For
example, bit 62.87096774. The actual bit could be over 63. That means the precision
is actually higher than what is documented here.
<1> ceil The result is the same as soft-float version.
<2> floor The result is the same as soft-float version.
<3> fabs The result is the same as soft-float version.
<4> sqrt The difference of hard-float and soft-float result is LSB.
<5> fmod The result is the same as soft-float version.
<6> ceilf The result is the same as soft-float version.
<7> floorf The result is the same as soft-float version.
<8> fabsf The result is the same as soft-float version.
<9> sqrtf The result is the same as soft-float version.
<10> fmodf The result is the same as soft-float version.
<11> pow The largest difference of hard-float and soft-float result occurs
at bit 54. The average difference occurs at bit 60.1171875.
<12> log The largest difference occurs at bit 62. The average difference
occurs at bit 62.87096774.
<13> log10 The largest difference occurs at bit 62. The average difference
occurs at bit 62.80434783.
<14> exp The difference is the LSB.
<15> sin The largest difference occurs at bit 26. The worst cases occur
when inputs are near the product of one integer with pi. The
average difference occurs at bit 61.37681159.
<16> cos The largest difference occurs at bit 26. The worst cases occur
when inputs are near the product of one odd integer with pi/2.
The average difference occurs at bit 61.72881356.
<17> tan The largest difference occurs at bit 26. The worst cases occur
when inputs are near the product of one odd integer with pi/2.
The average difference occurs at bit 61.04081633.
<18> asin The largest difference occurs at bit 62. The average difference
occurs at bit 62.95.
<19> acos The largest difference occurs at bit 63. The average difference
occurs at bit 63.
<20> atan The largest difference occurs at bit 62. The average difference
occurs at bit 62.93442623.
<21> atan2 The result is the same as soft-float version.
<22> sinh The largest difference occurs at bit 62. The average difference
occurs at bit 62.97752809.
<23> cosh The largest difference occurs at bit 63. The average difference
occurs at bit 63.
<24> tanh The largest difference occurs at bit 62. The average difference
occurs at bit 62.94805195.
<25> _y0 The largest difference occurs at bit 57. The average difference
occurs at bit 61.75.
<26> _y1 The largest difference occurs at bit 57. The average difference
occurs at bit 61.90909091.
<27> _yn The largest difference occurs at bit 58. The average difference
occurs at bit 62.56578947.
5. Exception Test
Exception test is to verify that functions in crunchlib give equal exceptions
to their counterparts in Windows CE kernel. As explained in document
crunchlibspec.txt, hard-float functions in the DLL can only show similar behavor
to soft-float ones. What prevents hard-float functions from giving exactly the
same exceptions as soft-float ones is the difference between the algorithms that
crunchlib adopts and Windows CE kernel adopts. However, these difference in
exception behavor is understandable and will not bring any ill effect to users'
applications. These differences will be documented bellow.
The following is the summarized test result of exceptiontest.exe, the exception
test program. In the following description, five types of exceptions are covered,
division by zero, inexact result, overflow, underflow, and invalid operation.
<1> ceil The exception behavor is the same as soft-float version.
<2> floor The exception behavor is the same as soft-float version.
<3> fabs The exception behavor is the same as soft-float version.
<4> sqrt The exceptions sent are all invalid operations. While, soft-float
version sents inexact result exceptions also.
<5> fmod The exception behavor is the same as soft-float version.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -