Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135086

Re: Sometimes Forth is just fun!

From minforth <minforth@gmx.net>
Newsgroups comp.lang.forth
Subject Re: Sometimes Forth is just fun!
Date 2026-05-19 20:19 +0200
Message-ID <n73nstF2o6fU1@mid.individual.net> (permalink)
References <10uhpdc$39qrk$1@dont-email.me>

Show all headers | View raw


Am 19.05.2026 um 15:43 schrieb Hans Bezemer:
> After all that IEEE-754 stuff, I had to do something with it. Because 
> there was something I wanted to do for a long time - if just to honor 
> the programmers that came up with it:
> 
> : finvsqrt                             ( f -- 1/sqrt f)
>    fdup f>ieee-sf 2/ negate 1597463007 + ieee-sf>f
>    fswap f2/ fover fdup f* f* fnegate 3 s>f f2/ f+ f*
> ;
> 
> 16 s>f finvsqrt f. cr depth . fdepth .
> 
> And it does this:
> 
> $ pp4th -x zenisqrt.4th
> 0.249576787396195506538282980998661071
> 0 0
> 
> :-)
> 
> Hans Bezemer

Thanks for this little piece of nostalgia  :-)

Some background:
https://en.wikipedia.org/wiki/Fast_inverse_square_root

Back to comp.lang.forth | Previous | NextPrevious in thread | Find similar


Thread

Sometimes Forth is just fun! Hans Bezemer <the.beez.speaks@gmail.com> - 2026-05-19 15:43 +0200
  Re: Sometimes Forth is just fun! minforth <minforth@gmx.net> - 2026-05-19 20:19 +0200

csiph-web