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


Groups > comp.lang.forth > #49275

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.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

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? Chris Curl <ccurl609@gmail.com> - 2016-07-20 05:37 -0700
      Re: Jazelle? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-07-20 13:36 +0000
    Re: Jazelle? "WJ" <w_a_x_man@yahoo.com> - 2016-07-20 13:06 +0000
    Re: Jazelle? "gareth G4SDW GQRP #3339" <no.spam@thank.you.invalid> - 2016-07-20 14:49 +0100
      Re: Jazelle? hughaguilar96@gmail.com - 2016-07-20 08:48 -0700
      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? mhx@iae.nl - 2016-07-20 13:27 -0700
              Re: Jazelle? "WJ" <w_a_x_man@yahoo.com> - 2016-07-21 09:41 +0000
            Re: Jazelle? hughaguilar96@gmail.com - 2016-07-21 17:24 -0700
        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? Cecil Bayona <cbayona@cbayona.com> - 2016-07-22 10:09 -0500
                Re: Jazelle? Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2016-07-22 19:20 +0300
                Re: Jazelle? Brad Eckert <hwfwguy@gmail.com> - 2016-07-22 09:35 -0700
          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? Julian Fondren <julian.fondren@gmail.com> - 2016-07-26 04:26 -0700
                Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-26 11:20 -0400
  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? "WJ" <w_a_x_man@yahoo.com> - 2016-07-20 14:33 +0000
      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? hughaguilar96@gmail.com - 2016-07-20 09:25 -0700
    Re: Jazelle? hughaguilar96@gmail.com - 2016-07-20 09:22 -0700
      Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 13:14 -0400
        Re: Jazelle? hughaguilar96@gmail.com - 2016-07-20 21:44 -0700
          Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-21 01:32 -0400
            Re: Jazelle? Cecil Bayona <cbayona@cbayona.com> - 2016-07-21 02:21 -0500
          Re: Jazelle? Brad Eckert <hwfwguy@gmail.com> - 2016-07-21 17:13 -0700
            Re: Jazelle? hughaguilar96@gmail.com - 2016-07-21 17:42 -0700
            Re: Jazelle? humptydumpty <ouatubi@gmail.com> - 2016-07-23 10:08 -0700
              Re: Jazelle? hughaguilar96@gmail.com - 2016-07-23 13:55 -0700
                Re: Jazelle? humptydumpty <ouatubi@gmail.com> - 2016-07-24 02:22 -0700
  Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 10:56 -0400
  Re: Jazelle? Brad Eckert <hwfwguy@gmail.com> - 2016-07-20 10:54 -0700
    Re: Jazelle? Cecil Bayona <cbayona@cbayona.com> - 2016-07-20 13:33 -0500
      Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 16:51 -0400
        Re: Jazelle? Cecil Bayona <cbayona@cbayona.com> - 2016-07-20 17:09 -0500
          Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 18:12 -0400
            Re: Jazelle? Cecil Bayona <cbayona@cbayona.com> - 2016-07-20 18:41 -0500
              Re: Jazelle? rickman <gnuarm@gmail.com> - 2016-07-20 21:01 -0400

csiph-web