  We introduce a numerical method for the approximation of functions which are
analytic on compact intervals, except at the endpoints. This method is based on
variable transforms using particular parametrized exponential and
double-exponential mappings, in combination with Fourier-like approximation in
a truncated domain. We show theoretically that this method is superior to
variable transform techniques based on the standard exponential and
double-exponential mappings. In particular, it can resolve oscillatory
behaviour using near-optimal degrees of freedom, whereas the standard mappings
require degrees of freedom that grow superlinearly with the frequency of
oscillation. We highlight these results with several numerical experiments.
Therein it is observed that near-machine epsilon accuracy is achieved using a
number of degrees of freedom that is between four and ten times smaller than
those of existing techniques.
