Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Task 4 Compare Results
#1
You can really check these all yourself.  But if you're lazy like me you'd probably rather just copy/paste this.

Code:
echo "(2)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(3)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(4)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(12)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(63246)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(5179)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(1)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(0)" > task4.args
scam -r task4.scm task4.args >> results.txt

Code:
cat results.txt
1.0594630944
1.0958726911
1.1224620483
1.2300755056
2.5123844031
2.0394848923
1.0000000000
0.000000e+00
Reply
#2
(08-30-2017, 03:26 AM)SSinischo Wrote: You can really check these all yourself.  But if you're lazy like me you'd probably rather just copy/paste this.

Code:
echo "(2)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(3)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(4)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(12)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(63246)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(5179)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(1)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(0)" > task4.args
scam -r task4.scm task4.args >> results.txt
[size=small][font=Monaco, Consolas, Courier, monospace]echo "(429496729)" > task4.args[/font][/size]
scam -r task4.scm task4.args >> results.txt

Code:
cat results.txt
1.0958726911
1.1224620483
1.2300755056
2.5123844031
2.0394848924
1.0000000000
5.2409898874

I get the same output for all of them except for 5179, my output has a 3 as the last digit instead of a 4(slight precision difference).

Also, I think the 12th root of 0 is 0.
Reply
#3
(08-30-2017, 08:27 AM)nebrinda Wrote: I get the same output for all of them except for 5179, my output has a 3 as the last digit instead of a 4(slight precision difference).
Also, I think the 12th root of 0 is 0.

Thanks for the catch!  It should be 3 instead of 4.  I added another digit to my precision check.
Reply
#4
Should we report the 12th root of 0 as "0" or as a real "0.000000e+00"?
UA ACM Vice President
ACM has bi-weekly meetings Tuesdays at 5:15pm
We're UA's best organization for CS majors (website)
Join us on Slack for all kinds of discussion channels (including one for CS403)
Reply
#5
^ Seems like it should be a real number.
Reply
#6
Did you guys hard-code the function to return 0.0 upon an input of 0?
Reply
#7
^ That seems reasonable, since the return value is always zero, regardless of the 'base'.
Reply
#8
(08-31-2017, 04:08 PM)lusth Wrote: ^ That seems reasonable, since the return value is always zero, regardless of the 'base'.

Okay. I asked because if I didn't do so my program will attempt to approximate the answer and output something like 1.092757e-13 instead of 0.0000000000. These are equivalent up to the latter's last decimal place but might not be considered as such in the grading process.
Reply
#9
It is possible that answers that get marked wrong are actually correct. The example you gave would result in such. For those types of grading mistakes, I will have to go in and adjust your scores by hand. Hopefully, there won't be too many instances of that.
Reply
#10
(08-30-2017, 03:26 AM)SSinischo Wrote: You can really check these all yourself.  But if you're lazy like me you'd probably rather just copy/paste this.

Code:
echo "(2)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(3)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(4)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(12)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(63246)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(5179)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(1)" > task4.args
scam -r task4.scm task4.args >> results.txt
echo "(0)" > task4.args
scam -r task4.scm task4.args >> results.txt

Code:
cat results.txt
1.0594630944
1.0958726911
1.1224620483
1.2300755056
2.5123844031
2.0394848923
1.0000000000
0.000000e+00

Weird, I got:

Code:
cat results.txt
1.0594631015
1.0958726923
1.1224636116
1.2300755056
2.5123844031
2.0394848923
1.0000000000
0.000000e+00
Just barely different and only on a few numbers. Anyone know why this may be?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)