## Re: [Fractdev] Problems with Bignum sqrt() |

This message is part of the following thread: | |
---|---|

the complete thread tree sorted by date | |

Jonathan Osuch at | |

Hi Jonathan,

You're a genius :)

That fixed it.

Thanks a lot matie.

Paul.

-----Original Message-----

From: fractdev-bounces@??? [mailto:fractdev-bounces@mailman.xmission.com] On Behalf Of Jonathan Osuch

Sent: Wednesday, 15 February 2012 12:53 PM

To: Fractint developer's list

Subject: Re: [Fractdev] Problems with Bignum sqrt()

Paul,

*
*

> I have been experimenting with converting all the Tierazon fractals to

> bignum. The only one I struggled with uses sqrt_bf(). I notice that

> this isn’t used anywhere in fractint, so I’m not sure if anyone has

> played with it.

Try replacing the division call:

unsafe_div_bf(bftmp3, n, r);

with:

div_bf(bftmp3, n, r);

The problem with using the unsafe version is that both n and r get modified by the call and we use r in the line that follows the division.

*
*

> I wrote a simple test program to check sqrt_bf() and it seemed to work

> okay for low precision numbers.

This is because our 'estimate' of the square root is the result of the function call to sqrtl(), which should give good results.

Jonathan

_______________________________________________

Fractdev mailing list

Fractdev@???

http://mailman.xmission.com/cgi-bin/mailman/listinfo/fractdev

You're a genius :)

That fixed it.

Thanks a lot matie.

Paul.

---------------------------------------------------------- Paul de Leeuw Computers NSW Central Coast, Australia Email: pdeleeuw@??? www: <http://www.deleeuw.com.au> ABN 72 360 822 562 ----------------------------------------------------------

-----Original Message-----

From: fractdev-bounces@??? [mailto:fractdev-bounces@mailman.xmission.com] On Behalf Of Jonathan Osuch

Sent: Wednesday, 15 February 2012 12:53 PM

To: Fractint developer's list

Subject: Re: [Fractdev] Problems with Bignum sqrt()

Paul,

> I have been experimenting with converting all the Tierazon fractals to

> bignum. The only one I struggled with uses sqrt_bf(). I notice that

> this isn’t used anywhere in fractint, so I’m not sure if anyone has

> played with it.

Try replacing the division call:

unsafe_div_bf(bftmp3, n, r);

with:

div_bf(bftmp3, n, r);

The problem with using the unsafe version is that both n and r get modified by the call and we use r in the line that follows the division.

> I wrote a simple test program to check sqrt_bf() and it seemed to work

> okay for low precision numbers.

This is because our 'estimate' of the square root is the result of the function call to sqrtl(), which should give good results.

Jonathan

_______________________________________________

Fractdev mailing list

Fractdev@???

http://mailman.xmission.com/cgi-bin/mailman/listinfo/fractdev

This message was posted to the following mailing lists: | ||||
---|---|---|---|---|

FractdevMailing List Info | Nearby Messages | Re: [Fractdev] Problems with Bignum sqrt() | [Fractdev] ManpWIN now creates animated GIFs and MPEG-2 files directly |

XMission Mailing List Archives administrated by XMission Support | Lurker (version 2.3) |