[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Exchange pow/frexp/ldexp (Lua power calculation)
- From: Flyer31 Test <flyer31@...>
- Date: Mon, 18 Oct 2021 16:13:10 +0200
PS: But my CORDIC of course has both exp and ln in hardware, so this
all should work fine (instead of exp it has sinh and cosh, but then
exp=sinh+cosh, this is fine...).
On Mon, Oct 18, 2021 at 4:11 PM Flyer31 Test <email@example.com> wrote:
> oh, thank you, then principally nice.. .
> But which header functions of Lua to I have to "tweek" to convice Lua
> to use my "myfrexp" instead of the C standard function "frexp".
> (and next question would be whether lua possibly also uses one of the
> other pwer functions like pow log etc... but I assume not as far as I
> looked to the code so far - it is a bit diffecult to be sure at this
> point, because there is somehow very deep in Lua and there much is
> done by macros, thus, then somehow hiding at least any of my "ASCII
> search attacks" for frrexp... ).
> On Mon, Oct 18, 2021 at 3:59 PM Doug Currie <firstname.lastname@example.org> wrote:
> > On Oct 18, 2021 at 9:47:47 AM, Flyer31 Test <email@example.com> wrote:
> >> thank you for fast answer - sorry for misunderstanding.
> >> I do not want to change this in Lua code.
> >> I want to change the C machine of Lua to use my own frexp (some new
> >> function, which I write by myself, e. g. myfrexp).
> > Right, that’s what I assumed. I just wrote it in pseudocode, which perhaps looked a bit like Lua. You can use the CORDIC based exp and log to build your myfrexp. (There are faster approaches than CORDIC for exp and log, but if you already have them in hand it’s a good place to start.)
> > See https://stackoverflow.com/a/17892402/33252 , where expt is called “pow,” and its links for some background on the special cases and edge cases to be concerned about.
> > e