mathimf and windows

98 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Sergey,

Melanie, mainly provided with a suggestion of an alternative flag.( no misunderstandings: I did try her test.c )

Also, not all the 1,000,000 elements are long double. Only their (partial) sums !!

Best Regards,

P-

>>>Noone cares about the silly printf, noone ever intended to call it - except from the very unfortunate test in

the documentation- I mean, who really wants to show a new feature by focussing on what it cannot do ;-))>>>

I know that nobody including me cares about printf,but in the end while working on Win platform you are dependent on Windows chain of execution components.Function printf was brought as a example because it was part of your code. Hope it helps.

Petros, as I promised a different test-case will be provided. I finally found article 'Using Intel Math Library' you've mentioned. Also,

>>...not all the 1,000,000 elements are long double. Only their (partial) sums !!..

this is a very important note and I'll try to simulate if a processing with mixed floating-point data types, for example float and double, improves accuracy of results.

Citation :

Sergey Kostrov a écrit :

Petros, as I promised a different test-case will be provided. I finally found article 'Using Intel Math Library' you've mentioned. Also,

>>...not all the 1,000,000 elements are long double. Only their (partial) sums !!..

this is a very important note and I'll try to simulate if a processing with mixed floating-point data types, for example float and double, improves accuracy of results.

Such a test case could be very interesting.Mainly for precission and accuracy of the accumulated sum.Sadly all this process at runtime is performed by the CPU microcode and hardware and it is opaque to the programmer.

The most interesting thing about the test case is that it prints pass when using the Intel compiler with /Qlong-double and fail otherwise.

You don't need to wait for the next release, the current download of the Intel c++ compiler for windows supports /Qlong-double

I found a version of the 12.1 compiler to test on Windows with vs2010. I tested both ia32 and intel64, and the test passes in either case. Since you have 12.1 also, it's still a puzzle as to why the option isn't recognized. Your compiler doesn't appear to print the same versionn string, I'll check if this is a version specific thing...   I usually use the compiler from the command line (cmd.exe). You can use iclvars.bat which is in the compiler installation directory to set up your path. 

>icl /Qlong-double test.cIntel(R) C++ Compiler XE for applications running on IA-32, Version 12.1.5.344 Build 20120612Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.
test.cMicrosoft (R) Incremental Linker Version 10.00.40219.01Copyright (C) Microsoft Corporation.  All rights reserved.
-out:test.exetest.obj 

>.\test.exe
TEST PASSED

>>...Version 12.1.5.344 Build 20120612...

Finally it is clear what version you're using. Thank you, Melanie.

Petros,

I've completed a first part of my investigation related to /Qlong-double /Qpc80 options of Intel C++ compiler ( version 12.1.3.300 / even older than you have ) and all results will be posted soon.

Note: All outputs are provided AS IS and without any modifications.

Here is a very simple test-case:
...
// Sub-Test 66 - Problem with 'long double' floating-point data type
{
printf( "Sub-Test 66\n" );

printf( "Size of [ long double ] is: %d\n", sizeof( long double ) );
}
...

All the rest tests, that is precision control and accuracy evaluation, will be done next week and please monitor the thread.

Best regards,
Sergey

[ Compilation output without /Qlong-double /Qpc80 ]

------ Build started: Project: IccTestApp, Configuration: Debug Win32 ------
Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment)
Stdphf.cpp
*** ScaLib Message: Compiling with Intel C++ v12.1.3 ***
*** ScaLib Message: Configuration - Desktop - _WIN32_ICC - DEBUG ***
*** ScaLib Message: Compiling for Intel Processing Unit ( 32-bit ) ***
*** ScaLib Message: Declared HRT-Types ***
*** ScaLib Message: Unicode Character Set ***
*** ScaLib Message: Support for HRT-Functions Enabled ***
Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment)
IccTestApp.cpp
Linking... (Intel C++ Environment)
xilink: executing 'link'
Creating library C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.lib and object C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.exp
Embedding manifest... (Microsoft VC++ Environment)
IccTestApp - 0 error(s), 0 warning(s), 0 remark(s)
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

[ Test output ]

C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug>IccTestAppD.exe
Application - IccTestApp - WIN32_ICC - Debug
Tests: Start
> Test1017 Start <
Sub-Test 66
Size of [ long double ] is: 8
Test Completed in 0 ticks
> Test1017 End <
Tests: Completed
Memory Blocks Allocated : 0
Memory Blocks Released : 0
Memory Blocks NOT Released: 0
Memory Tracer Integrity Verified - Memory Leaks NOT Detected

Deallocating Memory Tracer Data Table
Completed

[ Complete list of Intel C++ compiler options ]

/c /Od /I "..\..\Include" /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_WIN32_ICC" /D "_VC80_UPGRADE=0x0710" /D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /Yu"Stdphf.h" /Fp"Debug\IccTestAppD.pch" /Fo"Debug/" /W5 /nologo /Wp64 /ZI /TP /U "_WIN32_MSC" /U "_WIN32CE_MSC" /U "WIN32_PLATFORM_PSPC" /U "WIN32_PLATFORM_WFSP" /U "WIN32_PLATFORM_WM50" /U "_WIN32_MGW" /U "_WIN32_BCC" /U "_COS16_TCC" /Qopenmp /Qdiag-disable:111,673

[ Compilation output with /Qlong-double ]

------ Build started: Project: IccTestApp, Configuration: Debug Win32 ------
Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment)
Stdphf.cpp
*** ScaLib Message: Compiling with Intel C++ v12.1.3 ***
*** ScaLib Message: Configuration - Desktop - _WIN32_ICC - DEBUG ***
*** ScaLib Message: Compiling for Intel Processing Unit ( 32-bit ) ***
*** ScaLib Message: Declared HRT-Types ***
*** ScaLib Message: Unicode Character Set ***
*** ScaLib Message: Support for HRT-Functions Enabled ***
Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment)
IccTestApp.cpp
Linking... (Intel C++ Environment)
xilink: executing 'link'
Creating library C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.lib and object C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.exp
Embedding manifest... (Microsoft VC++ Environment)
IccTestApp - 0 error(s), 0 warning(s), 0 remark(s)
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

