|
|
1.1 ! root 1: ////////// ! 2: / libm 8087 ! 3: / asin(d) ! 4: ////////// ! 5: ! 6: #include "larges.h" ! 7: #include "ifno8087.h" ! 8: ! 9: .globl asin_ ! 10: .globl asin ! 11: .globl atan ! 12: .globl cfcc87 ! 13: .globl edomain ! 14: ! 15: ////////// ! 16: / double ! 17: / asin(d) ! 18: / double d; ! 19: ////////// ! 20: ! 21: d = RASIZE / arg offset ! 22: ! 23: asin_: ! 24: ifno8087(_asin_) ! 25: mov bx, sp ! 26: fdld Pss d(bx) / Load argument d. ! 27: ! 28: asin: / d ! 29: fld st / d, d ! 30: fabs / abs(d), d ! 31: fld1 / 1, abs(d), d ! 32: fcompp / Compare 1 to abs(d) and pop twice. ! 33: Gcall cfcc87 ! 34: ja 1f / -1 < d < 1, use atan. ! 35: je 0f / d = 1 or d = -1 ! 36: Gjmp edomain / d < -1 or 1 < d, issue EDOM error and return. ! 37: ! 38: 0: ! 39: fild cs:minus1 / -1, d ! 40: fldpi / pi, -1, d ! 41: fscale / pi/2, -1, d ! 42: fstp st1 / pi/2, d ! 43: fmul / For d = 1 or d = -1, asin(d) = d * pi/2. ! 44: Gret ! 45: ! 46: 1: fld st / d, d ! 47: fmul st, st / d*d, d ! 48: fld1 / 1, d*d, d ! 49: fsubr / 1 - d*d, d ! 50: fsqrt / sqrt(1-d*d), d ! 51: fdiv / d / sqrt(1-d*d) ! 52: Gjmp atan / asin(d) = atan(d/sqrt(1-d*d)) ! 53: ! 54: / Data. ! 55: minus1: .word -1 ! 56: ! 57: / end of asin87.m
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.