http://qs1969.pair.com?node_id=513396


in reply to Re^3: Speed/Efficiency tweaks for a fannkuch benchmark script?
in thread Speed/Efficiency tweaks for a fannkuch benchmark script?

It also fails for $n == 3, where the answers should be 231 and 312, each of which take 2 steps.

So just do || @$copy <= 3, one might say; and indeed that would give the right answers. But how do we know it would give the right answers, except by comparing the output with the unoptimized version? Is it possible to prove that this is safe?

Replies are listed 'Best First'.
Re^5: Speed/Efficiency tweaks for a fannkuch benchmark script?
by thundergnat (Deacon) on Dec 01, 2005 at 19:39 UTC

    Ah. Yes, ok I see your point now. I might be able to make a case for n being in the first position being safe to ignore, but how to prove when 1 is in the last...