I'd be wary about anything floating point. The 18F's don't have any hardware float processing capability, it's all software emulated, so accuracy, speed, etc are all less than spectacular.
If you can, I'd suggest re-writing and either bit-shifting it to integer math or simplyfying the results (less precision). Otherwise, I'd suggest the use of a coprocessor. We have a nice Python implementation using GUMSTIX. If you like, you can see more details on our website (
www.adambots.com , click on "Co-processor" ) or PM me.