-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6c3b48a
Showing
64 changed files
with
2,659 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
LibTomFloat is Public Domain. | ||
|
||
-- Tom St Denis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Still quite a bit todo for LibTomFloat. | ||
|
||
1. The following functions [as of v0.01] have not been implemented (the .C files are present but not populated) | ||
|
||
- mpf_acos | ||
- mpf_asin | ||
- mpf_atan | ||
- mpf_const_1pi [*] | ||
- mpf_const_2pi [*] | ||
- mpf_const_2rpi [*] | ||
- mpf_const_l10e [*] | ||
- mpf_const_l2e [*] | ||
- mpf_const_le2 [*] | ||
- mpf_const_pi [*] | ||
- mpf_const_pi2 [*] | ||
- mpf_const_pi4 [*] | ||
- mpf_ln | ||
- mpf_pow [*] | ||
- Any form of string input/output | ||
|
||
[*] Denotes functions which are written but depend upon incomplete functions to work. | ||
|
||
The critical path lies in two functions. The first is mpf_ln from which I can write mpf_pow and the various constants will function. | ||
The second is mpf_atan from which I can write mpf_const_pi and finish off the missing constants. | ||
|
||
From there it's a matter of adding mpf_asin, mpf_acos and mpf_tan and I have a decent subset of math in there. | ||
|
||
2. Once all of the functions have been written I want to add early-out optimizations to the various series calculations. Right now | ||
they use an arbitrary high count and get accurate results. However, quite a few functions stabalize quickly and do not need so many | ||
iterations. In particular I plan to start on mpf_invsqrt() as it forms the basis of mpf_inv() which is used in mpf_cos() [and other trigs]. | ||
|
||
At the same time I want to add more domain checking (e.g. valid inputs). | ||
|
||
3. Add decent string input/output | ||
|
||
4. More things to the manual. I plan on doing this with every release cycle though. | ||
|
||
5. MSVC makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
LibTomFloat is a *VERY* new package and is not even fully written yet. Quite a | ||
bit of the functionality is present but will be changing in the near future to allow | ||
for optimizations (e.g. early-outs). | ||
|
||
Please don't use LibTomFloat just yet for any production or fielded system. | ||
|
||
By all means if you wish to test and help find bugs in LibTomFloat give the package a try. | ||
|
||
I do not guarantee the numerical accuracy of this package as of yet. | ||
|
||
You've been warned. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
May 5th, 2004 v0.01 -- wrote base of LTF | ||
|
||
Anytime v0.00 -- no LTF existed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include <tomfloat.h> | ||
|
||
void draw(mp_float *a) | ||
{ | ||
char buf[8192]; | ||
mp_toradix(&(a->mantissa), buf, 10); | ||
printf("%s * 2^%ld\n", buf, a->exp); | ||
} | ||
|
||
int main(void) | ||
{ | ||
mp_float a, b, c, d, e; | ||
mpf_init_multi(96, &a, &b, &c, &d, &e, NULL); | ||
|
||
mpf_const_d(&a, 1); draw(&a); | ||
mpf_const_d(&b, 2); draw(&b); | ||
mpf_const_d(&c, 3); draw(&c); | ||
mpf_const_d(&d, 4); draw(&d); | ||
|
||
mpf_add(&b, &c, &e); printf("2 + 3 == "); draw(&e); | ||
mpf_sub(&b, &c, &e); printf("2 - 3 =="); draw(&e); | ||
mpf_mul(&b, &c, &e); printf("2 * 3 == "); draw(&e); | ||
mpf_div(&b, &c, &e); printf("2 / 3 == "); draw(&e); | ||
printf("\n"); | ||
mpf_invsqrt(&d, &e); printf("1/sqrt(4) == 1/2 == "); draw(&e); | ||
mpf_invsqrt(&c, &e); printf("1/sqrt(3) == "); draw(&e); | ||
mpf_inv(&a, &e); printf("1/1 == "); draw(&e); | ||
mpf_inv(&b, &e); printf("1/2 == "); draw(&e); | ||
mpf_inv(&c, &e); printf("1/3 == "); draw(&e); | ||
mpf_inv(&d, &e); printf("1/4 == "); draw(&e); | ||
printf("\n"); | ||
mpf_const_e(&e); printf("e == "); draw(&e); | ||
mpf_exp(&c, &e); printf("e^3 == "); draw(&e); | ||
mpf_sqrt(&e, &e); printf("sqrt(e^3) == "); draw(&e); | ||
mpf_sqr(&e, &e); printf("sqrt(e^3)^2 == "); draw(&e); | ||
printf("\n"); | ||
mpf_cos(&a, &e); printf("cos(1) == "); draw(&e); | ||
mpf_cos(&b, &e); printf("cos(2) == "); draw(&e); | ||
mpf_cos(&c, &e); printf("cos(3) == "); draw(&e); | ||
mpf_cos(&d, &e); printf("cos(4) == "); draw(&e); | ||
mpf_sin(&a, &e); printf("sin(1) == "); draw(&e); | ||
mpf_sin(&b, &e); printf("sin(2) == "); draw(&e); | ||
mpf_sin(&c, &e); printf("sin(3) == "); draw(&e); | ||
mpf_sin(&d, &e); printf("sin(4) == "); draw(&e); | ||
mpf_tan(&a, &e); printf("tan(1) == "); draw(&e); | ||
mpf_tan(&b, &e); printf("tan(2) == "); draw(&e); | ||
mpf_tan(&c, &e); printf("tan(3) == "); draw(&e); | ||
mpf_tan(&d, &e); printf("tan(4) == "); draw(&e); | ||
printf("\n"); | ||
return 0; | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). | ||
Scanning input file float.idx....done (48 entries accepted, 0 rejected). | ||
Sorting entries....done (285 comparisons). | ||
Generating output file float.ind....done (55 lines written, 0 warnings). | ||
Output written in float.ind. | ||
Transcript written in float.ilg. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
\begin{theindex} | ||
|
||
\item exponent, \hyperpage{2} | ||
|
||
\indexspace | ||
|
||
\item mantissa, \hyperpage{2} | ||
\item mp\_cmp, \hyperpage{16} | ||
\item mp\_error\_to\_string, \hyperpage{6} | ||
\item MP\_MEM, \hyperpage{5} | ||
\item MP\_NO, \hyperpage{5} | ||
\item MP\_OKAY, \hyperpage{5} | ||
\item MP\_VAL, \hyperpage{5} | ||
\item MP\_YES, \hyperpage{5} | ||
\item mpf\_abs, \hyperpage{13} | ||
\item mpf\_acos, \hyperpage{18} | ||
\item mpf\_add, \hyperpage{15} | ||
\item mpf\_add\_d, \hyperpage{15} | ||
\item mpf\_asin, \hyperpage{18} | ||
\item mpf\_atan, \hyperpage{18} | ||
\item mpf\_clear, \hyperpage{7} | ||
\item mpf\_clear\_multi, \hyperpage{8} | ||
\item mpf\_cmp\_d, \hyperpage{16} | ||
\item mpf\_const\_0, \hyperpage{11} | ||
\item mpf\_const\_d, \hyperpage{11} | ||
\item mpf\_const\_ln\_d, \hyperpage{11} | ||
\item mpf\_const\_sqrt\_d, \hyperpage{11} | ||
\item mpf\_copy, \hyperpage{9} | ||
\item mpf\_cos, \hyperpage{18} | ||
\item mpf\_div, \hyperpage{15} | ||
\item mpf\_div\_2, \hyperpage{16} | ||
\item mpf\_div\_d, \hyperpage{15} | ||
\item mpf\_exch, \hyperpage{10} | ||
\item mpf\_exp, \hyperpage{17} | ||
\item mpf\_init, \hyperpage{7} | ||
\item mpf\_init\_copy, \hyperpage{8} | ||
\item mpf\_init\_multi, \hyperpage{8} | ||
\item mpf\_inv, \hyperpage{18} | ||
\item mpf\_invsqrt, \hyperpage{18} | ||
\item mpf\_ln, \hyperpage{17} | ||
\item mpf\_mul, \hyperpage{15} | ||
\item mpf\_mul\_2, \hyperpage{16} | ||
\item mpf\_mul\_d, \hyperpage{15} | ||
\item mpf\_neg, \hyperpage{13} | ||
\item mpf\_normalize, \hyperpage{11} | ||
\item mpf\_normalize\_to, \hyperpage{11} | ||
\item mpf\_pow, \hyperpage{17} | ||
\item mpf\_sin, \hyperpage{18} | ||
\item mpf\_sqr, \hyperpage{16} | ||
\item mpf\_sqrt, \hyperpage{18} | ||
\item mpf\_sub, \hyperpage{15} | ||
\item mpf\_sub\_d, \hyperpage{15} | ||
\item mpf\_tan, \hyperpage{18} | ||
|
||
\end{theindex} |
Binary file not shown.
Oops, something went wrong.