Author Topic: Rob's Lisp Adventures  (Read 15137 times)

0 Members and 5 Guests are viewing this topic.

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #45 on: May 07, 2015, 12:04:28 PM »
I calculated a general formula that does any Newton-Raphson given by Z^n=1

the iteration step is      Z'= Z-1/n[ Z - Z^(1-n)]     8)

Now , Freebasic and the Math module of Mr Jean Debord (as a DLL) will speed things up a lot.  While not slow, PLT Scheme is "only" a bytecode compiler with GNU Lightning JIT .

There is no complex calculus module for Oxygen ??

attached : a fifth power

.

Mike Lobanovsky

  • Guest
Re: Rob's Lisp Adventures
« Reply #46 on: May 07, 2015, 03:21:01 PM »
Wow! It gives me the creeps as if it were alive...  :o

Charles Pegge

  • Guest
Re: Rob's Lisp Adventures
« Reply #47 on: May 07, 2015, 10:18:21 PM »
Hi Rob,

I'm working on a complex library based on the Freebasic Math lib you posted some time ago:

Code: [Select]
  ' ******************************************************************
  ' Complex number library
  ' ------------------------------------------------------------------
  ' Based on ComplexMath Delphi library by E. F. Glynn
  ' http://www.efg2.com/Lab/Mathematics/Complex/index.html
  ' ******************************************************************

It is tied in with Oxygen's operator-overloading system, which I think needs to be implemented in direct code instead of function calls, to get the best performance for fractals.

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #48 on: May 08, 2015, 02:26:29 AM »
Hi Charles, Mike ,

The intention is to get something as attached Z³=1  ..  however commercial software is used and a 1600x1000 pix image needs around 2 hrs of calculations (March 2011).

The use of complex numbers may be preferable as the formulae grow rapidly in length (attached same zzz=1 and here on the right it even has to be split in a real and imag part  .. it would be possible (theoretically) to obtain these data from the complex formula and these data turned into code (Lisp/Scheme) can do this -- but this will take some time.

Yep, that's the lib , you got the pdf ??  (attached) ;;
the nice thing is that (unlike in many other systems) the operators are redefined they can take complex numbers directly.

like Z=Z*Z     

+ - * / ^ and = !=    are (forgot about < > etc ..  but these use the magnitude anyway which are real numbers.)

Writing such a ray tracer in oxygen , freebasic would be a real challenge (the maths behind it may not be that difficult)

best Rob

Ah, yes , for fun -- I also make pictures  (photography)  attached a work inspired on fractals  8)

.
« Last Edit: May 08, 2015, 02:41:04 AM by RobbeK »

RobbeK

  • Guest
Re: Rob's Lisp Adventures -- the Wheel in PLT Scheme
« Reply #49 on: July 24, 2015, 05:39:34 AM »
Hi all,

Found something "useful" considering the Wheel.
About twin primes (both p and p+2 are primes  ... like 11 and 13) ; iirc still not proven there are an infinite number of those twins.

The Wheel is fast - 1000000 number testing on a slow computer :
0.9 sec in newLISP  (script)
0.35 sec in PLT Scheme (bytecode and JIT)
0.015 sec in Steel Bank Common Lisp (native code)

-- & thanks again for SetWindowPos (it is used here)

best , Rob
(ah , yes Miller-Rabbin used for the primality test , but is seems Solovay-Volker-Strassen is faster (?) )




[attachment deleted by admin]