[Contents] [TitleIndex] [WordIndex

Bi-weekly Report - 15th July 2011 (Mid-Term)

Work done in the past two weeks

Revisiting fdlibm's integration on Linux and fixing its wrong results

It was mainly debugging in the past two weeks. I started off by looking at the issue pointed by Michael about the wrong value of log() on windows. This made me realize that elementary_functions module wasn't using fdlibm on Linux. I fixed this by adding libfdlibm.la in the libscielementary_functions_LIBADD macro in the module's Makefile.am. Once done, I got the same error pointed out by Michael on Linux too.

In order to debug this problem, I tried calculating the same result on fdlibm separately, but it resulted in the same wrong answer. Assuming that the log()'s algorithm couldn't be wrong, I checked the fdlibm.h file and as it turned out there was no check for a x86_64 system and the code was considering my system as BIG_ENDIAN.

Making this change resulted in the right answer. But compiling scilab with the same modification resulted in a different answer. I assumed it was some trouble with scilab and wasted a whole day on debugging it. With no results, I went back to debugging the implementation in e_log.c and found that the code at line 111 was giving separate results on scilab and my separate testing code.

This made the problem pretty clear. Compilation options on scilab were causing all the trouble. It was the 2nd level optimization(-O2). It activates around 30 flags. Picking each one of them out one by one brought the light on fstrict-aliasing. _HI(x) was using double to int aliasing and this option won't allow it, hence all the trouble. I fixed it by adding the "fno-strict-aliasing" compilation option in fdlibm's Makefile.

I have pushed the final changes and fdlibm is well integrated and working good on scilab now.

Testing phase

The above results in the end of package investigation and compilation phase. I am still waiting for my mentors' comments on the pushed changes and guidelines for the testing phase, so I started getting acquainted with scilab's testing. I learned about the bench_run and test_run functions. While looking for a proper testing of math library, I checked the methods used in crlibm. Michael mentioned them to me earlier.

To Do

I am waiting for the mentors' comments but I'm pretty sure we'll be starting with fdlibm's testing from next week. As per Michael's previous email, there are going to be three kind of tests.

I believe the next two weeks will witness these three.


2022-09-08 09:26