# US 2019/0391610 A1 · Power series truncation using constant tables for function interpolation in transcendental functions

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

- Number: US 2019/0391610 A1
- Document ID: US20190391610A1
- Status: Published application
- Kind: A1
- Application number: 16/560,245
- Filed: 2019-09-04
- Published: 2019-12-26
- Earliest claimed: 2017-05-15
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: SWAPNIL SHAH; SRINIVASAN RAMANI
- Web page: https://patentgrep.com/patent/US20190391610A1

## CPC

- G06F 1/0314: {the table being stored on a peripheral device, e.g. papertape, drum}
- G06F 1/035: Reduction of table size {(G06F1/0314 takes precedence)}
- G06F 7/4833: {Logarithmic number system}
- G06F 7/544: for evaluating functions by calculation {(G06F7/4824 takes precedence)}
- H03K 19/17728: Reconfigurable logic blocks, e.g. lookup tables
- G06F 7/42: Adding; Subtracting {(G06F7/405 takes precedence)}
- G06F 7/48: using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H03K: PULSE TECHNIQUE (measuring pulse characteristics G01R; modulating sinusoidal oscillations with pulses H03C; transmission of digital information H04L; discriminator circuits detecting phase difference between two signals by counting or integrating cycles of oscillation H03D3/04; automatic control, starting, synchronisation or stabilisation of generators of electronic oscillations or pulses where the type of generator is irrelevant or unspecified H03L; coding, decoding or code conversion, in general H03M)

## Abstract

A primary interval for convergence of at least one power series in a transcendental function is interpolated, while selecting a number of one or more interpolation points for a truncated expansion of the at least one power series by a selected order of truncation. A function and at least one derivative of the function of the truncated expansion of the selected order of truncation is evaluated at the one or more interpolation points. Each separate value evaluated for the function and each of the at least one derivative is saved in a table, wherein the table is looked up for efficiently computing a result of the truncated expansion of the at least one power series.

## Claims

### Claim 1

A method, comprising:
interpolating, by a computer, a primary interval for convergence of at least one power series in a transcendental function while selecting a number of one or more interpolation points for a truncated expansion of the at least one power series by a selected order of truncation;
evaluating, by the computer, a function and at least one derivative of the function of the truncated expansion of the selected order of truncation at the one or more interpolation points;
comparing, by the computer, a first unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points;
responsive to the first unit of last precision value being less than an error bounds:
decreasing, by the computer, the number of the at one or more interpolations points; and
reevaluating, by the computer, the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points;
responsive to the first unit of last precision value not being less than the error bounds:
increasing, by the computer, the number of the at one or more interpolations points;
reevaluating, by the computer; the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points; and
comparing, by the computer, a second unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points for the reevaluated function;
responsive to the second unit of last precision being greater than the error bounds:
increasing, by the computer, the number of the at one or more interpolations points;
reevaluating, by the computer; the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points; and
comparing, by the computer, a second unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points for the reevaluated function;
responsive to the second unit of last precision not being greater than the error bound, determining, by the computer; whether a cache effect of a size of each separate value evaluated for the function and each of the least one derivative in the table;
responsive to the cache effect being acceptable, saving, by the computer, each separate value evaluated for the function and each of the at least one derivative in a table in a cache, wherein the table is looked up for efficiently computing a result of the truncated expansion of the at least one power series; and
responsive to the cache effect not being acceptable, increasing, by the computer, the selected order of truncation and estimating the number of one or more interpolation points to converge within the primary interval for the order of truncation at a specified number of fraction bits of precision.

### Claim 2 (depends on 1)

The method according to claim 1, wherein interpolating, by a computer, a primary interval for convergence of at least one power series in a transcendental function while selecting a number of one or more interpolation points for a truncated expansion of the at least one power series by a selected order of truncation further comprises:
setting, by the computer, the order of truncation to an initial value;
estimating, by the computer, the number of one or more interpolation points; and
changing, by the computer, a source of the transcendental function from the at least one power series to the truncated expansion of the at least one power series, wherein the truncated expansion comprises the order of truncation set to the initial value.

