Which programming language or a library can process Infinite Series?

后端 未结 13 1400
情书的邮戳
情书的邮戳 2021-02-03 23:46

Which programming language or a library is able to process infinite series (like geometric or harmonic)? It perhaps must have a database of some well-known series and automatica

13条回答
  •  醉梦人生
    2021-02-03 23:54

    There are two tools available in Haskell for this beyond simply supporting infinite lists.

    First there is a module that supports looking up sequences in OEIS. This can be applied to the first few terms of your series and can help you identify a series for which you don't know the closed form, etc. The other is the 'CReal' library of computable reals. If you have the ability to generate an ever improving bound on your value (i.e. by summing over the prefix, you can declare that as a computable real number which admits a partial ordering, etc. In many ways this gives you a value that you can use like the sum above.

    However in general computing the equality of two streams requires an oracle for the halting problem, so no language will do what you want in full generality, though some computer algebra systems like Mathematica can try.

提交回复
热议问题