Hacker News new | past | comments | ask | show | jobs | submit login

So the type of the return value changes at asymptotes/limits (already) and thus that's not a pure function in terms of math. If a [math] function returns a more complex type signature instead of throwing a ZeroDivisionError (as Python core does) what is that then called? Is it differentiable or no, etc?

We throw ZeroDivisionError instead of axiomatically defining a ranking for

  scalar*parameter*inf

  if x > 0:
      2*x*inf > x*inf
      # because
      2 > 1
But basically every CAS just prematurely throws away all terms next to infinity (by replacing the information in that expression with just infinity)? And nothing yet implements e.g. Conway's Surreal numbers infinities?

Is negative infinity to the infinity greater or lesser than infinity?

  assert (-1*math.inf)**math.inf == math.inf

  assert (-1*sympy.oo)**sympy.oo == sympy.oo
Here's a dumb Real/Function instead of prematurely discarding information that could be useful:

  from sympy import symbol
  from sympy.abc import x

  Infinity = symbol('Infinity', real=True)  # *
  # 

  from sympy.symbols import Wild
All the axioms just change there.

  limit(-x**-1)
An uphill battle for certain.

"[Python-ideas] Re: 'Infinity' constant in Python" https://mail.python.org/archives/list/python-ideas@python.or...




> So the type of the return value changes at asymptotes/limits (already) and thus that's not a pure function in terms of math.

Plenty of functions are discontinuous. Almost all of them, in fact. (This isn't true constructively, but GP is clearly doing classical analysis.)

> If a [math] function returns a more complex type signature instead of throwing a ZeroDivisionError (as Python core does) what is that then called? Is it differentiable or no, etc?

Depends on the smooth structures you've imposed on the domain and codomain, which requires much more powerful types to represent than are available in any mainstream language I'm aware of. (You might be able to contort Haskell into something sort of close, but it wouldn't be simple.)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: