ulfjack / ryu

Converts floating point numbers to decimal strings
Apache License 2.0
1.19k stars 99 forks source link

optimized ryu version for 'long doubles'? ( real 80-bit figures, not 'fake-long' ) - enhancement proposal - #212

Open newbie-02 opened 2 years ago

newbie-02 commented 2 years ago

hello @ all,
Can anyone code such a thing, an 'ld2s'?
I have managed with some newbie difficulties to use d2s in another program. Since I also need a solution for 80-bit long doubles I have to use 'generic128' so far and this is really slow :-( .
I was thinking if a similar optimized solution like d2s is also possible for 80-bit values, and as e.g. the significant ( mantissa ) with 64 bit fits into a uint64_t it could possibly be straightforward, but also have pitfalls if ryu needs free bits in the figures, or bigger lookup tables would be necessary and become too big ... ??? .
Alas I'm lacking programming experience and e.g. understanding for the math details, use of intrinsics and lookup tables. I think all the necessary information is in the comments in the code and in https://dl.acm.org/doi/pdf/10.1145/3296979.3192369, but I don't have the time to work through it.
If someone can do this, code an optimized 'ld2s'?, he could do me and possibly many other people a big favor ... and! improve ryu.
( against doubletes: i have placed a similar request at https://codereview.stackexchange.com/questions/276496/seeking-performance-improvement-for-a-clean-c-coded-fp-value-to-string-convers )