Skip to content

Add q16-fixed-exp: a Q16.16 fixed-point exp() library for Cortex-M (C + ASM) #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OscarJ12
Copy link

This library implements fixed_mul(), fixed_exp() (for x ≥ 0) and fixed_exp_signed() (full signed support) in Q16.16 format, entirely in integer math—no FPU or divisions. It uses:

Binary decomposition of the fractional part (11-bit resolution) for sub-0.1 % accuracy on positive exponents

LUT + one-point linear interpolation for negative exponents (≤ 0.1 % error over [0,10])

A tiny lookup table (~324 B) and just one extra multiply per call for negatives

Both portable C and highly optimized ARM Cortex-M3 assembly

Based on O. W. Jackson’s TechRxiv paper “A Fixed-Point Binary Decomposition Method for Efficient Exponential Approximation in Embedded Systems” (May 2025):
https://www.techrxiv.org/users/921611/articles/1293706-a-fixed-point-binary-decomposition-method-for-efficient-exponential-approximation-in-embedded-systems

GitHub: https://github.com/you/q16-fixed-exp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant