#!perl -wl
die unless defined($numbits=$ARGV[0]);
open FI,"formula" or die;
die unless defined($formula=<FI>);
chomp $formula;
print "\\l output/done$numbits.log";
print "default(realbitprecision,",$numbits+128,");";
print 'default(debug,5);';
print << "EOF";
allocatemem(10^9);
x=floor($formula*2^$numbits);
if(x%2,f=factorint(x),f=factorint(x+1));
if(x%2,print("data","line $formula numbits $numbits floor "f),       print("data","line $formula numbits $numbits ceil "f))
EOF
