With f*/+- written in forth it takes ~111 secs (original Leon's
flib):
.
99 R(m)= 4.144999E2 V(m3)= 2.983059E8 M(kg)= 7.457643E11
v(m/sec)= 6.29E4 Ek(J)= 1.479969E21
100 R(m)= 2.994999E2 V(m3)= 1.125327E8 M(kg)= 2.813316E11
v(m/sec)= 2.39E4 Ek(J)= 8.102348E19
1.118E2 secs e
Hi,
I could not resist to play with Leon's newest >float library, so
here is a small real life test, it tests basically everything so you
may optimise. Currently running on amforth 4.0. Enjoy the fun with
float! P.
\ ##
\ FLOATING POINT TEST
Hi, who needs urgently fatan - this is an aproximation, 5+ digits
precision for small arguments (-1..+1).
\ fatan library
\ amforth 4.0
\ Pito 26-9-2010
\ v 1.0.
\ needs Leon's flib (and Pito's asm flib v1.1 for speed)
-fatan
marker -fatan
\ calculate fatan
: fatan ( RAD -- arctangens )
\ x
fdup f
Matthias,
pls mind the Pito's asm lib update I've sent you (v1.1.) with a bug
fix.
I've been discussing the flib approach with Leon. There are
currently two ideas: to go full asm or combined. As from my
understanding nobody will be using the amforth for dsp, a forth flib
based on those 4 asm primit
Hi Pito,
great work, thank you. I've put it into the
application tree of the sourceforge subversion tree.
Matthias
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify applicat
Hi, this is a new version of the lib - combination of amforth's
look-up table sinus calculus (see examples) within the 0-pi/2 range,
and, the actual sinus calculated by the taylor series. VERY GOOD
precision (6+ digits) and still fast. Pito.
\ fsin fcos ftan library
\ amforth 4.0
\ Pito 25-9-2010
..more compact, faster by 25%.P.
\ fsin fcos ftan library
\ amforth 4.0
\ Pito 23-9-2010
\ based on 4tH library by J.L. Bezemer
\ needs Leon's flib (and Pito's asm flib v1.1 for speed)
-fsincostan
marker -fsincostan
\ the original JLB (taylor) does not work, a bug?
: >taylor fdup f* fover ;
.. a better fsin:
\ calculate fsin
: fsin _pihalf f- fcos ;
FYI:
\ Leon's flib and Pito's flib asm v 1.1 and atm...@25mhz:
> fmeasure ( _half fsin )
9.2494154E-3 secs duration of fsin FUNCTION ok
> fmeasure ( _half fcos )
1.23060155E-2 secs duration of fcos FUNCTION ok
> fmeasure ( _half ftan )
Hi,
here are the words for fsin, fcos, ftan. It uses taylor series for
fcos.
\ fsin fcos ftan library
\ amforth 4.0
\ Pito 23-9-2010
\ based on taylor and fsin fcos from 4tH library by J.L. Bezemer
\ needs Leon's flib (and Pito's asm flib v 1.1 for speed if
required)
\ needs Pito's float constants
Michael,
here is a little bit more precise function duration measurement tool
(FDMT):
\
***
\ Precise measurement of duration of a FUNCTION
\ Pito 17-9-2010
\ based on the idea on FUNCTION separation by Michael Kalus
\ Pito's 4 prim
Marcin,
> Dnia 16.09.2010 Matthias Trute napisał/a:
> >
> > btw: I'm still working on the marker issue. strange case
>
> Matthias,
>
> Reverting change 918 to istore_nrww.asm fixes the marker issue.
indeed. fixed. thank you.
Matthias
Dnia 16.09.2010 Matthias Trute napisał/a:
>
> btw: I'm still working on the marker issue. strange case
Matthias,
Reverting change 918 to istore_nrww.asm fixes the marker issue.
--Marcin
--
Start uncovering the man
Matthias,
if somebody may send to me the ready to run test cases for f* f/ f+
f-which runs in amforth, I will provide the results (e.g. I'am not
going to deal with uppercase words, as you know). Moreover, I cannot
write test cases as it might be an interest conflict then..
Btw, the marker is one o
Pito,
> Hi Leon and Matthias,
> enclosed pls find my little contribution to floating with amforth
Great work. Thank you.
> (:-)).
> The library is provided as-is, no guarantees and warrantees, no
> liability fo any direct, indirect, consequent damages or losses..
There is are test programs for
> But there is other Q I would like address - how to
> measure a word
> duration? Imagine to measure f/. So the loop might
> be:
Michael, to be more precise in what I like to address: how to
measure a "function" duration? P.
---
Michael, Thanks!! At least you have confirmed 3us, so my guess of
7us for an average amforth word is not so bad (:-)). I am using rtc
as well, however for these time measurements I use ticker (you may
see it somewhere in the post). I am thinking now to use 16bit
counter for the hw timer1 clocked by
Hi.
Am 16.09.2010 um 14:39 schrieb pito:
..
> PS: I am still thinking why the amforth overhead is so big?? It
> seems from my naive measurements a typical forth word takes ~7us
> plus minus.
> This is about 175 clock cycles @25MHz, or aprox 100 instructions -
> could it be so much? Just a stupid Q
Hi, the last one is f-. Even the amforth overhead compared to asm
float primitives is huge I did f- in asm too (all measurements
@25MHz):
> > test_empty_loop
> 4.0894465E-5 sec per empty loop operation ok
f- :
> test_sub_asm
4.0894465E-5 sec per fsub-asm operation ok
> _pi _pi f* _pi f- fs.
6.72
Hi, the f+ works as well:
> test_empty_loop
4.0894465E-5 sec per empty loop operation ok
> test_fadd_asm
4.194304E-5 sec per fadd-asm operation ok
> test_fmul_asm
4.5088768E-5 sec per fmul-asm operation ok
> test_fdiv_asm
6.6060295E-5 sec per fdiv-asm operation ok
> test_sub_forth_asm (f- as "fne
Hi, the f* routine (my template based) works now (a bug - I did not
care on R0,1 - where MULT puts results..), so Marcin may redo it
into amforth look, when required.
> : test_mul_asm timer-start 3 0 do _pi _ln2 f* drop drop loop
oktimer-stop 3 s>f f/ fs. ." sec per mul-asm operation" ;
o
As an example the f/ "__DIV" code has been generated by C compiler
from "c=a/b". So we may that way create any floating point-function
in few seconds. However, it is up to amforth community to agree the
integration standards. When the ___frutine will be hard coded to
certain amforth registers, the
I have uploaded the fdiv code (the one I got from Pito) integrated
into amforth here:
hg clone http://saper.info/hg/forth/fdiv/
It defines "f0", "fmin", "fmax" and "f/" words.
//Marcin
--
Start uncovering the many adv
Hi, Leon, Marcin and co.,
if somebody needs the fast word "f/" in asm (f* still not ready) I
recommend to use Marcin's one as mine is not amforth like one (I use
an template for educational purposes - the same as the template of
fuX I posted in the assembler discussion with a lot of stuff highly
u
HI,
thanks to Marcin, who had shown me again how the stack works, the f/
routine works within amforth as word f/. You may see the speed up
(amforth 4.0, new f/ v1. in asm, @25Mhz):
> : test_mul_forth timer-start 3 0 do _pi _ln2 f* drop drop
> loop
> oktimer-stop 3 s>f f/ fs. ." sec per mu
Hi Leon,
I am preparing two words - f/ and f* in asm. The results from
simulator are:
f_mul 190cycles, 7.6us @25MHz
f_div 735cycles, 29.4us @25MHz.
You may add a few usec for an overhead. The mul and div routines
works.
The words has been compiled with amforth already, however I still
have prob
Hi Leon,
> I've been working on a single precision floating point word set, and I
> recently got addition/subtraction working.
and a f* is already there :=))
Great work, Leon!! really!
Matthias
--
Sell apps to millio
On Sun, Jul 18, 2010 at 2:17 PM, Matthias Trute wrote:
>> PS: Any plans for amforth 32bit with float??
>
> Not currently. Maybe someone want to volonteer?
I've been working on a single precision floating point word set, and I
recently got addition/subtraction working. Everything is trivial after
27 matches
Mail list logo