Not a real suggestion, but: assuming we could generate arbitrary algorithms, we could always just go through a list of them and ask if that one is the fastest, then implement it.

Though I'd be hard pressed to think of a slower method of doing things.