shishua | SHISHUA – The fastest PRNG in the world | Runtime Evironment library

 by   espadrine C Version: Current License: CC0-1.0

kandi X-RAY | shishua Summary

kandi X-RAY | shishua Summary

shishua is a C library typically used in Server, Runtime Evironment, Nodejs applications. shishua has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

The announcement and explanation blog post is here.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              shishua has a low active ecosystem.
              It has 153 star(s) with 13 fork(s). There are 14 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 3 open issues and 2 have been closed. On average issues are closed in 425 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of shishua is current.

            kandi-Quality Quality

              shishua has 0 bugs and 0 code smells.

            kandi-Security Security

              shishua has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              shishua code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              shishua is licensed under the CC0-1.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              shishua releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of shishua
            Get all kandi verified functions for this library.

            shishua Key Features

            No Key Features are available at this moment for shishua.

            shishua Examples and Code Snippets

            No Code Snippets are available at this moment for shishua.

            Community Discussions

            QUESTION

            Transform random integers into range [min,max] without branching
            Asked 2021-Jan-04 at 14:37

            I got hold on an SUPER-FAST algorithm that generates an array of random bytes, uniformly. It's 6 times faster than c++ uniform distribution and mersenne-twister of std library.

            The count of an array is divisible by 4, so it can be interpreted as array of integers. Casting each entry to an integer, produces values in the range [INT_MIN, INT_MAX]. But how can I transform these integer values to lie between my own [min, maximum]?

            I want to avoid any if-else, to avoid branching.

            Maybe I should apply some bitwise logic, to discard irrelevant bits in each number? (because all remaining, unmasked bits will be either 0 or 1 anyway). If I can extract the most significant bit in my maximum-value, I could mask any bits that are more significant than that one, in my integers.

            For example, if I want my max to be 17, then it is 00010001 in binary form. Maybe my mask would then look as 00011111? I could then apply it to all numbers in my array.

            But, this mask is wrong ...It actually allows values up to (1+2+4+8+16) :(

            What can I do? Also, how to take care of the min?

            Edit

            I am generating millions of numbers every frame of my application, for neural networks. I managed to vectorize the code using AXV2 for float variants (using this post), but need to get integers working too.

            ...

            ANSWER

            Answered 2021-Jan-04 at 13:34

            The core idea is to use modulo instead of bitwise masks, which are useless in non-power-of-2 case. No branching is also a bit weird requirement. What you want is "fast enough", not "no branching and bitwise masks".

            So assume that we have a function

            Source https://stackoverflow.com/questions/65561520

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install shishua

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/espadrine/shishua.git

          • CLI

            gh repo clone espadrine/shishua

          • sshUrl

            git@github.com:espadrine/shishua.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link