質問

Does anyone have a recommendation I am working on Mac OSX and trying to write and run C++ code.

I am running the code to answer the mathematical question known as the "Tammes Problem". I have a gradient flow piece of code at the moment and it runs to distribute the points on the sphere and minimise the energy function. This works for Thomsons problem and low values of the t (the index in the energy function).

Tammes Problem is for t tending to infinity however and so I need to make t rather large. This is fine, however when I raise the distance between two points on my sphere to the power of t, the number gets really small (still positive), then by taking the reciprocal of this I get my energy which is then rather large. The issue is the energy looses accuracy as t increase which can be fixed with a bignum library. However if I want to find the size of the spherical caps on the sphere I need to rearrange the cosine rule to find the angle between the points. This therefore requires me to take the cosine of a number which is not acceptable due to GMP not supporting the cos function.

役に立ちましたか?

解決

Since you're familiar with GMP, I'd recommend MPFR. As well as using multiple precision floating-point arithmetic, it provides transcendental functions and rounding modes based on IEEE 754 (2008).

他のヒント

How about this library? Admittedly I haven't used it or GMP but it might work for your problem.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top