[ Test output ]

C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug>IccTestAppD.exe
Application - IccTestApp - WIN32_ICC - Debug
Tests: Start
> Test1017 Start <
Sub-Test 66
Size of [ long double ] is: 16
Test Completed in 0 ticks
> Test1017 End <
Tests: Completed
Memory Blocks Allocated : 0
Memory Blocks Released : 0
Memory Blocks NOT Released: 0
Memory Tracer Integrity Verified - Memory Leaks NOT Detected

Deallocating Memory Tracer Data Table
Completed

[ Complete list of Intel C++ compiler options ]

/c /Od /I "..\..\Include" /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_WIN32_ICC" /D "_VC80_UPGRADE=0x0710" /D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /Yu"Stdphf.h" /Fp"Debug\IccTestAppD.pch" /Fo"Debug/" /W5 /nologo /Wp64 /ZI /TP /U "_WIN32_MSC" /U "_WIN32CE_MSC" /U "WIN32_PLATFORM_PSPC" /U "WIN32_PLATFORM_WFSP" /U "WIN32_PLATFORM_WM50" /U "_WIN32_MGW" /U "_WIN32_BCC" /U "_COS16_TCC" /Qopenmp /Qdiag-disable:111,673 /Qlong-double

[ Compilation output with /Qlong-double /Qpc80 ]

------ Build started: Project: IccTestApp, Configuration: Debug Win32 ------
Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment)
Stdphf.cpp
Warning #1680: this option conflicts with the floating-point mode specification: -Qpc80

*** ScaLib Message: Compiling with Intel C++ v12.1.3 ***
*** ScaLib Message: Configuration - Desktop - _WIN32_ICC - DEBUG ***
*** ScaLib Message: Compiling for Intel Processing Unit ( 32-bit ) ***
*** ScaLib Message: Declared HRT-Types ***
*** ScaLib Message: Unicode Character Set ***
*** ScaLib Message: Support for HRT-Functions Enabled ***
Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment)
IccTestApp.cpp
Warning #1680: this option conflicts with the floating-point mode specification: -Qpc80

Linking... (Intel C++ Environment)
xilink: executing 'link'
Creating library C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.lib and object C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.exp
Embedding manifest... (Microsoft VC++ Environment)
IccTestApp - 0 error(s), 0 warning(s), 2 remark(s)
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

[ Test output ]

C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug>IccTestAppD.exe
Application - IccTestApp - WIN32_ICC - Debug
Tests: Start
> Test1017 Start <
Sub-Test 66
Size of [ long double ] is: 16
Test Completed in 0 ticks
> Test1017 End <
Tests: Completed
Memory Blocks Allocated : 0
Memory Blocks Released : 0
Memory Blocks NOT Released: 0
Memory Tracer Integrity Verified - Memory Leaks NOT Detected

Deallocating Memory Tracer Data Table
Completed

[ Complete list of Intel C++ compiler options ]

/c /Od /I "..\..\Include" /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_WIN32_ICC" /D "_VC80_UPGRADE=0x0710" /D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /Yu"Stdphf.h" /Fp"Debug\IccTestAppD.pch" /Fo"Debug/" /W5 /nologo /Wp64 /ZI /TP /U "_WIN32_MSC" /U "_WIN32CE_MSC" /U "WIN32_PLATFORM_PSPC" /U "WIN32_PLATFORM_WFSP" /U "WIN32_PLATFORM_WM50" /U "_WIN32_MGW" /U "_WIN32_BCC" /U "_COS16_TCC" /Qopenmp /Qdiag-disable:111,673 /Qlong-double /Qpc80

Here are details on

My Development Environment:

OS: Windows XP 32-bit SP3
IDE: Visual Studio 2005 Professional Edition SP1 ( and all the rest updates )
Intel C++ compiler version ( Composer XE 2011 Update 9 / 12.1.3.300 [IA-32] )

tuned for investigation of your problem.

>>>Size of [ long double ] is: 16>>>

So the size for long double is 16 bytes.Exactly as you pointed out in one of your posts.It is interesting what is memory layout of such a value.I suppose that the value(binary number)is padded with 6 bytes of 0's for alignment.

I don't think you can make any assumptions about the values of the padding bytes.

>>...Also, not all the 1,000,000 elements are long double. Only their (partial) sums !!

Petros, this is my preliminary conclusion.

So, usage of long double to hold partial results won't improve accuracy of your calculations and I recommend to change declarations of all array elements to long double if it is possible.

Another set of test results will be posted today.

>>>I don't think you can make any assumptions about the values of the padding bytes.>>>

Sorry my english is still not perfect I should have written "could".I know that I can not make any assumptions about the padding unless I will be able to see such a value under debugger.

Hi Melanie,

It seems that my compiler is slightly older than yours :

C:\Program Files (x86)\Intel\Parallel Studio 2011>icl
Intel(R) C++ Compiler for applications running on Intel(R) 64, Version 12.1.0.04
3 Build 20110811
Copyright (C) 1985-2011 Intel Corporation.  All rights reserved.

icl: command line error: no files specified; for help type "icl /help"

C:\Program Files (x86)\Intel\Parallel Studio 2011>

-Sergey, I think my icl is a bit "older".

So, it looks increasingly possible that my version in not recent enough. Still it looks kind of a big difference for such a slight version update ;-))

Finally, by next release, I meant from the one I have not the one that is avail out there

>>...Intel(R) C++ Compiler for applications running on Intel(R) 64, Version 12.1.0.043 Build 20110811
>>...
>>...my version in not recent enough...

