[libre-riscv-dev] algebraic numbers library

Jacob Lifshay programmerjake at gmail.com
Mon Sep 16 12:27:53 BST 2019


On Mon, Sep 16, 2019, 04:16 Luke Kenneth Casson Leighton <lkcl at lkcl.net>
wrote:

> On Mon, Sep 16, 2019 at 12:11 PM Jacob Lifshay <programmerjake at gmail.com>
> wrote:
> >
> > I've been writing an algebraic numbers library for a while with the
> > intention that it could be used to create a reference by which we
> > could test our IEEE 754 operations, since the numbers it represents
> > are exact instead of approximated.
>
> excellent. the main one we need is that rsqrt operation.
>

the library doesn't currently have a python interface, will be writing one
very soon.

it should also work for normalize, hypot, and several others. basically
anything that can be expressed as a combination of nth roots (where n
should be small), powers, and add/sub/mul/div.

it could also be used for testing add/sub/mul/div/muladd and similar,
though is probably not the fastest for those.

it does support much more precision than even f128 (exact results are the
highest precision possible), so can be used for testing all our fp needs
except for transcendentals (though I also have interval-based arithmetic in
there that got the right answer to a 200ish decimal digit exp()
calculation, we can add more transcendentals there).

Jacob


More information about the libre-riscv-dev mailing list