摘要 |
An exponential function on a base X raised to a power of N is performed in a processor in a manner that maximizes computing efficiency. The exponential function initially positions at a starting node in an exponential tree stored in a memory of the processor, wherein the starting node represents the value of N. A working value W is created in the memory of the processor and the working value W is initially set equal to the base X. The exponential tree is traversed in the memory of the processor from the starting node to an answer node and the working value W is updated in the memory of the processor at each node encountered during the traversal. The working value is squared in the memory of the processor when a next node is above and to the right of the current node. Otherwise, the working value is squared in the memory of the processor and a result thereof is multiplied by X in the memory of the processor when the next node is above and to the left of the current node. This working value W is finally outputted as a result of the exponential function.
|