Calculating large precision common logarithms
AssigneeInternational Business Machines Corporation
InventorsPaul Anderson, Andrew H. Richter, Grace A. Richter
Life of this patent
Estimating the term…
Abstract
Techniques are disclosed for calculating large precision common logarithms. A common logarithm may be calculated using addition and/or subtraction of known logarithm values. Embodiments of the invention permit calculation of common logarithms of real numbers stored within character arrays, where each element of the array corresponds to a digit in the real number.
Claims18
A computer-implemented method for calculating a logarithm to a specified precision for a specified real value, the method comprising performing operations on one or computer processors, comprising:
- determining an integer magnitude for the specified real value;
- shifting the specified real value by the determined integer magnitude;
- storing the shifted specified real value in a character array in a memory device, wherein each element of the character array is a digit of the real value;
- determining, by operation of one or more processing units, an interim result based on the shifted specified real value;
- determining a precision value based on the shifted specified real value;
- until a count of leading nine values in the precision value exceeds the specified precision, repeatedly:
- determining a next multiplier,
- determining a logarithm of the next multiplier;
- subtracting the determined logarithm of the next multiplier from the interim result, and
- multiplying the precision value by the next multiplier;
- and
- reporting the value of the interim result as the logarithm of the specified real value.
A computer readable storage medium containing a computer program product comprising:
- computer readable program code to determine an integer magnitude for the specified real value;
- computer readable program code to shift the specified real value by the determined integer magnitude;
- computer readable program code to store the shifted specified real value in a character array, wherein each element of the character array is a digit of the real value;
- computer readable program code to determine an interim result based on the shifted specified real value;
- computer readable program code to determine a precision value based on the shifted specified real value;
- computer readable program code to, until a count of leading nine values in the precision value exceeds the specified precision, repeatedly:
- determine a next multiplier,
- determine a logarithm of the next multiplier;
- subtract the determined logarithm of the next multiplier from the interim result, and
- multiply the precision value by the next multiplier;
- and
- computer readable program code to report the value of the interim result as the logarithm of the specified real value.
A system, comprising:
- a processor;
- a storage repository;
- and
- a memory storing a logarithm component, which when executed on the processor is configured to perform an operation, comprising:
- determining an integer magnitude for the specified real value;
- shifting the specified real value by the determined integer magnitude;
- determining an interim result based on the shifted specified real value;
- determining a precision value based on the shifted specified real value;
- until a count of leading nine values in the precision value exceeds the specified precision, repeatedly:
- determining a next multiplier,
- determining a logarithm of the next multiplier;
- subtracting the determined logarithm of the next multiplier from the interim result, and
- multiplying the precision value by the next multiplier;
- and
- reporting the value of the interim result as the logarithm of the specified real value,
- wherein each real value is stored in a character array and wherein each element of the character array is a digit of the real value.
Dependencies are inferred from the claim text.