A method of a hardware accelerator, comprising: loading, by the hardware accelerator, a lookup table in which information associated with a reciprocal of an exponential function corresponding to indexes is stored; mapping, by the hardware accelerator, each input data value of a plurality of input data values of input data to an index of the indexes based on an input data distribution of the input data, wherein the mapping comprises: determining, by the hardware accelerator, a maximum input data value among the plurality of the input data values, calculating, by the hardware accelerator, for each of the plurality of input data values a difference, wherein the difference is computed by subtracting the input data value from the maximum input data value, and directly mapping, by the hardware accelerator, each calculated difference to an index of the indexes, or scaling, by the hardware accelerator, each calculated difference and mapping the scaled difference to an index of the indexes; and obtaining, by the hardware accelerator, for each input data value of the plurality of input data values a corresponding output data value from the lookup table using the index to which the input data value has been mapped, wherein the obtained output data value is proportional to a reciprocal of the value of the exponential function of the difference that has been calculated for the input data value. loading, by the hardware accelerator, a lookup table in which information associated with a reciprocal of an exponential function corresponding to indexes is stored; mapping, by the hardware accelerator, each input data value of a plurality of input data values of input data to an index of the indexes based on an input data distribution of the input data, wherein the mapping comprises: determining, by the hardware accelerator, a maximum input data value among the plurality of the input data values, calculating, by the hardware accelerator, for each of the plurality of input data values a difference, wherein the difference is computed by subtracting the input data value from the maximum input data value, and directly mapping, by the hardware accelerator, each calculated difference to an index of the indexes, or scaling, by the hardware accelerator, each calculated difference and mapping the scaled difference to an index of the indexes; and determining, by the hardware accelerator, a maximum input data value among the plurality of the input data values, calculating, by the hardware accelerator, for each of the plurality of input data values a difference, wherein the difference is computed by subtracting the input data value from the maximum input data value, and directly mapping, by the hardware accelerator, each calculated difference to an index of the indexes, or scaling, by the hardware accelerator, each calculated difference and mapping the scaled difference to an index of the indexes; and obtaining, by the hardware accelerator, for each input data value of the plurality of input data values a corresponding output data value from the lookup table using the index to which the input data value has been mapped, wherein the obtained output data value is proportional to a reciprocal of the value of the exponential function of the difference that has been calculated for the input data value.