Taylor approximation: making a complicated function simple up close
Functions like sin x and eˣ are hard to work out by hand. But if you only look close to one point, you can imitate them almost exactly with a polynomial, which needs nothing but adding and multiplying. Raise the degree and watch the approximation hug the real function.
Short answer. Close to one point, any smooth function can be imitated by a polynomial. Match only the value there and you get a flat line (degree 0). Match the slope too and you get the tangent line (degree 1). Match how it bends as well and you get a parabola (degree 2). The higher the degree, the wider the range where it fits well. This is a Taylor approximation.
Drag the graph left and right, or type a number, to move the center a (the white dot). The dark curve is the real function, orange is the degree n approximation, and the green band is where the two differ by less than 0.05. In the formula, the orange part is the term added at this degree.
Definitions
For a function f and a center a, we define the following. is f differentiated k times, with and .
- Taylor polynomial
- If f is n times differentiable at a, the polynomial below is called the Taylor polynomial of degree n of f at a.
- Taylor series
- If f has derivatives of every order at a, the series below is called the Taylor series of f at a. It keeps adding the terms of the Taylor polynomial without end.
- Maclaurin series
- A Taylor series with center a = 0.
- remainder
- The difference between f and its Taylor polynomial of degree n, . If f is n + 1 times differentiable on an interval that contains a and x, then for some point c between a and x the formula below holds (Taylor's theorem).
- radius of convergence
- For a power series , it is the number R (0 ≤ R ≤ ∞) for which the following holds. The set of all x where the series converges is called the interval of convergence.
1. Up close, things get simple
If you zoom far enough into a curve, it looks almost straight. That straight line is the tangent line from the derivative page. A Taylor approximation goes one step further. Instead of a line, it uses a parabola, a cubic, and other polynomials of higher degree, so it can imitate the curve over a wider range.
A polynomial is a formula made only of multiplying x by itself and adding (for example 1 + x + x²/2). Computers and people can work it out easily. sin and eˣ are not like that. That is why turning a hard function into an easy polynomial shows up all over math and engineering.
Here is how the imitation works. Pick one point a as the center. At that point, match the real function one property at a time.
| Degree | What it matches at the center | Shape | Formula |
|---|---|---|---|
| 0 | value f(a) | flat line | f(a) |
| 1 | value + slope f′(a) | tangent line | f(a) + f′(a)(x − a) |
| 2 | value + slope + bend f″(a) | parabola | degree 1 + f″(a)(x − a)² ÷ 2 |
| n | everything up to the n-th derivative | degree n polynomial | the formula in section 2 |
The bend is how fast the slope changes. It is the derivative of the slope, that is f″ (the second derivative). If f″ is positive, the curve opens upward like a cup (∪, convex). If it is negative, it opens downward like a hill (∩, concave).
Try this. ① As it starts (sin x, center 0, degree 3), the formula is x − x³/6 and the green band goes from −1.45 to 1.45. ② Press "Add one degree at a time" and terms are added one by one from degree 0 to 12. The right end of the band moves out to 0.05, 0.67, 1.45, 2.22, 3, 3.77, and reaches the edge of the graph (4) at degree 11. At even degrees the band stays the same, because the even degree terms of sin are 0. ③ Pick cos x, set the center to 1 and the degree to 4. The band contains the center 1 and goes from −0.55 to 2.45. The center does not have to be 0. ④ Pick ln(1 + x). Even at degree 12, the band only goes from −0.85 to 1.02. It does not spread to the edges like sin does. Section 6 explains why. ⑤ For √(1 + x), the right end of the band is 1.3 at degree 5 but 1.24 at degree 12. It actually shrinks.
2. The Taylor formula: what each term means
If you keep raising the degree, the formula looks like this.
Why each coefficient is f⁽ⁿ⁾(a) ÷ n! is worked out one coefficient at a time in section 3.
| Term | Meaning |
|---|---|
f(a) | Starting height. The value at the center |
f′(a)(x − a) | Slope × distance from the center. How far you get by following the slope at that point |
f″(a)(x − a)² ÷ 2! | Correction for the bend. It uses the distance squared, so it is tiny up close and grows as you move away |
f‴(a)(x − a)³ ÷ 3! | Correction for how the bend itself changes |
f⁽ⁿ⁾(a)(x − a)ⁿ ÷ n! | The n-th correction. If the distance is less than 1, it gets smaller as n grows |
Later terms multiply (x − a) by itself more times. Close to the center this distance is small, so later terms shrink fast and the first few terms are enough. Far away, the powers of the distance get large, so you need later terms too. That is why the band in the lab spreads outward as you raise the degree.
The sum of all terms forever is called the Taylor series. The polynomial you get by stopping after a few terms is called a Taylor polynomial. When the center is 0, it has its own name, the Maclaurin series. The phrase "adding forever gets closer to the real value" is made precise with a limit.
3. How the formula is built: matching one coefficient at a time
You do not have to memorize the coefficient f⁽ⁿ⁾(a) ÷ n! from section 2. Write down a polynomial, then pick its coefficients one by one so that it matches the real function at the center, and the formula falls out. Below, we do this for eˣ at center 0 (the same function as the hand example in section 4). With the center at 0, x − a is just x, so the formulas stay short.
| At x = 0 | eˣ | polynomial p | so |
|---|
Press "Next" to go one step at a time. In the formula, the orange part is the piece picked at this step. In the graph, the orange curve is the approximation drawn from the coefficients picked so far, and the faded orange curves are the earlier steps. Coefficients not picked yet are drawn as 0. The table compares eˣ and the polynomial p at x = 0.
Written only as formulas, the steps above are:
- Set up a polynomial:
p(x) = c₀ + c₁x + c₂x² + c₃x³. Pick four numbers and you have one curve. - Match the value:
c₀ = f(0). Put in x = 0 and every term with an x is 0, leaving only c₀. For eˣ,e⁰ = 1, so c₀ = 1. This is the degree 0 approximation, a flat line. - Match the slope:
c₁ = f′(0). The derivative isp′(x) = c₁ + 2c₂x + 3c₃x², and at x = 0 only c₁ is left. So c₁ = 1. This is degree 1, the tangent line. - Match the bend:
c₂ = f″(0) ÷ 2. The second derivative isp″(x) = 2c₂ + 6c₃x, which is2c₂at x = 0. It has to be 1, so c₂ = 1 ÷ 2. This is degree 2, a parabola. - Match the third derivative:
c₃ = f‴(0) ÷ 3!. The third derivative isp‴(x) = 3 × 2 × 1 × c₃ = 6c₃. So c₃ = 1 ÷ 6. - n times brings down n!:
cₙ = f⁽ⁿ⁾(0) ÷ n!. Take the derivative of xⁿ n times and n, n − 1, …, 1 come down in front one after another, leaving n!. Terms of lower degree disappear along the way, and terms of higher degree still have an x, so they are 0 at x = 0. That is why each term can be matched on its own, and the coefficient is alwaysf⁽ⁿ⁾(0) ÷ n!. Move the center to a, write a for 0 and(x − a)for x, and you get the formula in section 2.
Every derivative of eˣ is eˣ, so the top number is always 1 and the coefficients look like plain 1 ÷ n!. For other functions, the top number is that function's derivative. For ln(1 + x), f‴(0) = 2, so c₃ = 2 ÷ 3! = 1/3, the x³/3 in the table of section 5.
Try this. Each time you press "Next", the approximation at x = 1 goes 0, 1, 2, 2.5, 2.666667, 2.718056, closing in on the real value e = 2.718282. At the last step, the row p⁽ⁿ⁾(0) = n! × cₙ appears at the bottom of the table, and the approximation goes up to degree 6. The range where it stays within 0.05 of eˣ widens from −1.1 to 0.99 at degree 3 to −2.29 to 2.11 at degree 6. In the first lab, pick eˣ with center 0 and set the degree to 3 and then 6 to see the same green bands.
Why the factorials?
n! (n factorial) is all the numbers from 1 to n multiplied together. 3! = 3 × 2 × 1 = 6, 5! = 120.
Take the degree 3 term c × (x − a)³. Take its derivative three times, and the exponents 3, 2, 1 come down in front one after another, leaving 3 × 2 × 1 × c = 6c. For the third derivative of the approximation to equal the real f‴(a), you need 6c = f‴(a), so c = f‴(a) ÷ 3!. The factorial is there to cancel the numbers that come down when you take derivatives.
There is one more nice thing. At x = a, (x − a)³ has value 0, slope 0, and bend 0. So adding the degree 3 term does not disturb the value, slope, and bend you already matched. That is why you can just keep adding terms one at a time.
4. Work it out by hand: e^0.1 and sin(0.1)
No matter how many times you take the derivative of eˣ, you get eˣ. And e⁰ = 1. So at center 0, the value, the slope, and the bend are all 1.
- Pick the center. a = 0, where you already know the value.
- Collect the derivatives at the center.
f(0) = 1,f′(0) = 1,f″(0) = 1. - Put them in the formula.
eˣ ≈ 1 + 1 × x + 1 × x² ÷ 2! = 1 + x + x²/2. - Plug in x = 0.1.
1 + 0.1 + 0.01 ÷ 2 = 1.105. - Compare with the real value.
e^0.1 = 1.105171…. The gap is 0.000171. Stopping at degree 1 gives 1.1 with a gap of 0.00517. One more term made the gap about 30 times smaller. - Estimate what is left. The first term you left out is
x³/6 = 0.001 ÷ 6 = 0.000167. That is almost all of the remaining gap of 0.000171. The first missing term tells you how big the error is.
sin works the same way. At center 0: sin 0 = 0, slope cos 0 = 1, bend −sin 0 = 0, and next −cos 0 = −1. So sin x ≈ x − x³/6.
- Up to degree 1:
sin(0.1) ≈ 0.1. The real value is 0.0998334, so the gap is 0.000167. - Up to degree 3:
0.1 − 0.001 ÷ 6 = 0.0998333. The gap drops to 8.33×10⁻⁸.
Here is the same work written as formulas.
In the second lab (section 6), pick eˣ and degree 2 and type 0.1 for x. You get exactly these numbers.
5. Common expansions and everyday shortcuts
These are expansions at center 0. "Where it works" is the range of x where adding the terms forever gives exactly the real function.
| Function | Expansion (center 0) | Where it works |
|---|---|---|
sin x | x − x³/3! + x⁵/5! − x⁷/7! + … | every x |
cos x | 1 − x²/2! + x⁴/4! − x⁶/6! + … | every x |
eˣ | 1 + x + x²/2! + x³/3! + … | every x |
ln(1 + x) | x − x²/2 + x³/3 − x⁴/4 + … | −1 < x ≤ 1 |
1 ÷ (1 − x) | 1 + x + x² + x³ + … | −1 < x < 1 |
√(1 + x) | 1 + x/2 − x²/8 + x³/16 − … | −1 ≤ x ≤ 1 |
sigmoid σ(x) | 1/2 + x/4 − x³/48 + x⁵/480 − … | −π < x < π |
sin has only odd degree terms, and cos has only even degree terms. That is because flipping left and right changes the sign of sin (sin(−x) = −sin x), while cos looks the same both ways.
When x is small, people keep only the first one or two terms. These shortcuts are used a lot.
| Shortcut | Example |
|---|---|
sin x ≈ x (small angle, in radians) | At 0.1 radians (about 5.73°): 0.1 versus 0.0998334. A 0.167% difference |
cos x ≈ 1 − x²/2 | cos 0.1 = 0.995004…, shortcut 0.995 |
eˣ ≈ 1 + x | e^0.05 = 1.051271…, shortcut 1.05 |
ln(1 + x) ≈ x | ln 1.03 = 0.029559…, shortcut 0.03. The log of a 3% increase is almost 0.03 |
√(1 + x) ≈ 1 + x/2 | √1.02 = 1.00995…, shortcut 1.01 |
1 ÷ (1 − x) ≈ 1 + x | 1 ÷ 0.98 = 1.020408…, shortcut 1.02 |
The small angle shortcut only works when you measure the angle in radians. Do not plug in a number of degrees. It also breaks down quickly as the angle grows. At 0.5 radians (about 29°), sin 0.5 = 0.4794, which is more than 4% off from 0.5.
6. How wrong is it? Error and where it works
The approximation gets worse as you move away from the center. The error of a degree n approximation is roughly the first term you left out, so it grows like (x − a)ⁿ⁺¹. More precisely it is f⁽ⁿ⁺¹⁾(c) × (x − a)ⁿ⁺¹ ÷ (n + 1)!, where c is some point between a and x. So for a degree 2 approximation, halving the distance makes the error about 8 times smaller ((1/2)³).
The lab below puts the center at 0 and shows how far apart the real value and the approximation are at a point x. The bottom graph draws the gap on a scale where each line up is 10 times bigger. That way you can see tiny gaps and huge gaps in one picture.
Drag the graphs left and right, or type a number, to move the point x. The purple segment and curve show the gap, and the green dashed line is the 0.05 line from the first lab. Wherever the purple curve is below the green line is the band from the first lab.
Try this. ① As it starts (eˣ, degree 2, x = 1), the real value is 2.718282, the approximation is 2.5, and the gap is 0.218. ② Raise the degree and the approximation becomes 2.666667, 2.708333, 2.716667, 2.718056, closing in on e = 2.718282. At degree 12 the gap is 1.73×10⁻¹⁰. ③ At degree 2, set x to 0.1 and you get the numbers from the hand example (1.105171, 1.105, 0.000171). At 0.05 the gap is 2.11×10⁻⁵. Half the distance, about one eighth of the gap. Move x to 2, 3, 4 and the gap grows fast: 2.39, 11.6, 41.6. ④ Where the series stops working. Pick ln(1 + x) and put x at 2. Raise the degree from 1 and the approximation jumps around: 2, 0, 2.666667, −1.333333, and so on. The gap grows: 0.901, 1.1, 1.57, 2.43, and 221 at degree 12. The higher the degree, the worse it gets. At x = 0.5 it is the opposite: the gap shrinks to 0.0945, 0.0305, and 6.42×10⁻⁶ at degree 12. ⑤ For 1 ÷ (1 − x) at x = −1.5, the real value is 0.4, but the degree 12 approximation is 78.247803. ⑥ For the sigmoid at x = 3, raising the degree to 3, 7, 11 slowly shrinks the gap: 0.265, 0.22, 0.183. At x = 3.5 it grows: 0.489, 0.751, 1.16. The boundary is π (about 3.14).
As ④ and ⑤ show, if you approximate ln(1 + x) or 1 ÷ (1 − x) around 0, it does not work where |x| is bigger than 1, no matter how high the degree. 1 ÷ (1 − x) has no value at x = 1 (it grows without end), and ln(1 + x) has no value at x = −1. The distance 1 from the center to that problem point becomes the radius of the range where the series works. This distance is called the radius of convergence. Inside it, raising the degree helps. Outside it, raising the degree makes things worse.
The sigmoid is smooth everywhere on the real number line, yet its radius is π. If you extend it to complex numbers, there is a problem point at distance π from the center. This page does not go further into that. On the other hand, sin, cos, and eˣ have no problem points, so their radius has no end. With enough degrees, they fit anywhere.
7. Degree 1 is the tangent line, degree 2 is a parabola: Newton's method
The degree 1 approximation f(a) + f′(a)(x − a) is the straight line that follows the slope at that point, the tangent line. It knows nothing about the bend, so it drifts away quickly where the curve bends.
The degree 2 approximation adds f″(a)(x − a)² ÷ 2, which makes a parabola. It also matches the direction of the bend. If f″(a) is positive, the parabola opens upward (convex). If it is negative, it opens downward (concave).
A parabola's vertex is easy to find. It is where the parabola's slope f′(a) + f″(a)(x − a) is 0.
The bottom of the real function is hard to find directly. So build the degree 2 approximation where you are, move to the vertex of that parabola, and build a new degree 2 approximation there. Repeating this is Newton's method for finding a bottom.
Drag the graph left and right, or type a number, to move the center a. Green is the degree 1 approximation (tangent line), blue is the degree 2 approximation (parabola), and the orange dot is the vertex of the parabola. "Move to the vertex" is one step of Newton's method.
Try this. ① As it starts (cos x, a = 2.5), the slope is −0.5985 and the bend is 0.8011, so the parabola opens upward and its vertex is at 3.247. ② Each time you press "Move to the vertex", a goes to 3.247, 3.1412, 3.1416. In three steps it reaches the real bottom of cos x, π = 3.14159…, to four decimal places. ③ Put a at 0.5. The bend is −0.8776, so the parabola opens downward and its vertex at −0.0463 is a top. Press the button twice and you reach the top of cos x at 0. Newton's method only looks for a spot where the slope is 0. It does not care whether that spot is a bottom or a top. ④ Pick sin x and put a at 0. The bend is 0, so the parabola lies on top of the tangent line. There is no vertex, and the button turns off. ⑤ Turn off "Degree 1 (tangent)" and look at the parabola alone. It stays on the curve over a wider range than the tangent line does.
With Newton's method you do not have to choose a step size, and near a bottom it gets there very fast. In exchange, you need to know the bend f″. In an AI model with millions of inputs, f″ is no longer one number. It becomes a table with (number of inputs) × (number of inputs) entries, the Hessian matrix, which is very expensive to compute and use.
8. Gradient descent trusts the degree 1 approximation
Gradient descent takes a small step against the slope. With step size η, it is x ← x − η × f′(x). The degree 1 approximation shows why.
The degree 1 approximation says f(x + Δ) ≈ f(x) + f′(x) × Δ. Put in Δ = −η f′(x) and you get f(x) − η × f′(x)². A square is never negative, so the approximation always says "you go down." It also says that a bigger η takes you further down.
But the degree 1 approximation only works up close. As the step grows, the degree 2 term it left out, f″ × Δ² ÷ 2, gets bigger. If the curve bends upward (f″ > 0), the real height is above the prediction, and if the step is too big you actually go up.
For a parabola like x², where the bend is the same everywhere, the boundary is exact. If the step size is smaller than 2 ÷ f″ you go down, and if it is bigger you go up. For x², f″ = 2, so the boundary is 1. Halfway, η = 1 ÷ f″ = 0.5 lands on the bottom in one step. That step is the same as the Newton's method step.
Drag the graph left and right, or type a number, to move the current spot a. The orange line is the degree 1 approximation (tangent line), the orange dot is the new height it predicts, the blue dot is the real new height, and the purple segment is how wrong the approximation was. The gray dashed line is the current height.
Try this. ① As it starts (x², a = 2, η = 0.1), the slope is 4 and the new spot is 1.6. The tangent line said the new height would be 2.4, and it is really 2.56. It went down by 1.44. The approximation was off by 0.16, which is the step 0.4 squared. ② Raise η to 0.25: new spot 1, predicted 0, real 1. At η = 0.5: new spot 0, predicted −4, real 0. It reaches the bottom in one step. ③ At η = 1: new spot −2, real height 4. Same height as before. At η = 1.2: new spot −2.8 with real height 7.84, so it went up by 3.84, while the tangent line said it would go down to −15.2. Press "Take one step" and a moves to −2.8. The next step would jump even further, to 3.92 (height 15.3664). ④ Pick cos x and put a at 2.5. Its bend there is 0.8011, smaller than the 2 of x², so it can handle bigger steps. At η = 2 it goes down by 0.0486, but at η = 2.5 it goes up by 0.1446.
So the learning rate (step size) has to fit how much the loss bends. If some direction bends sharply, only small steps are safe. With many inputs, these amounts of bending show up as the eigenvalues of the Hessian matrix.
9. Key properties
| Property | In plain words |
|---|---|
| At the center, it matches the real function up to the n-th derivative | A degree n approximation matches the value, the slope, the bend, and so on, in order |
| Closer is better | The error of a degree n approximation grows like the distance to the power n + 1. For degree 2, half the distance gives about one eighth of the error |
| Raising the degree widens the good range, but only inside the radius of convergence | sin, cos, eˣ: as far as you like. ln(1 + x), 1 ÷ (1 − x): only up to |x| < 1 around center 0 |
| Adding a term keeps what you already matched | (x − a)ᵏ stays 0 at the center for its first k − 1 derivatives |
| Left-right symmetry shows up in the coefficients | If f(−x) = −f(x) like sin, only odd degree terms remain. If f(−x) = f(x) like cos, only even ones remain (center 0) |
Where it is used
- How calculators and computers find sin. In fdlibm, a public C math library, sin takes an angle that has already been reduced to the range −π/4 to π/4 and computes a degree 13 polynomial
x + S1·x³ + … + S6·x¹³. The first coefficient, S1 = −0.16666666666666632, is very close to the Taylor coefficient −1/6, but the last digits differ. The comment in the code says the error is below 2⁻⁵⁸ over that whole range. It looks like the Taylor coefficients, which fit best at one point, were adjusted slightly to fit evenly across the range. Also, if x is smaller than 2⁻²⁷, it skips the work and returns x itself. That issin x ≈ xexactly. - Shortcuts in physics. The motion of a pendulum is solved by replacing
sin θwithθ, so the period formula you get only holds for small swings. Also, any smooth energy curve near its bottom can be seen as its degree 2 approximation, a parabola. That is why small wiggles near a bottom usually move like a spring. - AI training: first-order and second-order methods. Gradient descent and its variants (momentum, Adam) use only the degree 1 approximation (the slope), so they are first-order methods. Methods like Newton's method that also use the bend (the Hessian matrix) are second-order methods. The Hessian has as many entries as the number of weights squared, so a model with millions of weights cannot use it as is and works with an estimate instead.
- Why the step size cannot be too big. As section 8 showed, the slope can only be trusted close by, where the degree 1 approximation holds. That is why a large learning rate makes the loss bounce around or grow instead of shrinking.
- Shortcuts for activation functions. The sigmoid is almost the same as
1/2 + x/4near 0. In the first lab, pick the sigmoid at degree 1 and the gap stays under 0.05 from −1.42 to 1.42. If the inputs are bunched near 0, such a layer behaves almost like a straight-line function. The sigmoid's slope is only 1/4 even where it is largest (at 0).
Frequently asked questions
What is the difference between a Taylor approximation and a Taylor series?
An approximation is the polynomial you get when you stop after a few terms. A series keeps adding terms forever. The series equals the original function only inside the range where it works (the radius of convergence). Real calculations always stop after a few terms.
Does a higher degree always fit better everywhere?
No. Only inside the range where the series works. If you approximate ln(1 + x) around 0, then at x = 2 the gap grows as you raise the degree: 0.901, 1.1, 1.57, and 221 at degree 12. Even inside that range, points far from the center need a high degree.
Why do we divide by a factorial?
If you take the derivative of (x − a)ⁿ n times, the numbers n × (n − 1) × … × 1, that is n!, come down in front. To make the n-th derivative of the approximation equal the n-th derivative of the real function, you divide by that n! ahead of time so it cancels.
How are gradient descent and Newton's method related to Taylor approximation?
Gradient descent trusts the degree 1 approximation (the tangent line) and takes one step downhill. Newton's method builds the degree 2 approximation (a parabola) and jumps straight to its vertex. An approximation only works up close, so if the step is too big, gradient descent can actually go uphill.
What is a Maclaurin series?
It is a Taylor series with its center at 0. The expansion tables in textbooks, like sin x = x − x³/6 + x⁵/120 − …, are usually Maclaurin series.
Words
| Plain words used here | Textbook term |
|---|---|
| imitating a function with a polynomial close to one point | Taylor approximation |
| degree n approximation | Taylor polynomial of degree n. Tₙ(x), Pₙ(x) |
| adding the terms forever | Taylor series |
| a Taylor series centered at 0 | Maclaurin series |
| center a | center, expansion point |
| bend | second derivative. f″ |
| the derivative taken n times | n-th derivative. f⁽ⁿ⁾ |
| all numbers from 1 to n multiplied | factorial. n! |
| gap between the approximation and the real function | error, remainder. Rₙ(x) |
| radius of the range where adding forever works | radius of convergence |
| cup shape / hill shape | convex / concave |
| moving to the vertex of the parabola, again and again | Newton's method |
| trusting the degree 1 approximation and stepping downhill | gradient descent, first-order optimization |
| methods that also use the bend | second-order optimization |
| step size | learning rate. η |
| table of all the bends | Hessian matrix |
| small angle shortcut | small-angle approximation |
Sources
- OpenStax, Calculus Volume 2. 6.1 Power Series and Functions (radius of convergence), 6.3 Taylor and Maclaurin Series (Taylor polynomials, remainder), 6.4 Working with Taylor Series.
- Goodfellow, Bengio, Courville, Deep Learning. Chapter 4, Numerical Computation, section 4.3. Step size of gradient descent seen through a degree 2 Taylor approximation, why a step that is too big goes uphill, Newton's method, first-order and second-order optimization. Chapter 8, Optimization, section 8.6. The size of the Hessian and approximate second-order methods.
- OpenStax, University Physics Volume 1. 15.4 Pendulums. Solving a pendulum with sin θ ≈ θ for small angles.
- Sun Microsystems, fdlibm. k_sin.c. How sin on [−π/4, π/4] is computed with a degree 13 polynomial, and its coefficients.
← Partial derivatives and the gradientJacobian and Hessian →