Thanks for the version information. However, /Qlong-double option could be considered as fundamental and, possibly, very old. Isn't that true?

Petros, another set of test results with a test-case will be posted soon.

Note: Results for Microsoft and Intel C++ compilers

[ Microsoft C++ compiler ( default FP options ) ]

Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
_RTFPU_CW_DEFAULT & _RTFPU_CW_ALLBITSON: 0x9001F
_RTFPU_PC_24 & _RTFPU_MCW_PC : 0xA001F
_RTFPU_PC_53 & _RTFPU_MCW_PC : 0x9001F
_RTFPU_PC_64 & _RTFPU_MCW_PC : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _RTFPU_PC_24 - long double - Result: 1.0090389251708984
Test-Case 3.3
Accuracy _RTFPU_PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000079181

//

[ Intel C++ compiler ( default FP options / without /Qlong-double /Qpc80 ) ]

Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
_RTFPU_CW_DEFAULT & _RTFPU_CW_ALLBITSON: 0x9001F
_RTFPU_PC_24 & _RTFPU_MCW_PC : 0xA001F
_RTFPU_PC_53 & _RTFPU_MCW_PC : 0x9001F
_RTFPU_PC_64 & _RTFPU_MCW_PC : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _RTFPU_PC_24 - long double - Result: 1.0000000000079181
Test-Case 3.3
Accuracy _RTFPU_PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000079181

//

[ Intel C++ compiler ( default FP options / with /Qlong-double ) ]

Test-Case 1
Size of [ long double ] is: 16
Test-Case 2
_RTFPU_CW_DEFAULT & _RTFPU_CW_ALLBITSON: 0x9001F
_RTFPU_PC_24 & _RTFPU_MCW_PC : 0xA001F
_RTFPU_PC_53 & _RTFPU_MCW_PC : 0x9001F
_RTFPU_PC_64 & _RTFPU_MCW_PC : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _RTFPU_PC_24 - long double - Result: 1.0090389251708984
Test-Case 3.3
Accuracy _RTFPU_PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000000109

//

[ Intel C++ compiler ( default FP options / with /Qlong-double /Qpc80 ) ]

Test-Case 1
Size of [ long double ] is: 16
Test-Case 2
_RTFPU_CW_DEFAULT & _RTFPU_CW_ALLBITSON: 0x9001F
_RTFPU_PC_24 & _RTFPU_MCW_PC : 0xA001F
_RTFPU_PC_53 & _RTFPU_MCW_PC : 0x9001F
_RTFPU_PC_64 & _RTFPU_MCW_PC : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _RTFPU_PC_24 - long double - Result: 1.0090389251708984
Test-Case 3.3
Accuracy _RTFPU_PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000000109

Note: Results for Borland, MinGW and Turbo C++ compilers ( for comparison )

[ Borland C++ compiler ( default FP options ) ]

Test-Case 1
Size of [ long double ] is: 10
Test-Case 2
_RTFPU_CW_DEFAULT & _RTFPU_CW_ALLBITSON: 0x1332
_RTFPU_PC_24 & _RTFPU_MCW_PC : 0x1072
_RTFPU_PC_53 & _RTFPU_MCW_PC : 0x1272
_RTFPU_PC_64 & _RTFPU_MCW_PC : 0x1372
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000000109
Sub-Test 3.2
Accuracy _RTFPU_PC_24 - long double - Result: 1.0090390006792192
Test-Case 3.3
Accuracy _RTFPU_PC_53 - long double - Result: 1.0000000000079182
Test-Case 3.4
Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000000109

//

[ MinGW C++ compiler ( default FP options ) ]

Test-Case 1
Size of [ long double ] is: 12
Test-Case 2
_RTFPU_CW_DEFAULT & _RTFPU_CW_ALLBITSON: 0x9001F
_RTFPU_PC_24 & _RTFPU_MCW_PC : 0xA001F
_RTFPU_PC_53 & _RTFPU_MCW_PC : 0x9001F
_RTFPU_PC_64 & _RTFPU_MCW_PC : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _RTFPU_PC_24 - long double - Result: 1.0090389251708984
Test-Case 3.3
Accuracy _RTFPU_PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000000109

//

[ Turbo C++ compiler ( default FP options ) ]

Test-Case 1
Size of [ long double ] is: 10
Test-Case 2
_RTFPU_CW_DEFAULT & _RTFPU_CW_ALLBITSON: 0x1330
_RTFPU_PC_24 & _RTFPU_MCW_PC : 0x1072
_RTFPU_PC_53 & _RTFPU_MCW_PC : 0x1272
_RTFPU_PC_64 & _RTFPU_MCW_PC : 0x1372
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000000109
Sub-Test 3.2
Accuracy _RTFPU_PC_24 - long double - Result: 1.0090390006792192
Test-Case 3.3
Accuracy _RTFPU_PC_53 - long double - Result: 1.0000000000079182
Test-Case 3.4
Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000000109

Note: Almost a 20-year-old technology...

Petros, let me know if you have any questions.

