!!for the documentation
option:noreduction symbols=" "

reply$i=!rawmath $(reply$i)
reply$i=!trim $(reply$i)
parleft=(
dd=$(reply$i)
c=!char 1 of $dd
!if $c=+ or $c=-
  dd=!char 2 to -1 of $dd
!endif
!if ( + isin $dd or - isin $dd or * isin $dd or ^ isin $dd \
	  or $parleft isin $dd or ( . isin $dd and / isin $dd ) )
  test=NaN nocompute
  !exit
!endif

test=$[$(reply$i)]
m_reply$i=$(reply$i)
!if NaN isin $test
  !exit
!endif

!if $wims_read_parm=nocompare
  tmp=!exec maxima print($(reply$i));
  !if / isin $(reply$i) and noreduction notwordof $(replyoption$i) and $(reply$i) notsametext $tmp
    test=NaN badform noreduced
  !endif
  !exit
!endif

good=$[$(replygood$i)]
!if NaN isin $good or Inf isin $good
  Test=bad $i
  !exit
!endif

good=$(replygood$i)
tmp=!exec maxima print(is(equal($(reply$i),$(replygood$i))));\
print($(reply$i));
!distribute line $tmp into mres,reduced
!if $mres!=true
  diareply$i=bad
  !exit
!endif

!if $good=0 and $(reply$i) notsametext 0
  test=NaN badform
  !exit
!endif

!if / isin $(reply$i) and noreduction notwordof $(replyoption$i) and $(reply$i) notsametext $reduced
  test=NaN badform noreduced
  !exit
!endif

!for name in reply,replygood
  !if . isin $($name$i)
    tmp=!replace internal . by , in $($name$i)
    !distribute item $tmp into tmp1,tmp2
    nbdec=!charcnt $tmp2
    t1_$name=$[$($name$i)*10^$nbdec]
    t2_$name=$[10^$nbdec]
  !else
    tmp=!replace internal / by , in $($name$i)
    nb=!itemcnt $tmp
    !if $nb=1
      t1_$name=$($name$i)
      t2_$name=1
    !else
      !distribute item $tmp into t1_$name,t2_$name
    !endif
  !endif
!next name
mres=$[($t1_reply)*($t2_replygood) - $(t1_replygood)*($t2_reply)]

!if $mres!=0
  diareply$i=bad
  !exit
!endif

diareply$i=good
!advance freegot
