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

Use tanh-sinh algorithm to integrate and improve differenate precision #158

Merged
merged 10 commits into from
Aug 7, 2024

Conversation

BenderBlog
Copy link
Contributor

  1. tanh-sinh algorithm

Introduction at here, ported code from here. Testing use case from here.

Almost all test cases passed, except 22 of them with larger but considerable errors , and 8 of them cannot be handled both xcas and kalker:P

With this method, functions with one or two singular points can be integrated. For example:

Original Kalk

>> integral(-1,1,(1-x^2)^(-1/2),dx)
≈ Not defined.

With this

>> integral(-1,1,(1-x^2)^(-1/2),dx)
≈ 3.1415926469 ≈ π
  1. differentiation percision

I changed the code with the formula I found from here, and changed almost everything to KalkValue.

The original code, too confusion:

>> f(x)=x^4
>> f(3)
= 81
>> f'(3)
≈ 108
>> f''(3)
≈ 108
>> f'''(3)
≈ 38.99999
>> f''''(3)
≈ 14
>> f'''''(3)
≈ 24 749 993 000 000.001119983 ≈ 2.4749993×10^13

The changed code:

>> f(x)=x^4
>> f(3)
= 81
>> f'(3)
≈ 108
>> f''(3)
≈ 108
>> f'''(3)
≈ 72
>> f''''(3)
≈ 24
>> f'''''(3)
≈ 0 

@PaddiM8 PaddiM8 merged commit c998d0e into PaddiM8:master Aug 7, 2024
2 checks passed
@PaddiM8
Copy link
Owner

PaddiM8 commented Aug 7, 2024

Thank you! This is great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants