3 ms·
The Amiga manual suggests normalizing to a conjunctive normal form.
by meow_catrix 2y ago
The Amiga manual suggests normalizing to a conjunctive normal form.
- bcoates 2y agoThe constant-math method above doesn't require that and works on denormalized expressions, too. That said, the trick for turning four or more argument bitwise operations into a series of vpternlogd operations has yet to be posted
- LegionMammal978 2y agoSuppose you have four boolean variables A, B, C, and D. You can calculate X as the result from A, B, C assuming that D is false, and Y as the result assuming that D is true. Then, a third ternary operation can switch between X and Y depending on D. This creates a tree of 3 operations, which I suspect is the best you can do in the worst case. For five or more arguments, this naturally extends into a tree, though it likely isn't the most efficient encoding.