# US 2008/0307030 A1 · Generation of test cases with range constraints for floating point add and subtract instructions

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0307030 A1
- Document ID: US20080307030A1
- Status: Published application
- Kind: A1
- Application number: 12/193,396
- Filed: 2008-08-18
- Published: 2008-12-11
- Earliest claimed: 2004-03-31
- Assignees: International Business Machines Corporation
- Inventors: Abraham Ziv
- Web page: https://patentgrep.com/patent/US20080307030A1

## CPC

- G06F 30/33: Design verification, e.g. functional simulation or model checking
- G06F 7/483: Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers {(G06F7/4806, G06F7/4824, G06F7/49, G06F7/491, G06F7/544 take precedence)}
- G06F 7/49957: {Implementation of IEEE-754 Standard}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, apparatus and systems are disclosed for the generation of range-constrained test cases for verification of designs of arithmetic floating point units. Given three ranges of floating point numbers Rx, Ry, Rz, a floating point operation (op), and a rounding-mode (round), three floating point numbers x, y, z are generated such that xεRx, yεRy, zεRz, and z=round ( x op y). Solutions are provided for add and subtract operations. Range constraints are imposed on the input operands and on the result operand of floating point add and subtract instructions to target corner cases when generating test cases for use in verification of floating point hardware.

## Claims

### Claim 1

A method for verifying a design of a floating point computation unit, comprising the steps of:
receiving a definition of a floating point operation to test, said definition comprising a first floating point operand having a first floating point input interval and a second floating point operand having a second floating point input interval, and a floating point result having a floating point output interval, said first and second floating point input intervals and said floating point output interval having respective upper and lower floating point limits;
defining a first reduced interval for said first floating point operand responsively to said upper and lower floating point limits of said second floating point input interval and said floating point output interval;
selecting a first machine number in said first floating point input interval;
defining a second reduced interval for said second floating point operand responsively to said first machine number and to said upper and lower limits of said floating point output interval;
selecting a second machine number in said second reduced interval; and
testing said floating point operation in said design using said first machine number and said second machine number as said first floating point operand and said second floating point operand.

### Claim 2 (depends on 1)

The method according to claim 1, wherein at least one of said first machine number and said second machine number is chosen randomly.

### Claim 3 (depends on 1)

The method according to claim 1, wherein said steps of defining said first reduced interval and defining said second reduced interval are performed by defining new boundaries for said first floating point input interval and said second floating point input interval that are referenced to a set of real numbers.

### Claim 4 (depends on 3)

The method according to claim 3, wherein said set of real numbers is a set
Ax,y={(x,y)|āx≦x≦ bx,āy≦y≦ by,x+yεI′z},
wherein
x and y are real numbers in said set of real numbers,
āx is a smallest machine number in said first floating point input interval,
āy is a smallest machine number in said second floating point input interval,
bx is a largest machine number in said first floating point input interval,
by is a largest machine number in said second floating point input interval, and
I′z={z|āz≦round(z)≦ bz}.

### Claim 5 (depends on 1)

The method according to claim 1, wherein said steps of defining said first reduced interval and defining said second reduced interval are performed by defining new boundaries for said first floating point input interval and said second floating point input interval such that for all real numbers (x, y) in a set of real numbers
Ax,y={(x,y)|āx≦x≦ bx,āy≦y≦ by,x+yεI′z} wherein
said first reduced interval and said second reduced interval have boundaries such that
Ax=max{āx,a′z− by}≦x≦min{ bx,b′z−āy}=Bx.
and
Ay=max{āy,a′z−bx}≦y≦min{by,b′z−āx}=By,
wherein
x and y are real numbers in said set of real numbers,
Ax is a lower boundary of said first reduced interval,
Bx is an upper boundary of said first reduced interval,
Ay is a lower boundary of said second reduced interval,
By is an upper boundary of said second reduced interval,
āx is a smallest machine number in said first floating point input interval,
āy is a smallest machine number in said second floating point input interval,
bx is a largest machine number in said first floating point input interval,
by is a largest machine number in said second floating point input interval,
I′z={z|āz≦round(z)≦ bz},
a′z is a lower boundary of I′z, and
b′z is an upper boundary of I′z.

### Claim 6 (depends on 1)

The method according to claim 1, wherein said floating point operation is one of addition and subtraction.

