Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Calculate series atom #56

Closed
levBagryansky opened this issue Nov 3, 2022 · 9 comments · Fixed by #65
Closed

Calculate series atom #56

levBagryansky opened this issue Nov 3, 2022 · 9 comments · Fixed by #65
Assignees

Comments

@levBagryansky
Copy link
Member

levBagryansky commented Nov 3, 2022

What if we introduce a new atom that calculates a series. So we could implement sin, cos and and othe trigonometric functions via Taylor series. It would take a value and formula for coefficient of nth term. For example we could implement exp(x) by this:

[x] > exp
  calc-series > @
    x
    "1/n!"

We need to give coefficient of nth term somehow.
@Graur @EugeneDar @includealex what do you think?

@includealex
Copy link
Contributor

includealex commented Nov 3, 2022

@levBagryansky what do you think about WolframAlpha syntax to use it instead of given string? For instanse,
$$\sum_{k=0}^n x^k$$
would be written as

"sum x^k, k=0 to n"

@EugeneDar
Copy link
Member

EugeneDar commented Nov 3, 2022

@levBagryansky I think if you have posibilty to use strings what prevents us from writing like this "sin 10" and calculating it via Java.
I think this is a bad solution, perhaps there is a way to unify the parameters by which you can uniquely set the series. For example: step, whether the sign changes, etc..

@levBagryansky
Copy link
Member Author

@levBagryansky I think if you have posibilty to use strings what prevents us from writing like this "sin 10" and calculating it via Java. I think this is a bad solution, perhaps there is a way to unify the parameters by which you can uniquely set the series. For example: step, whether the sign changes, etc..

What do you mean? The strings must be written by dedicated sample so "sin 10" would not compiled.

@levBagryansky
Copy link
Member Author

levBagryansky commented Nov 3, 2022

@Graur May be it would be better to implement this in eo. Accuracy would be worse but we could give a function like this:

[x] > exp
  calc-series > @
    x
    [n]
      div.
        1
        factorial.
          n

@Graur
Copy link
Contributor

Graur commented Nov 3, 2022

@levBagryansky Tailor series sounds good to me. But maybe we can read more about Chebyshev Polynomials first? Since this algorithm is used in Java and C libraries, as far as I know.
@yegor256 What do you think about implementation of trigonometric functions via Tailor series?

@yegor256
Copy link
Member

yegor256 commented Nov 3, 2022

@levBagryansky @Graur I like the idea, but I would call the atom taylor

@levBagryansky
Copy link
Member Author

@Graur please assign me

@0pdd
Copy link

0pdd commented Nov 10, 2022

@levBagryansky 4 puzzles #79, #81, #82, #83 are still not solved.

@0pdd
Copy link

0pdd commented Nov 13, 2022

@levBagryansky 3 puzzles #79, #81, #82 are still not solved; solved: #83.

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

Successfully merging a pull request may close this issue.

6 participants