mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 12:48:14 +00:00
Merge pull request #1086 from Kelimion/bigint
big: Temporarily disable Toom.
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
:odin run . -vet
|
:odin run . -vet -o:speed -no-bounds-check
|
||||||
: -o:size
|
: -o:size
|
||||||
:odin build . -build-mode:shared -show-timings -o:minimal -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
:odin build . -build-mode:shared -show-timings -o:minimal -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
||||||
:odin build . -build-mode:shared -show-timings -o:size -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
:odin build . -build-mode:shared -show-timings -o:size -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
||||||
:odin build . -build-mode:shared -show-timings -o:size -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
:odin build . -build-mode:shared -show-timings -o:size -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
||||||
odin build . -build-mode:shared -show-timings -o:speed -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
odin build . -build-mode:shared -show-timings -o:speed -no-bounds-check -define:MATH_BIG_EXE=false && python test.py
|
||||||
|
: -fast-tests
|
||||||
:odin build . -build-mode:shared -show-timings -o:speed -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
:odin build . -build-mode:shared -show-timings -o:speed -define:MATH_BIG_EXE=false && python test.py -fast-tests
|
||||||
@@ -211,9 +211,12 @@ demo :: proc() {
|
|||||||
atoi(b, "378271691190525325893712245607881659587045836991909505715443874842659307597325888631898626653926188084180707310543535657996185416604973577488563643125766400", 10);
|
atoi(b, "378271691190525325893712245607881659587045836991909505715443874842659307597325888631898626653926188084180707310543535657996185416604973577488563643125766400", 10);
|
||||||
print("b: ", b, 10, true, true, true);
|
print("b: ", b, 10, true, true, true);
|
||||||
|
|
||||||
// _private_mul_karatsuba(c, a, b);
|
factorial(c, 10_000);
|
||||||
_private_int_mul_toom(c, a, b);
|
|
||||||
// 232651448952541576870611266174879305550351371288854695862580414333123414997160350830885091499735909790287667499899722495800734048928379224433901855785208987458832826418636718381316545267329375006999278984386253755079362097682611712000
|
// 120CCAA2076ADF69F75A97695E6C1C2A4E6F377DF92226E43B
|
||||||
|
cs, _ := itoa(c, 16);
|
||||||
|
defer delete(cs);
|
||||||
|
|
||||||
print("c: ", c, 10, true, true, true);
|
print("c: ", c, 10, true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -674,7 +674,11 @@ internal_int_mul :: proc(dest, src, multiplier: ^Int, allocator := context.alloc
|
|||||||
*/
|
*/
|
||||||
max_used >= 2 * min_used {
|
max_used >= 2 * min_used {
|
||||||
// err = s_mp_mul_balance(a,b,c);
|
// err = s_mp_mul_balance(a,b,c);
|
||||||
} else if min_used >= MUL_TOOM_CUTOFF {
|
} else if false && min_used >= MUL_TOOM_CUTOFF {
|
||||||
|
/*
|
||||||
|
Toom path commented out until it no longer fails Factorial 10k or 100k,
|
||||||
|
as reveaved in the long test.
|
||||||
|
*/
|
||||||
err = #force_inline _private_int_mul_toom(dest, src, multiplier);
|
err = #force_inline _private_int_mul_toom(dest, src, multiplier);
|
||||||
} else if min_used >= MUL_KARATSUBA_CUTOFF {
|
} else if min_used >= MUL_KARATSUBA_CUTOFF {
|
||||||
err = #force_inline _private_int_mul_karatsuba(dest, src, multiplier);
|
err = #force_inline _private_int_mul_karatsuba(dest, src, multiplier);
|
||||||
|
|||||||
@@ -532,7 +532,7 @@ TESTS = {
|
|||||||
if not args.fast_tests:
|
if not args.fast_tests:
|
||||||
TESTS[test_factorial].append(
|
TESTS[test_factorial].append(
|
||||||
# This one on its own takes around 800ms, so we exclude it for FAST_TESTS
|
# This one on its own takes around 800ms, so we exclude it for FAST_TESTS
|
||||||
[ 100_000 ],
|
[ 10_000 ],
|
||||||
)
|
)
|
||||||
|
|
||||||
total_passes = 0
|
total_passes = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user