Not the most original thing to read (especially for someone like me with a math background), but I did like the idea about how to get the initial guess _a lot_. It's a very useful idea that can be used for other functions as well, as long as you can get a general idea of the order of magnitude of the solution (which is what it does here).
I know it isn't always interesting to all people, but I try to give a bit of background to such things before jumping into my actual code. A lot of people are not likely familiar with Newton's method, or this type of iterative processing at all.
Yes, I'm happy with how I got the initial guess. I was reading up on how to do that step and didn't see that approach (I'm sure it must be known, given it's obviousness, just that I didn't read enough). Given that the numbers are stored in base 2, with a normalized significand, this initial guess is amazingly close to the correct value allowing a very low number of iterations.
Oh, I absolutely agree that the introduction was necessary. And I loved the trick. But let's say that I might have ended up not finding out about it if I didn't have the patience to go through the whole article. Maybe a small hint at the beginning that it's not just a presentation of Newton's method at the beginning might be a little more enticing.
It's all of course tentative syntax at the moment. I thik most of what is there will be similar in the end, but I'm leaving it open to change whatever I want. :)
8 comments
4 u/bilog78 29 Jul 2015 07:05
Not the most original thing to read (especially for someone like me with a math background), but I did like the idea about how to get the initial guess _a lot_. It's a very useful idea that can be used for other functions as well, as long as you can get a general idea of the order of magnitude of the solution (which is what it does here).
2 u/mortoray [OP] 29 Jul 2015 08:37
I know it isn't always interesting to all people, but I try to give a bit of background to such things before jumping into my actual code. A lot of people are not likely familiar with Newton's method, or this type of iterative processing at all.
Yes, I'm happy with how I got the initial guess. I was reading up on how to do that step and didn't see that approach (I'm sure it must be known, given it's obviousness, just that I didn't read enough). Given that the numbers are stored in base 2, with a normalized significand, this initial guess is amazingly close to the correct value allowing a very low number of iterations.
0 u/bilog78 29 Jul 2015 11:22
Oh, I absolutely agree that the introduction was necessary. And I loved the trick. But let's say that I might have ended up not finding out about it if I didn't have the patience to go through the whole article. Maybe a small hint at the beginning that it's not just a presentation of Newton's method at the beginning might be a little more enticing.
0 u/RaptorSixFour 29 Jul 2015 07:54
Off topic: Leaf looks a lot like a mix of verilog and C.
0 u/mortoray [OP] 29 Jul 2015 08:31
It's all of course tentative syntax at the moment. I thik most of what is there will be similar in the end, but I'm leaving it open to change whatever I want. :)
0 u/RaptorSixFour 29 Jul 2015 08:37
Are you producing Leaf?
1 u/mortoray [OP] 29 Jul 2015 08:40
Yes. I'm trying to create a language that is very modern and without suffering from backwards compatibility overload.