Patent ID: 7448026

Claim:
A method of accuracy-aware analysis of a program, comprising: obtaining source code for the program comprising a floating-point variable; instrumenting the source code to associate an accuracy-aware tracking structure with the floating-point variable to obtain instrumented source code with functionality to call a runtime logging utility; compiling the instrumented source code to obtain instrumented compiled code; executing the instrumented compiled code, wherein executing the instrumented compiled code comprises executing one of a plurality of operations on the floating-point variable to obtain a resultant value for the floating-point variable; and executing the runtime logging utility to populate the accuracy-aware tracking structure, wherein for each operation performed on the floating-point variable, the runtime logging utility is configured to: increment an operations variable in the accuracy-aware tracking structure corresponding to the operation performed on the floating-point variable, determine a scaled mantissa for the resultant value, wherein the scaled mantissa representation for a floating-point variable corresponds to the integer represented by the first non-zero digit in the mantissa to the last non-zero-digit in the mantissa, compare the scaled mantissa with the resultant value to determine whether the resultant value is exact, quantify an error associated with the resultant value when the resultant value is not exact to obtain the error value associated with the resultant value, wherein the error value is a half unit in last place (HULP) value associated with the floating-point variable, wherein the HULP value is a base of a floating-point representation raised to a power of the number of bits causing the error in the floating-point variable, store the resultant value, the scaled mantissa, and the error value when the resultant value is not exact, and store the resultant value and the scaled mantissa when the resultant value is exact.