# Benchmarking programming languages using the Leibniz formula for calculating π

**URL:** <https://racket.discourse.group/t/benchmarking-programming-languages-using-the-leibniz-formula-for-calculating/4059>\
**Category:** General\
**Created:** [December 28, 2025, 1:39am UTC](https://racket.discourse.group/t/benchmarking-programming-languages-using-the-leibniz-formula-for-calculating/4059 "2025-12-28T01:39:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gus-massa](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/gus-massa/32/507_2.png) [@gus-massa](https://racket.discourse.group/u/gus-massa)\
**Post date:** [December 28, 2025, 1:39am UTC](https://racket.discourse.group/t/benchmarking-programming-languages-using-the-leibniz-formula-for-calculating/4059/1 "2025-12-28T01:39:20Z")

</div>

After reading at [Speed Comparison - Programming Languages](https://niklas-heer.github.io/speed-comparison/) I took a look at the Racket code to see if there is something interesting. The last line of [speed-comparison/src/leibniz.rkt at master · niklas-heer/speed-comparison · GitHub](https://github.com/niklas-heer/speed-comparison/blob/master/src/leibniz.rkt#L17) says (I removed `unsafe`. to make it easier to read)

`(fl+ pie (fl/ x (fl- (fl* 2.0 (fx->fl i)) 1.0)))`

It's obviously better to calculate

`(fl+ pie (fl/ x (fx->fl (fx- (fx* 2 i) 1))))`

but when I run the code I get almost the same time. I expect`a tiny difference, like a .5%, but I only get noise. It's actually too noisy.

Why??? Is the floating point fast enough now? Does the pipeline hide the difference? Am I missing something?
