I\'m looking for implementation of log() and exp() functions provided in C library . I\'m working with 8 bit microcontro
First, let's make use of logn(x) = ln(x)/ln(n). ln(x) can be expressed as (x^h-1)/h, where h approaches 0. You can derive this with the differential quotient.
float log(x, n) {
return ((x^h-1)/h)/((n^h-1)/h)
}
So now choose a small value for h, it gets more accurate as you make it smaller. Constant runtime and small code size, I always prefer this method.