Jump to content

Minkowski question-mark function: Difference between revisions

m
J: remove some silliness, add a small but movtivating example
m (J: make it easier to experiment with longer continued fractions (though it's not clear that this length should match for minkowski and its inverse))
m (J: remove some silliness, add a small but movtivating example)
Line 479:
node=. t (1-b)} node
end.
(<.y)+B+/ .*2x2^-1+i.ITERCOUNT
}}
 
invmink=: {{
f=. 1|y
Line 492:
end.
f=. f*2
c=. -.b=. 1 >`<@.cur f
cf=. cf,c(-.b)#cnt
cnt=. 1+b*cnt
cur=. cur=b
Line 514:
3.53553
minkowski invmink (p:%%:)2
3.53553</lang>
*:invmink 1.4 NB. square of inverse minkowski of 1.4
2</lang>
 
That said, note that this algorithm introduces significant numeric instability for √7 divided by 3:
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.