Questions tagged [taylor-series]

A Taylor series is a representation of a function as an infinite sum of terms that are calculated from the values of the function's derivatives at a single point.

A Taylor series is a representation of a function as an infinite sum of terms that are calculated from the values of the function's derivatives at a single point.

Useful Links

256 questions
18
votes
3 answers

Picking good first estimates for Goldschmidt division

I'm calculating fixedpoint reciprocals in Q22.10 with Goldschmidt division for use in my software rasterizer on ARM. This is done by just setting the numerator to 1, i.e the numerator becomes the scalar on the first iteration. To be honest, I'm kind…
Mads Elvheim
10
votes
2 answers

expand 1 dim vector by using taylor series of log(1+e^x) in python

I need to non-linearly expand on each pixel value from 1 dim pixel vector with taylor series expansion of specific non-linear function (e^x or log(x) or log(1+e^x)), but my current implementation is not right to me at least based on taylor series…
9
votes
1 answer

How Were These Coefficients in a Polynomial Approximation for Sine Determined?

Background: I'm writing some geometry software in Java. I need the precision offered by Java's BigDecimal class. Since BigDecimal doesn't have support for trig functions, I thought I'd take a look at how Java implements the standard Math library…
freefall83
  • 145
  • 1
  • 7
7
votes
1 answer

How to implement maclaurin series in keras?

I am trying to implement expandable CNN by using maclaurin series. The basic idea is the first input node can be decomposed into multiple nodes with different orders and coefficients. Decomposing single nodes to multiple ones can generate different…
Jerry07
  • 929
  • 1
  • 10
  • 28
6
votes
1 answer

Multivariate Taylor series expansion in Mathematica

Mathematica seems to be missing a function for this, or I can't find it anyway. The Series function can do expansion in succession for multiple variables, but it doesn't seem capable of doing a full multivariate expansion. Does anyone know how to do…
Nick
  • 5,228
  • 9
  • 40
  • 69
6
votes
2 answers

Approximating cos using the Taylor series

I'm using the Taylors series to calculate the cos of a number, with small numbers the function returns accurate results for example cos(5) gives 0.28366218546322663. But with larger numbers it returns inaccurate results such as cos(1000) gives…
user9321739
6
votes
1 answer

Why does my Sympy code calculate the first order Taylor series approximation incorrectly?

I have an expression like this which is entered into Sympy like this (for the sake of a reproducible example in this question) from sympy import * expression = Add(Mul(Integer(-1), Float('0.9926375361451395', prec=2),…
Michael A
  • 4,391
  • 8
  • 34
  • 61
6
votes
3 answers

Best algorithm for series expansion of Rational function

I need to code function in C++ which efficiently finds coefficients of Taylor Series of given rational function (P(x) / Q(x)). Function parameters will be power of polynomials (equal in nominator and denominator), two arrays with coefficients of…
Somnium
  • 1,059
  • 1
  • 9
  • 34
5
votes
2 answers

implementation of using Maclaurin series of e^x in python

I have numpy array and I want to use power series like taylor series of e^x, and I am wondering how to implement this in python. For the simplicity purpose, I think I can use maclaurin series at x0=0, wheres x is numpy array. Basically, I have 1 dim…
kim
  • 556
  • 7
  • 28
5
votes
1 answer

Taylor series via F#

I'm trying to write Taylor series in F#. Have a look at my code let rec iter a b f i = if a > b then i; else f a (iter (a+1) b f i) let sum a b = iter a b (+) 0 // from 0 // e^x = 1 + x + (x^2)/2 + ... (x^n)/n! + ... let fact n = iter 1…
5
votes
1 answer

Assign Taylor expansion to function

When I use Maxima to calculate the Taylor series: f(x,y) := taylor((x+y)^3, [x, y], [2, 3], 2); f(2,3); /* error: wrong number of arguments */ Basically I want to define a function as a expansion of (x+y)^3, which takes in x,y as parameter. How…
gongzhitaao
  • 6,566
  • 3
  • 36
  • 44
4
votes
1 answer

Can't calculate e^(-x) for "high" x

This is my code: def fact(y): if y == 0: fact=1 return fact else: fact=1 for k in range (1, y+1): fact = fact * k return fact def e_negative_x(x): n=0 numerical_precesion=1 …
4
votes
1 answer

Haskell Function that calculates e^x

Implement a function that calculates the value of e ^ x, x is a parameter of the function, an integer. To do this, use the Taylor series expansion to calculate the potency of e. The function will receives as a parameter, in addition to the exponent…
4
votes
2 answers

Fast polynomial shift

I'm trying to implement "F. The convolution method" (section 2.2): from Fast algorithms for Taylor shifts and certain difference equations (at the bottom, or here): from math import factorial def convolve(f, h): g = [0] * (len(f) + len(h) -…
Ecir Hana
  • 10,864
  • 13
  • 67
  • 117
4
votes
1 answer

SymPy Taylor expansion for functions symbols

How can you perform a Taylor expansion with respect to function symbols in SymPy? For example from sympy import * ode = f(x).diff(x, 2) - sin(f(x)) We would like to linearize the differential equation by doing something like ode.series(f, 0, 1) to…
nicoguaro
  • 3,629
  • 1
  • 32
  • 57
1
2 3
17 18