Some facts:
Credit Suisse Group AG has bilanz sum (activa):
819’861'000'000 CHF
This is already more than 10^8 CHF.
Oracle Database has a Datatype Number, which
is up to 38 significant digits
https://docs.oracle.com/cd/B19306_01/olap.102/b14346/dml_datatypes002.htm
Java has a Datatype BigInteger, which
has so many digits, as your RAM gives you.
https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
With BigInteger you can easily compute with 10^604, your
infinity border. Here is an example calculation with your
infinity border:
?- X is 10^604, Y is root3(X).
X = 100000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000,
Y = 2154434690031883721759293566519350495259344942192108582
48923550634641110664834080018544150354324327610126122049178
09204465575051000832749571206753778093319327305836534892638
28125496931403878382796863315.
You can check yourself that Y is the 3rd root of your
infinity border, using an "interval" check:
?- ..., Z is Y^3, T is ((Y+1)^3).
Z = 9999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999
99999999999999999999999999997750102057162104088284680564669
06329302372725882236394411979142601586701096697325833038272
11015371495483174064309997945010904640277371399121069907211
47775295134486859541186906338398539485853664362726534562483
04768438514647915310208981117198217449183036698318772690132
35578427212210126762391487674849776130821581310109855310977
81940037654148392074565107575381404536559637168506668128772
421602229929780875,
T = 1000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000
00000000000000000000000000001167486855800044076551490961742
74030226777746338560948570718700020702006200455077369002599
33794251289072947331115796008962621274890224463044193957906
23841924795980966113071439520196292217875467250585002751912
69630965037754215005111365672656779271257954707540900288566
50400393928486225675250373749741520424378159614657348024167
91158910677412658485766019034535433985111016182941007036612
8562348786698738496
So all this hogwash about intervals works also if you
fix the width of an interval to lets say eps = 1/10^n.
You then need only one number to represent it.
For example if you have a grid 1000, you don't need two
numbers to represent the interval [1.414,1.415], you
could also say 1.4145 for example the middle of it.
So middle numbers would be intervals:
1.4145 = [1.414,1.415]
And non-middle numbers, would be just points:
1.414 = 1.414
1.415 = 1.415
So you only need an additional one bit. This was pursued
I guess in unums,
https://en.wikipedia.org/wiki/Unum_%28number_format%29
not 100%, its a little bit obscure what unums are, there
are different versions of it.
But lets assume we work with middle numbers only and
a fixed interval width, then most of the algorithms
boil down to some bisection. I used bisection for root3 above,
here is the code if isqrt,
square root. But the square root of 10^604 isn't very
interesting. Its just 10^302. But anyway, here have the
code of isqrt:
/**
* isqrt(X, Y):
* The predicate succeeds in Y with the integer square root of X.
*/
:- public isqrt/2.
isqrt(X, _) :- X < 0,
throw(error(evaluation_error(undefined),_)).
isqrt(0, R) :- !,
R = 0.
isqrt(X, Y) :-
Lo is 1<<((bitlength(X)-1)//2),
Hi is Lo*2,
sys_bisect(Lo, Hi, X, Y).
% sys_bisect(+Integer, +Integer, +Integer, -Integer)
:- private sys_bisect/4.
sys_bisect(Lo, Hi, X, Y) :-
Lo+1 < Hi, !,
M is (Lo+Hi)//2,
S is M*M,
sys_bisect(S, Lo, Hi, M, X, Y).
sys_bisect(Lo, _, _, Lo).
% sys_bisect(+Integer, +Integer, +Integer, +Integer, +Integer, -Integer)
:- private sys_bisect/6.
sys_bisect(S, Lo, _, M, X, Y) :- S > X, !,
sys_bisect(Lo, M, X, Y).
sys_bisect(S, _, Hi, M, X, Y) :- S < X, !,
sys_bisect(M, Hi, X, Y).
sys_bisect(_, _, _, Y, _, Y).
So basically you need an upper bound and a lower bound to do
your search efficiently. But if the curve you are searching is
not montone, you need to do other stuff. But a bound is
always helpful I guess.
You might find this bound interesting:
It is possible to determine the bounds of the roots of a polynomial
using Samuelson's inequality. This method is due to a paper by Laguerre.
https://en.wikipedia.org/wiki/Properties_of_polynomial_roots#Polynomials_with_real_roots
burs...@gmail.com schrieb: