• May 06, 2021, 07:10:46 PM

Author Topic: (Question) Is There a C++ Complex Library for MPFR?  (Read 584 times)

0 Members and 1 Guest are viewing this topic.

marcm200

• 3d
• Posts: 959
(Question)Re: Is There a C++ Complex Library for MPFR?
« Reply #15 on: August 12, 2020, 09:26:41 AM »
If you need a control to check your results (I used it with my custInt and custComplex struct for the subdivision algorithm:

Code: [Select]
typedef double kviabase; // change to MPFR arbitrary precision floating point type typedef kv::interval<kviabase> kvia;typedef kv::complex<kvia> kvcplxia;// samplekvcplxia cpi=kvcplxia(kv::constants<kvia>::pi(),kvia(0));kvcplxia a=exp(2*cpi*kvcplxia(kvia(0),kvia(1))*cremer_number);
Afaik, this also should (I haven't tried) work with iabase being set to an MPFR datatype. But it is more fun to implement one's own class.

LionHeart

• Posts: 164
Re: Is There a C++ Complex Library for MPFR?
« Reply #16 on: August 12, 2020, 09:34:27 AM »
Hi marcm200,

I'm sorry, I don't understand what you are doing here. Please clarify.

Many thanks.
Paul the LionHeart

marcm200

• 3d
• Posts: 959
Re: Is There a C++ Complex Library for MPFR?
« Reply #17 on: August 12, 2020, 09:53:03 AM »
@LionHeart: The code posted is an example computing an interval enclosed value e^(2*i*pi*angle), currently with double precision as endpoints of the intervals (kviabase). If you set this to an MPFR type, you could compute a higher precision interval enclosure.

Computing the same formula with your BigDouble and BigComplex class at specific values or the angle, pi etc, you could then check if your result is near the interval (due to non-controlled rounding it might not be directly in).

I used this to compare my interval struct (double, complex and for small matrices)'s results to the ones computed with the kv library to see if my calculation path was correct. It was also a good means once I got stuck with my implementation to use the kv numbertype and continue writing the rest of the code (generating a subdivision image) - and then turn back to the struct code.

LionHeart

• Posts: 164
Re: Is There a C++ Complex Library for MPFR?
« Reply #18 on: August 12, 2020, 12:53:16 PM »
Thanks for explaining, marcm200.

I understand now. Using typedef is a clever way to do it.

Thanks.

Similar Topics

"Time Span"

Started by cricke49 on Fractal Image Gallery

0 Replies
920 Views
August 02, 2018, 07:05:21 AM
by cricke49
A new style of fractal imagery using fractal neural style transfer

Started by iRyanBell on Fractal Image Gallery

3 Replies
868 Views
October 03, 2020, 10:50:39 PM
by Jimw338
New Theory of Super-Real and Complex-Complex Numbers and Aleph-Null

Started by M8W on Fractal Mathematics And New Theories

2 Replies
698 Views
January 06, 2018, 08:40:15 AM
by M8W
heman library

Started by Adam Majewski on Programming

0 Replies
213 Views
November 30, 2019, 01:08:40 PM