hw1p2 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function f = hw1p2(x) % Computes cos(x^2)-cos(x) accurately for x in [0,1] % this taylor approximation of order 10 is accurate for x < 0.5 if x < 0.5 f = x^2/2-(13*x^4)/24+x^6/720+(1679*x^8)/40320+x^10/3628800- (665281*x^12)/479001600+x^14/87178291200+(518918399*x^16)/20922789888000+x^18/64
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 02373705728000-(670442572801*x^20)/2432902008176640000; else % trig identity f = 2*sin(x*(1-x)/2)*sin((x^2+x)/2); end end...
View Full Document

This note was uploaded on 03/12/2012 for the course CS 3220 taught by Professor Marschner during the Spring '09 term at Cornell.

Ask a homework question - tutors are online