### Claim at position 7

7-10. (canceled)

### Claim 11

A method for verifying a design of a floating point computation unit, comprising:
receiving a definition of a floating point operation to test, said definition comprising a first floating point operand having a first floating point input interval and a second floating point operand, having a second floating point input interval, and a floating point result having a floating point output interval, said input and output intervals having respective upper and lower floating point limits, whereby said first floating point input interval and said second floating point input interval define a region in an operand plane having a first axis and a second axis corresponding respectively to said first floating point operand and said second floating point operand;
dividing said region into subrectangles, each of said subrectangles having respective bounds, such that within at least a first subrectangle, a first step size between machine numbers in any first succession along said second axis is constant, and a second step size between said machine numbers in any second succession along said first axis is no less than said first step size;
defining a reduced interval for said first floating point operand responsively to said upper and lower floating point limits of said second floating point input interval and said floating point output interval;
selecting a first machine number in said reduced interval;
defining an integer range responsively to said respective bounds of said first subrectangle, to said first machine number, and to said first step size;
selecting an integer within said integer range;
determining a second machine number responsively to said integer and to said first step size; and
testing said floating point operation in said design using said first machine number and said second machine number as said first floating point operand and said second floating point operand.

### Claim 12 (depends on 11)

The method according to claim 11, wherein at least one of said first machine number, said integer, and said second machine number is chosen randomly.

### Claim 13 (depends on 11)

The method according to claim 11, further comprising the steps of: verifying an existence of a second integer in said first subrectangle that satisfies a relation
(a′z−āx−āy)/Δy≦k≦(b′z−āx−āy)/Δy, wherein
k is said second integer;
āx is a smallest machine number of said first floating point input interval,
āy is a smallest machine number of said second floating point input interval,
I′z is an interval defined by a set {z|āz≦round(z)≦ bz},
a′z is a lower boundary of said interval I′z, and
b′z is an upper boundary of said interval I′z
Δy is said second step size.

### Claim 14 (depends on 11)

The method according to claim 11, wherein said region further comprises a second subrectangle, a third step size between said machine numbers in any third succession along said first axis being constant, and a fourth step size between said machine numbers in any fourth succession along said second axis being no less than said third step size.

### Claim 15 (depends on 11)

The method according to claim 11, wherein said floating point operation is one of addition and subtraction.

### Claim at position 13

16-19. (canceled)

### Claim 20

A method for generating a test case in a design verification system, said test case having a first input operand, a second input operand and a floating point arithmetic operation performed thereon to yield an output result, comprising the steps of:
defining a first range that contains a set of first machine numbers;
defining a second range that contains a set of second machine numbers;
defining a third range having a lower bound that is a result of a round operation on a minimum value of said output result, and having an upper bound that is a result of said round operation on a maximum value of said output result, wherein instances of said first input operand and said second input operand are in said first range and said second range, respectively;
defining a subrectangle having a first axis comprising said first range and a second axis comprising said second range;
subdividing said subrectangle into subregions, each of said subregions having a first property, wherein a first step size along said first axis between successive ones of said first machine numbers is constant, and a second property, wherein a second step size along said second axis between successive ones of said second machine numbers is at least as large as said first step size;
identifying one of said subregions wherein an integer k exists that satisfies a first inequality (a′z−āx−āy)/Δy≦k≦(b′z−āx−āy)/Δy, and wherein a machine number x exists that satisfies second and third inequalities āx≦ x≦ bx, a′z− by≦ x≦b′z−āy;
choosing an integer n with respect to said one subregion such that (a′z− x−āy)/Δy≦n≦(b′z− x−āy)/Δy; and
executing said arithmetic operation in said design verification system using said machine number x as said first input operand and a quantity (āy+n Δy) as said second input operand;
wherein
āx is a smallest one of said first machine numbers,
āy is a smallest one of said second machine numbers,
bx is a largest one of said first machine numbers,
by is a largest one of said second machine numbers,
a′z is said lower bound of said third range,
b′z is said upper bound of said third range, and
Δy is said second step size.

### Claim 21 (depends on 20)

The method according to claim 20, wherein said subregions are subrectangles.

### Claim 22 (depends on 20)

The method according to claim 20, wherein said arithmetic operation is one of addition and substraction.

### Claim at position 17

23-26. (canceled)
