[Push] division and tangent instructions

PerPlex Ed edperplex at yahoo.com
Sat Jun 26 10:22:07 EDT 2010


Division and modulo instruction are defined as no-op when the top of the stack is zero.

While I understand some of the reason behind this choice, I don't feel at ease with it completely.

For floating point computation I guess it's common for most platform to be able to represent and perform conputation on the special values NaN, +Inf and -Inf following more or less strictly the some IEEE standard. Java and C# behaviours are described here:

http://www.itu.dk/people/sestoft/javaprecisely/java-floatingpoint.pdf
http://www.itu.dk/~sestoft/csharpprecisely/csharp-floatingpoint.pdf

I don't know about Lisp.

Now what if I want to perform symbolic regression of 1/x?

Because of the current Push definition, any genetic programming system based on Push won't be able to find an exact result. I don't have enough experience to tell if this problem will make harder for Push based system to find an aproximate solution.

What about integers? I see that modern languages use "option types" or the Maybe monad to represent computation that can possibly result an invalid result without causing any exceptional conditions or disruption in the program evaluation. Isn't this something that looks appropriate for the purposes of Push?

In any case, the tangent function goes to infinity periodically but there is nothing in the language specification about these cases. Should they be performed as no-op? Why can Float.Tan push Inf or NaN on the stack while the division is not allowed to do that?
In my latest Push run Float.Tan found 2.8097223026326946E+36 on the top of the stack and pushed NaN.

Thanks.


      



More information about the Push mailing list