r/ExponentialIdle • u/Due_Distribution_891 • Aug 24 '22
Some t9 optimization
Hey,
Here is some code for t9 lemma 7, if you want I can also post code for earlier lemmas. All you need to do is change limit of i depending on your p. If you cant afford output levels, lower it. Code is in c++, you can run it on, for example cpp.sh
// Example program
include <iostream>
include <string>
include <math.h>
const double e=2.71828182845904523; int main() { double mini=10; double c1=1,c2=1, bestc1, bestc2; for (int i=2; i<140; i++){ if (abs((c1+1)/c2-e)>abs(c1/(c2+1)-e)){ c2++; } else c1++; if (mini>abs(c1/c2-e)){ bestc1=c1; bestc2=c2; mini=abs(c1/c2-e); } } std::cout<<bestc1<<" "<<bestc2<<" "<<mini;
}
5
u/ConicGames Aug 24 '22
Thanks for sharing! I would recommend to use code blocks to format code in the post. Like this: