https://github.com/rokerhro/xrm
XOR, (Bit-)Rotate, Multiply
https://github.com/rokerhro/xrm
mathematical-functions nerd riddle
Last synced: 9 months ago
JSON representation
XOR, (Bit-)Rotate, Multiply
- Host: GitHub
- URL: https://github.com/rokerhro/xrm
- Owner: RokerHRO
- License: mit
- Created: 2019-06-04T10:01:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-04T10:14:17.000Z (about 7 years ago)
- Last Synced: 2024-10-19T13:58:40.140Z (over 1 year ago)
- Topics: mathematical-functions, nerd, riddle
- Language: C++
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XOR, Rotate, Multiply
I'm looking for 6 parameters X1, X2, R1, R2, M1, M2 so that the nested function call is equivalent to addition:
```c++
// C++:
#include "xrm_template.cc"
XRM xrm1;
XRM xrm2;
ASSERT_TRUE( xrm1(xrm2(u)) == u+1 ); // for all u from 0 … 2⁶⁴-1
```