Search found 280 matches

by sean_vn
Feb 20, 2019 3:42
Forum: Sources, Examples, Tips and Tricks
Topic: Numerical optimizer
Replies: 25
Views: 5442

Re: Numerical optimizer

I was just starting to get back to coding after a break. This forum got very unfriendly very quick. Maybe Brexit is causing a general increase in grumpiness and a lack of movement. Maybe a chia seed and prune juice pudding would help? if not consult your doctor. While not an OAP like some of you guy...
by sean_vn
Feb 19, 2019 13:30
Forum: Sources, Examples, Tips and Tricks
Topic: Numerical optimizer
Replies: 25
Views: 5442

Re: Numerical optimizer

You can't expect people to maintain 2 systems and two compilers before they post some code. If you want to loosen up maybe the Dandy Warhols are a good band to listen to. Or is it roast beef, Yorkshire pudding and oxo every Sunday.
by sean_vn
Feb 19, 2019 6:45
Forum: Sources, Examples, Tips and Tricks
Topic: Numerical optimizer
Replies: 25
Views: 5442

Re: Numerical optimizer

I didn't put any work into it. Maybe this business between 32 and 64 bit systems again. Who knows. Anyway on my computer it does some mutations, sees if that makes an improvement, if not undoes. I need to decide an optimizer for something I'm doing. I'm not very happy with the code anyway, also I th...
by sean_vn
Feb 19, 2019 1:39
Forum: Sources, Examples, Tips and Tricks
Topic: Numerical optimizer
Replies: 25
Views: 5442

Numerical optimizer

function hash64(h as ulongint) as ulongint h = ( h xor ( h shr 30 ) ) * &hBF58476D1CE4E5B9 h = ( h xor ( h shr 27 ) ) * &h94D049BB133111EB return h xor ( h shr 31 ) end function type rnd256 as ulongint s0,s1,s2,s3 declare sub init() declare function next64() as ulongint declare function nex...
by sean_vn
Feb 19, 2019 1:26
Forum: Libraries & Headers
Topic: FFHT library (Walsh Hadamard transform)
Replies: 0
Views: 6084

FFHT library (Walsh Hadamard transform)

https://github.com/FALCONN-LIB/FFHT The code compiles to 2 objects. In linux you have to use ar to make a libwht.a static library from the objects. wht.bi file: #inclib "wht" declare sub fht_float alias "fht_float" (x as single ptr,ln2size as ulongint) declare sub fht_double ali...
by sean_vn
Feb 18, 2019 22:21
Forum: Community Discussion
Topic: Building FreeBASIC 1.06 Release
Replies: 46
Views: 12026

Re: Building FreeBASIC 1.06 Release

I am almost certain that this is due to libncurses/libtinfo library on my build system being different from the same named shared library on your system. I chose Ubuntu 14.04 as the build system because it's same as what is used on Travis-CI server (what checks the compiler build when we make pull ...
by sean_vn
Feb 18, 2019 14:35
Forum: Community Discussion
Topic: Building FreeBASIC 1.06 Release
Replies: 46
Views: 12026

Re: Building FreeBASIC 1.06 Release

I got this little bit of weirdness when compiling with 1.06 Linux 64 as just released: fbc -O 3 "RNG3.bas" (in directory: /initrd/mnt/dev_save/FB/code) fbc: Symbol `ospeed' has different size in shared object, consider re-linking Compilation finished successfully. The code still works fine.
by sean_vn
Feb 17, 2019 12:31
Forum: Linux
Topic: Two fbgfx bugs on Linux
Replies: 8
Views: 8367

Re: Two fbgfx bugs on Linux

I wasn't able to use FB for a while with Xenial Linux. I thought that was the end of it. However with the new ScPup64 Linux version the graphics are working again. Okay............
by sean_vn
Feb 03, 2019 13:58
Forum: General
Topic: RND breadth
Replies: 42
Views: 5640

Re: RND breadth

If the uniform random numbers fall on a line between 0 and 1 then you will get less than 0.5 (ie anywhere on the lower half) half the time, less than 0.1 (anywhere on the lower tenth) one over ten of the time, less than 0.01 one over a hundred of the time etc. If you want an equal probability of get...
by sean_vn
Jan 14, 2019 1:31
Forum: Game Dev
Topic: GOAP: A Basic AI Tutorial
Replies: 32
Views: 21009

Re: GOAP: A Basic AI Tutorial

Behavior trees are often used in more advanced games:
https://en.wikipedia.org/wiki/Behavior_ ... control%29
by sean_vn
Jan 14, 2019 1:27
Forum: Projects
Topic: glvideotexture_chung video to 3D openGL textures conversion
Replies: 6
Views: 2899

Re: glvideotexture_chung video to 3D openGL textures conversion

Very technically creative. Maybe you can explore genetic algorithms and neural networks a bit. If I remember correctly you did write some neural network code one time.
by sean_vn
Dec 27, 2018 3:01
Forum: Beginners
Topic: Optimization quirks
Replies: 6
Views: 1792

Re: Optimization quirks

There are no bugs in gcc. The bug is people assuming overflows etc are valid c code when they are not. The c compiler knows you will never overflow an integer operation, hence it can assume the carry flag is clear at the end of that operation. Should you do 2's complement arithmetic where overflows ...
by sean_vn
Nov 01, 2018 23:41
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 11366

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

Nice RNG algorithm. I must remember it. There is a 128 bit multiply in the AMD 64 instruction set that you can use for fixed point calculations. A random 64 bit number by (n+1) will give a result between 0 and n in the register that contains the high 64 bits of the 128 bit result. Not perfect but ge...
by sean_vn
Sep 27, 2018 13:23
Forum: General
Topic: SSE2: pand xmm3, 31?
Replies: 49
Views: 5262

Re: SSE2: pand xmm3, 31?

You can do a movd with an ordinary register

Code: Select all

mov eax,31
movd xmm0,eax
It's quite slow, about 20 clock cycle I think
by sean_vn
Sep 26, 2018 23:13
Forum: General
Topic: PRNGs randomness versus uniformity.
Replies: 8
Views: 1789

Re: PRNGs randomness versus uniformity.

The upper bits of a LCG where you use only every second value seems good for uniformity. I also have experimented with using the bswap instruction with LCG. If you generate permutations from a RNG the distribution of those permutations seems like a good test but of course only works on very small se...