// Sub-Test 66 - Support for 'long double' floating-point data type
// Note: /Qlong-double /Qpc80 options must be used for Intel C++ compiler
{
CrtPrintf( RTU("Sub-Test 66\n") );

// Test-Case 1
{
CrtPrintf( RTU("Test-Case 1\n") );
CrtPrintf( RTU("Size of [ long double ] is: %d\n"), sizeof( long double ) );
}

RTuint uiControlWordx87 = 0U;
RTint i = 0;

// Test-Case 2
{
CrtPrintf( RTU("Test-Case 2\n") );
uiControlWordx87 = CrtControl87( _RTFPU_CW_DEFAULT, _RTFPU_CW_ALLBITSON );
CrtPrintf( RTU("_RTFPU_CW_DEFAULT & _RTFPU_CW_ALLBITSON: 0x%.4X\n"), uiControlWordx87 );

uiControlWordx87 = CrtControl87( _RTFPU_PC_24, _RTFPU_MCW_PC );
CrtPrintf( RTU("_RTFPU_PC_24 & _RTFPU_MCW_PC : 0x%.4X\n"), uiControlWordx87 );

uiControlWordx87 = CrtControl87( _RTFPU_PC_53, _RTFPU_MCW_PC );
CrtPrintf( RTU("_RTFPU_PC_53 & _RTFPU_MCW_PC : 0x%.4X\n"), uiControlWordx87 );

uiControlWordx87 = CrtControl87( _RTFPU_PC_64, _RTFPU_MCW_PC );
CrtPrintf( RTU("_RTFPU_PC_64 & _RTFPU_MCW_PC : 0x%.4X\n"), uiControlWordx87 );
}

// Test-Case 3.1 - _CW_DEFAULT - long double
{
CrtPrintf( RTU("Test-Case 3.1\n") );
uiControlWordx87 = CrtControl87( _RTFPU_CW_DEFAULT, _RTFPU_MCW_PC );
long double dSum = 0.0L;
for( i = 0; i < 1000000; i++ )
{
dSum += 0.000001L;
}
CrtPrintf( RTU("Accuracy _CW_DEFAULT - long double - Result: %18.16f\n"), ( double )dSum );
}
// Test-Case 3.2 - _RTFPU_PC_24 - long double
{
CrtPrintf( RTU("Sub-Test 3.2\n") );
uiControlWordx87 = CrtControl87( _RTFPU_PC_24, _RTFPU_MCW_PC );
long double dSum = 0.0L;
for( i = 0; i < 1000000; i++ )
{
dSum += 0.000001L;
}
CrtPrintf( RTU("Accuracy _RTFPU_PC_24 - long double - Result: %18.16f\n"), ( double )dSum );
}
// Test-Case 3.3 - _RTFPU_PC_53 - long double
{
CrtPrintf( RTU("Test-Case 3.3\n") );
uiControlWordx87 = CrtControl87( _RTFPU_PC_53, _RTFPU_MCW_PC );
long double dSum = 0.0L;
for( i = 0; i < 1000000; i++ )
{
dSum += 0.000001L;
}
CrtPrintf( RTU("Accuracy _RTFPU_PC_53 - long double - Result: %18.16f\n"), ( double )dSum );
}
// Test-Case 3.4 - _RTFPU_PC_64 - long double
{
CrtPrintf( RTU("Test-Case 3.4\n") );
uiControlWordx87 = CrtControl87( _RTFPU_PC_64, _RTFPU_MCW_PC );
long double dSum = 0.0L;
for( i = 0; i < 1000000; i++ )
{
dSum += 0.000001L;
}
CrtPrintf( RTU("Accuracy _RTFPU_PC_64 - long double - Result: %18.16f\n"), ( double )dSum );
}
}

Note: today's posts are 2nd part and last one ( evaluation of accumulated error(s) ) will be done by the end of the week.

PS: Petros, did you try to upgrade Intel C++ compiler?

And some notes related to a latest test-case:

CrtPrintf -> printf or _tprintf

CrtControl87 -> _control87 or _controlfp

RTU macro -> _T macro ( UNICODE or MBCS support ) or nothing

_RTFPU_xxxx macros -> see float.h header file for more details

Sergey,

My compiler version does not support the long-double flag !!

I do not understand what you are implying. Yes, I aggree that is is a major change and should exist in my version, but the situation remains that the compiler warns me that it does not know and such flag !

>>...but the situation remains that the compiler warns me that it does not know and such flag !

Please consider upgrade of your older Intel C++ compiler to a newer version. Is there anything that prevents you from doing it?

Also, take a look at a new thread ( if interested ):

Forum-topic: Mixing of Floating-Point Types ( MFPT ) when performing calculations. Does it improve accuracy?
Web-link: http://software.intel.com/en-us/forums/topic/361134

Yes, my friend,

Alas, there is $1200 btn me and your suggestion..

>>...Alas, there is $1200 btn me and your suggestion...

I understand, Petros. Well, would you be able to execute Test-Case 3.4 - _RTFPU_PC_64 - long double with your older compiler? I'd like to see if you will get:

Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000079181

or

Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000000109

Sergey,

 Trying to compile your program. What is RTuint ? - just copied the code off the posting and probably don't have the right include files (only float.h and mathimf.h).

In particular I don't know what RTuint, RTint, _RTFPU_PC_64 and _RTFPU_MCW_PC are.

>>...In particular I don't know what RTuint, RTint, _RTFPU_PC_64 and _RTFPU_MCW_PC are...

Please do the following changes:

RTuint -> unsigned int
RTint -> int
_RTFPU_PC_64 -> _PC_64 ( declared in float.h )
_RTFPU_MCW_PC -> MCW_PC ( declared in float.h )
CrtControl87 -> _control87 ( declared in float.h )

and post a result as soon as the test is completed.

>>...and mathimf.h...

Take into account that my test-cases are very generic and could be compiled with many C/C++ compilers.

>>...In particular I don't know what RTuint, RTint, _RTFPU_PC_64 and _RTFPU_MCW_PC are...

Sergey do these typedefs belong to your Real time library?

Sergey,

here you go :

LDBL_MANT_DIG is equal to 53. It is not correct if "long double" supported by compiler. It must be 64

LDBL_DIG is equal to 15. It is not correct if "long double" supported by compiler. It must be 18

LDBL_MIN_EXP is equal to -1021. It is not correct if "long double" supported by compiler.  It must be -16381

LDBL_MAX_EXP is equal to 1024. It is not correct if "long double" supported by compiler.  It must be 16384

TEST FAILED

Petros, you've submitted results for a different test ( from Intel / not from me ). A couple of posts before this one I posted:

