Author Topic: Timings for fast median algo  (Read 1894 times)

guga

  • Member
  • *****
  • Posts: 1385
  • Assembly is a state of art.
    • RosAsm
Re: Timings for fast median algo
« Reply #45 on: July 27, 2020, 09:00:21 AM »
JJ. Does the adaptation you did to the algo works for negative limit as well ?

Ex..

  fsub arrInf.yMin   ; make positive
  fmul arrInf.yRange   ; normalise 0...99999

If the minimum limit is...say -1 and the max to 1 can this work too if i set those values ?
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

jj2007

  • Member
  • *****
  • Posts: 10919
  • Assembler is fun ;-)
    • MasmBasic
Re: Timings for fast median algo
« Reply #46 on: July 27, 2020, 05:43:26 PM »
If the minimum limit is...say -1 and the max to 1 can this work too if i set those values ?

Like this?

include \masm32\MasmBasic\MasmBasic.inc
  Init
  Dim MyArray() As REAL8        ; can be DWORD, REAL4, REAL8
  For_ ecx=0 To 9999999
        Rand(-1.0, 1.0, MyArray(ecx))   ; put random number into Real8 array
  Next
  PrintLine Str$("The elements:\t%i", MyArray(?))
  PrintLine Str$("The minimum:\t%f", MyArray(?min)v)
  PrintLine Str$("The maximum:\t%9f", MyArray(?max)v)
  PrintLine Str$("The mean:\t%9f", MyArray(?mean)v)
  PrintLine Str$("The median:\t%f", MyArray(?median)v)
EndOfCode


Code: [Select]
The elements:   10000000
The minimum:    -0.9999998
The maximum:    0.999999964
The mean:       -1.45892021e-05
The median:     6.515711e-05

guga

  • Member
  • *****
  • Posts: 1385
  • Assembly is a state of art.
    • RosAsm
Re: Timings for fast median algo
« Reply #47 on: July 27, 2020, 05:47:19 PM »
Yes. perfect. Testing it right now.  :greenclp: :greenclp:

Tks a lot. :thumbsup: :thumbsup: :thumbsup: :thumbsup:
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com