### Claim 3 (depends on 2)

The method according to claim 2, wherein estimating, by the computer, the number of one or more interpolation points further comprises:
estimating, by the computer, the number of one or more interpolation points to converge within the primary interval for the order of truncation at a specified number of fraction bits of precision.

### Claim 4 (depends on 1)

The method according to claim 1, further comprising:
responsive to saving the table, computing, by the computer, an index into the table for a particular interpolation point of the one or more interpolation points in a truncated expansion by rotating, shifting, and masking operations to a scaled convergent boundary value;
looking up, by the computer, at least two values at the index into the table;
computing, by the computer, a result of the sum of the looked up at least two values; and
returning, by the computer, the result for the particular interpolation point as the result of the transcendental function.

### Claim 5 (depends on 1)

The method according to claim 1, further comprising:
scaling, by the computer, the primary interval for convergence to select a number of derivatives in the truncated order required to evaluate an error of the at least one power series within a selected value of a unit of last precision.

### Claim 6 (depends on 1)

The method according to claim 1, further comprising:
selecting, by the computer, the number of one or more interpolation points and the order of truncation to minimize a total number of the at least one derivative of the function while increasing the number of one or more interpolation points to a value that is acceptable for a size of the table to fit within cache.

### Claim 7

A computer system, comprising:
one or more processors coupled to one or more memories;
the processor operative to interpolate a primary interval for convergence of at least one power series in a transcendental function while selecting a number of one or more interpolation points for a truncated expansion of the at least one power series by a selected order of truncation;
the processor operative to evaluate a function and at least one derivative of the function of the truncated expansion of the selected order of truncation at the one or more interpolation points;
the processor operative to compare a first unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points;
the processor operative to, responsive to the first unit of last precision value being less than an error bounds:
decrease the number of the at one or more interpolations points; and
reevaluate the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points;
the processor operative to, responsive to the first unit of last precision value not being less than the error bounds:
increase the number of the at one or more interpolations points;
reevaluate the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points; and
compare a second unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points for the reevaluated function;
the processor operative to, responsive to the second unit of last precision being greater than the error bounds:
increase the number of the at one or more interpolations points;
reevaluate the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points; and
compare a second unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points for the reevaluated function;
the processor operative to, responsive to the second unit of last precision not being greater than the error bound, determine whether a cache effect of a size of each separate value evaluated for the function and each of the least one derivative in the table;
the processor operative to, responsive to the cache effect being acceptable, save each separate value evaluated for the function and each of the at least one derivative in a table in a cache, wherein the table is looked up for efficiently computing a result of the truncated expansion of the at least one power series; and
the processor operative to, responsive to the cache effect not being acceptable, increase the selected order of truncation and estimating the number of one or more interpolation points to converge within the primary interval for the order of truncation at a specified number of fraction bits of precision.

### Claim 8 (depends on 7)

The computer system according to claim 7, wherein the processor operative to interpolate a primary interval for convergence of at least one power series in a transcendental function while selecting a number of one or more interpolation points for a truncated expansion of the at least one power series by a selected order of truncation further comprises:
the processor operative to set the order of truncation to an initial value;
the processor operative to estimate the number of one or more interpolation points; and
the processor operative to change a source of the transcendental function from the at least one power series to the truncated expansion of the at least one power series, wherein the truncated expansion comprises the order of truncation set to the initial value.

### Claim 9 (depends on 8)

The computer system according to claim 8, wherein the processor operative to set estimate the number of one or more interpolation points further comprises:
the processor operative to estimate the number of one or more interpolation points to converge within the primary interval for the order of truncation at a specified number of fraction bits of precision.

### Claim 10 (depends on 7)

The computer system according to claim 7, further comprising:
the processor operative, responsive to saving the table, to compute an index into the table for a particular interpolation point of the one or more interpolation points in a truncated expansion by rotating, shifting, and masking operations to a scaled convergent boundary value;
the processor operative to look up at least two values at the index into the table;
the processor operative to compute a result of the sum of the looked up at least two values; and
the processor operative to return the result for the particular interpolation point as the result of the transcendental function.

