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+/ .*
}}
invmink=: {{
f=. 1|y
Line 492:
end.
f=. f*2
cf=. cf,
cnt=. 1+b*cnt
cur=. cur=b
Line 514:
3.53553
minkowski invmink (p:%%:)2
3.53553
*: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:
|