1. An apparatus for computing a nonlinear function of an input variable, the apparatus comprising: a logarithmic circuit configured to compute a logarithm of a first input value; a reciprocal circuit configured to obtain the logarithm of the first input value and configured to: when enabled, negate the logarithm of the first input value and provide the negated logarithm of the first input value as an output of the reciprocal circuit, and when disabled, provide the logarithm of the first input value as the output of the reciprocal circuit; a root circuit configured to obtain the output of the reciprocal circuit and configured to: when enabled, divide the received output of the reciprocal circuit by N and provide the divided output of the reciprocal circuit as an output of the root circuit, and when disabled, provide the received output of the reciprocal circuit as the output of the root circuit; a control logic configured to: enable the reciprocal circuit and disable the root circuit when the nonlinear function is a reciprocal, disable the reciprocal circuit and enable the root circuit when the nonlinear function is an Nth root, and enable the reciprocal circuit and enable the root circuit when the nonlinear function is a reciprocal Nth root.