Spur: Kernel-nice.843.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Spur: Kernel-nice.843.mcz

commits-2
Eliot Miranda uploaded a new version of Kernel to project Spur:
http://source.squeak.org/spur/Kernel-nice.843.mcz

==================== Summary ====================

Name: Kernel-nice.843
Author: eem
Time: 10 May 2014, 3:17:03.03 pm
UUID: c64204a7-6b8c-46ca-8f22-75808e3cf017
Ancestors: Kernel-nice.843

Kernel-nice.843 patched for Spur by SpurBootstrapMonticelloPackagePatcher Cog-eem.150

Correct the bug I introduced for large integer sqrtFloor.

If receiver was of the form 2^2n*u
we did answer 2^n *E(sqrt(u))

But sqrt(u) = E(sqrt(u)) + residue
where 0<=residue<1
And result is rather
        E(2^n*sqrt(u))
        = E( 2^n*(E(sqrt(u)) + residue))
        = 2^n*E(sqrt(u)) + E(2^n*residue)

As 2^n * residue can be big (superior to 1), we miss the correct value by default.

If we want to correct this, an approximation of residue is (u-E(sqrt(u))^2) / 2 E(sqrt(u))
This is more or less like super Newton-Raphson inner loop...
It would be possible to duplicate super work, but I feel like it's adding too much complexity for small reward, so I prefer to remove offending code for now

=============== Diff against Kernel-nice.843 ===============