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


Groups > comp.sys.raspberry-pi > #12777

Re: Jazelle?

From "WJ" <w_a_x_man@yahoo.com>
Newsgroups comp.sys.raspberry-pi, comp.lang.forth
Subject Re: Jazelle?
Date 2016-07-21 10:43 +0000
Organization A noiseless patient Spider
Message-ID <nmq8vk$b52$1@dont-email.me> (permalink)
References (3 earlier) <MPG.31f93e8b429c8383989804@172.16.0.1> <nmnge0$rri$1@dont-email.me> <2016Jul20.121415@mips.complang.tuwien.ac.at> <nmnvi0$e7s$1@dont-email.me> <2016Jul20.163523@mips.complang.tuwien.ac.at>

Cross-posted to 2 groups.

Show all headers | View raw


Anton Ertl wrote:

> : compute-q { f: a f: b/2 f: c -- q }
>   b/2 b/2 f* a c f* f- fsqrt
>   b/2 f0< if fnegate then \ avoids cancelation by the F+ below
>   b/2 f+ ;
> 
> : quadratic { f: a f: b f: c -- x1 x2 }
>   a b f2/ c compute-q { f: q }
>   q a f/ c q f/ ;

Charles Moore said that local variables are harmful,
but Anton had to use them.  Imagine how unwritable
and how unreadable his code would have been without them!
It's atrocious enough already.

Testing:

3e0 -10e0 5e0 quadratic  ok
.s <0>  ok
f. -0.612574113277207  ok
f. -2.72075922005613  ok

Both results are wrong.

Note a very important fact.  None of the Forth "gurus"
posting in this thread noticed that his code produces
absolutely incorrect results.  Correctness matters
far less than dogmatic devotion to a stone-age language.


Julia:

quad(a,b,c) = (t = -b/2a; q = sqrt(b^2 - 4a*c)/2a; [t+q, t-q])

julia> quad(3,-10,5)
2-element Array{Float64,1}:
 2.72076
 0.612574

julia> quad(1,2,-8)
2-element Array{Float64,1}:
  2.0
 -4.0


Employing the other formula, but using a real language (Julia):

calc_q(a, b_2, c) = copysign(sqrt(b_2^2 - a*c), b_2) + b_2

quad(a,b,c) = (q = -calc_q(a, b/2, c); [q/a, c/q])

julia> quad(1,2,-8)
2-element Array{Float64,1}:
 -4.0
  2.0

julia> quad(3,-10,5)
2-element Array{Float64,1}:
 2.72076
 0.612574

-- 
Amazon bans book.  After nearly a month on the site, all traces of the book and
its 80 reviews have been removed.
http://jamesfetzer.blogspot.com/2015/11/debunking-sandy-hook-debunkers-5.html
https://www.youtube.com/watch?v=EEl_1HWFRfo

Back to comp.sys.raspberry-pi | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-18 10:50 +0100
  Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-19 20:25 -0400
    Re: Jazelle? The Natural Philosopher <tnp@invalid.invalid> - 2016-07-20 07:08 +0100
      Re: Jazelle? Paul <paul@pcserviceselectronics.co.uk> - 2016-07-20 08:54 +0100
        Re: Jazelle? The Natural Philosopher <tnp@invalid.invalid> - 2016-07-20 09:29 +0100
          Re: Jazelle? Gordon Henderson <gordon+usenet@drogon.net> - 2016-07-20 12:56 +0000
            Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-20 14:54 +0100
              Re: Jazelle? Folderol <general@musically.me.uk> - 2016-07-20 18:40 +0100
                Re: Jazelle? The Natural Philosopher <tnp@invalid.invalid> - 2016-07-20 19:12 +0100
                Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 15:17 -0400
                Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-20 20:32 +0100
                Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 15:37 -0400
                CAN / LIN auto bus (was Jazelle?) jeffj@panix.com (Jeff Jonas) - 2016-07-20 17:53 -0400
                Re: CAN / LIN auto bus (was Jazelle?) Martin Gregorie <martin@address-in-sig.invalid> - 2016-07-20 22:28 +0000
                Re: CAN / LIN auto bus (was Jazelle?) druck <news@druck.org.uk> - 2016-07-20 23:37 +0100
          Re: Jazelle? alister <alister.ware@ntlworld.com> - 2016-07-20 13:34 +0000
            Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 10:26 -0400
            Re: Jazelle? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-07-20 19:51 -0400
        Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-20 10:31 +0100
          Re: Jazelle? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-07-20 10:14 +0000
            Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-20 14:49 +0100
              Re: Jazelle? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-07-20 14:35 +0000
                Re: Jazelle? mm0fmf <none@invalid.com> - 2016-07-20 17:39 +0100
                Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-20 20:30 +0100
                Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 15:35 -0400
                Re: Jazelle? "WJ" <w_a_x_man@yahoo.com> - 2016-07-21 10:43 +0000
                Re: Jazelle? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-07-21 12:44 +0000
                Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-21 22:59 +0100
                Re: Jazelle? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-07-22 06:42 +0000
                Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-22 12:03 +0100
                Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-22 09:05 -0400
                Re: Jazelle? Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2016-07-22 19:20 +0300
                Re: Jazelle? "WJ" <w_a_x_man@yahoo.com> - 2016-07-25 10:43 +0000
                Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-26 11:41 +0100
          Re: Jazelle? Doug Hoffman <glidedog@gmail.com> - 2016-07-20 06:44 -0400
            Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-20 14:52 +0100
              Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 10:52 -0400
                Re: Jazelle? alister <alister.ware@ntlworld.com> - 2016-07-20 15:40 +0000
                Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 11:46 -0400
            Re: Jazelle? Robert Riches <spamtrap42@jacob21819.net> - 2016-07-21 01:27 +0000
              Re: Jazelle? "A. Dumas" <alexandre@dumas.fr.invalid> - 2016-07-21 05:58 +0200
                Re: Jazelle? colonel_hack@yahoo.com - 2016-07-21 16:29 -0700
                Re: Jazelle? "A. Dumas" <alexandre@dumas.fr.invalid> - 2016-07-22 01:56 +0200
                Re: Jazelle? colonel_hack@yahoo.com - 2016-07-22 14:04 -0700
                Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-22 11:59 +0100
          Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 10:56 -0400
      Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 10:24 -0400
    Re: Jazelle? Theo Markettos <theom+news@chiark.greenend.org.uk> - 2016-07-20 14:38 +0100
      Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-20 14:57 +0100
        Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 10:53 -0400

csiph-web