IP Library Granted Patent US 7,448,026
Granted Patent B1
US 7,448,026 · App. 10/784,753 · Granted Nov 4, 2008

Method and apparatus for accuracy-aware analysis

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,448,026
App. No.
10/784,753
Granted
Nov 4, 2008
Kind
B1
Abstract

A method for accuracy-aware analysis of a program involving 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, compiling to instrumented source code to obtain instrumented compiled code, and executing the instrumented compiled code, wherein executing the instrumented compiled code comprises using the accuracy-aware tracking structure to track an operation on the floating-point variable.

Claims (55)

1. 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.

2. The method of claim 1 , further comprising:

generating an accuracy-aware analysis report using the accuracy-aware tracking structure.

3. The method of claim 2 , wherein the accuracy-aware analysis report includes at least one selected from the group consisting of the error value, the scaled mantissa, and the resultant value.

4. The method of claim 1 , wherein the HULP value is determined using information obtained during renormalization.

5. The method of claim 3 , wherein the error value comprises an upper limit interval value or a lower limit interval value.

6. The method of claim 1 , wherein the operations variable comprises at least one selected from the group consisting of a multiplication variable, a division variable, and a square root variable.

7. The method of claim 1 , wherein the accuracy-aware tracking structure further comprises a renormalization variable which track the number of addition and subtraction operations performed on the floating-point variable that do not involve left digit destruction.

8. The method of claim 1 , further comprising:

updating the error value using data obtained from quantifying the error associated with the resultant value, if the resultant value is not exact.

9. The method of claim 1 , further comprising:

determining whether the resultant value exceeds an accuracy threshold if the resultant value is not exact.

10. The method of claim 9 , wherein execution of the compiled instrumented code halts if the accuracy threshold hold is exceeded.

11. The method of claim 9 , wherein the accuracy threshold comprises at least one selected from the group consisting of a relative error threshold, an absolute error threshold, and a comparison test.

12. The method of claim 1 , further comprising:

setting an accuracy threshold for the program.

13. The method of claim 1 , wherein instrumenting the source code comprises:

parsing the source code to obtain the floating-point variable; and

inserting additional source code to call the runtime logging utility.

14. The method of claim 1 , wherein the floating-point variable is double type.

15. A computer system for performing accuracy-aware analysis of a program, comprising:

a processor;

a memory;

a storage device; and

software instructions stored in the memory for enabling the computer system under control of the processor, to:

obtain source code for the program comprising a floating-point variable;

instrument 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;

compile the instrumented source code to obtain instrumented compiled code;

execute 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

execute 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.

16. The computer system of claim 15 , further comprising software instructions to:

generate an accuracy-aware analysis report using the accuracy-aware tracking structure.

17. The computer system of claim 16 , wherein the accuracy-aware analysis report includes at least one selected from the group consisting of the error value, the scaled mantissa, and the resultant value.

18. The computer system of claim 15 , wherein the HULP value is determined using information obtained during renormalization.

19. The computer system of claim 15 , wherein the operations variable comprises at least one selected from the group consisting of a multiplication variable, a division variable, and a square root variable.

20. The computer system of claim 15 , wherein software instructions for instrumenting the source code comprises software instructions to:

parse the source code to obtain the floating-point variable; and

insert additional source code to call the runtime logging utility.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037303/0926 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 23, 2004
From: GUSTAFSON, JOHN L.; GUSTAFSON, PHYLLIS E.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 015020/0880 →