tx · 4LCa3XyyMHVNqs47eXvENp1dFHTXKBTo2sxSHcNARZGG 3N7hFU6dFSFKGGwDyF9WJ1jVsrB9w8RHT37: -0.01000000 Waves 2023.03.17 13:35 [2493884] smart account 3N7hFU6dFSFKGGwDyF9WJ1jVsrB9w8RHT37 > SELF 0.00000000 Waves
{ "type": 13, "id": "4LCa3XyyMHVNqs47eXvENp1dFHTXKBTo2sxSHcNARZGG", "fee": 1000000, "feeAssetId": null, "timestamp": 1679049371320, "version": 2, "chainId": 84, "sender": "3N7hFU6dFSFKGGwDyF9WJ1jVsrB9w8RHT37", "senderPublicKey": "J6bcbr8r9usSLYw72NzzrKVCvKDDLe1uDx8bnWp3uFAV", "proofs": [ "4r56SRxKHDfjnuHQx8Yu6nMj4mBpKGuhhxBTyFmLnL81DPKUa89nZMF1zAgbmgg4MFkPTbHo2UnnGtCpQ6dfADkD" ], "script": "base64:BgIHCAISAwoBCAIAB01VTFQxOFgJAKcDAQITMTAwMDAwMDAwMDAwMDAwMDAwMAAERTE4WAkApwMBAhMyNzE4MjgxODI4NDU5MDQ1MjM1AQFpAQVnYW1tYQEEelN0cgQDejE4CQCnAwEFBHpTdHIEBmV4cHoxOAkAdgYFBEUxOFgAEgkAvgIBBQN6MTgAEgASBQZIQUxGVVAKAQVjaGFpbgIDYWNjAWkJALgCAgkAtwICBQN6MTgJALkCAgkAtgIBCQBlAgkAZAIFAWkFAWkAAQUHTVVMVDE4WAkAvAIDCQC5AgIJALYCAQkAaAIFAWkFAWkFB01VTFQxOFgFB01VTFQxOFgFA2FjYwQBZgoAAiRsCQDMCAIACwkAzAgCAAoJAMwIAgAJCQDMCAIACAkAzAgCAAcJAMwIAgAGCQDMCAIABQkAzAgCAAQJAMwIAgADCQDMCAIAAgkAzAgCAAEFA25pbAoAAiRzCQCQAwEFAiRsCgAFJGFjYzAFB01VTFQxOFgKAQUkZjBfMQICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkBBWNoYWluAgUCJGEJAJEDAgUCJ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kZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQBiAGMAZAQBZwkAvAIDBQZleHB6MTgFB01VTFQxOFgFAWYJAJQKAgUDbmlsCQCmAwEFAWcAGeufcg==", "height": 2493884, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AimrLN28fwqEDpBisXb3Nb48NszWdUyByNdxCuH1DULp Next: 7bUvfr4JimyawKg43Ufnutz82furGz6oZtxvrPw8mxSH Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func gamma (zStr) = { | |
10 | - | let | |
11 | - | let | |
12 | - | func chain (acc,i) = (( | |
10 | + | let z18 = parseBigIntValue(zStr) | |
11 | + | let expz18 = pow(E18X, 18, -(z18), 18, 18, HALFUP) | |
12 | + | func chain (acc,i) = ((z18 + (toBigInt(((i + i) - 1)) * MULT18X)) - fraction((toBigInt((i * i)) * MULT18X), MULT18X, acc)) | |
13 | 13 | ||
14 | 14 | let f = { | |
15 | 15 | let $l = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] | |
16 | 16 | let $s = size($l) | |
17 | - | let $acc0 = | |
17 | + | let $acc0 = MULT18X | |
18 | 18 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
19 | 19 | then $a | |
20 | 20 | else chain($a, $l[$i]) | |
25 | 25 | ||
26 | 26 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
27 | 27 | } | |
28 | - | let g = fraction( | |
28 | + | let g = fraction(expz18, MULT18X, f) | |
29 | 29 | $Tuple2(nil, toString(g)) | |
30 | 30 | } | |
31 | 31 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MULT18X = parseBigIntValue("1000000000000000000") | |
5 | 5 | ||
6 | 6 | let E18X = parseBigIntValue("2718281828459045235") | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func gamma (zStr) = { | |
10 | - | let | |
11 | - | let | |
12 | - | func chain (acc,i) = (( | |
10 | + | let z18 = parseBigIntValue(zStr) | |
11 | + | let expz18 = pow(E18X, 18, -(z18), 18, 18, HALFUP) | |
12 | + | func chain (acc,i) = ((z18 + (toBigInt(((i + i) - 1)) * MULT18X)) - fraction((toBigInt((i * i)) * MULT18X), MULT18X, acc)) | |
13 | 13 | ||
14 | 14 | let f = { | |
15 | 15 | let $l = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] | |
16 | 16 | let $s = size($l) | |
17 | - | let $acc0 = | |
17 | + | let $acc0 = MULT18X | |
18 | 18 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
19 | 19 | then $a | |
20 | 20 | else chain($a, $l[$i]) | |
21 | 21 | ||
22 | 22 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
23 | 23 | then $a | |
24 | 24 | else throw("List size exceeds 100") | |
25 | 25 | ||
26 | 26 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
27 | 27 | } | |
28 | - | let g = fraction( | |
28 | + | let g = fraction(expz18, MULT18X, f) | |
29 | 29 | $Tuple2(nil, toString(g)) | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 |
github/deemru/w8io/026f985 46.66 ms ◑