You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me know if this approach sounds good. For a first pull request some of the implementations might just be the simpler forms rather than the faster more complex versions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have made a decent amount of progress with a native Odin implementation of complex.h .
So far I've been going off of the implementations in musl libc. Some are simple and marked with
// FIXME
.e.g.
cacos
(https://git.musl-libc.org/cgit/musl/tree/src/complex/cacos.c) refers to https://dl.acm.org/doi/pdf/10.1145/275323.275324I did find that FreeBSD has an implementation that matches closely to that paper that I could try to port eventually.
See https://github.com/freebsd/freebsd-src/blob/cf17c2ff11a9e027e92bebdb3eb3fec6727c9c03/lib/msun/src/catrig.c#L1
Other implementations in musl libc have the same or are very similar to the ones in OpenBSD and FreeBSD. They have their respective BSD 2 clause licenses copied over as well.
e.g.
catan
: https://git.musl-libc.org/cgit/musl/tree/src/complex/catan.cis from https://github.com/openbsd/src/blob/master/lib/libm/src/s_catan.c
but there are slight differences as it looks like OpenBSD has some overflow handling? Should I just roll with the musl libc variation in these cases?
Let me know if this approach sounds good. For a first pull request some of the implementations might just be the simpler forms rather than the faster more complex versions.
Beta Was this translation helpful? Give feedback.
All reactions