Mathematics

A collection of 15 posts

Jul 22, 2009

Generating π in Haskell

Haskell beats CL quite comfortably using the same algorithm : module Main( main ) where import System( getArgs ) arccot :: Integer -> Integer -> Integer arccot x unity = arccot' x unity 0 start 1 1 where

Jul 22, 2009

Generating π in CL (faster)

Thanks to metacircular for pointing out that (floor (/ x y)) can be written as (floor x y) while avoiding the intermediate rational. (defun machin-pi (digits) "Calculates PI digits using fixed point arithmetic and

Jul 21, 2009

Generating π in CL

Update 2009-07-23 : Faster version in CL and a Haskell version. ———————————————————————