Sampling points logarithmically on the x axis

76 Views Asked by At

How may I sample points logarithmically on the $x$ axis in the interval $[x_0,x_1]$ ? Basically I have a sharply peaked function nearing the interval border at $x_0$ such that a linear sampling does not give me the correct behaviour of the function. Of course, I may also do a linear sampling on the reduced interval $[x_0, x_r]$, where $x_r \simeq x_0$ which corrects for that but I'd like to try with a logarithmic sampling and plot accurately for the whole $x$ interval.

Before, the linear sampling was $x = x_0 + (x_1-x_0)/\text{incs}*i$, where $\text{incs}=10000$ say and then $i\in \left\{0,...,10000 \right\}$.

How to sample logarithmically between $x_0$ and $x_1$?