Given required values for an expression with 2 variables, output a short expression which fulfill these values
Input
You may take the input in any reasonable format, e.g. f(x,y)=z
, {(x, y): z}
, [[[x,y],z]]
, but please write what format is your input is taken in
Output
Your output needs the be a valid infix expression for two variables, and it has to output the correct value when rounding the output to three digits after the comma, but the current value isn't rounded during calculation. The following symbols/operators are allowed:
symbols
x - the first input variables
y - the second input variables
pi - 3.1415 (4 digit precision)
e - 2.7182 (4 digit precision)
every possible numeric constant (1, 0.12, 42, 13.241)
operators
+ sum of two values, in the format a+b
- difference of two values, in the format a-b
* multiplication of two values, in the format a*b
/ division of two values, in the format a/b
^ power of two values, in the format a^b
|| absolute value, in the format |a|
() parentheses, in the format (a)
floor the floor of a value, in the format floor(a)
ceil the ceil of a value, in the format ceil(a)
if I forgot anything that you think is important tell me in the comments please.
Example Testcases
other expressions are okay if they result in the correct values
f(0.12, 0.423) = 3.142
f(0.89, 0.90) = 3.142
|
\/
pi (3.1415 gets rounded to 3 digits after the comma - 3.142)
f(0.12, 0.423) = 0.543
f(0.89,0.9)=1.79
|
\/
x+y
Score
Your score is the average length of expression for the following input: https://pastebin.com/tfuBjpc6 , where each batch of inputs (a different function) is separated by a newline. You can transform the format to any format your program accept.
Good luck!