Patent ID: 7933941

Claim:
An arithmetic program conversion apparatus for converting a floating-point arithmetic operation in an arithmetic program into a fixed-point arithmetic operation, the apparatus comprising: a storage; a processor; a profile section that, when executed by the processor: specifies a variable of a floating-point type in the arithmetic program, defines values of an input parameter in the arithmetic program, wherein the specified variable is an arithmetic result that depends on the value of the input parameter, generates a first program from the arithmetic program, wherein the first program causes the processor to record a history of values of the specified variable in the storage during execution of the first program, executes the first program for each of the defined values of the input parameter and records a plurality of corresponding histories for the specified variable in the storage, and detects a range of values of the specified variable from the histories; and a conversion section that, when executed by the processor: generates a second program from the arithmetic program, executes the second program, and determines if accuracy of an outcome of the executing of the second program meets a predefined accuracy level, wherein in the generating of the second program, the conversion section: selects from the arithmetic program an arithmetic operation, wherein the output from the arithmetic operation depends on the input parameter and the specified variable, converts the specified variable into a variable of a fixed-point type based on the detected range, adds to the arithmetic operation a classification operation which classifies a value of the input parameter and selects a shift amount from a plurality of shift amounts according to the classified value, adds to the arithmetic operation a first bit shift operation which moves from a original position a decimal point of the specified variable by shifting according to the selected shift amount, and adds to the arithmetic operation a second bit shift operation which returns to the original position the decimal point of the output from the selected arithmetic operation by shifting in the opposite direction according to the selected shift amount.