new integrable model, part III (fx/fl ops)

This commit is contained in:
ESL 2023-03-18 20:09:46 -04:00
parent 814c0648ec
commit 94dc0fb0c1
3 changed files with 75 additions and 453 deletions

138
i.h
View file

@ -241,75 +241,75 @@ declare_instruction(nullp, "u", 0, "%nullp", 1, INLINED)
declare_instruction(pairp, "p", 0, "%pairp", 1, INLINED)
declare_instruction(cons, "c", 0, "%cons", 2, INLINED)
declare_instruction(not, "~", 0, "%not", 1, INLINED)
declare_instruction(izerop, "I=0", 0, "%izerop", 1, INLINED)
declare_instruction(iposp, "I>0", 0, "%iposp", 1, INLINED)
declare_instruction(inegp, "I<0", 0, "%inegp", 1, INLINED)
declare_instruction(ievnp, "Ie", 0, "%ievnp", 1, INLINED)
declare_instruction(ioddp, "Io", 0, "%ioddp", 1, INLINED)
declare_instruction(iadd, "I+", 0, "%iadd", 2, INLINED)
declare_instruction(isub, "I-", 0, "%isub", 2, INLINED)
declare_instruction(imul, "I*", 0, "%imul", 2, INLINED)
declare_instruction(idiv, "I/", 0, "%idiv", 2, INLINED)
declare_instruction(iquo, "Iq", 0, "%iquo", 2, INLINED)
declare_instruction(irem, "Ir", 0, "%irem", 2, INLINED)
declare_instruction(ilt, "I<", 0, "%ilt", 2, INLINED)
declare_instruction(igt, "I>", 0, "%igt", 2, INLINED)
declare_instruction(ile, "I>!", 0, "%ile", 2, INLINED)
declare_instruction(ige, "I<!", 0, "%ige", 2, INLINED)
declare_instruction(ieq, "I=", 0, "%ieq", 2, INLINED)
declare_instruction(ine, "I=!", 0, "%ine", 2, INLINED)
declare_instruction(imin, "In", 0, "%imin", 2, INLINED)
declare_instruction(imax, "Ix", 0, "%imax", 2, INLINED)
declare_instruction(ineg, "I-!", 0, "%ineg", 1, INLINED)
declare_instruction(iabs, "Ia", 0, "%iabs", 1, INLINED)
declare_instruction(itoj, "Ij", 0, "%itoj", 1, INLINED)
declare_instruction(fixp, "I0", 0, "%fixp", 1, INLINED)
declare_instruction(imqu, "I3", 0, "%imqu", 2, INLINED)
declare_instruction(imlo, "I4", 0, "%imlo", 2, INLINED)
declare_instruction(ieuq, "I5", 0, "%ieuq", 2, INLINED)
declare_instruction(ieur, "I6", 0, "%ieur", 2, INLINED)
declare_instruction(igcd, "I7", 0, "%igcd", 2, INLINED)
declare_instruction(ipow, "I8", 0, "%ipow", 2, INLINED)
declare_instruction(isqrt, "I9", 0, "%isqrt", 1, INLINED)
declare_instruction(inot, "D0", 0, "%inot", 1, INLINED)
declare_instruction(iand, "D1", 0, "%iand", 2, INLINED)
declare_instruction(iior, "D2", 0, "%iior", 2, INLINED)
declare_instruction(ixor, "D3", 0, "%ixor", 2, INLINED)
declare_instruction(iasl, "D4", 0, "%iasl", 2, INLINED)
declare_instruction(iasr, "D5", 0, "%iasr", 2, INLINED)
declare_instruction(jzerop, "J=0", 0, "%jzerop", 1, INLINED)
declare_instruction(jposp, "J>0", 0, "%jposp", 1, INLINED)
declare_instruction(jnegp, "J<0", 0, "%jnegp", 1, INLINED)
declare_instruction(jevnp, "Je", 0, "%jevnp", 1, INLINED)
declare_instruction(joddp, "Jo", 0, "%joddp", 1, INLINED)
declare_instruction(jintp, "Jw", 0, "%jintp", 1, INLINED)
declare_instruction(jnanp, "Ju", 0, "%jnanp", 1, INLINED)
declare_instruction(jfinp, "Jf", 0, "%jfinp", 1, INLINED)
declare_instruction(jinfp, "Jh", 0, "%jinfp", 1, INLINED)
declare_instruction(jadd, "J+", 0, "%jadd", 2, INLINED)
declare_instruction(jsub, "J-", 0, "%jsub", 2, INLINED)
declare_instruction(jmul, "J*", 0, "%jmul", 2, INLINED)
declare_instruction(jdiv, "J/", 0, "%jdiv", 2, INLINED)
declare_instruction(jquo, "Jq", 0, "%jquo", 2, INLINED)
declare_instruction(jrem, "Jr", 0, "%jrem", 2, INLINED)
declare_instruction(jlt, "J<", 0, "%jlt", 2, INLINED)
declare_instruction(jgt, "J>", 0, "%jgt", 2, INLINED)
declare_instruction(jle, "J>!", 0, "%jle", 2, INLINED)
declare_instruction(jge, "J<!", 0, "%jge", 2, INLINED)
declare_instruction(jeq, "J=", 0, "%jeq", 2, INLINED)
declare_instruction(jne, "J=!", 0, "%jne", 2, INLINED)
declare_instruction(jmin, "Jn", 0, "%jmin", 2, INLINED)
declare_instruction(jmax, "Jx", 0, "%jmax", 2, INLINED)
declare_instruction(jneg, "J-!", 0, "%jneg", 1, INLINED)
declare_instruction(jabs, "Ja", 0, "%jabs", 1, INLINED)
declare_instruction(jtoi, "Ji", 0, "%jtoi", 1, INLINED)
declare_instruction(flop, "J0", 0, "%flop", 1, INLINED)
declare_instruction(jmqu, "J3", 0, "%jmqu", 2, INLINED)
declare_instruction(jmlo, "J4", 0, "%jmlo", 2, INLINED)
declare_instruction(jfloor, "H0", 0, "%jfloor", 1, INLINED)
declare_instruction(jceil, "H1", 0, "%jceil", 1, INLINED)
declare_instruction(jtrunc, "H2", 0, "%jtrunc", 1, INLINED)
declare_instruction(jround, "H3", 0, "%jround", 1, INLINED)
declare_instruction(izerop, "I=0", 0, "fxzero?", '1', AUTOGL)
declare_instruction(iposp, "I>0", 0, "fxpositive?", '1', AUTOGL)
declare_instruction(inegp, "I<0", 0, "fxnegative?", '1', AUTOGL)
declare_instruction(ievnp, "Ie", 0, "fxeven?", '1', AUTOGL)
declare_instruction(ioddp, "Io", 0, "fxodd?", '1', AUTOGL)
declare_instruction(iadd, "I+", 0, "fx+", '2', AUTOGL)
declare_instruction(isub, "I-", 0, "fx-", '2', AUTOGL)
declare_instruction(imul, "I*", 0, "fx*", '2', AUTOGL)
declare_instruction(idiv, "I/", 0, "fx/", '2', AUTOGL)
declare_instruction(iquo, "Iq", 0, "fxquotient", '2', AUTOGL)
declare_instruction(irem, "Ir", 0, "fxremainder", '2', AUTOGL)
declare_instruction(ilt, "I<", 0, "fx<?", '2', AUTOGL)
declare_instruction(igt, "I>", 0, "fx>?", '2', AUTOGL)
declare_instruction(ile, "I>!", 0, "fx<=?", '2', AUTOGL)
declare_instruction(ige, "I<!", 0, "fx>=?", '2', AUTOGL)
declare_instruction(ieq, "I=", 0, "fx=?", '2', AUTOGL)
declare_instruction(ine, "I=!", 0, "fx!=?", '2', AUTOGL)
declare_instruction(imin, "In", 0, "fxmin", '2', AUTOGL)
declare_instruction(imax, "Ix", 0, "fxmax", '2', AUTOGL)
declare_instruction(ineg, "I-!", 0, "fxneg", '1', AUTOGL)
declare_instruction(iabs, "Ia", 0, "fxabs", '1', AUTOGL)
declare_instruction(itoj, "Ij", 0, "fixnum->flonum", '1', AUTOGL)
declare_instruction(fixp, "I0", 0, "fixnum?", '1', AUTOGL)
declare_instruction(imqu, "I3", 0, "fxmodquo", '2', AUTOGL)
declare_instruction(imlo, "I4", 0, "fxmodulo", '2', AUTOGL)
declare_instruction(ieuq, "I5", 0, "fxeucquo", '2', AUTOGL)
declare_instruction(ieur, "I6", 0, "fxeucrem", '2', AUTOGL)
declare_instruction(igcd, "I7", 0, "fxgcd", '2', AUTOGL)
declare_instruction(ipow, "I8", 0, "fxexpt", '2', AUTOGL)
declare_instruction(isqrt, "I9", 0, "fxsqrt", '1', AUTOGL)
declare_instruction(inot, "D0", 0, "fxnot", '1', AUTOGL)
declare_instruction(iand, "D1", 0, "fxand", '2', AUTOGL)
declare_instruction(iior, "D2", 0, "fxior", '2', AUTOGL)
declare_instruction(ixor, "D3", 0, "fxxor", '2', AUTOGL)
declare_instruction(iasl, "D4", 0, "fxsll", '2', AUTOGL)
declare_instruction(iasr, "D5", 0, "fxsrl", '2', AUTOGL)
declare_instruction(jzerop, "J=0", 0, "flzero?", '1', AUTOGL)
declare_instruction(jposp, "J>0", 0, "flpositive?", '1', AUTOGL)
declare_instruction(jnegp, "J<0", 0, "flnegative?", '1', AUTOGL)
declare_instruction(jevnp, "Je", 0, "fleven?", '1', AUTOGL)
declare_instruction(joddp, "Jo", 0, "flodd?", '1', AUTOGL)
declare_instruction(jintp, "Jw", 0, "flinteger?", '1', AUTOGL)
declare_instruction(jnanp, "Ju", 0, "flnan?", '1', AUTOGL)
declare_instruction(jfinp, "Jf", 0, "flfinite?", '1', AUTOGL)
declare_instruction(jinfp, "Jh", 0, "flinfinite?", '1', AUTOGL)
declare_instruction(jadd, "J+", 0, "fl+", '2', AUTOGL)
declare_instruction(jsub, "J-", 0, "fl-", '2', AUTOGL)
declare_instruction(jmul, "J*", 0, "fl*", '2', AUTOGL)
declare_instruction(jdiv, "J/", 0, "fl/", '2', AUTOGL)
declare_instruction(jquo, "Jq", 0, "flquotient", '2', AUTOGL)
declare_instruction(jrem, "Jr", 0, "flremainder", '2', AUTOGL)
declare_instruction(jlt, "J<", 0, "fl<?", '2', AUTOGL)
declare_instruction(jgt, "J>", 0, "fl>?", '2', AUTOGL)
declare_instruction(jle, "J>!", 0, "fl<=?", '2', AUTOGL)
declare_instruction(jge, "J<!", 0, "fl>=?", '2', AUTOGL)
declare_instruction(jeq, "J=", 0, "fl=?", '2', AUTOGL)
declare_instruction(jne, "J=!", 0, "fl!=?", '2', AUTOGL)
declare_instruction(jmin, "Jn", 0, "flmin", '2', AUTOGL)
declare_instruction(jmax, "Jx", 0, "flmax", '2', AUTOGL)
declare_instruction(jneg, "J-!", 0, "flneg", '1', AUTOGL)
declare_instruction(jabs, "Ja", 0, "flabs", '1', AUTOGL)
declare_instruction(jtoi, "Ji", 0, "flonum->fixnum", '1', AUTOGL)
declare_instruction(flop, "J0", 0, "flonum?", '1', AUTOGL)
declare_instruction(jmqu, "J3", 0, "flmodquo", '2', AUTOGL)
declare_instruction(jmlo, "J4", 0, "flmodulo", '2', AUTOGL)
declare_instruction(jfloor, "H0", 0, "flfloor", '1', AUTOGL)
declare_instruction(jceil, "H1", 0, "flceiling", '1', AUTOGL)
declare_instruction(jtrunc, "H2", 0, "fltruncate", '1', AUTOGL)
declare_instruction(jround, "H3", 0, "flround", '1', AUTOGL)
declare_instruction(zerop, "=0", 0, "%zerop", 1, INLINED)
declare_instruction(posp, ">0", 0, "%posp", 1, INLINED)
declare_instruction(negp, "<0", 0, "%negp", 1, INLINED)