### Claim 11 (depends on 7)

The computer system according to claim 7, further comprising:
the processor operative to scale the primary interval for convergence to select a number of derivatives in the truncated order required to evaluate an error of the at least one power series within a selected value of a unit of last precision.

### Claim 12 (depends on 7)

The computer system according to claim 7, further comprising:
the processor operative to select the number of one or more interpolation points and the order of truncation to minimize a total number of the at least one derivative of the function while increasing the number of one or more interpolation points to a value that is acceptable for a size of the table to fit within cache.

### Claim 13

A computer program product comprising one or more computer-readable storage devices and program instructions, stored on at least one of the one or more storage devices, the stored program instructions comprising:
program instructions to interpolate a primary interval for convergence of at least one power series in a transcendental function while selecting a number of one or more interpolation points for a truncated expansion of the at least one power series by a selected order of truncation;
program instructions to evaluate a function and at least one derivative of the function of the truncated expansion of the selected order of truncation at the one or more interpolation points;
program instructions to compare a first unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points;
program instructions to, responsive to the first unit of last precision value being less than an error bounds:
decrease the number of the at one or more interpolations points; and
reevaluate the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points;
program instructions to, responsive to the first unit of last precision value not being less than the error bounds:
increase the number of the at one or more interpolations points;
reevaluate the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points; and
compare a second unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points for the reevaluated function;
program instructions to, responsive to the second unit of last precision being greater than the error bounds:
increase the number of the at one or more interpolations points;
reevaluate the function and the at least one derivative of the function of the truncated expansion of the selected order of truncation at the adjusted number of each of the one or more interpolation points; and
compare a second unit of last precision value of each separate value evaluated for the function and the at least one derivative at each of the one or more interpolation points for the reevaluated function;
program instructions to, responsive to the second unit of last precision not being greater than the error bound; determine whether a cache effect of a size of each separate value evaluated for the function and each of the least one derivative in the table;
program instructions to, responsive to the cache effect being acceptable, save each separate value evaluated for the function and each of the at least one derivative in a table in a cache, wherein the table is looked up for efficiently computing a result of the truncated expansion of the at least one power series; and
program instructions to, responsive to the cache effect not being acceptable, increase the selected order of truncation and estimating the number of one or more interpolation points to converge within the primary interval for the order of truncation at a specified number of fraction bits of precision.

### Claim 14 (depends on 13)

The computer program product according to claim 13, the stored program instructions further comprising:
program instructions to set the order of truncation to an initial value;
program instructions to estimate the number of one or more interpolation points; and
program instructions to change a source of the transcendental function from the at least one power series to the truncated expansion of the at least one power series, wherein the truncated expansion comprises the order of truncation set to the initial value.

### Claim 15 (depends on 14)

The computer program product according to claim 14, the stored program instructions further comprising:
program instructions to estimate the number of one or more interpolation points to converge within the primary interval for the order of truncation at a specified number of fraction bits of precision.

### Claim 16 (depends on 14)

The computer program product according to claim 14, the stored program instructions further comprising:
program instructions, responsive to saving the table, to compute an index into the table for a particular interpolation point of the one or more interpolation points in a truncated expansion by rotating, shifting, and masking operations to a scaled convergent boundary value;
program instructions to look up at least two values at the index into the table;
program instructions to compute a result of the sum of the looked up at least two values; and
program instructions to return e result for the particular interpolation point as the result of the transcendental function.

### Claim 17 (depends on 14)

The computer program product according to claim 14, the stored program instructions further comprising:
program instructions to scale the primary interval for convergence to select a number of derivatives in the truncated order required to evaluate an error of the at least one power series within a selected value of a unit of last precision.

### Claim 18 (depends on 14)

The computer program product according to claim 14, the stored program instructions further comprising:
program instructions to select the number of one or more interpolation points and the order of truncation to minimize a total number of the at least one derivative of the function while increasing the number of one or more interpolation points to a value that is acceptable for a size of the table to fit within cache.
