I had the opportunity to try my Pi program on 4 different iPads to see what the speed differences were. I ran the program which is set to calculate 25,000 digits of Pi. I commented out the line that prints the digits. This was on an iPad 1, an iPad Air 1, an iPad Pro 1, and an iPad Air 3. I ran it several times on each iPad and selected the lowest time. Here are the results. You can try this on your iPad and post your time.
iPad 1 178 seconds
iPad Air 1 14.03 seconds
iPad Pro 1 7.19 seconds (12.9”)
iPad Air 3 4.93 seconds
function setup()
s=require("socket")
local digits=25000 -- number of digits of Pi
print("Calculating "..digits.." digits of pi.")
local pi,tab={},{}
local size=math.ceil(digits/7)+1
local size1=math.ceil(size*7)
local sum,carry,b,z2
local d1,d2=10000000,9999999
local str=""
start=s.gettime()
for z=0,size1 do
tab[z]=5*z+3
end
for t=1,size do
carry=0
for z=size1,0,-1 do
z2=z*z
sum=tab[z]*d1+carry
b=27*(z2+z)+6
tab[z]=sum%b
carry=(sum//b)*(2*z2-z)
end
tab[0]=sum%d1
table.insert(pi,sum//d1)
end
carry=0
for z=size,1,-1 do
b=pi[z]+carry
if b>d2 then
b=b-d1
carry=1
else
carry=0
end
pi[z]=string.format("%07d",b)
end
pi[1]="3.\
"
str=table.concat(pi)
--print(string.sub(str,1,digits+2))
print(digits.." digits of Pi in "..s.gettime()-start,"seconds")
end