12 karma · joined Jun 18, 2014 (12y ago) · 18 submissions
comment 10mo ago · link · parent
comment 7y ago · link · parent
If you want to avoid a code generation, you can generate a .cdb (constant database) file with the cdbw(3) C API and read it using the cdbr(3) C API.
cdbw(3) http://netbsd.gw.com/cgi-bin/man-cgi?cdbw+3+NetBSD-current cdbr(3) http://netbsd.gw.com/cgi-bin/man-cgi?cdbr+3+NetBSD-current
Some examples of .cdb files on NetBSD:
/usr/share/misc/terminfo.cdb /var/db/services.cdb
If you don't like a particular choice of a scripting language, you can adapt my Lua script:
https://gist.github.com/alnsn/68f599bc9358fcee122d6175392d77...
Building and peeling a graph should be identical but the assign step is different. I use non-minimal not order preserving BDZ scheme while Joerg's code is based on the original CHM scheme.
Given keys A, B, C and D, CHM always maps them to values 0, 1, 2 and 3. BDZ, on the other hand, can generate values in a range [0, 2.1 * 4) and it doesn't preserve an order. For instance, one possible mapping in the BDZ scheme is 7, 2, 5, 1.
Alex
comment 11y ago · link · parent
comment 11y ago · link · parent
I might be wrong (I'm away from my NetBSD boxes) but build.sh script in NetBSD has a buildseed option which can be used to create identical builds of the base system.
comment 11y ago · link · parent
PS I noticed that gcc with -march=corei7-avx generates more cycles compared to a generic amd64 compilation for an unrolled integer(4) to char[4] conversion.
comment 11y ago · link · parent
comment 11y ago · link · parent
I used some bits from it to help me in building my own log approximation but I didn't have time to dig into it.
I ended up doing Chebyshev approximation over [1, 2) interval but I extended the interval slightly to make sure that an error term at 1.0 is minimal (you can also minimise an error term at 2.0 if you want some smoothness between [1, 2) and [2, 4) intervals).
It's easy to calculate new interval values for Chebyshev approximation and it shouldn't be a problem to modify Remez but I couldn't find any Remez implementation that would let me do what I needed.
Usually, interval ends in Remez algorithm are fixed, while internal points can be moved by the algorithm. I needed a way to to fix one or two internal points (1.0 and optionally 2.0) but let the algorithm move interval ends within certian limits.
If anyone knows of any tool that let me do it, I'd be happy to play with it and publish my code. My approach is a bit similar to [1] but I'd more likely use Intel assembly or DynASM.
[1] http://gallium.inria.fr/blog/fast-vectorizable-math-approx/
PS The author of [1] uses remez from e Sollya tool but it doesn't let me fix internal points. I looked at the implementation but it's more obscure than boost/remez.
UPDATE: it's not clear from the above what my objectives were. I wanted to to produce exact values for integer powers of 2 including log2(1). This approach also gives a small relative error around x=1.
comment 11y ago · link · parent
https://mobile.twitter.com/nasonov/status/484027620993273857...
comment 11y ago · link · parent
comment 11y ago · link · parent
comment 11y ago · link · parent
comment 12y ago · link · parent