Bug#602115: apcalc: logarithm precision does not seem to improve with a lower epsilon()

2014-10-14 Thread Martin Buck
This seems to be fixed in apcalc 2.12.5.0, to be uploaded to unstable
shortly:

C-style arbitrary precision calculator (version 2.12.5.0)
Calc is open software. For license details type:  help copyright
[Type exit to exit, or help for help.]

; display(70)
20
; for (n = 4 ; n = 70 ; n += 4) { epsilon(10^(-n)) ; print n, log(10^0.5) ; }
4 0.5
8 ~0.500021714724123398193288917718128714192273346128546328769982611153
12 0.5
16 ~0.4999782852759048374087681632417234746140129701972730600964
20 0.5
24 ~0.50002171472409516259138255645023376973100683865400
28 ~0.4999782852759048374086174435540543172005522040
32 0.5
36 0.5
40 ~0.5000217147240951625913825564459458
44 ~0.499978285275904837408617443554
48 ~0.49997828527590483740861744
52 0.5
56 ~0.500021714724095163
60 0.5
64 0.5
68 ~0.499978
; for (n = 4 ; n = 70 ; n += 4) { epsilon(10^(-n)) ; print n, 0.5 - 
log(10^0.5) ; }
4 0
8 ~-0.21714724123398193288917718128714192273346128546328769982611153
12 0
16 ~0.217147240951625912318367582765253859870298027269399036
20 0
24 ~-0.2171472409516259138255645023376973100683865400
28 ~0.217147240951625913825564459456827994477960
32 0
36 0
40 ~-0.217147240951625913825564459458
44 ~0.21714724095162591382556446
48 ~0.2171472409516259138256
52 0
56 ~-0.21714724095163
60 0
64 0
68 ~0.22


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#602115: apcalc: logarithm precision does not seem to improve with a lower epsilon()

2010-11-01 Thread Francesco Poli (t1000)
Package: apcalc
Version: 2.12.3.3-1
Severity: normal

Hi,
I noticed something I cannot understand.

I wanted to compute a base 10 logarithm with increasing precision, but
it seems that the precision does not increase beyond some sort of limit
value:

  $ calc
  C-style arbitrary precision calculator (version 2.12.3.3)
  Calc is open software. For license details type:  help copyright
  [Type exit to exit, or help for help.]
  
  ; display(70)
  20
  ; for (n = 4 ; n = 70 ; n += 4) { epsilon(10^(-n)) ; print n, log(10^0.5) ; }
  4 0.5
  8 ~0.467645270563710588030921566924346391036219925301832710848605923738
  12 ~0.467630057326500477720837314340310952835924606966038391383653261530
  16 ~0.46763005742551897854599148788326239902718665855921332406844437
  20 ~0.467630057425701424476678537305654477547120646226005385216711543473
  24 ~0.467630057425701420116390167636584730304872752540606271171718926431
  28 ~0.467630057425701420115205854251715452097628767480239729001997741683
  32 ~0.467630057425701420115206037435941978632849821940415182836793190307
  36 ~0.467630057425701420115206037445079475375662294797185789976548249805
  40 ~0.467630057425701420115206037445078609398071744983931208199426734995
  44 ~0.467630057425701420115206037445078609184139668201163901676365847303
  48 ~0.467630057425701420115206037445078609184158403543820029531833579432
  52 ~0.467630057425701420115206037445078609184158405222357335186311126553
  56 ~0.467630057425701420115206037445078609184158405222305307044210892035
  60 ~0.467630057425701420115206037445078609184158405222305292556240771302
  64 ~0.467630057425701420115206037445078609184158405222305292556025796925
  68 ~0.467630057425701420115206037445078609184158405222305292556025726483

Awkwardly enough, it seems that the exact value is computed, when epsilon
is set to 10^-4, but, when I set epsilon to 10^-8 or less, the absolute
error (with respect to the exact value of 0.5) does not seem to lower
significantly.

Indeed, the absolute error seem to be stay almost unchanged:

  ; for (n = 4 ; n = 70 ; n += 4) { epsilon(10^(-n)) ; print n, 0.5 - 
log(10^0.5) ; }
  4 0
  8 ~0.032354729436289411969078433075653608963780074698167289151394076262
  12 ~0.032369942673499522279162685659689047164075393033961608616346738470
  16 ~0.03236994257448102145400851211673760097281334144078667593155563
  20 ~0.032369942574298575523321462694345522452879353773994614783288456527
  24 ~0.032369942574298579883609832363415269695127247459393728828281073569
  28 ~0.032369942574298579884794145748284547902371232519760270998002258317
  32 ~0.032369942574298579884793962564058021367150178059584817163206809693
  36 ~0.032369942574298579884793962554920524624337705202814210023451750195
  40 ~0.032369942574298579884793962554921390601928255016068791800573265005
  44 ~0.032369942574298579884793962554921390815860331798836098323634152697
  48 ~0.032369942574298579884793962554921390815841596456179970468166420568
  52 ~0.032369942574298579884793962554921390815841594777642664813688873447
  56 ~0.032369942574298579884793962554921390815841594777694692955789107965
  60 ~0.032369942574298579884793962554921390815841594777694707443759228698
  64 ~0.032369942574298579884793962554921390815841594777694707443974203075
  68 ~0.032369942574298579884793962554921390815841594777694707443974273517
  ; 

I seem to get reasonable results with, say, the computation of sqrt(2),
where the absolute error really decreases exponentially (as I think
it should).

Why does the computation of log(10^0.5) fail to increase in precision?
What did I fail to understand?

Could you please explain if I missed something in the documentation
(I tried to read various help documents) or if this is an actual
bug?

Thanks for your time.


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (800, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages apcalc depends on:
ii  apcalc-common  2.12.3.3-1Arbitrary precision calculator (co
ii  libc6  2.11.2-6+squeeze1 Embedded GNU C Library: Shared lib
ii  libreadline5   5.2-7 GNU readline and history libraries

apcalc recommends no packages.

apcalc suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org