1.83K subscribers
3.3K photos
132 videos
15 files
3.58K links
Блог со звёздочкой.

Много репостов, немножко программирования.

Небольшое прикольное комьюнити: @decltype_chat_ptr_t
Автор: @insert_reference_here
Download Telegram
Подъем к храму Ямадэра в префектуре Ямагата зимой.
#prog #rust #c #video

Unsafe Rust is not C

Или об отличиях в правилах, нарушение которых приводит в C и в Rust к UB, к чему UB может привести на практике и как эти правила выливаются в ограничения и возможности для оптимизации.
👍1👎1
Forwarded from You Had No Job
Корпоративная доставка лука
👎2
👎5
Forwarded from самвел
👎12👍7😁54💩2
#prog #java #python #article

Ладно бы система типов Java полна по Тьюрингу. Оказывается, к системе типов, задаваемых аннотациями типов Python, это тоже относится!
😱6👎1
👎3
Кстати, сегодня день программиста. Сочувствую всем пострад... В смысле, с праздником всех причастных!
20🎉11😱4👎1
Блог* pinned «Кстати, сегодня день программиста. Сочувствую всем пострад... В смысле, с праздником всех причастных!»
👎2👍1
Forwarded from THINGS PROGRAMMERS DO
👍176👎1
Forwarded from я что-то �� и всё ����
🔁 Rezard
👍14😁41👎1💩1
Forwarded from твиттота
10❤‍🔥4👎1🤯1
#prog #math #article

Написано на удивление доходчиво.

High Performance Correctly Rounded Math Libraries for 32-bit Floating Point Representations

Everyone uses math libraries (i.e., libm), which provide approximations for elementary functions. Surprisingly (or not), mainstream math libraries (i.e., Intel’s and GCC’s libm) do not produce correct results for several thousands of inputs! Developers of modern software systems are seldom aware of them, which affects the reproducibility and portability of software systems. This blog post describes our new method for synthesizing elementary functions that produces correct results for all inputs but is also significantly faster than the state of the art libraries, which have been optimized for decades.

<...>

The overall goal of our RLIBM project is to make correctly rounded elementary functions mandatory rather than a recommendation by the standards (at least for 32 bits or lower). In our RLIBM project, we have been making a case for generating polynomials that approximate the correctly rounded result of f(x) rather than the real value of f(x) because our goal is to generate correct, yet efficient implementations. By approximating the correctly rounded result, we consider both approximation errors (i.e., polynomial approximation) and rounding errors (i.e., with polynomial evaluation with finite precision representations), which enables the generation of correct results. One can use existing high-precision libraries, which are slow, to generate oracle correctly rounded results. Now our goal is to generate efficient polynomials that produce these correctly rounded results for all inputs. Given a correctly rounded result, there is an interval of real values around the correct result that the polynomial can produce, which still rounds to the correct result. This interval is the amount of freedom available that our polynomial generator has for a given input. Using this interval, our idea is to structure the problem of polynomial generation that produces correct results for all inputs as a linear programming (LP) problem. To scale to representations with a large number of inputs, we propose counterexample guided polynomial generation, generate piecewise polynomials rather than a single polynomial, and develop techniques that support various complex range reductions.
🔥2👍1👎1
#prog #math #article

И продолжение (в апреле этого года, кстати):

One Polynomial Approximation to Produce Correctly Rounded Results for Multiple Representations and Rounding Modes

In the previous SIGPLAN blog post, we described our previous results in the RLIBM project where we have developed a collection of correctly rounded and efficient elementary functions for the 32-bit float representation with a single rounding mode: round-to-nearest-ties-to-even mode.

While the round-to-nearest-ties-to-even rounding mode is the default IEEE-754 rounding mode, there are four other standard rounding modes specified in IEEE-754. Some of them are attractive for efficient hardware implementations. Further, there is active research to explore new variants of the floating point representation that trade-off the range of values that can be represented and the precision of each such value. Such representations include bfloat16 and tensorfloat32, which are becoming widely used and also have hardware support. The key research question in consideration in this post is the following: how can we extend the RLIBM approach to create a single implementation that produces correctly rounded results for multiple configurations (e.g., float, tensorfloat32, and bfloat16)?

One possible method to develop correctly rounded implementations is to create one for each configuration of the floating point representation and for each rounding mode. This is a perfectly valid strategy if there are only few such configurations. However, it is not suitable/appealing if we have to support hundreds of configurations. Further, using a correctly rounded polynomial for a particular configuration and a rounding mode for other configurations will result in incorrect results due to double rounding errors, which we explain later in this article.

In contrast, it will be ideal to create a single implementation that can produce correct results for all the supported configurations. This is exactly what we propose in our POPL 2022 distinguished paper. As before with the RLIBM project, we also make a case for generating polynomials that approximate the correctly rounded result of f(x) rather than the real value of f(x). Approximating the correctly rounded result considers both the approximation error and the rounding error. The RLIBM approach identifies the rounding interval for each correctly rounded result. Using this interval, it frames the problem of polynomial generation into a linear programming (LP) problem.

To create a single polynomial approximation that produces correct results for multiple representations and rounding modes, we propose to generate a polynomial that generates the correctly rounded result of f(x) using the non-standard round-to-odd rounding mode with 2 additional precision bits compared to the largest floating point representation that we wish to support. We provide a proof that this method produces correctly rounded results for multiple representations and for all the standard rounding modes.
👍3👎1