...
Well, would you be able to execute Test-Case 3.4 - _RTFPU_PC_64 - long double with your older compiler? I'd like to see if you will get:

Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000079181

or

Accuracy _RTFPU_PC_64 - long double - Result: 1.0000000000000109
...

Once again, you need to execute Test-Case 3.4 - _RTFPU_PC_64 - long double, please.

>>>>...In particular I don't know what RTuint, RTint, _RTFPU_PC_64 and _RTFPU_MCW_PC are...
>>
>>...do these typedefs belong to your Real time library?

Yes and I provided a short instruction on required changes a couple of posts before this one. RT stands for Run-Time.

Sergey,

it aborts on line :

uiControlWordx87 = CrtControl87( _RTFPU_PC_64, _RTFPU_MCW_PC );

( something about an assertion on ieee.c line 109)

>>it aborts on line :
>>
>>uiControlWordx87 = CrtControl87( _RTFPU_PC_64, _RTFPU_MCW_PC );

[ SergeyK ] Could you try the same test with _RTFPU_PC_53 ( 53-bit precision )?

>>
>>( something about an assertion on ieee.c line 109)

Petros, could you provide a screenshot, or a description of what you've done, or any additional information ( as much as you can ) about origins of ieee.c file?

Also, I will create a complete Visual Studio project by the end of the week to simplify your investigation. It is not clear for me what is going on on your computer.

Citation :

Sergey Kostrov a écrit :

>>>>...In particular I don't know what RTuint, RTint, _RTFPU_PC_64 and _RTFPU_MCW_PC are...
>>
>>...do these typedefs belong to your Real time library?

Yes and I provided a short instruction on required changes a couple of posts before this one. RT stands for Run-Time.

I confused it with  Real-Time  library.IIRC few months ago you talked about the such a library.

Sergey,

I have never used ieee.c. Simply including the float.h and the mathimf.h.

I think it is better to wait for your test project (it is already Thursday, even beginning/middle of next week would be very OK )

.Thank you very much for all your help !

P-

A short follow up.

>>...>>( something about an assertion on ieee.c line 109)...

I reproduced the Debug Assertion Failed error message and I need a confirmation that you've tried to execute a 64-bit test application on a 64-bit Windows platform. I'll provide all the rest details as soon as the VS test project is ready.

>>...I'll provide all the rest details as soon as the VS test project is ready

Here it is:


and it comes from msvcr80d.dll. In Debug configuration expression ( mask &~ ( _MCW_DN | _MCW_EM | _MCW_RC ) ) == 0 checks that _MCW_PC bits are not set ( you need to press Ignore button because the message is actually a warning ).

Fichiers joints: 

Fichier attachéTaille
Télécharger debugassertionfailed.jpg38.29 Ko

VS 2005 ( Professional Edition ) projects for Intel and Microsoft C/C++ compilers attached.

Fichiers joints: 

Fichier attachéTaille
Télécharger fputestapp.zip11.13 Ko

This is what you should see:

[ Microsoft C++ compiler / on 32-bit Windows / DEBUG ]
Output:

32-bit Windows platform - Configuration: DEBUG
Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
_CW_DEFAULT & ALLBITSON: 0x9001F
_PC_24 & _MCW_PC : 0xA001F
_PC_53 & _MCW_PC : 0x9001F
_PC_64 & _MCW_PC : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _PC_24 - long double - Result: 1.0090389251708984
Test-Case 3.3
Accuracy _PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _PC_64 - long double - Result: 1.0000000000079181
Test-Case 4

Matrix A
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

Matrix B
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

MFPT Used

Matrix C - Result
13826808.0 14187608.0 14548408.0 14909208.0 15270008.0 15630808.0 15991608.0 16352408.0
32393208.0 33394008.0 34394808.0 35395608.0 36396408.0 37397208.0 38398008.0 39398808.0
50959608.0 52600408.0 54241208.0 55882008.0 57522808.0 59163608.0 60804408.0 62445208.0
69526008.0 71806808.0 74087608.0 76368408.0 78649208.0 80930008.0 83210808.0 85491608.0
88092408.0 91013208.0 93934008.0 96854808.0 99775608.0 102696408.0 105617208.0 108538008.0
106658808.0 110219608.0 113780408.0 117341208.0 120902008.0 124462808.0 128023608.0 131584408.0
125225208.0 129426008.0 133626808.0 137827616.0 142028416.0 146229216.0 150430016.0 154630816.0
143791616.0 148632416.0 153473216.0 158314016.0 163154816.0 167995616.0 172836416.0 177677216.0

Press ESC to Exit...

[ Microsoft C++ compiler / on 32-bit Windows / RELEASE ]
Output:

32-bit Windows platform - Configuration: RELEASE
Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
_CW_DEFAULT & ALLBITSON: 0x9001F
_PC_24 & _MCW_PC : 0xA001F
_PC_53 & _MCW_PC : 0x9001F
_PC_64 & _MCW_PC : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _PC_24 - long double - Result: 1.0090389251708984
Test-Case 3.3
Accuracy _PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _PC_64 - long double - Result: 1.0000000000000109
Test-Case 4

Matrix A
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

Matrix B
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

MFPT Used

Matrix C - Result
13826808.0 14187608.0 14548408.0 14909208.0 15270008.0 15630808.0 15991608.0 16352408.0
32393208.0 33394008.0 34394808.0 35395608.0 36396408.0 37397208.0 38398008.0 39398808.0
50959608.0 52600408.0 54241208.0 55882008.0 57522808.0 59163608.0 60804408.0 62445208.0
69526008.0 71806808.0 74087608.0 76368408.0 78649208.0 80930008.0 83210808.0 85491608.0
88092408.0 91013208.0 93934008.0 96854808.0 99775608.0 102696408.0 105617208.0 108538008.0
106658808.0 110219608.0 113780408.0 117341208.0 120902008.0 124462808.0 128023608.0 131584408.0
125225208.0 129426008.0 133626808.0 137827616.0 142028416.0 146229216.0 150430016.0 154630816.0
143791616.0 148632416.0 153473216.0 158314016.0 163154816.0 167995616.0 172836416.0 177677216.0

