Thursday, August 20, 2009

Donate Blood Or Plasma In Orange County Ca

From how to prevent floating-point error and a passed issue SAP, Intel and Microsoft

Months ago I reported a dump happened to a client while working with the SAP transaction designed to manage econometric models.

The problem occurred when calculating an antilog for a very small number of exponent, for example: 10 ^ -900 which usually any mortal would understand it as a positive value close to zero, but Well, not SAP.

The error analysis for this dump, SAP told us that:

There May Be an overflow or an underflow.
With the floating point format defined According To IEEE 754 and Widely Used on workstations, the Following Must Apply for "x ** y": -709 < y * ln x < 710


To which we proceeded to implement the formula as had been delivered without further analysis or review.

time later it happened again the same error when trying to calculate 10 ^ 307 655 to which we apply the rule to have the following SAP
y * ln x = ln 10 = -307.55 * -709 -708.4018168
< y * ln x < 710 = VERDADERO
to satisfy the rule and decided SAP consulting on what was happening and why it was such a mistake if it was meeting the established rule.

Part of the message and some additional errors can be checked here .

The issue was initially addressed by SAP who recommended that we apply a rounding before the calculation, that under a misconception that the number is stored internally in a format such as 3.07549999999999999E +02, which was implemented but to no avail.

After a while I learned that Microsoft saw the track (imagine a link to the operating system) who told me that this was a problem working with a subnormal number result type ( denormal number) which worked on the Itanium processor , according to Intel, was performed 100 times slower than a standard floating-point number and that there was the option to automatically return the zero Itanium which is faster even when you lose accuracy.

I indicated that they would submit the case to Microsoft and that to date no compiler Microsoft had the ability to make the automatic conversion on Itanium processors.

Even when the problem to date has stalled as they continue looking for someone who knows about Itanium, decided to focus on the initial problem had since even with all that told me he thought that a good validation error could prevent (and the current SAP not allowed). Fortunately

Jason Kafka saw fit to revise the rule that SAP provides, and then nurture a certain standard theory involves for IEEE 754 floating point arithmetic. And that sets limits for each case depending on the number of bits, in this case works with 64-bit Itanium.

exponent In this case the highest and lowest representation available are 1023 and -1022 respectively (if the base is 2).

Then I decided to show off my knowledge of mathematics and ancient raised as follows:

2 ^ -1022 <= x^y <= 2^1023

applying natural logarithm / Naperian to each member of the expression ...
-1022 * ln (2) <= y * ln(x) <= 1023 * ln(2)

which is approximately:
-708.3964185 <= y * ln(x) <= 709.0895657

words, the rule was that SAP was approximate and was the cause of all evils in this case all you had to do was to place the appropriate levels and prevent the dump.

currently
SAP, Microsoft and Intel are working on this issue, for me I already have it (if not solved) at least controlled.
However

my carelessness was not checking the maximum dimensions or not immediately relate why the central component of inequality "and * ln (x)", because apparently the same reasoning above as SAP came to the conclusion of the rule (approximate) inequality that while failure in extreme cases, includes a wide range of cases, as stated by German consultant Microsoft Development Platform.

0 comments:

Post a Comment