Thingiverse
faster sqrt function for marlin in planner.ccp
von jamesvilleneuve
9
Downloads
21
Likes
0
Makes
float SqrtAprox(float number) {//low in fat
unsigned long i;
float x, y;
y = number;
i = * ( long * ) &y;
i = 0x5f375a86 - ( i >> 1 );
y = * ( float * ) &i;
return number * y;
}
This is an alternate planner.ccp file that has a faster sqrt calc function. I don't know if it really speeds up planner.ccp but it does increase the performance of a sqrt to complete by 300%.
read here for more info http://forums.reprap.org/read.php?147,219210
I read about several methods before hacking this one together. I do not claim where it comes from just that it was from researching different methods. several people are likely to credit as it is based of of the quake III engine hacks to speed up lighting calculations, and all i did was slim it down some and test its performance, then modified the planner.ccp file. it is still experimental and has some errors that are around up to 3.5% for integers. I'll play around with reducing those errors. this is ok for planner.ccp as it
unsigned long i;
float x, y;
y = number;
i = * ( long * ) &y;
i = 0x5f375a86 - ( i >> 1 );
y = * ( float * ) &i;
return number * y;
}
This is an alternate planner.ccp file that has a faster sqrt calc function. I don't know if it really speeds up planner.ccp but it does increase the performance of a sqrt to complete by 300%.
read here for more info http://forums.reprap.org/read.php?147,219210
I read about several methods before hacking this one together. I do not claim where it comes from just that it was from researching different methods. several people are likely to credit as it is based of of the quake III engine hacks to speed up lighting calculations, and all i did was slim it down some and test its performance, then modified the planner.ccp file. it is still experimental and has some errors that are around up to 3.5% for integers. I'll play around with reducing those errors. this is ok for planner.ccp as it
Hast du dieses Modell gedruckt? Einloggen und dein Make teilen!
Melde dich an, um einen Kommentar zu hinterlassen
AnmeldenNoch keine Kommentare – sei der Erste!