# How to logarithmic interpolation? [closed]

I'm trying to interpolate a logarithmic function but it always reaches a singularity due to $\log(0)$ being $-\infty$

is there a correct way to interpolate logarithmic functions? (as in correct parameters)

What i'm currently going for is

$y=a+b \log(cx)$

with initial values

$a=0$, $b=1$, $c=0$

• What do you mean by 'interpolate a logarithmic function"? Can you articulate the problem more precisely/clearly? What are the inputs, and what outputs would you like to receive from the algorithm? Maybe give an example of an example input to the algorithm, and what output you'd like the algorithm to produce? – D.W. May 21 '14 at 4:47
• Welcome to Computer Science! Note that you can use LaTeX here to typeset mathematics in a more readable way. See here for a short introduction. – FrankW May 21 '14 at 5:14
• D.W. I had a set of points that i knew would make a log function but i wasn't sure how to interpolate them since log functions have many variables and have singularity problems. The solution was to set c's initial value to 1 and add a constant inside the log (log(cx + d) ) to dislocate the function in the x axis so it fit the point set – Jean-Luc Nacif Coelho May 21 '14 at 18:08

The general fitting formula for pretty much any function is $F(x)=a*x+b$
so if you have a function inside a function it would be $F(G(x))=a*G(c*x+d)+b$ by virtue of substitution.
You made a tiny error. Instead of $y=a+b \log(cx)$ you probably want $y=a+b \log(cx + d)$
try to fit your function again. a multiplier should never equal to zero, because that would imply you don't have a function of $x$.