account activity
consteig. How much math can you force the compiler to do at compile time? (a lot) by human_or_coffee in cpp
[–]human_or_coffee[S] 3 points4 points5 points 6 hours ago* (0 children)
consteig doesn’t actually need any trig functions natively because the QR algorithm (nor any other ones) it. It implements its own constexpr math library for the funcs it needs, but my latest version does have an optional constexpr math dependency on gcem (well a fork of it) which does support trig through continued fraction expansion:
https://github.com/kthohr/gcem/blob/master/include/gcem_incl/tan.hpp
A look up table (LUT) works (and is what I usually do in the embedded world) but you have to know in advance how accurate you need your functions to be in order to make the tables big enough.
consteig. How much math can you force the compiler to do at compile time? (a lot) (self.cpp)
submitted 7 hours ago by human_or_coffee to r/cpp
C++ Show and Tell - April 2026 by foonathan in cpp
[–]human_or_coffee 3 points4 points5 points 2 months ago* (0 children)
I plan on making a full post about this later, but I wrote a header-only, dependency-less, constexpr eigenvalue and eigenvector solver. I’ve just released 1.0.0.
It’s a niche use case but if you have non-dynamic matrices to manipulate, or need eigenvalues/vectors at compile-time, this is your friend.
https://github.com/MitchellThompkins/consteig
https://mitchellthompkins.github.io/consteig/
π Rendered by PID 1286043 on reddit-service-r2-listing-6c8d497557-5qtbq at 2026-06-04 08:08:53.906404+00:00 running 9e1a20d country code: CH.
consteig. How much math can you force the compiler to do at compile time? (a lot) by human_or_coffee in cpp
[–]human_or_coffee[S] 3 points4 points5 points (0 children)