[metapost] Update on mpost 2013 bug
Daniel H. Luecking
luecking at uark.edu
Mon Jan 27 20:54:32 CET 2014
I can pin down where the error occurs:
With
sigma = 6;
The quantity (2*sigma**2) is 144 and metapost also returns 144 for the
expression -(ix-mu)**2/(2*sigma**2), whatever the value of (ix-mu). The value is
returned correctly if extra parentheses are added enclosing the numerator:
(-(ix-mu)**2)/(2*sigma**2)
[I am curious whether the expression 2*sigma**2 is what the OP intended. It
is the same as (2*sigma)**2= 12*12 = 144 because * and ** have equal
precedence. But I would have expected 2*(sigma**2) = 2*6*6 = 72.
Also -(xi-mu)**2 is the same as (-(xi-mu)) * (-(xi-mu)) = (xi-mu)**2 (negation has
precedence over * and **), so I wonder why the minus sign is included.]
Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
Fayetteville, Arkansas
________________________________________
From: metapost [metapost-bounces at tug.org] on behalf of Michael D. Godfrey [michaeldgodfrey at gmail.com]
Sent: Sunday, January 26, 2014 10:38 PM
To: metapost at tug.org
Subject: [metapost] Update on mpost 2013 bug
> I have found a failure in the mpost which is installed with texlive-2013
> and with 2012. The last correct mpost appears to be from texlive_2010.
> Attached are:
>
> 1. The mpost script to be processed by mpost and mptopdf in figs-2.mp
> Note that this requires -numbersystem=double
>
> 2. The correct output in figs-2.pdf
>
> 3. The incorrect output in figs-2-2013.pdf
>
> The problem is that the tapered sin and cos functions disappear.
> I tried a number of changes to the code, but could not make it work.
>
> I will try the latest tar file and tell you if it works or not.
>
> Michael
>
>
I installed texlive 2010 and it works correctly. Note that mpost
form 2010 compiles this function without need of double option.
It has none anyhow.
I very much hope that you can fix this. I have used TeX and its associated
stuff since about the beginning and this is the first update
incompatibility that
I have encountered. Luckily, just before posting the paper with that figure
in it, I caught the error.
Michael
--
http://tug.org/metapost/
More information about the metapost
mailing list