Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

libmmt.lib gives different results

allyn_shell
Beginner
465 Views
When libmmt.lib is linked to an executable, the sin(x) and cos(x) functions give different results for large x compared toresult when libmmt.lib is not linked.
0 Kudos
7 Replies
mattsdad
Beginner
465 Views
That is a problem I have. What are the other libraries with the same content?
0 Kudos
Steven_L_Intel1
Employee
465 Views
Example, please.
0 Kudos
mattsdad
Beginner
465 Views
I have tens of thousands of lines of code in Fortran with C++ code in some of the projects. I have been requested to make one of the largest projects link both one of its older versions and its newest version (due to a government contractual issue of one of our customers). This involves linking the API of three projects with more than 10,000 lines of code each. I cannot separate the source that is causing this issue, but I can identify that when project B is linked alone it needs libmmt.lib to link. When it is linked with A and C it does not need libmmt.lib to link because of something in one of the other projects. When project A is linked with B and C without libmmt.lib all the regression tests for A give identical results. If libmmt.lib is added a fairly large portion of the regression tests for A fail. When I trace through the code in the debugger, I found the sine and cosine functions were producing different results with the same arguments in the two versions. This is not a show stopper, but it is something that we need to explain to our customers so that they in turn can explain to the government why their results are changing.
0 Kudos
Steven_L_Intel1
Employee
465 Views
libmmt is the math library. If that is not being used, where are the math intrinsics being referenced from? You may be using two different math libraries.
0 Kudos
mecej4
Honored Contributor III
465 Views
Just as Euclid said that there he could not provide a special easy route for Pharoah, there is no special way of computing sin(x) for large x for the benefit of a government. What is lim_{x->\infty} sin(x) ?

Are your expectations reasonable here? How large is "large". How different were the results in the two versions, which you were able to observe in the debugger?

You did not state which version of the compiler/library you were using, nor did you give a specific example.

If you are using double precision, there are 2^64 possible values of x. Let us say that 2^11 of those are "large", and let us admit that there are about 2^5 math-libraries that came with various versions of Intel Fortran. That leaves us 2^16 = 65,536 tests to run.

Sorry, Dr. Fortran's other patients are waiting, too.
0 Kudos
mattsdad
Beginner
465 Views
The C++ part of the projects also have math libraries. Could it be using a sin and cos from a C++ library in place of libmmt.lib. Don't the Fortran objects have names that are unique enough to link with the mangeled names in the C++ libraries?
0 Kudos
Steven_L_Intel1
Employee
465 Views
No, a single math library is used. If you enable the Linker > General > Show Progress Messages > Show All Progress Messages, you can see which libraries resolve which symbols.
0 Kudos
Reply