Click here to Skip to main content
16,011,428 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Good way to detect a useful portion of equivalent expressions Pin
Luc Pattyn18-Mar-11 7:09
sitebuilderLuc Pattyn18-Mar-11 7:09 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
_Erik_21-Mar-11 2:55
_Erik_21-Mar-11 2:55 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
molesworth18-Mar-11 4:40
molesworth18-Mar-11 4:40 
GeneralRe: Good way to detect a useful portion of equivalent expressions [modified] Pin
_Erik_18-Mar-11 4:44
_Erik_18-Mar-11 4:44 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
David198718-Mar-11 4:54
David198718-Mar-11 4:54 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
_Erik_18-Mar-11 5:24
_Erik_18-Mar-11 5:24 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
Matty221-Apr-11 1:51
Matty221-Apr-11 1:51 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
David19871-Apr-11 3:35
David19871-Apr-11 3:35 
I respectfully disagree. This will be part of an optimizing compiler. If the meteor decides to hit us after all then someone will have a nearly impossible to diagnose bug.
There are also large classes of expressions for which Eriks heuristic method does not work at all regardless of how many iterations it uses or require such a large number of iterations that it becomes impractical.
For example: (uint64)x / 3 and ((uint64)x * 0x5555556) >> 32 are the same for x in the interval 0..0x7FFFFFFF but not outside it. That gives a 0.5^k error probability where k is the number of iterations - which is fairly good, but if you combine a couple of those you can make the error probability arbitrarily high.
And I'm not even "cheating" with comparisons here - a single comparison against a constant can make the error probability arbitrarily high. They could be special-cased of course, but can the expressions above be special cased?
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
mbyamukama3-Apr-11 2:08
mbyamukama3-Apr-11 2:08 
GeneralRe: Good way to detect a useful portion of equivalent expressions [modified] Pin
David19873-Apr-11 2:35
David19873-Apr-11 2:35 
AnswerRe: Good way to detect a useful portion of equivalent expressions Pin
Alex Shtof9-Apr-11 10:47
Alex Shtof9-Apr-11 10:47 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
David19879-Apr-11 21:14
David19879-Apr-11 21:14 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
Alex Shtof11-Apr-11 9:06
Alex Shtof11-Apr-11 9:06 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
David198711-Apr-11 9:14
David198711-Apr-11 9:14 
AnswerRe: Good way to detect a useful portion of equivalent expressions Pin
dasblinkenlight11-Apr-11 9:21
dasblinkenlight11-Apr-11 9:21 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
David198711-Apr-11 18:50
David198711-Apr-11 18:50 
GeneralRe: Good way to detect a useful portion of equivalent expressions Pin
dasblinkenlight12-Apr-11 8:15
dasblinkenlight12-Apr-11 8:15 
Questionjava or C# , which better? Pin
Anwar Isaed9-Mar-11 23:12
Anwar Isaed9-Mar-11 23:12 
AnswerRe: java or C# , which better? Pin
Pravin Patil, Mumbai9-Mar-11 23:26
Pravin Patil, Mumbai9-Mar-11 23:26 
AnswerRe: java or C# , which better? Pin
RobCroll10-Mar-11 0:29
RobCroll10-Mar-11 0:29 
GeneralRe: java or C# , which better? Pin
David198710-Mar-11 2:15
David198710-Mar-11 2:15 
AnswerRe: java or C# , which better? Pin
Eddy Vluggen10-Mar-11 1:24
professionalEddy Vluggen10-Mar-11 1:24 
AnswerRe: java or C# , which better? Pin
riced10-Mar-11 3:12
riced10-Mar-11 3:12 
GeneralRe: java or C# , which better? Pin
Bernhard Hiller10-Mar-11 3:14
Bernhard Hiller10-Mar-11 3:14 
GeneralRe: java or C# , which better? Pin
riced10-Mar-11 3:31
riced10-Mar-11 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.