tx · D9gd5Ua4PsAMoJEMErixEvKjyN1hN56NkqesQrcy2En9 3MqbTfLJ5nrYh6fUbS38Hfpe6T8MP5K5HiT: -0.01400000 Waves 2020.07.18 01:12 [1091979] smart account 3MqbTfLJ5nrYh6fUbS38Hfpe6T8MP5K5HiT > SELF 0.00000000 Waves
{ "type": 13, "id": "D9gd5Ua4PsAMoJEMErixEvKjyN1hN56NkqesQrcy2En9", "fee": 1400000, "feeAssetId": null, "timestamp": 1595023971054, "version": 1, "sender": "3MqbTfLJ5nrYh6fUbS38Hfpe6T8MP5K5HiT", "senderPublicKey": "EzWkAi3pMjNqjjV3PpJiHWrButTm4aorR4p173qwdGeL", "proofs": [ "jhUETx5K6cj4tGDcWDbq6vv3fw4p1S2Bc79CdjbLKbegJmQUERhjciwd8MUS5h1dQxyWGosY9cAhLvDFJs6RHFH" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEBAAAABgEAAAAEc3FydAAAAAEAAAABUwMJAABmAAAAAgAAAAAAAAAAAgUAAAABUwUAAAABUwQAAAACeDAAAAAAAAAAATwEAAAAAngxCQAAaQAAAAIJAABkAAAAAgUAAAACeDAJAABpAAAAAgUAAAABUwUAAAACeDAAAAAAAAAAAAIEAAAAAngyCQAAaQAAAAIJAABkAAAAAgUAAAACeDEJAABpAAAAAgUAAAABUwUAAAACeDEAAAAAAAAAAAIEAAAAAngzCQAAaQAAAAIJAABkAAAAAgUAAAACeDIJAABpAAAAAgUAAAABUwUAAAACeDIAAAAAAAAAAAIEAAAAAng0CQAAaQAAAAIJAABkAAAAAgUAAAACeDMJAABpAAAAAgUAAAABUwUAAAACeDMAAAAAAAAAAAIEAAAAAng1CQAAaQAAAAIJAABkAAAAAgUAAAACeDQJAABpAAAAAgUAAAABUwUAAAACeDQAAAAAAAAAAAIFAAAAAng1AQAAAANzaW4AAAABAAAABWFscGhhBAAAAAR2YWwxBQAAAAVhbHBoYQQAAAAEdmFsMgkAAGkAAAACCQAAaQAAAAIJAABoAAAAAgkA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W4yAwMJAAAAAAAAAgUAAAABeAAAAAAAAAAAAAkAAGYAAAACBQAAAAF5AAAAAAAAAAAABwAAAAAAAATLLwMDCQAAAAAAAAIFAAAAAXgAAAAAAAAAAAAJAABmAAAAAgAAAAAAAAAAAAUAAAABeQcA///////7NNEAAAAAAAAAAAAAAAABAAAAAWkBAAAACXRyaWdmdW5jcwAAAAEAAAABeAQAAAAFaXNxcnQJAQAAAARzcXJ0AAAAAQUAAAABeAQAAAAEaXNpbgkBAAAAA3NpbgAAAAEFAAAAAXgEAAAABGljb3MJAQAAAANjb3MAAAABBQAAAAF4BAAAAAVpYXNpbgkBAAAABGFzaW4AAAABBQAAAAF4BAAAAAZpYXRhbjIJAQAAAAVhdGFuMgAAAAIFAAAAAXgAAAAAAAAAAAEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABHNxcnQFAAAABWlzcXJ0CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAANzaW4FAAAABGlzaW4JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAA2NvcwUAAAAEaWNvcwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAEYXNpbgUAAAAFaWFzaW4JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABWF0YW4yBQAAAAZpYXRhbjIFAAAAA25pbAAAAAA3X2kI", "chainId": 84, "height": 1091979, "spentComplexity": 0 } View: original | compacted Prev: 6CAHUJsxDVTbVTfGqbxQJntMc5FUX7WDMXcnXJurGKAh Next: GHtPEpizxaDxRCN9bVeFcnd7ZcVjHtMVxvAzjRU8YKep Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | - | func sin (alpha | |
17 | + | func sin (alpha) = { | |
18 | 18 | let val1 = alpha | |
19 | - | let val2 = ((((alpha * alpha) * alpha) / 6) / | |
20 | - | let val3 = ((((((alpha * alpha) * alpha) / 120) / | |
21 | - | let val4 = ((((((alpha * alpha) * alpha) / 5040) / | |
22 | - | let val5 = ((((((((alpha * alpha) * alpha) / 362880) / | |
19 | + | let val2 = ((((alpha * alpha) * alpha) / 6) / 10000000000) | |
20 | + | let val3 = ((((((alpha * alpha) * alpha) / 120) / 10000000000) * (alpha * alpha)) / 10000000000) | |
21 | + | let val4 = ((((((((alpha * alpha) * alpha) / 5040) / 10000000000) * (alpha * alpha)) / 10000000000) * (alpha * alpha)) / 10000000000) | |
22 | + | let val5 = ((((((((((alpha * alpha) * alpha) / 362880) / 10000000000) * (alpha * alpha)) / 10000000000) * (alpha * alpha)) / 10000000000) * (alpha * alpha)) / 10000000000) | |
23 | 23 | let isin = ((((val1 - val2) + val3) - val4) + val5) | |
24 | 24 | isin | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | - | func cos (alpha | |
29 | - | let val1 = | |
30 | - | let val2 = (((alpha * alpha) / 2) / | |
31 | - | let val3 = ((((((alpha * alpha) * alpha) / 24) / | |
32 | - | let val4 = ((((((((alpha * alpha) * alpha) / 720) / | |
33 | - | let val5 = ((((((((((alpha * alpha) * alpha) / 40320) / | |
28 | + | func cos (alpha) = { | |
29 | + | let val1 = 100000 | |
30 | + | let val2 = (((alpha * alpha) / 2) / 100000) | |
31 | + | let val3 = ((((((alpha * alpha) * alpha) / 24) / 10000000000) * alpha) / 100000) | |
32 | + | let val4 = ((((((((alpha * alpha) * alpha) / 720) / 10000000000) * (alpha * alpha)) / 10000000000) * alpha) / 100000) | |
33 | + | let val5 = ((((((((((alpha * alpha) * alpha) / 40320) / 10000000000) * (alpha * alpha)) / 10000000000) * (alpha * alpha)) / 10000000000) * alpha) / 100000) | |
34 | 34 | let icos = ((((val1 - val2) + val3) - val4) + val5) | |
35 | 35 | icos | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | - | func asin (x | |
39 | + | func asin (x) = { | |
40 | 40 | let val1 = x | |
41 | - | let val2 = ((((x * x) * x) / 6) / | |
42 | - | let val3 = | |
43 | - | let val4 = | |
44 | - | let val5 = | |
41 | + | let val2 = ((((x * x) * x) / 6) / 10000000000) | |
42 | + | let val3 = (((((((x * x) * x) * 3) / 40) / 10000000000) * (x * x)) / 10000000000) | |
43 | + | let val4 = (((((((((x * x) * x) * 15) / 336) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) | |
44 | + | let val5 = (((((((((((x * x) * x) * 105) / 3456) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) | |
45 | 45 | let asin = ((((val1 + val2) + val3) + val4) + val5) | |
46 | 46 | asin | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | - | func atan (x,scale) = { | |
51 | - | let val1 = x | |
52 | - | let val2 = ((((x * x) * x) / 3) / (scale * scale)) | |
53 | - | let val3 = ((((((x * x) * x) / 5) / (scale * scale)) * (x * x)) / (scale * scale)) | |
54 | - | let val4 = ((((((((x * x) * x) / 7) / (scale * scale)) * (x * x)) / (scale * scale)) * (x * x)) / (scale * scale)) | |
55 | - | let val5 = ((((((((((x * x) * x) / 9) / (scale * scale)) * (x * x)) / (scale * scale)) * (x * x)) / (scale * scale)) * (x * x)) / (scale * scale)) | |
56 | - | let iatan = (((val1 - val2) + val3) - val4) | |
57 | - | iatan | |
58 | - | } | |
50 | + | func atan (x) = if ((x > 100000)) | |
51 | + | then { | |
52 | + | let xinv = (10000000000 / x) | |
53 | + | let val1 = xinv | |
54 | + | let val2 = ((((xinv * xinv) * xinv) / 3) / 10000000000) | |
55 | + | let val3 = ((((((xinv * xinv) * xinv) / 5) / 10000000000) * (xinv * xinv)) / 10000000000) | |
56 | + | let val4 = ((((((((xinv * xinv) * xinv) / 7) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) | |
57 | + | let val5 = ((((((((((xinv * xinv) * xinv) / 9) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) | |
58 | + | let iatan = ((((314159 - val1) + val2) - val3) + val4) | |
59 | + | iatan | |
60 | + | } | |
61 | + | else if ((-100000 > x)) | |
62 | + | then { | |
63 | + | let xinv = (10000000000 / x) | |
64 | + | let val1 = xinv | |
65 | + | let val2 = ((((xinv * xinv) * xinv) / 3) / 10000000000) | |
66 | + | let val3 = ((((((xinv * xinv) * xinv) / 5) / 10000000000) * (xinv * xinv)) / 10000000000) | |
67 | + | let val4 = ((((((((xinv * xinv) * xinv) / 7) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) | |
68 | + | let val5 = ((((((((((xinv * xinv) * xinv) / 9) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) | |
69 | + | let iatan = ((((-314159 - val1) + val2) - val3) + val4) | |
70 | + | iatan | |
71 | + | } | |
72 | + | else { | |
73 | + | let val1 = x | |
74 | + | let val2 = ((((x * x) * x) / 3) / 10000000000) | |
75 | + | let val3 = ((((((x * x) * x) / 5) / 10000000000) * (x * x)) / 10000000000) | |
76 | + | let val4 = ((((((((x * x) * x) / 7) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) | |
77 | + | let val5 = ((((((((((x * x) * x) / 9) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) | |
78 | + | let iatan = (((val1 - val2) + val3) - val4) | |
79 | + | iatan | |
80 | + | } | |
59 | 81 | ||
60 | 82 | ||
61 | - | func atan2 (y,x | |
83 | + | func atan2 (y,x) = if ((x > 0)) | |
62 | 84 | then { | |
63 | - | let iatan2 = atan((y / x) | |
85 | + | let iatan2 = atan((y / x)) | |
64 | 86 | iatan2 | |
65 | 87 | } | |
66 | 88 | else if (if ((0 > x)) | |
67 | 89 | then (y >= 0) | |
68 | 90 | else false) | |
69 | 91 | then { | |
70 | - | let iatan2 = (atan((y / x) | |
92 | + | let iatan2 = (atan((y / x)) + 314159) | |
71 | 93 | iatan2 | |
72 | 94 | } | |
73 | 95 | else if (if ((0 > x)) | |
74 | 96 | then (0 > y) | |
75 | 97 | else false) | |
76 | 98 | then { | |
77 | - | let iatan2 = (atan((y / x) | |
99 | + | let iatan2 = (atan((y / x)) - 314159) | |
78 | 100 | iatan2 | |
79 | 101 | } | |
80 | 102 | else if (if ((x == 0)) | |
90 | 112 | ||
91 | 113 | @Callable(i) | |
92 | 114 | func trigfuncs (x) = { | |
93 | - | let scale = 100000 | |
94 | 115 | let isqrt = sqrt(x) | |
95 | - | let isin = sin(x | |
96 | - | let icos = cos(x | |
97 | - | let iasin = asin(x | |
98 | - | let iatan2 = atan2(x, 1 | |
116 | + | let isin = sin(x) | |
117 | + | let icos = cos(x) | |
118 | + | let iasin = asin(x) | |
119 | + | let iatan2 = atan2(x, 1) | |
99 | 120 | WriteSet([DataEntry("sqrt", isqrt), DataEntry("sin", isin), DataEntry("cos", icos), DataEntry("asin", iasin), DataEntry("atan2", iatan2)]) | |
100 | 121 | } | |
101 | 122 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func sqrt (S) = if ((2 > S)) | |
5 | 5 | then S | |
6 | 6 | else { | |
7 | 7 | let x0 = 316 | |
8 | 8 | let x1 = ((x0 + (S / x0)) / 2) | |
9 | 9 | let x2 = ((x1 + (S / x1)) / 2) | |
10 | 10 | let x3 = ((x2 + (S / x2)) / 2) | |
11 | 11 | let x4 = ((x3 + (S / x3)) / 2) | |
12 | 12 | let x5 = ((x4 + (S / x4)) / 2) | |
13 | 13 | x5 | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | - | func sin (alpha | |
17 | + | func sin (alpha) = { | |
18 | 18 | let val1 = alpha | |
19 | - | let val2 = ((((alpha * alpha) * alpha) / 6) / | |
20 | - | let val3 = ((((((alpha * alpha) * alpha) / 120) / | |
21 | - | let val4 = ((((((alpha * alpha) * alpha) / 5040) / | |
22 | - | let val5 = ((((((((alpha * alpha) * alpha) / 362880) / | |
19 | + | let val2 = ((((alpha * alpha) * alpha) / 6) / 10000000000) | |
20 | + | let val3 = ((((((alpha * alpha) * alpha) / 120) / 10000000000) * (alpha * alpha)) / 10000000000) | |
21 | + | let val4 = ((((((((alpha * alpha) * alpha) / 5040) / 10000000000) * (alpha * alpha)) / 10000000000) * (alpha * alpha)) / 10000000000) | |
22 | + | let val5 = ((((((((((alpha * alpha) * alpha) / 362880) / 10000000000) * (alpha * alpha)) / 10000000000) * (alpha * alpha)) / 10000000000) * (alpha * alpha)) / 10000000000) | |
23 | 23 | let isin = ((((val1 - val2) + val3) - val4) + val5) | |
24 | 24 | isin | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | - | func cos (alpha | |
29 | - | let val1 = | |
30 | - | let val2 = (((alpha * alpha) / 2) / | |
31 | - | let val3 = ((((((alpha * alpha) * alpha) / 24) / | |
32 | - | let val4 = ((((((((alpha * alpha) * alpha) / 720) / | |
33 | - | let val5 = ((((((((((alpha * alpha) * alpha) / 40320) / | |
28 | + | func cos (alpha) = { | |
29 | + | let val1 = 100000 | |
30 | + | let val2 = (((alpha * alpha) / 2) / 100000) | |
31 | + | let val3 = ((((((alpha * alpha) * alpha) / 24) / 10000000000) * alpha) / 100000) | |
32 | + | let val4 = ((((((((alpha * alpha) * alpha) / 720) / 10000000000) * (alpha * alpha)) / 10000000000) * alpha) / 100000) | |
33 | + | let val5 = ((((((((((alpha * alpha) * alpha) / 40320) / 10000000000) * (alpha * alpha)) / 10000000000) * (alpha * alpha)) / 10000000000) * alpha) / 100000) | |
34 | 34 | let icos = ((((val1 - val2) + val3) - val4) + val5) | |
35 | 35 | icos | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | - | func asin (x | |
39 | + | func asin (x) = { | |
40 | 40 | let val1 = x | |
41 | - | let val2 = ((((x * x) * x) / 6) / | |
42 | - | let val3 = | |
43 | - | let val4 = | |
44 | - | let val5 = | |
41 | + | let val2 = ((((x * x) * x) / 6) / 10000000000) | |
42 | + | let val3 = (((((((x * x) * x) * 3) / 40) / 10000000000) * (x * x)) / 10000000000) | |
43 | + | let val4 = (((((((((x * x) * x) * 15) / 336) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) | |
44 | + | let val5 = (((((((((((x * x) * x) * 105) / 3456) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) | |
45 | 45 | let asin = ((((val1 + val2) + val3) + val4) + val5) | |
46 | 46 | asin | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | - | func atan (x,scale) = { | |
51 | - | let val1 = x | |
52 | - | let val2 = ((((x * x) * x) / 3) / (scale * scale)) | |
53 | - | let val3 = ((((((x * x) * x) / 5) / (scale * scale)) * (x * x)) / (scale * scale)) | |
54 | - | let val4 = ((((((((x * x) * x) / 7) / (scale * scale)) * (x * x)) / (scale * scale)) * (x * x)) / (scale * scale)) | |
55 | - | let val5 = ((((((((((x * x) * x) / 9) / (scale * scale)) * (x * x)) / (scale * scale)) * (x * x)) / (scale * scale)) * (x * x)) / (scale * scale)) | |
56 | - | let iatan = (((val1 - val2) + val3) - val4) | |
57 | - | iatan | |
58 | - | } | |
50 | + | func atan (x) = if ((x > 100000)) | |
51 | + | then { | |
52 | + | let xinv = (10000000000 / x) | |
53 | + | let val1 = xinv | |
54 | + | let val2 = ((((xinv * xinv) * xinv) / 3) / 10000000000) | |
55 | + | let val3 = ((((((xinv * xinv) * xinv) / 5) / 10000000000) * (xinv * xinv)) / 10000000000) | |
56 | + | let val4 = ((((((((xinv * xinv) * xinv) / 7) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) | |
57 | + | let val5 = ((((((((((xinv * xinv) * xinv) / 9) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) | |
58 | + | let iatan = ((((314159 - val1) + val2) - val3) + val4) | |
59 | + | iatan | |
60 | + | } | |
61 | + | else if ((-100000 > x)) | |
62 | + | then { | |
63 | + | let xinv = (10000000000 / x) | |
64 | + | let val1 = xinv | |
65 | + | let val2 = ((((xinv * xinv) * xinv) / 3) / 10000000000) | |
66 | + | let val3 = ((((((xinv * xinv) * xinv) / 5) / 10000000000) * (xinv * xinv)) / 10000000000) | |
67 | + | let val4 = ((((((((xinv * xinv) * xinv) / 7) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) | |
68 | + | let val5 = ((((((((((xinv * xinv) * xinv) / 9) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) * (xinv * xinv)) / 10000000000) | |
69 | + | let iatan = ((((-314159 - val1) + val2) - val3) + val4) | |
70 | + | iatan | |
71 | + | } | |
72 | + | else { | |
73 | + | let val1 = x | |
74 | + | let val2 = ((((x * x) * x) / 3) / 10000000000) | |
75 | + | let val3 = ((((((x * x) * x) / 5) / 10000000000) * (x * x)) / 10000000000) | |
76 | + | let val4 = ((((((((x * x) * x) / 7) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) | |
77 | + | let val5 = ((((((((((x * x) * x) / 9) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) * (x * x)) / 10000000000) | |
78 | + | let iatan = (((val1 - val2) + val3) - val4) | |
79 | + | iatan | |
80 | + | } | |
59 | 81 | ||
60 | 82 | ||
61 | - | func atan2 (y,x | |
83 | + | func atan2 (y,x) = if ((x > 0)) | |
62 | 84 | then { | |
63 | - | let iatan2 = atan((y / x) | |
85 | + | let iatan2 = atan((y / x)) | |
64 | 86 | iatan2 | |
65 | 87 | } | |
66 | 88 | else if (if ((0 > x)) | |
67 | 89 | then (y >= 0) | |
68 | 90 | else false) | |
69 | 91 | then { | |
70 | - | let iatan2 = (atan((y / x) | |
92 | + | let iatan2 = (atan((y / x)) + 314159) | |
71 | 93 | iatan2 | |
72 | 94 | } | |
73 | 95 | else if (if ((0 > x)) | |
74 | 96 | then (0 > y) | |
75 | 97 | else false) | |
76 | 98 | then { | |
77 | - | let iatan2 = (atan((y / x) | |
99 | + | let iatan2 = (atan((y / x)) - 314159) | |
78 | 100 | iatan2 | |
79 | 101 | } | |
80 | 102 | else if (if ((x == 0)) | |
81 | 103 | then (y > 0) | |
82 | 104 | else false) | |
83 | 105 | then 314159 | |
84 | 106 | else if (if ((x == 0)) | |
85 | 107 | then (0 > y) | |
86 | 108 | else false) | |
87 | 109 | then -314159 | |
88 | 110 | else 0 | |
89 | 111 | ||
90 | 112 | ||
91 | 113 | @Callable(i) | |
92 | 114 | func trigfuncs (x) = { | |
93 | - | let scale = 100000 | |
94 | 115 | let isqrt = sqrt(x) | |
95 | - | let isin = sin(x | |
96 | - | let icos = cos(x | |
97 | - | let iasin = asin(x | |
98 | - | let iatan2 = atan2(x, 1 | |
116 | + | let isin = sin(x) | |
117 | + | let icos = cos(x) | |
118 | + | let iasin = asin(x) | |
119 | + | let iatan2 = atan2(x, 1) | |
99 | 120 | WriteSet([DataEntry("sqrt", isqrt), DataEntry("sin", isin), DataEntry("cos", icos), DataEntry("asin", iasin), DataEntry("atan2", iatan2)]) | |
100 | 121 | } | |
101 | 122 | ||
102 | 123 |
github/deemru/w8io/026f985 169.39 ms ◑