Efficient implementation of natural logarithm (ln) and exponentiation

Posted by Donotalo on Stack Overflow See other posts from Stack Overflow or by Donotalo
Published on 2012-03-21T05:25:42Z Indexed on 2012/03/21 5:30 UTC
Read the original article Hit count: 201

Basically, I'm looking for implementation of log() and exp() functions provided in C library <math.h>. I'm working with 8 bit microcontrollers (OKI 411 and 431). I need to calculate Mean Kinetic Temperature. The requirement is that we should be able to calculate MKT as fast as possible and with as little code memory as possible. The compiler comes with log() and exp() functions in <math.h>. But calling either function and linking with the library causes the code size to increase by 5 Kilobytes, which will not fit in one of the micro we work with (OKI 411), because our code already consumed ~12K of available ~15K code memory.

The implementation I'm looking for should not use any other C library functions (like pow(), sqrt() etc). This is because all library functions are packed in one library and even if one function is called, the linker will bring whole 5K library to code memory.

© Stack Overflow or respective owner

Related posts about c

    Related posts about math