.
D 2011-06-29T19:19:34
J assignee kennykb
J cmimetype text/plain
J comment \n[10:04]\s\s\s\s<yukonbob>\shttp://www.serpentine.com/blog/2011/06/29/here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/\n[10:04]\s\s\s\s<yukonbob>\s\s\s\s^---\sfloating\spoint\srendering\n\n\n<excerpt\sfrom\sthe\smiddle>\n[...]\sBut\show\ssolved\swas\sthe\sproblem?\sDragon4\sand\sits\sderivatives\sare\scomplicated\sand\stricky,\sand\sthey\shave\sa\shefty\sperformance\scost,\ssince\sthey\srely\son\sarbitrary-precision\sinteger\sarithmetic\sto\scompute\stheir\sresults.\sThere\smight\sbe\sa\ssignificant\sperformance\simprovement\sto\sbe\sgained\sif\ssomeone\scould\sfigure\sout\show\sto\suse\snative\smachine\sintegers\sinstead.\n\nIn\s2010,\sFlorian\sLoitsch\spublished\sa\swonderful\spaper\sin\sPLDI,\s"Printing\sfloating-point\snumbers\squickly\sand\saccurately\swith\sintegers"\s[1],\swhich\srepresents\sthe\sbiggest\sstep\sin\sthis\sfield\sin\s20\syears:\she\smostly\sfigured\sout\show\sto\suse\smachine\sintegers\sto\sperform\saccurate\srendering!\sWhy\sdo\sI\ssay\s"mostly"?\sBecause\salthough\sLoitsch's\s"Grisu3"\salgorithm\sis\svery\sfast,\sit\sgives\sup\son\sabout\s0.5%\sof\snumbers,\sin\swhich\scase\syou\shave\sto\sfall\sback\sto\sDragon4\sor\sa\sderivative.\n\nIf\syou're\sa\slanguage\sruntime\sauthor,\sthe\sGrisu\salgorithms\sare\sa\sbig\sdeal:\sGrisu3\sis\sabout\s5\stimes\sfaster\sthan\sthe\salgorithm\sused\sby\sprintf\sin\sGNU\slibc,\sfor\sinstance\s[...]\n</excerpt>\n\n[1]\shttp://florian.loitsch.com/publications/dtoa-pldi2010.pdf?attredirects=0\n\s\s\s\scode:\shttp://code.google.com/p/double-conversion\s\n\n[12:08]kbkaku,\syukonbob\s-\sThanks\sfor\sthe\sGrisu\spaper.\sOur\sfp\sconversion\shas\sa\s*different*\sset\sof\simprovements\sover\sSteele-White,\sGay,\sand\sBurger-Dybvig.\sEssentially,\sour\scode\sruns\sBurger-Dybvig\sbut\swith\soptimizations\sto\s(1)\sreplace\sthe\sbignum\sarithmetic\swith\sint64\sarithmetic\sif\sthe\snumber\sto\sformat\sis\sin\sthe\srange\s[1.0e-3,1.0e+24),\s(2)\sreplace\smp\sdivisions\sby\spowers\sof\s2\swith\sdigit\sshifts.\n[12:09]kbkI\ssuspect\sGrisu\swould\sbe\sa\sBig\sWin\sfor\sformatting\snumbers\slarger\sthan\s1.0e+24,\sand\sonly\sa\ssmaller\swin\sfor\snumbers\sin\sthe\srange\swhere\sthe\sint64\strick\sworks.\s\sNo\stime\sto\schase\sit\sat\sthe\smoment,\sbut\sopen\san\sRFE.\n
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter andreas_kupries
J subsystem 48.\sNumber\sHandling
J title Look\sinto\sintegration\sof\sgrisu\sfp\srendering
J type RFE
K 3344651fffffffffffffffffffffffffffffffff
U andreas_kupries
Z af64b08cc05f1a8201427291f0b7e31f