
PreCalculus PreCalculus Math Forum 
 LinkBack  Thread Tools  Display Modes 
July 21st, 2018, 10:41 AM  #1 
Newbie Joined: Jul 2018 From: France Posts: 1 Thanks: 0  EXP(x) approximation in old 1980's computer ROM
Hi, The presentation :  Old 1980’s ROM (Apple 2e, Commodore 64, ...) uses a Taylor’s serieslike to evaluate the exponential function EXP(x) : EXP(x) = 1 + x + 1/2! x^2 + ... + 1/7! x^7 x is in [1, 1], thanks to a preliminary work. Another preliminary work is to multiply x by a correction factor 1/ln(2) (better for the algorithm I suppose). So the series must take into account this factor and modify the coefficients : EXP(x) = 1 + ln(2) x + ln(2)^2 1/2! x^2 + ... + ln(2)^7 1/7! x^7 EXP(x) = a0 + a1 x + a2 x^2 + ... a7 x^7 a0 = 1.000000000 a1 = 0.693147181 ln(2) a2 = 0.240226507 a3 = 0.055504109 a4 = 0.009618129 a5 = 0.001333356 a6 = 0.000154035 a7 = 0.000015253 To reduce the Taylor error, especially near 1 and 1, the old 1980’s algorithm modify the coefficients with the Chebyshev polynomials approximation. As the comment says : “TCHEBYSHEV MODIFIED TAYLOR SERIES COEFFICIENTS FOR E**X” b0 = 1.000000000 b1 = 0.693147186 b2 = 0.240226385 b3 = 0.055505127 b4 = 0.009614017 b5 = 0.001342263 b6 = 0.000143523 b7 = 0.000021499 (see https://github.com/wsoltys/multicomp...6809/basic.asm line 3852) Now, the problem : —— ************************************************ * * Where these Chebyshev values come from ? * ************************************************ I did a lot of calculations to retreive these values. I used the normal method : compute the Chebyshev coefficients for EXP(x) up to 8 terms, then replace the Ti(x) by its x polynomial. Or by the economization method : compute Taylor EXP(x) up to x^9, and remove a9*T9(x)/2^8 and a8*T8(x)/2^7 (normally equivalent to the first method). No chance ! The computed Chebyshev coefficients I obtain, in accordance with the literature, are : c0 = 0.999999801 delta b0  c0 = 0.000000199 c1 = 0.693147113 b1  c1 = 0.000000073 c2 = 0.240229556 b2  c2 = 0.000003171 c3 = 0.055504542 b3  c3 = 0.000000585 c4 = 0.009610825 b4  c4 = 0.000003192 c5 = 0.001332605 b5  c5 = 0.000009658 c6 = 0.000159622 b6  c6 = 0.000016099 c7 = 0.000015734 b7  c7 = 0.000005765 Have you an idea ? Is the ROM coefficients really Chebyshev coefficients ? Is this another approximation method ? Am I wrong ? Thank you for your help. BR, 
July 21st, 2018, 09:51 PM  #2 
Senior Member Joined: Sep 2016 From: USA Posts: 564 Thanks: 329 Math Focus: Dynamical systems, analytic function theory, numerics 
Your sequence of $b_i$'s is identical to your sequence of $a_i$'s and neither of these gives the Chebyshev expansion for $\exp(x)$. I get the following via the Matlab chebfun library: \[c_0 = 1.2660, \ c_1 = 1.1303, \ c_2 = 0.2714, \ c_3 = 0.0443, \ c_4 = 0.0054\] On an unrelated note, why would you convert from Chebyshev basis back into monomial basis? This defeats the entire point of using a Cheybshev basis. 

Tags 
1980, approximation, computer, expx, rom 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Computer and pangram  Denis  Computer Science  6  May 13th, 2017 09:27 AM 
Clock in computer  MMath  Computer Science  2  November 20th, 2016 09:38 AM 
Computer Games  Eminem_Recovery  New Users  7  September 21st, 2011 01:25 PM 
Computer Science  johnny  Computer Science  8  December 2nd, 2007 01:16 PM 