• April 14, 2021, 04:05:27 PM

Login with username, password and session length

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

0 Members and 1 Guest are viewing this topic.

Offline marcm200

  • 3d
  • ****
  • Posts: 953
(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;

// sample
kvcplxia 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.

Offline LionHeart

  • Uploader
  • *
  • Posts: 164
    • ManpWIN Fractal Generator
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

Offline marcm200

  • 3d
  • ****
  • Posts: 953
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.


Offline LionHeart

  • Uploader
  • *
  • Posts: 164
    • ManpWIN Fractal Generator
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.


xx
"Time Span"

Started by cricke49 on Fractal Image Gallery

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

Started by iRyanBell on Fractal Image Gallery

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

Started by M8W on Fractal Mathematics And New Theories

2 Replies
690 Views
Last post January 06, 2018, 08:40:15 AM
by M8W
xx
heman library

Started by Adam Majewski on Programming

0 Replies
208 Views
Last post November 30, 2019, 01:08:40 PM
by Adam Majewski
xx
The library [128000x72000]

Started by Deliberate Dendrite on Fractal Image Gallery

2 Replies
227 Views
Last post October 11, 2018, 02:08:27 PM
by Deliberate Dendrite