The following steps summarize how to use the lookup table approximation functions.
Define:
The ideal function to approximate
The range, xmin
to xmax
, over which to find
X and Y data
The fixed-point implementation: data type, scaling, and rounding method
The maximum acceptable error, the maximum number of points, and the spacing
Run the fixpt_look1_func_approx
function to
generate X and Y data.
Use the fixpt_look1_func_plot
function to plot
the function and error between the ideal and approximated functions using the selected X
and Y data, and to calculate the error and the number of points used.
Vary input criteria, such as errmax
,
nptsmax
, and spacing
, to produce sets of X and Y
data that generate functions with varying worst-case error, number of points required, and
spacing.
Compare results of the number of points required and maximum absolute error from various runs to choose the best set of X and Y data.