Press ESC to Exit...

[ Intel C++ compiler / on 32-bit Windows / DEBUG ]
Output:

32-bit Windows platform - Configuration: DEBUG
Test-Case 1
Size of [ long double ] is: 16
Test-Case 2
_CW_DEFAULT & ALLBITSON: 0x9001F
_PC_24 & _MCW_PC : 0xA001F
_PC_53 & _MCW_PC : 0x9001F
_PC_64 & _MCW_PC : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _PC_24 - long double - Result: 1.0090389251708984
Test-Case 3.3
Accuracy _PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _PC_64 - long double - Result: 1.0000000000000109
Test-Case 4

Matrix A
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

Matrix B
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

MFPT Used

Matrix C - Result
13826808.0 14187608.0 14548408.0 14909208.0 15270008.0 15630808.0 15991608.0 16352408.0
32393208.0 33394008.0 34394808.0 35395608.0 36396408.0 37397208.0 38398008.0 39398808.0
50959608.0 52600408.0 54241208.0 55882008.0 57522808.0 59163608.0 60804408.0 62445208.0
69526008.0 71806808.0 74087608.0 76368408.0 78649208.0 80930008.0 83210808.0 85491608.0
88092408.0 91013208.0 93934008.0 96854808.0 99775608.0 102696408.0 105617208.0 108538008.0
106658808.0 110219608.0 113780408.0 117341208.0 120902008.0 124462800.0 128023600.0 131584400.0
125225200.0 129426000.0 133626800.0 137827600.0 142028400.0 146229200.0 150430000.0 154630800.0
143791600.0 148632400.0 153473200.0 158314000.0 163154800.0 167995600.0 172836400.0 177677200.0

Press ESC to Exit...

[ Intel C++ compiler / on 32-bit Windows / RELEASE ]
Output:

32-bit Windows platform - Configuration: RELEASE
Test-Case 1
Size of [ long double ] is: 16
Test-Case 2
_CW_DEFAULT & ALLBITSON: 0x109001F
_PC_24 & _MCW_PC : 0x10A001F
_PC_53 & _MCW_PC : 0x109001F
_PC_64 & _MCW_PC : 0x108001F
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _PC_24 - long double - Result: 1.0090389251708984
Test-Case 3.3
Accuracy _PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _PC_64 - long double - Result: 1.0000000000000109
Test-Case 4

Matrix A
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

Matrix B
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

MFPT Used

Matrix C - Result
13826808.0 14187608.0 14548408.0 14909208.0 15270008.0 15630808.0 15991608.0 16352408.0
32393208.0 33394008.0 34394808.0 35395608.0 36396408.0 37397208.0 38398008.0 39398808.0
50959608.0 52600408.0 54241208.0 55882008.0 57522808.0 59163608.0 60804408.0 62445208.0
69526008.0 71806808.0 74087608.0 76368408.0 78649208.0 80930008.0 83210808.0 85491608.0
88092408.0 91013208.0 93934008.0 96854808.0 99775608.0 102696408.0 105617208.0 108538008.0
106658808.0 110219608.0 113780408.0 117341208.0 120902008.0 124462800.0 128023600.0 131584400.0
125225200.0 129426000.0 133626800.0 137827600.0 142028400.0 146229200.0 150430000.0 154630800.0
143791600.0 148632400.0 153473200.0 158314000.0 163154800.0 167995600.0 172836400.0 177677200.0

Press ESC to Exit...

[ Microsoft C++ compiler / on 64-bit Windows / DEBUG ]
Output:

64-bit Windows platform - Configuration: DEBUG
Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
Not executed on a 64-bit Windows platform
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _PC_24 - long double - Result: 1.0000000000079181
Test-Case 3.3
Accuracy _PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _PC_64 - long double - Result: 1.0000000000079181
Test-Case 4

Matrix A
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

Matrix B
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

MFPT Used

Matrix C - Result
13826808.0 14187608.0 14548408.0 14909208.0 15270008.0 15630808.0 15991608.0 16352408.0
32393208.0 33394008.0 34394808.0 35395608.0 36396408.0 37397208.0 38398008.0 39398808.0
50959608.0 52600408.0 54241208.0 55882008.0 57522808.0 59163608.0 60804408.0 62445208.0
69526008.0 71806808.0 74087608.0 76368408.0 78649208.0 80930008.0 83210808.0 85491608.0
88092408.0 91013208.0 93934008.0 96854808.0 99775608.0 102696408.0 105617208.0 108538008.0
106658808.0 110219608.0 113780408.0 117341208.0 120902008.0 124462800.0 128023600.0 131584400.0
125225200.0 129426000.0 133626800.0 137827600.0 142028400.0 146229200.0 150430000.0 154630800.0
143791600.0 148632400.0 153473200.0 158314000.0 163154800.0 167995600.0 172836400.0 177677200.0

Press ESC to Exit...

[ Microsoft C++ compiler / on 64-bit Windows / RELEASE ]
Output:

64-bit Windows platform - Configuration: RELEASE
Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
Not executed on a 64-bit Windows platform
Test-Case 3.1
Accuracy _CW_DEFAULT - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _PC_24 - long double - Result: 1.0000000000079181
Test-Case 3.3
Accuracy _PC_53 - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _PC_64 - long double - Result: 1.0000000000079181
Test-Case 4

Matrix A
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

Matrix B
101.0 201.0 301.0 401.0 501.0 601.0 701.0 801.0
901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

MFPT Used

