Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Addition in logarithmic space is expensive, we don't have any neat ways of doing it. Options include:

* Converting back and forth to linear space, using exp and log functions, this is much slower than a regular multiplication.

* Evaluating a polynomial that approximates the logarithmic space add, this takes several multiplications, so also much slower.

In general we tend to use more additions than multiplications, so trading addition speed for multiplication speed is rarely a good idea, even 1 for 1. If we need a lot of exponentiation keeping some values in logarithmic space may be beneficial, but it has to be those rare cases only.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: