Dynamic algorithm selection
AssigneeInternational Business Machines Corporation
InventorsKerstin Claudia Schelm, Cedric Lichtenau, Michael Klein, Stefan Payer, Petra Leber
Life of this patent
Estimating the term…
Abstract
Dynamic selection of a multiplication algorithm by receiving operands A and B, determining a difference between A and B, selecting a first multiplication algorithm if the difference falls below a threshold, selecting a second multiplication algorithm if the difference equals or exceeds the threshold, pre-scaling the operands, calculating a quotient for the scaled operands, back multiplying the quotient using the selected algorithm, yielding a product, subtracting the product from operand A, yielding a remainder, and providing the remainder as an output.
Claims18
A computer implemented method for dynamic selection of a multiplication algorithm comprising:
- receiving, by one or more computer processors, operands A and B;
- determining, by the one or more computer processors, a difference between A and B;
- selecting, by the one or more computer processors, a digit wise multiplication algorithm if the difference falls below a threshold;
- selecting, by the one or more computer processors, a multi-digit multiplication algorithm if the difference equals or exceeds the threshold;
- determining a product, by the one or more computer processors using the selected algorithm, of B and a quotient of A divided by B;
- determining, by the one or more computer processors, a second difference between the product from A;
- and
- providing, by the one or more computer processors, the second difference as an output.
A computer program product for dynamic selection of a multiplication algorithm, the computer program product comprising one or more computer readable storage devices and collectively stored program instructions on the one or more computer readable storage devices, that when executed cause a processor to:
- receive operands A and B;
- determine a difference between A and B;
- estimate a number of quotient digits according to the difference between A and B;
- select a digit wise multiplication algorithm if the difference falls below a threshold;
- select a multi-digit multiplication algorithm if the difference equals or exceeds the threshold;
- determine a product using the selected algorithm, of B and a quotient of A divided by B;
- determine a second difference between A and the product;
- and
- providing the second difference as an output.
A computer system for dynamic selection of a multiplication algorithm, the computer system comprising:
- one or more computer processors;
- one or more computer readable storage devices;
- and
- stored program instructions on the one or more computer readable storage devices, which when executed cause the one or more computer processors to:
- receive operands A and B;
- determine a difference between A and B;
- estimate a number of quotient digits according to the difference between A and B;
- select a digit wise multiplication algorithm if the difference falls below a threshold;
- select a multi-digit multiplication algorithm if the difference equals or exceeds the threshold;
- determine a product using the selected algorithm, of B and a quotient of A divided by B;
- determine a second difference between A and the product;
- and
- providing the second difference as an output.
A computer implemented method for dynamic selection of a multiplication algorithm comprising:
- receiving operands A and B;
- determining a difference between A and B;
- estimating a number of quotient digits according to the difference between A and B;
- selecting a digit wise multiplication algorithm if the estimated number of quotient digits falls below a threshold;
- selecting a multi-digit multiplication algorithm if the estimated number of quotient digits equals or exceeds the threshold;
- determining a product, by the one or more computer processors using the selected algorithm, of B and a quotient of A divided by B;
- determining, by the one or more computer processors, a second difference between the product from A;
- and
- providing, by the one or more computer processors, the second difference as an output.
A computer implemented method for dynamic selection of a multiplication algorithm comprising:
- receiving operands A and B;
- determining a difference between A and B;
- selecting a digit wise multiplication algorithm if the difference falls below a threshold;
- selecting a multi-digit multiplication algorithm if the difference equals or exceeds the threshold;. pre-scaling the operands;
- calculating a quotient for the operands;
- back multiplying the quotient and operand B, using the selected algorithm, yielding a product;
- subtracting the product from operand A, yielding a remainder;
- and
- providing the remainder as an output.
Dependencies are inferred from the claim text.