- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Need to now the best performance of a prng on 100 Millions floating points numbers, generated with Intel C++ Compiler.
Prng algorithm: x=n*x+n*s+s*x-INT(n*x+n*s+s*x)
For more see:
Thanks
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll leave criticisms on technical grounds to those more expert on this subject. If you're asking about performance, either
n*(x+s)+s*x - int(n*(x+s)+s*x)
or
n*x+s*(n+x) - int(n*x+s*(n+x))
could prove faster with better control of roundoff (if you set /fp:source or similar option).
Do you capitalize INT to indicate use of an unspecified macro? Did you consider modf() ?
n*(x+s)+s*x - int(n*(x+s)+s*x)
or
n*x+s*(n+x) - int(n*x+s*(n+x))
could prove faster with better control of roundoff (if you set /fp:source or similar option).
Do you capitalize INT to indicate use of an unspecified macro? Did you consider modf() ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
I'll leave criticisms on technical grounds to those more expert on this subject. If you're asking about performance, either
n*(x+s)+s*x - int(n*(x+s)+s*x)
or
n*x+s*(n+x) - int(n*x+s*(n+x))
could prove faster with better control of roundoff (if you set /fp:source or similar option).
Do you capitalize INT to indicate use of an unspecified macro? Did you consider modf() ?
n*(x+s)+s*x - int(n*(x+s)+s*x)
or
n*x+s*(n+x) - int(n*x+s*(n+x))
could prove faster with better control of roundoff (if you set /fp:source or similar option).
Do you capitalize INT to indicate use of an unspecified macro? Did you consider modf() ?
I just want to now, if possible, the speed on Intel C++ Compiler, comparing to Intel Fortran (see: Floating Point prng on Intel Fortran for Linux and Mac forum):a small routine gives 100.000.000 in 1.3 sec.
I thing the algorithm n*x+n*s+s*x is faster thenn*(x+s)+s*x orn*x+s*(n+x), but??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - vermue
No, INT=int; floor; fractional part...
I just want to now, if possible, the speed on Intel C++ Compiler, comparing to Intel Fortran (see: Floating Point prng on Intel Fortran for Linux and Mac forum):a small routine gives 100.000.000 in 1.3 sec.
I thing the algorithm n*x+n*s+s*x is faster thenn*(x+s)+s*x orn*x+s*(n+x), but??
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page