Comments (3)
OK, this is turning out to be harder than I thought. I've coded up a solution that I think works for integer-height (and infinite-height) tetration, but in order to do fractional height I need layeradd to work for these small bases, which means I need an idea of what slog means on these smaller bases. slog_1.3(20) sure seems meaningless since no power tower of only 1.3s will ever get up to 20, but whatever it is, slog_1.3(1.3^20) (1.3^20 is around 190.0496377) should be 1 more than it.
The solution I'm thinking of is to write a function called "excess_slog", so named because it handles numbers that are above ("in excess of") the limit of usual slog for these smaller bases. excess_slog returns a pair (an array of two entries since this is TypeScript rather than a language with built-in tuples) whose first entry is a Decimal and whose second entry is a number - that number is either 0, 1, or 2. If it's 0, that means it's the usual slog, which operates in the lower range (the value is below the lower b^x = x solution) - for example, excess_slog(1.4, 1.3), i.e. the base 1.3 slog of 1.4, would return [1.9393492860381027, 0]. If the number is 1, that means we're in the middle range (the value is between the two b^x = x solutions - in this range, slog of the upper solution is -Infinity and slog of the lower solution is +Infinity, so slog is actually decreasing), and if the number is 2, that means we're in the upper range (slog of the upper solution is -Infinity here too). What I'm unsure of is what should be set as the 0 value for each range. For range 0, obviously excess_slog(1) is [0, 0], but what about the other two? I'm thinking I use the geometric mean of the two b^x = x solutions as the 0 value for range 1 (since those are the endpoints of range 1), but since range 2 only has a left endpoint (it shoots off to infinity on the right), I can't think of any choice for excess_slog(x) = [0, 2] that isn't arbitrary - the ideas that have come to my mind all involve the upper b^x = x solution (I'll call it "u" here), such as u + 1, u * 2, u^2, or perhaps u * l (where l is the lower b^x = x solution), but all of those are pretty arbitrary.
Any thoughts on this idea? Is the two-element array approach to return both a value and the range it's in a good idea, or do you have a better one? What should I use as the 0 values in the middle and high ranges of this "excess_slog" function? And if I do make the excess_slog function, should it be public like the rest of the Decimal functions, or do we say "every other Decimal function returns something like a number, a boolean, or another Decimal, an array of a Decimal and a number would be too confusing, so just make it private"?
from break_eternity.js.
Hmm, this sounds a bit above my paygrade (unless I spent time of my own researching it). It'd be great if we had arbitrary analytical tetration at this point but it remains hard to port to javascript :p I would suggest:
- This sounds extremely like an internal implementation detail, so keep it private.
- However you implement it, come up with some unit tests that make reasonable assertions on how it works. That way, it doesn't matter how it's implemented as long as it satisfies the unit tests.
from break_eternity.js.
Fixed.
from break_eternity.js.
Related Issues (20)
- Documentation - Read.me - weirdy weirdo HOT 8
- Can't convert BigInt to Decimal without setting its value to 0 HOT 8
- different results when expexting the same result HOT 5
- `Decimal.lambertw("ee4992767175317001")` errors instead of returning a value HOT 2
- The next step HOT 5
- [enhancement] I think I’ve figured out how to do arbitrary-height super-roots. HOT 3
- Wrong String for reciprocals HOT 1
- Wrong factorial approximation HOT 3
- `Decimal.lambertw` occasionally spikes with inputs around the ee31 range HOT 1
- Unexpected NaN from sqrt() HOT 1
- Decimal.isValid() ?
- `new Decimal("(e^x)1")` returns `Decimal` with fractional `layer` if `x` is not an integer HOT 1
- `new Decimal("(e^x)1")` returns `Decimal` with negative `layer` if `x` is negative HOT 1
- The normalization of `new Decimal(-Infinity)` breaks some operations and may be incorrect HOT 3
- Throws a TypeError with standard EcmaScript class fields
- Max Value constant HOT 8
- Some constants don't match break_infinity.js documentation HOT 6
- -Infinity times -Infinity is Infinity, not -Infinity. HOT 1
- new Decimal(2).pow(3) is 7.999999999999999 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from break_eternity.js.