Juggler sequence: Difference between revisions

→‎{{header|Go}}: Switched to using a GMP wrapper for Go. 125x speedup!
(→‎{{header|Go}}: Switched to using a GMP wrapper for Go. 125x speedup!)
Line 38:
{{trans|Wren}}
{{libheader|Go-rcu}}
{{libheader|GMP(Go wrapper)
This originally took about 13.5 minutes to reach n = 5,812,827 on my machine (Intel core i7-8565U) though should be much quicker using aGo's fasternative language'math/big' with GMPpackage.
 
However, when I exchanged that for Go's GMP wrapper there was a massive speed-up (now only 6.4 seconds to reach n = 5,812,827) and even 7,110,201 became viable with an overall time of 1 minute 40 seconds.
<lang go>package main
 
Line 44 ⟶ 47:
"fmt"
"log"
// "math/big"
big "github.com/ncw/gmp"
"rcu"
)
Line 88 ⟶ 92:
fmt.Println()
nums := []int64{
113, 173, 193, 2183, 11229, 15065, 15845, 30817,
30817, 48443, 275485, 1267909, 2264915, 5812827, 7110201
}
fmt.Println(" n l[n] i[n] d[n]")
Line 140 ⟶ 144:
2,264,915 149 89 2,855,584
5,812,827 135 67 7,996,276
7,110,201 205 119 89,981,517
</pre>
 
9,487

edits