Let continue the serie of computation of mathematical constants that we started with Euler Number. This time our target is π, the famous “3.14” ratio between circumference and diameter of a circle. Since out target is to compute one million digits in few minutes this post will use concept of code optimization. Like e, π… Continue reading One million digits of Pi

# Tag: algorithms

## A command line image reader

After some semi-serious posts about prime numbers and factorization, now it’s time to something lighter, related with the C ASCII webcam post. Hacking NASA… Suppose you are hacking NASA website using HTML. Obviously from the textual browser lynx since you are an hacker and you only use Linux terminal. Even better, in the order, you… Continue reading A command line image reader

## C code optimization of Matrix Multiplication – Part 2

Welcome in the second part of this first journey in C code optimization (first because I hope to show also FFT). We started in this post with several optimization techniques applied to the Matrix Multiplication, in particular: The result was interesting, since in the graph we could see the impact of the various levels of… Continue reading C code optimization of Matrix Multiplication – Part 2

## Pollard’s Rho Factoring Method

Finally it comes the weekend and you can go to the mountain, but as soon as you exit home and you reach the car you find a 2256+1 sleeping on the hood. You try to move it but it is too heavy. Oh no, again! you’ll have to factor it so you can move smaller… Continue reading Pollard’s Rho Factoring Method

## Trial Division and Eratosthene’s Sieve

Let’s suppose you change telephone number. Almost surely the first thing you think is “is my new phone number prime?”. Since the number is small the naive method “let’s try to divide the phone number by all numbers less than it” is good (at least if you do it with the computer). You can improve… Continue reading Trial Division and Eratosthene’s Sieve

## The Matrix Optimized: C code optimization of Matrix Multiplication – Part 1

I want to share an in depth experiment in code optimization the I did at least ten year ago during my PhD in high performance computing. I offer you to choice between two options: read this post or ignore this post. If you choose to skip this post your mind will stay safe, tomorrow you’ll… Continue reading The Matrix Optimized: C code optimization of Matrix Multiplication – Part 1