Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!not-for-mail From: David Kuehling Newsgroups: comp.lang.forth Subject: Re: VFX code quality Date: Tue, 22 May 2012 14:06:14 +0200 Lines: 33 Message-ID: <87vcjoju89.fsf@snail.Pool> References: <2243442.558.1337149672996.JavaMail.geo-discussion-forums@pbbnx3> <11e6995a-c86c-41d8-8140-31305030531d@ki5g2000pbb.googlegroups.com> <_76dne-Wl4qiKCnSnZ2dnUVZ_uWdnZ2d@supernews.com> <4tSdnV0EjcWaqCjSnZ2dnUVZ_uadnZ2d@supernews.com> <4fb612ab.267100980@192.168.0.50> <2012May18.145840@mips.complang.tuwien.ac.at> <4fb661ae.287328288@192.168.0.50> <7xmx528zi4.fsf@ruckus.brouhaha.com> <7x8vgmffmz.fsf@ruckus.brouhaha.com> <7x396uurso.fsf@ruckus.brouhaha.com> <7xpq9yc516.fsf@ruckus.brouhaha.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.uni-berlin.de k9ggln4DXKn9b4fHkGepqAeYDb8AJzH9rreP5uxRLlSZw/GURq9WN9RK4rdk5Ql7g= Cancel-Lock: sha1:INbHzUFuj9bMo2nfqSnyzQn13ck= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Xref: csiph.com comp.lang.forth:12379 >>>>> "Paul" == Paul Rubin writes: > "Elizabeth D. Rather" writes: >>> : z* ( a b c d -- ac-bd bc+ad ) .... ; >> >> I don't understand your stack comment (I'm no mathematician) > ac-bd just means a*c minus b*d. So the word takes 4 parameters > a,b,c,d representing the two complex numbers a+bi and c+di. It > multiplies them leaving the single complex number (ac-bd) + i*(bc+ad), > as two coefficients on the stack. It's trivial with locals: > : z* { a b c d -- x y } a c * b d * - b c * a d * + ; > doing it without locals seems quite inconvenient. I think Chuck might > have used globals. Well not too inconvenient, this is what I came up some time ago: : z* ( n1 n2 n3 n4 -- n5 n6 ) 2OVER 2OVER -ROT r* -ROT r* r+ >R ( imag ) ROT r* >R r* R> r- ( real ) R> ; this is for single-cell entities. Of course with floats you can't use >R R> which would screw you (but on the other hand floating point locals aren't supported by the standard). David -- GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40