Floating point? --> try integer solutions (what input values range, what expected calculation resolution and accuracy?)
What microcontroller, what clock frequency, what language, libraries and compiler do you use?
Consider creating a lookup table. Say you want two digits of precision... Then you need an array of 100 elements. Exponents are a simple matter of reversing the sign (positive to negative, negative to positive).
Floating point? --> try integer solutions (what input values range, what expected calculation resolution and accuracy?)
What microcontroller, what clock frequency, what language, libraries and compiler do you use?
8Bit STM8S MCU, 16MHz clock, Timer clock - 250KHz, Expected freq input to the Timer Capture unit is 0-200Hz.
I haven't used Float variables and no Math or standard libraries. C language Cosmic Compiler.
Your requirements are restrictive; you could consider setting timer scaler to a interval between acquisitions as a rational number power of two, so that division could be replaced by a simple right shift (>>) operation.
For example, by setting timer period as 1,024s, the division operation can be made by right-shifting 10 digits, so if e.g 512 pulses are accounted during this time, the computed frequency is 500Hz with a reasonable resolution.
Needless to say that a timer with the largest magnitude should be choosen; many 8 bit MCU's have either 8 and 16 bits timers available.
If you perform only 1 measurement per second, 40 µs division time (0.004 %) would be absolutely no issue. But I guess 1 Hz is too slow. For reasonable measurement rate and resolution, you are tied to (multi-)periode measurement method and hence need division step.
Although the specification is incomplete (didn't mention measurement rate, resolution, minimal input frequency), I presume long unsigned (uint32) arithmetic is used here. Thus tables are hardly an option. However, if you choose a rate equal to the maximum input frequency of 200 Hz, what's the problem with spending 40 µs for the calculation?