How do i make this php math script "faster"?

Hi,

i have this webpage i coded from scratch and learning it online
http://sgmarketwatch.com/sgstockcalculator.php

right now, all the math function is in php
how do i make it calculate without delay ? i think its having a delay due to the post method of the form

I could change all the math function to a javascript and that would work
but i do not want anyone to copy the math code

what can i do ?

appreciate the help
Thanks

the better way is to compress your coding… and always using looping and arrays for match if possible

change it to Javascript and obfuscate the code using something like http://javascriptobfuscator.com/default.aspx