Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement arbitrary height analytic sroot (probably through trial and error?) #8

Open
Patashu opened this issue Mar 15, 2019 · 11 comments
Labels
only if you're bored very difficult or of dubious value

Comments

@Patashu
Copy link
Owner

Patashu commented Mar 15, 2019

https://en.wikipedia.org/wiki/Tetration#Inverse_operations

neither seems to have a simple recursive definition, so this is annoying ™️.

@Patashu Patashu added the only if you're bored very difficult or of dubious value label Mar 15, 2019
@Patashu
Copy link
Owner Author

Patashu commented Mar 17, 2019

Oh, there's a slog approximation on its page:

https://en.wikipedia.org/wiki/Super-logarithm#Approximations

Maybe I could try it sometime.

https://en.wikipedia.org/wiki/Iterated_logarithm

'Iterated Logarithm" aka log* is almost the same too.

As for sroot, we can at least implement ssqrt if lambertw is implemented ( #6 ) and then see where we can go from there.

http://mrob.com/pub/math/largenum-3.html has an sroot approximation which is literally 'use Newton's Method'. Maybe this is useful, maybe not?

It also has an interesting example of slog10(), which looks like it's literally the 'extract the layer, mag becomes a fractional layer' operator.

@Patashu
Copy link
Owner Author

Patashu commented Mar 22, 2019

slog implemented - and since it uses the same linear approximation as tetrate, they are truly inverses of each other!

@Patashu Patashu changed the title implement slog and sroot (tetration inverses) implement slog and sroot (tetration inverses) (slog done!) Apr 2, 2019
@Patashu Patashu changed the title implement slog and sroot (tetration inverses) (slog done!) implement arbitrary height sroot (probably through trial and error?) Apr 16, 2019
@Patashu
Copy link
Owner Author

Patashu commented Jul 23, 2022

This is still an open issue. Now that slog uses guess-and-check to get exact values, the precedent has been set to write an sroot that accepts arbitrary arguments. Of course, there's a lot of fiddly work with edge cases, and how to find the first guess is a good question, but I think this would be good to solve.

EDIT: I think the trick is to binary search on slog representation. If you start with a good guess (and I think a good guess is 'N layers down where N is the sradical, but don't go below 1, and be very careful how far you step when you're below 1 (or some similar constant), but otherwise double until you change directions then halve after that) then I think you'll converge quickly. In the worst case you could need 1000 iterations but I think in practice this would only need 50ish, like new slog. It's likely to end up slow, but it's more important to be right than slow, especially if you give the user controls to decide how right/slow they want to be. Also, the algorithm needs to terminate when the value stops changing.

@jakub791
Copy link

jakub791 commented Aug 29, 2022

Isn't this just like root but you tetrate instead of exponentiate?

@Patashu
Copy link
Owner Author

Patashu commented Aug 29, 2022

Yep! Specifically if a^^b == c, then sroot_b(c) == a

@jakub791
Copy link

jakub791 commented Aug 29, 2022

Or is tetration to numbers below 1 but greater than 0 not implemented?

@Patashu
Copy link
Owner Author

Patashu commented Aug 29, 2022

Works great.

new Decimal(10).tetrate(0.9).toString()
'6.989961179534713'
new Decimal(10).tetrate(0.5).toString()
'2.4770056063449646'

@jakub791
Copy link

Then couldn't you implement sroot like root but with tetrate instead of pow?

@MathCookie17
Copy link
Collaborator

This issue should be closed now - I implemented linear_sroot (arbitrary-height sroot for the linear approximation) in 1.4.0, and as long as the analytic approximation isn't extended to all bases, sroot for it doesn't make sense.

@Patashu
Copy link
Owner Author

Patashu commented Feb 20, 2024

I still think that analytic arbitrary base tetration is something this library should have, but I don't anticipate it any time soon due to the high difficulty.

@MathCookie17 MathCookie17 changed the title implement arbitrary height sroot (probably through trial and error?) implement arbitrary height analytic sroot (probably through trial and error?) May 29, 2024
@MathCookie17
Copy link
Collaborator

Changed the title, since linear sroot is implemented already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
only if you're bored very difficult or of dubious value
Projects
None yet
Development

No branches or pull requests

3 participants