bc: remove tabs from internal library

function                                             old     new   delta
bc_lib                                              1877    1674    -203

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-12-05 00:35:49 +01:00
parent 51fb8aa5c1
commit 68cc0a676e

View File

@ -919,178 +919,178 @@ static const char bc_program_stdin_name[] = "<stdin>";
static const char *bc_lib_name = "gen/lib.bc"; static const char *bc_lib_name = "gen/lib.bc";
static const char bc_lib[] = { static const char bc_lib[] = {
"scale=20" "scale=20"
"\ndefine e(x){" "\n" "define e(x){"
"\n auto b,s,n,r,d,i,p,f,v" "\n" "auto b,s,n,r,d,i,p,f,v"
"\n b=ibase" "\n" "b=ibase"
"\n ibase=A" "\n" "ibase=A"
"\n if(x<0){" "\n" "if(x<0){"
"\n n=1" "\n" "n=1"
"\n x=-x" "\n" "x=-x"
"\n }" "\n" "}"
"\n s=scale" "\n" "s=scale"
"\n r=6+s+0.44*x" "\n" "r=6+s+0.44*x"
"\n scale=scale(x)+1" "\n" "scale=scale(x)+1"
"\n while(x>1){" "\n" "while(x>1){"
"\n d+=1" "\n" "d+=1"
"\n x/=2" "\n" "x/=2"
"\n scale+=1" "\n" "scale+=1"
"\n }" "\n" "}"
"\n scale=r" "\n" "scale=r"
"\n r=x+1" "\n" "r=x+1"
"\n p=x" "\n" "p=x"
"\n f=v=1" "\n" "f=v=1"
"\n for(i=2;v!=0;++i){" "\n" "for(i=2;v!=0;++i){"
"\n p*=x" "\n" "p*=x"
"\n f*=i" "\n" "f*=i"
"\n v=p/f" "\n" "v=p/f"
"\n r+=v" "\n" "r+=v"
"\n }" "\n" "}"
"\n while((d--)!=0)r*=r" "\n" "while((d--)!=0)r*=r"
"\n scale=s" "\n" "scale=s"
"\n ibase=b" "\n" "ibase=b"
"\n if(n!=0)return(1/r)" "\n" "if(n!=0)return(1/r)"
"\n return(r/1)" "\n" "return(r/1)"
"\n}" "\n" "}"
"\ndefine l(x){" "\n" "define l(x){"
"\n auto b,s,r,p,a,q,i,v" "\n" "auto b,s,r,p,a,q,i,v"
"\n b=ibase" "\n" "b=ibase"
"\n ibase=A" "\n" "ibase=A"
"\n if(x<=0){" "\n" "if(x<=0){"
"\n r=(1-10^scale)/1" "\n" "r=(1-10^scale)/1"
"\n ibase=b" "\n" "ibase=b"
"\n return(r)" "\n" "return(r)"
"\n }" "\n" "}"
"\n s=scale" "\n" "s=scale"
"\n scale+=6" "\n" "scale+=6"
"\n p=2" "\n" "p=2"
"\n while(x>=2){" "\n" "while(x>=2){"
"\n p*=2" "\n" "p*=2"
"\n x=sqrt(x)" "\n" "x=sqrt(x)"
"\n }" "\n" "}"
"\n while(x<=0.5){" "\n" "while(x<=0.5){"
"\n p*=2" "\n" "p*=2"
"\n x=sqrt(x)" "\n" "x=sqrt(x)"
"\n }" "\n" "}"
"\n r=a=(x-1)/(x+1)" "\n" "r=a=(x-1)/(x+1)"
"\n q=a*a" "\n" "q=a*a"
"\n v=1" "\n" "v=1"
"\n for(i=3;v!=0;i+=2){" "\n" "for(i=3;v!=0;i+=2){"
"\n a*=q" "\n" "a*=q"
"\n v=a/i" "\n" "v=a/i"
"\n r+=v" "\n" "r+=v"
"\n }" "\n" "}"
"\n r*=p" "\n" "r*=p"
"\n scale=s" "\n" "scale=s"
"\n ibase=b" "\n" "ibase=b"
"\n return(r/1)" "\n" "return(r/1)"
"\n}" "\n" "}"
"\ndefine s(x){" "\n" "define s(x){"
"\n auto b,s,r,n,a,q,i" "\n" "auto b,s,r,n,a,q,i"
"\n b=ibase" "\n" "b=ibase"
"\n ibase=A" "\n" "ibase=A"
"\n s=scale" "\n" "s=scale"
"\n scale=1.1*s+2" "\n" "scale=1.1*s+2"
"\n a=a(1)" "\n" "a=a(1)"
"\n if(x<0){" "\n" "if(x<0){"
"\n n=1" "\n" "n=1"
"\n x=-x" "\n" "x=-x"
"\n }" "\n" "}"
"\n scale=0" "\n" "scale=0"
"\n q=(x/a+2)/4" "\n" "q=(x/a+2)/4"
"\n x=x-4*q*a" "\n" "x=x-4*q*a"
"\n if(q%2!=0)x=-x" "\n" "if(q%2!=0)x=-x"
"\n scale=s+2" "\n" "scale=s+2"
"\n r=a=x" "\n" "r=a=x"
"\n q=-x*x" "\n" "q=-x*x"
"\n for(i=3;a!=0;i+=2){" "\n" "for(i=3;a!=0;i+=2){"
"\n a*=q/(i*(i-1))" "\n" "a*=q/(i*(i-1))"
"\n r+=a" "\n" "r+=a"
"\n }" "\n" "}"
"\n scale=s" "\n" "scale=s"
"\n ibase=b" "\n" "ibase=b"
"\n if(n!=0)return(-r/1)" "\n" "if(n!=0)return(-r/1)"
"\n return(r/1)" "\n" "return(r/1)"
"\n}" "\n" "}"
"\ndefine c(x){" "\n" "define c(x){"
"\n auto b,s" "\n" "auto b,s"
"\n b=ibase" "\n" "b=ibase"
"\n ibase=A" "\n" "ibase=A"
"\n s=scale" "\n" "s=scale"
"\n scale*=1.2" "\n" "scale*=1.2"
"\n x=s(2*a(1)+x)" "\n" "x=s(2*a(1)+x)"
"\n scale=s" "\n" "scale=s"
"\n ibase=b" "\n" "ibase=b"
"\n return(x/1)" "\n" "return(x/1)"
"\n}" "\n" "}"
"\ndefine a(x){" "\n" "define a(x){"
"\n auto b,s,r,n,a,m,t,f,i,u" "\n" "auto b,s,r,n,a,m,t,f,i,u"
"\n b=ibase" "\n" "b=ibase"
"\n ibase=A" "\n" "ibase=A"
"\n n=1" "\n" "n=1"
"\n if(x<0){" "\n" "if(x<0){"
"\n n=-1" "\n" "n=-1"
"\n x=-x" "\n" "x=-x"
"\n }" "\n" "}"
"\n if(x==1){" "\n" "if(x==1){"
"\n if(scale<65){" "\n" "if(scale<65){"
"\n return(.7853981633974483096156608458198757210492923498437764552437361480/n)" "\n" "return(.7853981633974483096156608458198757210492923498437764552437361480/n)"
"\n }" "\n" "}"
"\n }" "\n" "}"
"\n if(x==.2){" "\n" "if(x==.2){"
"\n if(scale<65){" "\n" "if(scale<65){"
"\n return(.1973955598498807583700497651947902934475851037878521015176889402/n)" "\n" "return(.1973955598498807583700497651947902934475851037878521015176889402/n)"
"\n }" "\n" "}"
"\n }" "\n" "}"
"\n s=scale" "\n" "s=scale"
"\n if(x>.2){" "\n" "if(x>.2){"
"\n scale+=5" "\n" "scale+=5"
"\n a=a(.2)" "\n" "a=a(.2)"
"\n }" "\n" "}"
"\n scale=s+3" "\n" "scale=s+3"
"\n while(x>.2){" "\n" "while(x>.2){"
"\n m+=1" "\n" "m+=1"
"\n x=(x-.2)/(1+.2*x)" "\n" "x=(x-.2)/(1+.2*x)"
"\n }" "\n" "}"
"\n r=u=x" "\n" "r=u=x"
"\n f=-x*x" "\n" "f=-x*x"
"\n t=1" "\n" "t=1"
"\n for(i=3;t!=0;i+=2){" "\n" "for(i=3;t!=0;i+=2){"
"\n u*=f" "\n" "u*=f"
"\n t=u/i" "\n" "t=u/i"
"\n r+=t" "\n" "r+=t"
"\n }" "\n" "}"
"\n scale=s" "\n" "scale=s"
"\n ibase=b" "\n" "ibase=b"
"\n return((m*a+r)/n)" "\n" "return((m*a+r)/n)"
"\n}" "\n" "}"
"\ndefine j(n,x){" "\n" "define j(n,x){"
"\n auto b,s,o,a,i,v,f" "\n" "auto b,s,o,a,i,v,f"
"\n b=ibase" "\n" "b=ibase"
"\n ibase=A" "\n" "ibase=A"
"\n s=scale" "\n" "s=scale"
"\n scale=0" "\n" "scale=0"
"\n n/=1" "\n" "n/=1"
"\n if(n<0){" "\n" "if(n<0){"
"\n n=-n" "\n" "n=-n"
"\n if(n%2==1)o=1" "\n" "if(n%2==1)o=1"
"\n }" "\n" "}"
"\n a=1" "\n" "a=1"
"\n for(i=2;i<=n;++i)a*=i" "\n" "for(i=2;i<=n;++i)a*=i"
"\n scale=1.5*s" "\n" "scale=1.5*s"
"\n a=(x^n)/2^n/a" "\n" "a=(x^n)/2^n/a"
"\n r=v=1" "\n" "r=v=1"
"\n f=-x*x/4" "\n" "f=-x*x/4"
"\n scale=scale+length(a)-scale(a)" "\n" "scale=scale+length(a)-scale(a)"
"\n for(i=1;v!=0;++i){" "\n" "for(i=1;v!=0;++i){"
"\n v=v*f/i/(n+i)" "\n" "v=v*f/i/(n+i)"
"\n r+=v" "\n" "r+=v"
"\n }" "\n" "}"
"\n scale=s" "\n" "scale=s"
"\n ibase=b" "\n" "ibase=b"
"\n if(o!=0)a=-a" "\n" "if(o!=0)a=-a"
"\n return(a*r/1)" "\n" "return(a*r/1)"
"\n}" "\n" "}"
}; };
#endif // ENABLE_BC #endif // ENABLE_BC