Using the lookup table created by create_lookup_table, find the value y corresponding to x. With two arguments the lookup is done to the nearest value below in the table less than the desired value. With three arguments a simple linear interpolation is performed. With four arguments an extrapolation is also performed. The exact values of arguments three and four are irrelevant, as only there presence detremines whether interpolation and/or extrapolation are used.