Slow Erlang code to find Pythagorean triplets
Erlang runs on a VM, so you will get better performance on such a pure arithmetic computation by compiling it into native code using HIPE.

From the command line:

erlc +native slow.erl


Or from the Erlang shell:

1&gt; hipe:c(slow).


Or:

1&gt; c(slow, [native]).