Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:
Hmm, I tried-out a C implementation and the timings weren't bad, 60% slower in exchange for always being correctly rounded. Do you all think that would be worth it? # New correctly rounded $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.5, 0.3, 5.2)' 2000000 loops, best of 11: 101 nsec per loop $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.81)' 5000000 loops, best of 11: 82.8 nsec per loop # Current baseline for Python 3.10 $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.5, 0.3, 5.2)' 5000000 loops, best of 11: 65.6 nsec per loop $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.81)' 5000000 loops, best of 11: 56.6 nsec per loop # Current baseline for Python 3.9 $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.5, 0.3, 5.2)' 5000000 loops, best of 11: 72.2 nsec per loop ~/npython $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.81)' 5000000 loops, best of 11: 56.2 nsec per loop ---------- status: closed -> open _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41513> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com