Major nerves are made of large numbers of nerve fibers. When a signal is initiated in the nerve, it is transmitted along each fiber via an action potential (called single fiber action potential (SFAP)) which travels with a velocity that is related with the diameter of the fiber and whether the fiber is covered with a myelin sheath or not. The additive superposition of SFAPs constitutes the compound action potential (CAP) of the nerve. The fiber diameter distribution (FDD) in the nerve can be computed from the CAP data through an inverse problem. The common practice is to obtain a histogram for FDD using convolution. However, number of fibers in a nerve can be measured sometimes in thousands and it is possible to assume a continuous distribution for the fiber diameters, which is the approach we have taken in this work. Utilizing an analytical function for SFAP and assumed functional form for FDD, the inverse problem is formulated as a gradient optimization problem in order to determine the FDD that will result to the considered CAP. We have observed that an 8th order polynomial can capture almost all fiber distributions present in vivo.