
var dcsp=10;var histm=10;var ft=15;var an=0;var ntype=0;var brktid=0;var hst1='';var sd="09azAZ";var ze=sd.charCodeAt(0);var ni=sd.charCodeAt(1);var aa=sd.charCodeAt(2);var za=sd.charCodeAt(3);var Aa=sd.charCodeAt(4);var Za=sd.charCodeAt(5);var i=0;var cstf=[];var st='';var ec=-2;var en=573;var er='';var ep=-1;var hist='';var histv=[]
var histp=0;var t1=0;var t2=0;function fs(a,b,c)
{var hs=""
if(ep==-1)
{if(b==0)
hs+="<i class=\"o\" style=\"font-size:"+c+"px\" >"+a+"<\/i>"
else if(b==1)
hs+="<i class=\"n\" style=\"font-size:"+c+"px\" >"+a+"<\/i>"
else if(b==2)
hs+="<i class=\"f\" style=\"font-size:"+c+"px\" >"+a+"<\/i>"
else if(b==3)
hs+="<i class=\"b\" style=\"font-size:"+c+"px\" >"+a+"<\/i>"
else if(b==4)
hs+="<i class=\"e\"  style=\"font-size:"+c+"px\" >"+a+"<\/i>"
else if(b==5)
hs+='<i class=\"b\"'+a;}else
{if(b==5)
hs+='<i class=\"e\"'+a;else
hs+="<i class=\"e\"  style=\"font-size:"+c+"px\" >"+a+"<\/i>"}
return hs;}
function addset(str)
{set.push('');var j=0;var f=0;while((j<set.length)&&(f!=1))
{if(str.length>=set[j].length)
{var a=j;var tt2=set[j];var tt1='';while((j<set.length)&&(tt2!=''))
{tt1=set[j+1];set[j+1]=tt2;tt2=tt1;j++;}
f=1;set[a]=str;}else j++;}
j=0;f=0;var ca=str.charAt(0);while((j<fst.length)&&(f==0))
{if(fst[j]==ca)
f=1;else j++;}
if(f==0)
fst.push(ca);if(mx<str.length)
mx=str.length}
function remset(str)
{var j=0;var f=0;while((j<set.length)&&(f!=1))
{if(str==set[j])
{var l=set.length-1;while(j<l)
{set[j]=set[j+1];j++;}
f=1;set.pop();}else j++;}
ca=str.charAt(0);j=0;f=0;while((j<set.length)&&(f==0))
{if(set[j].charAt(0)==ca)
f=1;else
j++;}
if(f==0)
{j=0;while((j<fst.length)&&(f!=1))
{if(ca==fst[j])
{var l=fst.length-1;while(j<l)
{fst[j]=fst[j+1];j++;}
f=1;fst.pop();}else j++;}}
mx=set[0].length;}
function san(a)
{an=a;}
function getcstf(a,b)
{var j=0;var f=0;while((j<cstf.length)&&(f==0))
{if(cstf[j][0]==a)
{if((b==-1)&&(cstf[j][1]==-1))
f=1;else if((cstf[j][1]!=-1)&&(b!=-1))
f=1;else j++;}
else
j++;}
if(f==0)
return-1;else
return j;}
function getfst(ca)
{var j=0;var f=0;while((j<fst.length)&&(f!=1))
{if(ca==fst[j])
f=1;else
j++;}
return f;}
function getst()
{var str=''
var rt='';var j=0;var l=set.length;var f=0;if((st.length-i)>mx)
str=st.substring(i,(i+mx));else
str=st.substring(i,st.length);while((j<l)&&(f!=1))
{var tp=str.substring(0,set[j].length);if(tp==set[j])
{f=1;rt=set[j];}
else
j++;}
return rt;}
function ag(a,b)
{var rt=0.0;if(b==0)
{if(an==0)
rt=a*Math.PI/180;else if(an==1)
rt=a;else if(an==2)
rt=Math.atan(a);}else if(b==1)
{if(an==0)
rt=a*180/Math.PI;else if(an==1)
rt=a;else if(an==2)
rt=sinm(a)/cosm(a);}
return fixit(rt);}
function fc(n1)
{var rt=1
var ts=parseInt(n1)
if(ts<0)
{rt=-1;ts=ts*(-1);}
while(ts>0)
{rt=rt*ts;ts--;}
return fixit(rt);}
function gcds(a,b)
{if((a%b)==0)
return b;else return gcds(b,(a%b));}
function fl(ic)
{var sg=1.0;var rt=0.0;while((st.charAt(i)=='+')||(st.charAt(i)=='-'))
{if(st.charAt(i)=='-')
sg=sg*(-1.0);i++;}
var ac=st.charCodeAt(i)
var ca=st.charAt(i)
if(ca=='(')
{i++;rt=ev(')');}else if(((ac>=ze)&&(ac<=ni))||(ca=='.')){var str='';while((st.charCodeAt(i)>=ze)&&(st.charCodeAt(i)<=ni))
{str+=''+st.charAt(i);i++;}
if(st.charAt(i)=='.')
{str+=''+'.';i++;}
while((st.charCodeAt(i)>=ze)&&(st.charCodeAt(i)<=ni))
{str+=''+st.charAt(i);i++;}
if((st.charAt(i)=='e')&&((st.charAt(i+1)=='+')||(st.charAt(i+1)=='-')))
{str+=''+st.charAt(i)+st.charAt(i+1);i=i+2;while((st.charCodeAt(i)>=ze)&&(st.charCodeAt(i)<=ni))
{str+=''+st.charAt(i);i++;}}
rt=parseFloat(str);if(st.charAt(i)=='.')
re(i,"syntax error");}else
rt=gf(getst());if((ic&8)!=8)
if(st.charAt(i)=='!')
{if(rt<0)
re(i,"factorial of negative number");else if(parseInt(rt)!=rt)
re(i,"factorial of decimal number");else
rt=fc(rt);i++;}else if(st.charAt(i)=='%')
{i++
rt=rt/100;}
ca=getst();if((ic&4)!=4)
{if(ca=='C')
{var j=i;i++;var ts=fl(3)
if((ts<0)||(rt<0)||(ts>rt))
re(j,"for xCy, x should be greater than y, and they should both be positive");else
if((parseInt(rt)!=rt)||(parseInt(ts)!=ts))
re(j,"combination of decimal number");else
rt=fc(rt)/(fc(rt-ts)*fc(ts));}else if(ca=='P')
{var j=i;i++;var ts=fl(3)
if((ts<0)||(rt<0)||(ts>rt))
re(j,"for xPy, x should be greater than y, and they should both be positive");else if((parseInt(rt)!=rt)||(parseInt(ts)!=ts))
re(j,"permutation of decimal number");else
rt=fc(rt)/fc(rt-ts);}
else if(ca=='mod')
{var j=i;i=i+3;var ts=fl(3);if((ts<=0)||(rt<0))
re(j,"mod of negative number");else if((parseInt(rt)!=rt)||(parseInt(ts)!=ts))
re(j,"mod of decimal number");else
rt=rt%ts;}}
ac=st.charCodeAt(i)
ca=st.charAt(i)
if((ic&2)!=2)
if(((ac>=ze)&&(ca<=ni))||(ca=='(')||(ca=='.')||(getfst(ca)==1))
{rt=rt*fl(0);}
if((ic&1)!=1)
while(st.charAt(i)=='^')
{var j=i;i++;rt=Math.pow(rt,fl(1));if(isNaN(rt))
re(j,"answer is not a real number");}
return fixit(rt*sg);}
function ev(ed)
{var rt=0.0;var s1=1.0;var s3=0.0;var ac=0;var ca="";while((i<st.length)&&(st.charAt(i)!=ed)&&(st.charAt(i)!=','))
{ac=st.charCodeAt(i);ca=st.charAt(i);if(((ac>=ze)&&(ac<=ni))||(ca=='(')||(ca=='.')||(getfst(ca)==1))
{s3=fl(0)*s1;s1=1.0;}else if(ca=='-')
{rt=rt+s3;s1=s1*(-1)
s3=0.0;i++;}else if(ca=='+')
{rt=rt+s3;s3=0.0;i++;}else if(ca=='*')
{i++;s3=s3*fl(0);}else if(ca=='/')
{var j=i;i++;var ts=fl(0);if(ts==0.0)
re(j,'division by zero');else
s3=s3/ts;}else i++}
if(st.charAt(i)==ed)
i++
rt+=s3;return fixit(rt);}
function flc(ic)
{var sg=1.0;var rt=[0.0,0.0];while((st.charAt(i)=='+')||(st.charAt(i)=='-'))
{if(st.charAt(i)=='-')
sg=sg*(-1.0)
i++;}
var ac=st.charCodeAt(i)
var ca=st.charAt(i)
if(((ac>=ze)&&(ac<=ni))||(ca=='.'))
{var str='';while((st.charCodeAt(i)>=ze)&&(st.charCodeAt(i)<=ni))
{str+=''+st.charAt(i);i++;}
if(st.charAt(i)=='.')
{str+=''+'.';i++;}
while((st.charCodeAt(i)>=ze)&&(st.charCodeAt(i)<=ni))
{str+=''+st.charAt(i);i++;}
if((st.charAt(i)=='e')&&((st.charAt(i+1)=='+')||(st.charAt(i+1)=='-')))
{str+=''+st.charAt(i)+st.charAt(i+1);i=i+2;while((st.charCodeAt(i)>=ze)&&(st.charCodeAt(i)<=ni))
{str+=''+st.charAt(i);i++;}}
rt[0]=parseFloat(str);if(st.charAt(i)=='.')
re(i,"syntax error");}else if(ca=='(')
{i++;rt=evc(')');}else
rt=gfc(getst());if((ic&8)!=8)
if(st.charAt(i)=='!')
{if(rt[0]<0)
re(i,"factorial of negative number");else if((parseInt(rt[0])!=rt[0])||(rt[1]!=0))
re(i,"factorial of decimal number");else
rt[0]=fc(rt[0]);i++;}else if(st.charAt(i)=='%')
{i++;rt[0]=rt[0]/100;rt[1]=rt[1]/100;}
ca=getst();if((ic&4)!=4)
{if(ca=='C')
{var j=i;i++;var ts=flc(3);if((parseInt(rt[0])!=rt[0])||(parseInt(ts[0])!=ts[0])||(ts[1]!=0)||(rt[1]!=0))
re(j,"combination of decimal number or complex number");else
if((ts[0]<0)||(rt[0]<0)||(ts[0]>rt[0]))
re(j,"for xCy, x should be greater than y, and they should both be positive");else
rt[0]=fc(rt[0])/(fc(rt[0]-ts[0])*fc(ts[0]));}else if(ca=='P')
{var j=i;i++;var ts=flc(3);if((parseInt(rt[0])!=rt[0])||(parseInt(ts[0])!=ts[0])||(ts[1]!=0)||(rt[1]!=0))
re(j,"permutation of decimal number or complex number");else
if((ts[0]<0)||(rt[0]<0)||(ts[0]>rt[0]))
re(j,"for xPy, x should be greater than y, and they should both be positive");else
rt[0]=fc(rt[0])/fc(rt[0]-ts[0]);}else if(ca=='mod')
{var j=i;i=i+3;var ts=flc(3);if((ts[0]<=0)||(rt[0]<0))
re(j,"mod of negative number");else if((parseInt(rt[0])!=rt[0])||(parseInt(ts[0])!=ts[0])||(ts[1]!=0)||(rt[1]!=0))
re(j,"mod of decimal or complex number");else
rt[0]=rt[0]%ts[0];}}
ac=st.charCodeAt(i)
ca=st.charAt(i)
if((ic&2)!=2)
if(((ac>=ze)&&(ca<=ni))||(ca=='(')||(ca=='.')||(getfst(ca)==1))
{rt=mulc(rt,flc(0));}
if((ic&1)!=1)
while(st.charAt(i)=='^')
{i++;var ts=flc(1);if((rt[0]!=0)||(rt[1]!=0))
{var na=an;an=1
if((parseInt(ts[0])==ts[0])&&(ts[1]==0))
{var tp=[0,0];var M=Math.abs(ts[0])
var a=0;var b=M;while(a<=M)
{if((a%4)==0)
tp[0]+=(fc(M)/(fc(M-a)*fc(a)))*Math.pow(rt[0],b)*Math.pow(rt[1],a);else if(((a+1)%4)==0)
tp[1]+=-(fc(M)/(fc(M-a)*fc(a)))*Math.pow(rt[0],b)*Math.pow(rt[1],a);else if(((a+2)%4)==0)
tp[0]+=-(fc(M)/(fc(M-a)*fc(a)))*Math.pow(rt[0],b)*Math.pow(rt[1],a);else if(((a+3)%4)==0)
tp[1]+=(fc(M)/(fc(M-a)*fc(a)))*Math.pow(rt[0],b)*Math.pow(rt[1],a);b--;a++;}
if(ts[0]<0)
{rt[0]=1;rt[1]=0;rt=divc(rt,tp);}else
rt=tp;}
else
{var A=(Math.pow(mag(rt),ts[0])/Math.pow(Math.E,(ts[1]*arg(rt))));var B=(ts[0]*arg(rt))+(ts[1]*Math.log(mag(rt)));rt[0]=A*cosm(ag(B,0));rt[1]=A*sinm(ag(B,0));}
an=na;}}
rt[0]=fixit(rt[0]*sg);rt[1]=fixit(rt[1]*sg);return rt;}
function evc(ed)
{var rt=[0.0,0.0]
var s1=1.0;var s3=[0.0,0.0];var ac=0;var ca=''
while((i<st.length)&&(st.charAt(i)!=ed)&&(st.charAt(i)!=','))
{ac=st.charCodeAt(i);ca=st.charAt(i);if(((ac>=ze)&&(ac<=ni))||(ca=='(')||(ca=='.')||(getfst(ca)==1))
{s3=flc(0);s3[0]=s3[0]*s1;s3[1]=s3[1]*s1
s1=1.0;}else
if(ca=='-')
{rt=addc(rt,s3);s1=s1*(-1)
s3=[0.0,0.0];i++;}else if(ca=='+')
{rt=addc(rt,s3);s3=[0.0,0.0];i++;}else if(ca=='*')
{i++;s3=mulc(s3,flc(0));}else if(ca=='/')
{var j=i;i++;var ts=flc(0);if((ts[0]==0.0)&&(ts[1]==0.0))
{re(j,'division by zero');}else
s3=divc(s3,ts);}
else
i++;}
if(st.charAt(i)==ed)
i++
rt=addc(rt,s3)
rt[0]=fixit(rt[0])
rt[1]=fixit(rt[1])
return rt;}
function gf(a)
{var rt=0;if(a=='E')
{rt=Math.E;i++;}else if(a=='pi')
{rt=Math.PI;i=i+2;}else if(a=='log')
{var j=i;i=i+3;i++;var ts=ev(']');if(ts==0)
re(j,"Cannot compute log base 0");else if(ts==1)
re(j,"Cannot compute log base 1");else
{rt=fl(15);if(rt==0)
re(j,"Value of log too large");else
rt=Math.log(rt)/Math.log(ts);if(isNaN(rt))
re(j,"answer is not a real number");}}else if(a=='ln')
{var j=i;i=i+2;var ts=fl(15);if(ts==0)
re(j,"Cannot compute log of zero");else{rt=Math.log(ts);if((rt)||(rt==0))
{}else
re(j,"Cannot compute log");}}else if(a=='rt')
{var j=i;i=i+3;var ts=ev(']')
if(ts==0)
re(j,"Cannot compute root zero");else
rt=Math.pow(fl(15),(1/ts));if(isNaN(rt))
re(j,"answer is not a real number");}else if(a=='sqrt')
{var j=i;i=i+4;rt=Math.pow(fl(15),(1/2));if(isNaN(rt))
re(j,"answer is not a real number");}else if(a=='cbrt')
{var j=i;i=i+4;rt=Math.pow(fl(15),(1/3));if(isNaN(rt))
re(j,"answer is not a real number");}
else if(a=='sin')
{i=i+3;rt=ag(fl(15),0);rt=sinm(rt);}else if(a=='cos')
{i=i+3;rt=ag(fl(15),0);rt=cosm(rt);}else if(a=='tan')
{var j=i;i=i+3;rt=ag(fl(15),0);if((rt%Math.PI)==0)
rt=0;else
if(((rt+(Math.PI/2))%Math.PI)==0)
re(j,"value of tan too large");else
rt=sinm(rt)/cosm(rt);}else if(a=='asin')
{var j=i;i=i+4;rt=fl(15);if((rt>1)||(rt<(-1)))
re(j,"cannot compute asin(x) if |x|>1");else
rt=ag(Math.asin(rt),1);}else if(a=='acos')
{var j=i;i=i+4;rt=fl(15);if((rt>1)||(rt<(-1)))
re(j,"Cannot compute acos(x) if |x|>1 ");else
rt=ag(Math.acos(rt),1);}else if(a=='atan')
{var j=i;i=i+4;rt=fl(15);rt=ag(Math.atan(rt),1);}else if(a=='lcm')
{var j=i;i=i+4;rt=ev(')');var ts=0;while(st.charAt(i)==',')
{i++;ts=ev(')');if((ts<0)||(rt<0))
re(j,"Cannot compute lcm for numbers less than zero");else if((parseInt(ts)!=ts)||(parseInt(rt)!=rt))
re(j,"Cannot compute lcm decimal numbers");else
{if((rt==0)||(ts==0))
{rt=0;}else
{rt=(rt*ts)/gcds(rt,ts);}}}}else if(a=='gcd')
{var j=i;i=i+4;rt=ev(')');var ts=0;while(st.charAt(i)==',')
{i++;ts=ev(')');if((ts<0)||(rt<0))
re(j,"Cannot compute gcd for numbers less than zero");else if((parseInt(ts)!=ts)||(parseInt(rt)!=rt))
re(j,"Cannot compute gcd decimal numbers");else{if(ts==0)
rt=rt;else if(rt==0)
rt=ts;else
rt=gcds(rt,ts);}}}else
if(a=='abs')
{i=i+3;rt=Math.abs(fl(15));}else if(a=='sinh')
{i=i+4;rt=fl(15);rt=(Math.pow(Math.E,rt)-Math.pow(Math.E,-rt))/2;}else if(a=='cosh')
{i=i+4;rt=fl(15);rt=(Math.pow(Math.E,rt)+Math.pow(Math.E,-rt))/2;}else if(a=='tanh')
{i=i+4;rt=fl(15);rt=(Math.pow(Math.E,rt)-Math.pow(Math.E,-rt))/(Math.pow(Math.E,rt)+Math.pow(Math.E,-rt));}else if(a=='asinh')
{i=i+5;rt=fl(15);rt=Math.log(rt+(Math.sqrt(Math.pow(rt,2)+1)));}else if(a=='acosh')
{var j=i;i=i+5;rt=fl(15);if(Math.abs(rt)<1)
re(j,"Cannot compute acosh(x) if |x| is less than 1 ");else
rt=Math.log(rt+(Math.sqrt(Math.pow(rt,2)-1)));}else if(a=='atanh')
{var j=i;i=i+5;rt=fl(15);if(Math.abs(rt)>=1)
re(j,"Cannot compute atanh(x) if |x| is greater than or equal to 1");else
rt=(1/2)*Math.log((1+rt)/(1-rt));}else if(a=='cosec')
{var j=i;i=i+5;var ts=fl(15);var p=i;var q=st;i=0;st="sin"+ts;rt=ev('~');st=q;i=p;if(rt==0)
re(j,"value of cosec too large");else
rt=1/rt;}else if(a=='sec')
{var j=i;i=i+3;var ts=fl(15);var p=i;var q=st;i=0;st="cos"+ts;rt=ev('~');st=q;i=p;if(rt==0)
re(j,"value of sec too large");else
rt=1/rt;}else if(a=='cot')
{var j=i;i=i+3;rt=fl(15);if(((ag(rt,0)+(Math.PI/2))%Math.PI)==0)
rt=0;else
{var p=i;var q=st;i=0;st='tan'+rt;rt=ev('~');if(rt==0)
{re(j,"value of cot too large");}else
rt=1/rt;i=p;st=q;}}else if(a=='acosec')
{var j=i;i=i+6;rt=fl(15);if(Math.abs(rt)<1)
re(j,"Cannot compute acosec(x) if |x| is less than 1");else
rt=ag(Math.asin(1/rt),1);}else if(a=='asec')
{var j=i;i=i+4;rt=fl(15);if(Math.abs(rt)<1)
re(j,"Cannot compute asec(x) if |x| is less than 1 ");else
rt=ag(Math.acos(1/rt),1);}
else if(a=='acot')
{i=i+4;rt=fl(15);if(rt==0)
{rt=ag((Math.PI/2),1);}
else rt=ag(Math.atan(1/rt),1);}else if(a=='cosech')
{var j=i;i=i+6;rt=fl(15);if(rt==0)
re(j,"cannot compute cosech of zero");else
rt=2/(Math.pow(Math.E,rt)-Math.pow(Math.E,-rt));}else if(a=='sech')
{i=i+4;rt=fl(15);rt=2/(Math.pow(Math.E,rt)+Math.pow(Math.E,-rt));}else if(a=='coth')
{var j=i;i=i+4;var rt=fl(15);if(rt==0)
re(j,"Cannot compute coth of zero");else
rt=(Math.pow(Math.E,rt)+Math.pow(Math.E,-rt))/(Math.pow(Math.E,rt)-Math.pow(Math.E,-rt));}else if(a=='acosech')
{var j=i;i=i+7;rt=fl(15);if(rt==0)
re(j,"Cannot compute  acosech(x) if x is zero");else
rt=Math.log((1/rt)+(Math.sqrt(Math.pow((1/rt),2)+1)));}else if(a=='asech')
{var j=i;i=i+5;rt=fl(15);if(Math.abs(rt)>=1)
re(j,"Cannot compute asech(x) if |x| is greater than or equal to 1 ");else
rt=Math.log((1/rt)+(Math.sqrt(Math.pow((1/rt),2)-1)));}else if(a=='acoth')
{var j=i;i=i+5;rt=fl(15);if(Math.abs(rt)>1)
{rt=(1/2)*Math.log((1+(1/rt))/(1-(1/rt)));}else
re(j,"Cannot compute  acoth(x) if |x| is less than or equal to 1");}
else if(getcstf(a,-1)!=-1)
{var j=i;i=i+a.length;var b=getcstf(a,-1);if(parseInt(cstf[b][3])!=1)
{var c=i;var d=st
i=0;st=''+cstf[b][2];rt=ev(':');i=c
st=d;}else
re(j,'constants created in complex number mode cannot be used in real number mode');}
else
if(getcstf(a,0)!=-1)
{var j=i;i+=a.length;var b=getcstf(a,0);if(parseInt(cstf[b][3])!=1)
{if(ep==-1)
{var c=i;var ta=[]
var ts='';var k=0;var l=0;while(l<cstf[b][1])
{ts='';while(cstf[b][2].charAt(k)!=',')
{ts+=cstf[b][2].charAt(k);k++;}
k++;l++;ta.push([ts,0]);}
var e='';while(k<cstf[b][2].length)
{e+=cstf[b][2].charAt(k);k++;}
if(cstf[b][1]==1)
ta[0][1]=fl(15);else
{k=0;i++;while(k<ta.length)
{ta[k][1]=ev(')');k++;if(st.charAt(i)==',')
i++;}}
if(ep==-1)
{var c=i;var d=st;st=e;var str=e;e='';k=0;var tm=''
var tp=[];while(k<ta.length)
{i=0;addset(ta[k][0]);while(i<st.length)
{tm=getst();if(tm==ta[k][0])
{tp.push([e.length,(('('+ta[k][1]+')').length-tm.length)]);e+='('+ta[k][1]+')';i+=tm.length}else
{e+=st.charAt(i)
i++;}}
st=e;e='';remset(ta[k][0]);k++;}
i=0;en=573;ep=-1;ec=-2;ts=ck(ft,':',':')
if(ep==-1)
{i=0;rt=ev(':');if(ep!=-1)
{ec=ep;st=str;k=-1;while((k<tp.length)&&(tp[k+1][0]<ep))
k++;l=0;while(l<=k)
{ep=ep-tp[k][1];l++;}
l=0;ts=''
while(l<st.length)
{if(l==ep)
{i=l;var tt=getst();if(tt!='')
{ts+='<i class=\"e\" >'+tt+'</i>';l+=tt.length;}else
{ts+='<i class=\"e\" >'+st.charAt(l)+'</i>';l++;}}else
{ts+=st.charAt(l);l++;}}
ts=prtwnshp(ts);ep=-1;i=0;en=573;re(j,'function error  {'+ts+' | '+er+'}');}}
else
{ep=-1;re(j,'function error: syntax')}
st=d;i=c;}}}else
re(j,'function created in complex number mode cannot be used in real number mode');}else
i++;return fixit(rt);}
function gfc(a)
{var rt=[0,0];if(a=='E')
{rt[0]=Math.E;i++;}else if(a=='i')
{rt[0]=0.0;rt[1]=1.0;i++;}else if(a=='im')
{i=i+2;rt=flc(15);rt[0]=rt[1];rt[1]=0;}else if(a=='re')
{i=i+2;rt=flc(15);rt[1]=0;}else if(a=='arg')
{i=i+3;rt[0]=arg(flc(15));rt[1]=0;}else if(a=='pi')
{rt[0]=Math.PI;i=i+2;}else if(a=='log')
{var j=i;i=i+3;i++;var ts=evc(']');if((ts[0]==0)&&(ts[1]==0))
re(j,"cannot compute log base 0");else if((ts[0]==1)&&(ts[1]==0))
re(j,"cannot compute log base 1");else
{rt=flc(15);if((rt[0]==0)&&(rt[1]==0))
re(j,"cannot compute log of zero");else{var na=an;an=1
var a=[0,0]
a[0]=ts[0];a[1]=ts[1];ts[0]=Math.log(mag(a));ts[1]=arg(a);a[0]=rt[0];a[1]=rt[1];rt[0]=Math.log(mag(a));rt[1]=arg(a);rt=divc(rt,ts);if((isNaN(rt[0]))||(isNaN(rt[1])))
re(j,"cannot evaluate log");an=na;}}}else if(a=='ln')
{var j=i;i=i+2;var ts=flc(15);if((ts[0]==0)&&(ts[1]==0))
re(j,"cannot evaluate of zero");else
{var na=an;an=1;rt[0]=Math.log(mag(ts));rt[1]=arg(ts);an=na;}}else if(a=='rt')
{var j=i;i=i+3;var ts=evc(']')
if((ts[0]==0)&&(ts[1]==0))
re(j,"Cannot compute root zero");else
{var tp=[1,0];ts=divc(tp,ts);rt=flc(15);var a=i;var b=st;i=0;st='('+rt[0]+'+'+rt[1]+'i)^('+ts[0]+'+'+ts[1]+'i)';rt=evc('~');st=b;i=a;}
if(isNaN(rt[0])||isNaN(rt[1]))
re(j,"Cannot compute root");}else if(a=='sqrt')
{var j=i;i=i+4;rt=flc(15);var a=i;var b=st;i=0;st='('+rt[0]+'+'+rt[1]+'i)^.5';rt=evc('~');st=b;i=a;if(isNaN(rt[0])||isNaN(rt[1]))
re(j,"Cannot compute square root");}else if(a=='cbrt')
{var j=i;i=i+4;rt=flc(15);var a=i;var b=st;i=0;st='('+rt[0]+'+'+rt[1]+'i)^(1/3)';rt=evc('~');st=b;i=a;if(isNaN(rt[0])||isNaN(rt[1]))
re(j,"Cannot compute cube root");}else if(a=='sin')
{i=i+3;rt=flc(15);rt[0]=ag(rt[0],0);rt[1]=ag(rt[1],0);var a=rt[0];rt[0]=sinm(a)*(Math.pow(Math.E,rt[1])+Math.pow(Math.E,-rt[1]))/2;rt[1]=cosm(a)*(Math.pow(Math.E,rt[1])-Math.pow(Math.E,-rt[1]))/2;}else if(a=='cos')
{i=i+3;rt=flc(15);rt[0]=ag(rt[0],0);rt[1]=ag(rt[1],0);var a=rt[0];rt[0]=cosm(a)*(Math.pow(Math.E,rt[1])+Math.pow(Math.E,-rt[1]))/2;rt[1]=-sinm(a)*(Math.pow(Math.E,rt[1])-Math.pow(Math.E,-rt[1]))/2;}else if(a=='tan')
{var j=i;i=i+3;rt=flc(15);var a=i;var b=st;st='cos('+rt[0]+'+i'+rt[1]+')';i=0;var ts=evc('~');if((ts[0]==0)&&(ts[1]==0))
re(j,'value of tan too large');else
{st='sin('+rt[0]+'+i'+rt[1]+')';i=0;rt=evc('~');rt=divc(rt,ts);}
i=a;st=b;}else if(a=='asin')
{i=i+4;rt=flc(15);var a=i;var b=st;i=0;st='-iln(i'+rt[0]+'-'+rt[1]+'+(1-('+rt[0]+'+'+rt[1]+'i)^2)^(1/2))';rt=evc('~');rt[0]=ag(rt[0],1);rt[1]=ag(rt[1],1);i=a;st=b;}else if(a=='acos')
{i=i+4;rt=flc(15);var a=i;var b=st;i=0;st='-iln('+rt[0]+'+'+rt[1]+'i+(-1+('+rt[0]+'+'+rt[1]+'i)^2)^(1/2))';rt=evc('~');rt[0]=ag(rt[0],1);rt[1]=ag(rt[1],1);i=a;st=b;}else if(a=='atan')
{var j=i;i=i+4;rt=flc(15)
if((rt[0]==0)&&(rt[1]==1))
re(j,"Cannot compute atan(x) if x is equal to i");else
{var a=i;var b=st;i=0;st='.5iln((i+'+rt[0]+'+'+rt[1]+'i)/(i-('+rt[0]+'+'+rt[1]+'i)))';rt=evc('~');rt[0]=ag(rt[0],1);rt[1]=ag(rt[1],1);i=a;st=b;}}else if(a=='lcm')
{var j=i;i=i+4;rt=evc(')');var ts=[0,0];while(st.charAt(i)==',')
{i++;ts=evc(')')
if((ts[0]<0)||(rt[0]<0))
re(j,"Cannot compute lcm for numbers less than zero");else if((parseInt(ts[0])!=ts[0])||(parseInt(rt[0])!=rt[0]))
re(j,"Cannot compute lcm for decimal numbers");else if((ts[1]!=0)||(rt[1]!=0))
re(j,"Cannot compute lcm for complex numbers");else
{if((rt[0]==0)||(ts[0]==0))
rt[0]=0;else
rt[0]=(rt[0]*ts[0])/gcds(rt[0],ts[0]);}}}else if(a=='gcd')
{var j=i;i=i+4;rt=evc(')');var ts=[0,0];while(st.charAt(i)==',')
{i++;ts=evc(')');if((ts[0]<0)||(rt[0]<0))
re(j,"Cannot compute gcd for numbers less than zero");else if((parseInt(ts[0])!=ts[0])||(parseInt(rt[0])!=rt[0]))
re(j,"Cannot compute gcd for decimal numbers");else if((rt[1]!=0)||(ts[1]!=0))
re(j,"Cannot compute gcd for complex numbers");else{if(ts[0]==0)
rt[0]=rt[0];else if(rt[0]==0)
rt[0]=ts[0];else
rt[0]=gcds(rt[0],ts[0]);}}}else if(a=='abs')
{i=i+3;rt[0]=mag(flc(15));rt[1]=0;}else if(a=='sinh')
{i=i+4;rt=flc(15);var a=rt[0];rt[0]=(Math.pow(Math.E,a)-Math.pow(Math.E,-a))*cosm(rt[1])/2;rt[1]=(Math.pow(Math.E,a)+Math.pow(Math.E,-a))*sinm(rt[1])/2;}else if(a=='cosh')
{i=i+4;rt=flc(15);var a=rt[0];rt[0]=(Math.pow(Math.E,a)+Math.pow(Math.E,-a))*cosm(rt[1])/2
rt[1]=(Math.pow(Math.E,a)-Math.pow(Math.E,-a))*sinm(rt[1])/2}else if(a=='tanh')
{var j=i;i=i+4;rt=flc(15);var a=i;var b=st;st='cosh('+rt[0]+'+i'+rt[1]+')';i=0;var ts=evc('~');if((ts[0]==0)&&(ts[1]==0))
re(j,'value of tanh too large');else
{st='sinh('+rt[0]+'+i'+rt[1]+')';i=0;rt=evc('~');rt=divc(rt,ts);}
i=a;st=b;}else if(a=='asinh')
{i=i+5;rt=flc(15);var a=i;var b=st;i=0;st="ln("+rt[0]+'+'+rt[1]+'i+((('+rt[0]+'+'+rt[1]+'i)^2)+1)^.5'
rt=evc('~');i=a;st=b;}else if(a=='acosh')
{i=i+5;rt=flc(15)
var a=i;var b=st;i=0;st="ln("+rt[0]+'+'+rt[1]+'i+((('+rt[0]+'+'+rt[1]+'i)^2)-1)^.5'
rt=evc('~');i=a;st=b;}else if(a=='atanh')
{var j=i;i=i+5;rt=flc(15);if((Math.abs(rt[0])==1)&&(rt[1]==0))
re(j,"Cannot compute atanh(x) if |x| is equal to 1");else
{var ts=[1,0];rt=divc(ts,rt);var a=i;var b=st;i=0;st='.5ln((1+'+rt[0]+'+'+rt[1]+'i)/(1-('+rt[0]+'+'+rt[1]+'i)))';rt=evc('~');i=a;st=b;}}else if(a=='cosec')
{var j=i;i=i+5;rt=flc(15);var a=i;var b=st;st='sin('+rt[0]+'+'+'i'+rt[1]+')';i=0;rt=evc('~');if((rt[0]==0)&&(rt[1]==0))
re(j,"value of cosec too large");else
{var ts=[1,0];rt=divc(ts,rt);}
i=a;st=b;}else if(a=='sec')
{var j=i;i=i+3;rt=flc(15);var a=i;var b=st;st='cos('+rt[0]+'+'+'i'+rt[1]+')';i=0;rt=evc('~');if((rt[0]==0)&&(rt[1]==0))
re(j,"value of sec too large");else
{var ts=[1,0];rt=divc(ts,rt);}
i=a;st=b;}else if(a=='cot')
{var j=i;i=i+3;rt=flc(15);var a=i;var b=st;st='sin('+rt[0]+'+i'+rt[1]+')';i=0
var ts=evc('~');if((ts[0]==0)&&(ts[1]==0))
re(j,'value of cot too large');else
{st='cos('+rt[0]+'+i'+rt[1]+')';i=0;rt=evc('~');rt=divc(rt,ts);}
i=a;st=b;}else if(a=='acosec')
{var j=i;i=i+6;rt=flc(15);if((rt[0]==0)&&(rt[1]==0))
re(j,"cannor compute acosec(x) if x=0");else{var ts=[1,0];rt=divc(ts,rt);var a=i;var b=st;i=0;st='-iln(i'+rt[0]+'-'+rt[1]+'+(1-('+rt[0]+'+'+rt[1]+'i)^2)^(1/2))';rt=evc('~');rt[0]=ag(rt[0],1);rt[1]=ag(rt[1],1);i=a;st=b;}}else if(a=='asec')
{var j=i;i=i+4;rt=flc(15);if((rt[0]==0)&&(rt[1]==0))
re(j,"cannot compute asec(x) if x=0");else
{var a=i;var b=st;var ts=[1,0];rt=divc(ts,rt);i=0;st='-iln('+rt[0]+'+'+rt[1]+'i+(-1+('+rt[0]+'+'+rt[1]+'i)^2)^(1/2))';rt=evc('~');rt[0]=ag(rt[0],1);rt[1]=ag(rt[1],1);i=a;st=b;}}else if(a=='acot')
{var j=i;i=i+4;rt=flc(15);if((rt[0]==0)&&(rt[1]==-1))
re(j,"Cannot compute acot(x) if x is equal to -i");else if((rt[0]==0)&&(rt[1]==0))
rt[0]=ag((Math.PI/2),1);else
{var a=i;var b=st;i=0;st='.5iln((i+'+rt[0]+'+'+rt[1]+'i)/(i-('+rt[0]+'+'+rt[1]+'i)))';rt=evc('~');rt[0]=ag(rt[0],1);rt[1]=ag(rt[1],1);i=a;st=b;}}else if(a=='cosech')
{var j=i;i=i+6;rt=flc(15);var a=i;var b=st;st='sinh('+rt[0]+'+'+'i'+rt[1]+')';i=0;rt=evc('~');if((rt[0]==0)&&(rt[1]==0))
re(j,"value of cosech too large");else
{var ts=[1,0];rt=divc(ts,rt);}
i=a;st=b;}else if(a=='sech')
{var j=i;i=i+4;rt=flc(15);var a=i;var b=st;st='cosh('+rt[0]+'+'+'i'+rt[1]+')';i=0;rt=evc('~');if((rt[0]==0)&&(rt[1]==0))
re(j,'value of sech too large');else
{var ts=[1,0];rt=divc(ts,rt);}
i=a;st=b;}else if(a=='coth')
{var j=i;i=i+4;rt=flc(15);var a=i;var b=st;st='sinh('+rt[0]+'+i'+rt[1]+')';i=0
var ts=evc('~');if((ts[0]==0)&&(ts[1]==0))
re(j,'value of coth too large');else
{st='cosh('+rt[0]+'+i'+rt[1]+')';i=0;rt=evc('~');rt=divc(rt,ts);}
i=a;st=b;}else if(a=='acosech')
{var j=i;i=i+7;rt=flc(15)
if((rt[0]==0)&&(rt[1]==0))
re(j,"cannot compute acosech(x) if x=0")
else
{var ts=[1,0];rt=divc(ts,rt);var a=i;var b=st;i=0;st="ln("+rt[0]+'+'+rt[1]+'i+((('+rt[0]+'+'+rt[1]+'i)^2)+1)^.5'
rt=evc('~');i=a;st=b;}}else if(a=='asech')
{var j=i;i=i+5;rt=flc(15)
if((rt[0]==0)&&(rt[1]==0))
re(j,"cannot compute asech(x) is x=0");else
{var ts=[1,0];rt=divc(ts,rt);var a=i;var b=st;i=0;st="ln("+rt[0]+'+'+rt[1]+'i+((('+rt[0]+'+'+rt[1]+'i)^2)-1)^.5'
rt=evc('~');i=a;st=b;}}else if(a=='acoth')
{var j=i;i=i+5;rt=flc(15);if((Math.abs(rt[0])==1)&&(rt[1]==0))
re(j,"Cannot compute acoth(x) if |x| is equal to 1");else if((rt[0]==0)&&(rt[1]==0))
re(j,"Cannot compute acoth(x) if x=0");{var ts=[1,0];rt=divc(ts,rt);var a=i;var b=st;i=0;st='.5ln((1+'+rt[0]+'+'+rt[1]+'i)/(1-('+rt[0]+'+'+rt[1]+'i)))';rt=evc('~');i=a;st=b;}}else if(getcstf(a,-1)!=-1)
{i=i+a.length;var b=getcstf(a,-1);var c=i;var d=st
i=0;st=''+cstf[b][2];rt=evc(':');i=c
st=d;}else if(getcstf(a,0)!=-1)
{var j=i;i+=a.length;var b=getcstf(a,0);if(ep==-1)
{var c=i;var ta=[]
var ts='';var k=0;var l=0;while(l<cstf[b][1])
{ts='';while(cstf[b][2].charAt(k)!=',')
{ts+=cstf[b][2].charAt(k);k++;}
k++;l++;ta.push([ts,'']);}
var e='';while(k<cstf[b][2].length)
{e+=cstf[b][2].charAt(k);k++;}
if(cstf[b][1]==1)
{var tp=flc(15);ta[0][1]='('+tp[0]+'+i('+tp[1]+'))';}
else
{k=0;i++;var tp=[0,0];while(k<ta.length)
{tp=evc(')');ta[k][1]='('+tp[0]+'+i('+tp[1]+'))';k++;if(st.charAt(i)==',')
i++;}}
if(ep==-1)
{var c=i;var d=st;st=e;var str=e;e='';k=0;var tm=''
var tp=[];while(k<ta.length)
{i=0;addset(ta[k][0]);while(i<st.length)
{tm=getst();if(tm==ta[k][0])
{tp.push([e.length,(('('+ta[k][1]+')').length-tm.length)]);e+='('+ta[k][1]+')';i+=tm.length;}else
{e+=st.charAt(i);i++;}}
st=e;e='';remset(ta[k][0]);k++;}
i=0;en=573;ep=-1;ec=-2;ts=ck(ft,':',':');if(ep==-1)
{i=0;rt=evc(':');if(ep!=-1)
{ec=ep;st=str;k=-1;while((k<tp.length)&&(tp[k+1][0]<ep))
k++;l=0;while(l<=k)
{ep=ep-tp[k][1];l++;}
l=0;ts=''
while(l<st.length)
{if(l==ep)
{i=l;var tt=getst();if(tt!='')
{ts+='<i class=\"e\" >'+tt+'</i>';l+=tt.length;}else
{ts+='<i class=\"e\" >'+st.charAt(l)+'</i>';l++;}}else
{ts+=st.charAt(l);l++;}}
ts=prtwnshp(ts);ep=-1;i=0;en=573;re(j,'function error  {'+ts+' | '+er+'}');}}else
{ep=-1;re(j,('function error: syntax'))}
st=d;i=c;}}}
else
i++;rt[0]=fixit(rt[0])
rt[1]=fixit(rt[1])
return rt;}
function re(a,b)
{if(ep==-1)
{ep=a;er=b;}}
function setip(a)
{document.getElementById('in').value=a;pt(0);document.getElementById('in').focus();}
function dispfunc(a,b)
{document.getElementById('in').focus();if((b==0)&&(a!=''))
document.getElementById('desc').innerHTML=a+' <button  style=\"width:100px;height:25px\" onClick=\"dispfunc(\''+a+'\',1)\" > description <\/button>';else
if(b==1)
{if(window.XMLHttpRequest)
{rqst=new XMLHttpRequest();}
else
{rqst=new ActiveXObject("Microsoft.XMLHTTP");}
var c='';var j=0;var tp;var d='';while(j<a.length)
{tp=a.charCodeAt(j);if(((tp>=ze)&&(tp<=ni))||((tp>=aa)&&(tp<=za))||((tp>=Aa)&&(tp<=Za)))
c+=a.charAt(j);else
{d=''+thex(tp);if(d.length==1)
c+='%0'+d;else
c+='%'+d;}
j++;}
var str='desc/'+c+'.txt';document.getElementById('desc').innerHTML='loading...';rqst.open('GET',str,true);rqst.onreadystatechange=dispfunc2;rqst.send(null)}}
function brkthndl(a)
{if(document.getElementById(a+'o'))
{if(document.getElementById(a+'o').style.bottom==(4+'px'))
document.getElementById(a+'o').style.bottom=0+'px';else
document.getElementById(a+'o').style.bottom=4+'px';}
if(document.getElementById(a+'c'))
{if(document.getElementById(a+'c').style.bottom==(4+'px'))
document.getElementById(a+'c').style.bottom=0+'px';else
document.getElementById(a+'c').style.bottom=4+'px';}}
function thex(a)
{var rt='';var str='';var b=a;while(b>0)
{rt=''+(b%16);if(rt==10)
str+='A';else if(rt==11)
str+='B';else if(rt==12)
str+='C';else if(rt==13)
str+='D';else if(rt==14)
str+='E';else if(rt==15)
str+='F';else
str=rt+str;b=Math.floor(b/16);}
return str;}
function dispfunc2()
{if(rqst.readyState==4)
if(rqst.status==200)
{document.getElementById('desc').innerHTML=rqst.responseText;}else document.getElementById('desc').innerHTML="Could not get file";}
function morefsdis()
{var str=document.getElementById('morefs').innerHTML;if(str!='')
{document.getElementById('morefs').innerHTML='';document.getElementById('morebutt').innerHTML='more'}
else
{document.getElementById('morefs').innerHTML='<button class=\"butt20\" onClick=\"bthd(\'cosec(\',\'trigonometric function\')\"  >cosec</button><button class=\"butt20\" onClick=\"bthd(\'acosec(\',\'trigonometric function\')\"  >acosec</button><button class=\"butt20\" onClick=\"bthd(\'sec(\',\'trigonometric function\')\"  >sec</button><button class=\"butt20\" onClick=\"bthd(\'asec(\',\'trigonometric function\')\"  >asec</button><button class=\"butt10\" onClick=\"bthd(\'cot(\',\'trigonometric function\')\"  >cot</button><button class=\"butt10\" onClick=\"bthd(\'acot(\',\'trigonometric function\')\"  >acot</button><button class=\"butt20\" onClick=\"bthd(\'cosech(\',\'trigonometric function\')\"  >cosech</button><button class=\"butt20\" onClick=\"bthd(\'acosech(\',\'trigonometric function\')\"  >acosech</button><button class=\"butt20\" onClick=\"bthd(\'sech(\',\'trigonometric function\')\"  >sech</button><button class=\"butt20\" onClick=\"bthd(\'asech(\',\'trigonometric function\')\"  >asech</button><button class=\"butt10\" onClick=\"bthd(\'coth(\',\'trigonometric function\')\"  >coth</button><button class=\"butt10\" onClick=\"bthd(\'acot(\',\'trigonometric function\')\"  >acoth</button>'
document.getElementById('morebutt').innerHTML='less'}}
function bthd(a,b)
{document.getElementById("in").value=document.getElementById("in").value+a;pt(0);dispfunc(b,0)}
function cls(a)
{if(a==0)
{document.getElementById("in").value='';document.getElementById("di").innerHTML='';hist='';histp=0;}else if(a==1)
{if(document.getElementById("in").value!='')
document.getElementById("in").value=document.getElementById("in").value.substring(0,(document.getElementById("in").value.length-1))
pt(0);}}
function lcthndl()
{var a=document.getElementById('lstofdir');var j=0;var f=0;while((j<a.length)&&(f!=1))
{if(a[j].selected==true)
f=1;else
j++;}
window.location=a[j].value;}
function sinm(a)
{if((Math.abs(a)%Math.PI)==0)
{return 0;}
else if(((Math.abs(a)-(Math.PI/6))%(Math.PI*2))==0)
{if(a<0)
return-.5;else
return.5;}else if(((Math.abs(a)-(Math.PI/6))%Math.PI)==0)
{if(a>0)
return-.5;else
return.5;}else return fixit(Math.sin(a));}
function cosm(a)
{if(((Math.abs(a)+(Math.PI/2))%Math.PI)==0)
return 0;else if(((Math.abs(a)-(Math.PI/3))%(Math.PI*2))==0)
return.5;else if(((Math.abs(a)-(Math.PI/3))%Math.PI)==0)
return-.5;else return fixit(Math.cos(a));}
function fixit(a)
{var b=new Number(a);return parseFloat(b.toFixed(dcsp));}
function mag(rt)
{return fixit(Math.sqrt(Math.pow(rt[0],2)+Math.pow(rt[1],2)));}
function arg(a)
{if((a[0]==0)&&(a[1]==0))
return 0.0;if(a[1]>=0)
return fixit(ag(Math.acos(a[0]/Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))),1));else
return fixit(ag(-Math.acos(a[0]/Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))),1));}
function divc(c1,c2)
{var rt=[0.0,0.0]
var dic=Math.pow(c2[0],2)+Math.pow(c2[1],2);rt[0]=fixit(((c1[0]*c2[0])+(c1[1]*c2[1]))/dic);rt[1]=fixit(((c1[1]*c2[0])-(c1[0]*c2[1]))/dic);return rt;}
function mulc(c1,c2)
{var rt=[0.0,0.0];rt[0]=fixit(c1[0]*c2[0]-(c1[1]*c2[1]));rt[1]=fixit(c1[0]*c2[1]+(c2[0]*c1[1]));return rt;}
function subc(c1,c2)
{var rt=[0.0,0.0]
rt[0]=fixit(c1[0]-c2[0]);rt[1]=fixit(c1[1]-c2[1]);return rt;}
function addc(c1,c2)
{var rt=[0.0,0.0]
rt[0]=fixit(c1[0]+c2[0]);rt[1]=fixit(c1[1]+c2[1]);return rt;}
function prtwnshp(a)
{var rt='';var j=0;while(j<a.length)
{if((a.charAt(j)=='#')&&((a.charCodeAt(j+1)<ze)||(a.charCodeAt(j+1)>ni)))
{}else
rt+=a.charAt(j);j++;}
return rt;}
var is={ie:navigator.appName=='Microsoft Internet Explorer',java:navigator.javaEnabled(),ns:navigator.appName=='Netscape',ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=='Win32'}
is.mac=is.ua.indexOf('mac')>=0;if(is.ua.indexOf('opera')>=0){is.ie=is.ns=false;is.opera=true;}
if(is.ua.indexOf('gecko')>=0){is.ie=is.ns=false;is.gecko=true;}