Matrix C - Result
13826808.0 14187608.0 14548408.0 14909208.0 15270008.0 15630808.0 15991608.0 16352408.0
32393208.0 33394008.0 34394808.0 35395608.0 36396408.0 37397208.0 38398008.0 39398808.0
50959608.0 52600408.0 54241208.0 55882008.0 57522808.0 59163608.0 60804408.0 62445208.0
69526008.0 71806808.0 74087608.0 76368408.0 78649208.0 80930008.0 83210808.0 85491608.0
88092408.0 91013208.0 93934008.0 96854808.0 99775608.0 102696408.0 105617208.0 108538008.0
106658808.0 110219608.0 113780408.0 117341208.0 120902008.0 124462800.0 128023600.0 131584400.0
125225200.0 129426000.0 133626800.0 137827600.0 142028400.0 146229200.0 150430000.0 154630800.0
143791600.0 148632400.0 153473200.0 158314000.0 163154800.0 167995600.0 172836400.0 177677200.0

Press ESC to Exit...

Petros, here a couple of final Notes:

- Please try to contact Intel Premium Support and discuss the situation with your current Intel C/C++ compiler

- These Intel C++ compiler options did not affect accuracy of my test results:

/Qfimf-accuracy-bits= 64 | 80 | 96 | etc
/Qimf-precision=high
/fp:extended

- You could also try to control floating-point precision in a command line of Intel C++ compiler ( take into account that this is not a portable solution ):

...
Use the -pc{32|64|80} option to enable floating-point significand precision control.
Some floating-point algorithms, created for specific IA-32 and Itanium-based systems,
are sensitive to the accuracy of the significand or fractional part of the
floating-point value. Use appropriate version of the option to round the significand
to the number of bits as follows:

-pc32: 24 bits (single precision)
-pc64: 53 bits (double precision)
-pc80: 64 bits (extended precision)

The default is -pc80 for extended floating-point precision
...

Best regards,
Sergey

Sergey,

These are very comprehensive tests and thank you very much for this.

I unzipped the files and openned the solution fputest.vs05 win vs2010 which transormed it into a 2010 solution - should presumably be innocuous.

On Building I got :

1>------ Rebuild All started: Project: FpuTestApp, Configuration: Debug Win32 ------
1>Build started 1/27/2013 8:15:26 PM.
1>_PrepareForClean:
1>  Deleting file "Debug\FpuTestApp.lastbuildstate".
1>InitializeBuildStatus:
1>  Creating "Debug\FpuTestApp.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>MessageBuildingWithCompiler:
1>  Building with Intel(R) C++ Compiler 12.1
1>ClCompile:
1>  ***** ClCompile (Win32 - Intel C++)
1>icl : warning #10148: option '/Qlong-double' not supported
1>icl : warning #10148: option '/Qpc80' not supported
1>  Stdafx.cpp
1>icl : warning #10148: option '/Qlong-double' not supported
1>icl : warning #10148: option '/Qpc80' not supported
1>  FpuTestApp.cpp
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\_petros\_otc\tests\FpuTestApp.Icc\Debug\FpuTestApp.exe) does not match the Linker's OutputFile property value (C:\_petros\_otc\tests\FpuTestApp.Icc\Debug\FpuTestApp32D.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(FpuTestApp) does not match the Linker's OutputFile property value (FpuTestApp32D). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>Link:
1>  xilink: executing 'link'
1>Manifest:
1>  Deleting file "Debug\FpuTestApp.exe.embed.manifest".
1>LinkEmbedManifest:
1>  xilink: executing 'link'
1>  FpuTestApp.VS05.vcxproj -> C:\_petros\_otc\tests\FpuTestApp.Icc\Debug\FpuTestApp.exe
1>FinalizeBuildStatus:
1>  Deleting file "Debug\FpuTestApp.unsuccessfulbuild".
1>  Touching "Debug\FpuTestApp.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:02.51

which is due to the naming of the file (in the debug version in vs2010 the output goes to different directories so there is no collision issue).

1>Build started 1/27/2013 8:19:49 PM.

1>_PrepareForClean:
1>  Deleting file "Debug\FpuTestApp.lastbuildstate".
1>InitializeBuildStatus:
1>  Creating "Debug\FpuTestApp.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>MessageBuildingWithCompiler:
1>  Building with Intel(R) C++ Compiler 12.1
1>ClCompile:
1>  ***** ClCompile (Win32 - Intel C++)
1>icl : warning #10148: option '/Qlong-double' not supported
1>icl : warning #10148: option '/Qpc80' not supported
1>  Stdafx.cpp
1>icl : warning #10148: option '/Qlong-double' not supported
1>icl : warning #10148: option '/Qpc80' not supported
1>  FpuTestApp.cpp
1>Link:
1>  xilink: executing 'link'
1>Manifest:
1>  Deleting file "Debug\FpuTestApp.exe.embed.manifest".
1>LinkEmbedManifest:
1>  xilink: executing 'link'
1>  FpuTestApp.VS05.vcxproj -> C:\_petros\_otc\tests\FpuTestApp.Icc\Debug\FpuTestApp.exe
1>FinalizeBuildStatus:
1>  Deleting file "Debug\FpuTestApp.unsuccessfulbuild".
1>  Touching "Debug\FpuTestApp.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:02.45
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

For x64 configuration though the result was :

64-bit Windows platform - Configuration: DEBUG
Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
Not executed on a 64-bit Windows platform
Test-Case 3.1
Press any key to continue . . .

After I changed this I got ( 32bit configuration on 64bit windows):

32-bit Windows platform - Configuration: RELEASE
Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
_CW_DEFAULT & ALLBITSON: 0x9001F
_PC_24 & _MCW_PC       : 0xA001F
_PC_53 & _MCW_PC       : 0x9001F
_PC_64 & _MCW_PC       : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT  - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _PC_24       - long double - Result: 1.0000000000079181
Test-Case 3.3
Accuracy _PC_53       - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _PC_64       - long double - Result: 1.0000000000079181
Test-Case 4

