Research Article
Detecting Floating-Point Expression Errors Based Improved PSO Algorithm
Algorithm 3
MaxError search based on CPSO.
Require: expression , | 1: Particles population_initialization() | 2: gBest getGlobalBest(particles) | 3: iter 0 | 4: whiledo | 5: for do | 6: vUpdate(particle) | 7: pUpdate(particle) | 8: updateLocalBest(particle) | 9: UpdateGlobalBest(particle) | 10: associatedParticles geneAssociatedParticles() | 11: end for | 12: for do | 13: ifthen | 14: gBest aParticle | 15: end if | 16: end for | 17: iter iter + 1 | 18: end while | 19: MaxError gBest.error | 20: x gBest.x | 21: MaxError, x |
|