[libre-riscv-dev] [isa-dev] Re: FP transcendentals (trigonometry, root/exp/log) proposal
Mitchalsup
mitchalsup at aol.com
Thu Jan 16 17:56:07 GMT 2020
Mitch AlsupMitchAlsup at aol.com
-----Original Message-----
From: Luke Kenneth Casson Leighton <lkcl at lkcl.net>
To: Libre-RISCV General Development <libre-riscv-dev at lists.libre-riscv.org>
Cc: MitchAlsup <mitchalsup at aol.com>
Sent: Thu, Jan 16, 2020 4:00 am
Subject: Re: [isa-dev] Re: FP transcendentals (trigonometry, root/exp/log) proposal
On Thursday, January 16, 2020, Jacob Lifshay <programmerjake at gmail.com> wrote:
On Thu, Jan 16, 2020, 01:22 Luke Kenneth Casson Leighton <lkcl at lkcl.net>
wrote:
> On Thursday, January 16, 2020, <whygee at f-cpu.org> wrote:
>
> > On 2020-01-16 04:04, lkcl . wrote:
>
>
>
> > the time (let alone rounding). how do you *know* when the rounding (or
> the
> >> last bit of the mantissa) is wrong?
> >>
> >
> > That was my reaction :
> > if you *know* your LSB is wrong then you can correct it...
>
>
> ... or can you? this is what i'm fascinated to hear about, mitch.
>
> is there some mathematical way in which the accuracy can be computed yet
> the effort not known?
>
Yes. you just compute the output to a few more bits where the output is
known to always be within a certain distance of the correct output,
sorry to be sounding dumb: the question thus becomes, "how do you know when the output is always within a cer... etc etc " :)
There is the side branch of computer science called "numerical analysis" and here you learn how to determine the error of the polynomial, the error of the iteration (Newton-Raphson or Goldschmidt), the error of the "way" the calculation is performed, and other insundry errors.At the end you have a numeric value of the maximum error and a numeric value of the numberof bits that are known to be correct.
Newton Raphson is basically useless for functions like sin or cos, since
you have to compute the inverse function (asin or acos) to a higher
accuracy which takes even more work than just computing the function to
enough accuracy in the first place.
oh whoops. oh yes.
l.
--
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
More information about the libre-riscv-dev
mailing list