Euclidean Affine Functions and Applications to Calendar Algorithms

02/13/2021
by   Cassio Neri, et al.
0

We study properties of Euclidean affine functions (EAFs), namely those of the form f(r) = (α· r + β)/δ, and their closely related expression f(r) = (α· r + β)%δ, where r, α, β and δ are integers, and where / and % respectively denote the quotient and remainder of Euclidean division. We derive algebraic relations and numerical approximations that are important for the efficient evaluation of these expressions in modern CPUs. Since simple division and remainder are particular cases of EAFs (when α = 1 and β = 0), the optimisations proposed in this paper can also be appplied to them. Such expressions appear in some of the most common tasks in any computer system, such as printing numbers, times and dates. We use calendar calculations as the main application example because it is richer with respect to the number of EAFs employed. Specifically, the main application presented in this article relates to Gregorian calendar algorithms. We will show how they can be implemented substantially more efficiently than is currently the case in widely used C, C++, C# and Java open source libraries. Gains in speed of a factor of two or more are common.

READ FULL TEXT

page 22

page 23

research
01/24/2022

Euclidean and Affine Curve Reconstruction

We consider practical aspects of reconstructing planar curves with presc...
research
03/25/2021

Beyond permutation equivariance in graph networks

We introduce a novel architecture for graph networks which is equivarian...
research
01/06/2022

Simple algorithm for GCD of polynomials

Based on the Bezout approach we propose a simple algorithm to determine ...
research
02/03/2016

Division and Slope Factorization of p-Adic Polynomials

We study two important operations on polynomials defined over complete d...
research
08/08/2020

dxo: A System for Relational Algebra and Differentiation

We present dxo, a relational system for algebra and differentiation, wri...
research
01/26/2023

On simulation of continuous determinantal point processes

We review how to simulate continuous determinantal point processes (DPPs...

Please sign up or login with your details

Forgot password? Click here to reset