#1251 (negative float)^rational

closed
nobody
7
2007-11-18
2007-08-07
Barton Willis
No

negative float to a rational power is broken:

(%i7) (-4.207913)^(2/3);
(%o7) (0.25*26695^(2/3))/793^(2/3)

(%i8) (-4.2079137)^(2/3);
(%o8) (1.0*5849^(2/3))/1390^(2/3)

(%i9) (-4.207)^(2/3);
(%o9) 0.01*4207^(2/3)

When 'float' is true, it's worse:

(%i16) (-4.2079137)^(2/3);
(%o16) (-4.2079137)^0.66666666666667

(%i17) rectform(%);
(%o17) 2.25722671285884*%i-1.303210450291064

Since the exponent gets converted to a float,
the real branch rule isn't an option. After that,
rectform does the right thing.

Discussion

  • Dan Gildea
    Dan Gildea
    2007-11-18

    Logged In: YES
    user_id=1797506
    Originator: NO

    Fixed in simp.lisp rev 1.44.

    (%i4) (-4.207913)^(2/3);
    (%o4) 2.606420611524446

    (%i5) (-4.2079137)^(2/3);
    (%o5) 2.60642090058213

    (%i6) (-4.207)^(2/3);
    (%o6) 2.606043584071641

    (%i7) (-4.2079137)^(2/3),float;
    (%o7) (-4.2079137)^.6666666666666666

    (%i8) (-4.2079137)^(2/3),float,numer_pbranch;
    (%o8) 2.25722671285884*%i-1.303210450291064

    (%i9) (-4.2079137)^(2/3),numer_pbranch;
    (%o9) 2.60642090058213

     
  • Dan Gildea
    Dan Gildea
    2007-11-18

    • status: open --> closed