JuliaGeometry / GeometricalPredicates.jl

Fast and robust 2D & 3D incircle/intriangle/etc. for Julia
Other
57 stars 14 forks source link

Why are Float64's promoted to BigInt's? #9

Closed 0joshuaolson1 closed 9 years ago

0joshuaolson1 commented 9 years ago

Could DoubleDoubles be a possible intermediate-precision option?

skariel commented 9 years ago

no they can't, for e.g. for incircle in 3D you need to calculate the sign of a 4*4 matrix, that's a sum of terms each consisting of a multiplication of 4 integers which needs to be done exactly, to maximal precision. The information doesn't fit in a DoubleDouble, maybe in a Double^5... I don't know.

Anyway, because of the algorithm used to track errors, the BigInts are only used when really needed, which usually is a very rare event. So they are really not the bottleneck anymore. When just eliminating such BigInt operations to measure performcance I find obnly maybe 2% improvement overall....