7i / rand Goto Github PK
View Code? Open in Web Editor NEWGenerate random Complex128 numbers in the range (-2, -2i) to (2 - 2i)
License: Creative Commons Zero v1.0 Universal
Generate random Complex128 numbers in the range (-2, -2i) to (2 - 2i)
License: Creative Commons Zero v1.0 Universal
Hopefully using hexadecimal representation of AVX2 instructions should no longer be needed, as the following commit adds native support for such instruction to the Go assembler.
Complex128 can't generate more than 16 values before only creating (0+0i).
Reproduce with this code:
package main
import (
"fmt"
"github.com/7i/rand"
)
func main() {
r := rand.NewComplexRNG(2)
for i := 0; i < 20; i++ {
fmt.Println(r.Complex128())
}
}
Output:
(1.6865675300359726-0.7458155155181885i)
(0.6459241434931755-0.5123334154486656i)
(-1.1976671814918518+0.30174003168940544i)
(1.9891699776053429+1.2461936622858047i)
(-1.5661767162382603-0.7391329631209373i)
(-0.8398294821381569+1.1099664196372032i)
(0.7193359322845936-0.07182033360004425i)
(1.4429706782102585-1.6247142776846886i)
(0.15417367964982986+0.37837256491184235i)
(1.3701438084244728-1.0620558746159077i)
(1.7493415288627148+1.051068291068077i)
(1.8130390085279942-1.6751261875033379i)
(1.8191914111375809-1.451352346688509i)
(-1.3210551738739014+1.2325180806219578i)
(1.8622635416686535-1.717281986027956i)
(-0.17155596241354942-1.9850400798022747i)
(0+0i)
(0+0i)
(0+0i)
(0+0i)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.