Division by zero Optimization
- To: mathgroup at smc.vnet.net
- Subject: [mg110949] Division by zero Optimization
- From: Luis <lgmendes at gmail.com>
- Date: Tue, 13 Jul 2010 05:27:31 -0400 (EDT)
Dear all, In order to avoid division by zero I have write the flowing simply code : divideWithThreoshold[ai_,bi_]:= If[bi<0.1,0,ai/bi] ; DivideWithThreoshold[a_,b_]:= MapThread[divideWithThreoshold,{a,b}] Since I have to apply this operation to very large lists, can give me some suggestion how to optimize this code? Any other optimize way to do this task? All my best, Luis