# US 7,080,112 B2 · Method and apparatus for computing an approximation to the reciprocal of a floating point number in IEEE format

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

- Number: US 7,080,112 B2
- Document ID: US7080112B2
- Status: Granted
- Kind: B2
- Application number: 10/292,768
- Filed: 2002-11-13
- Published: 2004-05-13
- Granted: 2006-07-18
- Earliest claimed: 2002-11-13
- Assignees: International Business Machines Corporation
- Inventors: James Bergheim Shearer
- Web page: https://patentgrep.com/patent/US7080112B2

## CPC

- G06F 7/4873: {Dividing}
- G06F 2207/5354: Using table lookup, e.g. for digit selection in division by digit recurrence
- G06F 2207/5356: Via reciprocal, i.e. calculate reciprocal only, or calculate reciprocal first and then the quotient from the reciprocal and the numerator
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and apparatus allows the quick computation of an estimate of the reciprocal of a floating point number in IEEE format. A table with 2k entries allows the computation of an estimate with 2×k+3 good bits. x is a floating point number in IEEE format for which a reciprocal approximation is to be computed. {circumflex over (x)} be a floating point number in IEEE format derived from x by leaving the sign bit unchanged, complementing the exponent bits, leaving the first k fraction bits unchanged, and complementing the remaining fraction bits. t is another floating point number in IEEE format found by using the first k bits of the fraction of x as an index into a table with 2k entries. The product {circumflex over (x)}×t computed with IEEE floating point arithmetic is an estimate of the reciprocal of x with 2×k+3 good bits (i.e., relative error less than 2−2×k+3).

## Claims

### Claim 1

A computer-implemented method of computing a computing machine representation of an approximation to the reciprocal of a floating point number x comprising the steps of:
generating a computing machine representation of a floating point number {circumflex over (x)} by leaving a sign bit of x, which is loaded into a first fixed point register, unchanged, complementing exponent bits of x, leaving a first k fraction bits of x unchanged, and complementing remaining fraction bits of x;
generating another computing machine representation of a floating point number t found by using the first k bits of the fraction of x, which is loaded into said first fixed point register, as an index into a table with 2k entries; and
computing the product {circumflex over (x)}×t computed with floating point arithmetic as an estimate of the reciprocal of x with 2×k+3 good bits which is loaded into a floating point register; and
outputting said estimate of the reciprocal of x to be used by a high speed digital computer.

### Claim 2 (depends on 1)

The computer-implemented method of computing a computing machine representation of an approximation to the reciprocal of a floating point number x as recited in claim 1, wherein the floating point number x is in IEEE format, the floating point number {circumflex over (x)} is in IEEE format, the floating point number t is in IEEE format, and the product {circumflex over (x)}×t is in IEEE format.

### Claim 3 (depends on 1)

The computer-implemented method of computing a computing machine representation of an approximation to the reciprocal of a floating point number x as recited in claim 1, wherein {circumflex over (x)} is computed from x with a single bitwise exclusive OR operation with a mask m which is loaded into a second fixed point register.

### Claim 4 (depends on 3)

The computer-implemented method of computing a computing machine representation of an approximation to the reciprocal of a floating point number x as recited in claim 3, wherein the mask m consists of one zero bit corresponding to the sign bit of x, e one bits corresponding to the exponent bits of x, k zero bits corresponding to the first k fraction bits of x and f−k one bits corresponding to the remaining f−k fraction bits of x.

### Claim 5 (depends on 1)

The computer-implemented method of computing a computing machine representation of an approximation to the reciprocal of a floating point number x as recited in claim 1, wherein said table is a lookup table containing 2kentries in the same format as x, the ith entry, T(i), in the lookup table is,
4
(
8
⁢
z
2
-
(
δ
-
ɛ
)
2
-
ɛ
2
)
,
where i is the index used to address the lookup table, δ=2−k, ε=2−f and z=1+i×δ+0.5(δ−ε).

### Claim 6

An apparatus for computing an approximation to the reciprocal of a floating point number x comprising:
a first register storing the number x comprising a 1-bit sign, an e-bit exponent, and an f-bit fraction;
a second register storing a mask m mask comprised of one zero bit corresponding to the sign bit of x, e one bits corresponding to the exponent bits of x, k zero bits corresponding to the first k fraction bits of x and f−k one bits corresponding to the remaining f−k fraction bits of x;
a bitwise exclusive OR function combining the number x from the first register and the mask m from the second register to produce a bitwise exclusive OR output {circumflex over (x)}=xΛm;
an index extractor extracting the first k bits of the fraction of x as an index I;
a lookup table with 2k entries responding to the index i and outputting an entry T(i) as the ith entry of the table; and
a multiplier computing the product {circumflex over (x)}×T(i) with floating point arithmetic an output r=T(i)×{circumflex over (x)} as an estimate of the reciprocal of x with 2×k+3 good bits.

### Claim 7 (depends on 6)

The apparatus for computing an approximation to the reciprocal of a floating point number x as recited in claim 6, wherein the floating point number x is in IEEE format, the floating point number {circumflex over (x)} is in IEEE format, the floating point number T(i) is in IEEE format, and the product {circumflex over (x)}.times.T(i) is in IEEE format.

### Claim 8 (depends on 6)

The apparatus for computing an approximation to the reciprocal of a floating point number x recited in claim 6, wherein the lookup table contains 2k entries in the same format as x, the ith entry, T(i), in the lookup table is
4
(
8
⁢
z
2
-
(
δ
-
ɛ
)
2
-
ɛ
2
)
,
where i is the index used to address the lookup table, δ=2−k, ε=2−f and z=1i×δ+0.5(δ−ε).
