Last change
on this file since c7bd6d1 was
959eb01,
checked in by ajj, 8 years ago
|
normalising line endings
|
-
Property mode set to
100644
|
File size:
940 bytes
|
Rev | Line | |
---|
[959eb01] | 1 | import math |
---|
| 2 | |
---|
| 3 | # log(x) |
---|
| 4 | def from_log10(x, y=0): |
---|
| 5 | return math.pow(10.0, x) |
---|
| 6 | def err_log10(x, y, dx, dy): |
---|
| 7 | return math.pow(10.0, x)*dx |
---|
| 8 | |
---|
| 9 | # ln(x) |
---|
| 10 | def from_lnx(x, y=0): |
---|
| 11 | return math.exp(x) |
---|
| 12 | def err_lnx(x, y, dx, dy): |
---|
| 13 | return math.exp(x)*dx |
---|
| 14 | |
---|
| 15 | # x^2 |
---|
| 16 | def from_x2(x, y=0): |
---|
| 17 | return math.sqrt(x) |
---|
| 18 | def err_x2(x, y, dx, dy): |
---|
| 19 | return 0.5*dx/math.sqrt(x) |
---|
| 20 | |
---|
| 21 | # 1/x |
---|
| 22 | def from_inv_x(x, y=0): |
---|
| 23 | return 1.0/x |
---|
| 24 | def err_inv_x(x, y, dx, dy): |
---|
| 25 | return 1.0/(x**2)*dx |
---|
| 26 | |
---|
| 27 | # 1/sqrt(y) |
---|
| 28 | def from_inv_sqrtx(x, y=0): |
---|
| 29 | return 1.0/x**2 |
---|
| 30 | def err_inv_sqrtx(x, y, dx, dy): |
---|
| 31 | return 2.0*math.pow(x,-3.0)*dx |
---|
| 32 | |
---|
| 33 | # ln(xy) |
---|
| 34 | def from_lnxy(x, y): |
---|
| 35 | return math.exp(x)/y |
---|
| 36 | def err_lnxy(x, y, dx, dy): |
---|
| 37 | return math.exp(x)/y*dx |
---|
| 38 | |
---|
| 39 | # ln(xy2) |
---|
| 40 | def from_lnx2y(x, y): |
---|
| 41 | return math.exp(x)/y**2 |
---|
| 42 | def err_lnx2y(x, y, dx, dy): |
---|
| 43 | return math.exp(x)/y**2*dx |
---|
| 44 | |
---|
| 45 | # ln(xy4) |
---|
| 46 | def from_lnx4y(x, y): |
---|
| 47 | return math.exp(x)/y**4 |
---|
| 48 | def err_lnx4y(x, y, dx, dy): |
---|
| 49 | return math.exp(x)/y**4*dx |
---|
| 50 | |
---|
Note: See
TracBrowser
for help on using the repository browser.