home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2333 < prev    next >
Internet Message Format  |  1990-12-28  |  56KB

  1. From: glenn@qed.physics.su.OZ.AU (Glenn Geers)
  2. Newsgroups: alt.sources
  3. Subject: Alternative 80386 math lib v2.0 part04/06
  4. Message-ID: <1990Dec16.210541.28363@metro.ucc.su.OZ.AU>
  5. Date: 16 Dec 90 21:05:41 GMT
  6.  
  7. Submitted-by: root@trantor
  8. Archive-name: mathlib2.0/part04
  9.  
  10. ---- Cut Here and feed the following to sh ----
  11. #!/bin/sh
  12. # this is mathlib.04 (part 4 of mathlib2.0)
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file asinf.s continued
  15. #
  16. if test ! -r _shar_seq_.tmp; then
  17.     echo 'Please unpack part 1 first!'
  18.     exit 1
  19. fi
  20. (read Scheck
  21.  if test "$Scheck" != 4; then
  22.     echo Please unpack part "$Scheck" next!
  23.     exit 1
  24.  else
  25.     exit 0
  26.  fi
  27. ) < _shar_seq_.tmp || exit 1
  28. if test ! -f _shar_wnt_.tmp; then
  29.     echo 'x - still skipping asinf.s'
  30. else
  31. echo 'x - continuing file asinf.s'
  32. sed 's/^X//' << 'SHAR_EOF' >> 'asinf.s' &&
  33. ** This file is part of the alternative 80386 math library and is
  34. ** covered by the GNU General Public license with my modification
  35. ** as noted in the README file that accompanied this file.
  36. **
  37. ** Copyright 1990 G. Geers
  38. **
  39. */
  40. X
  41. X    .align 4
  42. X    .globl asinf
  43. asinf:
  44. X    pushl %ebp
  45. X    movl %esp,%ebp
  46. X
  47. X    flds 8(%ebp)
  48. X    fst %st(1)
  49. X    fst %st(2)
  50. X    fmulp
  51. X    fld1
  52. X    fsubp
  53. X    fsqrt
  54. X    fld1
  55. X    fdivp
  56. X    fmulp
  57. X    fld1
  58. X    fpatan
  59. X
  60. X    leave
  61. X    ret
  62. SHAR_EOF
  63. echo 'File asinf.s is complete' &&
  64. chmod 0644 asinf.s ||
  65. echo 'restore of asinf.s failed'
  66. Wc_c="`wc -c < 'asinf.s'`"
  67. test 403 -eq "$Wc_c" ||
  68.     echo 'asinf.s: original size 403, current size' "$Wc_c"
  69. rm -f _shar_wnt_.tmp
  70. fi
  71. # ============= coshf.s ==============
  72. if test -f 'coshf.s' -a X"$1" != X"-c"; then
  73.     echo 'x - skipping coshf.s (File already exists)'
  74.     rm -f _shar_wnt_.tmp
  75. else
  76. > _shar_wnt_.tmp
  77. echo 'x - extracting coshf.s (Text)'
  78. sed 's/^X//' << 'SHAR_EOF' > 'coshf.s' &&
  79. /*
  80. ** This file is part of the alternative 80386 math library and is
  81. ** covered by the GNU General Public license with my modification
  82. ** as noted in the README file that accompanied this file.
  83. **
  84. ** Copyright 1990 G. Geers
  85. **
  86. */
  87. X
  88. X    .align 4
  89. .LC2:
  90. X    .double 0.500
  91. X
  92. X    .align 4
  93. X    .globl coshf
  94. coshf:
  95. X    pushl %ebp
  96. X    movl %esp,%ebp
  97. X
  98. X    flds 8(%ebp)
  99. X    ftst
  100. X    fstsw %ax
  101. X    sahf
  102. X    ja .Lpos
  103. X    fchs
  104. X
  105. .Lpos:
  106. X    fldl2e
  107. X    fmulp
  108. X    fstl %st(1)
  109. X    frndint
  110. X    fstl %st(2)
  111. X    fsubrp
  112. X    f2xm1
  113. X    fld1
  114. X    faddp
  115. X    fscale
  116. X    fst %st(1)
  117. X
  118. X    fld1
  119. X    fdivp
  120. X    faddp
  121. X
  122. X    fldl .LC2
  123. X    fmulp
  124. X
  125. X    leave
  126. X    ret
  127. SHAR_EOF
  128. chmod 0644 coshf.s ||
  129. echo 'restore of coshf.s failed'
  130. Wc_c="`wc -c < 'coshf.s'`"
  131. test 535 -eq "$Wc_c" ||
  132.     echo 'coshf.s: original size 535, current size' "$Wc_c"
  133. rm -f _shar_wnt_.tmp
  134. fi
  135. # ============= floorf.s ==============
  136. if test -f 'floorf.s' -a X"$1" != X"-c"; then
  137.     echo 'x - skipping floorf.s (File already exists)'
  138.     rm -f _shar_wnt_.tmp
  139. else
  140. > _shar_wnt_.tmp
  141. echo 'x - extracting floorf.s (Text)'
  142. sed 's/^X//' << 'SHAR_EOF' > 'floorf.s' &&
  143. /*
  144. ** This file is part of the alternative 80386 math library and is
  145. ** covered by the GNU General Public license with my modification
  146. ** as noted in the README file that accompanied this file.
  147. **
  148. ** Copyright 1990 G. Geers
  149. **
  150. */
  151. X
  152. X    .align 4
  153. X    .globl floorf
  154. floorf:
  155. X    pushl %ebp
  156. X    movl %esp,%ebp
  157. X    subl $8, %esp
  158. X    
  159. X    flds 8(%ebp)        /* load data */
  160. X
  161. X    fstcw -12(%ebp)        /* store control word */
  162. X    fstcw -16(%ebp)        /* store it again */
  163. X    orw $0x0400, -16(%ebp)    /* round toward -inf */
  164. X    fldcw -16(%ebp)        /* store new control word */
  165. X
  166. X    frndint            /* rounding gives floor(x) */
  167. X    fldcw -12(%ebp)        /* restore original control word */
  168. X
  169. X    leave
  170. X    ret
  171. SHAR_EOF
  172. chmod 0644 floorf.s ||
  173. echo 'restore of floorf.s failed'
  174. Wc_c="`wc -c < 'floorf.s'`"
  175. test 630 -eq "$Wc_c" ||
  176.     echo 'floorf.s: original size 630, current size' "$Wc_c"
  177. rm -f _shar_wnt_.tmp
  178. fi
  179. # ============= log2f.s ==============
  180. if test -f 'log2f.s' -a X"$1" != X"-c"; then
  181.     echo 'x - skipping log2f.s (File already exists)'
  182.     rm -f _shar_wnt_.tmp
  183. else
  184. > _shar_wnt_.tmp
  185. echo 'x - extracting log2f.s (Text)'
  186. sed 's/^X//' << 'SHAR_EOF' > 'log2f.s' &&
  187. /*
  188. ** This file is part of the alternative 80386 math library and is
  189. ** covered by the GNU General Public license with my modification
  190. ** as noted in the README file that accompanied this file.
  191. **
  192. ** Copyright 1990 G. Geers
  193. **
  194. */
  195. X
  196. X    .align 4
  197. X    .globl log2f
  198. log2f:
  199. X    pushl %ebp
  200. X    movl %esp,%ebp
  201. X
  202. X    fld1
  203. X    flds 8(%ebp)
  204. X    fyl2x
  205. X
  206. X    leave
  207. X    ret
  208. SHAR_EOF
  209. chmod 0644 log2f.s ||
  210. echo 'restore of log2f.s failed'
  211. Wc_c="`wc -c < 'log2f.s'`"
  212. test 331 -eq "$Wc_c" ||
  213.     echo 'log2f.s: original size 331, current size' "$Wc_c"
  214. rm -f _shar_wnt_.tmp
  215. fi
  216. # ============= sqrtf.s ==============
  217. if test -f 'sqrtf.s' -a X"$1" != X"-c"; then
  218.     echo 'x - skipping sqrtf.s (File already exists)'
  219.     rm -f _shar_wnt_.tmp
  220. else
  221. > _shar_wnt_.tmp
  222. echo 'x - extracting sqrtf.s (Text)'
  223. sed 's/^X//' << 'SHAR_EOF' > 'sqrtf.s' &&
  224. /*
  225. ** This file is part of the alternative 80386 math library and is
  226. ** covered by the GNU General Public license with my modification
  227. ** as noted in the README file that accompanied this file.
  228. **
  229. ** Copyright 1990 G. Geers
  230. **
  231. ** sqrt in the prevailing precision
  232. */
  233. X
  234. X    .align 4
  235. X    .globl sqrtf
  236. sqrtf:
  237. X    pushl %ebp
  238. X    movl %esp,%ebp
  239. X
  240. X    flds 8(%ebp)
  241. X    fsqrt
  242. X
  243. X    leave
  244. X    ret
  245. SHAR_EOF
  246. chmod 0644 sqrtf.s ||
  247. echo 'restore of sqrtf.s failed'
  248. Wc_c="`wc -c < 'sqrtf.s'`"
  249. test 361 -eq "$Wc_c" ||
  250.     echo 'sqrtf.s: original size 361, current size' "$Wc_c"
  251. rm -f _shar_wnt_.tmp
  252. fi
  253. # ============= asinhf.s ==============
  254. if test -f 'asinhf.s' -a X"$1" != X"-c"; then
  255.     echo 'x - skipping asinhf.s (File already exists)'
  256.     rm -f _shar_wnt_.tmp
  257. else
  258. > _shar_wnt_.tmp
  259. echo 'x - extracting asinhf.s (Text)'
  260. sed 's/^X//' << 'SHAR_EOF' > 'asinhf.s' &&
  261. /*
  262. ** This file is part of the alternative 80386 math library and is
  263. ** covered by the GNU General Public license with my modification
  264. ** as noted in the README file that accompanied this file.
  265. **
  266. ** Copyright 1990 G. Geers
  267. **
  268. */
  269. X
  270. X    .align 4
  271. X    .globl asinhf
  272. asinhf:
  273. X    pushl %ebp
  274. X    movl %esp,%ebp
  275. X
  276. X    flds 8(%ebp)
  277. X
  278. X    fmuls 8(%ebp)
  279. X    fld1
  280. X    faddp
  281. X    fsqrt
  282. X    fadds 8(%ebp)
  283. X    fldln2
  284. X    fxch %st(1)
  285. X    fyl2x
  286. X
  287. X    leave
  288. X    ret
  289. SHAR_EOF
  290. chmod 0644 asinhf.s ||
  291. echo 'restore of asinhf.s failed'
  292. Wc_c="`wc -c < 'asinhf.s'`"
  293. test 399 -eq "$Wc_c" ||
  294.     echo 'asinhf.s: original size 399, current size' "$Wc_c"
  295. rm -f _shar_wnt_.tmp
  296. fi
  297. # ============= dremf.s ==============
  298. if test -f 'dremf.s' -a X"$1" != X"-c"; then
  299.     echo 'x - skipping dremf.s (File already exists)'
  300.     rm -f _shar_wnt_.tmp
  301. else
  302. > _shar_wnt_.tmp
  303. echo 'x - extracting dremf.s (Text)'
  304. sed 's/^X//' << 'SHAR_EOF' > 'dremf.s' &&
  305. /*
  306. ** This file is part of the alternative 80386 math library and is
  307. ** covered by the GNU General Public license with my modification
  308. ** as noted in the README file that accompanied this file.
  309. **
  310. ** Copyright 1990 G. Geers
  311. **
  312. */
  313. X
  314. X    .align 4
  315. X    .globl drem
  316. drem:
  317. X    pushl %ebp
  318. X    movl %esp,%ebp
  319. X    
  320. X    fldl 16(%ebp)
  321. X    fldl 8(%ebp)
  322. .Lnotred:
  323. X    fprem1
  324. X
  325. X    fstsw %ax
  326. X    sahf
  327. X    jp .Lnotred
  328. X
  329. X    leave
  330. X    ret
  331. SHAR_EOF
  332. chmod 0644 dremf.s ||
  333. echo 'restore of dremf.s failed'
  334. Wc_c="`wc -c < 'dremf.s'`"
  335. test 381 -eq "$Wc_c" ||
  336.     echo 'dremf.s: original size 381, current size' "$Wc_c"
  337. rm -f _shar_wnt_.tmp
  338. fi
  339. # ============= fmodf.s ==============
  340. if test -f 'fmodf.s' -a X"$1" != X"-c"; then
  341.     echo 'x - skipping fmodf.s (File already exists)'
  342.     rm -f _shar_wnt_.tmp
  343. else
  344. > _shar_wnt_.tmp
  345. echo 'x - extracting fmodf.s (Text)'
  346. sed 's/^X//' << 'SHAR_EOF' > 'fmodf.s' &&
  347. /*
  348. ** This file is part of the alternative 80386 math library and is
  349. ** covered by the GNU General Public license with my modification
  350. ** as noted in the README file that accompanied this file.
  351. **
  352. ** Copyright 1990 G. Geers
  353. **
  354. */
  355. X
  356. X    .align 4
  357. X    .globl fmodf
  358. fmodf:
  359. X    pushl %ebp
  360. X    movl %esp,%ebp
  361. X    
  362. X    flds 12(%ebp)
  363. X    flds 8(%ebp)
  364. .Lnotred:
  365. X    fprem
  366. X
  367. X    fstsw %ax
  368. X    sahf
  369. X    jp .Lnotred
  370. X
  371. X    leave
  372. X    ret
  373. SHAR_EOF
  374. chmod 0644 fmodf.s ||
  375. echo 'restore of fmodf.s failed'
  376. Wc_c="`wc -c < 'fmodf.s'`"
  377. test 382 -eq "$Wc_c" ||
  378.     echo 'fmodf.s: original size 382, current size' "$Wc_c"
  379. rm -f _shar_wnt_.tmp
  380. fi
  381. # ============= logbf.s ==============
  382. if test -f 'logbf.s' -a X"$1" != X"-c"; then
  383.     echo 'x - skipping logbf.s (File already exists)'
  384.     rm -f _shar_wnt_.tmp
  385. else
  386. > _shar_wnt_.tmp
  387. echo 'x - extracting logbf.s (Text)'
  388. sed 's/^X//' << 'SHAR_EOF' > 'logbf.s' &&
  389. /*
  390. ** This file is part of the alternative 80386 math library and is
  391. ** covered by the GNU General Public license with my modification
  392. ** as noted in the README file that accompanied this file.
  393. **
  394. ** Copyright 1990 G. Geers
  395. **
  396. */
  397. X
  398. X    .align 4
  399. X    .globl logbf
  400. logbf:
  401. X    pushl %ebp
  402. X    movl %esp,%ebp
  403. X    
  404. X    flds 8(%ebp)
  405. X    fxtract
  406. X    fldl %st(1)
  407. X
  408. X    leave
  409. X    ret
  410. SHAR_EOF
  411. chmod 0644 logbf.s ||
  412. echo 'restore of logbf.s failed'
  413. Wc_c="`wc -c < 'logbf.s'`"
  414. test 341 -eq "$Wc_c" ||
  415.     echo 'logbf.s: original size 341, current size' "$Wc_c"
  416. rm -f _shar_wnt_.tmp
  417. fi
  418. # ============= sqrtpf.s ==============
  419. if test -f 'sqrtpf.s' -a X"$1" != X"-c"; then
  420.     echo 'x - skipping sqrtpf.s (File already exists)'
  421.     rm -f _shar_wnt_.tmp
  422. else
  423. > _shar_wnt_.tmp
  424. echo 'x - extracting sqrtpf.s (Text)'
  425. sed 's/^X//' << 'SHAR_EOF' > 'sqrtpf.s' &&
  426. /*
  427. ** This file is part of the alternative 80386 math library and is
  428. ** covered by the GNU General Public license with my modification
  429. ** as noted in the README file that accompanied this file.
  430. **
  431. ** Copyright 1990 G. Geers
  432. **
  433. ** sqrt in 64 bit precision always
  434. */
  435. X
  436. X    .align 4
  437. X    .globl sqrtpf
  438. sqrtpf:
  439. X    pushl %ebp
  440. X    movl %esp,%ebp
  441. X    subl $8, %esp
  442. X
  443. X    fnstcw -12(%ebp)        /* store current control word */
  444. X    fnstcw -16(%ebp)           /* store again */
  445. X    andw  $0xf0ff, -12(%ebp)       /* enable 32 bit precision */
  446. X    fldcw -12(%ebp)
  447. X
  448. X    flds 8(%ebp)
  449. X    fsqrt
  450. X
  451. X    fldcw -16(%ebp)           /* restore original control word */
  452. X
  453. X    leave
  454. X    ret
  455. SHAR_EOF
  456. chmod 0644 sqrtpf.s ||
  457. echo 'restore of sqrtpf.s failed'
  458. Wc_c="`wc -c < 'sqrtpf.s'`"
  459. test 607 -eq "$Wc_c" ||
  460.     echo 'sqrtpf.s: original size 607, current size' "$Wc_c"
  461. rm -f _shar_wnt_.tmp
  462. fi
  463. # ============= atan2f.s ==============
  464. if test -f 'atan2f.s' -a X"$1" != X"-c"; then
  465.     echo 'x - skipping atan2f.s (File already exists)'
  466.     rm -f _shar_wnt_.tmp
  467. else
  468. > _shar_wnt_.tmp
  469. echo 'x - extracting atan2f.s (Text)'
  470. sed 's/^X//' << 'SHAR_EOF' > 'atan2f.s' &&
  471. /*
  472. ** This file is part of the alternative 80386 math library and is
  473. ** covered by the GNU General Public license with my modification
  474. ** as noted in the README file that accompanied this file.
  475. **
  476. ** Copyright 1990 G. Geers
  477. **
  478. */
  479. X
  480. X    .align 4
  481. .Lpi:
  482. X    .double 3.14159265358979323846
  483. X
  484. X    .align 4
  485. .Lmpi:
  486. X    .double -3.14159265358979323846
  487. X
  488. X    .align 4
  489. .Lhalfpi: 
  490. X    .double 1.57079632679489661923
  491. X
  492. X    .align 4
  493. .Lmhalfpi:
  494. X    .double -1.57079632679489661923
  495. X
  496. X    .align 4
  497. X    .globl atan2f
  498. atan2f:
  499. X    pushl %ebp
  500. X    movl %esp,%ebp
  501. X
  502. X    flds 12(%ebp)
  503. X    ftst
  504. X    fnstsw %ax
  505. X    sahf 
  506. X    flds 8(%ebp)
  507. X    jz .Lgotzero
  508. X    jc .Lgotneg
  509. X
  510. X    fdivp
  511. X    fld1
  512. X    fpatan
  513. X
  514. X    leave
  515. X    ret
  516. X
  517. .Lgotneg:
  518. X    ftst
  519. X    fnstsw %ax
  520. X    sahf 
  521. X    jc .Lneg1
  522. X
  523. X    fdivp
  524. X    fld1
  525. X    fpatan
  526. X    flds .Lmpi
  527. X    fsubrp
  528. X
  529. X    leave
  530. X    ret
  531. X
  532. .Lneg1:
  533. X    fdivp
  534. X    fld1
  535. X    fpatan
  536. X    flds .Lpi
  537. X    fsubrp
  538. X
  539. X    leave
  540. X    ret
  541. X
  542. .Lgotzero:
  543. X    ftst
  544. X    fnstsw %ax
  545. X    sahf
  546. X    jz .Lzero
  547. X    jc .Lneg
  548. X
  549. X    flds .Lhalfpi
  550. X
  551. X    leave
  552. X    ret
  553. X
  554. .Lzero:
  555. X    fldz
  556. X
  557. X    leave
  558. X    ret
  559. X
  560. .Lneg:
  561. X    flds .Lmhalfpi
  562. X
  563. X    leave
  564. X    ret
  565. SHAR_EOF
  566. chmod 0644 atan2f.s ||
  567. echo 'restore of atan2f.s failed'
  568. Wc_c="`wc -c < 'atan2f.s'`"
  569. test 933 -eq "$Wc_c" ||
  570.     echo 'atan2f.s: original size 933, current size' "$Wc_c"
  571. rm -f _shar_wnt_.tmp
  572. fi
  573. # ============= exp10f.s ==============
  574. if test -f 'exp10f.s' -a X"$1" != X"-c"; then
  575.     echo 'x - skipping exp10f.s (File already exists)'
  576.     rm -f _shar_wnt_.tmp
  577. else
  578. > _shar_wnt_.tmp
  579. echo 'x - extracting exp10f.s (Text)'
  580. sed 's/^X//' << 'SHAR_EOF' > 'exp10f.s' &&
  581. /*
  582. ** This file is part of the alternative 80386 math library and is
  583. ** covered by the GNU General Public license with my modification
  584. ** as noted in the README file that accompanied this file.
  585. **
  586. ** Copyright 1990 G. Geers
  587. **
  588. */
  589. X
  590. X    .align 4
  591. X    .globl exp10f
  592. exp10f:
  593. X    pushl %ebp
  594. X    movl %esp,%ebp
  595. X
  596. X    flds 8(%ebp)
  597. X    fldl2t
  598. X    fmulp
  599. X    fstl %st(1)
  600. X    frndint
  601. X    fstl %st(2)
  602. X    fsubrp
  603. X    f2xm1
  604. X    fld1
  605. X    faddp
  606. X    fscale
  607. X
  608. X    leave
  609. X    ret
  610. SHAR_EOF
  611. chmod 0644 exp10f.s ||
  612. echo 'restore of exp10f.s failed'
  613. Wc_c="`wc -c < 'exp10f.s'`"
  614. test 406 -eq "$Wc_c" ||
  615.     echo 'exp10f.s: original size 406, current size' "$Wc_c"
  616. rm -f _shar_wnt_.tmp
  617. fi
  618. # ============= hypotf.s ==============
  619. if test -f 'hypotf.s' -a X"$1" != X"-c"; then
  620.     echo 'x - skipping hypotf.s (File already exists)'
  621.     rm -f _shar_wnt_.tmp
  622. else
  623. > _shar_wnt_.tmp
  624. echo 'x - extracting hypotf.s (Text)'
  625. sed 's/^X//' << 'SHAR_EOF' > 'hypotf.s' &&
  626. /*
  627. ** This file is part of the alternative 80386 math library and is
  628. ** covered by the GNU General Public license with my modification
  629. ** as noted in the README file that accompanied this file.
  630. **
  631. ** Copyright 1990 G. Geers
  632. **
  633. */
  634. X
  635. X    .align 4
  636. .globl hypotf
  637. hypotf:
  638. X    pushl %ebp
  639. X    movl %esp,%ebp
  640. X
  641. X    flds 8(%ebp)
  642. X    fmuls 8(%ebp)
  643. X    flds 12(%ebp)
  644. X    fmuls 12(%ebp)
  645. X    faddp
  646. X    fsqrt
  647. X
  648. X    leave
  649. X    ret
  650. SHAR_EOF
  651. chmod 0644 hypotf.s ||
  652. echo 'restore of hypotf.s failed'
  653. Wc_c="`wc -c < 'hypotf.s'`"
  654. test 379 -eq "$Wc_c" ||
  655.     echo 'hypotf.s: original size 379, current size' "$Wc_c"
  656. rm -f _shar_wnt_.tmp
  657. fi
  658. # ============= logf.s ==============
  659. if test -f 'logf.s' -a X"$1" != X"-c"; then
  660.     echo 'x - skipping logf.s (File already exists)'
  661.     rm -f _shar_wnt_.tmp
  662. else
  663. > _shar_wnt_.tmp
  664. echo 'x - extracting logf.s (Text)'
  665. sed 's/^X//' << 'SHAR_EOF' > 'logf.s' &&
  666. /*
  667. ** This file is part of the alternative 80386 math library and is
  668. ** covered by the GNU General Public license with my modification
  669. ** as noted in the README file that accompanied this file.
  670. **
  671. ** Copyright 1990 G. Geers
  672. **
  673. */
  674. X
  675. X    .align 4
  676. X    .globl logf
  677. logf:
  678. X    pushl %ebp
  679. X    movl %esp,%ebp
  680. X
  681. X    fldln2
  682. X    flds 8(%ebp)
  683. X    fyl2x
  684. X
  685. X    leave
  686. X    ret
  687. SHAR_EOF
  688. chmod 0644 logf.s ||
  689. echo 'restore of logf.s failed'
  690. Wc_c="`wc -c < 'logf.s'`"
  691. test 331 -eq "$Wc_c" ||
  692.     echo 'logf.s: original size 331, current size' "$Wc_c"
  693. rm -f _shar_wnt_.tmp
  694. fi
  695. # ============= tanf.s ==============
  696. if test -f 'tanf.s' -a X"$1" != X"-c"; then
  697.     echo 'x - skipping tanf.s (File already exists)'
  698.     rm -f _shar_wnt_.tmp
  699. else
  700. > _shar_wnt_.tmp
  701. echo 'x - extracting tanf.s (Text)'
  702. sed 's/^X//' << 'SHAR_EOF' > 'tanf.s' &&
  703. /*
  704. ** This file is part of the alternative 80386 math library and is
  705. ** covered by the GNU General Public license with my modification
  706. ** as noted in the README file that accompanied this file.
  707. **
  708. ** Copyright 1990 G. Geers
  709. **
  710. */
  711. X
  712. X    .align 4
  713. X    .globl tanf
  714. tanf:
  715. X    pushl %ebp
  716. X    movl %esp,%ebp
  717. X
  718. X    flds 8(%ebp)
  719. X    fptan
  720. X    fstp %st(0)
  721. X
  722. X    leave
  723. X    ret
  724. SHAR_EOF
  725. chmod 0644 tanf.s ||
  726. echo 'restore of tanf.s failed'
  727. Wc_c="`wc -c < 'tanf.s'`"
  728. test 336 -eq "$Wc_c" ||
  729.     echo 'tanf.s: original size 336, current size' "$Wc_c"
  730. rm -f _shar_wnt_.tmp
  731. fi
  732. # ============= atanf.s ==============
  733. if test -f 'atanf.s' -a X"$1" != X"-c"; then
  734.     echo 'x - skipping atanf.s (File already exists)'
  735.     rm -f _shar_wnt_.tmp
  736. else
  737. > _shar_wnt_.tmp
  738. echo 'x - extracting atanf.s (Text)'
  739. sed 's/^X//' << 'SHAR_EOF' > 'atanf.s' &&
  740. /*
  741. ** This file is part of the alternative 80386 math library and is
  742. ** covered by the GNU General Public license with my modification
  743. ** as noted in the README file that accompanied this file.
  744. **
  745. ** Copyright 1990 G. Geers
  746. **
  747. */
  748. X
  749. X    .align 4
  750. X    .globl atanf
  751. atanf:
  752. X    pushl %ebp
  753. X    movl %esp,%ebp
  754. X    
  755. X    flds 8(%ebp)
  756. X    fld1
  757. X    fpatan
  758. X
  759. X    leave
  760. X    ret
  761. SHAR_EOF
  762. chmod 0644 atanf.s ||
  763. echo 'restore of atanf.s failed'
  764. Wc_c="`wc -c < 'atanf.s'`"
  765. test 333 -eq "$Wc_c" ||
  766.     echo 'atanf.s: original size 333, current size' "$Wc_c"
  767. rm -f _shar_wnt_.tmp
  768. fi
  769. # ============= exp2f.s ==============
  770. if test -f 'exp2f.s' -a X"$1" != X"-c"; then
  771.     echo 'x - skipping exp2f.s (File already exists)'
  772.     rm -f _shar_wnt_.tmp
  773. else
  774. > _shar_wnt_.tmp
  775. echo 'x - extracting exp2f.s (Text)'
  776. sed 's/^X//' << 'SHAR_EOF' > 'exp2f.s' &&
  777. /*
  778. ** This file is part of the alternative 80386 math library and is
  779. ** covered by the GNU General Public license with my modification
  780. ** as noted in the README file that accompanied this file.
  781. **
  782. ** Copyright 1990 G. Geers
  783. **
  784. */
  785. X
  786. X    .align 4
  787. X    .globl exp2f
  788. exp2f:
  789. X    pushl %ebp
  790. X    movl %esp,%ebp
  791. X
  792. X    flds 8(%ebp)
  793. X    fstl %st(1)
  794. X    frndint
  795. X    fstl %st(2)
  796. X    fsubrp
  797. X    f2xm1
  798. X    fld1
  799. X    faddp
  800. X    fscale
  801. X
  802. X    leave
  803. X    ret
  804. SHAR_EOF
  805. chmod 0644 exp2f.s ||
  806. echo 'restore of exp2f.s failed'
  807. Wc_c="`wc -c < 'exp2f.s'`"
  808. test 389 -eq "$Wc_c" ||
  809.     echo 'exp2f.s: original size 389, current size' "$Wc_c"
  810. rm -f _shar_wnt_.tmp
  811. fi
  812. # ============= ieee_extf.s ==============
  813. if test -f 'ieee_extf.s' -a X"$1" != X"-c"; then
  814.     echo 'x - skipping ieee_extf.s (File already exists)'
  815.     rm -f _shar_wnt_.tmp
  816. else
  817. > _shar_wnt_.tmp
  818. echo 'x - extracting ieee_extf.s (Text)'
  819. sed 's/^X//' << 'SHAR_EOF' > 'ieee_extf.s' &&
  820. /*
  821. ** This file is part of the alternative 80386 math library and is
  822. ** covered by the GNU General Public license with my modification
  823. ** as noted in the README file that accompanied this file.
  824. **
  825. ** Copyright 1990 G. Geers
  826. **
  827. */
  828. X
  829. X    .align 4
  830. X    .globl isnanf
  831. isnanf:
  832. X    pushl %ebp
  833. X    movl %esp,%ebp
  834. X
  835. X    movl 8(%ebp), %eax
  836. X    andl $0x7f800000, %eax
  837. X    cmpl $0x7f800000, %eax
  838. X    jne .Lnotnan
  839. X    movl 8(%ebp), %eax
  840. X    andl $0x7ffff, %eax
  841. X    cmpl $0x0, %eax
  842. X    je .Lnotnan
  843. X
  844. X    movl $1, %eax
  845. X    leave 
  846. X    ret
  847. X
  848. .Lnotnan:
  849. X    movl $0, %eax
  850. X
  851. .Ldone:
  852. X    leave
  853. X    ret
  854. X
  855. X    .align 4
  856. X    .globl isinff
  857. isinff:
  858. X    pushl %ebp
  859. X    movl %esp,%ebp
  860. X
  861. X    movl 8(%ebp), %eax
  862. X    andl $0x7fffffff, %eax
  863. X    cmpl $0x7f800000, %eax
  864. X    je .Lgotinf
  865. X
  866. X    movl $0, %eax
  867. X    leave
  868. X    ret
  869. X
  870. .Lgotinf:
  871. X    movl $1, %eax
  872. X    leave
  873. X    ret
  874. X
  875. X    .align 4
  876. X    .globl iszerof
  877. iszerof:
  878. X    pushl %ebp
  879. X    movl %esp,%ebp
  880. X
  881. X    movl 8(%ebp), %eax
  882. X    cmpl $0x0, %eax
  883. X    je .Lgotzero
  884. X
  885. X    movl $0, %eax
  886. X    leave
  887. X    ret
  888. X
  889. .Lgotzero:
  890. X    movl $1, %eax
  891. X    leave
  892. X    ret
  893. X
  894. X    .align 4
  895. X    .globl signbitf
  896. signbitf:
  897. X    pushl %ebp
  898. X    movl %esp,%ebp
  899. X
  900. X    movl 8(%ebp), %eax
  901. X    andl $0x80000000, %eax
  902. X    cmpl $0x80000000, %eax
  903. X    jne .Lpos
  904. X    movl $1, %eax
  905. X    leave
  906. X    ret
  907. X
  908. .Lpos:
  909. X    movl $0, %eax
  910. X    leave
  911. X    ret
  912. X
  913. X    .align 4
  914. X    .globl issubnormalf
  915. issubnormalf:
  916. X    pushl %ebp
  917. X    movl %esp,%ebp
  918. X
  919. X    movl 8(%ebp), %eax
  920. X    andl $0x7f800000, %eax
  921. X    cmpl $0x0, %eax
  922. X    je .Lcouldbesub
  923. X
  924. .Lnotsubnorm:
  925. X    movl $0, %eax
  926. X    leave
  927. X    ret
  928. X
  929. .Lcouldbesub:
  930. X    movl 8(%ebp), %eax
  931. X    andl $0x7ffff, %eax
  932. X    cmpl $0x0, %eax
  933. X    je .Lnotsubnorm
  934. X
  935. X    movl $1, %eax
  936. X    leave
  937. X    ret
  938. X
  939. X    .align 4
  940. X    .globl isnormalf
  941. isnormalf:
  942. X    pushl %ebp
  943. X    movl %esp,%ebp
  944. X
  945. X    movl 8(%ebp), %eax
  946. X    andl $0x7f800000, %eax /* mask sign bit */
  947. X    xorl $0x7f800000, %eax 
  948. X    cmpl $0x0, %eax
  949. X    je .Lnotnorm
  950. X    cmpl $0x7f800000, %eax
  951. X    je .Lnotnorm
  952. X
  953. .Lnorm:
  954. X    movl $1, %eax
  955. X    leave
  956. X    ret
  957. X
  958. .Lnotnorm:
  959. X    movl $0, %eax
  960. X    leave
  961. X    ret
  962. SHAR_EOF
  963. chmod 0644 ieee_extf.s ||
  964. echo 'restore of ieee_extf.s failed'
  965. Wc_c="`wc -c < 'ieee_extf.s'`"
  966. test 1738 -eq "$Wc_c" ||
  967.     echo 'ieee_extf.s: original size 1738, current size' "$Wc_c"
  968. rm -f _shar_wnt_.tmp
  969. fi
  970. # ============= powf.s ==============
  971. if test -f 'powf.s' -a X"$1" != X"-c"; then
  972.     echo 'x - skipping powf.s (File already exists)'
  973.     rm -f _shar_wnt_.tmp
  974. else
  975. > _shar_wnt_.tmp
  976. echo 'x - extracting powf.s (Text)'
  977. sed 's/^X//' << 'SHAR_EOF' > 'powf.s' &&
  978. /*
  979. ** This file is part of the alternative 80386 math library and is
  980. ** covered by the GNU General Public license with my modification
  981. ** as noted in the README file that accompanied this file.
  982. **
  983. ** This file started life as a C implemenation of pow, it then evolved
  984. ** into an embeded asm version (with some C) and finally, all assembler.
  985. ** It's actually hacked assembler produced by gcc.
  986. **
  987. ** Copyright 1990 G. Geers
  988. **
  989. */
  990. X
  991. .text
  992. .LC0:
  993. X    .ascii "pow: DOMAIN ERROR\12\0"
  994. X    .align 4
  995. .LC1:
  996. X    .long 0x0
  997. X    .align 4
  998. .LC2:
  999. X    .long 0x3f800000
  1000. X    .align 4
  1001. .globl powf
  1002. powf:
  1003. X    pushl %ebp
  1004. X    movl %esp,%ebp
  1005. X    pushl %esi
  1006. X    pushl %ebx
  1007. X    xorl %esi,%esi
  1008. X    movl $1,%ebx
  1009. X    flds 8(%ebp)
  1010. X    ftst
  1011. X    fstp %st(0)
  1012. X    fnstsw %ax
  1013. X    sahf
  1014. X    jae .L2
  1015. X    movl %ebx,%esi
  1016. X    pushl 12(%ebp)
  1017. X
  1018. /**/
  1019. X    flds 12(%ebp)
  1020. X
  1021. X    fstcw -8(%ebp)
  1022. X    fstcw -12(%ebp)
  1023. X    orw $0x0400, -12(%ebp)
  1024. X    fldcw -12(%ebp)
  1025. X
  1026. X    frndint
  1027. X    fldcw -8(%ebp)
  1028. /**/
  1029. X    fsubrs 12(%ebp)
  1030. X    addl $4,%esp
  1031. X    ftst
  1032. X    fstp %st(0)
  1033. X    fnstsw %ax
  1034. X    sahf
  1035. X    je .L3
  1036. X    movl $33,errno
  1037. X    pushl $.LC0
  1038. X    pushl $_iob+32
  1039. X    call fprintf
  1040. X    flds .LC1
  1041. X    jmp .L1
  1042. X    .align 4
  1043. .L3:
  1044. X    flds 12(%ebp)
  1045. /**/
  1046. X    fstpl -8(%ebp)
  1047. X
  1048. X    fldl -8(%ebp) 
  1049. X    fistpl -8(%ebp)
  1050. X    movl -8(%ebp),%eax
  1051. /**/
  1052. X    movl %eax,%edx
  1053. X    testl %eax,%eax
  1054. X    jge .L5
  1055. X    incl %eax
  1056. .L5:
  1057. X    andl $-2,%eax
  1058. X    subl %eax,%edx
  1059. X    movl %edx,%eax
  1060. X    testl %eax,%eax
  1061. X    je .L2
  1062. X    xorl %ebx,%ebx
  1063. .L2:
  1064. X    flds 8(%ebp)
  1065. X    ftst
  1066. X    fstp %st(0)
  1067. X    fnstsw %ax
  1068. X    sahf
  1069. X    jne .L6
  1070. X    flds 12(%ebp)
  1071. X    ftst
  1072. X    fstp %st(0)
  1073. X    fnstsw %ax
  1074. X    sahf
  1075. X    je .L6
  1076. X    flds .LC1
  1077. X    jmp .L1
  1078. X    .align 4
  1079. .L6:
  1080. X    flds 12(%ebp)
  1081. X    ftst
  1082. X    fstp %st(0)
  1083. X    fnstsw %ax
  1084. X    sahf
  1085. X    jne .L8
  1086. X    flds .LC2
  1087. X    jmp .L1
  1088. X    .align 4
  1089. .L8:
  1090. /APP
  1091. X    flds 12(%ebp)
  1092. X    flds 8(%ebp)
  1093. /NO_APP
  1094. X    testl %esi,%esi
  1095. X    je .L10
  1096. /APP
  1097. X    fchs
  1098. /NO_APP
  1099. .L10:
  1100. /APP
  1101. X    fyl2x
  1102. X    fstl %st(1)
  1103. X    frndint
  1104. X    fstl %st(2)
  1105. X    fsubr %st(1)
  1106. X    f2xm1
  1107. X    fld1
  1108. X    faddp
  1109. X    fld %st(2)
  1110. X    fstp %st(2)
  1111. X    fscale
  1112. /NO_APP
  1113. X    testl %ebx,%ebx
  1114. X    jne .L1
  1115. /APP
  1116. X    fchs
  1117. /NO_APP
  1118. .L1:
  1119. X    leal -8(%ebp),%esp
  1120. X    popl %ebx
  1121. X    popl %esi
  1122. X    leave
  1123. X    ret
  1124. SHAR_EOF
  1125. chmod 0644 powf.s ||
  1126. echo 'restore of powf.s failed'
  1127. Wc_c="`wc -c < 'powf.s'`"
  1128. test 1850 -eq "$Wc_c" ||
  1129.     echo 'powf.s: original size 1850, current size' "$Wc_c"
  1130. rm -f _shar_wnt_.tmp
  1131. fi
  1132. # ============= tanhf.s ==============
  1133. if test -f 'tanhf.s' -a X"$1" != X"-c"; then
  1134.     echo 'x - skipping tanhf.s (File already exists)'
  1135.     rm -f _shar_wnt_.tmp
  1136. else
  1137. > _shar_wnt_.tmp
  1138. echo 'x - extracting tanhf.s (Text)'
  1139. sed 's/^X//' << 'SHAR_EOF' > 'tanhf.s' &&
  1140. /*
  1141. ** This file is part of the alternative 80386 math library and is
  1142. ** covered by the GNU General Public license with my modification
  1143. ** as noted in the README file that accompanied this file.
  1144. **
  1145. ** Copyright 1990 G. Geers
  1146. **
  1147. */
  1148. X
  1149. X    .align 4
  1150. X    .globl tanhf
  1151. tanhf:
  1152. X    pushl %ebp
  1153. X    movl %esp,%ebp
  1154. X    subl $8, %esp
  1155. X
  1156. X    flds 8(%ebp)
  1157. X    fldl2e
  1158. X    fmulp
  1159. X    fstl %st(1)
  1160. X    frndint
  1161. X    fstl %st(2)
  1162. X    fsubrp
  1163. X    f2xm1
  1164. X    fld1
  1165. X    faddp
  1166. X    fscale
  1167. X    fstl %st(1)
  1168. X    fsts -16(%ebp)
  1169. X
  1170. X    fld1
  1171. X    fdivp
  1172. X
  1173. X    fsubr
  1174. X    fadds -16(%ebp)
  1175. X    fdivrp
  1176. X
  1177. X    leave
  1178. X    ret
  1179. SHAR_EOF
  1180. chmod 0644 tanhf.s ||
  1181. echo 'restore of tanhf.s failed'
  1182. Wc_c="`wc -c < 'tanhf.s'`"
  1183. test 495 -eq "$Wc_c" ||
  1184.     echo 'tanhf.s: original size 495, current size' "$Wc_c"
  1185. rm -f _shar_wnt_.tmp
  1186. fi
  1187. # ============= atanhf.s ==============
  1188. if test -f 'atanhf.s' -a X"$1" != X"-c"; then
  1189.     echo 'x - skipping atanhf.s (File already exists)'
  1190.     rm -f _shar_wnt_.tmp
  1191. else
  1192. > _shar_wnt_.tmp
  1193. echo 'x - extracting atanhf.s (Text)'
  1194. sed 's/^X//' << 'SHAR_EOF' > 'atanhf.s' &&
  1195. /*
  1196. ** This file is part of the alternative 80386 math library and is
  1197. ** covered by the GNU General Public license with my modification
  1198. ** as noted in the README file that accompanied this file.
  1199. **
  1200. ** Copyright 1990 G. Geers
  1201. **
  1202. */
  1203. X
  1204. X    .align 4
  1205. .Lhalf:
  1206. X    .double 0.500
  1207. X
  1208. X    .align 4
  1209. X    .globl atanhf
  1210. atanhf:
  1211. X    pushl %ebp
  1212. X    movl %esp,%ebp
  1213. X
  1214. X    fld1
  1215. X    fadds 8(%ebp)
  1216. X    fld1
  1217. X    fsubs 8(%ebp)
  1218. X    fdivrp
  1219. X
  1220. X    fldln2
  1221. X    fxch %st(1)
  1222. X    fyl2x
  1223. X
  1224. X    flds .Lhalf
  1225. X    fmulp
  1226. X
  1227. X    leave
  1228. X    ret
  1229. SHAR_EOF
  1230. chmod 0644 atanhf.s ||
  1231. echo 'restore of atanhf.s failed'
  1232. Wc_c="`wc -c < 'atanhf.s'`"
  1233. test 440 -eq "$Wc_c" ||
  1234.     echo 'atanhf.s: original size 440, current size' "$Wc_c"
  1235. rm -f _shar_wnt_.tmp
  1236. fi
  1237. # ============= expf.s ==============
  1238. if test -f 'expf.s' -a X"$1" != X"-c"; then
  1239.     echo 'x - skipping expf.s (File already exists)'
  1240.     rm -f _shar_wnt_.tmp
  1241. else
  1242. > _shar_wnt_.tmp
  1243. echo 'x - extracting expf.s (Text)'
  1244. sed 's/^X//' << 'SHAR_EOF' > 'expf.s' &&
  1245. /*
  1246. ** This file is part of the alternative 80386 math library and is
  1247. ** covered by the GNU General Public license with my modification
  1248. ** as noted in the README file that accompanied this file.
  1249. **
  1250. ** Copyright 1990 G. Geers
  1251. **
  1252. */
  1253. X
  1254. X    .align 4
  1255. X    .globl expf
  1256. expf:
  1257. X    pushl %ebp
  1258. X    movl %esp,%ebp
  1259. X
  1260. X    flds 8(%ebp)
  1261. X    fldl2e
  1262. X    fmulp
  1263. X    fstl %st(1)
  1264. X    frndint
  1265. X    fstl %st(2)
  1266. X    fsubrp
  1267. X    f2xm1
  1268. X    fld1
  1269. X    faddp
  1270. X    fscale
  1271. X
  1272. X    leave
  1273. X    ret
  1274. SHAR_EOF
  1275. chmod 0644 expf.s ||
  1276. echo 'restore of expf.s failed'
  1277. Wc_c="`wc -c < 'expf.s'`"
  1278. test 402 -eq "$Wc_c" ||
  1279.     echo 'expf.s: original size 402, current size' "$Wc_c"
  1280. rm -f _shar_wnt_.tmp
  1281. fi
  1282. # ============= ieee_valuesf.s ==============
  1283. if test -f 'ieee_valuesf.s' -a X"$1" != X"-c"; then
  1284.     echo 'x - skipping ieee_valuesf.s (File already exists)'
  1285.     rm -f _shar_wnt_.tmp
  1286. else
  1287. > _shar_wnt_.tmp
  1288. echo 'x - extracting ieee_valuesf.s (Text)'
  1289. sed 's/^X//' << 'SHAR_EOF' > 'ieee_valuesf.s' &&
  1290. /*
  1291. ** This file is part of the alternative 80386 math library and is
  1292. ** covered by the GNU General Public license with my modification
  1293. ** as noted in the README file that accompanied this file.
  1294. **
  1295. ** Copyright 1990 G. Geers
  1296. **
  1297. */
  1298. X
  1299. X    .align 4
  1300. X    .globl max_normalf
  1301. X
  1302. max_normalf:
  1303. X    pushl %ebp
  1304. X    movl %esp,%ebp
  1305. X    subl $8, %esp
  1306. X
  1307. X    movl $0x7f7fffff, -8(%ebp)
  1308. X
  1309. X    flds -8(%ebp)
  1310. X    
  1311. X    leave
  1312. X    ret
  1313. X
  1314. X    .align 4
  1315. X    .globl min_normalf
  1316. X
  1317. min_normalf:
  1318. X    pushl %ebp
  1319. X    movl %esp,%ebp
  1320. X    subl $8, %esp
  1321. X
  1322. X    movl $0x00800001, -8(%ebp)
  1323. X
  1324. X    flds -8(%ebp)
  1325. X    
  1326. X    leave
  1327. X    ret
  1328. X
  1329. X    .align 4
  1330. X    .globl min_subnormalf
  1331. X
  1332. min_subnormalf:
  1333. X    pushl %ebp
  1334. X    movl %esp,%ebp
  1335. X    subl $8, %esp
  1336. X
  1337. X    movl $0x00000001, -8(%ebp)
  1338. X
  1339. X    flds -8(%ebp)
  1340. X    
  1341. X    leave
  1342. X    ret
  1343. X
  1344. X    .align 4
  1345. X    .globl max_subnormalf
  1346. X
  1347. max_subnormalf:
  1348. X    pushl %ebp
  1349. X    movl %esp,%ebp
  1350. X    subl $8, %esp
  1351. X
  1352. X    movl $0x007fffff, -8(%ebp)
  1353. X
  1354. X    flds -8(%ebp)
  1355. X    
  1356. X    leave
  1357. X    ret
  1358. X
  1359. X    .align 4
  1360. X    .globl quiet_nanf
  1361. X
  1362. quiet_nanf:
  1363. X    pushl %ebp
  1364. X    movl %esp,%ebp
  1365. X    subl $8, %esp
  1366. X
  1367. X    movl $0x7fffffff, -8(%ebp)
  1368. X
  1369. X    flds -8(%ebp)
  1370. X    
  1371. X    leave
  1372. X    ret
  1373. X
  1374. X    .align 4
  1375. X    .globl signaling_nanf
  1376. X
  1377. signaling_nanf:
  1378. X    pushl %ebp
  1379. X    movl %esp,%ebp
  1380. X    subl $8, %esp
  1381. X
  1382. X    movl $0x7f800001, -8(%ebp)
  1383. X
  1384. X    fldl -8(%ebp)
  1385. X    
  1386. X    leave
  1387. X    ret
  1388. SHAR_EOF
  1389. chmod 0644 ieee_valuesf.s ||
  1390. echo 'restore of ieee_valuesf.s failed'
  1391. Wc_c="`wc -c < 'ieee_valuesf.s'`"
  1392. test 1128 -eq "$Wc_c" ||
  1393.     echo 'ieee_valuesf.s: original size 1128, current size' "$Wc_c"
  1394. rm -f _shar_wnt_.tmp
  1395. fi
  1396. # ============= rintf.s ==============
  1397. if test -f 'rintf.s' -a X"$1" != X"-c"; then
  1398.     echo 'x - skipping rintf.s (File already exists)'
  1399.     rm -f _shar_wnt_.tmp
  1400. else
  1401. > _shar_wnt_.tmp
  1402. echo 'x - extracting rintf.s (Text)'
  1403. sed 's/^X//' << 'SHAR_EOF' > 'rintf.s' &&
  1404. /*
  1405. ** This file is part of the alternative 80386 math library and is
  1406. ** covered by the GNU General Public license with my modification
  1407. ** as noted in the README file that accompanied this file.
  1408. **
  1409. ** Copyright 1990 G. Geers
  1410. **
  1411. */
  1412. X
  1413. X    .align 4
  1414. X    .globl rintf
  1415. rintf:
  1416. X    pushl %ebp
  1417. X    movl %esp,%ebp
  1418. X    
  1419. X    flds 8(%ebp)
  1420. X    frndint
  1421. X
  1422. X    leave
  1423. X    ret
  1424. SHAR_EOF
  1425. chmod 0644 rintf.s ||
  1426. echo 'restore of rintf.s failed'
  1427. Wc_c="`wc -c < 'rintf.s'`"
  1428. test 328 -eq "$Wc_c" ||
  1429.     echo 'rintf.s: original size 328, current size' "$Wc_c"
  1430. rm -f _shar_wnt_.tmp
  1431. fi
  1432. # ============= ceilf.s ==============
  1433. if test -f 'ceilf.s' -a X"$1" != X"-c"; then
  1434.     echo 'x - skipping ceilf.s (File already exists)'
  1435.     rm -f _shar_wnt_.tmp
  1436. else
  1437. > _shar_wnt_.tmp
  1438. echo 'x - extracting ceilf.s (Text)'
  1439. sed 's/^X//' << 'SHAR_EOF' > 'ceilf.s' &&
  1440. /*
  1441. ** This file is part of the alternative 80386 math library and is
  1442. ** covered by the GNU General Public license with my modification
  1443. ** as noted in the README file that accompanied this file.
  1444. **
  1445. ** Could use ceil(x) = -floor(-x) but this is quicker.
  1446. **
  1447. ** Copyright 1990 G. Geers
  1448. **
  1449. */
  1450. X
  1451. X    .align 4
  1452. X    .globl ceilf
  1453. ceilf:
  1454. X    pushl %ebp
  1455. X    movl %esp,%ebp
  1456. X    subl $8, %esp
  1457. X    
  1458. X    flds 8(%ebp)        /* load data */
  1459. X
  1460. X    fstcw -12(%ebp)        /* store control word */
  1461. X    fstcw -16(%ebp)        /* store it again */
  1462. X    orw $0x0800, -16(%ebp)    /* round toward +inf */
  1463. X    fldcw -16(%ebp)        /* store new control word */
  1464. X    frndint            /* rounding gives ceil(x) */
  1465. X    fldcw -12(%ebp)        /* restore original control word */
  1466. X
  1467. X    leave
  1468. X    ret
  1469. SHAR_EOF
  1470. chmod 0644 ceilf.s ||
  1471. echo 'restore of ceilf.s failed'
  1472. Wc_c="`wc -c < 'ceilf.s'`"
  1473. test 684 -eq "$Wc_c" ||
  1474.     echo 'ceilf.s: original size 684, current size' "$Wc_c"
  1475. rm -f _shar_wnt_.tmp
  1476. fi
  1477. # ============= expm1f.s ==============
  1478. if test -f 'expm1f.s' -a X"$1" != X"-c"; then
  1479.     echo 'x - skipping expm1f.s (File already exists)'
  1480.     rm -f _shar_wnt_.tmp
  1481. else
  1482. > _shar_wnt_.tmp
  1483. echo 'x - extracting expm1f.s (Text)'
  1484. sed 's/^X//' << 'SHAR_EOF' > 'expm1f.s' &&
  1485. /*
  1486. ** This file is part of the alternative 80386 math library and is
  1487. ** covered by the GNU General Public license with my modification
  1488. ** as noted in the README file that accompanied this file.
  1489. **
  1490. ** Copyright 1990 G. Geers
  1491. **
  1492. */
  1493. X
  1494. X    .align 4
  1495. X    .globl expm1
  1496. expm1:
  1497. X    pushl %ebp
  1498. X    movl %esp,%ebp
  1499. X    subl $8, %esp
  1500. X
  1501. X    flds 8(%ebp)
  1502. X    fldl2e
  1503. X    fmulp
  1504. X    fstl %st(1)
  1505. X    frndint
  1506. X    fstl %st(2)
  1507. X    fsubrp
  1508. X    f2xm1
  1509. X    fld1
  1510. X    faddp
  1511. X    fscale
  1512. X
  1513. X    fstpl -8(%ebp)
  1514. X
  1515. X    flds 8(%ebp)
  1516. X    fchs
  1517. X    fldl2e
  1518. X    fmulp
  1519. X    fstl %st(1)
  1520. X    frndint
  1521. X    fstl %st(2)
  1522. X    fsubrp
  1523. X    f2xm1
  1524. X    fld1
  1525. X    faddp
  1526. X    fscale
  1527. X
  1528. X    fld1
  1529. X    fsubp
  1530. X    fmull -8(%ebp)
  1531. X
  1532. X    leave
  1533. X    ret
  1534. SHAR_EOF
  1535. chmod 0644 expm1f.s ||
  1536. echo 'restore of expm1f.s failed'
  1537. Wc_c="`wc -c < 'expm1f.s'`"
  1538. test 573 -eq "$Wc_c" ||
  1539.     echo 'expm1f.s: original size 573, current size' "$Wc_c"
  1540. rm -f _shar_wnt_.tmp
  1541. fi
  1542. # ============= infinityf.s ==============
  1543. if test -f 'infinityf.s' -a X"$1" != X"-c"; then
  1544.     echo 'x - skipping infinityf.s (File already exists)'
  1545.     rm -f _shar_wnt_.tmp
  1546. else
  1547. > _shar_wnt_.tmp
  1548. echo 'x - extracting infinityf.s (Text)'
  1549. sed 's/^X//' << 'SHAR_EOF' > 'infinityf.s' &&
  1550. /*
  1551. ** This file is part of the alternative 80386 math library and is
  1552. ** covered by the GNU General Public license with my modification
  1553. ** as noted in the README file that accompanied this file.
  1554. **
  1555. ** Copyright 1990 G. Geers
  1556. **
  1557. */
  1558. X
  1559. X    .align 4
  1560. X    .globl infinityf
  1561. infinityf:
  1562. X    pushl %ebp
  1563. X    movl %esp,%ebp
  1564. X    subl $8, %esp
  1565. X
  1566. X    movl $0x7f800000, -8(%ebp)
  1567. X
  1568. X    flds -8(%ebp)
  1569. X    
  1570. X    leave
  1571. X    ret
  1572. SHAR_EOF
  1573. chmod 0644 infinityf.s ||
  1574. echo 'restore of infinityf.s failed'
  1575. Wc_c="`wc -c < 'infinityf.s'`"
  1576. test 372 -eq "$Wc_c" ||
  1577.     echo 'infinityf.s: original size 372, current size' "$Wc_c"
  1578. rm -f _shar_wnt_.tmp
  1579. fi
  1580. # ============= scalbf.s ==============
  1581. if test -f 'scalbf.s' -a X"$1" != X"-c"; then
  1582.     echo 'x - skipping scalbf.s (File already exists)'
  1583.     rm -f _shar_wnt_.tmp
  1584. else
  1585. > _shar_wnt_.tmp
  1586. echo 'x - extracting scalbf.s (Text)'
  1587. sed 's/^X//' << 'SHAR_EOF' > 'scalbf.s' &&
  1588. /*
  1589. ** This file is part of the alternative 80386 math library and is
  1590. ** covered by the GNU General Public license with my modification
  1591. ** as noted in the README file that accompanied this file.
  1592. **
  1593. ** Copyright 1990 G. Geers
  1594. **
  1595. */
  1596. X
  1597. X    .align 4
  1598. X    .globl scalbf
  1599. scalbf:
  1600. X    pushl %ebp
  1601. X    movl %esp,%ebp
  1602. X    
  1603. X    fildl 12(%ebp)
  1604. X    flds 8(%ebp)
  1605. X    fscale
  1606. X
  1607. X    leave
  1608. X    ret
  1609. SHAR_EOF
  1610. chmod 0644 scalbf.s ||
  1611. echo 'restore of scalbf.s failed'
  1612. Wc_c="`wc -c < 'scalbf.s'`"
  1613. test 345 -eq "$Wc_c" ||
  1614.     echo 'scalbf.s: original size 345, current size' "$Wc_c"
  1615. rm -f _shar_wnt_.tmp
  1616. fi
  1617. # ============= ieee_retro.c ==============
  1618. if test -f 'ieee_retro.c' -a X"$1" != X"-c"; then
  1619.     echo 'x - skipping ieee_retro.c (File already exists)'
  1620.     rm -f _shar_wnt_.tmp
  1621. else
  1622. > _shar_wnt_.tmp
  1623. echo 'x - extracting ieee_retro.c (Text)'
  1624. sed 's/^X//' << 'SHAR_EOF' > 'ieee_retro.c' &&
  1625. /*
  1626. ** This file is part of the alternative 80386 math library and is
  1627. ** covered by the GNU General Public license with my modification
  1628. ** as noted in the README file that accompanied this file.
  1629. **
  1630. ** Copyright 1990 G. Geers
  1631. **
  1632. */
  1633. X
  1634. #include <stdio.h>
  1635. X
  1636. extern short _getsw();
  1637. X
  1638. ieee_retrospective(f)
  1639. FILE *f;
  1640. {
  1641. X    short status;
  1642. X
  1643. X    if (f == (FILE *)NULL)
  1644. X        f = stderr;
  1645. X
  1646. X    status = _getsw();
  1647. X
  1648. X    if (status & 0xdf) {
  1649. X        fprintf(f,"\n");
  1650. X        fprintf(f,"Warning: the following IEEE floating-point");
  1651. X        fprintf(f," arithmetic exceptions\n");
  1652. X        fprintf(f,"occurred in this program and were never cleared:\n");
  1653. X        if (status & 0x0001) fprintf(f,"Invalid Operation;\n");
  1654. X        if (status & 0x0002) fprintf(f,"Denormal;\n");
  1655. X        if (status & 0x0004) fprintf(f,"Division by Zero;\n");
  1656. X        if (status & 0x0008) fprintf(f,"Overflow;\n");
  1657. X        if (status & 0x0010) fprintf(f,"Underflow;\n");
  1658. X        fprintf(f,"\n");
  1659. X    }
  1660. }
  1661. SHAR_EOF
  1662. chmod 0644 ieee_retro.c ||
  1663. echo 'restore of ieee_retro.c failed'
  1664. Wc_c="`wc -c < 'ieee_retro.c'`"
  1665. test 879 -eq "$Wc_c" ||
  1666.     echo 'ieee_retro.c: original size 879, current size' "$Wc_c"
  1667. rm -f _shar_wnt_.tmp
  1668. fi
  1669. # ============= _getsw.s ==============
  1670. if test -f '_getsw.s' -a X"$1" != X"-c"; then
  1671.     echo 'x - skipping _getsw.s (File already exists)'
  1672.     rm -f _shar_wnt_.tmp
  1673. else
  1674. > _shar_wnt_.tmp
  1675. echo 'x - extracting _getsw.s (Text)'
  1676. sed 's/^X//' << 'SHAR_EOF' > '_getsw.s' &&
  1677. /*
  1678. ** This file is part of the alternative 80386 math library and is
  1679. ** covered by the GNU General Public license with my modification
  1680. ** as noted in the README file that accompanied this file.
  1681. **
  1682. ** Copyright 1990 G. Geers
  1683. **
  1684. */
  1685. X
  1686. X        .align 4
  1687. X        .globl _getsw
  1688. X
  1689. _getsw:
  1690. X    pushl %ebp
  1691. X    movl %esp,%ebp
  1692. X
  1693. X    fstsw %ax
  1694. X
  1695. X    leave
  1696. X    ret
  1697. SHAR_EOF
  1698. chmod 0644 _getsw.s ||
  1699. echo 'restore of _getsw.s failed'
  1700. Wc_c="`wc -c < '_getsw.s'`"
  1701. test 320 -eq "$Wc_c" ||
  1702.     echo '_getsw.s: original size 320, current size' "$Wc_c"
  1703. rm -f _shar_wnt_.tmp
  1704. fi
  1705. # ============= setcont.s ==============
  1706. if test -f 'setcont.s' -a X"$1" != X"-c"; then
  1707.     echo 'x - skipping setcont.s (File already exists)'
  1708.     rm -f _shar_wnt_.tmp
  1709. else
  1710. > _shar_wnt_.tmp
  1711. echo 'x - extracting setcont.s (Text)'
  1712. sed 's/^X//' << 'SHAR_EOF' > 'setcont.s' &&
  1713. /*
  1714. ** This file is part of the alternative 80386 math library and is
  1715. ** covered by the GNU General Public license with my modification
  1716. ** as noted in the README file that accompanied this file.
  1717. **
  1718. ** Copyright 1990 G. Geers
  1719. **
  1720. */
  1721. X
  1722. X    .align 4
  1723. X    .globl setcont
  1724. X
  1725. setcont:
  1726. X    pushl %ebp
  1727. X    movl %esp, %ebp
  1728. X    subl $4, %esp
  1729. X
  1730. X    fnstcw -8(%ebp)
  1731. X    movw -8(%ebp), %ax
  1732. X    fldcw 8(%ebp)
  1733. X
  1734. X    leave
  1735. X    ret
  1736. SHAR_EOF
  1737. chmod 0644 setcont.s ||
  1738. echo 'restore of setcont.s failed'
  1739. Wc_c="`wc -c < 'setcont.s'`"
  1740. test 377 -eq "$Wc_c" ||
  1741.     echo 'setcont.s: original size 377, current size' "$Wc_c"
  1742. rm -f _shar_wnt_.tmp
  1743. fi
  1744. # ============= setinternal.s ==============
  1745. if test -f 'setinternal.s' -a X"$1" != X"-c"; then
  1746.     echo 'x - skipping setinternal.s (File already exists)'
  1747.     rm -f _shar_wnt_.tmp
  1748. else
  1749. > _shar_wnt_.tmp
  1750. echo 'x - extracting setinternal.s (Text)'
  1751. sed 's/^X//' << 'SHAR_EOF' > 'setinternal.s' &&
  1752. /*
  1753. ** This file is part of the alternative 80386 math library and is
  1754. ** covered by the GNU General Public license with my modification
  1755. ** as noted in the README file that accompanied this file.
  1756. **
  1757. ** Copyright 1990 G. Geers
  1758. **
  1759. */
  1760. X
  1761. X    .align 4
  1762. X    .globl setinternal
  1763. X
  1764. setinternal:
  1765. X    pushl %ebp
  1766. X    movl %esp, %ebp
  1767. X    subl $4, %esp
  1768. X
  1769. X    fnstcw -8(%ebp)
  1770. X    movw -8(%ebp), %ax
  1771. X    orw $0x007e, -8(%ebp)    /*  All exceptions except IOP masked */
  1772. X    fldcw -8(%ebp)
  1773. X
  1774. X    leave
  1775. X    ret
  1776. SHAR_EOF
  1777. chmod 0644 setinternal.s ||
  1778. echo 'restore of setinternal.s failed'
  1779. Wc_c="`wc -c < 'setinternal.s'`"
  1780. test 449 -eq "$Wc_c" ||
  1781.     echo 'setinternal.s: original size 449, current size' "$Wc_c"
  1782. rm -f _shar_wnt_.tmp
  1783. fi
  1784. # ============= paranoia.c ==============
  1785. if test -f 'paranoia.c' -a X"$1" != X"-c"; then
  1786.     echo 'x - skipping paranoia.c (File already exists)'
  1787.     rm -f _shar_wnt_.tmp
  1788. else
  1789. > _shar_wnt_.tmp
  1790. echo 'x - extracting paranoia.c (Text)'
  1791. sed 's/^X//' << 'SHAR_EOF' > 'paranoia.c' &&
  1792. /*    A C version of Kahan's Floating Point Test "Paranoia"
  1793. X
  1794. X            Thos Sumner, UCSF, Feb. 1985
  1795. X            David Gay, BTL, Jan. 1986
  1796. X
  1797. X    This is a rewrite from the Pascal version by
  1798. X
  1799. X            B. A. Wichmann, 18 Jan. 1985
  1800. X
  1801. X    (and does NOT exhibit good C programming style).
  1802. X
  1803. (C) Apr 19 1983 in BASIC version by:
  1804. X    Professor W. M. Kahan,
  1805. X    567 Evans Hall
  1806. X    Electrical Engineering & Computer Science Dept.
  1807. X    University of California
  1808. X    Berkeley, California 94720
  1809. X    USA
  1810. X
  1811. converted to Pascal by:
  1812. X    B. A. Wichmann
  1813. X    National Physical Laboratory
  1814. X    Teddington Middx
  1815. X    TW11 OLW
  1816. X    UK
  1817. X
  1818. converted to C by:
  1819. X
  1820. X    David M. Gay        and    Thos Sumner
  1821. X    AT&T Bell Labs            Computer Center, Rm. U-76
  1822. X    600 Mountain Avenue        University of California
  1823. X    Murray Hill, NJ 07974        San Francisco, CA 94143
  1824. X    USA                USA
  1825. X
  1826. with simultaneous corrections to the Pascal source (reflected
  1827. in the Pascal source available over netlib).
  1828. [A couple of bug fixes from dgh = sun!dhough incorporated 31 July 1986.]
  1829. X
  1830. Reports of results on various systems from all the versions
  1831. of Paranoia are being collected by Richard Karpinski at the
  1832. same address as Thos Sumner.  This includes sample outputs,
  1833. bug reports, and criticisms.
  1834. X
  1835. You may copy this program freely if you acknowledge its source.
  1836. Comments on the Pascal version to NPL, please.
  1837. X
  1838. X
  1839. The C version catches signals from floating-point exceptions.
  1840. If signal(SIGFPE,...) is unavailable in your environment, you may
  1841. #define NOSIGNAL to comment out the invocations of signal.
  1842. X
  1843. This source file is too big for some C compilers, but may be split
  1844. into pieces.  Comments containing "SPLIT" suggest convenient places
  1845. for this splitting.  At the end of these comments is an "ed script"
  1846. (for the UNIX(tm) editor ed) that will do this splitting.
  1847. X
  1848. By #defining Single when you compile this source, you may obtain
  1849. a single-precision C version of Paranoia.
  1850. X
  1851. X
  1852. The following is from the introductory commentary from Wichmann's work:
  1853. X
  1854. The BASIC program of Kahan is written in Microsoft BASIC using many
  1855. facilities which have no exact analogy in Pascal.  The Pascal
  1856. version below cannot therefore be exactly the same.  Rather than be
  1857. a minimal transcription of the BASIC program, the Pascal coding
  1858. follows the conventional style of block-structured languages.  Hence
  1859. the Pascal version could be useful in producing versions in other
  1860. structured languages.
  1861. X
  1862. Rather than use identifiers of minimal length (which therefore have
  1863. little mnemonic significance), the Pascal version uses meaningful
  1864. identifiers as follows [Note: A few changes have been made for C]:
  1865. X
  1866. X
  1867. BASIC   C               BASIC   C               BASIC   C               
  1868. X
  1869. X   A                       J                       S    StickyBit
  1870. X   A1   AInverse           J0   NoErrors           T
  1871. X   B    Radix                    [Failure]         T0   Underflow
  1872. X   B1   BInverse           J1   NoErrors           T2   ThirtyTwo
  1873. X   B2   RadixD2                  [SeriousDefect]   T5   OneAndHalf
  1874. X   B9   BMinusU2           J2   NoErrors           T7   TwentySeven
  1875. X   C                             [Defect]          T8   TwoForty
  1876. X   C1   CInverse           J3   NoErrors           U    OneUlp
  1877. X   D                             [Flaw]            U0   UnderflowThreshold
  1878. X   D4   FourD              K    PageNo             U1
  1879. X   E0                      L    Milestone          U2
  1880. X   E1                      M                       V
  1881. X   E2   Exp2               N                       V0
  1882. X   E3                      N1                      V8
  1883. X   E5   MinSqEr            O    Zero               V9
  1884. X   E6   SqEr               O1   One                W
  1885. X   E7   MaxSqEr            O2   Two                X
  1886. X   E8                      O3   Three              X1
  1887. X   E9                      O4   Four               X8
  1888. X   F1   MinusOne           O5   Five               X9   Random1
  1889. X   F2   Half               O8   Eight              Y
  1890. X   F3   Third              O9   Nine               Y1
  1891. X   F6                      P    Precision          Y2
  1892. X   F9                      Q                       Y9   Random2
  1893. X   G1   GMult              Q8                      Z
  1894. X   G2   GDiv               Q9                      Z0   PseudoZero
  1895. X   G3   GAddSub            R                       Z1
  1896. X   H                       R1   RMult              Z2
  1897. X   H1   HInverse           R2   RDiv               Z9
  1898. X   I                       R3   RAddSub
  1899. X   IO   NoTrials           R4   RSqrt
  1900. X   I3   IEEE               R9   Random9
  1901. X
  1902. X   SqRWrng
  1903. X
  1904. All the variables in BASIC are true variables and in consequence,
  1905. the program is more difficult to follow since the "constants" must
  1906. be determined (the glossary is very helpful).  The Pascal version
  1907. uses Real constants, but checks are added to ensure that the values
  1908. are correctly converted by the compiler.
  1909. X
  1910. The major textual change to the Pascal version apart from the
  1911. identifiersis that named procedures are used, inserting parameters
  1912. wherehelpful.  New procedures are also introduced.  The
  1913. correspondence is as follows:
  1914. X
  1915. X
  1916. BASIC       Pascal
  1917. lines 
  1918. X
  1919. X  90- 140   Pause
  1920. X 170- 250   Instructions
  1921. X 380- 460   Heading
  1922. X 480- 670   Characteristics
  1923. X 690- 870   History
  1924. 2940-2950   Random
  1925. 3710-3740   NewD
  1926. 4040-4080   DoesYequalX
  1927. 4090-4110   PrintIfNPositive
  1928. 4640-4850   TestPartialUnderflow
  1929. X
  1930. =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  1931. X
  1932. Below is an "ed script" that splits para.c into 10 files
  1933. of the form part[1-8].c, subs.c, and msgs.c, plus a header
  1934. file, paranoia.h, that these files require.
  1935. X
  1936. r paranoia.c
  1937. $
  1938. ?SPLIT
  1939. +,$w msgs.c
  1940. X .,$d
  1941. ?SPLIT
  1942. X .d
  1943. +d
  1944. -,$w subs.c
  1945. -,$d
  1946. ?part8
  1947. +d
  1948. ?include
  1949. X .,$w part8.c
  1950. X .,$d
  1951. -d
  1952. ?part7
  1953. +d
  1954. ?include
  1955. X .,$w part7.c
  1956. X .,$d
  1957. -d
  1958. ?part6
  1959. +d
  1960. ?include
  1961. X .,$w part6.c
  1962. X .,$d
  1963. -d
  1964. ?part5
  1965. +d
  1966. ?include
  1967. X .,$w part5.c
  1968. X .,$d
  1969. -d
  1970. ?part4
  1971. +d
  1972. ?include
  1973. X .,$w part4.c
  1974. X .,$d
  1975. -d
  1976. ?part3
  1977. +d
  1978. ?include
  1979. X .,$w part3.c
  1980. X .,$d
  1981. -d
  1982. ?part2
  1983. +d
  1984. ?include
  1985. X .,$w part2.c
  1986. X .,$d
  1987. ?SPLIT
  1988. X .d
  1989. 1,/^#include/-1d
  1990. 1,$w part1.c
  1991. /Computed constants/,$d
  1992. 1,$s/^int/extern &/
  1993. 1,$s/^FLOAT/extern &/
  1994. 1,$s/^char/extern &/
  1995. 1,$s! = .*!;!
  1996. /^Guard/,/^Round/s/^/extern /
  1997. /^jmp_buf/s/^/extern /
  1998. /^Sig_type/s/^/extern /
  1999. s/$/\
  2000. extern void sigfpe();/
  2001. w paranoia.h
  2002. q
  2003. X
  2004. */
  2005. X
  2006. #include <stdio.h>
  2007. #ifndef NOSIGNAL
  2008. #include <signal.h>
  2009. #endif
  2010. #include <setjmp.h>
  2011. X
  2012. #include "fpumath.h"
  2013. X
  2014. #ifdef Single
  2015. #define FLOAT float
  2016. #define FABS(x) fabsf(x)
  2017. #define FLOOR(x) floorf(x)
  2018. #define LOG(x) logf(x)
  2019. #define POW(x,y) powf(x,y)
  2020. #ifdef TEST
  2021. #define SQRT(x) sqrtpf(x)
  2022. #else
  2023. #define SQRT(x) sqrtf(x)
  2024. #endif
  2025. #else
  2026. #define FLOAT double
  2027. #define FABS(x) fabs(x)
  2028. #define FLOOR(x) floor(x)
  2029. #define LOG(x) log(x)
  2030. #define POW(x,y) pow(x,y)
  2031. #ifdef TEST
  2032. #define SQRT(x) sqrtp(x)
  2033. #else
  2034. #define SQRT(x) sqrt(x)
  2035. #endif
  2036. #endif
  2037. X
  2038. jmp_buf ovfl_buf;
  2039. typedef void (*Sig_type)();
  2040. Sig_type sigsave;
  2041. X
  2042. #define KEYBOARD 0
  2043. X
  2044. FLOAT Radix, BInvrse, RadixD2, BMinusU2;
  2045. FLOAT Sign(), Random();
  2046. X
  2047. /*Small floating point constants.*/
  2048. FLOAT Zero = 0.0;
  2049. FLOAT Half = 0.5;
  2050. FLOAT One = 1.0;
  2051. FLOAT Two = 2.0;
  2052. FLOAT Three = 3.0;
  2053. FLOAT Four = 4.0;
  2054. FLOAT Five = 5.0;
  2055. FLOAT Eight = 8.0;
  2056. FLOAT Nine = 9.0;
  2057. FLOAT TwentySeven = 27.0;
  2058. FLOAT ThirtyTwo = 32.0;
  2059. FLOAT TwoForty = 240.0;
  2060. FLOAT MinusOne = -1.0;
  2061. FLOAT OneAndHalf = 1.5;
  2062. /*Integer constants*/
  2063. int NoTrials = 20; /*Number of tests for commutativity. */
  2064. #define False 0
  2065. #define True 1
  2066. X
  2067. /* Definitions for declared types 
  2068. X    Guard == (Yes, No);
  2069. X    Rounding == (Chopped, Rounded, Other);
  2070. X    Message == packed array [1..40] of char;
  2071. X    Class == (Flaw, Defect, Serious, Failure);
  2072. X      */
  2073. #define Yes 1
  2074. #define No  0
  2075. #define Chopped 2
  2076. #define Rounded 1
  2077. #define Other   0
  2078. #define Flaw    3
  2079. #define Defect  2
  2080. #define Serious 1
  2081. #define Failure 0
  2082. typedef int Guard, Rounding, Class;
  2083. typedef char Message;
  2084. X
  2085. /* Declarations of Variables */
  2086. int Indx;
  2087. char ch[8];
  2088. FLOAT AInvrse, A1;
  2089. FLOAT C, CInvrse;
  2090. FLOAT D, FourD;
  2091. FLOAT E0, E1, Exp2, E3, MinSqEr;
  2092. FLOAT SqEr, MaxSqEr, E9;
  2093. FLOAT Third;
  2094. FLOAT F6, F9;
  2095. FLOAT H, HInvrse;
  2096. int I;
  2097. FLOAT StickyBit, J;
  2098. FLOAT MyZero;
  2099. FLOAT Precision;
  2100. FLOAT Q, Q9;
  2101. FLOAT R, Random9;
  2102. FLOAT T, Underflow, S;
  2103. FLOAT OneUlp, UfThold, U1, U2;
  2104. FLOAT V, V0, V9;
  2105. FLOAT W;
  2106. FLOAT X, X1, X2, X8, Random1;
  2107. FLOAT Y, Y1, Y2, Random2;
  2108. FLOAT Z, PseudoZero, Z1, Z2, Z9;
  2109. int ErrCnt[4];
  2110. int fpecount;
  2111. int Milestone;
  2112. int PageNo;
  2113. int M, N, N1;
  2114. Guard GMult, GDiv, GAddSub;
  2115. Rounding RMult, RDiv, RAddSub, RSqrt;
  2116. int Break, Done, NotMonot, Monot, Anomaly, IEEE,
  2117. X        SqRWrng, UfNGrad;
  2118. /* Computed constants. */
  2119. /*U1  gap below 1.0, i.e, 1.0-U1 is next number below 1.0 */
  2120. /*U2  gap above 1.0, i.e, 1.0+U2 is next number above 1.0 */
  2121. X
  2122. /* floating point exception receiver */
  2123. X void
  2124. sigfpe()
  2125. {
  2126. X    fpecount++;
  2127. X    printf("\n* * * FLOATING-POINT ERROR * * *\n");
  2128. X    fflush(stdout);
  2129. X    if (sigsave) {
  2130. #ifndef NOSIGNAL
  2131. X        signal(SIGFPE, sigsave);
  2132. #endif
  2133. X        sigsave = 0;
  2134. X        longjmp(ovfl_buf, 1);
  2135. X        }
  2136. X    abort();
  2137. }
  2138. X
  2139. main()
  2140. {
  2141. /*
  2142. ** Modified by G. Geers - glenn@qed.physics.su.oz.au
  2143. **
  2144. ** Define TEST if you want to include my code
  2145. **
  2146. */
  2147. X
  2148. #ifdef TEST
  2149. #ifdef Single
  2150. X    setcont(MASK_ALL0);
  2151. #else
  2152. X    setcont(MASK_ALL);
  2153. #endif
  2154. #endif
  2155. X
  2156. X    /* First two assignments use integer right-hand sides. */
  2157. X    Zero = 0;
  2158. X    One = 1;
  2159. X    Two = One + One;
  2160. X    Three = Two + One;
  2161. X    Four = Three + One;
  2162. X    Five = Four + One;
  2163. X    Eight = Four + Four;
  2164. X    Nine = Three * Three;
  2165. X    TwentySeven = Nine * Three;
  2166. X    ThirtyTwo = Four * Eight;
  2167. X    TwoForty = Four * Five * Three * Four;
  2168. X    MinusOne = -One;
  2169. X    Half = One / Two;
  2170. X    OneAndHalf = One + Half;
  2171. X    ErrCnt[Failure] = 0;
  2172. X    ErrCnt[Serious] = 0;
  2173. X    ErrCnt[Defect] = 0;
  2174. X    ErrCnt[Flaw] = 0;
  2175. X    PageNo = 1;
  2176. X    /*=============================================*/
  2177. X    Milestone = 0;
  2178. X    /*=============================================*/
  2179. #ifndef NOSIGNAL
  2180. X    signal(SIGFPE, sigfpe);
  2181. #endif
  2182. X    Instructions();
  2183. X    Pause();
  2184. X    Heading();
  2185. X    Pause();
  2186. X    Characteristics();
  2187. X    Pause();
  2188. X    History();
  2189. X    Pause();
  2190. X    /*=============================================*/
  2191. X    Milestone = 7;
  2192. X    /*=============================================*/
  2193. X    printf("Program is now RUNNING tests on small integers:\n");
  2194. X    
  2195. X    TstCond (Failure, (Zero + Zero == Zero) && (One - One == Zero)
  2196. X           && (One > Zero) && (One + One == Two),
  2197. X            "0+0 != 0, 1-1 != 0, 1 <= 0, or 1+1 != 2");
  2198. X    Z = - Zero;
  2199. X    if (Z != 0.0) {
  2200. X        ErrCnt[Failure] = ErrCnt[Failure] + 1;
  2201. X        printf("Comparison alleges that -0.0 is Non-zero!\n");
  2202. X        U1 = 0.001;
  2203. X        Radix = 1;
  2204. X        TstPtUf();
  2205. X        }
  2206. X    TstCond (Failure, (Three == Two + One) && (Four == Three + One)
  2207. X           && (Four + Two * (- Two) == Zero)
  2208. X           && (Four - Three - One == Zero),
  2209. X           "3 != 2+1, 4 != 3+1, 4+2*(-2) != 0, or 4-3-1 != 0");
  2210. X    TstCond (Failure, (MinusOne == (0 - One))
  2211. X           && (MinusOne + One == Zero ) && (One + MinusOne == Zero)
  2212. X           && (MinusOne + FABS(One) == Zero)
  2213. X           && (MinusOne + MinusOne * MinusOne == Zero),
  2214. X           "-1+1 != 0, (-1)+abs(1) != 0, or -1+(-1)*(-1) != 0");
  2215. X    TstCond (Failure, Half + MinusOne + Half == Zero,
  2216. X          "1/2 + (-1) + 1/2 != 0");
  2217. X    /*=============================================*/
  2218. X    /*SPLIT
  2219. X    part2();
  2220. X    part3();
  2221. X    part4();
  2222. X    part5();
  2223. X    part6();
  2224. X    part7();
  2225. X    part8();
  2226. X
  2227. X    }
  2228. #include "paranoia.h"
  2229. part2(){
  2230. */
  2231. X    Milestone = 10;
  2232. X    /*=============================================*/
  2233. X    TstCond (Failure, (Nine == Three * Three)
  2234. X           && (TwentySeven == Nine * Three) && (Eight == Four + Four)
  2235. X           && (ThirtyTwo == Eight * Four)
  2236. X           && (ThirtyTwo - TwentySeven - Four - One == Zero),
  2237. X           "9 != 3*3, 27 != 9*3, 32 != 8*4, or 32-27-4-1 != 0");
  2238. X    TstCond (Failure, (Five == Four + One) &&
  2239. X            (TwoForty == Four * Five * Three * Four)
  2240. X           && (TwoForty / Three - Four * Four * Five == Zero)
  2241. X           && ( TwoForty / Four - Five * Three * Four == Zero)
  2242. X           && ( TwoForty / Five - Four * Three * Four == Zero),
  2243. X          "5 != 4+1, 240/3 != 80, 240/4 != 60, or 240/5 != 48");
  2244. X    if (ErrCnt[Failure] == 0) {
  2245. X        printf("-1, 0, 1/2, 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.\n");
  2246. X        printf("\n");
  2247. X        }
  2248. X    printf("Searching for Radix and Precision.\n");
  2249. X    W = One;
  2250. X    do  {
  2251. X        W = W + W;
  2252. X        Y = W + One;
  2253. X        Z = Y - W;
  2254. X        Y = Z - One;
  2255. X        } while (MinusOne + FABS(Y) < Zero);
  2256. X    /*.. now W is just big enough that |((W+1)-W)-1| >= 1 ...*/
  2257. X    Precision = Zero;
  2258. X    Y = One;
  2259. X    do  {
  2260. X        Radix = W + Y;
  2261. X        Y = Y + Y;
  2262. X        Radix = Radix - W;
  2263. X        } while ( Radix == Zero);
  2264. X    if (Radix < Two) Radix = One;
  2265. X    printf("Radix = %f .\n", Radix);
  2266. X    if (Radix != 1) {
  2267. X        W = One;
  2268. X        do  {
  2269. X            Precision = Precision + One;
  2270. X            W = W * Radix;
  2271. X            Y = W + One;
  2272. X            } while ((Y - W) == One);
  2273. X        }
  2274. X    /*... now W == Radix^Precision is barely too big to satisfy (W+1)-W == 1
  2275. X                                          ...*/
  2276. X    U1 = One / W;
  2277. X    U2 = Radix * U1;
  2278. X    printf("Closest relative separation found is U1 = %.7e .\n\n", U1);
  2279. X    printf("Recalculating radix and precision\n ");
  2280. X    
  2281. X    /*save old values*/
  2282. X    E0 = Radix;
  2283. X    E1 = U1;
  2284. X    E9 = U2;
  2285. X    E3 = Precision;
  2286. X    
  2287. X    X = Four / Three;
  2288. X    Third = X - One;
  2289. X    F6 = Half - Third;
  2290. X    X = F6 + F6;
  2291. X    X = FABS(X - Third);
  2292. X    if (X < U2) X = U2;
  2293. X    
  2294. X    /*... now X = (unknown no.) ulps of 1+...*/
  2295. X    do  {
  2296. X        U2 = X;
  2297. X        Y = Half * U2 + ThirtyTwo * U2 * U2;
  2298. X        Y = One + Y;
  2299. X        X = Y - One;
  2300. X        } while ( ! ((U2 <= X) || (X <= Zero)));
  2301. X    
  2302. X    /*... now U2 == 1 ulp of 1 + ... */
  2303. X    X = Two / Three;
  2304. X    F6 = X - Half;
  2305. X    Third = F6 + F6;
  2306. X    X = Third - Half;
  2307. X    X = FABS(X + F6);
  2308. X    if (X < U1) X = U1;
  2309. X    
  2310. X    /*... now  X == (unknown no.) ulps of 1 -... */
  2311. X    do  {
  2312. X        U1 = X;
  2313. X        Y = Half * U1 + ThirtyTwo * U1 * U1;
  2314. X        Y = Half - Y;
  2315. X        X = Half + Y;
  2316. X        Y = Half - X;
  2317. X        X = Half + Y;
  2318. X        } while ( ! ((U1 <= X) || (X <= Zero)));
  2319. X    /*... now U1 == 1 ulp of 1 - ... */
  2320. X    if (U1 == E1) printf("confirms closest relative separation U1 .\n");
  2321. X    else printf("gets better closest relative separation U1 = %.7e .\n", U1);
  2322. X    W = One / U1;
  2323. X    F9 = (Half - U1) + Half;
  2324. X    Radix = FLOOR(0.01 + U2 / U1);
  2325. X    if (Radix == E0) printf("Radix confirmed.\n");
  2326. X    else printf("MYSTERY: recalculated Radix = %.7e .\n", Radix);
  2327. X    TstCond (Defect, Radix <= Eight + Eight,
  2328. X           "Radix is too big: roundoff problems");
  2329. X    TstCond (Flaw, (Radix == Two) || (Radix == 10)
  2330. X           || (Radix == One), "Radix is not as good as 2 or 10");
  2331. X    /*=============================================*/
  2332. X    Milestone = 20;
  2333. X    /*=============================================*/
  2334. X    TstCond (Failure, F9 - Half < Half,
  2335. X           "(1-U1)-1/2 < 1/2 is FALSE, prog. fails?");
  2336. X    X = F9;
  2337. X    I = 1;
  2338. X    Y = X - Half;
  2339. X    Z = Y - Half;
  2340. X    TstCond (Failure, (X != One)
  2341. X           || (Z == Zero), "Comparison is fuzzy,X=1 but X-1/2-1/2 != 0");
  2342. X    X = One + U2;
  2343. X    I = 0;
  2344. X    /*=============================================*/
  2345. X    Milestone = 25;
  2346. X    /*=============================================*/
  2347. X    /*... BMinusU2 = nextafter(Radix, 0) */
  2348. X    BMinusU2 = Radix - One;
  2349. X    BMinusU2 = (BMinusU2 - U2) + One;
  2350. X    /* Purify Integers */
  2351. X    if (Radix != One)  {
  2352. X        X = - TwoForty * LOG(U1) / LOG(Radix);
  2353. X        Y = FLOOR(Half + X);
  2354. X        if (FABS(X - Y) * Four < One) X = Y;
  2355. X        Precision = X / TwoForty;
  2356. X        Y = FLOOR(Half + Precision);
  2357. X        if (FABS(Precision - Y) * TwoForty < Half) Precision = Y;
  2358. X        }
  2359. X    if ((Precision != FLOOR(Precision)) || (Radix == One)) {
  2360. X        printf("Precision cannot be characterized by an Integer number\n");
  2361. X        printf("of significant digits but, by itself, this is a minor flaw.\n");
  2362. X        }
  2363. X    if (Radix == One) 
  2364. X        printf("logarithmic encoding has precision characterized solely by U1.\n");
  2365. X    else printf("The number of significant digits of the Radix is %f .\n",
  2366. X            Precision);
  2367. X    TstCond (Serious, U2 * Nine * Nine * TwoForty < One,
  2368. X           "Precision worse than 5 decimal figures  ");
  2369. X    /*=============================================*/
  2370. X    Milestone = 30;
  2371. X    /*=============================================*/
  2372. X    /* Test for extra-precise subepressions */
  2373. X    X = FABS(((Four / Three - One) - One / Four) * Three - One / Four);
  2374. X    do  {
  2375. X        Z2 = X;
  2376. X        X = (One + (Half * Z2 + ThirtyTwo * Z2 * Z2)) - One;
  2377. X        } while ( ! ((Z2 <= X) || (X <= Zero)));
  2378. X    X = Y = Z = FABS((Three / Four - Two / Three) * Three - One / Four);
  2379. X    do  {
  2380. X        Z1 = Z;
  2381. X        Z = (One / Two - ((One / Two - (Half * Z1 + ThirtyTwo * Z1 * Z1))
  2382. X            + One / Two)) + One / Two;
  2383. X        } while ( ! ((Z1 <= Z) || (Z <= Zero)));
  2384. X    do  {
  2385. X        do  {
  2386. X            Y1 = Y;
  2387. X            Y = (Half - ((Half - (Half * Y1 + ThirtyTwo * Y1 * Y1)) + Half
  2388. X                )) + Half;
  2389. X            } while ( ! ((Y1 <= Y) || (Y <= Zero)));
  2390. X        X1 = X;
  2391. X        X = ((Half * X1 + ThirtyTwo * X1 * X1) - F9) + F9;
  2392. X        } while ( ! ((X1 <= X) || (X <= Zero)));
  2393. X    if ((X1 != Y1) || (X1 != Z1)) {
  2394. X        BadCond(Serious, "Disagreements among the values X1, Y1, Z1,\n");
  2395. X        printf("respectively  %.7e,  %.7e,  %.7e,\n", X1, Y1, Z1);
  2396. X        printf("are symptoms of inconsistencies introduced\n");
  2397. X        printf("by extra-precise evaluation of arithmetic subexpressions.\n");
  2398. X        notify("Possibly some part of this");
  2399. X        if ((X1 == U1) || (Y1 == U1) || (Z1 == U1))  printf(
  2400. X            "That feature is not tested further by this program.\n") ;
  2401. X        }
  2402. X    else  {
  2403. X        if ((Z1 != U1) || (Z2 != U2)) {
  2404. X            if ((Z1 >= U1) || (Z2 >= U2)) {
  2405. X                BadCond(Failure, "");
  2406. X                notify("Precision");
  2407. X                printf("\tU1 = %.7e, Z1 - U1 = %.7e\n",U1,Z1-U1);
  2408. X                printf("\tU2 = %.7e, Z2 - U2 = %.7e\n",U2,Z2-U2);
  2409. X                }
  2410. X            else {
  2411. X                if ((Z1 <= Zero) || (Z2 <= Zero)) {
  2412. X                    printf("Because of unusual Radix = %f", Radix);
  2413. X                    printf(", or exact rational arithmetic a result\n");
  2414. X                    printf("Z1 = %.7e, or Z2 = %.7e ", Z1, Z2);
  2415. X                    notify("of an\nextra-precision");
  2416. X                    }
  2417. X                if (Z1 != Z2 || Z1 > Zero) {
  2418. X                    X = Z1 / U1;
  2419. X                    Y = Z2 / U2;
  2420. X                    if (Y > X) X = Y;
  2421. X                    Q = - LOG(X);
  2422. X                    printf("Some subexpressions appear to be calculated extra\n");
  2423. X                    printf("precisely with about %g extra B-digits, i.e.\n",
  2424. X                        (Q / LOG(Radix)));
  2425. X                    printf("roughly %g extra significant decimals.\n",
  2426. X                        Q / LOG(10.));
  2427. X                    }
  2428. X                printf("That feature is not tested further by this program.\n");
  2429. X                }
  2430. X            }
  2431. X        }
  2432. X    Pause();
  2433. X    /*=============================================*/
  2434. X    /*SPLIT
  2435. X    }
  2436. #include "paranoia.h"
  2437. part3(){
  2438. */
  2439. X    Milestone = 35;
  2440. X    /*=============================================*/
  2441. X    if (Radix >= Two) {
  2442. X        X = W / (Radix * Radix);
  2443. X        Y = X + One;
  2444. X        Z = Y - X;
  2445. X        T = Z + U2;
  2446. X        X = T - Z;
  2447. X        TstCond (Failure, X == U2,
  2448. X            "Subtraction is not normalized X=Y,X+Z != Y+Z!");
  2449. X        if (X == U2) printf(
  2450. X            "Subtraction appears to be normalized, as it should be.");
  2451. X        }
  2452. X    printf("\nChecking for guard digit in *, /, and -.\n");
  2453. X    Y = F9 * One;
  2454. X    Z = One * F9;
  2455. X    X = F9 - Half;
  2456. X    Y = (Y - Half) - X;
  2457. X    Z = (Z - Half) - X;
  2458. X    X = One + U2;
  2459. X    T = X * Radix;
  2460. X    R = Radix * X;
  2461. X    X = T - Radix;
  2462. X    X = X - Radix * U2;
  2463. X    T = R - Radix;
  2464. X    T = T - Radix * U2;
  2465. X    X = X * (Radix - One);
  2466. X    T = T * (Radix - One);
  2467. X    if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)) GMult = Yes;
  2468. X    else {
  2469. X        GMult = No;
  2470. X        TstCond (Serious, False,
  2471. X            "* lacks a Guard Digit, so 1*X != X");
  2472. X        }
  2473. X    Z = Radix * U2;
  2474. X    X = One + Z;
  2475. X    Y = FABS((X + Z) - X * X) - U2;
  2476. X    X = One - U2;
  2477. X    Z = FABS((X - U2) - X * X) - U1;
  2478. X    TstCond (Failure, (Y <= Zero)
  2479. X           && (Z <= Zero), "* gets too many final digits wrong.\n");
  2480. X    Y = One - U2;
  2481. X    X = One + U2;
  2482. X    Z = One / Y;
  2483. X    Y = Z - X;
  2484. X    X = One / Three;
  2485. X    Z = Three / Nine;
  2486. X    X = X - Z;
  2487. X    T = Nine / TwentySeven;
  2488. X    Z = Z - T;
  2489. X    TstCond(Defect, X == Zero && Y == Zero && Z == Zero,
  2490. X        "Division lacks a Guard Digit, so error can exceed 1 ulp\n\
  2491. or  1/3  and  3/9  and  9/27 may disagree");
  2492. X    Y = F9 / One;
  2493. X    X = F9 - Half;
  2494. X    Y = (Y - Half) - X;
  2495. X    X = One + U2;
  2496. X    T = X / One;
  2497. X    X = T - X;
  2498. X    if ((X == Zero) && (Y == Zero) && (Z == Zero)) GDiv = Yes;
  2499. X    else {
  2500. X        GDiv = No;
  2501. X        TstCond (Serious, False,
  2502. X            "Division lacks a Guard Digit, so X/1 != X");
  2503. X        }
  2504. X    X = One / (One + U2);
  2505. X    Y = X - Half - Half;
  2506. X    TstCond (Serious, Y < Zero,
  2507. X           "Computed value of 1/1.000..1 >= 1");
  2508. X    X = One - U2;
  2509. X    Y = One + Radix * U2;
  2510. X    Z = X * Radix;
  2511. X    T = Y * Radix;
  2512. X    R = Z / Radix;
  2513. X    StickyBit = T / Radix;
  2514. X    X = R - X;
  2515. X    Y = StickyBit - Y;
  2516. X    TstCond (Failure, X == Zero && Y == Zero,
  2517. X            "* and/or / gets too many last digits wrong");
  2518. X    Y = One - U1;
  2519. X    X = One - F9;
  2520. X    Y = One - Y;
  2521. X    T = Radix - U2;
  2522. X    Z = Radix - BMinusU2;
  2523. X    T = Radix - T;
  2524. X    if ((X == U1) && (Y == U1) && (Z == U2) && (T == U2)) GAddSub = Yes;
  2525. X    else {
  2526. X        GAddSub = No;
  2527. X        TstCond (Serious, False,
  2528. X            "- lacks Guard Digit, so cancellation is obscured");
  2529. X        }
  2530. X    if (F9 != One && F9 - One >= Zero) {
  2531. X        BadCond(Serious, "comparison alleges  (1-U1) < 1  although\n");
  2532. X        printf("  subtraction yields  (1-U1) - 1 = 0 , thereby vitiating\n");
  2533. X        printf("  such precautions against division by zero as\n");
  2534. X        printf("  ...  if (X == 1.0) {.....} else {.../(X-1.0)...}\n");
  2535. X        }
  2536. X    if (GMult == Yes && GDiv == Yes && GAddSub == Yes) printf(
  2537. X        "     *, /, and - appear to have guard digits, as they should.\n");
  2538. X    /*=============================================*/
  2539. X    Milestone = 40;
  2540. X    /*=============================================*/
  2541. X    Pause();
  2542. X    printf("Checking rounding on multiply, divide and add/subtract.\n");
  2543. X    RMult = Other;
  2544. X    RDiv = Other;
  2545. X    RAddSub = Other;
  2546. X    RadixD2 = Radix / Two;
  2547. X    A1 = Two;
  2548. X    Done = False;
  2549. X    do  {
  2550. X        AInvrse = Radix;
  2551. X        do  {
  2552. X            X = AInvrse;
  2553. X            AInvrse = AInvrse / A1;
  2554. X            } while ( ! (FLOOR(AInvrse) != AInvrse));
  2555. X        Done = (X == One) || (A1 > Three);
  2556. X        if (! Done) A1 = Nine + One;
  2557. X        } while ( ! (Done));
  2558. X    if (X == One) A1 = Radix;
  2559. X    AInvrse = One / A1;
  2560. X    X = A1;
  2561. X    Y = AInvrse;
  2562. X    Done = False;
  2563. X    do  {
  2564. X        Z = X * Y - Half;
  2565. X        TstCond (Failure, Z == Half,
  2566. X            "X * (1/X) differs from 1");
  2567. X        Done = X == Radix;
  2568. X        X = Radix;
  2569. X        Y = One / X;
  2570. X        } while ( ! (Done));
  2571. X    Y2 = One + U2;
  2572. X    Y1 = One - U2;
  2573. SHAR_EOF
  2574. true || echo 'restore of paranoia.c failed'
  2575. fi
  2576. echo 'End of mathlib2.0 part 4'
  2577. echo 'File paranoia.c is continued in part 5'
  2578. echo 5 > _shar_seq_.tmp
  2579. exit 0
  2580. --
  2581. Glenn Geers                       | "So when it's over, we're back to people.
  2582. Department of Theoretical Physics |  Just to prove that human touch can have
  2583. The University of Sydney          |  no equal."
  2584. Sydney NSW 2006 Australia         |  - Basia Trzetrzelewska, 'Prime Time TV'
  2585.