Code to calculate tetration using my method
#11
(10/19/2023, 11:49 AM)Shanghai46 Wrote: Btw I checked a bit and did a quick change of my code.
I erased p(x) from existence, and replaced it (in the if of tetra) by "n==int(n) and b==0". I also added a "if x==1, Z=(1,0)"

You can check if \(n\) is integer with \(\text{n.is_integer()}\). It works even if \(n\) is a float.

For a complex number

\(c=\text{complex(a,b)}\)

you can check:

\(\text{c.real.is_integer() and c.imag == 0}\)

Unless your calculation is unstable for small values of \(\text{c.imag}\), then may be convenient to check

\(\text{isclose(c.imag, 0)}\)

\(\text{isclose()}\) belongs to \(math\) module from which you imported everything, and allows to set the relative tolerance.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Terse Schroeder & Abel function code Daniel 1 1,428 10/16/2022, 07:03 AM
Last Post: Daniel
  The beta method program JmsNxn 0 1,979 02/25/2022, 03:05 AM
Last Post: JmsNxn
  C++ code for tet, ate and hexp MorgothV8 0 6,275 07/10/2014, 04:24 PM
Last Post: MorgothV8
  Which method is currently "the best"? MorgothV8 2 10,435 11/15/2013, 03:42 PM
Last Post: MorgothV8
  "Kneser"/Riemann mapping method code for *complex* bases mike3 2 13,488 08/15/2011, 03:14 PM
Last Post: Gottfried
  An incremental method to compute (Abel) matrix inverses bo198214 3 16,810 07/20/2010, 12:13 PM
Last Post: Gottfried
  Single-exp series computation code mike3 0 5,830 04/20/2010, 08:59 PM
Last Post: mike3
  Toying with the Borel summation to calculate tetration mike3 11 35,986 03/25/2010, 09:00 PM
Last Post: mike3
  SAGE code for computing flow matrix for exp(z)-1 jaydfox 4 17,775 08/21/2009, 05:32 PM
Last Post: jaydfox
  Matrix-method: compare use of different fixpoints Gottfried 23 55,900 11/30/2007, 05:24 PM
Last Post: andydude



Users browsing this thread: 1 Guest(s)