Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/1] Initial work on lib/math


Initial work on libmath. Nothing very interesting yet, just structure.

 - I picked the most trivial functions I could think of. I'm
   half-expecting to rewrite these later, since they feel more
   complicated than they should be right now. I'd rather rewrite a
   simple function that a complicated one.

 - No asm versions just yet. I want to understand asm a bit more
   before I start on that. In particular, I'm not sure yet what
   extensions are reasonable to target, or whether it's worth making
   the tag system more complicated (is fpmath-impl+amd64-avx2-sse4.s
   really worth it?).

 - The good news is that the three functions trunc, floor, and ceil
   have been pretty heavily tested, however. I mentioned in IRC
   that I've spent the last few days putting together a tool [0]
   to compare implementations. I've exhaustively checked these
   functions on all flt32 bit-patterns in a couple of minutes against
   generic libc and (for overkill) mpfr. Exhausting flt64 is unlikely
   to happen this decade, but random checking still helps.

 - My immediate next steps are to implement one or two summation
   algorithms. Muller et al. lists quite a few (Kahan, Priest,
   Pichat—Neumaier, …). After that, perhaps something truly exotic
   like square roots.

[0] http://repo.or.cz/fpmath-consensus.git

S. Gilles (1):
  Implement a few simple floating-point functions

 lib/bld.sub              |   1 +
 lib/math/bld.sub         |   5 ++
 lib/math/fpmath.myr      | 199 +++++++++++++++++++++++++++++++++++++++++++++++
 lib/math/test/fpmath.myr | 163 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 368 insertions(+)
 create mode 100644 lib/math/bld.sub
 create mode 100644 lib/math/fpmath.myr
 create mode 100644 lib/math/test/fpmath.myr

-- 
2.16.2


Follow-Ups:
[PATCH 1/1] Implement math.trunc and math.fast2sum"S. Gilles" <sgilles@xxxxxxxxxxxx>