PIC specific math@ (including trigonometric functions sin(), arctan(), etc.), SX specific math@, Intel specific math@
Dr Dobbs Journal #271 pg 18 "A Conversation with William Kahan" William Kahan "Formulas that are numerically stable are sometimes quite inelegant. Formulas that give you greater accuracy are sometimes full of cases, ugly cases.... F(x)=(sin x)/x .... F(x)=(sin x)/x if x != 0 and F(0) = 1"
Have exmathematicians become dysfunctional?
See also:
Books
math:
If you've got a basket with 3 oranges in it and you take 5 out, then you have to put 2 oranges in again in order for it to be empty.  Peter Gutmann
Questions:
Hi there, I am having trouble with arithmetic in assembler. I want to do the following calculation:
Y = ((XXmin)((YmaxYmin)/(XmaxXmin))) + Ymin This is a formula to scale a point between Xmax and Xmin to a point between Ymax and Ymin. The Y points is 8bit but the X points can be up to 16bit values. You can already see my problem because I cannot get any 16bit divided by 16bit algorith or for that matter 24bit divided by 16bit that replies with the fractional part. So I came up with the next formula to try and use a 16bit divided by 8bit number to give back fractions:
Y = ((XXmin)(1/(XmaxXmin)/(YmaxYmin))) + Ymin But it just gets more complex as I go along. My second problem is that say I work out the division and now I must multiply the answer (which is fractional , how the hell do you do it with the fractional part. Do you first multiply both numbers so they are integer and then divide it again later with the same number or what. Am I even on the right track here or am I going bananas? Please help me I am now three months into the game and have learned a lot in a short space of time but the learning just seems to grow and not level out, not that I am complaining just a remark:)
Rearrange the formula so that the top and bottom of the fraction is kept
seperate. What you really want is:
Y = ((XXmin)(YmaxYmin) + Ymin(XmaxXmin)) over XmaxXmin.
Now you can do the top and bottom seperatly. Multiplying by a fraction is
a seperate job but can still be done without division. It is a good
idea to reduce the fraction after each operation to prevent overflow. A method
for doing that is available but I can't find it at the moment.
Once you have the final answer, then you do the division.
See:
Comments:
file: /Techref/method/math.htm, 12KB, , updated: 2016/3/21 16:10, local time: 2016/10/1 15:14,

©2016 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://www.sxlist.com/techref/method/math.htm?key=math"> Methods in Math</A> 
Did you find what you needed? "math" 
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. 
Welcome to www.sxlist.com! 
.