Mathematical expression with any functions |

The return Polish notation (RPN) of the set expression |

Reverse Polish Notation (RPN) of a given expression |

For the first time I had to deal with Polish notation in the 80s, when I got into the hands of the programmable calculator MK-61. The lack of home computers at that time, and the great desire to write any program was such that it allowed us to master this notation with the help of a "scientific poke" and the journal "Science and Life", where small articles were written on the topic of programming on this calculator .

Reverse Polish notation - turned out to be a very popular tool in information systems.

The most important benefit of this notation is that the **resulting expression does not have a single bracket** . This greatly (!!) simplifies the calculation of arbitrary mathematical expressions and formulas with many nested brackets.

A distinctive feature of the reverse Polish notation is that the arguments come first, and then the operation itself for these arguments.

Unlike direct Polish notation, where the operands go first and then the values / arguments.

for example in reverse Polish notation will look like

Why is this one called Polish? The fact is that the reverse Polish notation was invented on the basis of the usual Polish notation, which was proposed in 1920 by the Polish mathematician Jan Lukasevic.

This bot automatically converts an arbitrary expression into reverse Polish notation.

You can use this bot, both for studying or writing articles and essays, and using the ability to receive an answer in RPN format via JSON request to your services or sites.

What else to tell about him. Some readers questioned the correctness of the provision in the reverse Polish entry by providing an example.

and we get the answer **2 0 3 - ^**

I would like to object to this, since it is impossible to represent a negative number in reverse Polish notation in principle, therefore such a trick is used. The correctness of this method is confirmed by the correctness of the calculation of all other calculators on this site, including the Universal complex numbers calculator online

## Syntax

**infixa expression**

**An expression** can be any (!!) mathematical expression. The language in which the expression is written is not important here. You can write an expression in Ruby, PHP or Pascal.

An expression can use an unlimited number of functions.

## Examples

Expression

after the conversion becomes

**An expression recorded in RPN format looks like this 4 5 + x * y 2/15 + -**

Converts to

**An expression recorded in RPN format looks like this 1 2 + 4 sin * 3 +**