384
s.c
View file

@ -58,390 +58,6 @@ char *s_code[] = {
0,
"&0{%2.1,.1z!]2}@!(y18:%25residual-set-box!)",
"fixnum?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25fixp;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py17:%25residual-fixnum?;y12:syntax-rules;;;l2:y1:_;y"
"17:%25residual-fixnum?;;",
0,
"&0{%1.0I0]1}@!(y17:%25residual-fixnum?)",
"fxzero?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y7:%25izerop;y1:x;;;l2:py1:_"
";y12:syntax-rules;;py17:%25residual-fxzero?;y12:syntax-rules;;;l2:y1:_"
";y17:%25residual-fxzero?;;",
0,
"&0{%1.0I=0]1}@!(y17:%25residual-fxzero?)",
"fxpositive?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25iposp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py21:%25residual-fxpositive?;y12:syntax-rules;;;l2:y"
"1:_;y21:%25residual-fxpositive?;;",
0,
"&0{%1.0I>0]1}@!(y21:%25residual-fxpositive?)",
"fxnegative?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25inegp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py21:%25residual-fxnegative?;y12:syntax-rules;;;l2:y"
"1:_;y21:%25residual-fxnegative?;;",
0,
"&0{%1.0I<0]1}@!(y21:%25residual-fxnegative?)",
"fx+",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25iadd;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py13:%25residual-fx+;y12:syntax-rules;;;l2:"
"y1:_;y13:%25residual-fx+;;",
0,
"&0{%2.1,.1I+]2}@!(y13:%25residual-fx+)",
"fx*",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25imul;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py13:%25residual-fx*;y12:syntax-rules;;;l2:"
"y1:_;y13:%25residual-fx*;;",
0,
"&0{%2.1,.1I*]2}@!(y13:%25residual-fx*)",
"fx-",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25isub;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py13:%25residual-fx-;y12:syntax-rules;;;l2:"
"y1:_;y13:%25residual-fx-;;",
0,
"&0{%2.1,.1I-]2}@!(y13:%25residual-fx-)",
"fx/",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25idiv;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py13:%25residual-fx/;y12:syntax-rules;;;l2:"
"y1:_;y13:%25residual-fx/;;",
0,
"&0{%2.1,.1I/]2}@!(y13:%25residual-fx/)",
"fxquotient",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25iquo;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py20:%25residual-fxquotient;y12:syntax-rule"
"s;;;l2:y1:_;y20:%25residual-fxquotient;;",
0,
"&0{%2.1,.1Iq]2}@!(y20:%25residual-fxquotient)",
"fxremainder",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25irem;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py21:%25residual-fxremainder;y12:syntax-rul"
"es;;;l2:y1:_;y21:%25residual-fxremainder;;",
0,
"&0{%2.1,.1Ir]2}@!(y21:%25residual-fxremainder)",
"fxmodquo",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25imqu;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py18:%25residual-fxmodquo;y12:syntax-rules;"
";;l2:y1:_;y18:%25residual-fxmodquo;;",
0,
"&0{%2.1,.1I3]2}@!(y18:%25residual-fxmodquo)",
"fxmodulo",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25imlo;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py18:%25residual-fxmodulo;y12:syntax-rules;"
";;l2:y1:_;y18:%25residual-fxmodulo;;",
0,
"&0{%2.1,.1I4]2}@!(y18:%25residual-fxmodulo)",
"fxeucquo",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25ieuq;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py18:%25residual-fxeucquo;y12:syntax-rules;"
";;l2:y1:_;y18:%25residual-fxeucquo;;",
0,
"&0{%2.1,.1I5]2}@!(y18:%25residual-fxeucquo)",
"fxeucrem",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25ieur;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py18:%25residual-fxeucrem;y12:syntax-rules;"
";;l2:y1:_;y18:%25residual-fxeucrem;;",
0,
"&0{%2.1,.1I6]2}@!(y18:%25residual-fxeucrem)",
"fxneg",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25ineg;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py15:%25residual-fxneg;y12:syntax-rules;;;l2:y1:_;y15"
":%25residual-fxneg;;",
0,
"&0{%1.0I-!]1}@!(y15:%25residual-fxneg)",
"fxabs",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25iabs;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py15:%25residual-fxabs;y12:syntax-rules;;;l2:y1:_;y15"
":%25residual-fxabs;;",
0,
"&0{%1.0Ia]1}@!(y15:%25residual-fxabs)",
"fx<?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25ilt;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py14:%25residual-fx<?;y12:syntax-rules;;;l2:"
"y1:_;y14:%25residual-fx<?;;",
0,
"&0{%2.1,.1I<]2}@!(y14:%25residual-fx<?)",
"fx<=?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25ile;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py15:%25residual-fx<=?;y12:syntax-rules;;;l2"
":y1:_;y15:%25residual-fx<=?;;",
0,
"&0{%2.1,.1I>!]2}@!(y15:%25residual-fx<=?)",
"fx>?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25igt;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py14:%25residual-fx>?;y12:syntax-rules;;;l2:"
"y1:_;y14:%25residual-fx>?;;",
0,
"&0{%2.1,.1I>]2}@!(y14:%25residual-fx>?)",
"fx>=?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25ige;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py15:%25residual-fx>=?;y12:syntax-rules;;;l2"
":y1:_;y15:%25residual-fx>=?;;",
0,
"&0{%2.1,.1I<!]2}@!(y15:%25residual-fx>=?)",
"fx=?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25ieq;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py14:%25residual-fx=?;y12:syntax-rules;;;l2:"
"y1:_;y14:%25residual-fx=?;;",
0,
"&0{%2.1,.1I=]2}@!(y14:%25residual-fx=?)",
"fxmin",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25imin;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py15:%25residual-fxmin;y12:syntax-rules;;;l"
"2:y1:_;y15:%25residual-fxmin;;",
0,
"&0{%2.1,.1In]2}@!(y15:%25residual-fxmin)",
"fxmax",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25imax;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py15:%25residual-fxmax;y12:syntax-rules;;;l"
"2:y1:_;y15:%25residual-fxmax;;",
0,
"&0{%2.1,.1Ix]2}@!(y15:%25residual-fxmax)",
"fixnum->flonum",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25itoj;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py24:%25residual-fixnum->flonum;y12:syntax-rules;;;l2"
":y1:_;y24:%25residual-fixnum->flonum;;",
0,
"&0{%1.0Ij]1}@!(y24:%25residual-fixnum->flonum)",
"flonum?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25flop;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py17:%25residual-flonum?;y12:syntax-rules;;;l2:y1:_;y"
"17:%25residual-flonum?;;",
0,
"&0{%1.0J0]1}@!(y17:%25residual-flonum?)",
"flzero?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y7:%25jzerop;y1:x;;;l2:py1:_"
";y12:syntax-rules;;py17:%25residual-flzero?;y12:syntax-rules;;;l2:y1:_"
";y17:%25residual-flzero?;;",
0,
"&0{%1.0J=0]1}@!(y17:%25residual-flzero?)",
"flpositive?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25jposp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py21:%25residual-flpositive?;y12:syntax-rules;;;l2:y"
"1:_;y21:%25residual-flpositive?;;",
0,
"&0{%1.0J>0]1}@!(y21:%25residual-flpositive?)",
"flnegative?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25jnegp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py21:%25residual-flnegative?;y12:syntax-rules;;;l2:y"
"1:_;y21:%25residual-flnegative?;;",
0,
"&0{%1.0J<0]1}@!(y21:%25residual-flnegative?)",
"flinteger?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25jintp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py20:%25residual-flinteger?;y12:syntax-rules;;;l2:y1"
":_;y20:%25residual-flinteger?;;",
0,
"&0{%1.0Jw]1}@!(y20:%25residual-flinteger?)",
"flnan?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25jnanp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py16:%25residual-flnan?;y12:syntax-rules;;;l2:y1:_;y"
"16:%25residual-flnan?;;",
0,
"&0{%1.0Ju]1}@!(y16:%25residual-flnan?)",
"flinfinite?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25jinfp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py21:%25residual-flinfinite?;y12:syntax-rules;;;l2:y"
"1:_;y21:%25residual-flinfinite?;;",
0,
"&0{%1.0Jh]1}@!(y21:%25residual-flinfinite?)",
"flfinite?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25jfinp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py19:%25residual-flfinite?;y12:syntax-rules;;;l2:y1:"
"_;y19:%25residual-flfinite?;;",
0,
"&0{%1.0Jf]1}@!(y19:%25residual-flfinite?)",
"fleven?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25jevnp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py17:%25residual-fleven?;y12:syntax-rules;;;l2:y1:_;"
"y17:%25residual-fleven?;;",
0,
"&0{%1.0Je]1}@!(y17:%25residual-fleven?)",
"flodd?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y6:%25joddp;y1:x;;;l2:py1:_;"
"y12:syntax-rules;;py16:%25residual-flodd?;y12:syntax-rules;;;l2:y1:_;y"
"16:%25residual-flodd?;;",
0,
"&0{%1.0Jo]1}@!(y16:%25residual-flodd?)",
"fl+",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25jadd;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py13:%25residual-fl+;y12:syntax-rules;;;l2:"
"y1:_;y13:%25residual-fl+;;",
0,
"&0{%2.1,.1J+]2}@!(y13:%25residual-fl+)",
"fl-",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25jsub;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py13:%25residual-fl-;y12:syntax-rules;;;l2:"
"y1:_;y13:%25residual-fl-;;",
0,
"&0{%2.1,.1J-]2}@!(y13:%25residual-fl-)",
"fl*",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25jmul;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py13:%25residual-fl*;y12:syntax-rules;;;l2:"
"y1:_;y13:%25residual-fl*;;",
0,
"&0{%2.1,.1J*]2}@!(y13:%25residual-fl*)",
"fl/",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25jdiv;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py13:%25residual-fl/;y12:syntax-rules;;;l2:"
"y1:_;y13:%25residual-fl/;;",
0,
"&0{%2.1,.1J/]2}@!(y13:%25residual-fl/)",
"flneg",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25jneg;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py15:%25residual-flneg;y12:syntax-rules;;;l2:y1:_;y15"
":%25residual-flneg;;",
0,
"&0{%1.0J-!]1}@!(y15:%25residual-flneg)",
"flabs",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25jabs;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py15:%25residual-flabs;y12:syntax-rules;;;l2:y1:_;y15"
":%25residual-flabs;;",
0,
"&0{%1.0Ja]1}@!(y15:%25residual-flabs)",
"fl<?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25jlt;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py14:%25residual-fl<?;y12:syntax-rules;;;l2:"
"y1:_;y14:%25residual-fl<?;;",
0,
"&0{%2.1,.1J<]2}@!(y14:%25residual-fl<?)",
"fl<=?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25jle;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py15:%25residual-fl<=?;y12:syntax-rules;;;l2"
":y1:_;y15:%25residual-fl<=?;;",
0,
"&0{%2.1,.1J>!]2}@!(y15:%25residual-fl<=?)",
"fl>?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25jgt;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py14:%25residual-fl>?;y12:syntax-rules;;;l2:"
"y1:_;y14:%25residual-fl>?;;",
0,
"&0{%2.1,.1J>]2}@!(y14:%25residual-fl>?)",
"fl>=?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25jge;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py15:%25residual-fl>=?;y12:syntax-rules;;;l2"
":y1:_;y15:%25residual-fl>=?;;",
0,
"&0{%2.1,.1J<!]2}@!(y15:%25residual-fl>=?)",
"fl=?",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y4:%25jeq;y1:x;y1:y;;;l"
"2:py1:_;y12:syntax-rules;;py14:%25residual-fl=?;y12:syntax-rules;;;l2:"
"y1:_;y14:%25residual-fl=?;;",
0,
"&0{%2.1,.1J=]2}@!(y14:%25residual-fl=?)",
"flmin",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25jmin;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py15:%25residual-flmin;y12:syntax-rules;;;l"
"2:y1:_;y15:%25residual-flmin;;",
0,
"&0{%2.1,.1Jn]2}@!(y15:%25residual-flmin)",
"flmax",
"l5:y12:syntax-rules;n;l2:l3:y1:_;y1:x;y1:y;;l3:y5:%25jmax;y1:x;y1:y;;;"
"l2:py1:_;y12:syntax-rules;;py15:%25residual-flmax;y12:syntax-rules;;;l"
"2:y1:_;y15:%25residual-flmax;;",
0,
"&0{%2.1,.1Jx]2}@!(y15:%25residual-flmax)",
"flonum->fixnum",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25jtoi;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py24:%25residual-flonum->fixnum;y12:syntax-rules;;;l2"
":y1:_;y24:%25residual-flonum->fixnum;;",
0,
"&0{%1.0Ji]1}@!(y24:%25residual-flonum->fixnum)",
"number?",
"l5:y12:syntax-rules;n;l2:l2:y1:_;y1:x;;l2:y5:%25nump;y1:x;;;l2:py1:_;y"
"12:syntax-rules;;py17:%25residual-number?;y12:syntax-rules;;;l2:y1:_;y"

View file

@ -71,6 +71,8 @@
; Exact integer numbers (fixnums)
;---------------------------------------------------------------------------------------------
#|
(define-inline (fixnum? x) %residual-fixnum? (%fixp x))
(define-inline (fxzero? x) %residual-fxzero? (%izerop x))
@ -119,11 +121,14 @@
(define-inline (fixnum->flonum x) %residual-fixnum->flonum (%itoj x))
|#
;---------------------------------------------------------------------------------------------
; Inexact floating-point numbers (flonums)
;---------------------------------------------------------------------------------------------
#|
(define-inline (flonum? x) %residual-flonum? (%flop x))
(define-inline (flzero? x) %residual-flzero? (%jzerop x))
@ -172,6 +177,7 @@
(define-inline (flonum->fixnum x) %residual-flonum->fixnum (%jtoi x))
|#
;---------------------------------------------------------------------------------------------
; Numbers (fixnums or flonums)