Matrix A
         101.0  201.0  301.0  401.0  501.0  601.0  701.0  801.0
         901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
        1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
        2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
        3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
        4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
        4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
        5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

Matrix B
         101.0  201.0  301.0  401.0  501.0  601.0  701.0  801.0
         901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
        1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
        2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
        3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
        4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
        4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
        5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

MFPT Used

Matrix C - Result
         13826808.0  14187608.0  14548408.0  14909208.0  15270008.0  15630808.0  15991608.0  16352408.0
         32393208.0  33394008.0  34394808.0  35395608.0  36396408.0  37397208.0  38398008.0  39398808.0
         50959608.0  52600408.0  54241208.0  55882008.0  57522808.0  59163608.0  60804408.0  62445208.0
         69526008.0  71806808.0  74087608.0  76368408.0  78649208.0  80930008.0  83210808.0  85491608.0
         88092408.0  91013208.0  93934008.0  96854808.0  99775608.0 102696408.0 105617208.0 108538008.0
        106658808.0 110219608.0 113780408.0 117341208.0 120902008.0 124462808.0 128023608.0 131584408.0
        125225208.0 129426008.0 133626808.0 137827616.0 142028416.0 146229216.0 150430016.0 154630816.0
        143791616.0 148632416.0 153473216.0 158314016.0 163154816.0 167995616.0 172836416.0 177677216.0

Press ESC to Exit...

Therefore different results !!!

and the DEBUG for win32 configuration :

32-bit Windows platform - Configuration: RELEASE
Test-Case 1
Size of [ long double ] is: 8
Test-Case 2
_CW_DEFAULT & ALLBITSON: 0x9001F
_PC_24 & _MCW_PC       : 0xA001F
_PC_53 & _MCW_PC       : 0x9001F
_PC_64 & _MCW_PC       : 0x8001F
Test-Case 3.1
Accuracy _CW_DEFAULT  - long double - Result: 1.0000000000079181
Sub-Test 3.2
Accuracy _PC_24       - long double - Result: 1.0000000000079181
Test-Case 3.3
Accuracy _PC_53       - long double - Result: 1.0000000000079181
Test-Case 3.4
Accuracy _PC_64       - long double - Result: 1.0000000000079181
Test-Case 4

Matrix A
         101.0  201.0  301.0  401.0  501.0  601.0  701.0  801.0
         901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
        1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
        2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
        3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
        4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
        4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
        5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

Matrix B
         101.0  201.0  301.0  401.0  501.0  601.0  701.0  801.0
         901.0 1001.0 1101.0 1201.0 1301.0 1401.0 1501.0 1601.0
        1701.0 1801.0 1901.0 2001.0 2101.0 2201.0 2301.0 2401.0
        2501.0 2601.0 2701.0 2801.0 2901.0 3001.0 3101.0 3201.0
        3301.0 3401.0 3501.0 3601.0 3701.0 3801.0 3901.0 4001.0
        4101.0 4201.0 4301.0 4401.0 4501.0 4601.0 4701.0 4801.0
        4901.0 5001.0 5101.0 5201.0 5301.0 5401.0 5501.0 5601.0
        5701.0 5801.0 5901.0 6001.0 6101.0 6201.0 6301.0 6401.0

MFPT Used

Matrix C - Result
         13826808.0  14187608.0  14548408.0  14909208.0  15270008.0  15630808.0  15991608.0  16352408.0
         32393208.0  33394008.0  34394808.0  35395608.0  36396408.0  37397208.0  38398008.0  39398808.0
         50959608.0  52600408.0  54241208.0  55882008.0  57522808.0  59163608.0  60804408.0  62445208.0
         69526008.0  71806808.0  74087608.0  76368408.0  78649208.0  80930008.0  83210808.0  85491608.0
         88092408.0  91013208.0  93934008.0  96854808.0  99775608.0 102696408.0 105617208.0 108538008.0
        106658808.0 110219608.0 113780408.0 117341208.0 120902008.0 124462808.0 128023608.0 131584408.0
        125225208.0 129426008.0 133626808.0 137827616.0 142028416.0 146229216.0 150430016.0 154630816.0
        143791616.0 148632416.0 153473216.0 158314016.0 163154816.0 167995616.0 172836416.0 177677216.0

Press ESC to Exit...

Finally with the flag fp:precision enabled I get the same resuling matrix the same size of long double (8), as before and very different and very different sub-test 3.2 result :
Sub-Test 3.2
Accuracy _PC_24       - long double - Result: 1.0090389251708984

All this is very confusing at this point. And it is a shame with all the effort you have put into this. One thing that I take from your notes is that probably /Qpc80 is the same as fp:extended flag ?

I do not have premium support so ..

Anyway, I am indebted for your help !

>>...One thing that I take from your notes is that probably /Qpc80 is the same as fp:extended flag ?

Yes, and here is a quote from Intel docs:
...
-pc32: 24 bits ( single precision )
-pc64: 53 bits ( double precision )
-pc80: 64 bits ( extended precision )
...

Petros, I think it also makes sence to try some latest evaluation version of Intel C++ compiler. You really need to get this:
...
Test-Case 3.4
Accuracy _PC_64 - long double - Result: 1.0000000000000109
...
and this is the best result.

Let's say you installed a newer evaluation version of Intel C++ compiler. If accuracy of your calculations is not improved, when FPU is really set to 64-bits precision and sizeof( long double ) is equal to 16, then something else is wrong in the software.

>>...Anyway, I am indebted for your help !

And a couple of more IDZ users...

Melanie, Tim and Iliya, Thank you for your time and help!

>> And a couple of more IDZ users...

goes w/out saying! Thank you all very much!

Pages

Connectez-vous pour laisser un commentaire.