GNU bug report logs - #62658
[Typo] in Calc-Manual: Rewrite Rules - exercise 1

Previous Next

Package: emacs;

Reported by: Garid Zorigoo <garidzorigoo <at> gmail.com>

Date: Tue, 4 Apr 2023 05:32:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Garid Zorigoo <garidzorigoo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62658 <at> debbugs.gnu.org
Subject: bug#62658: [Typo] in Calc-Manual: Rewrite Rules - exercise 1
Date: Fri, 7 Apr 2023 21:46:21 +0900
[Message part 1 (text/plain, inline)]
Thanks for the reply

> It's possible.  But I tried to run the example, and I seem to be
> unable to get past the formula I'm asked to enter after the "m s"
> part: I get error messages.

Sorry, which "m s" are you referring to?
The section I referred to (from the start of "3.5.2 Rewrite Rules" to
first 2 entries of "Exercise 1") didn't have the command "m s".

> Could you perhaps show the commands and keys to type

To reproduce it'll need the following commands (in emacs -Q).
(These are copied from Rewrite-Rules 3.5.2 (in emacs-28)
or 2.5.2 (website). I picked up only entries /omitted outputs/)


    ' 2sec(x)^2/tan(x)^2 - 2/tan(x)^2 <RET>   s 1
    a r a/x + b/x := (a+b)/x <RET>
    a r sec(x)^2 := 1 + tan(x)^2 <RET>


    ' a/x + b/x := (a+b)/x <RET>          s t merge <RET>
    ' sec(x)^2 := 1 + tan(x)^2 <RET>      s t secsqr <RET>
    r 1                  a r merge <RET>  a r secsqr <RET>


    ' [merge,sinsqr] <RET>          =
    s t trig <RET>  r 1                  a r trig <RET>


According to the manual, the output after the last line should be 2.

I wrote the following tables, slightly detailed manner.
The First column represents what you enter, the 2nd column represents what
the result is.

Part I: (Not required for re-creating error)
| command                               | result                      |
|---------------------------------------+-----------------------------|
| '2sec(x)^2/tan(x)^2 - 2/tan(x)^2<RET> | 2sec(x)^2/ ...              |
| s 1                                   | same                        |
| a r  a/x + b/x := (a+b)/x <RET>       | (2 sec(x)^2 - 2) / tan(x)^2 |
| a r sec(x)^2 := 1 + tan(x)^2 <RET>    | 2                           |

Part II: (required for re-creating error, because saving expressions)
| command                          | result                      |
|----------------------------------+-----------------------------|
| ' a/x + b/x := (a+b)/x <RET>     | a/x + b/x := (a+b)/x        |
| s t merge <RET>                  | disappear                   |
| ' sec(x)^2 := 1 + tan(x)^2 <RET> | sec(x)^2 := 1 + tan(x)^2    |
| s t secsqr <RET>                 | disappear                   |
| r 1                              | 2sec(x)^2/...               |
| a r merge <RET>                  | (2 sec(x)^2 - 2) / tan(x)^2 |
| a r secsqr <RET>                 | 2                           |


Exercise I:
| command                | result                                   |
|------------------------+------------------------------------------|
| ' [merge,sinsqr] <RET> | [merge,sinsqr]                           |
| =                      | [a / x + b / x := (a + b) / x, sinsqr]   |
|                        | above, you can see sinsqr didn't expands |
|                        |                                          |
| s t trig <RET>         | disappear                                |
| r 1                    | 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2     |
| a r trig <RET>         | 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2     |
|                        | above, you can see it didn't change.     |
|                        | It should've outputted 2                 |


Here is what I think it should be:
Exercise I (My suggestion):
| command                | result                                     |
|------------------------+--------------------------------------------|
| ' [merge,secsqr] <RET> | [merge,secsqr]                             |
| =                      | [a / x + b / x := (a + b) / x, sec(x)^2... |
|                        | above, you WILL see SECSQR expands         |
|                        |                                            |
| s t trig <RET>         | disappear                                  |
| r 1                    | 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2       |
| a r trig <RET>         | 2                                          |
|                        | above, you  WILL see 2                     |


(Just in case, it might being helpful, I also attached the
asciicinema recording in the email)


Garid
[Message part 2 (text/html, inline)]
[tmpw7vsjq4x-ascii.cast (application/octet-stream, attachment)]

This bug report was last modified 2 years and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.