Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Task 4 Compare Results
#11
[quote pid='491' dateline='1504738982']
Just barely different and only on a few numbers. Anyone know why this may be?
[/quote]

Likely you need more precision if the differing digits are the least significant.
Reply
#12
(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

When I run the script, I get similar answers:
Code:
1.0595002627
1.0958881250
1.1224636116
1.2300777894
2.5123844031
2.0394849156
1.0000000000
0.000000e+00
By comparing my answers with the generally accepted answers, it appears that my answers are less precise. In the description, it says "The form of your solution should follow that in the text for square root." I assume that also includes the desired precision for the "good-enough?" function (which is 0.001 in the book). Are your answers using the precision from the book or a different precision value? If you are using a value other than 0.001, is there any documentation that says to use that precision?

Lastly, a question for Dr. Lusth: The book has a definition for good-enough?, but it also has an exercise that asks us to improve the good-enough? function (exercise 1.7). I am currently under the assumption that we are supposed to use the explicitly defined version. Is that correct?
Reply
#13
(09-07-2017, 04:08 PM)jdhawley Wrote: By comparing my answers with the generally accepted answers, it appears that my answers are less precise. In the description, it says "The form of your solution should follow that in the text for square root." I assume that also includes the desired precision for the "good-enough?" function (which is 0.001 in the book). Are your answers using the precision from the book or a different precision value? If you are using a value other than 0.001, is there any documentation that says to use that precision?

Lastly, a question for Dr. Lusth: The book has a definition for good-enough?, but it also has an exercise that asks us to improve the good-enough? function (exercise 1.7). I am currently under the assumption that we are supposed to use the explicitly defined version. Is that correct?

You'll need more precision from your good-enough? function. Just test with adding more digits to get to the same results as in this thread.
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
#14
(09-07-2017, 04:13 PM)davidmccoy Wrote:
(09-07-2017, 04:08 PM)jdhawley Wrote: By comparing my answers with the generally accepted answers, it appears that my answers are less precise. In the description, it says "The form of your solution should follow that in the text for square root." I assume that also includes the desired precision for the "good-enough?" function (which is 0.001 in the book). Are your answers using the precision from the book or a different precision value? If you are using a value other than 0.001, is there any documentation that says to use that precision?

Lastly, a question for Dr. Lusth: The book has a definition for good-enough?, but it also has an exercise that asks us to improve the good-enough? function (exercise 1.7). I am currently under the assumption that we are supposed to use the explicitly defined version. Is that correct?

You'll need more precision from your good-enough? function. Just test with adding more digits to get to the same results as in this thread.

If we are supposed to have more precision, you're correct. I think I may have been unclear in my first post, so let me try to clarify. The assignment says "The form of your solution should follow that in the text for square root". In the book, the precision used for the "good-enough?" function is 0.001. My interpretation of those two facts is that we are supposed to use 0.001 for the precision in "good-enough?" UNLESS Dr. Lusth has specified otherwise. 

I never asked how to make my answer more precise. I was suggesting that more precision (while desirable from a mathematical calculation standpoint) may not be what Dr. Lusth asked for, thereby making a "more precise" answer incorrect.
Reply
#15
(09-07-2017, 04:55 PM)jdhawley Wrote: If we are supposed to have more precision, you're correct. I think I may have been unclear in my first post, so let me try to clarify. The assignment says "The form of your solution should follow that in the text for square root". In the book, the precision used for the "good-enough?" function is 0.001. My interpretation of those two facts is that we are supposed to use 0.001 for the precision in "good-enough?" UNLESS Dr. Lusth has specified otherwise. 

I never asked how to make my answer more precise. I was suggesting that more precision (while desirable from a mathematical calculation standpoint) may not be what Dr. Lusth asked for, thereby making a "more precise" answer incorrect.

http://beastie.cs.ua.edu/mybb/showthread.php?tid=42
Reply
#16
(09-07-2017, 05:23 PM)james_h Wrote:
(09-07-2017, 04:55 PM)jdhawley Wrote: If we are supposed to have more precision, you're correct. I think I may have been unclear in my first post, so let me try to clarify. The assignment says "The form of your solution should follow that in the text for square root". In the book, the precision used for the "good-enough?" function is 0.001. My interpretation of those two facts is that we are supposed to use 0.001 for the precision in "good-enough?" UNLESS Dr. Lusth has specified otherwise. 

I never asked how to make my answer more precise. I was suggesting that more precision (while desirable from a mathematical calculation standpoint) may not be what Dr. Lusth asked for, thereby making a "more precise" answer incorrect.

http://beastie.cs.ua.edu/mybb/showthread.php?tid=42

That is exactly what I was looking for, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)