Talk:Square root by hand: Difference between revisions

From Rosetta Code
Content added Content deleted
m (Thundergnat moved page Talk:Square Root by Hand to Talk:Square root by hand: Follow normal task title capitalization policy)
(→‎REXX: new section)
Line 8: Line 8:
The task description should be more specific regarding meaning of number. Perhaps including example test cases and output. Presumably the number should not be negative. Should the output include the decimal point when and where appropriate? I'd suggest testing 2, 0.2 and 10.89, with output showing decimal point correctly. With √2 to 480 or 500 decimal places or integers.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 15:38, 14 October 2020 (UTC)
The task description should be more specific regarding meaning of number. Perhaps including example test cases and output. Presumably the number should not be negative. Should the output include the decimal point when and where appropriate? I'd suggest testing 2, 0.2 and 10.89, with output showing decimal point correctly. With √2 to 480 or 500 decimal places or integers.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 15:38, 14 October 2020 (UTC)
: spigot_sqrt(pi_to_100dp), squared, to 100dp? - not sure how much of a stress test that really is.. (my maths is so crap I expected the root would have to be accurate to maybe 200dp, or at least 150dp, but apparently not.) --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 14:59, 15 October 2020 (UTC)
: spigot_sqrt(pi_to_100dp), squared, to 100dp? - not sure how much of a stress test that really is.. (my maths is so crap I expected the root would have to be accurate to maybe 200dp, or at least 150dp, but apparently not.) --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 14:59, 15 October 2020 (UTC)

== REXX ==

What is the meaning of the second argument?

The REXX Version shows:
<pre>
output when using the inputs of: .2 80

.4472135954999579392818347337462552470881236719223051448541794490821041851275609
</pre>
If 80 digits are required, the result should be
<pre>
.44721359549995793928183473374625524708812367192230514485417944908210418512756098
</pre>
--Walter Pachl 16:17, 1 August 2021 (UTC)

Revision as of 16:17, 1 August 2021

Weaknesses of initial VB.NET algorithm

Just noting where improvements could be made...
1. Depends on BigIntegers, which start consuming a considerable amount of memory as the number of digits escalates.
2. Computes and checks 1 to ten "next" digits (average 5?) instead of predicting a guess, then checking it once or twice.--Enter your username (talk) 20:31, 12 October 2020 (UTC)

At heart, it appears to be the same algorithm as my Phix entry, just "de-generalised". --Pete Lomax (talk) 23:45, 12 October 2020 (UTC)

What is a number?

The task description should be more specific regarding meaning of number. Perhaps including example test cases and output. Presumably the number should not be negative. Should the output include the decimal point when and where appropriate? I'd suggest testing 2, 0.2 and 10.89, with output showing decimal point correctly. With √2 to 480 or 500 decimal places or integers.--Nigel Galloway (talk) 15:38, 14 October 2020 (UTC)

spigot_sqrt(pi_to_100dp), squared, to 100dp? - not sure how much of a stress test that really is.. (my maths is so crap I expected the root would have to be accurate to maybe 200dp, or at least 150dp, but apparently not.) --Pete Lomax (talk) 14:59, 15 October 2020 (UTC)

REXX

What is the meaning of the second argument?

The REXX Version shows:

output   when using the inputs of:     .2   80

.4472135954999579392818347337462552470881236719223051448541794490821041851275609

If 80 digits are required, the result should be

.44721359549995793928183473374625524708812367192230514485417944908210418512756098 

--Walter Pachl 16:17, 1 August 2021 (UTC)