Sage has `max_symbolic`:

sage: var('x0, x1, x2');
sage: 
integrate(integrate(integrate(1,x2,max_symbolic(x0,x1),1),x1,0,1),x0,0,1)
1/3

.. i'm pretty sure Nils meant:  symb_max(x,y)=(x+y)/2+abs(x-y)/2
which gives the same result:

sage: integrate(integrate(integrate(1,x2,symb_max(x0,x1),1),x1,0,1),x0,0,1)
1/3

El sábado, 3 de junio de 2017, 19:18:30 (UTC+2), Nils Bruin escribió:
>
> On Saturday, June 3, 2017 at 10:07:03 AM UTC-7, Ognjen Dragoljevic wrote:
>>
>> The following integral should be 1/3 but Sage gives 1/2.
>> integrate(integrate(integrate(1,x2,max(x0,x1),1),x1,0,1),x0,0,1)
>>
>> It seems that Sage immediately evaluates max(x0,x1) to x0 which is 
>> incorrect.
>>
> "max" hasn't been implemented as a symbolic function, so the result
>
> max(x,y)
>
> simply follows from bool(x<y)==False 
>
> You can implement a symbolic max function by
>
> symb_max(x,y)=(x+y)/2+abs(x-y)
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to