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


Groups > comp.programming > #11814

Re: Fast randomizer

From Tavis Ormandy <taviso@gmail.com>
Newsgroups comp.programming
Subject Re: Fast randomizer
Date 2021-01-17 21:11 +0000
Message-ID <i6jnghF2s7kU1@mid.individual.net> (permalink)
References <4d7dea01-65a4-422e-84ba-ad54b9d09615n@googlegroups.com>

Show all headers | View raw


On 2021-01-17, H e <he12457@hotmail.com> wrote:
> Anybody knows why Javascript Math.random() is so slow?
> Am the only one, who thinks, that it can be as fast as a computer screen?
>

Which implementation? As far as I know, all major implementations use
xorshift128+, which is very fast with a very impressive period,
2^128-1. It is just a dozen or so machine instructions on a 64bit
machine.

You can read about it here: http://vigna.di.unimi.it/ftp/papers/xorshiftplus.pdf

> It will be the next a10. Function will remember a2,...,a10. Next
> polynom takes as last polynom multiplier new time produced digit.

I would suggest implementing your scheme and see if it passes the
Diehard test suite. If it does, then see if you can benchmark better
than something from the xorshift family with a similar period.

(I really think that is a tall order though)

https://en.wikipedia.org/wiki/Diehard_tests

Tavis.

-- 
 _o)            $ lynx lock.cmpxchg8b.com
 /\\  _o)  _o)  $ finger taviso@sdf.org
_\_V _( ) _( )  @taviso

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Fast randomizer H e <he12457@hotmail.com> - 2021-01-17 12:59 -0800
  Re: Fast randomizer Tavis Ormandy <taviso@gmail.com> - 2021-01-17 21:11 +0000
    Re: Fast randomizer H e <he12457@hotmail.com> - 2021-01-17 13:26 -0800
      Re: Fast randomizer H e <he12457@hotmail.com> - 2021-01-17 14:01 -0800
      Re: Fast randomizer H e <he12457@hotmail.com> - 2021-01-17 14:13 -0800
        Re: Fast randomizer David Brown <david.brown@hesbynett.no> - 2021-01-18 00:09 +0100
          Re: Fast randomizer H e <he12457@hotmail.com> - 2021-01-17 16:53 -0800
            Re: Fast randomizer Richard Heathfield <rjh@cpax.org.uk> - 2021-01-18 07:30 +0000
              Re: Fast randomizer David Brown <david.brown@hesbynett.no> - 2021-01-18 08:55 +0100
                Re: Fast randomizer Richard Heathfield <rjh@cpax.org.uk> - 2021-01-18 08:05 +0000
            Re: Fast randomizer David Brown <david.brown@hesbynett.no> - 2021-01-18 08:47 +0100
              Re: Fast randomizer H e <he12457@hotmail.com> - 2021-01-18 03:08 -0800
                Re: Fast randomizer H e <he12457@hotmail.com> - 2021-01-18 03:18 -0800
                Re: Fast randomizer David Brown <david.brown@hesbynett.no> - 2021-01-18 12:19 +0100
                Re: Fast randomizer Julio Di Egidio <julio@diegidio.name> - 2022-01-05 02:56 -0800
                Re: Fast randomizer Richard Heathfield <rjh@cpax.org.uk> - 2022-01-05 11:27 +0000
                Re: Fast randomizer David Brown <david.brown@hesbynett.no> - 2022-01-05 16:00 +0100
                Re: Fast randomizer Richard Heathfield <rjh@cpax.org.uk> - 2022-01-05 16:35 +0000
                Re: Fast randomizer Julio Di Egidio <julio@diegidio.name> - 2022-01-05 14:23 -0800
                Re: Fast randomizer David Brown <david.brown@hesbynett.no> - 2022-01-05 23:36 +0100
                Re: Fast randomizer Julio Di Egidio <julio@diegidio.name> - 2022-01-05 14:41 -0800
                Re: Fast randomizer Richard Heathfield <rjh@cpax.org.uk> - 2022-01-06 00:32 +0000
                Re: Fast randomizer Julio Di Egidio <julio@diegidio.name> - 2022-01-06 01:21 -0800
                Re: Fast randomizer Richard Heathfield <rjh@cpax.org.uk> - 2022-01-06 09:38 +0000
                Re: Fast randomizer Julio Di Egidio <julio@diegidio.name> - 2022-01-06 01:48 -0800
                Re: Fast randomizer Richard Heathfield <rjh@cpax.org.uk> - 2022-01-06 00:24 +0000
    Re: Fast randomizer Härra Ramob <ya12983@mail.com> - 2022-01-05 00:39 -0800

csiph-web