0s autopkgtest [15:51:55]: starting date and time: 2025-03-15 15:51:55+0000 0s autopkgtest [15:51:55]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 0s autopkgtest [15:51:55]: host juju-7f2275-prod-proposed-migration-environment-2; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.n82ed0a3/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:glibc --apt-upgrade r-cran-rmpfr --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=glibc/2.41-1ubuntu2 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-2@bos03-arm64-6.secgroup --name adt-plucky-arm64-r-cran-rmpfr-20250315-155154-juju-7f2275-prod-proposed-migration-environment-2-de644ecf-555a-4178-8ef0-36636bb3ee94 --image adt/ubuntu-plucky-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-2 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com,radosgw.ps5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 142s autopkgtest [15:54:17]: testbed dpkg architecture: arm64 142s autopkgtest [15:54:17]: testbed apt version: 2.9.33 142s autopkgtest [15:54:17]: @@@@@@@@@@@@@@@@@@@@ test bed setup 143s autopkgtest [15:54:18]: testbed release detected to be: None 143s autopkgtest [15:54:18]: updating testbed package index (apt update) 144s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [126 kB] 144s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 144s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 144s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 144s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [99.7 kB] 144s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [379 kB] 145s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.8 kB] 145s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 Packages [111 kB] 145s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 c-n-f Metadata [1856 B] 145s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted arm64 c-n-f Metadata [116 B] 145s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 Packages [324 kB] 145s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 c-n-f Metadata [14.7 kB] 145s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse arm64 Packages [4948 B] 145s Get:14 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse arm64 c-n-f Metadata [268 B] 146s Fetched 1078 kB in 2s (638 kB/s) 147s Reading package lists... 147s Reading package lists... 148s Building dependency tree... 148s Reading state information... 149s Calculating upgrade... 149s Calculating upgrade... 149s The following packages will be upgraded: 149s pinentry-curses python3-jinja2 strace 150s 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 150s Need to get 647 kB of archives. 150s After this operation, 11.3 kB of additional disk space will be used. 150s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 strace arm64 6.13+ds-1ubuntu1 [499 kB] 150s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 pinentry-curses arm64 1.3.1-2ubuntu3 [39.2 kB] 150s Get:3 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-jinja2 all 3.1.5-2ubuntu1 [109 kB] 151s Fetched 647 kB in 1s (497 kB/s) 152s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 117701 files and directories currently installed.) 152s Preparing to unpack .../strace_6.13+ds-1ubuntu1_arm64.deb ... 152s Unpacking strace (6.13+ds-1ubuntu1) over (6.11-0ubuntu1) ... 152s Preparing to unpack .../pinentry-curses_1.3.1-2ubuntu3_arm64.deb ... 152s Unpacking pinentry-curses (1.3.1-2ubuntu3) over (1.3.1-2ubuntu2) ... 152s Preparing to unpack .../python3-jinja2_3.1.5-2ubuntu1_all.deb ... 152s Unpacking python3-jinja2 (3.1.5-2ubuntu1) over (3.1.5-2) ... 152s Setting up pinentry-curses (1.3.1-2ubuntu3) ... 152s Setting up python3-jinja2 (3.1.5-2ubuntu1) ... 152s Setting up strace (6.13+ds-1ubuntu1) ... 152s Processing triggers for man-db (2.13.0-1) ... 153s Reading package lists... 154s Building dependency tree... 154s Reading state information... 154s Solving dependencies... 154s The following packages will be REMOVED: 154s libnsl2* libpython3.12-minimal* libpython3.12-stdlib* libpython3.12t64* 154s libunwind8* linux-headers-6.11.0-8* linux-headers-6.11.0-8-generic* 154s linux-image-6.11.0-8-generic* linux-modules-6.11.0-8-generic* 154s linux-tools-6.11.0-8* linux-tools-6.11.0-8-generic* 155s 0 upgraded, 0 newly installed, 11 to remove and 5 not upgraded. 155s After this operation, 267 MB disk space will be freed. 155s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 117701 files and directories currently installed.) 155s Removing linux-tools-6.11.0-8-generic (6.11.0-8.8) ... 155s Removing linux-tools-6.11.0-8 (6.11.0-8.8) ... 155s Removing libpython3.12t64:arm64 (3.12.9-1) ... 155s Removing libpython3.12-stdlib:arm64 (3.12.9-1) ... 155s Removing libnsl2:arm64 (1.3.0-3build3) ... 155s Removing libpython3.12-minimal:arm64 (3.12.9-1) ... 155s Removing libunwind8:arm64 (1.6.2-3.1) ... 155s Removing linux-headers-6.11.0-8-generic (6.11.0-8.8) ... 156s Removing linux-headers-6.11.0-8 (6.11.0-8.8) ... 157s Removing linux-image-6.11.0-8-generic (6.11.0-8.8) ... 158s I: /boot/vmlinuz.old is now a symlink to vmlinuz-6.14.0-10-generic 158s I: /boot/initrd.img.old is now a symlink to initrd.img-6.14.0-10-generic 158s /etc/kernel/postrm.d/initramfs-tools: 158s update-initramfs: Deleting /boot/initrd.img-6.11.0-8-generic 158s /etc/kernel/postrm.d/zz-flash-kernel: 158s flash-kernel: Kernel 6.11.0-8-generic has been removed. 158s flash-kernel: A higher version (6.14.0-10-generic) is still installed, no reflashing required. 158s /etc/kernel/postrm.d/zz-update-grub: 158s Sourcing file `/etc/default/grub' 158s Sourcing file `/etc/default/grub.d/50-cloudimg-settings.cfg' 158s Generating grub configuration file ... 158s Found linux image: /boot/vmlinuz-6.14.0-10-generic 158s Found initrd image: /boot/initrd.img-6.14.0-10-generic 159s Warning: os-prober will not be executed to detect other bootable partitions. 159s Systems on them will not be added to the GRUB boot configuration. 159s Check GRUB_DISABLE_OS_PROBER documentation entry. 159s Adding boot menu entry for UEFI Firmware Settings ... 159s done 159s Removing linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 159s Processing triggers for libc-bin (2.41-1ubuntu1) ... 159s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81650 files and directories currently installed.) 159s Purging configuration files for linux-image-6.11.0-8-generic (6.11.0-8.8) ... 160s Purging configuration files for libpython3.12-minimal:arm64 (3.12.9-1) ... 160s Purging configuration files for linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 160s autopkgtest [15:54:35]: upgrading testbed (apt dist-upgrade and autopurge) 160s Reading package lists... 161s Building dependency tree... 161s Reading state information... 162s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 162s Starting 2 pkgProblemResolver with broken count: 0 162s Done 163s Entering ResolveByKeep 163s 163s Calculating upgrade... 164s The following packages will be upgraded: 164s libc-bin libc-dev-bin libc6 libc6-dev locales 164s 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 164s Need to get 9530 kB of archives. 164s After this operation, 0 B of additional disk space will be used. 164s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc6-dev arm64 2.41-1ubuntu2 [1750 kB] 166s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc-dev-bin arm64 2.41-1ubuntu2 [24.0 kB] 166s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc6 arm64 2.41-1ubuntu2 [2910 kB] 169s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc-bin arm64 2.41-1ubuntu2 [600 kB] 170s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 locales all 2.41-1ubuntu2 [4246 kB] 175s Preconfiguring packages ... 175s Fetched 9530 kB in 11s (903 kB/s) 175s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 175s Preparing to unpack .../libc6-dev_2.41-1ubuntu2_arm64.deb ... 175s Unpacking libc6-dev:arm64 (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 175s Preparing to unpack .../libc-dev-bin_2.41-1ubuntu2_arm64.deb ... 175s Unpacking libc-dev-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 175s Preparing to unpack .../libc6_2.41-1ubuntu2_arm64.deb ... 175s Unpacking libc6:arm64 (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 176s Setting up libc6:arm64 (2.41-1ubuntu2) ... 176s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 176s Preparing to unpack .../libc-bin_2.41-1ubuntu2_arm64.deb ... 176s Unpacking libc-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 176s Setting up libc-bin (2.41-1ubuntu2) ... 176s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 176s Preparing to unpack .../locales_2.41-1ubuntu2_all.deb ... 176s Unpacking locales (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 176s Setting up locales (2.41-1ubuntu2) ... 178s Generating locales (this might take a while)... 180s en_US.UTF-8... done 180s Generation complete. 180s Setting up libc-dev-bin (2.41-1ubuntu2) ... 180s Setting up libc6-dev:arm64 (2.41-1ubuntu2) ... 180s Processing triggers for man-db (2.13.0-1) ... 181s Processing triggers for systemd (257.3-1ubuntu3) ... 182s Reading package lists... 183s Building dependency tree... 183s Reading state information... 184s Starting pkgProblemResolver with broken count: 0 184s Starting 2 pkgProblemResolver with broken count: 0 184s Done 185s Solving dependencies... 186s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 187s autopkgtest [15:55:02]: rebooting testbed after setup commands that affected boot 210s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 218s autopkgtest [15:55:33]: testbed running kernel: Linux 6.14.0-10-generic #10-Ubuntu SMP PREEMPT_DYNAMIC Wed Mar 12 15:45:31 UTC 2025 221s autopkgtest [15:55:36]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-rmpfr 223s Get:1 http://ftpmaster.internal/ubuntu plucky/universe r-cran-rmpfr 0.9-5-1 (dsc) [2135 B] 223s Get:2 http://ftpmaster.internal/ubuntu plucky/universe r-cran-rmpfr 0.9-5-1 (tar) [608 kB] 223s Get:3 http://ftpmaster.internal/ubuntu plucky/universe r-cran-rmpfr 0.9-5-1 (diff) [2684 B] 224s gpgv: Signature made Thu Feb 1 16:01:12 2024 UTC 224s gpgv: using RSA key F1F007320A035541F0A663CA578A0494D1C646D1 224s gpgv: issuer "tille@debian.org" 224s gpgv: Can't check signature: No public key 224s dpkg-source: warning: cannot verify inline signature for ./r-cran-rmpfr_0.9-5-1.dsc: no acceptable signature found 224s autopkgtest [15:55:39]: testing package r-cran-rmpfr version 0.9-5-1 225s autopkgtest [15:55:40]: build not needed 227s autopkgtest [15:55:42]: test run-unit-test: preparing testbed 228s Reading package lists... 228s Building dependency tree... 228s Reading state information... 229s Starting pkgProblemResolver with broken count: 0 229s Starting 2 pkgProblemResolver with broken count: 0 229s Done 230s The following NEW packages will be installed: 230s fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono libblas3 230s libcairo2 libdatrie1 libdeflate0 libfontconfig1 libgfortran5 libgomp1 230s libgraphite2-3 libharfbuzz0b libice6 libjbig0 libjpeg-turbo8 libjpeg8 230s liblapack3 liblerc4 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 230s libpaper-utils libpaper2 libpixman-1-0 libsharpyuv0 libsm6 libtcl8.6 230s libthai-data libthai0 libtiff6 libtk8.6 libwebp7 libxcb-render0 libxcb-shm0 230s libxft2 libxrender1 libxss1 libxt6t64 r-base-core r-cran-gmp r-cran-mass 230s r-cran-polynom r-cran-rmpfr r-cran-sfsmisc unzip x11-common xdg-utils zip 230s 0 upgraded, 49 newly installed, 0 to remove and 0 not upgraded. 230s Need to get 41.8 MB of archives. 230s After this operation, 84.1 MB of additional disk space will be used. 230s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 fonts-dejavu-mono all 2.37-8 [502 kB] 231s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 fonts-dejavu-core all 2.37-8 [835 kB] 232s Get:3 http://ftpmaster.internal/ubuntu plucky/main arm64 fontconfig-config arm64 2.15.0-2ubuntu1 [37.5 kB] 232s Get:4 http://ftpmaster.internal/ubuntu plucky/main arm64 libfontconfig1 arm64 2.15.0-2ubuntu1 [144 kB] 232s Get:5 http://ftpmaster.internal/ubuntu plucky/main arm64 fontconfig arm64 2.15.0-2ubuntu1 [191 kB] 232s Get:6 http://ftpmaster.internal/ubuntu plucky/main arm64 libblas3 arm64 3.12.1-2 [161 kB] 232s Get:7 http://ftpmaster.internal/ubuntu plucky/main arm64 libpixman-1-0 arm64 0.44.0-3 [197 kB] 233s Get:8 http://ftpmaster.internal/ubuntu plucky/main arm64 libxcb-render0 arm64 1.17.0-2 [16.6 kB] 233s Get:9 http://ftpmaster.internal/ubuntu plucky/main arm64 libxcb-shm0 arm64 1.17.0-2 [5884 B] 233s Get:10 http://ftpmaster.internal/ubuntu plucky/main arm64 libxrender1 arm64 1:0.9.10-1.1build1 [18.8 kB] 233s Get:11 http://ftpmaster.internal/ubuntu plucky/main arm64 libcairo2 arm64 1.18.2-2 [560 kB] 233s Get:12 http://ftpmaster.internal/ubuntu plucky/main arm64 libdatrie1 arm64 0.2.13-3build1 [19.2 kB] 233s Get:13 http://ftpmaster.internal/ubuntu plucky/main arm64 libdeflate0 arm64 1.23-1 [46.2 kB] 233s Get:14 http://ftpmaster.internal/ubuntu plucky/main arm64 libgfortran5 arm64 15-20250222-0ubuntu1 [444 kB] 234s Get:15 http://ftpmaster.internal/ubuntu plucky/main arm64 libgomp1 arm64 15-20250222-0ubuntu1 [146 kB] 234s Get:16 http://ftpmaster.internal/ubuntu plucky/main arm64 libgraphite2-3 arm64 1.3.14-2ubuntu1 [70.6 kB] 234s Get:17 http://ftpmaster.internal/ubuntu plucky/main arm64 libharfbuzz0b arm64 10.2.0-1 [490 kB] 234s Get:18 http://ftpmaster.internal/ubuntu plucky/main arm64 x11-common all 1:7.7+23ubuntu3 [21.7 kB] 234s Get:19 http://ftpmaster.internal/ubuntu plucky/main arm64 libice6 arm64 2:1.1.1-1 [42.3 kB] 235s Get:20 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg-turbo8 arm64 2.1.5-3ubuntu2 [165 kB] 235s Get:21 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg8 arm64 8c-2ubuntu11 [2148 B] 235s Get:22 http://ftpmaster.internal/ubuntu plucky/main arm64 liblapack3 arm64 3.12.1-2 [2307 kB] 237s Get:23 http://ftpmaster.internal/ubuntu plucky/main arm64 liblerc4 arm64 4.0.0+ds-5ubuntu1 [167 kB] 238s Get:24 http://ftpmaster.internal/ubuntu plucky/main arm64 libthai-data all 0.1.29-2build1 [158 kB] 238s Get:25 http://ftpmaster.internal/ubuntu plucky/main arm64 libthai0 arm64 0.1.29-2build1 [18.2 kB] 238s Get:26 http://ftpmaster.internal/ubuntu plucky/main arm64 libpango-1.0-0 arm64 1.56.2-1 [237 kB] 238s Get:27 http://ftpmaster.internal/ubuntu plucky/main arm64 libpangoft2-1.0-0 arm64 1.56.2-1 [49.5 kB] 238s Get:28 http://ftpmaster.internal/ubuntu plucky/main arm64 libpangocairo-1.0-0 arm64 1.56.2-1 [27.6 kB] 238s Get:29 http://ftpmaster.internal/ubuntu plucky/main arm64 libpaper2 arm64 2.2.5-0.3 [17.3 kB] 238s Get:30 http://ftpmaster.internal/ubuntu plucky/main arm64 libpaper-utils arm64 2.2.5-0.3 [15.4 kB] 238s Get:31 http://ftpmaster.internal/ubuntu plucky/main arm64 libsharpyuv0 arm64 1.5.0-0.1 [16.9 kB] 238s Get:32 http://ftpmaster.internal/ubuntu plucky/main arm64 libsm6 arm64 2:1.2.4-1 [16.4 kB] 238s Get:33 http://ftpmaster.internal/ubuntu plucky/main arm64 libtcl8.6 arm64 8.6.16+dfsg-1 [987 kB] 240s Get:34 http://ftpmaster.internal/ubuntu plucky/main arm64 libjbig0 arm64 2.1-6.1ubuntu2 [29.3 kB] 240s Get:35 http://ftpmaster.internal/ubuntu plucky/main arm64 libwebp7 arm64 1.5.0-0.1 [194 kB] 240s Get:36 http://ftpmaster.internal/ubuntu plucky/main arm64 libtiff6 arm64 4.5.1+git230720-4ubuntu4 [193 kB] 240s Get:37 http://ftpmaster.internal/ubuntu plucky/main arm64 libxft2 arm64 2.3.6-1build1 [44.1 kB] 240s Get:38 http://ftpmaster.internal/ubuntu plucky/main arm64 libxss1 arm64 1:1.2.3-1build3 [7244 B] 240s Get:39 http://ftpmaster.internal/ubuntu plucky/main arm64 libtk8.6 arm64 8.6.16-1 [776 kB] 241s Get:40 http://ftpmaster.internal/ubuntu plucky/main arm64 libxt6t64 arm64 1:1.2.1-1.2build1 [168 kB] 241s Get:41 http://ftpmaster.internal/ubuntu plucky/main arm64 zip arm64 3.0-14ubuntu2 [173 kB] 241s Get:42 http://ftpmaster.internal/ubuntu plucky/main arm64 unzip arm64 6.0-28ubuntu6 [178 kB] 241s Get:43 http://ftpmaster.internal/ubuntu plucky/main arm64 xdg-utils all 1.2.1-2ubuntu1 [66.0 kB] 241s Get:44 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-base-core arm64 4.4.3-1 [28.4 MB] 274s Get:45 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-gmp arm64 0.7-5-1 [307 kB] 274s Get:46 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-mass arm64 7.3-64-1 [1110 kB] 275s Get:47 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-polynom all 1.4-1+dfsg-1 [89.7 kB] 275s Get:48 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-rmpfr arm64 0.9-5-1 [1219 kB] 276s Get:49 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-sfsmisc all 1.1-20-1 [674 kB] 278s Preconfiguring packages ... 278s Fetched 41.8 MB in 47s (880 kB/s) 278s Selecting previously unselected package fonts-dejavu-mono. 278s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 278s Preparing to unpack .../00-fonts-dejavu-mono_2.37-8_all.deb ... 278s Unpacking fonts-dejavu-mono (2.37-8) ... 278s Selecting previously unselected package fonts-dejavu-core. 278s Preparing to unpack .../01-fonts-dejavu-core_2.37-8_all.deb ... 278s Unpacking fonts-dejavu-core (2.37-8) ... 278s Selecting previously unselected package fontconfig-config. 278s Preparing to unpack .../02-fontconfig-config_2.15.0-2ubuntu1_arm64.deb ... 279s Unpacking fontconfig-config (2.15.0-2ubuntu1) ... 279s Selecting previously unselected package libfontconfig1:arm64. 279s Preparing to unpack .../03-libfontconfig1_2.15.0-2ubuntu1_arm64.deb ... 279s Unpacking libfontconfig1:arm64 (2.15.0-2ubuntu1) ... 279s Selecting previously unselected package fontconfig. 279s Preparing to unpack .../04-fontconfig_2.15.0-2ubuntu1_arm64.deb ... 279s Unpacking fontconfig (2.15.0-2ubuntu1) ... 279s Selecting previously unselected package libblas3:arm64. 279s Preparing to unpack .../05-libblas3_3.12.1-2_arm64.deb ... 279s Unpacking libblas3:arm64 (3.12.1-2) ... 279s Selecting previously unselected package libpixman-1-0:arm64. 279s Preparing to unpack .../06-libpixman-1-0_0.44.0-3_arm64.deb ... 279s Unpacking libpixman-1-0:arm64 (0.44.0-3) ... 279s Selecting previously unselected package libxcb-render0:arm64. 279s Preparing to unpack .../07-libxcb-render0_1.17.0-2_arm64.deb ... 279s Unpacking libxcb-render0:arm64 (1.17.0-2) ... 279s Selecting previously unselected package libxcb-shm0:arm64. 279s Preparing to unpack .../08-libxcb-shm0_1.17.0-2_arm64.deb ... 279s Unpacking libxcb-shm0:arm64 (1.17.0-2) ... 279s Selecting previously unselected package libxrender1:arm64. 279s Preparing to unpack .../09-libxrender1_1%3a0.9.10-1.1build1_arm64.deb ... 279s Unpacking libxrender1:arm64 (1:0.9.10-1.1build1) ... 279s Selecting previously unselected package libcairo2:arm64. 279s Preparing to unpack .../10-libcairo2_1.18.2-2_arm64.deb ... 279s Unpacking libcairo2:arm64 (1.18.2-2) ... 279s Selecting previously unselected package libdatrie1:arm64. 279s Preparing to unpack .../11-libdatrie1_0.2.13-3build1_arm64.deb ... 279s Unpacking libdatrie1:arm64 (0.2.13-3build1) ... 279s Selecting previously unselected package libdeflate0:arm64. 279s Preparing to unpack .../12-libdeflate0_1.23-1_arm64.deb ... 279s Unpacking libdeflate0:arm64 (1.23-1) ... 279s Selecting previously unselected package libgfortran5:arm64. 279s Preparing to unpack .../13-libgfortran5_15-20250222-0ubuntu1_arm64.deb ... 279s Unpacking libgfortran5:arm64 (15-20250222-0ubuntu1) ... 279s Selecting previously unselected package libgomp1:arm64. 279s Preparing to unpack .../14-libgomp1_15-20250222-0ubuntu1_arm64.deb ... 279s Unpacking libgomp1:arm64 (15-20250222-0ubuntu1) ... 279s Selecting previously unselected package libgraphite2-3:arm64. 279s Preparing to unpack .../15-libgraphite2-3_1.3.14-2ubuntu1_arm64.deb ... 279s Unpacking libgraphite2-3:arm64 (1.3.14-2ubuntu1) ... 279s Selecting previously unselected package libharfbuzz0b:arm64. 279s Preparing to unpack .../16-libharfbuzz0b_10.2.0-1_arm64.deb ... 279s Unpacking libharfbuzz0b:arm64 (10.2.0-1) ... 279s Selecting previously unselected package x11-common. 279s Preparing to unpack .../17-x11-common_1%3a7.7+23ubuntu3_all.deb ... 279s Unpacking x11-common (1:7.7+23ubuntu3) ... 279s Selecting previously unselected package libice6:arm64. 280s Preparing to unpack .../18-libice6_2%3a1.1.1-1_arm64.deb ... 280s Unpacking libice6:arm64 (2:1.1.1-1) ... 280s Selecting previously unselected package libjpeg-turbo8:arm64. 280s Preparing to unpack .../19-libjpeg-turbo8_2.1.5-3ubuntu2_arm64.deb ... 280s Unpacking libjpeg-turbo8:arm64 (2.1.5-3ubuntu2) ... 280s Selecting previously unselected package libjpeg8:arm64. 280s Preparing to unpack .../20-libjpeg8_8c-2ubuntu11_arm64.deb ... 280s Unpacking libjpeg8:arm64 (8c-2ubuntu11) ... 280s Selecting previously unselected package liblapack3:arm64. 280s Preparing to unpack .../21-liblapack3_3.12.1-2_arm64.deb ... 280s Unpacking liblapack3:arm64 (3.12.1-2) ... 280s Selecting previously unselected package liblerc4:arm64. 280s Preparing to unpack .../22-liblerc4_4.0.0+ds-5ubuntu1_arm64.deb ... 280s Unpacking liblerc4:arm64 (4.0.0+ds-5ubuntu1) ... 280s Selecting previously unselected package libthai-data. 280s Preparing to unpack .../23-libthai-data_0.1.29-2build1_all.deb ... 280s Unpacking libthai-data (0.1.29-2build1) ... 280s Selecting previously unselected package libthai0:arm64. 280s Preparing to unpack .../24-libthai0_0.1.29-2build1_arm64.deb ... 280s Unpacking libthai0:arm64 (0.1.29-2build1) ... 280s Selecting previously unselected package libpango-1.0-0:arm64. 280s Preparing to unpack .../25-libpango-1.0-0_1.56.2-1_arm64.deb ... 280s Unpacking libpango-1.0-0:arm64 (1.56.2-1) ... 280s Selecting previously unselected package libpangoft2-1.0-0:arm64. 280s Preparing to unpack .../26-libpangoft2-1.0-0_1.56.2-1_arm64.deb ... 280s Unpacking libpangoft2-1.0-0:arm64 (1.56.2-1) ... 280s Selecting previously unselected package libpangocairo-1.0-0:arm64. 280s Preparing to unpack .../27-libpangocairo-1.0-0_1.56.2-1_arm64.deb ... 280s Unpacking libpangocairo-1.0-0:arm64 (1.56.2-1) ... 280s Selecting previously unselected package libpaper2:arm64. 280s Preparing to unpack .../28-libpaper2_2.2.5-0.3_arm64.deb ... 280s Unpacking libpaper2:arm64 (2.2.5-0.3) ... 280s Selecting previously unselected package libpaper-utils. 280s Preparing to unpack .../29-libpaper-utils_2.2.5-0.3_arm64.deb ... 280s Unpacking libpaper-utils (2.2.5-0.3) ... 280s Selecting previously unselected package libsharpyuv0:arm64. 280s Preparing to unpack .../30-libsharpyuv0_1.5.0-0.1_arm64.deb ... 280s Unpacking libsharpyuv0:arm64 (1.5.0-0.1) ... 280s Selecting previously unselected package libsm6:arm64. 280s Preparing to unpack .../31-libsm6_2%3a1.2.4-1_arm64.deb ... 280s Unpacking libsm6:arm64 (2:1.2.4-1) ... 280s Selecting previously unselected package libtcl8.6:arm64. 280s Preparing to unpack .../32-libtcl8.6_8.6.16+dfsg-1_arm64.deb ... 280s Unpacking libtcl8.6:arm64 (8.6.16+dfsg-1) ... 280s Selecting previously unselected package libjbig0:arm64. 280s Preparing to unpack .../33-libjbig0_2.1-6.1ubuntu2_arm64.deb ... 280s Unpacking libjbig0:arm64 (2.1-6.1ubuntu2) ... 280s Selecting previously unselected package libwebp7:arm64. 280s Preparing to unpack .../34-libwebp7_1.5.0-0.1_arm64.deb ... 280s Unpacking libwebp7:arm64 (1.5.0-0.1) ... 280s Selecting previously unselected package libtiff6:arm64. 281s Preparing to unpack .../35-libtiff6_4.5.1+git230720-4ubuntu4_arm64.deb ... 281s Unpacking libtiff6:arm64 (4.5.1+git230720-4ubuntu4) ... 281s Selecting previously unselected package libxft2:arm64. 281s Preparing to unpack .../36-libxft2_2.3.6-1build1_arm64.deb ... 281s Unpacking libxft2:arm64 (2.3.6-1build1) ... 281s Selecting previously unselected package libxss1:arm64. 281s Preparing to unpack .../37-libxss1_1%3a1.2.3-1build3_arm64.deb ... 281s Unpacking libxss1:arm64 (1:1.2.3-1build3) ... 281s Selecting previously unselected package libtk8.6:arm64. 281s Preparing to unpack .../38-libtk8.6_8.6.16-1_arm64.deb ... 281s Unpacking libtk8.6:arm64 (8.6.16-1) ... 281s Selecting previously unselected package libxt6t64:arm64. 281s Preparing to unpack .../39-libxt6t64_1%3a1.2.1-1.2build1_arm64.deb ... 281s Unpacking libxt6t64:arm64 (1:1.2.1-1.2build1) ... 281s Selecting previously unselected package zip. 281s Preparing to unpack .../40-zip_3.0-14ubuntu2_arm64.deb ... 281s Unpacking zip (3.0-14ubuntu2) ... 281s Selecting previously unselected package unzip. 281s Preparing to unpack .../41-unzip_6.0-28ubuntu6_arm64.deb ... 281s Unpacking unzip (6.0-28ubuntu6) ... 281s Selecting previously unselected package xdg-utils. 281s Preparing to unpack .../42-xdg-utils_1.2.1-2ubuntu1_all.deb ... 281s Unpacking xdg-utils (1.2.1-2ubuntu1) ... 281s Selecting previously unselected package r-base-core. 281s Preparing to unpack .../43-r-base-core_4.4.3-1_arm64.deb ... 281s Unpacking r-base-core (4.4.3-1) ... 281s Selecting previously unselected package r-cran-gmp. 281s Preparing to unpack .../44-r-cran-gmp_0.7-5-1_arm64.deb ... 281s Unpacking r-cran-gmp (0.7-5-1) ... 281s Selecting previously unselected package r-cran-mass. 282s Preparing to unpack .../45-r-cran-mass_7.3-64-1_arm64.deb ... 282s Unpacking r-cran-mass (7.3-64-1) ... 282s Selecting previously unselected package r-cran-polynom. 282s Preparing to unpack .../46-r-cran-polynom_1.4-1+dfsg-1_all.deb ... 282s Unpacking r-cran-polynom (1.4-1+dfsg-1) ... 282s Selecting previously unselected package r-cran-rmpfr. 282s Preparing to unpack .../47-r-cran-rmpfr_0.9-5-1_arm64.deb ... 282s Unpacking r-cran-rmpfr (0.9-5-1) ... 282s Selecting previously unselected package r-cran-sfsmisc. 282s Preparing to unpack .../48-r-cran-sfsmisc_1.1-20-1_all.deb ... 282s Unpacking r-cran-sfsmisc (1.1-20-1) ... 282s Setting up libgraphite2-3:arm64 (1.3.14-2ubuntu1) ... 282s Setting up libpixman-1-0:arm64 (0.44.0-3) ... 282s Setting up libsharpyuv0:arm64 (1.5.0-0.1) ... 282s Setting up liblerc4:arm64 (4.0.0+ds-5ubuntu1) ... 282s Setting up libxrender1:arm64 (1:0.9.10-1.1build1) ... 282s Setting up libdatrie1:arm64 (0.2.13-3build1) ... 282s Setting up libxcb-render0:arm64 (1.17.0-2) ... 282s Setting up unzip (6.0-28ubuntu6) ... 282s Setting up x11-common (1:7.7+23ubuntu3) ... 282s Setting up libdeflate0:arm64 (1.23-1) ... 282s Setting up libxcb-shm0:arm64 (1.17.0-2) ... 282s Setting up libgomp1:arm64 (15-20250222-0ubuntu1) ... 282s Setting up libjbig0:arm64 (2.1-6.1ubuntu2) ... 282s Setting up zip (3.0-14ubuntu2) ... 282s Setting up libblas3:arm64 (3.12.1-2) ... 282s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/aarch64-linux-gnu/libblas.so.3 (libblas.so.3-aarch64-linux-gnu) in auto mode 282s Setting up fonts-dejavu-mono (2.37-8) ... 282s Setting up libtcl8.6:arm64 (8.6.16+dfsg-1) ... 282s Setting up fonts-dejavu-core (2.37-8) ... 282s Setting up libjpeg-turbo8:arm64 (2.1.5-3ubuntu2) ... 282s Setting up libgfortran5:arm64 (15-20250222-0ubuntu1) ... 282s Setting up libwebp7:arm64 (1.5.0-0.1) ... 282s Setting up libharfbuzz0b:arm64 (10.2.0-1) ... 282s Setting up libthai-data (0.1.29-2build1) ... 282s Setting up libxss1:arm64 (1:1.2.3-1build3) ... 282s Setting up libpaper2:arm64 (2.2.5-0.3) ... 283s Setting up xdg-utils (1.2.1-2ubuntu1) ... 283s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 283s Setting up libjpeg8:arm64 (8c-2ubuntu11) ... 283s Setting up libice6:arm64 (2:1.1.1-1) ... 283s Setting up liblapack3:arm64 (3.12.1-2) ... 283s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/aarch64-linux-gnu/liblapack.so.3 (liblapack.so.3-aarch64-linux-gnu) in auto mode 283s Setting up fontconfig-config (2.15.0-2ubuntu1) ... 283s Setting up libpaper-utils (2.2.5-0.3) ... 283s Setting up libthai0:arm64 (0.1.29-2build1) ... 283s Setting up libtiff6:arm64 (4.5.1+git230720-4ubuntu4) ... 283s Setting up libfontconfig1:arm64 (2.15.0-2ubuntu1) ... 283s Setting up libsm6:arm64 (2:1.2.4-1) ... 283s Setting up fontconfig (2.15.0-2ubuntu1) ... 285s Regenerating fonts cache... done. 285s Setting up libxft2:arm64 (2.3.6-1build1) ... 285s Setting up libtk8.6:arm64 (8.6.16-1) ... 285s Setting up libpango-1.0-0:arm64 (1.56.2-1) ... 285s Setting up libcairo2:arm64 (1.18.2-2) ... 285s Setting up libxt6t64:arm64 (1:1.2.1-1.2build1) ... 285s Setting up libpangoft2-1.0-0:arm64 (1.56.2-1) ... 285s Setting up libpangocairo-1.0-0:arm64 (1.56.2-1) ... 285s Setting up r-base-core (4.4.3-1) ... 285s Creating config file /etc/R/Renviron with new version 285s Setting up r-cran-polynom (1.4-1+dfsg-1) ... 285s Setting up r-cran-gmp (0.7-5-1) ... 285s Setting up r-cran-sfsmisc (1.1-20-1) ... 285s Setting up r-cran-mass (7.3-64-1) ... 285s Setting up r-cran-rmpfr (0.9-5-1) ... 285s Processing triggers for libc-bin (2.41-1ubuntu2) ... 285s Processing triggers for man-db (2.13.0-1) ... 287s Processing triggers for install-info (7.1.1-1) ... 288s autopkgtest [15:56:43]: test run-unit-test: [----------------------- 289s BEGIN TEST arith-ex.R 289s 289s R version 4.4.3 (2025-02-28) -- "Trophy Case" 289s Copyright (C) 2025 The R Foundation for Statistical Computing 289s Platform: aarch64-unknown-linux-gnu 289s 289s R is free software and comes with ABSOLUTELY NO WARRANTY. 289s You are welcome to redistribute it under certain conditions. 289s Type 'license()' or 'licence()' for distribution details. 289s 289s R is a collaborative project with many contributors. 289s Type 'contributors()' for more information and 289s 'citation()' on how to cite R or R packages in publications. 289s 289s Type 'demo()' for some demos, 'help()' for on-line help, or 289s 'help.start()' for an HTML browser interface to help. 289s Type 'q()' to quit R. 289s 289s > require("Rmpfr") 289s Loading required package: Rmpfr 289s Loading required package: gmp 289s 289s Attaching package: ‘gmp’ 289s 289s The following objects are masked from ‘package:base’: 289s 289s %*%, apply, crossprod, matrix, tcrossprod 289s 289s C code of R package 'Rmpfr': GMP using 64 bits per limb 289s 289s 289s Attaching package: ‘Rmpfr’ 289s 289s The following object is masked from ‘package:gmp’: 289s 289s outer 289s 289s The following objects are masked from ‘package:stats’: 289s 289s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 289s 289s The following objects are masked from ‘package:base’: 289s 289s cbind, pmax, pmin, rbind 289s 289s > ## includes ("gmp")# want to check "mixed arithmetic" too __ TODO __ 289s > 289s > `%=N=%` <- function(x,y) (x == y) | (is.na(x) & is.na(y)) 289s > all.EQ <- function(x,y, tolerance = 2^-98, ...) # very small tol. for MPFR 289s + all.equal(x, y, tolerance=tolerance, ...) 289s > warningI <- function(...) warning(..., immediate. = TRUE) 289s > 289s > unlist(.Platform) 289s OS.type file.sep dynlib.ext GUI endian pkgType path.sep 289s "unix" "/" ".so" "X11" "little" "source" ":" 289s r_arch 289s "" 289s > 289s > ## Check that we got the "which.*" methods also from "bigq": 289s > bcl <- c("ANY", "bigq", "bigz", "mpfr") 289s > ##if(packageVersion("gmp") >= "0.5-8") { 289s > stopifnot(identical(bcl, 289s + sort(unlist(findMethods("which.max")@signatures))), 289s + identical(bcl, 289s + sort(unlist(findMethods("which.min")@signatures)))) 289s > ##} 289s > 289s > options(warn = 1)# warnings *immediately* 289s > (doExtras <- Rmpfr:::doExtras()) 289s [1] FALSE 289s > eps2 <- 2 * .Machine$double.eps 289s > eps8 <- 8 * .Machine$double.eps 289s > eps32 <- 32 * .Machine$double.eps 289s > 289s > ## must take the *larger* of the two precisions: 289s > stopifnot(substr(format(mpfr(1, 60)/mpfr(7, 160)), 1,51) == # format() may show more digits 289s + "0.1428571428571428571428571428571428571428571428571")# again has extra "2" at end 289s > 289s > (x <- mpfr(0:7, 100) / 7) 289s 8 'mpfr' numbers of precision 100 bits 290s [1] 0 0.14285714285714285714285714285711 290s [3] 0.28571428571428571428571428571423 0.42857142857142857142857142857154 290s [5] 0.57142857142857142857142857142846 0.71428571428571428571428571428538 290s [7] 0.85714285714285714285714285714308 1 290s > ix <- x^-1000 290s > iX <- asNumeric(ix) 290s > 290s > stopifnot( mpfrIs0(x - x), # badly failed on 64-bit 290s + identical(-x, 0-x),# testing "- x" 290s + all.equal(ix, (1/x)^1000, tol= 1e-25), 290s + is.numeric(iX), iX[1:4] == Inf, # failed previously as we used RNDD (downward rounding) 290s + all.equal(log(iX[5:8]), c(559.6157879, 336.4722366, 154.1506798, 0), 290s + tol = 1e-9)) 290s > 290s > ## checking hexadecimal input : 290s > stopifnot(mpfr("0xFFFFFFFFFFFFFFFFFFFF", base=16) + 1 == 2^80, 290s + ## sign(0) == 0: 290s + identical(sign(as(-1:1, "mpfr")), -1:1 + 0)) 290s > 290s > stopifnot(all.equal(as.numeric(x+ 1L), 290s + as.numeric(x)+1L, tol = eps2), 290s + as.integer( x [x < 1]) == 0,# was *wrong* {we round()ed; previously "down"!} 290s + as.integer((-x)[x < 1]) == 0,# (ditto) 290s + (3 * x)/3 <= x, 290s + all.equal(as.numeric(x * 2L), 290s + as.numeric(x + x), tol = 0)) 290s > 290s > u <- mpfr(0:17, 128)/17 290s > two <- mpfr(2,100) 290s > stopifnot(all.EQ(u ^ two, u ^ 2), 290s + identical(u ^ 2, u ^ 2L), 290s + all.EQ(two ^ u, 2 ^ u), 290s + identical(2 ^ u, 2L ^ u), 290s + floor (3*u) == floor (3/17*(0:17)), 290s + ceiling(u*5) == ceiling(5/17*(0:17)) 290s + ) 290s > 290s > i7 <- mpfr(0:7, 200)/ 7 290s > i17 <- mpfr(0:17, 300)/17 290s > stopifnot(all.equal(as.numeric(x+1), 290s + as.numeric(x)+1), 290s + all.equal(round(x,2), round(asNumeric(x), 2), tol=1e-15), 290s + all.equal(round(mpfr(1.152, 80), 2), 1.15), # was wrong {as.integer() bug} 290s + all.equal(0:7, 7 * round ( i7, 25), tol = 2e-25), 290s + all.equal(0:7, 7 * round ( i7, 50), tol = 2e-50), 290s + all.equal(0:17, 17 * signif(i17,100), tol = 2e-100), 290s + all.equal(0:17, 17 * signif(i17, 20), tol = 2e-20) 290s + ) 290s > 290s > ## When we compute with 100 bits, 290s > ## we should compare relative errors with 2^-100 : 290s > del <- abs((x+pi)-pi - x) / 2^-100 290s > stopifnot(del <= 4) ## <= 2 already 290s > (fd <- format(del, drop0 = TRUE)) 290s [1] "0" "1.75" "0.5" "1" "1" "1" "2" "0" 290s > stopifnot(all.equal(as.numeric(del), 290s + as.numeric(fd), tol = 1e-15)) 290s > if(print(Sys.info()[["machine"]]) == "x86_64") 290s + stopifnot(fd %in% as.character(c(0:2, c(2,7)/4))) 290s [1] "aarch64" 290s > 290s > 290s > checkPmin <- function(x, nx = as(x, "numeric")) { 290s + rx <- if(is(x,"mpfr")) round(x, 25) else x 290s + isZ <- is(x, "bigz") || is(nx, "bigz") 290s + M.X <- max(x, na.rm=TRUE) 290s + m.x <- min(x, na.rm=TRUE) 290s + stopifnot(all.equal(x, nx), 290s + pmin(x, x, M.X) %=N=% x, x %=N=% pmax(x, m.x, x), 290s + all.equal(x, pmin(x, nx, x, M.X)), 290s + all.equal(x, pmax(m.x, nx, x, rx, m.x)), 290s + if(isZ)TRUE else all.equal(pmin(x, 0.75), pmin(nx, 0.75)), 290s + if(isZ)TRUE else all.equal(pmax(x, 0.25), pmax(nx, 0.25))) 290s + } 290s > 290s > x <- mpfr(0:7, 100) / 7 290s > checkPmin(x) 290s > 290s > nx <- (0:7)/7 290s > (qx <- as.bigq(0:7, 7)) 290s Big Rational ('bigq') object of length 8: 290s [1] 0 1/7 2/7 3/7 4/7 5/7 6/7 1 290s > x[c(2,5)] <- NA 290s > nx[c(2,5)] <- NA 290s > qx[c(2,5)] <- NA 290s > 290s > Z <- as.bigz(1:7) 290s > mZ <- mpfr(Z, 64) 290s > stopifnot(Z == mZ, mZ == Z) 290s > 290s > checkPmin(x, nx) 290s > cat("checking pmin(. bigq ): ") 290s checking pmin(. bigq ): > ## FIXME checkPmin(x, qx); cat("[Ok]\n") 290s > ## 290s > print( base::pmin(Z, Z, max(Z)) )# via gmp:: rep.bigz(x, length.out = *) 290s Big Integer ('bigz') object of length 7: 290s [1] 1 2 3 4 5 6 7 290s > cat("checking pmin(. bigz ) 290s + [currently with lots of pmin() and pmax(...) warnings 'incompatible methods]:\n ") 290s checking pmin(. bigz ) 290s [currently with lots of pmin() and pmax(...) warnings 'incompatible methods]: 290s > checkPmin(Z); cat("[Ok]\n") # via gmp:: all.equal.bigz() 290s [Ok] 290s > 290s > stopifnot(all.equal( round(x, 10), round(nx, 10)), 290s + all.equal(signif(x, 10), signif(nx, 10))) 290s > 290s > ## L & x , x & L failed in Rmpfr 0.2* and 0.4-2 290s > stopifnot(identical(L <- x > 0.5, L & x), 290s + identical(L, x & L), 290s + identical(x > 0, x | L)) 290s > 290s > ## Summary() methods {including NA 290s > stopifnot(exprs = { 290s + is.na(min(x)) 290s + is.na(max(x)) 290s + is.na(range(x)) 290s + is.na(sum(x)) 290s + is.na(prod(x)) 290s + min(x, na.rm=TRUE) == 0 290s + max(x, na.rm=TRUE) == 1 290s + range(x, na.rm=TRUE) == 0:1 290s + all.equal(sum (x, na.rm=TRUE)*7, 2+3+5+6+7, tolerance = 1e-28) # 1.0975e-30 290s + prod(x, na.rm=TRUE) == 0 290s + all.equal(180, prod(x[-1], na.rm=TRUE)*7^4, tol = 1e-15) # 1.579e-16 290s + ## 290s + ## all(), any() had memory bug [PROTECT missing, but more, somehow] 290s + !all(x) 290s + is.na( all(x[-1]) ) 290s + any(x) 290s + is.na(any(x[c(2,5)])) 290s + ## do these *twice* {that triggered R-forge bug #6764 } 290s + ! all(x, na.rm=TRUE) 290s + any(x, na.rm=TRUE) 290s + ## 290s + ! all(x, na.rm=TRUE) 290s + any(x, na.rm=TRUE) 290s + }) 290s > 290s > ##-------------- Modulo and "integer division" ------------- 290s > 290s > ## R's ?Arithmetic : 290s > ## 290s > ## ‘%%’ indicates ‘x mod y’ and ‘%/%’ indicates integer division. It 290s > ## is guaranteed that ‘x == (x %% y) + y * ( x %/% y )’ (up to 290s > ## rounding error) unless ‘y == 0’ where the result of ‘%%’ is 290s > ## ‘NA_integer_’ or ‘NaN’ (depending on the ‘typeof’ of the 290s > ## arguments). 290s > ## 290s > ## and has 'details' about how non-integer 'y' works 290s > ## 290s > (N <- if(doExtras) 1000 else 200) 290s [1] 200 290s > (todays.seed <- eval(parse(text=Sys.Date())))# so this is reproducible 290s [1] 20162 290s > # (and constant within one day) 290s > set.seed(todays.seed) 290s > mm <- c(-4:4, sample(50, N-9, replace=TRUE)) 290s > for(n in seq_len(N)) { 290s + cat("."); if(n %% 50 == 0) cat(n,"\n") 290s + m <- mm[n] 290s + prec <- sample(52:200, 1)# "high precision" ==> can use small tol 290s + x <- sample(100, 50) - 20 290s + for(kind in c('int','real')) { 290s + if(kind == "real") { 290s + m <- jitter(m) 290s + x <- jitter(x) 290s + tol.1 <- eps32 * pmax(1, 1/abs(m)) 290s + EQ <- function(x,y, tol = tol.1) 290s + isTRUE(all.equal(x, as.numeric(y), tol=tol)) 290s + EQ2 <- function(x,y, tol = tol.1) { 290s + ## for the DIV - MOD identity, a small x leads to cancellation 290s + all((x %=N=% y) | abs(x - y) < tol*pmax(abs(x), 1)) || 290s + isTRUE(all.equal(x, as.numeric(y), tol=tol)) 290s + } 290s + } else { ## "integer" 290s + EQ2 <- EQ <- function(x,y, tol) all(x %=N=% y) 290s + } 290s + i.m <- mpfr(x, prec) %% mpfr(m, prec) 290s + if(!EQ2(x %% m, i.m)) { 290s + cat("\n -- m = ",m," (prec = ",prec,")\n") 290s + rE <- range(rel.E <- as.numeric(1 - (x %% m)/i.m)) 290s + print(cbind(x, 'R.%%' = x %% m, rel.E)) 290s + MSG <- if(max(abs(rE)) < 1e-10) warningI else stop 290s + MSG(sprintf("not all equal: range(rel.Err.) = [%g, %g]", rE[1],rE[2])) 290s + } 290s + ## 290s + if(m != 0) { 290s + ##---Check the x == (x %% m) + m * ( x %/% m ) assertion ------ 290s + ## 290s + if(EQ2(x, (x %% m) + m*( x %/% m ), tol = 1e-12)) { ## ok for R 290s + ## --> also ok for mpfr ? 290s + iDm <- mpfr(x, prec) %/% mpfr(m, prec) 290s + rhs <- i.m + m*iDm 290s + if(!EQ2(x, i.m + m*iDm)) { 290s + cat("\n -- m = ",m," (prec = ",prec,")\n") 290s + print(cbind(x,' MPFR[ x%%m + m(x %/% m) ]' = as.numeric(rhs), rel.E)) 290s + MSG <- if(max(abs(rE)) < 1e-10) warningI else stop 290s + MSG(sprintf("Identity(MOD - DIV) not all eq.: range(rel.Err.) = [%g, %g]", 290s + rE[1],rE[2])) 290s + } 290s + } else { 290s + cat("\n hmm.. the basic %% <-> %/% assertion 'fails' in *R* :\n") 290s + rhs <- (x %% m) + m * ( x %/% m ) 290s + rel.E <- (1 - rhs/x) 290s + print(cbind(x, 'x%%m + m(x %/% m)' = rhs, rel.E)) 290s + } 290s + } 290s + } 290s + } 292s ..................................................50 293s ..................................................100 294s ..................................................150 296s ..................................................200 296s > 296s > ## mpfr o now implemented, for '%%', too : 296s > r <- as.double(i <- -10:20) 296s > 296s > stopifnot( 296s + ## %% ------------------------------------- 296s + mpfr(i, prec=99) %% 7 == i %% 7 296s + , ## 296s + mpfr(i, prec=99) %% 7 == 296s + mpfr(i, prec=99) %% 7L 296s + , ## 296s + i %% mpfr(27, prec=99) == i %% 27 296s + , ## 296s + r %% mpfr(27, prec=99) == r %% 27 296s + , ## %/% ------------------------------------- 296s + mpfr(i, prec=99) %/% 7 == i %/% 7 296s + , ## 296s + mpfr(i, prec=99) %/% 7 == 296s + mpfr(i, prec=99) %/% 7L 296s + , ## 296s + mpfr(i, prec=99) %/% mpfr(27, prec=99) == i %/% 27 296s + , ## 296s + i %/% mpfr(27, prec=99) == i %/% 27 296s + , ## 296s + i %/% mpfr(27, prec=99) == 296s + r %/% mpfr(27, prec=99) 296s + , TRUE ## 296s + ) 296s > 296s > cat('Time elapsed: ', proc.time(),'\n') # "stats" 296s Time elapsed: 6.89 0.144 7.058 0 0.009 296s > 296s > ## Was reproducible BUG in Rmpfr-addition (on Linux, MPFR 4.x.y) -- ## but the bug was Rmpfr, 296s > ## in ../src/Ops.c, detecting if *integer*, i.e., long can be used 296s > dn <- 1e20 296s > dOO <- 9223372036854775808; formatC(dOO) # "9.2...e18" 296s [1] "9.223e+18" 296s > (r <- dn / (dn + dOO)) # 0.915555 (double prec arithmetic) 296s [1] 0.915555 296s > ## but *so* strange when switching to Rmpfr : addition accidentally *subtract*!! 296s > n <- mpfr(dn, precBits = 99) 296s > (rM <- n / (n + dOO)) # wrongly gave " 1 'mpfr' .... 99 bits; 1.101605140483951..... 296s 1 'mpfr' number of precision 99 bits 296s [1] 0.9155549598510603318013907353116 296s > stopifnot(exprs = { 296s + all.equal(n + dOO, dn + dOO) 296s + all.equal(n / (n + dOO), r) 296s + }) 296s > 296s > ## log(., base) : 296s > (ten40 <- as.bigz(10)^40) 296s Big Integer ('bigz') : 296s [1] 10000000000000000000000000000000000000000 296s > ten40m <- mpfr(ten40) 296s > (lt40 <- log(ten40m, 10)) # gave Error in ... : base != exp(1) is not yet implemented 296s 1 'mpfr' number of precision 133 bits 296s [1] 40 296s > ## 'mpfr' .. 133 bits \\ [1] 40 296s > stopifnot(exprs = { 296s + grepl("^40[.]000+$", print(format(lt40, digits = 60))) 296s + identical(lt40, log10(ten40m)) 296s + identical(log(ten40m, 2), log2(ten40m)) 296s + inherits(Pi <- Const("pi", 140), "mpfr") 296s + all.equal(show(log(ten40m, Pi)), 296s + log(ten40m)/log(Pi), tol = 1e-40) 296s + }) 296s [1] "40.0000000000000000000000000000000000000000000000000000000000" 296s 1 'mpfr' number of precision 133 bits 296s [1] 80.45863470352243755058888189154834786778 296s > 296s > 296s > 296s > ###------Standard Statistics Functions -------------------------------------------------------- 296s > 296s > x <- c(del, 1000) 296s > stopifnot(identical(mean(x), mean(x, trim=0))) 296s > for(tr in (0:8)/16) 296s + stopifnot(all.equal(mean( x, trim = tr), 296s + mean(asNumeric(x), trim = tr), tol=1e-15)) 296s > 296s > cat('Time elapsed: ', proc.time(),'\n') # "stats" 296s Time elapsed: 7.038 0.146 7.212 0 0.009 296s > 296s BEGIN TEST binomial-etc.R 296s 296s R version 4.4.3 (2025-02-28) -- "Trophy Case" 296s Copyright (C) 2025 The R Foundation for Statistical Computing 296s Platform: aarch64-unknown-linux-gnu 296s 296s R is free software and comes with ABSOLUTELY NO WARRANTY. 296s You are welcome to redistribute it under certain conditions. 296s Type 'license()' or 'licence()' for distribution details. 296s 296s R is a collaborative project with many contributors. 296s Type 'contributors()' for more information and 296s 'citation()' on how to cite R or R packages in publications. 296s 296s Type 'demo()' for some demos, 'help()' for on-line help, or 296s 'help.start()' for an HTML browser interface to help. 296s Type 'q()' to quit R. 296s 296s > stopifnot(require("Rmpfr")) 296s Loading required package: Rmpfr 296s Loading required package: gmp 296s 296s Attaching package: ‘gmp’ 296s 296s The following objects are masked from ‘package:base’: 296s 296s %*%, apply, crossprod, matrix, tcrossprod 296s 297s C code of R package 'Rmpfr': GMP using 64 bits per limb 297s 297s 297s Attaching package: ‘Rmpfr’ 297s 297s > 297s > n <- 10000 + 0:10 297s > stopifnot(exprs = { 297s + chooseMpfr(1:10, 0) == 1 # failed earlier 297s + chooseMpfr(20, 0:20) == choose(20, 0:20) 297s + chooseMpfr(19, 0:20) == choose(19, 0:20) 297s + chooseMpfr (30, 4:30) * (-1)^(4:30) == 297s + chooseMpfr.all(30, k0=4, alternating=TRUE) 297s + chooseMpfr(mpfr(1111, 2^8), 1111) == 1 297s + chooseMpfr(mpfr(n,256), n ) == 1 # was wrong in <= 2023 297s + chooseMpfr(mpfr(n,256), n-1) == n # " " 297s + }) 297s The following object is masked from ‘package:gmp’: 297s 297s outer 297s 297s The following objects are masked from ‘package:stats’: 297s 297s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 297s 297s The following objects are masked from ‘package:base’: 297s 297s cbind, pmax, pmin, rbind 297s 297s > cat('Time elapsed: ', proc.time(),'\n') # "stats" 297s Time elapsed: 0.786 0.061 0.844 0.001 0.009 297s > 297s > ## sumBinomMpfr() ... had embarrasing bug for a while 297s > sBn <- Rmpfr:::sumBinomMpfr.v1 297s > stopifnot( 297s + all.equal( sBn(10, sqrt), 297s + sumBinomMpfr(10, sqrt), tol=1e-77) , 297s + all.equal( sBn(10, log, n0=1, alternating=FALSE), 297s + sumBinomMpfr(10, log, n0=1, alternating=FALSE), tol=1e-77) 297s + ) 297s > 297s > fBin <- function(k) x^k * (1-x)^(n-k) 297s > ## \sum_{k=0}^n (n \\ k) x^k (1-x)^{n-k} == sum(dbinom(0:n, n, prob=x)) == 1 : 297s > for(x in runif(50)) { 297s + n <- 1 + rpois(1, lambda=10) 297s + cat(".") 297s + stopifnot(all.equal(1, sumBinomMpfr(n, fBin, alternating=FALSE), 297s + tol = 1e-15)) 297s + };cat("\n") 297s .................................................. 297s > 297s > 297s > cat('Time elapsed: ', proc.time(),'\n') # "stats" 297s Time elapsed: 1.398 0.09 1.494 0.001 0.009 297s > 297s > if(!interactive()) warnings() 297s > 297s BEGIN TEST bit-repr.R 297s 297s R version 4.4.3 (2025-02-28) -- "Trophy Case" 297s Copyright (C) 2025 The R Foundation for Statistical Computing 297s Platform: aarch64-unknown-linux-gnu 297s 297s R is free software and comes with ABSOLUTELY NO WARRANTY. 297s You are welcome to redistribute it under certain conditions. 297s Type 'license()' or 'licence()' for distribution details. 297s 297s R is a collaborative project with many contributors. 297s Type 'contributors()' for more information and 297s 'citation()' on how to cite R or R packages in publications. 297s 297s Type 'demo()' for some demos, 'help()' for on-line help, or 297s 'help.start()' for an HTML browser interface to help. 297s Type 'q()' to quit R. 297s 298s > stopifnot(suppressPackageStartupMessages(require("Rmpfr"))) 298s > ## (checking that the 32 / 64 bit GMP message does *not* show here) 298s > 298s > ### Try to look at the internal bit-representation of the limbs 298s > 298s > .limbs <- function(x) { 298s + stopifnot(is(x, "mpfr")) 298s + lapply(x@.Data, slot, "d") # not sapply() each can have different prec. & #{limbs} 298s + } 298s > .expo <- function(x) { 298s + stopifnot(is(x, "mpfr")) 298s + sapply(x@.Data, slot, "exp") 298s + } 298s > 298s > Bits <- function(x) { 298s + L <- .limbs(x)# list(length n) each of "k(prec)" 32-bit ints 298s + ## NB: mpfr(2, .) and all mpfr(2^k, .) also have a 'd' ending in NA integer! 298s + ## [reason: after all, R's NA_integer_ is INT_MAX+1 = 2^31 ] 298s + ## and the mpfr(c(NA,NaN, Inf, -Inf), .) have *no* NA in 'd' (but all in 'exp'! 298s + ## see .mpfr2list() example below 298s + 298s + hasNA <- any(iNA <- sapply(lapply(L, is.na), any)) # iNA: TRUE if there's an NA 298s + ## need to catch them later 298s + CC <- function(ch) paste(ch, collapse="") 298s + hex <- sapply(L, function(.) CC(sprintf("%x", rev(.)))) 298s + if(hasNA) hex[iNA] <- NA_character_ 298s + hex <- strsplit(hex, NULL) 298s + 298s + db <- t(expand.grid(0:1,0:1,0:1,0:1, KEEP.OUT.ATTRS=FALSE)[,4:1]) 298s + storage.mode(db) <- "character" # "0" or "1" 298s + dimnames(db) <- list(NULL, c(paste(0:9), letters[1:6])) 298s + ## db is 4 x 16 matrix with col.names "0" "1" .. "9" "a" "b" ... "f" 298s + 298s + ex <- .expo(x) 298s + if(is.matrix(ex)) { 298s + ## 64-bit case: exponent is long == two ints 298s + ## ----------- the 2nd int is in {0, -1, NA} (NA : for 0) 298s + ex2 <- ex[2,] 298s + ex <- ex[1,] 298s + } 298s + pat <- paste("(", sapply(pmax(0, ex), 298s + function(n) CC(rep.int(".", n))), 298s + ")0+$", sep="") 298s + ## pat <- ifelse(iNA, NA_character_, pat) 298s + 298s + getbits <- function(ch) CC(as.vector(db[,ch])) 298s + 298s + ## drop trailing zeros (from r[[i]], via pat[i]), keeping correct number: 298s + drop0.r <- function(i) sub(pat[i], "\\1", r[[i]]) 298s + 298s + if(hasNA) { 298s + r <- as.list(iNA) 298s + r[!iNA] <- lapply(hex[!iNA], getbits) 298s + r[!iNA] <- lapply(which(!iNA), drop0.r) 298s + ## FIXME this is wrong -- really have powers of 2, and want their (easy) bits : 298s + r[iNA ] <- NA_character_ 298s + unlist(r) 298s + } 298s + else { 298s + r <- lapply(hex, getbits) 298s + sapply(seq_along(r), drop0.r) 298s + } 298s + 298s + } 298s > 298s > x <- mpfr(r <- c(NA,NaN, Inf, -Inf), 64) 298s > stopifnot(identical(asNumeric(x), # mpfr has no NA, just NaN's: 298s + c(NaN,NaN, Inf, -Inf)), 298s + identical(as.character(fDec <- formatDec(x)), 298s + as.character(asNumeric(x))) # of different nchar() for now 298s + ) 298s > formatDec(x) # should print fine (no quotes) 298s [1] NaN NaN Inf -Inf 298s > 298s > 298s > if(FALSE) # platform dependent: 298s + ## The "non-finite" mpfr value internals (in 64-bit: 'exp' has NA): 298s + str(.mpfr2list(x)) 298s > 298s > 298s > ## bug in Bits(): all (exact) powers of 2 will show as NA: 298s > 298s > x <- mpfr(c(3:5,11:16, 59, 125:128, 1024:1025), 64) 298s > x 298s 16 'mpfr' numbers of precision 64 bits 298s [1] 3 4 5 11 12 13 14 15 16 59 125 126 127 128 1024 298s [16] 1025 298s > data.frame(x= as.numeric(x), I(Bits(x))) 298s x Bits.x. 298s 1 3 11 298s 2 4 298s 3 5 101 298s 4 11 1011 298s 5 12 1100 298s 6 13 1101 298s 7 14 1110 298s 8 15 1111 298s 9 16 298s 10 59 111011 298s 11 125 1111101 298s 12 126 1111110 298s 13 127 1111111 298s 14 128 298s 15 1024 298s 16 1025 10000000001 298s > 298s > x <- mpfr(c(-20:-1, 1:30),64)# w/o 0 - as its mantissa is "random" (in 64-bit) 298s > data.frame(x= as.numeric(x), I(Bits(x))) 298s x Bits.x. 298s 1 -20 10100 298s 2 -19 10011 298s 3 -18 10010 298s 4 -17 10001 298s 5 -16 298s 6 -15 1111 298s 7 -14 1110 298s 8 -13 1101 298s 9 -12 1100 298s 10 -11 1011 298s 11 -10 1010 298s 12 -9 1001 298s 13 -8 298s 14 -7 111 298s 15 -6 110 298s 16 -5 101 298s 17 -4 298s 18 -3 11 298s 19 -2 298s 20 -1 298s 21 1 298s 22 2 298s 23 3 11 298s 24 4 298s 25 5 101 298s 26 6 110 298s 27 7 111 298s 28 8 298s 29 9 1001 298s 30 10 1010 298s 31 11 1011 298s 32 12 1100 298s 33 13 1101 298s 34 14 1110 298s 35 15 1111 298s 36 16 298s 37 17 10001 298s 38 18 10010 298s 39 19 10011 298s 40 20 10100 298s 41 21 10101 298s 42 22 10110 298s 43 23 10111 298s 44 24 11000 298s 45 25 11001 298s 46 26 11010 298s 47 27 11011 298s 48 28 11100 298s 49 29 11101 298s 50 30 11110 298s > b0 <- Bits(mpfr(0, 64)) # not printing it here -- they are "random" for this special case! 298s > 298s > (half <- mpfr(0.5, 64)*(1 + mpfr(2, 64)^-16 * (-3:3))) 298s 7 'mpfr' numbers of precision 64 bits 298s [1] 0.49997711181640625 0.4999847412109375 0.49999237060546875 298s [4] 0.5 0.50000762939453125 0.5000152587890625 298s [7] 0.50002288818359375 298s > Bits(half) 298s [1] "1111111111111101" "111111111111111" "1111111111111111" 298s [4] NA "10000000000000001" "1000000000000001" 298s [7] "10000000000000011" 298s > 298s > ## pi, in varying number of bits : 298s > p. <- round(pi* 2^c(10,16,5*(4:8))) 298s > dput(p.)#-> the definition of p : 298s c(3217, 205887, 3294199, 105414357, 3373259426, 107944301636, 298s 3454217652358) 298s > p <- mpfr(c(3217, 205887, 3294199, 105414357, 298s + 3373259426, 107944301636, 3454217652358), 64) 298s > stopifnot(all.equal(p., p, tolerance = 1e-15)) 298s > ## all the mantissas are those of pi, rounded differently: 298s > Bits(c(p, Const("pi", 64))) 299s [1] "110010010001" 299s [2] "110010010000111111" 299s [3] "1100100100001111110111" 299s [4] "110010010000111111011010101" 299s [5] "11001001000011111101101010100010" 299s [6] "1100100100001111110110101010001000100" 299s [7] "110010010000111111011010101000100010000110" 299s [8] "1100100100001111110110101010001000100001011010001100001000110101" 299s > 299s > ###--- and possibly the _internal_ sprintfMpfr() --- see also ./tstHexBin.R 299s > ## TODO: use examples above for checking formatBin() <---> ============ 299s > spr <- Rmpfr:::sprintfMpfr 299s > ##= ~~~~~~~~~~~ 299s > (fB.04 <- formatBin(i16.04 <- mpfr(0:16, 4))) 299s [1] +0b0.000p+0 +0b1.000p+0 +0b1.000p+1 +0b1.100p+1 +0b1.000p+2 +0b1.010p+2 299s [7] +0b1.100p+2 +0b1.110p+2 +0b1.000p+3 +0b1.001p+3 +0b1.010p+3 +0b1.011p+3 299s [13] +0b1.100p+3 +0b1.101p+3 +0b1.110p+3 +0b1.111p+3 +0b1.000p+4 299s > (fB.60 <- formatBin(i16.60 <- mpfr(0:16, 60))) 299s [1] +0b0.00000000000000000000000000000000000000000000000000000000000p+0 299s [2] +0b1.00000000000000000000000000000000000000000000000000000000000p+0 299s [3] +0b1.00000000000000000000000000000000000000000000000000000000000p+1 299s [4] +0b1.10000000000000000000000000000000000000000000000000000000000p+1 299s [5] +0b1.00000000000000000000000000000000000000000000000000000000000p+2 299s [6] +0b1.01000000000000000000000000000000000000000000000000000000000p+2 299s [7] +0b1.10000000000000000000000000000000000000000000000000000000000p+2 299s [8] +0b1.11000000000000000000000000000000000000000000000000000000000p+2 299s [9] +0b1.00000000000000000000000000000000000000000000000000000000000p+3 299s [10] +0b1.00100000000000000000000000000000000000000000000000000000000p+3 299s [11] +0b1.01000000000000000000000000000000000000000000000000000000000p+3 299s [12] +0b1.01100000000000000000000000000000000000000000000000000000000p+3 299s [13] +0b1.10000000000000000000000000000000000000000000000000000000000p+3 299s [14] +0b1.10100000000000000000000000000000000000000000000000000000000p+3 299s [15] +0b1.11000000000000000000000000000000000000000000000000000000000p+3 299s [16] +0b1.11100000000000000000000000000000000000000000000000000000000p+3 299s [17] +0b1.00000000000000000000000000000000000000000000000000000000000p+4 299s > stopifnot( 299s + identical(sub("00p","p", spr(i16.60, bits = 10)), 299s + spr(i16.60, bits = 4)), 299s + identical(spr(i16.60, bits = 4), 299s + spr(i16.04, bits = 4)) 299s + , 299s + all.equal(i16.04, mpfr(fB.04), tolerance = 0) 299s + , 299s + all.equal(i16.60, mpfr(fB.60), tolerance = 0) 299s + ) 299s > 299s > ## not even this one 299s > two <- mpfr(2, precBits = 60) 299s > stopifnot(identical(two, mpfr(formatBin(two)))) 299s > 299s > 299s > cat('Time elapsed: ', proc.time(),'\n') # "stats" 299s Time elapsed: 1.087 0.064 1.155 0.002 0.006 299s > 299s > if(!interactive()) warnings() 299s > 299s BEGIN TEST create.R 299s 299s R version 4.4.3 (2025-02-28) -- "Trophy Case" 299s Copyright (C) 2025 The R Foundation for Statistical Computing 299s Platform: aarch64-unknown-linux-gnu 299s 299s R is free software and comes with ABSOLUTELY NO WARRANTY. 299s You are welcome to redistribute it under certain conditions. 299s Type 'license()' or 'licence()' for distribution details. 299s 299s R is a collaborative project with many contributors. 299s Type 'contributors()' for more information and 299s 'citation()' on how to cite R or R packages in publications. 299s 299s Type 'demo()' for some demos, 'help()' for on-line help, or 299s 'help.start()' for an HTML browser interface to help. 299s Type 'q()' to quit R. 299s 299s > require("Rmpfr") 299s Loading required package: Rmpfr 299s Loading required package: gmp 299s 299s Attaching package: ‘gmp’ 299s 299s The following objects are masked from ‘package:base’: 299s 299s %*%, apply, crossprod, matrix, tcrossprod 299s 299s C code of R package 'Rmpfr': GMP using 64 bits per limb 299s 299s 299s Attaching package: ‘Rmpfr’ 299s 299s The following object is masked from ‘package:gmp’: 299s 299s outer 299s 299s The following objects are masked from ‘package:stats’: 299s 299s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 299s 299s > 299s The following objects are masked from ‘package:base’: 299s 299s cbind, pmax, pmin, rbind 299s 299s > ### Simple basic examples of creation of "mpfr" objects 299s > 299s > pi. <- Const("pi", prec = 260) 299s > pi. # nicely prints 80 digits [260 * log10(2) ~= 78.3 ~ 80] 299s 1 'mpfr' number of precision 260 bits 299s [1] 3.1415926535897932384626433832795028841971693993751058209749445923078164062862088 299s > 299s > ## These both failed (in mpfr2str(.)) with a seg.fault: 299s > c(mpfr(1, prec=3), pi.) 299s 2 'mpfr' numbers of precision 3 .. 260 bits 300s [1] 1 300s [2] 3.1415926535897932384626433832795028841971693993751058209749445923078164062862088 300s > m0 <- mpfr(numeric(), prec=64) 300s > ## print()ing / str() of 0-length mpfr 300s > stopifnot( 300s + grepl("0 'mpfr' numbers", capture.output( m0)), 300s + grepl("0 'mpfr' numbers", capture.output(str(m0)))) 300s > 300s > c(m0,m0) # failed in Rmpfr <= 0.6-0 300s 0 'mpfr' numbers 300s > stopifnot(identical(c(m0,m0), m0), 300s + identical(c(m0,pi.), pi.), 300s + identical(c(pi.,m0), pi.)) 300s > 300s > ## This is TRUE for 0 and -0 : 300s > Zero <- mpfr(c(0,1/-Inf), 20) 300s > stopifnot(mpfrIs0(Zero), is.whole(Zero)) 300s > stopifnot(mpfr.is.0(Zero))# deprecated but must work 300s > stopifnot(mpfr.is.integer(Zero))# deprecated but must work 300s > Warning message: 300s In mpfr.is.0(Zero) : 'mpfr.is.0' is deprecated. 300s Use 'mpfrIs0' instead. 300s See help("Deprecated") 300s Warning message: 300s In mpfr.is.integer(Zero) : 'mpfr.is.integer' is deprecated. 300s Use '.mpfr.is.whole' instead. 300s See help("Deprecated") 300s Zero # the "-0" should print correctly 300s 2 'mpfr' numbers of precision 20 bits 300s [1] 0 -0 300s > stopifnot(.getSign(Zero) == c(1,-1), 300s + sign(Zero) == 0, 300s + identical(format(Zero, digits=1), c("0.", "-0."))) 300s > 300s > ## testing 'recycling' 300s > b <- c(20,120,80, 60) 300s > (x <- mpfr(2^-(5:7), precBits = b)) 300s 4 'mpfr' numbers of precision 20 .. 120 bits 300s [1] 0.03125 0.015625 0.0078125 0.03125 300s > 300s > d.spec <- c(0,NA,NaN,Inf,-Inf) 300s > (spec <- mpfr(d.spec, 3)) 300s 5 'mpfr' numbers of precision 3 bits 300s [1] 0 NaN NaN Inf -Inf 300s > stopifnot(length(x) == 4, x[1] == x[4], getPrec(x) == b, 300s + identical(is.na(spec), is.na(d.spec)), 300s + identical(is.finite(spec), is.finite(d.spec)), 300s + identical(is.infinite(spec), is.infinite(d.spec)), 300s + ## mpfr(, .) : 300s + identical(x, mpfr(x, getPrec(x))), 300s + identical(spec, mpfr(spec, getPrec(spec))), 300s + asNumeric(1/mpfr(x, 16)) == 2^c(5:7,5), 300s + identical(format(spec), c("0.", "NaN", "NaN", "Inf", "-Inf")), 300s + mpfr(0.2, prec = 5:15, rnd.mode = "D") < 0.2) 300s > 300s > B.set <- setNames(2:62, paste0("B=",2:62)) 300s > str(lapply(B.set, function(B) format(spec, base= B)))# "0.0" and "0.00" -- FIXME 300s List of 61 300s $ B=2 : chr [1:5] "0.0" "NaN" "NaN" "Inf" ... 300s $ B=3 : chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=4 : chr [1:5] "0.0" "NaN" "NaN" "Inf" ... 300s $ B=5 : chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=6 : chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=7 : chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=8 : chr [1:5] "0.0" "NaN" "NaN" "Inf" ... 300s $ B=9 : chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=10: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=11: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=12: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=13: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=14: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=15: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=16: chr [1:5] "0.0" "NaN" "NaN" "Inf" ... 300s $ B=17: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=18: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=19: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=20: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=21: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=22: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=23: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=24: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=25: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=26: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=27: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=28: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=29: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=30: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=31: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=32: chr [1:5] "0.0" "NaN" "NaN" "Inf" ... 300s $ B=33: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=34: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=35: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=36: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=37: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=38: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=39: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=40: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=41: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=42: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=43: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=44: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=45: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=46: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=47: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=48: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=49: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=50: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=51: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=52: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=53: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=54: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=55: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=56: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=57: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=58: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=59: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=60: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=61: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s $ B=62: chr [1:5] "0." "NaN" "NaN" "Inf" ... 300s > 300s > t2 <- mpfr(2^10,3) 300s > ## digits = 1 used to crash: MPFR assertion failed: m >= 2 || ((((b) & ((b) - 1)) == 0) == 0 && m >= 1) 300s > ## ---------- (+ seg.fault) for 'base = 2' (and others, not for default base = 10), 300s > ## digits = NULL should choose "enough" ... but does not 300s > str(r <- lapply(B.set, function(B) .mpfr2str(t2, digits=1, base = B))) 300s base = 2, digits = 1 is increased to digits = 2 300s base = 4, digits = 1 is increased to digits = 2 300s base = 8, digits = 1 is increased to digits = 2 300s base = 16, digits = 1 is increased to digits = 2 300s base = 32, digits = 1 is increased to digits = 2 300s List of 61 300s $ B=2 :List of 4 300s ..$ str : chr "10" 300s ..$ exp : int 11 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=3 :List of 4 300s ..$ str : chr "1" 300s ..$ exp : int 7 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=4 :List of 4 300s ..$ str : chr "10" 300s ..$ exp : int 6 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=5 :List of 4 300s ..$ str : chr "2" 300s ..$ exp : int 5 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=6 :List of 4 300s ..$ str : chr "5" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=7 :List of 4 300s ..$ str : chr "3" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=8 :List of 4 300s ..$ str : chr "20" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=9 :List of 4 300s ..$ str : chr "1" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=10:List of 4 300s ..$ str : chr "1" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=11:List of 4 300s ..$ str : chr "8" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=12:List of 4 300s ..$ str : chr "7" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=13:List of 4 300s ..$ str : chr "6" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=14:List of 4 300s ..$ str : chr "5" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=15:List of 4 300s ..$ str : chr "5" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=16:List of 4 300s ..$ str : chr "40" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=17:List of 4 300s ..$ str : chr "4" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=18:List of 4 300s ..$ str : chr "3" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=19:List of 4 300s ..$ str : chr "3" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=20:List of 4 300s ..$ str : chr "3" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=21:List of 4 300s ..$ str : chr "2" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=22:List of 4 300s ..$ str : chr "2" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=23:List of 4 300s ..$ str : chr "2" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=24:List of 4 300s ..$ str : chr "2" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=25:List of 4 300s ..$ str : chr "2" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=26:List of 4 300s ..$ str : chr "2" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=27:List of 4 300s ..$ str : chr "1" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=28:List of 4 300s ..$ str : chr "1" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=29:List of 4 300s ..$ str : chr "1" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=30:List of 4 300s ..$ str : chr "1" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=31:List of 4 300s ..$ str : chr "1" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=32:List of 4 300s ..$ str : chr "10" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=33:List of 4 300s ..$ str : chr "v" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=34:List of 4 300s ..$ str : chr "u" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=35:List of 4 300s ..$ str : chr "t" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=36:List of 4 300s ..$ str : chr "s" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=37:List of 4 300s ..$ str : chr "S" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=38:List of 4 300s ..$ str : chr "R" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=39:List of 4 300s ..$ str : chr "Q" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=40:List of 4 300s ..$ str : chr "Q" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=41:List of 4 300s ..$ str : chr "P" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=42:List of 4 300s ..$ str : chr "O" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=43:List of 4 300s ..$ str : chr "O" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=44:List of 4 300s ..$ str : chr "N" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=45:List of 4 300s ..$ str : chr "N" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=46:List of 4 300s ..$ str : chr "M" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=47:List of 4 300s ..$ str : chr "M" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=48:List of 4 300s ..$ str : chr "L" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=49:List of 4 300s ..$ str : chr "L" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=50:List of 4 300s ..$ str : chr "K" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=51:List of 4 300s ..$ str : chr "K" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=52:List of 4 300s ..$ str : chr "K" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=53:List of 4 300s ..$ str : chr "J" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=54:List of 4 300s ..$ str : chr "J" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=55:List of 4 300s ..$ str : chr "J" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=56:List of 4 300s ..$ str : chr "I" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=57:List of 4 300s ..$ str : chr "I" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=58:List of 4 300s ..$ str : chr "I" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=59:List of 4 300s ..$ str : chr "H" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=60:List of 4 300s ..$ str : chr "H" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=61:List of 4 300s ..$ str : chr "H" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=62:List of 4 300s ..$ str : chr "H" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s > str(r. <- lapply(B.set, function(B) .mpfr2str(t2, base = B))) 300s List of 61 300s $ B=2 :List of 4 300s ..$ str : chr "100" 300s ..$ exp : int 11 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=3 :List of 4 300s ..$ str : chr "111" 300s ..$ exp : int 7 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=4 :List of 4 300s ..$ str : chr "10" 300s ..$ exp : int 6 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=5 :List of 4 300s ..$ str : chr "131" 300s ..$ exp : int 5 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=6 :List of 4 300s ..$ str : chr "443" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=7 :List of 4 300s ..$ str : chr "266" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=8 :List of 4 300s ..$ str : chr "20" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=9 :List of 4 300s ..$ str : chr "14" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=10:List of 4 300s ..$ str : chr "10" 300s ..$ exp : int 4 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=11:List of 4 300s ..$ str : chr "85" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=12:List of 4 300s ..$ str : chr "71" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=13:List of 4 300s ..$ str : chr "61" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=14:List of 4 300s ..$ str : chr "53" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=15:List of 4 300s ..$ str : chr "48" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=16:List of 4 300s ..$ str : chr "40" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=17:List of 4 300s ..$ str : chr "39" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=18:List of 4 300s ..$ str : chr "33" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=19:List of 4 300s ..$ str : chr "2g" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=20:List of 4 300s ..$ str : chr "2b" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=21:List of 4 300s ..$ str : chr "27" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=22:List of 4 300s ..$ str : chr "23" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=23:List of 4 300s ..$ str : chr "1m" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=24:List of 4 300s ..$ str : chr "1j" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=25:List of 4 300s ..$ str : chr "1g" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=26:List of 4 300s ..$ str : chr "1d" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=27:List of 4 300s ..$ str : chr "1b" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=28:List of 4 300s ..$ str : chr "19" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=29:List of 4 300s ..$ str : chr "16" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=30:List of 4 300s ..$ str : chr "14" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=31:List of 4 300s ..$ str : chr "12" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=32:List of 4 300s ..$ str : chr "10" 300s ..$ exp : int 3 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=33:List of 4 300s ..$ str : chr "v1" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=34:List of 4 300s ..$ str : chr "u4" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=35:List of 4 300s ..$ str : chr "t9" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=36:List of 4 300s ..$ str : chr "sg" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=37:List of 4 300s ..$ str : chr "RP" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=38:List of 4 300s ..$ str : chr "Qa" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=39:List of 4 300s ..$ str : chr "QA" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=40:List of 4 300s ..$ str : chr "PO" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=41:List of 4 300s ..$ str : chr "Oe" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=42:List of 4 300s ..$ str : chr "OG" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=43:List of 4 300s ..$ str : chr "NZ" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=44:List of 4 300s ..$ str : chr "NC" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=45:List of 4 300s ..$ str : chr "MY" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=46:List of 4 300s ..$ str : chr "MC" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=47:List of 4 300s ..$ str : chr "Lb" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=48:List of 4 300s ..$ str : chr "LG" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=49:List of 4 300s ..$ str : chr "Ki" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=50:List of 4 300s ..$ str : chr "KO" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=51:List of 4 300s ..$ str : chr "K4" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=52:List of 4 300s ..$ str : chr "Ja" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=53:List of 4 300s ..$ str : chr "JH" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=54:List of 4 300s ..$ str : chr "Iq" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=55:List of 4 300s ..$ str : chr "IY" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=56:List of 4 300s ..$ str : chr "IG" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=57:List of 4 300s ..$ str : chr "Ht" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=58:List of 4 300s ..$ str : chr "Hc" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=59:List of 4 300s ..$ str : chr "HL" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=60:List of 4 300s ..$ str : chr "H4" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=61:List of 4 300s ..$ str : chr "Gm" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s $ B=62:List of 4 300s ..$ str : chr "GW" 300s ..$ exp : int 2 300s ..$ finite: logi TRUE 300s ..$ is.0 : logi FALSE 300s > ## FIXME: still too short 300s > 300s > x <- c(-12, 1:3 * pi) 300s > sss <- mpfr(x, 100) 300s > validObject(sss) 300s [1] TRUE 300s > sss 300s 4 'mpfr' numbers of precision 100 bits 300s [1] -12 3.1415926535897931159979634685442 300s [3] 6.2831853071795862319959269370884 9.4247779607693793479938904056326 300s > sss2 <- sss * sss 300s > stopifnot(identical(sss2, sss * x), 300s + identical(sss2, x * sss), 300s + sss ^ 2 == sss2) 300s > ## and go back {not sure if identical() is guaranteed here, but it seems...}: 300s > stopifnot(identical(x, as(sss, "numeric"))) 300s > 300s > (cs <- as(sss, "character")) 300s [1] "-12" "3.1415926535897931159979634685442" 300s [3] "6.2831853071795862319959269370884" "9.4247779607693793479938904056326" 300s > 300s > y <- c(0, 100,-10, 1.25, -2.5, 300s + x * c(1,100,1e5,1e20), 300s + x / 100^(1:4)) 300s > (Y <- mpfr(y, 100)) 300s 13 'mpfr' numbers of precision 100 bits 300s [1] 0 100 300s [3] -10 1.25 300s [5] -2.5 -12 300s [7] 314.15926535897932581065106205642 628318.53071795857977122068405151 300s [9] 942477796076937936896 -0.11999999999999999555910790149937 300s [11] 0.00031415926535897930899771113288921 6.2831853071795866542926731201923e-6 300s [13] 9.4247779607693799284994504768947e-8 300s > cbind(y, as.data.frame(.mpfr2str(Y, 20))[,c("exp","str")]) 300s y exp str 300s 1 0.000000e+00 0 00000000000000000000 300s 2 1.000000e+02 3 10000000000000000000 300s 3 -1.000000e+01 2 -10000000000000000000 300s 4 1.250000e+00 1 12500000000000000000 300s 5 -2.500000e+00 1 -25000000000000000000 300s 6 -1.200000e+01 2 -12000000000000000000 300s 7 3.141593e+02 3 31415926535897932581 300s 8 6.283185e+05 6 62831853071795857977 300s 9 9.424778e+20 21 94247779607693793690 300s 10 -1.200000e-01 0 -11999999999999999556 300s 11 3.141593e-04 -3 31415926535897930900 300s 12 6.283185e-06 -5 62831853071795866543 300s 13 9.424778e-08 -7 94247779607693799285 300s > 300s > s <- mpfr(43208, 14)# low precision 300s > eps8 <- 8 * .Machine$double.eps 300s > ## checking mpfr -> character -> mpfr: 300s > i1..5f <- c("4.e+4", "4.3e+4", "4.32e+4", "43210.", "43208.") 300s > stopifnot(exprs = { 300s + all.equal(y, as.numeric(format(Y, digits=20)), tol= eps8) 300s + all.equal(Y, as(format(Y), "mpfr"), tol= eps8) 300s + identical(sapply(1:5, formatMpfr, x=s), i1..5f) 300s + identical(sapply(1:5, formatMpfr, x=s, exponent.plus=FALSE), 300s + sub("e[+]", "e", i1..5f)) 300s + }) 300s > 300s > 300s > ## More character -> mpfr checking : 300s > ## from echo 'scale=200; 4*a(1)' | bc -l : 300s > cpi <- "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196" 300s > pi. <- Const("pi", prec=667) 300s > stopifnot(cpi == format(mpfr(cpi, prec=667), digits=201), 300s + all.equal(pi., as(cpi, "mpfr")), 300s + all.equal(pi., as(cpi, "mpfr"), tol = 1e-200)) 300s > 300s > set.seed(17) 300s > ## Check double -> mpfr -> character -> double : 300s > ## Unfortunately, format(, .) -> .mpfr2str() triggers a memory bug 300s > ## that I think is an MPFR library "mis-feature" 300s > ## 2011-02-09 -- bug *no longer* triggered ! 300s > rSign <- function(n) sample(c(-1,1), size = n, replace=TRUE) 300s > N <- function(x) as.numeric(x) 300s > ntry <- if(Sys.getenv("USER") == "maechler") 150 else 5 300s > for(n in 1:ntry) { 300s + cat(if(n %% 10)"." else n) 300s + x. <- rSign(100) * rlnorm(100) 300s + prec <- rpois(1, 110); digs <- floor(0.95*(prec / log2(10))) 300s + X. <- mpfr(x., precBits = prec) 300s + stopifnot(all.equal(x., N(format(X., digits=digs)), tol = eps8) 300s + , all.equal(x., N(log(exp(X.))), tol = 32*eps8) 300s + ) 300s + }; cat("\n") 300s .....Warning message: 300s In mpfr.is.0(X.) : 'mpfr.is.0' is deprecated. 300s Use 'mpfrIs0' instead. 300s See help("Deprecated") 300s 300s > 300s > stopifnot(identical(mpfr.is.0(X.),# deprecated but must work 300s + mpfrIs0 (X.))) 300s > X. <- X.[!mpfrIs0(X.)] 300s > stopifnot(all( X./X. == 1)) # TRUE 300s > 300s > u <- mpfr(as.raw(0:100)) 300s > z <- mpfr(1:12, 200) 300s > z[z > 100] <- 100 # nothing done (but used to fail) 300s > z[] <- 0 300s > stopifnot(0:100 == u, is(z,"mpfr"), mpfrIs0(z), 300s + all.equal(u, mpfr(0:100, prec = 8), tol = 0), 300s + 0:1 == mpfr(1:2 %% 2 == 0)) 300s > z[3] <- Const("pi",200) 300s > ## z has length 12 -- now extend it: 300s > z[15:17] <- 1/mpfr(10:12, 100) 300s > stopifnot(all.equal(z[1:4], c(0,0,pi,0), tol = 1e-15), validObject(z), 300s + all.equal(z[13:17], c(NaN,NaN, 1/(10:12)), tol = 1e-15)) 300s > 300s > ## These seg.faulted (each via different R -> C interface) in the past: 300s > assertError <- tools::assertError 300s > assertError( pp <- Const("pi", prec = 1e11) ) 300s > assertError( mpfr("123.456", precBits= 1e11) ) 300s > assertError( mpfr(as.bigz(3), precBits= 1e11) ) 300s > 300s > stopifnot(identical(mpfr(NULL), mpfr(logical()))) 300s > 300s > ## mpfr --> bigInteger "bigz" 300s > Pi <- Const("pi", prec = 300) 300s > twoP <- mpfr(2, 100)^(-2:80) 300s > m <- Pi * twoP 300s > L <- mpfr(2, 256)^1000 300s > stopifnot(exprs = { 300s + .mpfr2bigz(Pi) == 3 300s + .mpfr2bigz(twoP) == as.bigz(c(0,0, 2^(0:80))) 300s + .mpfr2bigz(m) == floor(m) 300s + .mpfr2bigz(m / L) == 0 300s + .mpfr2bigz(m * L) == floor(m * L) ## used to fail 300s + .mpfr2bigz(m * L^8) == floor(m * L^8) ## (ditto) 300s + }) 300s > 301s BEGIN TEST functionals.R 301s 301s R version 4.4.3 (2025-02-28) -- "Trophy Case" 301s Copyright (C) 2025 The R Foundation for Statistical Computing 301s Platform: aarch64-unknown-linux-gnu 301s 301s R is free software and comes with ABSOLUTELY NO WARRANTY. 301s You are welcome to redistribute it under certain conditions. 301s Type 'license()' or 'licence()' for distribution details. 301s 301s R is a collaborative project with many contributors. 301s Type 'contributors()' for more information and 301s 'citation()' on how to cite R or R packages in publications. 301s 301s Type 'demo()' for some demos, 'help()' for on-line help, or 301s 'help.start()' for an HTML browser interface to help. 301s Type 'q()' to quit R. 301s 301s > #### Tests for "Functionals": Root finding, Optimization, Integration, etc 301s > 301s > stopifnot(require("Rmpfr")) 301s Loading required package: Rmpfr 301s Loading required package: gmp 301s 301s Attaching package: ‘gmp’ 301s 301s The following objects are masked from ‘package:base’: 301s 301s %*%, apply, crossprod, matrix, tcrossprod 301s 301s C code of R package 'Rmpfr': GMP using 64 bits per limb 301s 301s 301s Attaching package: ‘Rmpfr’ 301s 301s The following object is masked from ‘package:gmp’: 301s 301s outer 301s 301s The following objects are masked from ‘package:stats’: 301s 301s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 301s 301s > The following objects are masked from ‘package:base’: 301s 301s cbind, pmax, pmin, rbind 301s 301s 301s > (f.chk <- system.file("check-tools.R", package="Rmpfr", mustWork=TRUE)) 301s [1] "/usr/lib/R/site-library/Rmpfr/check-tools.R" 301s > source(f.chk, keep.source=FALSE) 301s > ## -> assert.EQ.() showSys.time() 301s > 301s > options(warn = 1)# warnings *immediately* 301s > (doExtras <- Rmpfr:::doExtras()) 301s [1] FALSE 301s > 301s > ### 1. Integration ----------------------------------------------- 301s > 301s > ## Example from Lauren K, June 2014 (~/R/MM/Pkg-ex/Rmpfr/integrateR-LaurenK.R): 301s > beta0 <- 0.05 301s > beta1 <- 0.05 301s > (tau <- sqrt(0.01*0.05*0.95/0.99))# = 0.0219.. 301s [1] 0.02190429 301s > ## 301s > Z00 <- 9 301s > Z01 <- 1 301s > Z10 <- 18 301s > Z11 <- 2 301s > N <- Z00+Z01+Z10+Z11 301s > 301s > integrand <- function(u) { 301s + ee.u <- exp(-u^2/2)/(sqrt(2*pi)*tau) 301s + b0u <- beta0 + tau*u 301s + b1u <- beta1 + b0u # == beta0+beta1+ tau*u 301s + 301s + ee.u ^ (Z00+Z01 + Z10+Z11) * 301s + (1-b0u)^Z00 * b0u ^ Z01 * 301s + (1-b1u)^Z10 * b1u ^ Z11 301s + } 301s > 301s > ## MM: note how the integrand() function looks: 301s > op <- par(mfcol=c(3,1), mgp=c(1.5, .6, 0), mar=.1+c(3,3,0,0)) 301s > ax1 <- function(a,b) axis(1, at=c(a,b), col=2, col.axis=2, tcl= +3/4, mgp=c(3,0,0)) 301s > curve(integrand, -5,5, n=1000) 301s > cc <- adjustcolor(2, 1/4) ## look closer: 301s > ep <- .01; rect(-3, -ep, 0, +ep, col=cc, border=cc); ax1(-3,0) 301s > curve(integrand, -3,0, n=1000, ylim = c(-ep,ep)) 301s > ## but now look really closely : 301s > ep <- .001; rect(-3, -ep, -2, +ep, col=cc); ax1(-3,-2) 301s > curve(integrand, -3,-2, n=1000, ylim = c(-ep, ep)) 301s > par(op) 301s > 301s > (I1 <- integrate(integrand,lower = -100, upper = 100)) 301s 1.396355e+33 with absolute error < 1.6e+29 301s > (I1. <- integrate(integrand,lower = -100, upper = 100, rel.tol = 1e-14)) 301s 1.396355e+33 with absolute error < 1e+19 301s > 301s > showSys.time(I2 <- integrateR(integrand, lower = -100, upper = 100)) 301s Warning in integrateR(integrand, lower = -100, upper = 100) : 301s no convergence up to order 13; last relative change = 1.285403e-05 301s Consider setting 'ord = ' (e.g. = 14). 301s Time user system elapsed 301s Time 0.004 0.000 0.004 301s > I2 ## ... Warning ‘no convergence up to order 13’ 301s Non-convergence message ‘no convergence up to order 13; last relative change = 1.285403e-05 301s Consider setting 'ord = ' (e.g. = 14).’ 301s 1.3964e+33 with absolute error < 1.7949e+28 301s > ## Solaris Sparc (2014-06, CRAN checks); thanks Brian: print(I2[1:2], digits=15) 301s > I2.Solaris <- list(value = 1.3963550396006e+33, abs.error = 1.79487857486724e+28) 301s > I.db <- list(value = 1.39635503960059e+33, abs.error = 1.79487857478077e+28) 301s > stopifnot( 301s + all.equal(I2[1:2], I.db, tol = 1e-10)# Solaris SPARC needs at least 4.8e-11 301s + ) 301s > 301s > ## Now using high accuracy 301s > showSys.time(I3 <- integrateR(integrand, lower = mpfr(-100, precBits=256), upper = 100)) 304s Warning in integrateR(integrand, lower = mpfr(-100, precBits = 256), upper = 100) : 304s no convergence up to order 13; last relative change = 1.285403e-5 304s Consider setting 'ord = ' (e.g. = 14). 304s Time user system elapsed 304s Time 2.334 0.031 2.369 304s > ## much slower but not better (and not worse) 304s > I3 304s Non-convergence message ‘no convergence up to order 13; last relative change = 1.285403e-5 304s Consider setting 'ord = ' (e.g. = 14).’ 304s 1.3964e+33 with absolute error < 1.7949e+28 304s > assert.EQ.(sapply(I3[1:2], asNumeric), unlist(I.db)) 304s Mean relative difference: 3.569039e-15 304s > ## Really get better when decreasing the integration interval 304s > ## from [-100, 100] to [-10, 10] ... which should give "the same" 304s > showSys.time(I4 <- integrateR(integrand, lower = mpfr(-10, precBits=256), upper = 10, 304s + ord = 15, verbose=TRUE)) 304s ord = 15; ==> evaluating integrand at 2^(ord+1)-2 = 65534 locations 304s n= 1, 2^n= 2 | I = 4.085188566e+34, abs.err = 4.085189e+34 304s n= 2, 2^n= 4 | I = 8.170377132e+33, abs.err = 3.268151e+34 304s n= 3, 2^n= 8 | I = 4.712016441e+33, abs.err = 3.458361e+33 304s n= 4, 2^n= 16 | I = 2.335919214e+33, abs.err = 2.376097e+33 304s n= 5, 2^n= 32 | I = 1.181962279e+33, abs.err = 1.153957e+33 304s n= 6, 2^n= 64 | I = 1.220705480e+33, abs.err = 3.874320e+31 304s n= 7, 2^n= 128 | I = 1.410495454e+33, abs.err = 1.897900e+32 305s n= 8, 2^n= 256 | I = 1.396201858e+33, abs.err = 1.429360e+31 305s n= 9, 2^n= 512 | I = 1.396354229e+33, abs.err = 1.523703e+29 305s n=10, 2^n= 1024 | I = 1.396354970e+33, abs.err = 7.409143e+26 305s n=11, 2^n= 2048 | I = 1.396354964e+33, abs.err = 5.998797e+24 305s n=12, 2^n= 4096 | I = 1.396354964e+33, abs.err = 6.619581e+21 307s n=13, 2^n= 8192 | I = 1.396354964e+33, abs.err = 1.662622e+18 309s n=14, 2^n= 16384 | I = 1.396354964e+33, abs.err = 1.021861e+14 312s n=15, 2^n= 32768 | I = 1.396354964e+33, abs.err = 1.561794e+9 312s Time user system elapsed 312s Time 8.142 0.105 8.267 312s > ## ~ 6.6 sec [lynne 2013] 312s > I4 312s 1.3964e+33 with absolute error < 1.5618e+9 312s > 312s > ## on the left side, there is "nothing" (and negative, as we know!): 312s > showSys.time(I0.1 <- integrateR(integrand, lower = mpfr(-1000, precBits=256), 312s + upper = -10, ord= 11, verbose=TRUE)) 313s ord = 11; ==> evaluating integrand at 2^(ord+1)-2 = 4094 locations 313s n= 1, 2^n= 2 | I = -2.859606864e-613, abs.err = 5.719214e-613 313s n= 2, 2^n= 4 | I = -1.334483203e-613, abs.err = 1.525124e-613 313s n= 3, 2^n= 8 | I = -6.566504650e-614, abs.err = 6.778327e-614 313s n= 4, 2^n= 16 | I = -3.270376825e-614, abs.err = 3.296128e-614 313s n= 5, 2^n= 32 | I = -1.633589988e-614, abs.err = 1.636787e-614 313s n= 6, 2^n= 64 | I = -8.165955325e-615, abs.err = 8.169945e-615 313s n= 7, 2^n= 128 | I = -4.082728442e-615, abs.err = 4.083227e-615 313s n= 8, 2^n= 256 | I = -2.041333072e-615, abs.err = 2.041395e-615 313s n= 9, 2^n= 512 | I = -1.020662642e-615, abs.err = 1.020670e-615 313s n=10, 2^n= 1024 | I = -5.103308345e-616, abs.err = 5.103318e-616 313s n=11, 2^n= 2048 | I = -2.551653564e-616, abs.err = 2.551655e-616 313s Time user system elapsed 313s Time 0.453 0.002 0.455 313s > showSys.time(I0.2 <- integrateR(integrand, lower = mpfr(10, precBits=256), 313s + upper = 1000, ord= 11, verbose=TRUE)) 313s ord = 11; ==> evaluating integrand at 2^(ord+1)-2 = 4094 locations 313s n= 1, 2^n= 2 | I = 6.250128073e-618, abs.err = 1.250026e-617 313s n= 2, 2^n= 4 | I = 2.916726434e-618, abs.err = 3.333402e-618 313s n= 3, 2^n= 8 | I = 1.435214595e-618, abs.err = 1.481512e-618 313s n= 4, 2^n= 16 | I = 7.147931510e-619, abs.err = 7.204214e-619 313s n= 5, 2^n= 32 | I = 3.570472142e-619, abs.err = 3.577459e-619 313s n= 6, 2^n= 64 | I = 1.784800116e-619, abs.err = 1.785672e-619 313s n= 7, 2^n= 128 | I = 8.923455870e-620, abs.err = 8.924545e-620 313s n= 8, 2^n= 256 | I = 4.461659853e-620, abs.err = 4.461796e-620 313s n= 9, 2^n= 512 | I = 2.230821417e-620, abs.err = 2.230838e-620 313s n=10, 2^n= 1024 | I = 1.115409645e-620, abs.err = 1.115412e-620 314s n=11, 2^n= 2048 | I = 5.577046893e-621, abs.err = 5.577050e-621 314s Time user system elapsed 314s Time 0.468 0.001 0.470 314s > I0.1 314s -2.5517e-616 with absolute error < 2.5517e-616 314s > I0.2 314s 5.5770e-621 with absolute error < 5.5770e-621 314s > I4 314s 1.3964e+33 with absolute error < 1.5618e+9 314s > 314s > ## Integral [-1000, +1000 ] = Int[-1000, -10] + Int[-10, +10] + Int[+10, +1000]: 314s > 314s > I4 $value + I0.1 $value + I0.2 $value 314s 1 'mpfr' number of precision 256 bits 314s [1] 1396354963674017387015147490193159.224442394550727848837192551722726424516192161 314s > ## but this is really the same as just the middle: 314s > stopifnot(I4 $value + I0.1 $value + I0.2 $value 314s + == I4 $value) 314s > 314s > value <- I4$value; delta <- I4$abs.err 314s > nDig <- -asNumeric(log10(delta/value)) 314s > cat("Correct number of digits: ", round(nDig, 2),"\n", 314s + "Integral I = ", format(I4$value, digits = ceiling(nDig)), 314s + " (last change change= ", format(delta, digits = 7),")\n", 314s + "integrate(.) = ", format(I1 $value, digits = 22),"\n", 314s + "integrate(., rtol=1e-15)= ", format(I1.$value, digits = 22),"\n", sep="") 314s Correct number of digits: 23.95 314s Integral I = 1.39635496367401738701515e+33 (last change change= 1.561794e+9) 314s integrate(.) = 1.396354963673671427757e+33 314s integrate(., rtol=1e-15)= 1.396354963674017015978e+33 314s > 314s > 314s > 314s > 314s > ### 2. Root Finding ---------------------------------------------- 314s > 314s > ### 3. Optimization / Minimization, .. --------------------------- 314s > 314s > 314s > 314s > cat('Time elapsed: ', proc.time(),'\n') # "stats" 314s Time elapsed: 12.874 0.22 13.125 0.002 0.007 314s > 314s BEGIN TEST lowlevel.R 314s 314s R version 4.4.3 (2025-02-28) -- "Trophy Case" 314s Copyright (C) 2025 The R Foundation for Statistical Computing 314s Platform: aarch64-unknown-linux-gnu 314s 314s R is free software and comes with ABSOLUTELY NO WARRANTY. 314s You are welcome to redistribute it under certain conditions. 314s Type 'license()' or 'licence()' for distribution details. 314s 314s R is a collaborative project with many contributors. 314s Type 'contributors()' for more information and 314s 'citation()' on how to cite R or R packages in publications. 314s 314s Type 'demo()' for some demos, 'help()' for on-line help, or 314s 'help.start()' for an HTML browser interface to help. 314s Type 'q()' to quit R. 314s 314s > #### Low level stuff - debugging etc 314s > #### ========= ========= 314s > 314s > require("Rmpfr") 314s Loading required package: Rmpfr 314s Loading required package: gmp 314s 314s Attaching package: ‘gmp’ 314s 314s The following objects are masked from ‘package:base’: 314s 314s %*%, apply, crossprod, matrix, tcrossprod 314s 314s C code of R package 'Rmpfr': GMP using 64 bits per limb 314s 314s > options(warn = 2)# warning -> error 314s > 314s > identical3 <- function(x,y,z) identical(x,y) && identical (y,z) 314s > identical4 <- function(a,b,c,d) identical(a,b) && identical3(b,c,d) 314s > 314s > ## sane state [when re-source()ing this file]: 314s > .mpfr_erange_set("Emin", -(2^30-1)) 314s > .mpfr_erange_set("Emax", +(2^30-1)) 314s > 314s > ###----- _1_ mpfr1 , import, xport etc ----------------------------------------- 314s > i8 <- mpfr(-2:5, 32) 314s 314s Attaching package: ‘Rmpfr’ 314s 314s The following object is masked from ‘package:gmp’: 314s 314s outer 314s 314s The following objects are masked from ‘package:stats’: 314s 314s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 314s 314s The following objects are masked from ‘package:base’: 314s 314s cbind, pmax, pmin, rbind 314s 314s > x4 <- mpfr(c(NA, NaN, -Inf, Inf), 32); x4 # NA -> NaN as well 314s 4 'mpfr' numbers of precision 32 bits 314s [1] NaN NaN -Inf Inf 314s > stopifnot(identical3(is.na(x4), is.nan(x4), c(T,T,F,F))) 314s > 314s > o1 <- as(x4[1], "mpfr1") 314s > stopifnot(is(o1, "mpfr1")) # failed previously 314s > validObject(o1) # ditto (failed on 64-bit only) 314s [1] TRUE 314s > 314s > stopifnot( 314s + getPrec("0xabc", base=16, doNumeric=FALSE) == 3*4, 314s + getPrec( "abc", base=16, doNumeric=FALSE) == 3*4, 314s + getPrec("0b1001", base=2, doNumeric=FALSE) == 4, 314s + getPrec( "1001", base=2, doNumeric=FALSE) == 4, 314s + identical3(mpfr("0b101", base= 2), 314s + mpfr( "101", base= 2), mpfr(5, precBits = 3)) 314s + , 314s + identical3(mpfr("0xabc", base=16), 314s + mpfr( "abc", base=16), mpfr(2748, base=16, precBits = 12)) 314s + ) 314s > 314s > ## save initial (Emin, Emax) eranges : 314s > erangesOrig <- .mpfr_erange() 314s > 314s > ###----- _2_ Debugging, changing MPFR defaults, .. ----------------------------- 314s > ## NB: Currently mostly *not* documented, not even .mpfr_erange() 314s > 314s > stopifnot(Rmpfr:::.mpfr_debug() == 0 # the default level 314s + ## Activate debugging level 1: 314s + , Rmpfr:::.mpfr_debug(1) == 0 # the previous level 314s + ## and check it : 314s + , Rmpfr:::.mpfr_debug() == 1 # the current level 314s + ) 314s > 314s > r <- mpfr(7, 100)^-1000 314s > r 314s 1 'mpfr' number of precision 100 bits 314s .mpfr_debug[1]: .mpfr_debug[1]: mpfr2str(*, digits=0, maybeF=False, base=10): 314s [i=0]: prec=100, exp2=-2807 -> (nchar_i,dig.n)=(33,33) .. max_nchar=33 314s [1] 7.9792116643192417444751621015671e-846 314s > ## (same as without debugging) 314s > 314s > ## where as this does print info: -- notably the very large values [3..6]: 314s > .eranges <- function() sapply(.mpfr_erange_kinds, .mpfr_erange, USE.NAMES=FALSE) 314s > ## now, mpfr_erange() works with a *vector* of args: 314s > .erange2 <- function() .mpfr_erange(.mpfr_erange_kinds) 314s > ## now returning *double* - which loses some precision [ending in '04' instead of '03']: 314s > formatC(.eranges(), format="fg") 314s R_mpfr_get_erange(1): -1073741823 314s R_mpfr_get_erange(2): 1073741823 314s R_mpfr_get_erange(3): -4611686018427387903 314s .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: R_mpfr_get_erange(4): 4611686018427387903 314s R_mpfr_get_erange(5): -4611686018427387903 314s R_mpfr_get_erange(6): 4611686018427387903 314s .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: Emin Emax min.emin 314s "-1073741823" "1073741823" "-4611686018427387904" 314s max.emin min.emax max.emax 314s "4611686018427387904" "-4611686018427387904" "4611686018427387904" 314s > stopifnot(identical(.eranges(), .erange2())) 314s R_mpfr_get_erange(1): -1073741823 314s R_mpfr_get_erange(2): 1073741823 314s R_mpfr_get_erange(3): -4611686018427387903 314s R_mpfr_get_erange(4): 4611686018427387903 314s R_mpfr_get_erange(5): -4611686018427387903 314s R_mpfr_get_erange(6): 4611686018427387903 314s .mpfr_debug[1]: .mpfr_debug[1]: R_mpfr_get_erange(1): -1073741823 314s R_mpfr_get_erange(2): 1073741823 314s R_mpfr_get_erange(3): -4611686018427387903 314s R_mpfr_get_erange(4): 4611686018427387903 314s R_mpfr_get_erange(5): -4611686018427387903 314s R_mpfr_get_erange(6): 4611686018427387903 314s .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: .mpfr_debug[1]: > 314s > .mpfr_minPrec() 314s R_mpfr_prec_range(): 1 314s .mpfr_debug[1]: [1] 1 314s > .mpfr_maxPrec()# debug printing shows the long integer (on 64 bit) 314s R_mpfr_prec_range(): 9223372036854775551 314s mpfr2str(*, digits=0, maybeF=False, base=10): 314s ex[0:1]= (4294964489,4294967295) -> _exp = 0xfffffffffffff509 314s dd[0:1]= (2684354560, 135379182) -> r..d[i=0]= 0x811b8eea0000000 314s dd[2:3]= (1395976304,3358285975) -> r..d[i=1]= 0xc82b60975334e870 314s [i=0]: prec=100, exp2=-2807 -> (nchar_i,dig.n)=(33,33) .. max_nchar=33 314s ex[0:1]= (4294964489,4294967295) -> _exp = 0xfffffffffffff509 314s dd[0:1]= (2684354560, 135379182) -> r..d[i=0]= 0x811b8eea0000000 314s dd[2:3]= (1395976304,3358285975) -> r..d[i=1]= 0xc82b60975334e870 314s .mpfr_debug[1]: [1] 9.223372e+18 314s > 314s > ## Now, level 2 : 314s > stopifnot(Rmpfr:::.mpfr_debug(2) == 1) 314s > r 314s 1 'mpfr' number of precision 100 bits 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: [1] 7.9792116643192417444751621015671e-846 314s > ## with quite a bit of output 314s > 314s > if(FALSE) # on Winbuilder [2019-08-08, both 32 and 64 bit]: 314s + .mpfr_erange_set("Emax", 1073741823) 314s > 314s > r2 <- r^100 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: > r2 314s 1 'mpfr' number of precision 100 bits 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: [1] 1.5703576492231738528268016707234e-84510 314s > L <- r^-100000 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: ex[0:1]= (4294964489,4294967295) -> _exp = 0xfffffffffffff509 314s dd[0:1]= (2684354560, 135379182) -> r..d[i=0]= 0x811b8eea0000000 314s dd[2:3]= (1395976304,3358285975) -> r..d[i=1]= 0xc82b60975334e870 314s _exp = 0xfffffffffffbb761 314s r..d[i=0] = 0xc5307c7070000000 314s r..d[i=1] = 0xb5fffcb01cfbf9bc 314s mpfr2str(*, digits=0, maybeF=False, base=10): 314s ex[0:1]= (4294686561,4294967295) -> _exp = 0xfffffffffffbb761 314s dd[0:1]= (1879048192,3308289136) -> r..d[i=0]= 0xc5307c7070000000 314s dd[2:3]= ( 486275516,3053452464) -> r..d[i=1]= 0xb5fffcb01cfbf9bc 314s [i=0]: prec=100, exp2=-280735 -> (nchar_i,dig.n)=(33,33) .. max_nchar=33 314s ex[0:1]= (4294686561,4294967295) -> _exp = 0xfffffffffffbb761 314s dd[0:1]= (1879048192,3308289136) -> r..d[i=0]= 0xc5307c7070000000 314s dd[2:3]= ( 486275516,3053452464) -> r..d[i=1]= 0xb5fffcb01cfbf9bc 314s ex[0:1]= (4294964489,4294967295) -> _exp = 0xfffffffffffff509 314s dd[0:1]= (2684354560, 135379182) -> r..d[i=0]= 0x811b8eea0000000 314s dd[2:3]= (1395976304,3358285975) -> r..d[i=1]= 0xc82b60975334e870 314s _exp = 0x10bbaf05 314s r..d[i=0] = 0xe7c2f7bc20000000 314s r..d[i=1] = 0x939f23c91dc591a5 314s ex[0:1]= ( 280735493, 0) -> _exp = 0x10bbaf05 314s dd[0:1]= ( 536870912,3888314300) -> r..d[i=0]= 0xe7c2f7bc20000000 314s dd[2:3]= ( 499487141,2476680137) -> r..d[i=1]= 0x939f23c91dc591a5 314s _exp = 0x32330d0d 314s r..d[i=0] = 0x2d66dbe010000000 314s r..d[i=1] = 0xc45982ce58f361ce 314s mpfr2str(*, digits=12, maybeF=TRUE, base=10): 314s ex[0:1]= ( 842206477, 0) -> _exp = 0x32330d0d 314s dd[0:1]= ( 268435456, 761715680) -> r..d[i=0]= 0x2d66dbe010000000 314s dd[2:3]= (1492345294,3294200526) -> r..d[i=1]= 0xc45982ce58f361ce 314s N_digits: [i=0]: ... -> dig.n = 12 .. max_nchar=12 314s ex[0:1]= ( 842206477, 0) -> _exp = 0x32330d0d 314s dd[0:1]= ( 268435456, 761715680) -> r..d[i=0]= 0x2d66dbe010000000 314s dd[2:3]= (1492345294,3294200526) -> r..d[i=1]= 0xc45982ce58f361ce 314s mpfr2str(*, digits=12, maybeF=TRUE, base=10): 314s ex[0:1]= ( 842206477, 0) -> _exp = 0x32330d0d 314s dd[0:1]= ( 268435456, 761715680) -> r..d[i=0]= 0x2d66dbe010000000 314s dd[2:3]= (1492345294,3294200526) -> r..d[i=1]= 0xc45982ce58f361ce 314s N_digits: [i=0]: ... -> dig.n = 12 .. max_nchar=12 314s ex[0:1]= ( 842206477, 0) -> _exp = 0x32330d0d 314s dd[0:1]= ( 268435456, 761715680) -> r..d[i=0]= 0x2d66dbe010000000 314s dd[2:3]= (1492345294,3294200526) -> r..d[i=1]= 0xc45982ce58f361ce 314s mpfr2str(*, digits=0, maybeF=False, base=10): 314s ex[0:1]= ( 842206477, 0) -> _exp = 0x32330d0d 314s dd[0:1]= ( 268435456, 761715680) -> r..d[i=0]= 0x2d66dbe010000000 314s dd[2:3]= (1492345294,3294200526) -> r..d[i=1]= 0xc45982ce58f361ce 314s [i=0]: prec=100, exp2=842206477 -> (nchar_i,dig.n)=(33,33) .mpfr_debug[2]: .mpfr_debug[2]: > L3 <- L^3 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: > str(L3, internal=TRUE) 314s Class 'mpfr' [package "Rmpfr"] of length 1 and precision 100 314s internally @.Data: List of 1 314s $ :Formal class 'mpfr1' [package "Rmpfr"] with 4 slots 314s .. ..@ prec: int 100 314s .. ..@ exp : int [1:2] 842206477 0 314s .. ..@ sign: int 1 314s .. ..@ d : int [1:4] 268435456 761715680 1492345294 -1000766770 314s > ## Class 'mpfr' [package "Rmpfr"] of length 1 and precision 100 314s > ## internally @.Data: List of 1 314s > ## $ :Formal class 'mpfr1' [package "Rmpfr"] with 4 slots 314s > ## .. ..@ prec: int 100 314s > ## .. ..@ exp : int [1:2] 842206477 0 314s > ## .. ..@ sign: int 1 314s > ## .. ..@ d : int [1:4] 268435456 761715680 1492345294 -1000766770 314s > str(L3) 314s Class 'mpfr' [package "Rmpfr"] of length 1 and precision 100 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: 1.00989692356e+253529412 314s > ## lots of debugging output, then 314s > ## 1.00989692356e+253529412 314s > ## ^^~~~~~~~~~ 10 ^ 253'529'412 that is humongous 314s > if(!interactive()) # not seg.faulting, but printing a *huge* line [no longer!] 314s + show(L3) 314s 1 'mpfr' number of precision 100 bits 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .. max_nchar=33 314s ex[0:1]= ( 842206477, 0) -> _exp = 0x32330d0d 314s dd[0:1]= ( 268435456, 761715680) -> r..d[i=0]= 0x2d66dbe010000000 314s dd[2:3]= (1492345294,3294200526) -> r..d[i=1]= 0xc45982ce58f361ce 314s mpfr2str(*, digits=0, maybeF=False, base=10): 314s ex[0:1]= ( 2,2147483648) -> _exp = 0x8000000000000002 314s .. max_nchar=5 314s ex[0:1]= ( 2,2147483648) -> _exp = 0x8000000000000002 314s .. max_nchar=5 314s ex[0:1]= ( 3,2147483648) -> _exp = 0x8000000000000003 314s .. max_nchar=5 314s ex[0:1]= ( 3,2147483648) -> _exp = 0x8000000000000003 314s .. max_nchar=5 314s ex[0:1]= ( 2,2147483648) -> _exp = 0x8000000000000002 314s ex[0:1]= ( 2,2147483648) -> _exp = 0x8000000000000002 314s ex[0:1]= ( 3,2147483648) -> _exp = 0x8000000000000003 314s ex[0:1]= ( 3,2147483648) -> _exp = 0x8000000000000003 314s R_mpfr_get_erange(2): 1073741823 314s R_mpfr_get_erange(6): 4611686018427387903 314s R_mpfr_get_erange(2): 4000000000000000000 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: [1] 1.0098969235574373617534053306205e+253529412 314s > ## segmentation fault -- randomly; 2017-06: no longer see any problem, not even with 314s > if(FALSE) ## well, not really, definitely not interactively for now 314s + if(interactive()) 314s + for(i in 1:256) show(L3) 314s > ## 314s > 314s > ## quite platform dependent {valgrind ==> bug? even in mpfr/gmp/.. ?} 314s > str(.mpfr2list(x4)) 314s List of 4 314s $ :List of 4 314s ..$ prec: int 32 314s ..$ exp : int [1:2] 2 NA 314s ..$ sign: int 1 314s ..$ d : int(0) 314s $ :List of 4 314s ..$ prec: int 32 314s ..$ exp : int [1:2] 2 NA 314s ..$ sign: int 1 314s ..$ d : int(0) 314s $ :List of 4 314s ..$ prec: int 32 314s ..$ exp : int [1:2] 3 NA 314s ..$ sign: int -1 314s ..$ d : int(0) 314s $ :List of 4 314s ..$ prec: int 32 314s ..$ exp : int [1:2] 3 NA 314s ..$ sign: int 1 314s ..$ d : int(0) 314s > ## slightly nicer ["uniformly not worse"] (still very similar) : 314s > str(x4, internal=TRUE) 314s Class 'mpfr' [package "Rmpfr"] of length 4 and precision 32 314s internally @.Data: List of 4 314s $ :Formal class 'mpfr1' [package "Rmpfr"] with 4 slots 314s .. ..@ prec: int 32 314s .. ..@ exp : int [1:2] 2 NA 314s .. ..@ sign: int 1 314s .. ..@ d : int(0) 314s $ :Formal class 'mpfr1' [package "Rmpfr"] with 4 slots 314s .. ..@ prec: int 32 314s .. ..@ exp : int [1:2] 2 NA 314s .. ..@ sign: int 1 314s .. ..@ d : int(0) 314s $ :Formal class 'mpfr1' [package "Rmpfr"] with 4 slots 314s .. ..@ prec: int 32 314s .. ..@ exp : int [1:2] 3 NA 314s .. ..@ sign: int -1 314s .. ..@ d : int(0) 314s $ :Formal class 'mpfr1' [package "Rmpfr"] with 4 slots 314s .. ..@ prec: int 32 314s .. ..@ exp : int [1:2] 3 NA 314s .. ..@ sign: int 1 314s .. ..@ d : int(0) 314s > x4 ## "similar info" as .mpfr2list(.) 314s 4 'mpfr' numbers of precision 32 bits 314s .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: .mpfr_debug[2]: [1] NaN NaN -Inf Inf 314s > 314s > ## Increase maximal exponent: 314s > 314s > tools:::assertWarning( 314s + .mpfr_erange_set("Emax", 5e18)) # too large {FIXME why only warning and not error ??} 314s > .mpfr_erange("Emax") # is unchanged 314s .mpfr_debug[2]: Emax 314s 1073741823 314s > if(4e18 < .mpfr_erange("max.emax")) { 314s + .mpfr_erange_set("Emax", 4e18) # now ok: 314s + stopifnot(.mpfr_erange("Emax") == 4e18) 314s + } 314s .mpfr_debug[2]: .mpfr_debug[2]: > 314s > 314s > ## revert to no debugging: 314s > stopifnot(Rmpfr:::.mpfr_debug(0) == 2) 314s > .mpfr_maxPrec() 314s [1] 9.223372e+18 314s > 314s > L / (r2^-1000)# 1.00000....448 (could be more accurate?) 314s 1 'mpfr' number of precision 100 bits 314s [1] 1.0000000000000000000000000004481 314s > 314s > stopifnot(exprs = { 314s + all.equal(L, r2^-1000, tol= 1e-27) # why not more accurate? 314s + all.equal(log(L), -100000 * (-1000) * log(7), tol = 1e-15) 314s + }) 314s > 314s > ## Now, our experimental "transport vehicle": 314s > stopifnot(length(rv <- c(r, r2, L)) == 3) 314s > 314s > str(mpfrXport(rv)) 314s List of 5 314s $ gmp.numb.bits: int 64 314s $ mpfr.version : chr "4.2.1" 314s $ Machine :List of 5 314s ..$ sizeof.long : int 8 314s ..$ sizeof.longlong : int 8 314s ..$ sizeof.longdouble: int 16 314s ..$ sizeof.pointer : int 8 314s ..$ sizeof.time_t : int 8 314s $ Sys.info : Named chr [1:2] "Linux" "aarch64" 314s ..- attr(*, "names")= chr [1:2] "sysname" "machine" 314s $ mpfr :List of 3 314s ..$ :List of 4 315s .. ..$ prec: int 100 315s .. ..$ exp : int [1:2] -2807 -1 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -1610612736 135379182 1395976304 -936681321 315s ..$ :List of 4 315s .. ..$ prec: int 100 315s .. ..$ exp : int [1:2] -280735 -1 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] 1879048192 -986678160 486275516 -1241514832 315s ..$ :List of 4 315s .. ..$ prec: int 100 315s .. ..$ exp : int [1:2] 280735493 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] 536870912 -406652996 499487141 -1818287159 315s - attr(*, "class")= chr "mpfrXport" 315s > str(mpfrXport(mpfr(2, 64)^(-3:3))) 315s List of 5 315s $ gmp.numb.bits: int 64 315s $ mpfr.version : chr "4.2.1" 315s $ Machine :List of 5 315s ..$ sizeof.long : int 8 315s ..$ sizeof.longlong : int 8 315s ..$ sizeof.longdouble: int 16 315s ..$ sizeof.pointer : int 8 315s ..$ sizeof.time_t : int 8 315s $ Sys.info : Named chr [1:2] "Linux" "aarch64" 315s ..- attr(*, "names")= chr [1:2] "sysname" "machine" 315s $ mpfr :List of 7 315s ..$ :List of 4 315s .. ..$ prec: int 64 315s .. ..$ exp : int [1:2] -2 -1 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:2] 0 NA 315s ..$ :List of 4 315s .. ..$ prec: int 64 315s .. ..$ exp : int [1:2] -1 -1 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:2] 0 NA 315s ..$ :List of 4 315s .. ..$ prec: int 64 315s .. ..$ exp : int [1:2] 0 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:2] 0 NA 315s ..$ :List of 4 315s .. ..$ prec: int 64 315s .. ..$ exp : int [1:2] 1 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:2] 0 NA 315s ..$ :List of 4 315s .. ..$ prec: int 64 315s .. ..$ exp : int [1:2] 2 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:2] 0 NA 315s ..$ :List of 4 315s .. ..$ prec: int 64 315s .. ..$ exp : int [1:2] 3 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:2] 0 NA 315s ..$ :List of 4 315s .. ..$ prec: int 64 315s .. ..$ exp : int [1:2] 4 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:2] 0 NA 315s - attr(*, "class")= chr "mpfrXport" 315s > str(mpfrXport(Const("pi")* 2^(-3:3))) 315s List of 5 315s $ gmp.numb.bits: int 64 315s $ mpfr.version : chr "4.2.1" 315s $ Machine :List of 5 315s ..$ sizeof.long : int 8 315s ..$ sizeof.longlong : int 8 315s ..$ sizeof.longdouble: int 16 315s ..$ sizeof.pointer : int 8 315s ..$ sizeof.time_t : int 8 315s $ Sys.info : Named chr [1:2] "Linux" "aarch64" 315s ..- attr(*, "names")= chr [1:2] "sysname" "machine" 315s $ mpfr :List of 7 315s ..$ :List of 4 315s .. ..$ prec: int 120 315s .. ..$ exp : int [1:2] -1 -1 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -2133058304 -993631605 560513588 -921707870 315s ..$ :List of 4 315s .. ..$ prec: int 120 315s .. ..$ exp : int [1:2] 0 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -2133058304 -993631605 560513588 -921707870 315s ..$ :List of 4 315s .. ..$ prec: int 120 315s .. ..$ exp : int [1:2] 1 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -2133058304 -993631605 560513588 -921707870 315s ..$ :List of 4 315s .. ..$ prec: int 120 315s .. ..$ exp : int [1:2] 2 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -2133058304 -993631605 560513588 -921707870 315s ..$ :List of 4 315s .. ..$ prec: int 120 315s .. ..$ exp : int [1:2] 3 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -2133058304 -993631605 560513588 -921707870 315s ..$ :List of 4 315s .. ..$ prec: int 120 315s .. ..$ exp : int [1:2] 4 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -2133058304 -993631605 560513588 -921707870 315s ..$ :List of 4 315s .. ..$ prec: int 120 315s .. ..$ exp : int [1:2] 5 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -2133058304 -993631605 560513588 -921707870 315s - attr(*, "class")= chr "mpfrXport" 315s > 315s > ## and a very large one 315s > mil <- mpfr(1025, 111) 315s > str(mm <- mpfrXport(xx <- mil^(2^25))) 315s List of 5 315s $ gmp.numb.bits: int 64 315s $ mpfr.version : chr "4.2.1" 315s $ Machine :List of 5 315s ..$ sizeof.long : int 8 315s ..$ sizeof.longlong : int 8 315s ..$ sizeof.longdouble: int 16 315s ..$ sizeof.pointer : int 8 315s ..$ sizeof.time_t : int 8 315s $ Sys.info : Named chr [1:2] "Linux" "aarch64" 315s ..- attr(*, "names")= chr [1:2] "sysname" "machine" 315s $ mpfr :List of 1 315s ..$ :List of 4 315s .. ..$ prec: int 111 315s .. ..$ exp : int [1:2] 335591572 0 315s .. ..$ sign: int 1 315s .. ..$ d : int [1:4] -474349568 -2023461216 -832488434 -1890623142 315s - attr(*, "class")= chr "mpfrXport" 315s > stopifnot(all.equal(log2(xx) * 2^-25, log2(mil), tol=1e-15)) 315s > 315s > ## even larger -- strictly needs extended erange: 315s > if(.mpfr_erange("min.emin") <= -2^40) { 315s + .mpfr_erange_set("Emin", - 2^40) 315s + show(xe <- 2^mpfr(-seq(1,70, by=3)*8e8, 64)) 315s + ## used to print wrongly {because of integer overflow in .mpfr2str()$exp}, 315s + ## with some exponents large positive 315s + stopifnot(exprs = { 315s + ! .mpfr_erange_is_int() # as 'exp's now are double 315s + (ee <- as.numeric(sub(".*e","", formatMpfr(xe)))) < -240e6 315s + (diff(ee) + 722471990) %in% 0:1 315s + }) 315s + } else { 315s + cat(sprintf( 315s + "Cannot set 'Emin' to -2^40 (= %g), as .mpfr_erange(\"min.emin\") is larger, 315s + namely %g.\n", 315s + - 2^40, .mpfr_erange("min.emin"))) 315s + } 315s 24 'mpfr' numbers of precision 64 bits 315s [1] 2.94316793837715924694e-240823997 7.50343587401352095291e-963295987 315s [3] 1.9129574354658573759e-1685767976 4.87697397745164731108e-2408239966 315s [5] 1.24335621565715989157e-3130711955 3.16986452287999940147e-3853183945 315s [7] 8.08138566155193403194e-4575655935 2.06030238009668925059e-5298127924 315s [9] 5.25262136371909071978e-6020599914 1.33912533699560207614e-6743071903 315s [11] 3.4140223404831125046e-7465543893 8.70385184964659379367e-8188015883 315s [13] 2.2189965227314881102e-8910487872 5.65720287173128376478e-9632959862 315s [15] 1.44227104477519513027e-10355431851 3.67698633717256500188e-11077903841 315s [17] 9.37426330004503135356e-11800375831 2.38991403177593603161e-12522847820 315s [19] 6.0929471431126458909e-13245319810 1.55336151824581934705e-13967791799 315s [21] 3.96020505297586637804e-14690263789 1.00963129814921265231e-15412735778 315s [23] 2.57399640818214045471e-16135207768 6.5622544799075640584e-16857679758 315s > 315s > ## Bill Dunlap's example (with patch about convert S_alloc bug): 315s > ## (precision increases, then decreases) 315s > z <- c(mpfr(1,8)/19, mpfr(1,32)/19, mpfr(1,24)/19) 315s > cbind(fz <- format(z)) 315s [,1] 315s [1,] "0.05273" 315s [2,] "0.052631578947" 315s [3,] "0.0526315793" 315s > stopifnot(identical(fz, rev(format(rev(z))))) 315s > stopifnot(identical(fz, c("0.05273", 315s + "0.052631578947", 315s + "0.0526315793"))) # << smaller prec, again since 2019-08-09 315s > 315s > e.xx. <- .mpfr2exp(xx) 315s > e.z. <- .mpfr2exp(z) 315s > 315s > ## revert to original 'erange' settings (which gives integer 'exp'): 315s > .mpfr_erange_set("Emax", erangesOrig[["Emax"]]) # typically 2^30 - 1 = 1073741823 315s > .mpfr_erange_set("Emin", erangesOrig[["Emin"]]) 315s > 315s > e.xx <- .mpfr2exp(xx) 315s > e.z <- .mpfr2exp(z) 315s > stopifnot(exprs = { 315s + .mpfr_erange_is_int() 315s + e.xx == e.xx. 315s + e.xx == 335591572 315s + e.z == e.z. 315s + e.z == -4 315s + is.integer(e.xx) # but e.xx. is double 315s + is.integer(e.z) 315s + }) 315s > 315s > k1 <- mpfr( c(123, 1234, 12345, 123456), precBits=2) 315s > (N1 <- asNumeric(k1))# 128 1024 12288 131072 -- correct 315s [1] 128 1024 12288 131072 315s > str(sk1 <- .mpfr2str(k1)) 315s List of 4 315s $ str : chr [1:4] "13" "10" "12" "13" 315s $ exp : int [1:4] 3 4 5 6 315s $ finite: logi [1:4] TRUE TRUE TRUE TRUE 315s $ is.0 : logi [1:4] FALSE FALSE FALSE FALSE 315s > str(sk1. <- .mpfr2str(k1, maybe.full=TRUE)) 315s List of 4 315s $ str : chr [1:4] "128" "1024" "12288" "131072" 315s $ exp : int [1:4] 3 4 5 6 315s $ finite: logi [1:4] TRUE TRUE TRUE TRUE 315s $ is.0 : logi [1:4] FALSE FALSE FALSE FALSE 315s > str(sk1.2 <- .mpfr2str(k1, digits=2, base=2)) 315s List of 4 315s $ str : chr [1:4] "10" "10" "11" "10" 315s $ exp : int [1:4] 8 11 14 18 315s $ finite: logi [1:4] TRUE TRUE TRUE TRUE 315s $ is.0 : logi [1:4] FALSE FALSE FALSE FALSE 315s > str(sk1.2F <- .mpfr2str(k1, maybe.full=TRUE, base=2)) 315s List of 4 315s $ str : chr [1:4] "10000000" "10000000000" "11000000000000" "100000000000000000" 315s $ exp : int [1:4] 8 11 14 18 315s $ finite: logi [1:4] TRUE TRUE TRUE TRUE 315s $ is.0 : logi [1:4] FALSE FALSE FALSE FALSE 315s > stopifnot(exprs = { 315s + identical(sk1 [1:2], list(str = c("13", "10", "12", "13"), exp = 3:6)) 315s + identical(sk1.[1:2], list(str = c("128", "1024", "12288", "131072"), exp = 3:6)) 315s + identical(sk1.2, list(str = c("10", "10", "11", "10"), 315s + exp = c( 8L, 11L, 14L, 18L), 315s + finite = rep(TRUE, 4), is.0 = rep(FALSE, 4))) 315s + all.equal(sk1.2[2:4], .mpfr_formatinfo(k1), tol=0) # not identical(): int <-> double 315s + identical(formatMpfr(k1, base=2, digits=20, drop0trailing=TRUE), 315s + with(sk1.2, paste0(str, sapply(exp - nchar(str), strrep, x="0")))) 315s + identical(formatMpfr(k1, base=2, digits=2, exponent.plus=FALSE), 315s + c("1.0e7", "1.0e10", "1.1e13", "1.0e17")) 315s + }) 315s > ## MM: --> need_dig is fine but is not used in the string that is returned !! 315s > 315s > (fk1sF <- formatMpfr(k1, scientific=FALSE)) # "the bug" --- now fixed! ==> new "Bug" in new Rmpfr ???? 315s [1] "128." "1024." "12288." "131072." 315s > ## was "128." "1024." "12288." "131072." , but now obeying internal precision gives 315s > ## "1.e2" "1.e3" "1.e4" "1.e5" 315s > (fk1 <- formatMpfr(k1, digits=6)) 315s [1] "128.000" "1024.00" "12288.0" "131072." 315s > stopifnot(exprs = { 315s + N1 == as.numeric(fk1) 315s + ## FIXME: This should change again "1024" 315s + identical(format(k1, digits=3), c("128.", "1020.", "1.23e+4", "1.31e+5")) 315s + }) 315s > ## 315s > digs <- setNames(1:6, 1:6) 315s > ## Each of these are 4 x 6 matrices 315s > ffix <- sapply(digs, function(d) format(k1, digits = d, scientific = FALSE)) ## *not* good at all .. 315s > ## ==> need a maybe.full=TRUE even here 315s > ff <- sapply(digs, function(d) format(k1, digits = d))# sci..fic = NA -- digits=1 failing for '128' 315s > fsci <- sapply(digs, function(d) format(k1, digits = d, scientific = TRUE)) # perfect 315s > stopifnot(exprs = { 315s + length(dd <- dim(ff)) == 2 315s + identical(dd, dim(ffix)) 315s + identical(dd, dim(fsci)) 315s + all.equal(asNumeric(fsci), asNumeric(ffix) -> dmat, tol=0) 315s + all.equal(asNumeric(ff), asNumeric(ffix), tol=0) 315s + }) 315s > rE <- 1 - dmat / asNumeric(k1) 315s > i <- 1:5 315s > summary(fm <- lm(log10(colMeans(abs(rE)))[i] ~ i)) 315s 315s Call: 315s lm(formula = log10(colMeans(abs(rE)))[i] ~ i) 315s 315s Residuals: 315s 1 2 3 4 5 315s -0.12076 0.06070 0.10167 0.09761 -0.13922 315s 315s Coefficients: 315s Estimate Std. Error t value Pr(>|t|) 315s (Intercept) 0.49710 0.14522 3.423 0.041747 * 315s i -1.15528 0.04378 -26.386 0.000119 *** 315s --- 315s Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 315s 315s Residual standard error: 0.1385 on 3 degrees of freedom 315s Multiple R-squared: 0.9957, Adjusted R-squared: 0.9943 315s F-statistic: 696.2 on 1 and 3 DF, p-value: 0.0001194 315s 315s > stopifnot(exprs = { 315s + rE[ cbind(FALSE, upper.tri(rE)[,-6]) ] == 0 315s + abs(residuals(fm)) < 0.15 315s + }) 315s > 315s > ## formatting / printing : 315s > tenth <- mpfr(-12:12, 52)/10 315s > cents <- mpfr(-11:11, 64)/100 315s > (kxi <- sort(c(k1, x4, i8, tenth, cents), na.last=FALSE)) 315s 64 'mpfr' numbers of precision 2 .. 64 bits 315s [1] NaN NaN 315s [3] -Inf -2 315s [5] -1.2000000000000002 -1.1000000000000001 315s [7] -1 -1 315s [9] -0.89999999999999991 -0.80000000000000004 315s [11] -0.69999999999999996 -0.60000000000000009 315s [13] -0.5 -0.40000000000000002 315s [15] -0.30000000000000004 -0.20000000000000001 315s [17] -0.109999999999999999999 -0.10000000000000001 315s [19] -0.100000000000000000001 -0.0900000000000000000033 315s [21] -0.0799999999999999999984 -0.0700000000000000000003 315s [23] -0.0599999999999999999988 -0.0500000000000000000007 315s [25] -0.0399999999999999999992 -0.0299999999999999999994 315s [27] -0.0199999999999999999996 -0.0099999999999999999998 315s [29] 0 0 315s [31] 0 0.0099999999999999999998 315s [33] 0.0199999999999999999996 0.0299999999999999999994 315s [35] 0.0399999999999999999992 0.0500000000000000000007 315s [37] 0.0599999999999999999988 0.0700000000000000000003 315s [39] 0.0799999999999999999984 0.0900000000000000000033 315s [41] 0.100000000000000000001 0.10000000000000001 315s [43] 0.109999999999999999999 0.20000000000000001 315s [45] 0.30000000000000004 0.40000000000000002 315s [47] 0.5 0.60000000000000009 315s [49] 0.69999999999999996 0.80000000000000004 315s [51] 0.89999999999999991 1 315s [53] 1 1.1000000000000001 315s [55] 1.2000000000000002 2 315s [57] 3 4 315s [59] 5 130 315s [61] 1e+3 1.2e+4 315s [63] 1.3e+5 Inf 315s > mstr <- .mpfr2str (kxi) 315s > mfi <- .mpfr_formatinfo(kxi) 315s > es <- mstr$exp # base 10 ; with '0' when !is.finite or is0 315s > ef <- mfi $exp # base 2 ; "undefined" when !is.finite or is0 315s > j2 <- c("finite", "is.0") 315s > dxi <- cbind(x = asNumeric(kxi), prec = .getPrec(kxi), 315s + as.data.frame(mstr, stringsAsFactors = FALSE)) 315s > stopifnot(is.data.frame(dxi), identical(mstr$str, dxi[,"str"]), 315s + identical(mstr[j2], mfi[j2]), 315s + identical(ef, .mpfr2exp(kxi))) 315s > dxi ## 2019-08-09: again *varying* size of 'str' rather than only growing !! 315s x prec str exp finite is.0 315s 1 NaN 32 @NaN@ 0 FALSE FALSE 315s 2 NaN 32 @NaN@ 0 FALSE FALSE 315s 3 -Inf 32 -@Inf@ 0 FALSE FALSE 315s 4 -2.00 32 -20000000000 1 TRUE FALSE 315s 5 -1.20 52 -12000000000000002 1 TRUE FALSE 315s 6 -1.10 52 -11000000000000001 1 TRUE FALSE 315s 7 -1.00 32 -10000000000 1 TRUE FALSE 315s 8 -1.00 52 -10000000000000000 1 TRUE FALSE 315s 9 -0.90 52 -89999999999999991 0 TRUE FALSE 315s 10 -0.80 52 -80000000000000004 0 TRUE FALSE 315s 11 -0.70 52 -69999999999999996 0 TRUE FALSE 315s 12 -0.60 52 -60000000000000009 0 TRUE FALSE 315s 13 -0.50 52 -50000000000000000 0 TRUE FALSE 315s 14 -0.40 52 -40000000000000002 0 TRUE FALSE 315s 15 -0.30 52 -30000000000000004 0 TRUE FALSE 315s 16 -0.20 52 -20000000000000001 0 TRUE FALSE 315s 17 -0.11 64 -109999999999999999999 0 TRUE FALSE 315s 18 -0.10 52 -10000000000000001 0 TRUE FALSE 315s 19 -0.10 64 -100000000000000000001 0 TRUE FALSE 315s 20 -0.09 64 -900000000000000000033 -1 TRUE FALSE 315s 21 -0.08 64 -799999999999999999984 -1 TRUE FALSE 315s 22 -0.07 64 -700000000000000000003 -1 TRUE FALSE 315s 23 -0.06 64 -599999999999999999988 -1 TRUE FALSE 315s 24 -0.05 64 -500000000000000000007 -1 TRUE FALSE 315s 25 -0.04 64 -399999999999999999992 -1 TRUE FALSE 315s 26 -0.03 64 -299999999999999999994 -1 TRUE FALSE 315s 27 -0.02 64 -199999999999999999996 -1 TRUE FALSE 315s 28 -0.01 64 -999999999999999999980 -2 TRUE FALSE 315s 29 0.00 32 0 0 TRUE TRUE 315s 30 0.00 52 0 0 TRUE TRUE 315s 31 0.00 64 0 0 TRUE TRUE 315s 32 0.01 64 999999999999999999980 -2 TRUE FALSE 315s 33 0.02 64 199999999999999999996 -1 TRUE FALSE 315s 34 0.03 64 299999999999999999994 -1 TRUE FALSE 315s 35 0.04 64 399999999999999999992 -1 TRUE FALSE 315s 36 0.05 64 500000000000000000007 -1 TRUE FALSE 315s 37 0.06 64 599999999999999999988 -1 TRUE FALSE 315s 38 0.07 64 700000000000000000003 -1 TRUE FALSE 315s 39 0.08 64 799999999999999999984 -1 TRUE FALSE 315s 40 0.09 64 900000000000000000033 -1 TRUE FALSE 315s 41 0.10 64 100000000000000000001 0 TRUE FALSE 315s 42 0.10 52 10000000000000001 0 TRUE FALSE 315s 43 0.11 64 109999999999999999999 0 TRUE FALSE 315s 44 0.20 52 20000000000000001 0 TRUE FALSE 315s 45 0.30 52 30000000000000004 0 TRUE FALSE 315s 46 0.40 52 40000000000000002 0 TRUE FALSE 315s 47 0.50 52 50000000000000000 0 TRUE FALSE 315s 48 0.60 52 60000000000000009 0 TRUE FALSE 315s 49 0.70 52 69999999999999996 0 TRUE FALSE 315s 50 0.80 52 80000000000000004 0 TRUE FALSE 315s 51 0.90 52 89999999999999991 0 TRUE FALSE 315s 52 1.00 32 10000000000 1 TRUE FALSE 315s 53 1.00 52 10000000000000000 1 TRUE FALSE 315s 54 1.10 52 11000000000000001 1 TRUE FALSE 315s 55 1.20 52 12000000000000002 1 TRUE FALSE 315s 56 2.00 32 20000000000 1 TRUE FALSE 315s 57 3.00 32 30000000000 1 TRUE FALSE 315s 58 4.00 32 40000000000 1 TRUE FALSE 315s 59 5.00 32 50000000000 1 TRUE FALSE 315s 60 128.00 2 13 3 TRUE FALSE 315s 61 1024.00 2 10 4 TRUE FALSE 315s 62 12288.00 2 12 5 TRUE FALSE 315s 63 131072.00 2 13 6 TRUE FALSE 315s 64 Inf 32 @Inf@ 0 FALSE FALSE 315s > ## Show that *order* no longer matters: 315s > n <- length(ixk <- rev(kxi)) 315s > dix <- cbind(x = asNumeric(ixk), prec = .getPrec(ixk), 315s + as.data.frame(.mpfr2str(ixk), stringsAsFactors = FALSE))[n:1,] 315s > attr(dix, "row.names") <- .set_row_names(n) 315s > stopifnot(identical(dxi, dix)) 315s > 315s > 315s > ## somewhat (but not so much) revealing : 315s > cbind(prec = .getPrec(kxi), kxi = asNumeric(kxi), str = es, 315s + fi.10 = ceiling(ef/log2(10)), str.2 = as.integer(es*log2(10)), fi = ef) 315s prec kxi str fi.10 str.2 fi 315s [1,] 32 NaN 0 1 0 2 315s [2,] 32 NaN 0 1 0 2 315s [3,] 32 -Inf 0 1 0 3 315s [4,] 32 -2.00 1 1 3 2 315s [5,] 52 -1.20 1 1 3 1 315s [6,] 52 -1.10 1 1 3 1 315s [7,] 32 -1.00 1 1 3 1 315s [8,] 52 -1.00 1 1 3 1 315s [9,] 52 -0.90 0 0 0 0 315s [10,] 52 -0.80 0 0 0 0 315s [11,] 52 -0.70 0 0 0 0 315s [12,] 52 -0.60 0 0 0 0 315s [13,] 52 -0.50 0 0 0 0 315s [14,] 52 -0.40 0 0 0 -1 315s [15,] 52 -0.30 0 0 0 -1 315s [16,] 52 -0.20 0 0 0 -2 315s [17,] 64 -0.11 0 0 0 -3 315s [18,] 52 -0.10 0 0 0 -3 315s [19,] 64 -0.10 0 0 0 -3 315s [20,] 64 -0.09 -1 0 -3 -3 315s [21,] 64 -0.08 -1 0 -3 -3 315s [22,] 64 -0.07 -1 0 -3 -3 315s [23,] 64 -0.06 -1 -1 -3 -4 315s [24,] 64 -0.05 -1 -1 -3 -4 315s [25,] 64 -0.04 -1 -1 -3 -4 315s [26,] 64 -0.03 -1 -1 -3 -5 315s [27,] 64 -0.02 -1 -1 -3 -5 315s [28,] 64 -0.01 -2 -1 -6 -6 315s [29,] 32 0.00 0 1 0 1 315s [30,] 52 0.00 0 1 0 1 315s [31,] 64 0.00 0 1 0 1 315s [32,] 64 0.01 -2 -1 -6 -6 315s [33,] 64 0.02 -1 -1 -3 -5 315s [34,] 64 0.03 -1 -1 -3 -5 315s [35,] 64 0.04 -1 -1 -3 -4 315s [36,] 64 0.05 -1 -1 -3 -4 315s [37,] 64 0.06 -1 -1 -3 -4 315s [38,] 64 0.07 -1 0 -3 -3 315s [39,] 64 0.08 -1 0 -3 -3 315s [40,] 64 0.09 -1 0 -3 -3 315s [41,] 64 0.10 0 0 0 -3 315s [42,] 52 0.10 0 0 0 -3 315s [43,] 64 0.11 0 0 0 -3 315s [44,] 52 0.20 0 0 0 -2 315s [45,] 52 0.30 0 0 0 -1 315s [46,] 52 0.40 0 0 0 -1 315s [47,] 52 0.50 0 0 0 0 315s [48,] 52 0.60 0 0 0 0 315s [49,] 52 0.70 0 0 0 0 315s [50,] 52 0.80 0 0 0 0 315s [51,] 52 0.90 0 0 0 0 315s [52,] 32 1.00 1 1 3 1 315s [53,] 52 1.00 1 1 3 1 315s [54,] 52 1.10 1 1 3 1 315s [55,] 52 1.20 1 1 3 1 315s [56,] 32 2.00 1 1 3 2 315s [57,] 32 3.00 1 1 3 2 315s [58,] 32 4.00 1 1 3 3 315s [59,] 32 5.00 1 1 3 3 315s [60,] 2 128.00 3 3 9 8 315s [61,] 2 1024.00 4 4 13 11 315s [62,] 2 12288.00 5 5 16 14 315s [63,] 2 131072.00 6 6 19 18 315s [64,] 32 Inf 0 1 0 3 315s > 315s > 315s > 315s > ## Bug example from RMH 2018-03-16 : 315s > (x <- mpfr(c(65, 650, 6500, 65000, 650000), precBits=6)) 315s 5 'mpfr' numbers of precision 6 bits 315s [1] 64 656 6530 6.45e+4 6.55e+5 315s > data.frame(fDec = formatDec(x), f = formatMpfr(x)) 315s fDec f 315s 1 64.0 64.0 315s 2 656. 656. 315s 3 6530. 6530. 315s 4 6.45e+4 6.45e+4 315s 5 6.55e+5 6.55e+5 315s > x. <- as.numeric(xDec <- formatDec(x)) 315s > stopifnot(abs(x - x.) <= c(0, 0, 2, 12, 360)) 315s > 315s > cat("Checking compatibility .mpfr_formatinfo() <--> .mpfr2str(*, base=2) :\n") 315s Checking compatibility .mpfr_formatinfo() <--> .mpfr2str(*, base=2) : 315s > for(nm in ls()) 315s + if(is(OO <- get(nm), "mpfr")) { 315s + cat(nm,": str(*) :\n"); str(OO); cat("compatibility: ") 315s + I <- .mpfr_formatinfo(OO) 315s + S <- .mpfr2str(OO, base = 2L) 315s + if(identical(I, S[-1])) 315s + cat("[Ok]\n") 315s + else { 315s + if(any(B <- !I$finite)) I$exp[B] <- S$exp[B] 315s + if(any(B <- I $ is.0)) I$exp[B] <- S$exp[B] 315s + if(identical(I, S[-1])) 315s + cat(" after fixup [Ok]\n") 315s + else 315s + stop(".mpfr_formatinfo(*) and .mpfr2str(*, base=2) do not match") 315s + } 315s + } 315s cents : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 23 and precision 64 315s -0.11 -0.1 -0.09 -0.08 -0.07 -0.06 -0.05 -0.04 -0.03 -0.02 -0.01 0 ... 315s compatibility: after fixup [Ok] 315s i8 : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 8 and precision 32 315s -2 -1 0 1 2 3 4 5 315s compatibility: after fixup [Ok] 315s ixk : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 64 and precisions 2..64 315s Inf 131072 12288 ... 315s compatibility: after fixup [Ok] 315s k1 : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 4 and precision 2 315s 1.e+2 1.e+3 1.e+4 1.e+5 315s compatibility: [Ok] 315s kxi : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 64 and precisions 2..64 315s NaN NaN -Inf -2 -1.2 ... 315s compatibility: after fixup [Ok] 315s L : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 1 and precision 100 315s 1.00328815073e+84509804 315s compatibility: [Ok] 315s L3 : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 1 and precision 100 315s 1.00989692356e+253529412 315s compatibility: [Ok] 315s mil : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 1 and precision 111 315s 1025 315s compatibility: [Ok] 315s r : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 1 and precision 100 315s 7.97921166432e-846 315s compatibility: [Ok] 315s r2 : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 1 and precision 100 315s 1.57035764922e-84510 315s compatibility: [Ok] 315s rv : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 3 and precision 100 315s 7.97921166432e-846 1.57035764922e-84510 1.00328815073e+84509804 315s compatibility: [Ok] 315s tenth : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 25 and precision 52 315s -1.2 -1.1 -1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 ... 315s compatibility: after fixup [Ok] 315s x : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 5 and precision 6 315s 64 660 6.5e+3 6.5e+4 6.6e+5 315s compatibility: [Ok] 315s x4 : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 4 and precision 32 315s NaN NaN -Inf Inf 315s compatibility: after fixup [Ok] 315s xe : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 24 and precision 64 315s 2.94316793838e-240823997 7.50343587401e-963295987 ... 315s compatibility: [Ok] 315s xx : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 1 and precision 111 315s 1.62954142022e+101023129 315s compatibility: [Ok] 315s z : str(*) : 315s Class 'mpfr' [package "Rmpfr"] of length 3 and precisions 8..32 315s 0.052734375 0.05263157895 0.05263157934 315s compatibility: [Ok] 315s > 315s BEGIN TEST matrix-ex.R 315s 315s R version 4.4.3 (2025-02-28) -- "Trophy Case" 315s Copyright (C) 2025 The R Foundation for Statistical Computing 315s Platform: aarch64-unknown-linux-gnu 315s 315s R is free software and comes with ABSOLUTELY NO WARRANTY. 315s You are welcome to redistribute it under certain conditions. 315s Type 'license()' or 'licence()' for distribution details. 315s 315s R is a collaborative project with many contributors. 315s Type 'contributors()' for more information and 315s 'citation()' on how to cite R or R packages in publications. 315s 315s Type 'demo()' for some demos, 'help()' for on-line help, or 315s 'help.start()' for an HTML browser interface to help. 315s Type 'q()' to quit R. 315s 315s > stopifnot(require("Rmpfr")) 315s Loading required package: Rmpfr 315s Loading required package: gmp 315s 315s Attaching package: ‘gmp’ 315s 315s The following objects are masked from ‘package:base’: 315s 315s %*%, apply, crossprod, matrix, tcrossprod 315s 315s C code of R package 'Rmpfr': GMP using 64 bits per limb 315s 315s 315s Attaching package: ‘Rmpfr’ 315s 315s The following object is masked from ‘package:gmp’: 315s 315s outer 315s 315s The following objects are masked from ‘package:stats’: 315s 315s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 315s 315s The following objects are masked from ‘package:base’: 315s 315s cbind, pmax, pmin, rbind 315s 315s > 315s > x <- mpfr(0:7, 64)/7 315s > mx <- x 315s > dim(mx) <- c(4,2) 315s > (m. <- mx) # "print" 315s 'mpfrMatrix' of dim(.) = (4, 2) of precision 64 bits 315s [,1] [,2] 315s [1,] 0. 0.571428571428571428564 315s [2,] 0.142857142857142857141 0.714285714285714285691 315s [3,] 0.285714285714285714282 0.857142857142857142873 315s [4,] 0.428571428571428571436 1.00000000000000000000 315s > m.[,2] <- Const("pi", 80) 315s > m.[,] <- exp(mpfr(1, 90)) 315s > stopifnot(is(mx, "mpfrMatrix"), dim(mx) == c(4,2), 315s + is(m., "mpfrMatrix"), dim(m.) == dim(mx), 315s + dim(is.finite(mx)) == dim(mx), 315s + dim(is.nan(mx)) == dim(mx), 315s + getPrec(m.) == 90) 315s > 315s > xx <- (0:7)/7 315s > m.x <- matrix(xx, 4,2) 315s > m2 <- mpfr(xx, 64); dim(m2) <- dim(m.x) 315s > ## 315s > u <- 10*(1:4) 315s > y <- 7 * mpfr(1:12, 80) 315s > my <- y 315s > dim(my) <- 3:4 315s > m.y <- asNumeric(my) 315s > stopifnot(all.equal(m2, mpfr(m.x, 64), tol=0), # not identical(..) 315s + my[2,2] == 35, 315s + my[,1] == 7*(1:3)) 315s > 315s > .N <- function(x) { if(!is.null(dim(x))) as(x,"array") else as(x,"numeric") } 315s > noDN <- function(.) { dimnames(.) <- NULL ; . } 315s > allEQ <- function(x,y) all.equal(x,y, tol=1e-15) 315s > 315s > ## FIXME write "functions" that take x -> {mx , m.x} and run the following as *function* 315s > ## ---- then use previous case *and* cases with NA's ! 315s > ## and use higher precision via fPrec = 2 etc ... 315s > 315s > stopifnot(allEQ(m.x, noDN(.N(mx))), 315s + allEQ(m.y, noDN(.N(my))), 315s + allEQ(noDN(.N(my %*% mx)), m.y %*% m.x), 315s + allEQ(noDN(.N(crossprod(mx, t(my)))), crossprod(m.x, t(m.y))), 315s + allEQ(noDN(.N(tcrossprod(my, t(mx)))), 315s + tcrossprod(m.y, t(m.x))), 315s + ## 315s + identical(mx, t(t(mx))), 315s + identical(my, t(t(my))), 315s + ## matrix o vector .. even vector o vector 315s + identical(noDN(.N(my %*% 1:4)), m.y %*% 1:4 ), 315s + identical(noDN(.N(my %*% my[2,])), m.y %*% .N(my[2,])), 315s + identical( crossprod(1:3, my), 1:3 %*% my), 315s + identical(tcrossprod(1:4, my), 1:4 %*% t(my)), 315s + identical(crossprod(y), t(y) %*% y), 315s + identical(tcrossprod(y), y %*% t(y)), 315s + identical(noDN(.N( crossprod(y))), crossprod(7 * 1:12)), 315s + identical(noDN(.N(tcrossprod(y))),tcrossprod(7 * 1:12)), 315s + identical(tcrossprod(1:3, u), noDN(.N(tcrossprod(1:3, as(u,"mpfr"))))) 315s + ) 316s > 316s > mx[3,1] <- Const("pi", 64) 316s > stopifnot(allEQ(sum(mx[,1]), pi + 4/7)) 316s > m2 <- mx[c(1,4),] 316s > stopifnot(dim(m2) == c(2,2), sum(m2) == 2) 316s > Note: method with signature ‘mpfrArray#mpfr’ chosen for function ‘==’, 316s target signature ‘mpfrMatrix#mpfrMatrix’. 316s " 316s > ## "mpfrArray" o "mpfr" : 316s > Tmx <- array(TRUE, dim(mx), dimnames=dimnames(mx)) 316s > stopifnot(identical(Tmx, mx == (mx - mpfr(0, 10))), 316s + identical(Tmx, mx - mpfr(1, 10) * mx == 0)) 316s mpfr#mpfrArray" would also be valid 316s > ## subassignment, many kinds 316s > mx[5] <- pi 316s > mx[6] <- Const("pi",100) 316s > stopifnot(validObject(mx), allEQ(mx[5], mx[6]), 316s + getPrec(mx) == c(rep(64,5), 100, 64,64)) 316s > 316s > ## %*% with vectors on LHS, ... 316s > y <- t(2:4) # 1 x 3 matrix 316s > m1 <- (0:10) %*% y 316s > m2 <- mpfr(0:10, 50) %*% y 316s > stopifnot((d <- m1 - m2) == 0, identical(dim(m1), dim(d)), 316s + m2 == m1, m1 == m2) 316s > 316s > r <- 10*(0:4) 316s > y <- t(2:6) 316s > m1 <- 1:3 %*% y %*% r 316s > y. <- t(mpfr(2:6, 20)) 316s > m2 <- 1:3 %*% y. %*% r 316s > stopifnot(m1 == m2, m1 - m2 == 0, identical(dim(m1), dim(m2))) 316s > 316s > ### Array (non-matrix) ---- indexing & sub-assignment : 316s > A <- mpfrArray(1:24, prec = 96, dim = 2:4) 316s > a <- array(1:24, dim = 2:4) 316s > a.1 <- as(A[,,1], "array") 316s > a1. <- as(A[1,,], "array") 316s > A1. <- as(A[1,,], "mpfr") 316s > 316s > stopifnot(all.equal(noDN(a.1), a[,,1], tol=0), 316s + identical(A1., as.vector(A[1,,])), 316s + ## arithmetic, subsetting etc: 316s + allEQ(noDN(.N(A / A1.)), a/c(a1.)), 316s + allEQ(noDN(.N(a / A1.)), a/c(a1.)), 316s + identical(noDN(A == 23), a == 23), 316s + identical(noDN(10 >= A), 10 >= a), 316s + identical(noDN(A <= 2), a <= 2), 316s + identical(noDN(A < 2.5), a < 2.5), 316s + identical(noDN(A != 5), a != 5), 316s + identical(A != 3, !(3 == A)), 316s + identical(-1 > A, A == 100), 316s + identical(noDN(A <= 0), a == pi) 316s + ) 316s > 316s > A[1,2,3] <- Const("pi") 316s > A[1, ,2] <- 1 / A[1,,2] 316s > A 316s 'mpfrArray' of dim(.) = (2, 3, 4) of precision 96 .. 120 bits 316s , , 1 316s 316s [,1] [,2] 316s [1,] 1.00000000000000000000000000000 3.00000000000000000000000000000 316s [2,] 2.00000000000000000000000000000 4.00000000000000000000000000000 316s [,3] 316s [1,] 5.00000000000000000000000000000 316s [2,] 6.00000000000000000000000000000 316s 316s , , 2 316s 316s [,1] [,2] 316s [1,] 0.142857142857142857142857142858 0.111111111111111111111111111111 316s [2,] 8.00000000000000000000000000000 10.0000000000000000000000000000 316s [,3] 316s [1,] 0.0909090909090909090909090909098 316s [2,] 12.0000000000000000000000000000 316s 316s , , 3 316s 316s [,1] [,2] 316s [1,] 13.0000000000000000000000000000 3.1415926535897932384626433832795028847 316s [2,] 14.0000000000000000000000000000 16.0000000000000000000000000000 316s [,3] 316s [1,] 17.0000000000000000000000000000 316s [2,] 18.0000000000000000000000000000 316s 316s , , 4 316s 316s [,1] [,2] 316s [1,] 19.0000000000000000000000000000 21.0000000000000000000000000000 316s [2,] 20.0000000000000000000000000000 22.0000000000000000000000000000 316s [,3] 316s [1,] 23.0000000000000000000000000000 316s [2,] 24.0000000000000000000000000000 316s 316s > 316s > ## check that A is "==" a where 316s > a <- array(1:24, 2:4); a[1,2,3] <- pi; a[1,,2] <- 1/a[1,,2] 316s > stopifnot(allEQ(noDN(.N(A)), a), 316s + ## check aperm() methods : 316s + allEQ(noDN(.N(aperm(A))), aperm(a)), 316s + {p <- c(3,1:2); allEQ(noDN(.N(aperm(A,p))), aperm(a,p))}, 316s + {p <- c(2:1,3); allEQ(noDN(.N(aperm(A,p))), aperm(a,p))}) 316s > 316s > ## cbind() / rbind(): 316s > options(warn = 2)## no warnings here - ("exact recycling"): 316s > validObject(m0 <- cbind(pi=pi, i = 1:6)) 316s [1] TRUE 316s > validObject(m1 <- cbind(a=Const("pi",60),i = 1:6, "1/mp" = 1/mpfr(1:3,70))) 316s [1] TRUE 316s > validObject(m2 <- cbind(pi=pi, i = 1:2, 1/mpfr(1:6,70))) 316s [1] TRUE 316s > validObject(n2 <- rbind(pi=pi, i = 1:2, 1/mpfr(1:6,70))) 316s [1] TRUE 316s > stopifnot(is(m0,"matrix"), is(m1, "mpfrMatrix"), is(m2, "mpfrMatrix"), 316s + dim(m0) == c(6,2), dim(m1) == c(6,3), dim(m2) == c(6,3)) 316s > options(warn = 1) 316s > suppressWarnings(eval(ex <- quote(m3 <- cbind(I=10, 1:3, inv=1/mpfr(2:3,80))))) 316s > validObject(suppressWarnings( n3 <- rbind(I=10, 1:3, inv=1/mpfr(2:3,80)))) 316s [1] TRUE 316s > stopifnot(identical(t(n2), m2), 316s + identical(t(n3), m3), validObject(m3), 316s + is(tryCatch(eval(ex), warning=function(.).), "warning"), 316s + identical(cbind("A", "c"), matrix(c("A", "c"), 1,2)), 316s + identical(rbind("A", 2), matrix(c("A", "2"), 2,1)) ) 316s > 316s > ## head() / tail() : 316s > stopifnot(all.equal(c(21, 12), 316s + dim(mm3 <- m3[rep(1:3, each=7), rep(3:1, 4)])), 316s + all.equal(dim(t3 <- tail(mm3)), c(6, 12)), 316s + all.equal(head(mm3), mm3[1:6,])) 316s > 316s > ## matrix() works since 2015-02-28: 316s > x <- mpfr(pi,64)*mpfr(2,64)^(2^(0:19)) 316s > (mx <- matrix(x, 4,5)) 316s 'mpfrMatrix' of dim(.) = (4, 5) of precision 64 bits 316s [,1] [,2] 316s [1,] 6.28318530717958623200 205887.416145660681650 316s [2,] 12.5663706143591724640 13493037704.5220184326 316s [3,] 50.2654824574366898560 57952155664616980480.0 316s [4,] 804.247719318987037695 1.06902858406496670619e+39 316s [,3] [,4] 316s [1,] 3.63771576891766310100e+77 3.28104443733842154527e+1233 316s [2,] 4.21218708934506345775e+154 3.42668632977872042983e+2466 316s [3,] 5.64761954589225685791e+308 3.73765172555867836946e+4932 316s [4,] 1.01526868859647402324e+617 4.44680197657346404992e+9864 316s [,5] 316s [1,] 6.29427491061341831593e+19728 316s [2,] 1.26107681736228617526e+39457 316s [3,] 5.06212903659356755184e+78913 316s [4,] 8.15673870189463167140e+157826 316s > 316s > stopifnot(is(mx, "mpfrMatrix"), 316s + all.equal(matrix(0:19, 4,5), 316s + asNumeric(log2(log2(mx) - log2(Const("pi")))), 316s + tol = 1e-15)) # 64b-lnx: see 8.1e-17 316s > 316s > 316s > ## Ensure that apply() continues to work with 'bigz'/'bigq' 316s > A <- matrix(2^as.bigz(1:12), 3,4) 316s > Aq <- as.bigq(A) 316s > mA <- as(A, "mpfr") # failed {as dim(A) is "double", not "integer"} 316s > (Qm <- A / (A^2 - 1)) # big rational matrix 316s Big Rational ('bigq') 3 x 4 matrix: 316s [,1] [,2] [,3] [,4] 316s [1,] 2/3 16/255 128/16383 1024/1048575 316s [2,] 4/15 32/1023 256/65535 2048/4194303 316s [3,] 8/63 64/4095 512/262143 4096/16777215 316s > MQ <- mpfr(Qm, precBits = 64) 316s > stopifnot(exprs = { 316s + mA == A 316s + mA == Aq 316s + is.bigq(Aq) 316s + mA == mpfr(A, precBits=16) 316s + mA == asNumeric(A) 316s + is.bigq(Qm) 316s + is(MQ, "mpfrMatrix") 316s + all.equal(Qm, MQ, tol = 1e-18) 316s + identical(dim(mA), dim(A)) 316s + identical(dim(mA), dim(Qm)) 316s + identical(asNumeric(apply(A, 1, min)), 316s + apply(asNumeric(A), 1, min)) 316s + identical(asNumeric(apply(A, 1, max)), 316s + apply(asNumeric(A), 1, max)) 316s + identical(asNumeric(apply(A, 2, max)), 316s + apply(asNumeric(A), 2, max)) 316s + identical(asNumeric(apply(A, 2, min)), 316s + apply(asNumeric(A), 2, min)) 316s + }) 316s Warning in getPrec(x) : 316s default precision for 'bigq' arbitrarily chosen as 128 316s > ## mA etc, failed up to Rmpfr 0.8-1; the apply() parts failed up to Rmpfr 0.6.0 316s > 316s > if(FALSE) ## Bug in gmp : apply(*, range) does *not* return matrix 316s + stopifnot( 316s + identical(asNumeric(apply(A, 1, range)), 316s + apply(asNumeric(A), 1, range)) 316s + ) 316s > 316s > if(FALSE) ## Bug in gmp : --- no mean method for bigz, just mean.bigq 316s + stopifnot( 316s + all.equal(asNumeric(apply(A, 1, mean)), 316s + apply(asNumeric(A), 1, mean)) 316s + , 316s + all.equal(asNumeric(apply(A, 2, mean)), 316s + apply(asNumeric(A), 2, mean)) 316s + ) 316s > 316s > cat('Time elapsed: ', proc.time(),'\n') # "stats" 316s Time elapsed: 1.137 0.058 1.199 0 0.003 316s > if(!interactive()) warnings() 316s > 316s BEGIN TEST special-fun-ex.R 316s 316s R version 4.4.3 (2025-02-28) -- "Trophy Case" 316s Copyright (C) 2025 The R Foundation for Statistical Computing 316s Platform: aarch64-unknown-linux-gnu 316s 316s R is free software and comes with ABSOLUTELY NO WARRANTY. 316s You are welcome to redistribute it under certain conditions. 316s Type 'license()' or 'licence()' for distribution details. 316s 316s R is a collaborative project with many contributors. 316s Type 'contributors()' for more information and 316s 'citation()' on how to cite R or R packages in publications. 316s 316s Type 'demo()' for some demos, 'help()' for on-line help, or 316s 'help.start()' for an HTML browser interface to help. 316s Type 'q()' to quit R. 316s 316s Loading required package: Rmpfr 316s > stopifnot(require("Rmpfr")) 316s Loading required package: gmp 316s 316s Attaching package: ‘gmp’ 316s 316s The following objects are masked from ‘package:base’: 316s 316s %*%, apply, crossprod, matrix, tcrossprod 316s 317s C code of R package 'Rmpfr': GMP using 64 bits per limb 317s 317s 317s Attaching package: ‘Rmpfr’ 317s 317s The following object is masked from ‘package:gmp’: 317s 317s outer 317s 317s > (doExtras <- Rmpfr:::doExtras()) 317s [1] FALSE 317s > options(nwarnings = 50000, width = 99) 317s > 317s > (do.pdf <- !dev.interactive(orNone = TRUE)) 317s [1] TRUE 317s > if(do.pdf) { 317s + pdf.options(width = 8.5, height = 6) # for all pdf plots 317s + pdf("special-fun.pdf") 317s + } 317s The following objects are masked from ‘package:stats’: 317s 317s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 317s 317s The following objects are masked from ‘package:base’: 317s 317s cbind, pmax, pmin, rbind 317s 317s > 317s > 317s > ## to enhance |rel.Err| plots: {also in ~/R/Pkgs/DPQ/tests/pow-tst.R } 317s > drawEps.h <- function(p2 = -(53:51), side = 4, lty=3, lwd=2, col=adjustcolor(2, 1/2)) { 317s + abline(h = 2^p2, lty=lty, lwd=lwd, col=col) 317s + axis(side, las=2, line=-1, at = 2^p2, 317s + labels = as.expression(lapply(p2, function(p) substitute(2^E, list(E=p)))), 317s + col.axis = col, col=NA, col.ticks=NA) 317s + } 317s > mtextVersion <- function(adj = 1, col = 1) { 317s + mtext(osVersion, line=1, col=col, adj=adj) 317s + mtext(sfsmisc::shortRversion(spaces=FALSE), col=col, adj=adj) 317s + } 317s > 317s > all.eq.finite <- function(x,y, ...) { 317s + ## x = 'target' y = 'current' 317s + if(any(is.finite(y[!(fx <- is.finite(x))]))) 317s + return("current has finite values where target has not") 317s + if(any(is.finite(x[!(fy <- is.finite(y))]))) 317s + return("target has finite values where current has not") 317s + ## now they have finite values at the same locations 317s + all.equal(x[fx], y[fy], ...) 317s + } 317s > 317s > 317s > 317s > n <- 1000 317s > head(x <- mpfr(0:n, 100) / n) 317s 6 'mpfr' numbers of precision 100 bits 317s [1] 0 0.0010000000000000000000000000000008 317s [3] 0.0020000000000000000000000000000015 0.0030000000000000000000000000000007 317s [5] 0.004000000000000000000000000000003 0.0050000000000000000000000000000022 317s > 317s > stopifnot(exprs = { 317s + range(x) == 0:1 317s + all.equal(as.numeric(j0(x)), besselJ(as.numeric(x), 0), tol = 1e-14) 317s + all.equal(as.numeric(j1(x)), besselJ(as.numeric(x), 1), tol = 1e-14) 317s + all.equal(as.numeric(y0(x)), besselY(as.numeric(x), 0), tol = 1e-14) 317s + all.equal(as.numeric(y1(x)), besselY(as.numeric(x), 1), tol = 1e-14) 317s + }) 317s > 317s > ### pnorm() -> erf() : ---------------------------------------------------------- 317s > u <- 7*x - 2 317s > stopifnot(all.equal(pnorm(as.numeric(u)), 317s + as.numeric(pnorm(u)), tol = 1e-14)) 317s > ## systematic random input testing: 317s > set.seed(101) 317s > if(doExtras) { 317s + nSim <- 50 317s + n2 <- 100 317s + } else { 317s + nSim <- 10 317s + n2 <- 64 317s + } 317s > for(n in 1:nSim) { 317s + N <- rpois(1, lambda=n2) 317s + N3 <- N %/% 3 317s + x <- c(rnorm(N-N3), 10*rt(N3, df=1.25))# <- some large values 317s + m <- rnorm(N, sd = 1/32) 317s + s <- rlnorm(N, sd = 1/8) 317s + cEps <- .Machine$double.eps 317s + for(LOG in c(TRUE,FALSE)) 317s + for(L.T in c(TRUE,FALSE)) { 317s + p. <- pnorm( x, m=m,sd=s, log.p=LOG, lower.tail=L.T) 317s + stopifnot(all.equal(p., pnorm(mpfr(x, precBits= 48), m=m,sd=s, 317s + log.p=LOG, lower.tail=L.T), 317s + tol = 128 * cEps)) 317s + stopifnot(all.equal(p., pnorm(mpfr(x, precBits= 60), m=m,sd=s, 317s + log.p=LOG, lower.tail=L.T), 317s + tol = 2 * cEps)) 317s + } 317s + cat(".") 317s + };cat("\n") 318s .......... 318s > proc.time() 318s user system elapsed 318s 2.352 0.052 2.403 318s > 318s > ## Jerry Lewis - Aug 2, 2019 318s > ## Contrast the results of pnorm with double and mpfr inputs 318s > x <- c(1:9, 5*(2:9), 10*(5:20)) ; x <- c(-rev(x), 0, x) 318s > pdL <- pnorm(x, log.p=TRUE) 318s > pdU <- pnorm(x, log.p=TRUE, lower.tail=FALSE) 318s > stopifnot(exprs = { 318s + !is.unsorted(x) 318s + 35 %in% x 318s + x == -rev(x) # exactly 318s + pdL == rev(pdU) # even exactly, currently 318s + }) 318s > mx <- mpfr(x, precBits = 128) 318s > pmL <- pnorm(mx, log.p=TRUE) 318s > pmU <- pnorm(mx, log.p=TRUE, lower.tail=FALSE) 318s > stopifnot(exprs = { 318s + pmL < 0 # not true for 'pdL' which underflows 318s + pmL == rev(pmU) # even exactly, currently 318s + all.equal(pmL, pdL, tol=4e-16) # 'tol=0' shows 4.46e-17 318s + }) 318s > ## some explorations : 318s > dlp <- diff(log(-pmL))/diff(x) 318s > n <- length(x) 318s > x.1 <- (x[-1] + x[-n])/2 318s > plot(x.1, dlp, type="b", ylab = "d/dx log(-pnorm(., log=TRUE))"); mtextVersion() 318s > plot(x.1[-1], diff(dlp)/diff(x.1), type="b", ylab = "d^2/dx^2 log(-pnorm(., log=TRUE))") 318s > stopifnot(exprs = { 318s + -1 < (d2 <- diff(dlp)/diff(x.1)) 318s + d2 < 0 318s + diff(d2) < 0 318s + }) 318s > x.3 <- x.1[-c(1L,n-1L)] 318s > plot(x.3, -diff(d2)/ diff(x.1)[-1], type="o", log="y") 318s > 318s > 318s > 318s > 318s > ### Riemann's Zeta function: ---------------------------------------------------- 318s > 318s > ## -- integer arguments -- 318s > stopifnot(all(mpfrIs0(zeta(-2*(1:100))))) 318s > 318s > k.neg <- 2*(-100:0) - 1 318s > Z.neg <- zeta(k.neg) 318s > plot(k.neg, abs(as.numeric(Z.neg)), type = "l", log="y") 318s > 318s > Pi <- Const("pi", 128L) 318s > 318s > ## confirm published value of Euler's gamma to 100 digits 318s > pub.g <- 318s + paste("0.5772156649", "0153286060", "6512090082", "4024310421", "5933593992", 318s + "3598805767", "2348848677", "2677766467", "0936947063", "2917467495", 318s + sep="") 318s > 318s > ## almost = 318s > our.g <- Const("gamma", log2(10) * 100) # 100 digits 318s > (ff.g <- .mpfr2str(our.g)) 318s $str 318s [1] "57721566490153286060651209008240243104215933593992359880576723488486772677766467093694706329174674948" 318s 318s $exp 318s [1] 0 318s 318s $finite 318s [1] TRUE 318s 318s $is.0 318s [1] FALSE 318s 318s > 318s > 318s > M <- function(x) mpfr(x, 128L) 318s > stopifnot(all.equal(zeta( 0), -1/2, tol = 2^-100) 318s + , all.equal(zeta(-1), -1/M(12), tol = 2^-100) 318s + , all.equal(zeta(-3), 1/M(120), tol = 2^-100) 318s + ## positive ones : 318s + , all.equal(zeta(2), Pi^2/6, tol = 2^-100) 318s + , all.equal(zeta(4), Pi^4/90, tol = 2^-100) 318s + , all.equal(zeta(6), Pi^6/945, tol = 2^-100) 318s + ) 318s > 318s > ### Exponential Integral Ei(.) 318s > curve(Ei, 0,5, n=5001) 319s > if(mpfrVersion() >= "3") { ## only available since MPFR 3.0.0 319s + ### Airy function Ai(.) 319s + curve(Ai, -10, 5, n=5001); abline(h=0,v=0, col="gray", lty=3) 319s + } 319s > 319s > ### Utilities hypot(), atan2() : -------------------------------------------------------------- 319s > 319s > ## ======= TODO! ======== 319s > 319s > ## beta(), lbeta() 319s > ## --------------- 319s > ## The simplistic "slow" versions: 319s > B <- function(a,b) { a <- as(a, "mpfr"); b <- as(b, "mpfr"); gamma(a)*gamma(b) / gamma(a+b) } 319s > lB <- function(a,b) { a <- as(a, "mpfr"); b <- as(b, "mpfr"); lgamma(a)+lgamma(b) - lgamma(a+b) } 319s > 319s > ## For partly *integer* arguments 319s > Bi1 <- function(a,b) 1/(a*chooseMpfr(a+b-1, a)) # a must be integer >= 0 319s > Bi2 <- function(a,b) 1/(b*chooseMpfr(a+b-1, b)) # b must be integer >= 0 319s > 319s > x <- 1:10 + 0 ; (b10 <- mpfr(x, 128L)) 319s 10 'mpfr' numbers of precision 128 bits 319s [1] 1 2 3 4 5 6 7 8 9 10 319s > 319s > stopifnot(all.equal( B(1,b10), 1/x), 319s + all.equal( B(2,b10), 1/(x*(x+1))), 319s + all.equal( beta(1,b10), 1/x), 319s + all.equal( beta(2,b10), 1/(x*(x+1))), 319s + TRUE) 319s > 319s > if(do.pdf) { dev.off(); pdf("special-fun-beta.pdf") } 319s > 319s > 319s > x <- -10:10 + 0; X <- mpfr(x, 128L) 319s > stopifnot(exprs = { 319s + Bi1(1,X) == (B1x <- Bi2(X,1)) 319s + Bi1(2,X) == (B2x <- Bi2(X,2)) 319s + Bi1(3,X) == (B3x <- Bi2(X,3)) 319s + all.equal(B1x, 1/x, tol= 4e-16) 319s + all.equal(B2x, 1/(x*(x+1)), tol= 8e-16) 319s + all.equal(B3x, 2/(x*(x+1)*(x+2)), tol=16e-16) 319s + ## these the "poles" are all odd i.e. result in { +Inf / -Inf / NaN} 319s + ## are all "ok" {e.g. 1/(x*(x+1)) gives (-Inf, Inf) for x = -1:0 } 319s + all.eq.finite(beta(1,X), 1/x) 319s + all.eq.finite(beta(X,2), 1/(x*(x+1))) 319s + all.eq.finite(beta(3,X), 2/(x*(x+1)*(x+2)), tol=16e-16) 319s + }) 319s > 319s > ## (a,b) *both* integer, one negative: 319s > for(i in (-20):(-1)) { 319s + cat(i,":\n") 319s + a <- mpfr(i, 99) 319s + i1 <- i+1 319s + b. <- seq_len(-i1) 319s + Bab <- beta(a, b.) 319s + stopifnot(is.nan(beta(a, (i1:0))), is.nan(lbeta(a, (i1:0))), 319s + all.equal(Bab, Bi2(a, b.), tol=1e-20), 319s + all.equal(lbeta(a, b.), log(abs(Bab)), tol=1e-20), allow.logical0 = TRUE) 319s + } 319s -20 : 319s -19 : 319s -18 : 319s -17 : 319s -16 : 319s -15 : 319s -14 : 319s -13 : 319s -12 : 319s -11 : 319s -10 : 319s -9 : 319s -8 : 319s -7 : 319s -6 : 319s -5 : 319s -4 : 319s -3 : 319s -2 : 319s -1 : 319s > 319s > ## (a,b) all positive 319s > c10 <- b10 + 0.25 319s > for(a in c(0.1, 1, 1.5, 2, 20)) { 319s + stopifnot(all.equal( B(a,b10), (bb <- beta(a, b10))), 319s + all.equal(lB(a,b10), (lb <- lbeta(a, b10))), all.equal(lb, log(bb)), 319s + all.equal( B(a,c10), (bb <- beta(a, c10))), 319s + all.equal(lB(a,c10), (lb <- lbeta(a, c10))), all.equal(lb, log(bb)), 319s + TRUE) 319s + } 320s > 320s > ## However, the speedup is *not* much (50%) when applied to vectors: 320s > stopifnot(validObject(xx <- outer(b10, runif(20))), 320s + dim(xx) == c(length(b10), 20), 320s + validObject(vx <- as(xx, "mpfr")), class(vx) == "mpfr", is.null(dim(vx))) 320s > C1 <- replicate(10, system.time(bb <<- beta(vx, vx+2))) 320s > C2 <- replicate(10, system.time(b2 <<- B(vx, vx+2))) 321s > summary(1000*C1[1,]) ## 80.3 {cmath-5, 2009} 321s Min. 1st Qu. Median Mean 3rd Qu. Max. 321s 16 17 17 17 17 18 321s > summary(1000*C2[1,]) ## 125.1 { " } 321s Min. 1st Qu. Median Mean 3rd Qu. Max. 321s 23.0 23.0 23.0 23.4 24.0 24.0 321s > stopifnot(all.equal(bb, b2)) 321s > ## and for a single number, the speedup is a factor 3: 321s > x1 <- vx[1]; x2 <- x1+2 321s > system.time(for(i in 1:100) bb <- beta(x1, x2))# .27 321s user system elapsed 321s 0.061 0.000 0.061 321s > system.time(for(i in 1:100) b2 <- B(x1, x2))# .83 321s user system elapsed 321s 0.165 0.000 0.165 321s > 321s > ## a+b is integer <= 0, but a and b are not integer: 321s > a <- b <- .5 + -10:10 321s > ab <- data.matrix(expand.grid(a=a, b=b, KEEP.OUT.ATTRS=FALSE)) 321s > ab <- mpfr(ab[rowSums(ab) <= 0, ], precBits = 128) 321s > stopifnot( beta(ab[,"a"], ab[,"b"]) == 0, 321s + lbeta(ab[,"a"], ab[,"b"]) == -Inf) 321s > ## was NaN in Rmpfr <= 0.5-2 321s > 321s > stopifnot(all.equal(6 * beta(mpfr(1:3,99), -3.), c(-2,1,-2), tol=1e-20)) 321s > ## add more checks, notably for b (> 0) above and below the "large_b" in 321s > ## ../src/utils.c : 321s > bb <- beta(mpfr(1:23, 128), -23) 321s > stopifnot(all.equal(bb, Bi1(1:23, -23), tol=1e-7)) 321s > # Bi1() does not get high prec for small b 321s > ## can be written via rationals: N / D : 321s > bn <- c(330, -360, 468, -728, 1365, -3120, 8840, -31824, 321s + 151164, -1007760, 10581480, -232792560) 321s > bn <- c(rev(bn[-1]), bn) 321s > bd <- 24* as.bigz(2 * 3 * 5 * 7 * 11) * 13 * 17 * 19 * 23 321s > stopifnot(all.equal(bb, as(bn/bd,"mpfr"), tol=0)) 321s > 321s > stopifnot(all.equal(6 * beta(mpfr(1:3, 99), -3.), 321s + c(-2,1,-2), tol=1e-20), 321s + all.equal( lbeta(mpfr(1:3, 128), -3.), 321s + log(mpfr(c( 2,1, 2), 128) / 6), tol=1e-20)) 321s > 321s > ## add more checks, notably for b (> 0) above and below the "large_b" in 321s > ## ../src/utils.c : 321s > bb <- beta(mpfr(1:23, 128), -23) 321s > stopifnot(all.equal(bb, Bi1(1:23, -23), tol=1e-7)) 321s > # Bi1() does not get high prec for small b 321s > ## can be written via rationals: N / D : 321s > bn <- c(330, -360, 468, -728, 1365, -3120, 8840, -31824, 321s + 151164, -1007760, 10581480, -232792560) 321s > bn <- c(rev(bn[-1]), bn) 321s > bd <- 24* as.bigz(2 * 3 * 5 * 7 * 11) * 13 * 17 * 19 * 23 321s > stopifnot(all.equal(bb, as(bn/bd,"mpfr"), tol=0)) 321s > 321s > ## 2) add check for 'b' > maximal unsigned int {so C code uses different branch} 321s > two <- mpfr(2, 128) 321s > for(b in list(mpfr(9, 128), mpfr(5, 128)^10, two^25, two^26, two^100)) { 321s + a <- -(b+ (1:7)) 321s + stopifnot(a+b == -(1:7), # just ensuring that there was no cancellation 321s + is.finite( B <- beta(a,b)), ## was NaN .. 321s + is.finite(lB <- lbeta(a,b)), ## ditto 321s + all.equal(log(abs(B)), lB), 321s + TRUE) 321s + } 321s > 321s > ee <- c(10:145, 5*(30:59), 10*(30:39), 25*(16:30)) 321s > b <- mpfr(2, precBits = 10 + max(ee))^ee # enough precision {now "automatic"} 321s > stopifnot((b+4)-b == 4, # <==> enough precision above 321s + b == (b. <- as(as(b,"bigz"),"mpfr"))) 321s > (pp <- getPrec(b.))# shows why b. is not *identical* to b. 321s [1] 12 12 16 16 16 16 20 20 20 20 24 24 24 24 28 28 28 28 32 32 32 32 36 321s [24] 36 36 36 40 40 40 40 44 44 44 44 48 48 48 48 52 52 52 52 56 56 56 56 321s [47] 60 60 60 60 64 64 64 64 68 68 68 68 72 72 72 72 76 76 76 76 80 80 80 321s [70] 80 84 84 84 84 88 88 88 88 92 92 92 92 96 96 96 96 100 100 100 100 104 104 321s [93] 104 104 108 108 108 108 112 112 112 112 116 116 116 116 120 120 120 120 124 124 124 124 128 321s [116] 128 128 128 132 132 132 132 136 136 136 136 140 140 140 140 144 144 144 144 148 148 152 156 321s [139] 164 168 172 176 184 188 192 196 204 208 212 216 224 228 232 236 244 248 252 256 264 268 272 321s [162] 276 284 288 292 296 304 312 324 332 344 352 364 372 384 392 404 428 452 476 504 528 552 576 321s [185] 604 628 652 676 704 728 752 321s > system.time(Bb <- beta(-b-4, b))# 0.334 sec 322s user system elapsed 322s 0.069 0.000 0.069 322s > if(dev.interactive()) 322s + plot(ee, asNumeric(log(Bb)), type="o",col=2) 322s > lb <- asNumeric(log(Bb)) 322s > ## using coef(lm(lb ~ ee)) 322s > stopifnot(all.equal(lb, 3.175933 -3.46571851*ee, tol = 1e-5))# 4.254666 e-6 322s > 322s > 322s > bb <- beta( 1:4, mpfr(2,99)) 322s > stopifnot(identical(bb, beta(mpfr(2,99), 1:4)), 322s + all.equal((2*bb)*cumsum(1:4), rep(1, 4), tol=1e-20), 322s + getPrec(bb) == 128) 322s > 322s > 322s > ##-- The d*() density functions from ../R/special-fun.R | ../man/distr-etc.Rd --- 322s > 322s > if(do.pdf) { dev.off(); pdf("special-fun-density.pdf") } 322s > 322s > dx <- 1400+ 0:10 322s > mx <- mpfr(dx, 120) 322s > nx <- sort(c(c(-32:32)/2, 50*(-8:8))) 322s > 322s > xL <- 2^(989+(0:139)/4) # "close" to double.xmax 322s > dnbD <- dnbinom(xL, prob=1-1/4096, size=1e307, log=TRUE)# R's own 322s > iF <- -(130:140) # index of finite dnbD[] 322s > dnbx8 <- dnbinom(xL, prob=1-mpfr(2, 2^ 8)^-12, size=1e307, log=TRUE) 322s > dnbx10 <- dnbinom(xL, prob=1-mpfr(2, 2^10)^-12, size=1e307, log=TRUE) 322s > dnbx13 <- dnbinom(xL, prob=1-mpfr(2, 2^13)^-12, size=1e307, log=TRUE) 322s > 322s > stopifnot(exprs = { 322s + all.equal(dpois(dx, 1000), dpois(mx, 1000), tol = 3e-13) # 64b Lnx: 7.369e-14 322s + all.equal(dbinom(0:16, 16, pr = 4 / 5), 322s + dbinom(0:16, 16, pr = 4/mpfr(5, 128)) -> db, tol = 5e-15)# 64b Lnx: 4.3e-16 322s + all.equal(dnorm( -3:3, m=10, s=1/4), 322s + dnorm(mpfr(-3:3, 128), m=10, s=1/4), tol = 1e-15) # 64b Lnx: 6.45e-17 322s + all.equal(dnorm(nx), dnorm(mpfr(nx, 99)), tol = 1e-15) 322s + all.equal(dnorm( nx, m = 4, s = 1/4), 322s + dnorm(mpfr(nx, 99), m = 4, s = 1/4), tol = 1e-15) 322s + all.equal(dnorm( nx, m = -10, s = 1/4, log=TRUE), 322s + dnorm(mpfr(nx, 99), m = -10, s = 1/4, log=TRUE), tol = 1e-15) 322s + ## t-distrib. : 322s + all.equal(dt(nx, df=3), dt(mpfr(nx, 99), df=3), tol = 1e-15) 322s + all.equal(dt( nx, df = 0.75), 322s + dt(mpfr(nx, 99), df = 0.75), tol = 1e-15) 322s + all.equal(dt( nx, df = 2.5, log=TRUE), 322s + dt(mpfr(nx, 99), df = 2.5, log=TRUE), tol = 1e-15) 322s + ## negative binomial dnbinom(): 322s + all.equal(dnbx13, dnbx10, tol = 2^-999) # see 2^-1007, but not 2^-1008 322s + all.equal(dnbx13, dnbx8, tol = 2^-238) # see 2^-239, but not 2^-240 322s + all.equal(dnbx10[iF], dnbD[iF], tol = 6e-16) # R's *is* accurate here (seen 2.9e-16) 322s + }) 322s > 322s > 322s > ## plot dt() "error" of R's implementation 322s > nx <- seq(-100, 100, by=1/8) 322s > dtd <- dt( nx, df= .75) 322s > dtM <- dt(mpfr(nx, 256), df= .75) 323s > if(doExtras) withAutoprint({ 323s + system.time( 323s + dtMx <- dt(mpfr(nx, 2048), df= .75) ) # 2.5 sec 323s + stopifnot(all.equal(dtMx, dtM, tol = 2^-254)) # almost all of dtM's 256 bits are correct 323s + }) 323s > relE <- asNumeric(dtd/dtM - 1) 323s > plot(relE ~ nx, type="l", col=2); mtextVersion() 323s > plot(abs(relE) ~ nx, type="l", col=2, log="y", ylim=c(5e-17, 1.5e-15)) 323s > 323s > ## ============== even smaller 'df' such that lgamma1p(df) is better than lgamma(1+df) ==== 323s > 323s > require(sfsmisc)# -> eaxis(); relErrV() 323s Loading required package: sfsmisc 323s 323s Attaching package: ‘sfsmisc’ 323s 323s The following objects are masked from ‘package:gmp’: 323s 323s factorize, is.whole 323s 323s > 323s > u <- sort(outer(10^-(20:1), c(1,2,5))) # *not* "exact" on purpose 323s > ## .. unfinished .. exploring *when* dt() would suffer from inaccurate stirlerr() -- would it? 323s > 323s > nu <- 2^-(70:1) 323s > dt10 <- dt( 10, df=nu) 323s > dt10M <- dt(mpfr(10, 1024), df=nu) 323s > re10 <- asNumeric(relErrV(dt10M, dt10)) 323s > 323s > plot(re10 ~ nu, type="l", lwd=2, log="x", main = quote(rel.Err( dt(10, df==nu) )), 323s + xaxt="n"); eaxis(1, nintLog=20) 323s > mtextVersion() 323s > abline(h = (-1:1)*2^-53, lty=4, col=adjustcolor("blue", 1/2)) 323s > 323s > plot(abs(re10) ~ nu, type="l", lwd=2, log="xy", 323s + xlab = quote(df == nu), ylab = quote(abs(relE)), 323s + main = quote(abs(rel.Err( dt(10, df==nu) ))), xaxt="n", yaxt="n") 323s > eaxis(1, nintLog=20); eaxis(2); drawEps.h() 323s > 323s > x0 <- c(0, 10^(-5:10)) # only >= 0 should be sufficient; x0 <- c(-rev(x0),0,x0) 323s > stopifnot(!is.unsorted(nu), # just for plotting .. 323s + !is.unsorted(x0)) 323s > xnu <- expand.grid(x=x0, df=nu) 323s > dt2 <- with(xnu, dt( x, df=df)) 323s > dtM2 <- with(xnu, dt(mpfr(x, 512), df=df)) 323s > str(relE2 <- `attributes<-`(asNumeric(relErrV(dtM2, dt2)), 323s + attr(xnu, "out.attrs"))) 323s num [1:17, 1:70] 1.78e-15 1.08e-15 1.11e-15 7.85e-16 1.73e-15 ... 323s - attr(*, "dimnames")=List of 2 323s ..$ x : chr [1:17] "x=0e+00" "x=1e-05" "x=1e-04" "x=1e-03" ... 323s ..$ df: chr [1:70] "df=8.470329e-22" "df=1.694066e-21" "df=3.388132e-21" "df=6.776264e-21" ... 323s > 323s > ## consistency check that with() etc was fine: 323s > stopifnot(identical(re10, unname(relE2[which(x0 == 10), ]))) 323s > 323s > filled.contour(x=log10(1e-7+x0), y=log10(nu), z = relE2) 323s > filled.contour(x=log10(1e-7+x0), y=log10(nu), z = abs(relE2)) 323s > ## around nu = 10^-16 is the most critical place 323s > 323s > (pch <- c(1L:9L, 0L, letters, LETTERS)[1:ncol(relE2)]) 323s [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" 323s [24] "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" 323s [47] "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" NA NA NA NA NA NA NA 323s [70] NA 323s > 323s > matplot(x0+1e-7, relE2, type="b", log="x", main="rel.err{ dt(x, df=df) }") 323s > Warning message: 323s In matplot(x0 + 1e-07, relE2, type = "b", log = "x", main = "rel.err{ dt(x, df=df) }") : 323s default 'pch' is smaller than number of columns and hence recycled 323s legend("topright", legend = paste0("df=",formatC(nu,wid=3)), ncol=7, 323s + bty="n", lwd=1, pch=pch, col=1:6, lty=1:5, cex = 0.8) 323s > abline(h = c(-4:4)*2^-53, lty=3, col="gray") 323s > 323s > matplot(nu, t(relE2), type="b", log="x", main="rel.err{ dt(x, df=df) }") 323s > legend("topright", legend = paste0("x=",formatC(x0,wid=3)), ncol=7, 323s + bty="n", lwd=1, pch=pch, col=1:6, lty=1:5, cex = 0.8) 323s > abline(h = c(-4:4)*2^-53, lty=3, col="gray") 323s > 323s > matplot(nu, pmax(abs(t(relE2)), 1e-19), type="b", log="xy", axes=FALSE, ylab = quote(abs("rel Err")), 323s + ylim = c(7e-17, max(abs(relE2))), main="|rel.err{ dt(x, df=df)}|") 323s > eaxis(1, nintLog=22) ; eaxis(2, line=-1/2); drawEps.h() 323s > legend("topright", legend = paste0("x=",formatC(x0,wid=3)), ncol=7, 323s + bty="n", lwd=1, pch=pch, col=1:6, lty=1:5, cex = 0.8) 323s > 323s > 323s > 1 323s [1] 1 323s > ## dnbinom() -- has mode as expected, but with huge size, the scales are "off reality" .. 323s > 323s > ### ..... TODO ! 323s > 323s > ### dgamma(): ---------------------------------------------------- 323s > if(do.pdf) { dev.off(); pdf("special-fun-dgamma.pdf") } 323s > 323s > xe <- c(-2e5, -1e5, -2e4, -1e4, -2000, -1000, -500, -200, -100, -50, -20, -10) 323s > (xe <- c(xe, -8:8, -rev(xe))) 323s [1] -2e+05 -1e+05 -2e+04 -1e+04 -2e+03 -1e+03 -5e+02 -2e+02 -1e+02 -5e+01 -2e+01 -1e+01 -8e+00 323s [14] -7e+00 -6e+00 -5e+00 -4e+00 -3e+00 -2e+00 -1e+00 0e+00 1e+00 2e+00 3e+00 4e+00 5e+00 323s [27] 6e+00 7e+00 8e+00 1e+01 2e+01 5e+01 1e+02 2e+02 5e+02 1e+03 2e+03 1e+04 2e+04 323s [40] 1e+05 2e+05 323s > two <- mpfr(2, 64) 323s > ## For centering at E[.], will use xP(x, shp) : 323s > xP <- function(x, d) x - d*(x > d) 323s > aEQformat <- function(xy, ...) format(xy, digits = 7, ...) 323s > allEQ_0 <- function (target, current, ...) 323s + all.equal(target, current, tolerance = 0, formatFUN = aEQformat, ...) 323s > stopIfNot <- 323s + if("allow.logical0" %in% names(formals(stopifnot))) { # experimental (MM only) 323s + stopifnot 323s + } else function(exprs, allow.logical0) stopifnot(exprs=exprs) 323s > 323s > for(shp in c(2^c(-20, -3, -1:1, 4, 10, 50))) { 323s + cat("shape = 2^", log2(shp), ":\n-------------\n") 323s + d.dg <- dgamma(xP(2 ^ xe, shp), shape=shp) 323s + m.dg <- dgamma(xP(two^xe, shp), shape=shp) 323s + m.ldg <- dgamma(xP(two^xe, shp), shape=shp, log=TRUE) 323s + stopIfNot(exprs = { 323s + !is.unsorted(xe) 323s + is.finite(m.dg) 323s + m.dg >= 0 323s + shp > 1 || all(diff(m.dg) <= 0) 323s + shp > 100|| all((m.dg > 0) >= (d.dg > 0)) 323s + any(fin.d <- is.finite(d.dg)) 323s + m.dg[!fin.d] > 1e300 323s + { cat("all.EQ(, ):", allEQ_0(m.dg[fin.d], d.dg[fin.d]), "\n") 323s + shp > 100 || all.equal(m.dg[fin.d], d.dg[fin.d], 323s + tol = 1e-13) # 2.063241e-14 323s + } 323s + ## compare with log scale : 323s + if(any(pos.d <- m.dg > 0)) { 323s + cat("all.EQ(log(d), d*(log)):", 323s + allEQ_0 (log(m.dg[pos.d]), m.ldg[pos.d]),"\n") 323s + all.equal(log(m.dg[pos.d]), m.ldg[pos.d], tol = 1e-14) 323s + } 323s + }, allow.logical0 = TRUE) 323s + } 324s shape = 2^ -20 : 324s ------------- 324s all.EQ(, ): Mean relative difference: 5.766884e-16 324s all.EQ(log(d), d*(log)): Mean relative difference: 4.826256e-16 324s shape = 2^ -3 : 324s ------------- 324s all.EQ(, ): Mean relative difference: 1.723515e-16 324s all.EQ(log(d), d*(log)): Mean relative difference: 8.342404e-20 324s shape = 2^ -1 : 324s ------------- 324s all.EQ(, ): Mean relative difference: 2.536642e-17 324s all.EQ(log(d), d*(log)): Mean relative difference: 7.917217e-20 324s shape = 2^ 0 : 324s ------------- 324s all.EQ(, ): Mean relative difference: 2.432573e-17 324s all.EQ(log(d), d*(log)): Mean relative difference: 1.509670e-19 324s shape = 2^ 1 : 324s ------------- 324s all.EQ(, ): Mean relative difference: 1.133389e-16 324s all.EQ(log(d), d*(log)): TRUE 324s shape = 2^ 4 : 324s ------------- 324s all.EQ(, ): Mean relative difference: 1.911332e-16 324s all.EQ(log(d), d*(log)): TRUE 324s shape = 2^ 10 : 324s ------------- 324s all.EQ(, ): Mean relative difference: 5.728002e-17 324s all.EQ(log(d), d*(log)): TRUE 324s shape = 2^ 50 : 324s ------------- 324s all.EQ(, ): Mean relative difference: 0.001523136 324s all.EQ(log(d), d*(log)): TRUE 324s > 324s > cat('Time elapsed: ', proc.time(),'\n') # "stats" 324s Time elapsed: 7.778 0.08 7.888 0 0.004 324s > if(!interactive()) warnings() 324s Warning message: 324s In matplot(x0 + 1e-07, relE2, type = "b", log = "x", main = "rel.err{ dt(x, df=df) }") : 324s default 'pch' is smaller than number of columns and hence recycled 324s > 324s BEGIN TEST tstHexBin.R 324s 324s R version 4.4.3 (2025-02-28) -- "Trophy Case" 324s Copyright (C) 2025 The R Foundation for Statistical Computing 324s Platform: aarch64-unknown-linux-gnu 324s 324s R is free software and comes with ABSOLUTELY NO WARRANTY. 324s You are welcome to redistribute it under certain conditions. 324s Type 'license()' or 'licence()' for distribution details. 324s 324s R is a collaborative project with many contributors. 324s Type 'contributors()' for more information and 324s 'citation()' on how to cite R or R packages in publications. 324s 324s Type 'demo()' for some demos, 'help()' for on-line help, or 324s 'help.start()' for an HTML browser interface to help. 324s Type 'q()' to quit R. 324s 324s > require(Rmpfr) 324s Loading required package: Rmpfr 324s Loading required package: gmp 324s 324s Attaching package: ‘gmp’ 324s 324s The following objects are masked from ‘package:base’: 324s 324s %*%, apply, crossprod, matrix, tcrossprod 324s 324s C code of R package 'Rmpfr': GMP using 64 bits per limb 324s 324s 324s Attaching package: ‘Rmpfr’ 324s 324s The following object is masked from ‘package:gmp’: 324s 324s outer 324s 324s The following objects are masked from ‘package:stats’: 324s 324s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 324s 324s The following objects are masked from ‘package:base’: 324s 324s cbind, pmax, pmin, rbind 324s 324s > sessionInfo() 325s R version 4.4.3 (2025-02-28) 325s Platform: aarch64-unknown-linux-gnu 325s Running under: Ubuntu Plucky Puffin (development branch) 325s 325s Matrix products: default 325s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 325s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 325s 325s locale: 325s [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 325s [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 325s [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C 325s [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C 325s 325s time zone: Etc/UTC 325s tzcode source: system (glibc) 325s 325s attached base packages: 325s [1] stats graphics grDevices utils datasets methods base 325s 325s other attached packages: 325s [1] Rmpfr_0.9-5 gmp_0.7-5 325s 325s loaded via a namespace (and not attached): 325s [1] compiler_4.4.3 325s > 325s > nums <- c(0, .625, .1, .3, .3125, .5, .6, (.3+.6), .9, 1, 3.3125) 325s > nums9 <- mpfr(nums, precBits = 9) 325s > 325s > n5.b2 <- mpfr("101", base=2) 325s > stopifnot(identical(n5.b2, mpfr(5, precBits=3)), 325s + identical(n5.b2, mpfr("0b101", base=2))) 325s > if(FALSE)## 0b101 could also be a Hex number with no initial '0x' -- hence NOT true: 325s + identical(n5.b2, mpfr("0b101")) 325s > ## We *could* say that anything starting with '0b' is binary, anything with '0x' is hexadecimal 325s > 325s > 325s > ### mpfr_Bcharacter() {no longer method} [was 'mpfrBchar', was 'scanBin'] : 325s > 325s > ##' Check the inverse of formatBin(), i.e., mpfr() working correctly 325s > chkInv.fBin <- function(x, ...) { 325s + stopifnot(is(x, "mpfr")) 325s + nb <- formatBin(x, ...) 325s + xx <- mpfr(nb) 325s + ## Inverse should work {apart from 0: that is not uniquely represented in MPFR!} 325s + stopifnot(identical(mpfrIs0(x ) -> i0, 325s + mpfrIs0(xx)), 325s + identical(x[!i0], xx[!i0])) 325s + invisible(nb) 325s + } 325s > (nums9bc <- chkInv.fBin(nums9)) 325s [1] +0b0.00000000p+0 +0b1.01000000p-1 +0b1.10011010p-4 +0b1.00110011p-2 325s [5] +0b1.01000000p-2 +0b1.00000000p-1 +0b1.00110011p-1 +0b1.11001101p-1 325s [9] +0b1.11001101p-1 +0b1.00000000p+0 +0b1.10101000p+1 325s > (nums9bF <- chkInv.fBin(nums9, scientific=FALSE)) # "F": Fixed format (as in Fortran) 325s [1] +0b_0.00000000____ +0b__.101000000___ +0b__.___110011010 +0b__._100110011__ 325s [5] +0b__._101000000__ +0b__.100000000___ +0b__.100110011___ +0b__.111001101___ 325s [9] +0b__.111001101___ +0b_1.00000000____ +0b11.0101000_____ 325s > 325s > ## higher precision, 0,Inf, sign change: 325s > (i12 <- 1 / mpfr(c(-2:12, Inf), 64)) 325s 16 'mpfr' numbers of precision 64 bits 325s [1] -0.5 -1 Inf 325s [4] 1 0.5 0.333333333333333333342 325s [7] 0.25 0.200000000000000000003 0.166666666666666666671 325s [10] 0.142857142857142857141 0.125 0.11111111111111111111 325s [13] 0.100000000000000000001 0.0909090909090909090934 0.0833333333333333333356 325s [16] 0 325s > (i12.50 <- roundMpfr(i12, precBits=50)) # "same", with 50 (< 53) bits 325s 16 'mpfr' numbers of precision 50 bits 325s [1] -0.5 -1 Inf 325s [4] 1 0.5 0.33333333333333348 325s [7] 0.25 0.19999999999999996 0.16666666666666674 325s [10] 0.14285714285714279 0.125 0.11111111111111116 325s [13] 0.099999999999999978 0.090909090909090939 0.08333333333333337 325s [16] 0 325s > try({ ## FIXME -- formatBin() bug -- fails for 'Inf' ! 325s + (nI.12 <- chkInv.fBin(i12 )) 325s + (nI.12.50 <- chkInv.fBin(i12.50)) 325s + }) 325s [1] -0b1.0000000000000000000000000000000000000000000000000p-1 325s [2] -0b1.0000000000000000000000000000000000000000000000000p+0 325s [3] Inf 325s [4] +0b1.0000000000000000000000000000000000000000000000000p+0 325s [5] +0b1.0000000000000000000000000000000000000000000000000p-1 325s [6] +0b1.0101010101010101010101010101010101010101010101011p-2 325s [7] +0b1.0000000000000000000000000000000000000000000000000p-2 325s [8] +0b1.1001100110011001100110011001100110011001100110011p-3 325s [9] +0b1.0101010101010101010101010101010101010101010101011p-3 325s [10] +0b1.0010010010010010010010010010010010010010010010010p-3 325s [11] +0b1.0000000000000000000000000000000000000000000000000p-3 325s [12] +0b1.1100011100011100011100011100011100011100011100100p-4 325s [13] +0b1.1001100110011001100110011001100110011001100110011p-4 325s [14] +0b1.0111010001011101000101110100010111010001011101001p-4 325s [15] +0b1.0101010101010101010101010101010101010101010101011p-4 325s [16] +0b0.0000000000000000000000000000000000000000000000000p+0 325s > ii <- mpfr(c(-Inf, 17, Inf), 7) 325s > formatHex(ii) ## fine 325s [1] -Inf +0x1.10p+4 Inf 325s > formatDec(ii) ## not 100% ok, as it has "." [FIXME ?] 325s [1] -Inf 17.00 Inf 325s > 325s > n9. <- Rmpfr:::mpfr.Ncharacter(nums9bc) 325s > n9_ <- mpfr(nums9bc) 325s > ## Inverse worked {apart from 0: it is not at all uniquely represented in MPFR!} 325s > stopifnot(identical(mpfrIs0(n9.), mpfrIs0(n9_)), 325s + all.equal(n9_, n9., tolerance=0), 325s + identical(nums9[-1], n9.[-1])) 325s > 325s > mpfr(nums9bc, precBits=5) 325s 11 'mpfr' numbers of precision 5 bits 325s [1] 0 0.625 0.102 0.297 0.312 0.5 0.594 0.906 0.906 1 3.25 325s > 325s > (n9.5 <- mpfr(nums9bF, scientific=FALSE, precBits=5)) 325s 11 'mpfr' numbers of precision 5 bits 325s [1] 0 0.625 0.102 0.297 0.312 0.5 0.594 0.906 0.906 1 3.25 325s > stopifnot(all.equal(n9.5, mpfr(nums9bF, precBits=5), tol=0)) 325s > stopifnot(all.equal(n9., n9.5, tol = 0.02), getPrec(n9.5) == 5) 325s > mpfr(nums9bF, scientific=FALSE) 325s 11 'mpfr' numbers of precision 9 bits 325s [1] 0 0.625 0.1001 0.2998 0.3125 0.5 0.5996 0.9004 0.9004 1 325s [11] 3.312 325s > mpfr(nums9bF) 325s 11 'mpfr' numbers of precision 9 bits 325s [1] 0 0.625 0.1001 0.2998 0.3125 0.5 0.5996 0.9004 0.9004 1 325s [11] 3.312 325s > 325s > ### mpfr() -> mpfrHchar (was 'scanHex') : 325s > nums9hc <- formatHex(nums9) 325s > stopifnot(all.equal(n9., mpfr(nums9hc), tol = 0), 325s + all.equal(n9.5, mpfr(nums9hc, precBits=5), tol = 0)) 325s > 325s > ### Rest from ../R/formatHex.R -- heavily modified 325s > 325s > (m32 <- matrix(0:31, 8, 4, dimnames = list(0:7, c(0,8,16,24)))) 325s 0 8 16 24 325s 0 0 8 16 24 325s 1 1 9 17 25 325s 2 2 10 18 26 325s 3 3 11 19 27 325s 4 4 12 20 28 325s 5 5 13 21 29 325s 6 6 14 22 30 325s 7 7 15 23 31 325s > FourBits <- mpfr(m32, precBits=4) 325s > FiveBits <- mpfr(m32, precBits=5) 325s > stopifnot(all.equal(m32, asNumeric(FiveBits), tol=0), 325s + all.equal(m32, asNumeric(FourBits), tol= 0.05)) 325s > 325s > ## HH:::formatHexInternal(FourBits) 325s > formatHex(FourBits) 325s 0 8 16 24 325s 0 +0x0.0p+0 +0x1.0p+3 +0x1.0p+4 +0x1.8p+4 325s 1 +0x1.0p+0 +0x1.2p+3 +0x1.0p+4 +0x1.8p+4 325s 2 +0x1.0p+1 +0x1.4p+3 +0x1.2p+4 +0x1.ap+4 325s 3 +0x1.8p+1 +0x1.6p+3 +0x1.4p+4 +0x1.cp+4 325s 4 +0x1.0p+2 +0x1.8p+3 +0x1.4p+4 +0x1.cp+4 325s 5 +0x1.4p+2 +0x1.ap+3 +0x1.4p+4 +0x1.cp+4 325s 6 +0x1.8p+2 +0x1.cp+3 +0x1.6p+4 +0x1.ep+4 325s 7 +0x1.cp+2 +0x1.ep+3 +0x1.8p+4 +0x1.0p+5 325s > formatHex(FourBits, precBits=5) 325s 0 8 16 24 325s 0 +0x0.0p+0 +0x1.0p+3 +0x1.0p+4 +0x1.8p+4 325s 1 +0x1.0p+0 +0x1.2p+3 +0x1.0p+4 +0x1.8p+4 325s 2 +0x1.0p+1 +0x1.4p+3 +0x1.2p+4 +0x1.ap+4 325s 3 +0x1.8p+1 +0x1.6p+3 +0x1.4p+4 +0x1.cp+4 325s 4 +0x1.0p+2 +0x1.8p+3 +0x1.4p+4 +0x1.cp+4 325s 5 +0x1.4p+2 +0x1.ap+3 +0x1.4p+4 +0x1.cp+4 325s 6 +0x1.8p+2 +0x1.cp+3 +0x1.6p+4 +0x1.ep+4 325s 7 +0x1.cp+2 +0x1.ep+3 +0x1.8p+4 +0x1.0p+5 325s > formatHex(FourBits, precBits=6) 325s 0 8 16 24 325s 0 +0x0.00p+0 +0x1.00p+3 +0x1.00p+4 +0x1.80p+4 325s 1 +0x1.00p+0 +0x1.20p+3 +0x1.00p+4 +0x1.80p+4 325s 2 +0x1.00p+1 +0x1.40p+3 +0x1.20p+4 +0x1.a0p+4 325s 3 +0x1.80p+1 +0x1.60p+3 +0x1.40p+4 +0x1.c0p+4 325s 4 +0x1.00p+2 +0x1.80p+3 +0x1.40p+4 +0x1.c0p+4 325s 5 +0x1.40p+2 +0x1.a0p+3 +0x1.40p+4 +0x1.c0p+4 325s 6 +0x1.80p+2 +0x1.c0p+3 +0x1.60p+4 +0x1.e0p+4 325s 7 +0x1.c0p+2 +0x1.e0p+3 +0x1.80p+4 +0x1.00p+5 325s > formatBin(FourBits) 325s 0 8 16 24 325s 0 +0b0.000p+0 +0b1.000p+3 +0b1.000p+4 +0b1.100p+4 325s 1 +0b1.000p+0 +0b1.001p+3 +0b1.000p+4 +0b1.100p+4 325s 2 +0b1.000p+1 +0b1.010p+3 +0b1.001p+4 +0b1.101p+4 325s 3 +0b1.100p+1 +0b1.011p+3 +0b1.010p+4 +0b1.110p+4 325s 4 +0b1.000p+2 +0b1.100p+3 +0b1.010p+4 +0b1.110p+4 325s 5 +0b1.010p+2 +0b1.101p+3 +0b1.010p+4 +0b1.110p+4 325s 6 +0b1.100p+2 +0b1.110p+3 +0b1.011p+4 +0b1.111p+4 325s 7 +0b1.110p+2 +0b1.111p+3 +0b1.100p+4 +0b1.000p+5 325s > formatBin(FourBits, precBits=5) 325s 0 8 16 24 325s 0 +0b0.0000p+0 +0b1.0000p+3 +0b1.0000p+4 +0b1.1000p+4 325s 1 +0b1.0000p+0 +0b1.0010p+3 +0b1.0000p+4 +0b1.1000p+4 325s 2 +0b1.0000p+1 +0b1.0100p+3 +0b1.0010p+4 +0b1.1010p+4 325s 3 +0b1.1000p+1 +0b1.0110p+3 +0b1.0100p+4 +0b1.1100p+4 325s 4 +0b1.0000p+2 +0b1.1000p+3 +0b1.0100p+4 +0b1.1100p+4 325s 5 +0b1.0100p+2 +0b1.1010p+3 +0b1.0100p+4 +0b1.1100p+4 325s 6 +0b1.1000p+2 +0b1.1100p+3 +0b1.0110p+4 +0b1.1110p+4 325s 7 +0b1.1100p+2 +0b1.1110p+3 +0b1.1000p+4 +0b1.0000p+5 325s > formatBin(FourBits, scientific=FALSE) 325s 0 8 16 24 325s 0 +0b_____0.000 +0b__1000.___ +0b_1000_.___ +0b_1100_.___ 325s 1 +0b_____1.000 +0b__1001.___ +0b_1000_.___ +0b_1100_.___ 325s 2 +0b____10.00_ +0b__1010.___ +0b_1001_.___ +0b_1101_.___ 325s 3 +0b____11.00_ +0b__1011.___ +0b_1010_.___ +0b_1110_.___ 325s 4 +0b___100.0__ +0b__1100.___ +0b_1010_.___ +0b_1110_.___ 325s 5 +0b___101.0__ +0b__1101.___ +0b_1010_.___ +0b_1110_.___ 325s 6 +0b___110.0__ +0b__1110.___ +0b_1011_.___ +0b_1111_.___ 325s 7 +0b___111.0__ +0b__1111.___ +0b_1100_.___ +0b1000__.___ 325s > formatBin(FourBits, scientific=FALSE, precBits=5) 325s 0 8 16 24 325s 0 +0b_____0.0000 +0b__1000.0___ +0b_10000.____ +0b_11000.____ 325s 1 +0b_____1.0000 +0b__1001.0___ +0b_10000.____ +0b_11000.____ 325s 2 +0b____10.000_ +0b__1010.0___ +0b_10010.____ +0b_11010.____ 325s 3 +0b____11.000_ +0b__1011.0___ +0b_10100.____ +0b_11100.____ 325s 4 +0b___100.00__ +0b__1100.0___ +0b_10100.____ +0b_11100.____ 325s 5 +0b___101.00__ +0b__1101.0___ +0b_10100.____ +0b_11100.____ 325s 6 +0b___110.00__ +0b__1110.0___ +0b_10110.____ +0b_11110.____ 325s 7 +0b___111.00__ +0b__1111.0___ +0b_11000.____ +0b10000_.____ 325s > formatDec(FourBits) 325s 0 8 16 24 325s 0 0.00 8.00 16.0 24.0 325s 1 1.00 9.00 16.0 24.0 325s 2 2.00 10.0 18.0 26.0 325s 3 3.00 11.0 20.0 28.0 325s 4 4.00 12.0 20.0 28.0 325s 5 5.00 13.0 20.0 28.0 325s 6 6.00 14.0 22.0 30.0 325s 7 7.00 15.0 24.0 32.0 325s > formatDec(FourBits, precBits=5) 325s 0 8 16 24 325s 0 0.00 8.00 16.0 24.0 325s 1 1.00 9.00 16.0 24.0 325s 2 2.00 10.0 18.0 26.0 325s 3 3.00 11.0 20.0 28.0 325s 4 4.00 12.0 20.0 28.0 325s 5 5.00 13.0 20.0 28.0 325s 6 6.00 14.0 22.0 30.0 325s 7 7.00 15.0 24.0 32.0 325s > formatDec(FourBits, precBits=7) 325s 0 8 16 24 325s 0 0.000 8.000 16.00 24.00 325s 1 1.000 9.000 16.00 24.00 325s 2 2.000 10.00 18.00 26.00 325s 3 3.000 11.00 20.00 28.00 325s 4 4.000 12.00 20.00 28.00 325s 5 5.000 13.00 20.00 28.00 325s 6 6.000 14.00 22.00 30.00 325s 7 7.000 15.00 24.00 32.00 325s > 325s > ## HH:::formatHexInternal(FiveBits) 325s > formatHex(FiveBits) 325s 0 8 16 24 325s 0 +0x0.0p+0 +0x1.0p+3 +0x1.0p+4 +0x1.8p+4 325s 1 +0x1.0p+0 +0x1.2p+3 +0x1.1p+4 +0x1.9p+4 325s 2 +0x1.0p+1 +0x1.4p+3 +0x1.2p+4 +0x1.ap+4 325s 3 +0x1.8p+1 +0x1.6p+3 +0x1.3p+4 +0x1.bp+4 325s 4 +0x1.0p+2 +0x1.8p+3 +0x1.4p+4 +0x1.cp+4 325s 5 +0x1.4p+2 +0x1.ap+3 +0x1.5p+4 +0x1.dp+4 325s 6 +0x1.8p+2 +0x1.cp+3 +0x1.6p+4 +0x1.ep+4 325s 7 +0x1.cp+2 +0x1.ep+3 +0x1.7p+4 +0x1.fp+4 325s > formatHex(FiveBits, precBits=5) 325s 0 8 16 24 325s 0 +0x0.0p+0 +0x1.0p+3 +0x1.0p+4 +0x1.8p+4 325s 1 +0x1.0p+0 +0x1.2p+3 +0x1.1p+4 +0x1.9p+4 325s 2 +0x1.0p+1 +0x1.4p+3 +0x1.2p+4 +0x1.ap+4 325s 3 +0x1.8p+1 +0x1.6p+3 +0x1.3p+4 +0x1.bp+4 325s 4 +0x1.0p+2 +0x1.8p+3 +0x1.4p+4 +0x1.cp+4 325s 5 +0x1.4p+2 +0x1.ap+3 +0x1.5p+4 +0x1.dp+4 325s 6 +0x1.8p+2 +0x1.cp+3 +0x1.6p+4 +0x1.ep+4 325s 7 +0x1.cp+2 +0x1.ep+3 +0x1.7p+4 +0x1.fp+4 325s > formatHex(FiveBits, precBits=6) 325s 0 8 16 24 325s 0 +0x0.00p+0 +0x1.00p+3 +0x1.00p+4 +0x1.80p+4 325s 1 +0x1.00p+0 +0x1.20p+3 +0x1.10p+4 +0x1.90p+4 325s 2 +0x1.00p+1 +0x1.40p+3 +0x1.20p+4 +0x1.a0p+4 325s 3 +0x1.80p+1 +0x1.60p+3 +0x1.30p+4 +0x1.b0p+4 325s 4 +0x1.00p+2 +0x1.80p+3 +0x1.40p+4 +0x1.c0p+4 325s 5 +0x1.40p+2 +0x1.a0p+3 +0x1.50p+4 +0x1.d0p+4 325s 6 +0x1.80p+2 +0x1.c0p+3 +0x1.60p+4 +0x1.e0p+4 325s 7 +0x1.c0p+2 +0x1.e0p+3 +0x1.70p+4 +0x1.f0p+4 325s > formatBin(FiveBits) 325s 0 8 16 24 325s 0 +0b0.0000p+0 +0b1.0000p+3 +0b1.0000p+4 +0b1.1000p+4 325s 1 +0b1.0000p+0 +0b1.0010p+3 +0b1.0001p+4 +0b1.1001p+4 325s 2 +0b1.0000p+1 +0b1.0100p+3 +0b1.0010p+4 +0b1.1010p+4 325s 3 +0b1.1000p+1 +0b1.0110p+3 +0b1.0011p+4 +0b1.1011p+4 325s 4 +0b1.0000p+2 +0b1.1000p+3 +0b1.0100p+4 +0b1.1100p+4 325s 5 +0b1.0100p+2 +0b1.1010p+3 +0b1.0101p+4 +0b1.1101p+4 325s 6 +0b1.1000p+2 +0b1.1100p+3 +0b1.0110p+4 +0b1.1110p+4 325s 7 +0b1.1100p+2 +0b1.1110p+3 +0b1.0111p+4 +0b1.1111p+4 325s > formatBin(FiveBits, precBits=5) 325s 0 8 16 24 325s 0 +0b0.0000p+0 +0b1.0000p+3 +0b1.0000p+4 +0b1.1000p+4 325s 1 +0b1.0000p+0 +0b1.0010p+3 +0b1.0001p+4 +0b1.1001p+4 325s 2 +0b1.0000p+1 +0b1.0100p+3 +0b1.0010p+4 +0b1.1010p+4 325s 3 +0b1.1000p+1 +0b1.0110p+3 +0b1.0011p+4 +0b1.1011p+4 325s 4 +0b1.0000p+2 +0b1.1000p+3 +0b1.0100p+4 +0b1.1100p+4 325s 5 +0b1.0100p+2 +0b1.1010p+3 +0b1.0101p+4 +0b1.1101p+4 325s 6 +0b1.1000p+2 +0b1.1100p+3 +0b1.0110p+4 +0b1.1110p+4 325s 7 +0b1.1100p+2 +0b1.1110p+3 +0b1.0111p+4 +0b1.1111p+4 325s > formatBin(FiveBits, precBits=6) 325s 0 8 16 24 325s 0 +0b0.00000p+0 +0b1.00000p+3 +0b1.00000p+4 +0b1.10000p+4 325s 1 +0b1.00000p+0 +0b1.00100p+3 +0b1.00010p+4 +0b1.10010p+4 325s 2 +0b1.00000p+1 +0b1.01000p+3 +0b1.00100p+4 +0b1.10100p+4 325s 3 +0b1.10000p+1 +0b1.01100p+3 +0b1.00110p+4 +0b1.10110p+4 325s 4 +0b1.00000p+2 +0b1.10000p+3 +0b1.01000p+4 +0b1.11000p+4 325s 5 +0b1.01000p+2 +0b1.10100p+3 +0b1.01010p+4 +0b1.11010p+4 325s 6 +0b1.10000p+2 +0b1.11000p+3 +0b1.01100p+4 +0b1.11100p+4 325s 7 +0b1.11000p+2 +0b1.11100p+3 +0b1.01110p+4 +0b1.11110p+4 325s > formatBin(FiveBits, scientific=FALSE) 325s 0 8 16 24 325s 0 +0b____0.0000 +0b_1000.0___ +0b10000.____ +0b11000.____ 325s 1 +0b____1.0000 +0b_1001.0___ +0b10001.____ +0b11001.____ 325s 2 +0b___10.000_ +0b_1010.0___ +0b10010.____ +0b11010.____ 325s 3 +0b___11.000_ +0b_1011.0___ +0b10011.____ +0b11011.____ 325s 4 +0b__100.00__ +0b_1100.0___ +0b10100.____ +0b11100.____ 325s 5 +0b__101.00__ +0b_1101.0___ +0b10101.____ +0b11101.____ 325s 6 +0b__110.00__ +0b_1110.0___ +0b10110.____ +0b11110.____ 325s 7 +0b__111.00__ +0b_1111.0___ +0b10111.____ +0b11111.____ 325s > formatBin(FiveBits, scientific=FALSE, precBits=6) 325s 0 8 16 24 325s 0 +0b____0.00000 +0b_1000.00___ +0b10000.0____ +0b11000.0____ 325s 1 +0b____1.00000 +0b_1001.00___ +0b10001.0____ +0b11001.0____ 325s 2 +0b___10.0000_ +0b_1010.00___ +0b10010.0____ +0b11010.0____ 325s 3 +0b___11.0000_ +0b_1011.00___ +0b10011.0____ +0b11011.0____ 325s 4 +0b__100.000__ +0b_1100.00___ +0b10100.0____ +0b11100.0____ 325s 5 +0b__101.000__ +0b_1101.00___ +0b10101.0____ +0b11101.0____ 325s 6 +0b__110.000__ +0b_1110.00___ +0b10110.0____ +0b11110.0____ 325s 7 +0b__111.000__ +0b_1111.00___ +0b10111.0____ +0b11111.0____ 325s > formatDec(FiveBits) 325s 0 8 16 24 325s 0 0.00 8.00 16.0 24.0 325s 1 1.00 9.00 17.0 25.0 325s 2 2.00 10.0 18.0 26.0 325s 3 3.00 11.0 19.0 27.0 325s 4 4.00 12.0 20.0 28.0 325s 5 5.00 13.0 21.0 29.0 325s 6 6.00 14.0 22.0 30.0 325s 7 7.00 15.0 23.0 31.0 325s > formatDec(FiveBits, precBits=5) 325s 0 8 16 24 325s 0 0.00 8.00 16.0 24.0 325s 1 1.00 9.00 17.0 25.0 325s 2 2.00 10.0 18.0 26.0 325s 3 3.00 11.0 19.0 27.0 325s 4 4.00 12.0 20.0 28.0 325s 5 5.00 13.0 21.0 29.0 325s 6 6.00 14.0 22.0 30.0 325s 7 7.00 15.0 23.0 31.0 325s > formatDec(FiveBits, precBits=7) 325s 0 8 16 24 325s 0 0.000 8.000 16.00 24.00 325s 1 1.000 9.000 17.00 25.00 325s 2 2.000 10.00 18.00 26.00 325s 3 3.000 11.00 19.00 27.00 325s 4 4.000 12.00 20.00 28.00 325s 5 5.000 13.00 21.00 29.00 325s 6 6.000 14.00 22.00 30.00 325s 7 7.000 15.00 23.00 31.00 325s > 325s > TenPowers <- mpfr(matrix(10^(-3:5)), precBits=53) 325s > row.names(TenPowers) <- -3:5 325s > TenPowers 325s 'mpfrMatrix' of dim(.) = (9, 1) of precision 53 bits 325s [,1] 325s -3 0.0010000000000000000 325s -2 0.010000000000000000 325s -1 0.10000000000000001 325s 0 1.0000000000000000 325s 1 10.000000000000000 325s 2 100.00000000000000 325s 3 1000.0000000000000 325s 4 10000.000000000000 325s 5 100000.00000000000 325s > 325s > options(width = 180) # for several "wide" displays below 325s > 325s > ## This indirectly "checks' as.data.frame.Ncharacter(): 325s > mkDF <- function(mv, displaydigits = 4, stringsAsFactors = FALSE) { 325s + stopifnot(is.numeric(mv) || inherits(mv, "mpfr")) 325s + data.frame(Hex = formatHex(mv), 325s + Bin = formatBin(mv), 325s + BinF= formatBin(mv, scientific=FALSE), 325s + Dec = formatDec(mv), 325s + Dec4= formatDec(mv, displaydigits=displaydigits), 325s + Dec.= formatDec(mv, scientific=TRUE), 325s + Dec.4=formatDec(mv, scientific=TRUE, displaydigits=displaydigits), 325s + stringsAsFactors = stringsAsFactors) 325s + } 325s > nmsMkDF <- c("Hex", "Bin", "BinF", "Dec", "Dec4", "Dec.", "Dec.4") 325s > 325s > d10p. <- mkDF(TenPowers) 325s > (d10p <- mkDF(as.vector(TenPowers))) 325s Hex Bin BinF 325s 1 +0x1.0624dd2f1a9fcp-10 +0b1.0000011000100100110111010010111100011010100111111100p-10 +0b_________________._________10000011000100100110111010010111100011010100111111100 325s 2 +0x1.47ae147ae147bp-7 +0b1.0100011110101110000101000111101011100001010001111011p-7 +0b_________________.______10100011110101110000101000111101011100001010001111011___ 325s 3 +0x1.999999999999ap-4 +0b1.1001100110011001100110011001100110011001100110011010p-4 +0b_________________.___11001100110011001100110011001100110011001100110011010______ 325s 4 +0x1.0000000000000p+0 +0b1.0000000000000000000000000000000000000000000000000000p+0 +0b________________1.0000000000000000000000000000000000000000000000000000__________ 325s 5 +0x1.4000000000000p+3 +0b1.0100000000000000000000000000000000000000000000000000p+3 +0b_____________1010.0000000000000000000000000000000000000000000000000_____________ 325s 6 +0x1.9000000000000p+6 +0b1.1001000000000000000000000000000000000000000000000000p+6 +0b__________1100100.0000000000000000000000000000000000000000000000________________ 325s 7 +0x1.f400000000000p+9 +0b1.1111010000000000000000000000000000000000000000000000p+9 +0b_______1111101000.0000000000000000000000000000000000000000000___________________ 325s 8 +0x1.3880000000000p+13 +0b1.0011100010000000000000000000000000000000000000000000p+13 +0b___10011100010000.000000000000000000000000000000000000000_______________________ 325s 9 +0x1.86a0000000000p+16 +0b1.1000011010100000000000000000000000000000000000000000p+16 +0b11000011010100000.000000000000000000000000000000000000__________________________ 325s Dec Dec4 Dec. Dec.4 325s 1 0.0010000000000000000 0.0010000000000000000 1.0000000000000000e-3 1.0000000000000000e-3 325s 2 0.010000000000000000 0.010000000000000000 1.0000000000000000e-2 1.0000000000000000e-2 325s 3 0.10000000000000001 0.10000000000000001 1.0000000000000001e-1 1.0000000000000001e-1 325s 4 1.0000000000000000 1.0000000000000000 1.0000000000000000e+0 1.0000000000000000e+0 325s 5 10.000000000000000 10.000000000000000 1.0000000000000000e+1 1.0000000000000000e+1 325s 6 100.00000000000000 100.00000000000000 1.0000000000000000e+2 1.0000000000000000e+2 325s 7 1000.0000000000000 1000.0000000000000 1.0000000000000000e+3 1.0000000000000000e+3 325s 8 10000.000000000000 10000.000000000000 1.0000000000000000e+4 1.0000000000000000e+4 325s 9 100000.00000000000 100000.00000000000 1.0000000000000000e+5 1.0000000000000000e+5 325s > 325s > 325s > TenFrac <- matrix((1:10)/10, dimnames=list(1:10, expression(1/x))) 325s > TenFrac 325s 1/x 325s 1 0.1 325s 2 0.2 325s 3 0.3 325s 4 0.4 325s 5 0.5 325s 6 0.6 325s 7 0.7 325s 8 0.8 325s 9 0.9 325s 10 1.0 325s > stopifnot(exprs = { 325s + is.matrix(print(formatHex(TenFrac))) # stays a matrix 325s + is.matrix(print(formatBin(TenFrac))) 325s + is.matrix(print(formatBin(TenFrac, scientific=FALSE))) 325s + is.matrix(print(formatDec(TenFrac))) 325s + }) 325s 1/x 325s 1 +0x1.999999999999ap-4 325s 2 +0x1.999999999999ap-3 325s 3 +0x1.3333333333333p-2 325s 4 +0x1.999999999999ap-2 325s 5 +0x1.0000000000000p-1 325s 6 +0x1.3333333333333p-1 325s 7 +0x1.6666666666666p-1 325s 8 +0x1.999999999999ap-1 325s 9 +0x1.ccccccccccccdp-1 325s 10 +0x1.0000000000000p+0 325s 1/x 325s 1 +0b1.1001100110011001100110011001100110011001100110011010p-4 325s 2 +0b1.1001100110011001100110011001100110011001100110011010p-3 325s 3 +0b1.0011001100110011001100110011001100110011001100110011p-2 325s 4 +0b1.1001100110011001100110011001100110011001100110011010p-2 325s 5 +0b1.0000000000000000000000000000000000000000000000000000p-1 325s 6 +0b1.0011001100110011001100110011001100110011001100110011p-1 325s 7 +0b1.0110011001100110011001100110011001100110011001100110p-1 325s 8 +0b1.1001100110011001100110011001100110011001100110011010p-1 325s 9 +0b1.1100110011001100110011001100110011001100110011001101p-1 325s 10 +0b1.0000000000000000000000000000000000000000000000000000p+0 325s 1/x 325s 1 +0b_.___11001100110011001100110011001100110011001100110011010 325s 2 +0b_.__11001100110011001100110011001100110011001100110011010_ 325s 3 +0b_._10011001100110011001100110011001100110011001100110011__ 325s 4 +0b_._11001100110011001100110011001100110011001100110011010__ 325s 5 +0b_.10000000000000000000000000000000000000000000000000000___ 325s 6 +0b_.10011001100110011001100110011001100110011001100110011___ 325s 7 +0b_.10110011001100110011001100110011001100110011001100110___ 325s 8 +0b_.11001100110011001100110011001100110011001100110011010___ 325s 9 +0b_.11100110011001100110011001100110011001100110011001101___ 325s 10 +0b1.0000000000000000000000000000000000000000000000000000____ 325s 1/x 325s 1 0.10000000000000001 325s 2 0.20000000000000001 325s 3 0.29999999999999999 325s 4 0.40000000000000002 325s 5 0.50000000000000000 325s 6 0.59999999999999998 325s 7 0.69999999999999996 325s 8 0.80000000000000004 325s 9 0.90000000000000002 325s 10 1.0000000000000000 325s > 325s > TenFrac9 <- mpfr(TenFrac, precBits=9) 325s > TenFrac9 325s 'mpfrMatrix' of dim(.) = (10, 1) of precision 9 bits 325s 1/x 325s 1 0.1001 325s 2 0.2002 325s 3 0.2998 325s 4 0.4004 325s 5 0.5000 325s 6 0.5996 325s 7 0.6992 325s 8 0.8008 325s 9 0.9004 325s 10 1.000 325s > data.frame(Hex = formatHex(TenFrac9), ## checking as.data.frame.Ncharacter as well 325s + Bin = formatBin(TenFrac9), 325s + BinF= formatBin(TenFrac9, scientific=FALSE), 325s + Dec = formatDec(TenFrac9)) -> d9 325s > d9 325s 1/x 1/x 1/x 1/x 325s 1 +0x1.9ap-4 +0b1.10011010p-4 +0b_.___110011010 0.1001 325s 2 +0x1.9ap-3 +0b1.10011010p-3 +0b_.__110011010_ 0.2002 325s 3 +0x1.33p-2 +0b1.00110011p-2 +0b_._100110011__ 0.2998 325s 4 +0x1.9ap-2 +0b1.10011010p-2 +0b_._110011010__ 0.4004 325s 5 +0x1.00p-1 +0b1.00000000p-1 +0b_.100000000___ 0.5000 325s 6 +0x1.33p-1 +0b1.00110011p-1 +0b_.100110011___ 0.5996 325s 7 +0x1.66p-1 +0b1.01100110p-1 +0b_.101100110___ 0.6992 325s 8 +0x1.9ap-1 +0b1.10011010p-1 +0b_.110011010___ 0.8008 325s 9 +0x1.cdp-1 +0b1.11001101p-1 +0b_.111001101___ 0.9004 325s 10 +0x1.00p+0 +0b1.00000000p+0 +0b1.00000000____ 1.000 325s > ## Does not print the column names but the colnames of each 1-col. matrix ("1/x"). 325s > ## This is how R in general works { in format.data.frame() } 325s > ## now use vectors: 325s > tenfrac9 <- as.vector(TenFrac9) 325s > stopifnot(identical(tenfrac9, c(TenFrac9))) 325s > data.frame(Hex = formatHex(tenfrac9), 325s + Bin = formatBin(tenfrac9), 325s + BinF= formatBin(tenfrac9, scientific=FALSE), 325s + Dec = formatDec(tenfrac9)) -> dl9 325s > dl9 # (now prints as d9 had printed in the past) 325s Hex Bin BinF Dec 325s 1 +0x1.9ap-4 +0b1.10011010p-4 +0b_.___110011010 0.1001 325s 2 +0x1.9ap-3 +0b1.10011010p-3 +0b_.__110011010_ 0.2002 325s 3 +0x1.33p-2 +0b1.00110011p-2 +0b_._100110011__ 0.2998 325s 4 +0x1.9ap-2 +0b1.10011010p-2 +0b_._110011010__ 0.4004 325s 5 +0x1.00p-1 +0b1.00000000p-1 +0b_.100000000___ 0.5000 325s 6 +0x1.33p-1 +0b1.00110011p-1 +0b_.100110011___ 0.5996 325s 7 +0x1.66p-1 +0b1.01100110p-1 +0b_.101100110___ 0.6992 325s 8 +0x1.9ap-1 +0b1.10011010p-1 +0b_.110011010___ 0.8008 325s 9 +0x1.cdp-1 +0b1.11001101p-1 +0b_.111001101___ 0.9004 325s 10 +0x1.00p+0 +0b1.00000000p+0 +0b1.00000000____ 1.000 325s > 325s > stopifnot(exprs = { 325s + getPrec(TenFrac ) == 53 325s + getPrec(TenFrac9) == 9 325s + colnames(d9) == c("Hex", "Bin", "BinF", "Dec") 325s + inherits(d9, "data.frame") 325s + all.equal(dim(d9), c(10,4)) 325s + }) 325s > 325s > (Ten <- matrix(1:10 + 0.0, dimnames=list(1:10, "x"))) ## + 0.0 forces double precision 325s x 325s 1 1 325s 2 2 325s 3 3 325s 4 4 325s 5 5 325s 6 6 325s 7 7 325s 8 8 325s 9 9 325s 10 10 325s > 325s > dT <- mkDF(Ten) 325s > dt <- mkDF(as.vector(Ten)) 325s > dt # large 325s Hex Bin BinF Dec 325s 1 +0x1.0000000000000p+0 +0b1.0000000000000000000000000000000000000000000000000000p+0 +0b___1.0000000000000000000000000000000000000000000000000000 1.0000000000000000 325s 2 +0x1.0000000000000p+1 +0b1.0000000000000000000000000000000000000000000000000000p+1 +0b__10.000000000000000000000000000000000000000000000000000_ 2.0000000000000000 325s 3 +0x1.8000000000000p+1 +0b1.1000000000000000000000000000000000000000000000000000p+1 +0b__11.000000000000000000000000000000000000000000000000000_ 3.0000000000000000 325s 4 +0x1.0000000000000p+2 +0b1.0000000000000000000000000000000000000000000000000000p+2 +0b_100.00000000000000000000000000000000000000000000000000__ 4.0000000000000000 325s 5 +0x1.4000000000000p+2 +0b1.0100000000000000000000000000000000000000000000000000p+2 +0b_101.00000000000000000000000000000000000000000000000000__ 5.0000000000000000 325s 6 +0x1.8000000000000p+2 +0b1.1000000000000000000000000000000000000000000000000000p+2 +0b_110.00000000000000000000000000000000000000000000000000__ 6.0000000000000000 325s 7 +0x1.c000000000000p+2 +0b1.1100000000000000000000000000000000000000000000000000p+2 +0b_111.00000000000000000000000000000000000000000000000000__ 7.0000000000000000 325s 8 +0x1.0000000000000p+3 +0b1.0000000000000000000000000000000000000000000000000000p+3 +0b1000.0000000000000000000000000000000000000000000000000___ 8.0000000000000000 325s 9 +0x1.2000000000000p+3 +0b1.0010000000000000000000000000000000000000000000000000p+3 +0b1001.0000000000000000000000000000000000000000000000000___ 9.0000000000000000 325s 10 +0x1.4000000000000p+3 +0b1.0100000000000000000000000000000000000000000000000000p+3 +0b1010.0000000000000000000000000000000000000000000000000___ 10.000000000000000 325s Dec4 Dec. Dec.4 325s 1 1.0000000000000000 1.0000000000000000e+0 1.0000000000000000e+0 325s 2 2.0000000000000000 2.0000000000000000e+0 2.0000000000000000e+0 325s 3 3.0000000000000000 3.0000000000000000e+0 3.0000000000000000e+0 325s 4 4.0000000000000000 4.0000000000000000e+0 4.0000000000000000e+0 325s 5 5.0000000000000000 5.0000000000000000e+0 5.0000000000000000e+0 325s 6 6.0000000000000000 6.0000000000000000e+0 6.0000000000000000e+0 325s 7 7.0000000000000000 7.0000000000000000e+0 7.0000000000000000e+0 325s 8 8.0000000000000000 8.0000000000000000e+0 8.0000000000000000e+0 325s 9 9.0000000000000000 9.0000000000000000e+0 9.0000000000000000e+0 325s 10 10.000000000000000 1.0000000000000000e+1 1.0000000000000000e+1 325s > 325s > (Ten4 <- mpfr(Ten, precBits=4)) 325s 'mpfrMatrix' of dim(.) = (10, 1) of precision 4 bits 325s x 325s 1 1.00 325s 2 2.00 325s 3 3.00 325s 4 4.00 325s 5 5.00 325s 6 6.00 325s 7 7.00 325s 8 8.00 325s 9 9.00 325s 10 10.0 325s > ten4 <- as.vector(Ten4) 325s > D4 <- mkDF(Ten4) # would be printing "x" --- because we added one-column matrices !! 325s > (d4 <- mkDF(ten4)) # printing fine ! 325s Hex Bin BinF Dec Dec4 Dec. Dec.4 325s 1 +0x1.0p+0 +0b1.000p+0 +0b___1.000 1.00 1.00 1.00e+0 1.00e+0 325s 2 +0x1.0p+1 +0b1.000p+1 +0b__10.00_ 2.00 2.00 2.00e+0 2.00e+0 325s 3 +0x1.8p+1 +0b1.100p+1 +0b__11.00_ 3.00 3.00 3.00e+0 3.00e+0 325s 4 +0x1.0p+2 +0b1.000p+2 +0b_100.0__ 4.00 4.00 4.00e+0 4.00e+0 325s 5 +0x1.4p+2 +0b1.010p+2 +0b_101.0__ 5.00 5.00 5.00e+0 5.00e+0 325s 6 +0x1.8p+2 +0b1.100p+2 +0b_110.0__ 6.00 6.00 6.00e+0 6.00e+0 325s 7 +0x1.cp+2 +0b1.110p+2 +0b_111.0__ 7.00 7.00 7.00e+0 7.00e+0 325s 8 +0x1.0p+3 +0b1.000p+3 +0b1000.___ 8.00 8.00 8.00e+0 8.00e+0 325s 9 +0x1.2p+3 +0b1.001p+3 +0b1001.___ 9.00 9.00 9.00e+0 9.00e+0 325s 10 +0x1.4p+3 +0b1.010p+3 +0b1010.___ 10.0 10.0 1.00e+1 1.00e+1 325s > stopifnot(identical(names(d4), names(D4)), 325s + identical(names(d4), nmsMkDF)) 325s > 325s > 325s > 325s > Two8 <- matrix(2^seq(-8, 8)) 325s > Two8.3 <- mpfr(Two8, precBits=3) 325s > ## formatBin 325s > stopifnot( 325s + identical(sapply(as(Two8.3, "mpfr")[-c(1:3, 15:17)], 325s + function(t83) formatBin(t83, scientific=FALSE)), 325s + c("+0b.____100", "+0b.___100", "+0b.__100", "+0b._100", "+0b.100", 325s + "+0b1.00","+0b10.0","+0b100.","+0b100_.","+0b100__.","+0b100___."))) 325s > ## formatDec --- these must be perfectly aligned on the "." ! 325s > formatDec(Two8.3, digits = 3) 325s [,1] 325s [1,] 0.00391 325s [2,] 0.00781 325s [3,] 0.0156 325s [4,] 0.0312 325s [5,] 0.0625 325s [6,] 0.125 325s [7,] 0.250 325s [8,] 0.500 325s [9,] 1.00 325s [10,] 2.00 325s [11,] 4.00 325s [12,] 8.00 325s [13,] 16.0 325s [14,] 32.0 325s [15,] 64.0 325s [16,] 128. 325s [17,] 256. 325s > formatDec(Two8.3, digits = 8) 325s [,1] 325s [1,] 0.0039062500 325s [2,] 0.0078125000 325s [3,] 0.015625000 325s [4,] 0.031250000 325s [5,] 0.062500000 325s [6,] 0.12500000 325s [7,] 0.25000000 325s [8,] 0.50000000 325s [9,] 1.0000000 325s [10,] 2.0000000 325s [11,] 4.0000000 325s [12,] 8.0000000 325s [13,] 16.000000 325s [14,] 32.000000 325s [15,] 64.000000 325s [16,] 128.00000 325s [17,] 256.00000 325s > stopifnot( 325s + identical(capture.output(formatDec(Two8.3, digits = 3))[2:4], 325s + c(" [1,] 0.00391", " [2,] 0.00781", " [3,] 0.0156 ")) 325s + , 325s + identical(capture.output(formatDec(Two8.3, digits = 8))[c(2:3,8,13,16)], 325s + c(" [1,] 0.0039062500", " [2,] 0.0078125000", " [7,] 0.25000000 ", 325s + "[12,] 8.0000000 ", "[15,] 64.000000 ")) 325s + ) 325s > 325s > 325s > 325s autopkgtest [15:57:20]: test run-unit-test: -----------------------] 326s autopkgtest [15:57:21]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 326s run-unit-test PASS 326s autopkgtest [15:57:21]: test pkg-r-autopkgtest: preparing testbed 493s autopkgtest [16:00:08]: testbed dpkg architecture: arm64 493s autopkgtest [16:00:08]: testbed apt version: 2.9.33 494s autopkgtest [16:00:09]: @@@@@@@@@@@@@@@@@@@@ test bed setup 494s autopkgtest [16:00:09]: testbed release detected to be: plucky 495s autopkgtest [16:00:10]: updating testbed package index (apt update) 495s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [126 kB] 495s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 496s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 496s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 496s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [99.7 kB] 496s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [379 kB] 496s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.8 kB] 496s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 Packages [111 kB] 496s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 c-n-f Metadata [1856 B] 496s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted arm64 c-n-f Metadata [116 B] 496s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 Packages [324 kB] 497s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 c-n-f Metadata [14.7 kB] 497s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse arm64 Packages [4948 B] 497s Get:14 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse arm64 c-n-f Metadata [268 B] 497s Fetched 1078 kB in 2s (531 kB/s) 498s Reading package lists... 499s Reading package lists... 499s Building dependency tree... 499s Reading state information... 500s Calculating upgrade... 500s Calculating upgrade... 500s The following packages will be upgraded: 500s pinentry-curses python3-jinja2 strace 501s 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 501s Need to get 647 kB of archives. 501s After this operation, 11.3 kB of additional disk space will be used. 501s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 strace arm64 6.13+ds-1ubuntu1 [499 kB] 501s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 pinentry-curses arm64 1.3.1-2ubuntu3 [39.2 kB] 501s Get:3 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-jinja2 all 3.1.5-2ubuntu1 [109 kB] 502s Fetched 647 kB in 1s (640 kB/s) 502s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 117701 files and directories currently installed.) 502s Preparing to unpack .../strace_6.13+ds-1ubuntu1_arm64.deb ... 502s Unpacking strace (6.13+ds-1ubuntu1) over (6.11-0ubuntu1) ... 502s Preparing to unpack .../pinentry-curses_1.3.1-2ubuntu3_arm64.deb ... 502s Unpacking pinentry-curses (1.3.1-2ubuntu3) over (1.3.1-2ubuntu2) ... 502s Preparing to unpack .../python3-jinja2_3.1.5-2ubuntu1_all.deb ... 502s Unpacking python3-jinja2 (3.1.5-2ubuntu1) over (3.1.5-2) ... 503s Setting up pinentry-curses (1.3.1-2ubuntu3) ... 503s Setting up python3-jinja2 (3.1.5-2ubuntu1) ... 503s Setting up strace (6.13+ds-1ubuntu1) ... 503s Processing triggers for man-db (2.13.0-1) ... 504s Reading package lists... 504s Building dependency tree... 504s Reading state information... 504s Solving dependencies... 505s The following packages will be REMOVED: 505s libnsl2* libpython3.12-minimal* libpython3.12-stdlib* libpython3.12t64* 505s libunwind8* linux-headers-6.11.0-8* linux-headers-6.11.0-8-generic* 505s linux-image-6.11.0-8-generic* linux-modules-6.11.0-8-generic* 505s linux-tools-6.11.0-8* linux-tools-6.11.0-8-generic* 505s 0 upgraded, 0 newly installed, 11 to remove and 5 not upgraded. 505s After this operation, 267 MB disk space will be freed. 505s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 117701 files and directories currently installed.) 505s Removing linux-tools-6.11.0-8-generic (6.11.0-8.8) ... 505s Removing linux-tools-6.11.0-8 (6.11.0-8.8) ... 505s Removing libpython3.12t64:arm64 (3.12.9-1) ... 505s Removing libpython3.12-stdlib:arm64 (3.12.9-1) ... 506s Removing libnsl2:arm64 (1.3.0-3build3) ... 506s Removing libpython3.12-minimal:arm64 (3.12.9-1) ... 506s Removing libunwind8:arm64 (1.6.2-3.1) ... 506s Removing linux-headers-6.11.0-8-generic (6.11.0-8.8) ... 506s Removing linux-headers-6.11.0-8 (6.11.0-8.8) ... 508s Removing linux-image-6.11.0-8-generic (6.11.0-8.8) ... 508s I: /boot/vmlinuz.old is now a symlink to vmlinuz-6.14.0-10-generic 508s I: /boot/initrd.img.old is now a symlink to initrd.img-6.14.0-10-generic 508s /etc/kernel/postrm.d/initramfs-tools: 508s update-initramfs: Deleting /boot/initrd.img-6.11.0-8-generic 509s /etc/kernel/postrm.d/zz-flash-kernel: 509s flash-kernel: Kernel 6.11.0-8-generic has been removed. 509s flash-kernel: A higher version (6.14.0-10-generic) is still installed, no reflashing required. 509s /etc/kernel/postrm.d/zz-update-grub: 509s Sourcing file `/etc/default/grub' 509s Sourcing file `/etc/default/grub.d/50-cloudimg-settings.cfg' 509s Generating grub configuration file ... 509s Found linux image: /boot/vmlinuz-6.14.0-10-generic 509s Found initrd image: /boot/initrd.img-6.14.0-10-generic 510s Warning: os-prober will not be executed to detect other bootable partitions. 510s Systems on them will not be added to the GRUB boot configuration. 510s Check GRUB_DISABLE_OS_PROBER documentation entry. 510s Adding boot menu entry for UEFI Firmware Settings ... 510s done 510s Removing linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 510s Processing triggers for libc-bin (2.41-1ubuntu1) ... 510s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81650 files and directories currently installed.) 510s Purging configuration files for linux-image-6.11.0-8-generic (6.11.0-8.8) ... 510s Purging configuration files for libpython3.12-minimal:arm64 (3.12.9-1) ... 510s Purging configuration files for linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 510s autopkgtest [16:00:25]: upgrading testbed (apt dist-upgrade and autopurge) 511s Reading package lists... 511s Building dependency tree... 511s Reading state information... 511s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 512s Starting 2 pkgProblemResolver with broken count: 0 512s Done 512s Entering ResolveByKeep 513s 513s Calculating upgrade... 513s The following packages will be upgraded: 513s libc-bin libc-dev-bin libc6 libc6-dev locales 513s 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 513s Need to get 9530 kB of archives. 513s After this operation, 0 B of additional disk space will be used. 513s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc6-dev arm64 2.41-1ubuntu2 [1750 kB] 516s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc-dev-bin arm64 2.41-1ubuntu2 [24.0 kB] 516s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc6 arm64 2.41-1ubuntu2 [2910 kB] 519s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc-bin arm64 2.41-1ubuntu2 [600 kB] 520s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 locales all 2.41-1ubuntu2 [4246 kB] 525s Preconfiguring packages ... 525s Fetched 9530 kB in 12s (815 kB/s) 525s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 525s Preparing to unpack .../libc6-dev_2.41-1ubuntu2_arm64.deb ... 526s Unpacking libc6-dev:arm64 (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 526s Preparing to unpack .../libc-dev-bin_2.41-1ubuntu2_arm64.deb ... 526s Unpacking libc-dev-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 526s Preparing to unpack .../libc6_2.41-1ubuntu2_arm64.deb ... 526s Unpacking libc6:arm64 (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 526s Setting up libc6:arm64 (2.41-1ubuntu2) ... 526s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 526s Preparing to unpack .../libc-bin_2.41-1ubuntu2_arm64.deb ... 526s Unpacking libc-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 526s Setting up libc-bin (2.41-1ubuntu2) ... 526s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 526s Preparing to unpack .../locales_2.41-1ubuntu2_all.deb ... 527s Unpacking locales (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 527s Setting up locales (2.41-1ubuntu2) ... 527s Generating locales (this might take a while)... 530s en_US.UTF-8... done 530s Generation complete. 530s Setting up libc-dev-bin (2.41-1ubuntu2) ... 530s Setting up libc6-dev:arm64 (2.41-1ubuntu2) ... 530s Processing triggers for man-db (2.13.0-1) ... 531s Processing triggers for systemd (257.3-1ubuntu3) ... 532s Reading package lists... 532s Building dependency tree... 532s Reading state information... 532s Starting pkgProblemResolver with broken count: 0 532s Starting 2 pkgProblemResolver with broken count: 0 532s Done 533s Solving dependencies... 533s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 534s autopkgtest [16:00:49]: rebooting testbed after setup commands that affected boot 560s Reading package lists... 561s Building dependency tree... 561s Reading state information... 561s Starting pkgProblemResolver with broken count: 0 561s Starting 2 pkgProblemResolver with broken count: 0 561s Done 562s The following NEW packages will be installed: 562s build-essential cpp cpp-14 cpp-14-aarch64-linux-gnu cpp-aarch64-linux-gnu 562s dctrl-tools fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono 562s g++ g++-14 g++-14-aarch64-linux-gnu g++-aarch64-linux-gnu gcc gcc-14 562s gcc-14-aarch64-linux-gnu gcc-aarch64-linux-gnu gfortran gfortran-14 562s gfortran-14-aarch64-linux-gnu gfortran-aarch64-linux-gnu icu-devtools 562s libasan8 libblas-dev libblas3 libbz2-dev libcairo2 libcc1-0 libdatrie1 562s libdeflate-dev libdeflate0 libfontconfig1 libgcc-14-dev libgfortran-14-dev 562s libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b libhwasan0 libice6 562s libicu-dev libisl23 libitm1 libjbig0 libjpeg-dev libjpeg-turbo8 562s libjpeg-turbo8-dev libjpeg8 libjpeg8-dev liblapack-dev liblapack3 liblerc4 562s liblsan0 liblzma-dev libmpc3 libncurses-dev libpango-1.0-0 562s libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper2 libpcre2-16-0 562s libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpixman-1-0 libpkgconf3 562s libpng-dev libreadline-dev libsharpyuv0 libsm6 libstdc++-14-dev libtcl8.6 562s libthai-data libthai0 libtiff6 libtirpc-dev libtk8.6 libtsan2 libubsan1 562s libwebp7 libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 562s pkg-r-autopkgtest pkgconf pkgconf-bin r-base-core r-base-dev r-cran-gmp 562s r-cran-mass r-cran-rmpfr r-cran-sfsmisc unzip x11-common xdg-utils zip 562s zlib1g-dev 562s 0 upgraded, 102 newly installed, 0 to remove and 0 not upgraded. 562s Need to get 134 MB of archives. 562s After this operation, 418 MB of additional disk space will be used. 562s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 libisl23 arm64 0.27-1 [676 kB] 563s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 libmpc3 arm64 1.3.1-1build2 [56.8 kB] 563s Get:3 http://ftpmaster.internal/ubuntu plucky/main arm64 cpp-14-aarch64-linux-gnu arm64 14.2.0-17ubuntu3 [10.6 MB] 576s Get:4 http://ftpmaster.internal/ubuntu plucky/main arm64 cpp-14 arm64 14.2.0-17ubuntu3 [1028 B] 576s Get:5 http://ftpmaster.internal/ubuntu plucky/main arm64 cpp-aarch64-linux-gnu arm64 4:14.2.0-1ubuntu1 [5558 B] 576s Get:6 http://ftpmaster.internal/ubuntu plucky/main arm64 cpp arm64 4:14.2.0-1ubuntu1 [22.4 kB] 576s Get:7 http://ftpmaster.internal/ubuntu plucky/main arm64 libcc1-0 arm64 15-20250222-0ubuntu1 [44.2 kB] 576s Get:8 http://ftpmaster.internal/ubuntu plucky/main arm64 libgomp1 arm64 15-20250222-0ubuntu1 [146 kB] 576s Get:9 http://ftpmaster.internal/ubuntu plucky/main arm64 libitm1 arm64 15-20250222-0ubuntu1 [28.0 kB] 576s Get:10 http://ftpmaster.internal/ubuntu plucky/main arm64 libasan8 arm64 15-20250222-0ubuntu1 [2924 kB] 579s Get:11 http://ftpmaster.internal/ubuntu plucky/main arm64 liblsan0 arm64 15-20250222-0ubuntu1 [1319 kB] 581s Get:12 http://ftpmaster.internal/ubuntu plucky/main arm64 libtsan2 arm64 15-20250222-0ubuntu1 [2694 kB] 584s Get:13 http://ftpmaster.internal/ubuntu plucky/main arm64 libubsan1 arm64 15-20250222-0ubuntu1 [1178 kB] 585s Get:14 http://ftpmaster.internal/ubuntu plucky/main arm64 libhwasan0 arm64 15-20250222-0ubuntu1 [1642 kB] 587s Get:15 http://ftpmaster.internal/ubuntu plucky/main arm64 libgcc-14-dev arm64 14.2.0-17ubuntu3 [2593 kB] 590s Get:16 http://ftpmaster.internal/ubuntu plucky/main arm64 gcc-14-aarch64-linux-gnu arm64 14.2.0-17ubuntu3 [20.9 MB] 613s Get:17 http://ftpmaster.internal/ubuntu plucky/main arm64 gcc-14 arm64 14.2.0-17ubuntu3 [526 kB] 614s Get:18 http://ftpmaster.internal/ubuntu plucky/main arm64 gcc-aarch64-linux-gnu arm64 4:14.2.0-1ubuntu1 [1200 B] 614s Get:19 http://ftpmaster.internal/ubuntu plucky/main arm64 gcc arm64 4:14.2.0-1ubuntu1 [4998 B] 614s Get:20 http://ftpmaster.internal/ubuntu plucky/main arm64 libstdc++-14-dev arm64 14.2.0-17ubuntu3 [2499 kB] 617s Get:21 http://ftpmaster.internal/ubuntu plucky/main arm64 g++-14-aarch64-linux-gnu arm64 14.2.0-17ubuntu3 [12.1 MB] 631s Get:22 http://ftpmaster.internal/ubuntu plucky/main arm64 g++-14 arm64 14.2.0-17ubuntu3 [21.8 kB] 631s Get:23 http://ftpmaster.internal/ubuntu plucky/main arm64 g++-aarch64-linux-gnu arm64 4:14.2.0-1ubuntu1 [956 B] 631s Get:24 http://ftpmaster.internal/ubuntu plucky/main arm64 g++ arm64 4:14.2.0-1ubuntu1 [1080 B] 631s Get:25 http://ftpmaster.internal/ubuntu plucky/main arm64 build-essential arm64 12.10ubuntu1 [4932 B] 631s Get:26 http://ftpmaster.internal/ubuntu plucky/main arm64 dctrl-tools arm64 2.24-3build3 [103 kB] 632s Get:27 http://ftpmaster.internal/ubuntu plucky/main arm64 fonts-dejavu-mono all 2.37-8 [502 kB] 632s Get:28 http://ftpmaster.internal/ubuntu plucky/main arm64 fonts-dejavu-core all 2.37-8 [835 kB] 633s Get:29 http://ftpmaster.internal/ubuntu plucky/main arm64 fontconfig-config arm64 2.15.0-2ubuntu1 [37.5 kB] 633s Get:30 http://ftpmaster.internal/ubuntu plucky/main arm64 libfontconfig1 arm64 2.15.0-2ubuntu1 [144 kB] 633s Get:31 http://ftpmaster.internal/ubuntu plucky/main arm64 fontconfig arm64 2.15.0-2ubuntu1 [191 kB] 634s Get:32 http://ftpmaster.internal/ubuntu plucky/main arm64 libgfortran5 arm64 15-20250222-0ubuntu1 [444 kB] 634s Get:33 http://ftpmaster.internal/ubuntu plucky/main arm64 libgfortran-14-dev arm64 14.2.0-17ubuntu3 [498 kB] 635s Get:34 http://ftpmaster.internal/ubuntu plucky/main arm64 gfortran-14-aarch64-linux-gnu arm64 14.2.0-17ubuntu3 [11.4 MB] 648s Get:35 http://ftpmaster.internal/ubuntu plucky/main arm64 gfortran-14 arm64 14.2.0-17ubuntu3 [13.6 kB] 648s Get:36 http://ftpmaster.internal/ubuntu plucky/main arm64 gfortran-aarch64-linux-gnu arm64 4:14.2.0-1ubuntu1 [1022 B] 648s Get:37 http://ftpmaster.internal/ubuntu plucky/main arm64 gfortran arm64 4:14.2.0-1ubuntu1 [1166 B] 648s Get:38 http://ftpmaster.internal/ubuntu plucky/main arm64 icu-devtools arm64 76.1-1ubuntu2 [213 kB] 649s Get:39 http://ftpmaster.internal/ubuntu plucky/main arm64 libblas3 arm64 3.12.1-2 [161 kB] 649s Get:40 http://ftpmaster.internal/ubuntu plucky/main arm64 libblas-dev arm64 3.12.1-2 [126 kB] 649s Get:41 http://ftpmaster.internal/ubuntu plucky/main arm64 libbz2-dev arm64 1.0.8-6 [36.1 kB] 650s Get:42 http://ftpmaster.internal/ubuntu plucky/main arm64 libpixman-1-0 arm64 0.44.0-3 [197 kB] 650s Get:43 http://ftpmaster.internal/ubuntu plucky/main arm64 libxcb-render0 arm64 1.17.0-2 [16.6 kB] 650s Get:44 http://ftpmaster.internal/ubuntu plucky/main arm64 libxcb-shm0 arm64 1.17.0-2 [5884 B] 650s Get:45 http://ftpmaster.internal/ubuntu plucky/main arm64 libxrender1 arm64 1:0.9.10-1.1build1 [18.8 kB] 650s Get:46 http://ftpmaster.internal/ubuntu plucky/main arm64 libcairo2 arm64 1.18.2-2 [560 kB] 651s Get:47 http://ftpmaster.internal/ubuntu plucky/main arm64 libdatrie1 arm64 0.2.13-3build1 [19.2 kB] 651s Get:48 http://ftpmaster.internal/ubuntu plucky/main arm64 libdeflate0 arm64 1.23-1 [46.2 kB] 651s Get:49 http://ftpmaster.internal/ubuntu plucky/main arm64 libdeflate-dev arm64 1.23-1 [53.7 kB] 651s Get:50 http://ftpmaster.internal/ubuntu plucky/main arm64 libgraphite2-3 arm64 1.3.14-2ubuntu1 [70.6 kB] 651s Get:51 http://ftpmaster.internal/ubuntu plucky/main arm64 libharfbuzz0b arm64 10.2.0-1 [490 kB] 652s Get:52 http://ftpmaster.internal/ubuntu plucky/main arm64 x11-common all 1:7.7+23ubuntu3 [21.7 kB] 652s Get:53 http://ftpmaster.internal/ubuntu plucky/main arm64 libice6 arm64 2:1.1.1-1 [42.3 kB] 652s Get:54 http://ftpmaster.internal/ubuntu plucky/main arm64 libicu-dev arm64 76.1-1ubuntu2 [12.2 MB] 666s Get:55 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg-turbo8 arm64 2.1.5-3ubuntu2 [165 kB] 666s Get:56 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg-turbo8-dev arm64 2.1.5-3ubuntu2 [306 kB] 667s Get:57 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg8 arm64 8c-2ubuntu11 [2148 B] 667s Get:58 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg8-dev arm64 8c-2ubuntu11 [1484 B] 667s Get:59 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg-dev arm64 8c-2ubuntu11 [1482 B] 667s Get:60 http://ftpmaster.internal/ubuntu plucky/main arm64 liblapack3 arm64 3.12.1-2 [2307 kB] 670s Get:61 http://ftpmaster.internal/ubuntu plucky/main arm64 liblapack-dev arm64 3.12.1-2 [4439 kB] 675s Get:62 http://ftpmaster.internal/ubuntu plucky/main arm64 liblerc4 arm64 4.0.0+ds-5ubuntu1 [167 kB] 675s Get:63 http://ftpmaster.internal/ubuntu plucky/main arm64 libncurses-dev arm64 6.5+20250216-2 [389 kB] 675s Get:64 http://ftpmaster.internal/ubuntu plucky/main arm64 libthai-data all 0.1.29-2build1 [158 kB] 676s Get:65 http://ftpmaster.internal/ubuntu plucky/main arm64 libthai0 arm64 0.1.29-2build1 [18.2 kB] 676s Get:66 http://ftpmaster.internal/ubuntu plucky/main arm64 libpango-1.0-0 arm64 1.56.2-1 [237 kB] 676s Get:67 http://ftpmaster.internal/ubuntu plucky/main arm64 libpangoft2-1.0-0 arm64 1.56.2-1 [49.5 kB] 676s Get:68 http://ftpmaster.internal/ubuntu plucky/main arm64 libpangocairo-1.0-0 arm64 1.56.2-1 [27.6 kB] 677s Get:69 http://ftpmaster.internal/ubuntu plucky/main arm64 libpaper2 arm64 2.2.5-0.3 [17.3 kB] 677s Get:70 http://ftpmaster.internal/ubuntu plucky/main arm64 libpaper-utils arm64 2.2.5-0.3 [15.4 kB] 677s Get:71 http://ftpmaster.internal/ubuntu plucky/main arm64 libpcre2-16-0 arm64 10.45-1 [222 kB] 677s Get:72 http://ftpmaster.internal/ubuntu plucky/main arm64 libpcre2-32-0 arm64 10.45-1 [210 kB] 677s Get:73 http://ftpmaster.internal/ubuntu plucky/main arm64 libpcre2-posix3 arm64 10.45-1 [7084 B] 677s Get:74 http://ftpmaster.internal/ubuntu plucky/main arm64 libpcre2-dev arm64 10.45-1 [768 kB] 679s Get:75 http://ftpmaster.internal/ubuntu plucky/main arm64 libpkgconf3 arm64 1.8.1-4 [31.4 kB] 679s Get:76 http://ftpmaster.internal/ubuntu plucky/main arm64 zlib1g-dev arm64 1:1.3.dfsg+really1.3.1-1ubuntu1 [894 kB] 680s Get:77 http://ftpmaster.internal/ubuntu plucky/main arm64 libpng-dev arm64 1.6.47-1 [269 kB] 680s Get:78 http://ftpmaster.internal/ubuntu plucky/main arm64 libreadline-dev arm64 8.2-6 [179 kB] 681s Get:79 http://ftpmaster.internal/ubuntu plucky/main arm64 libsharpyuv0 arm64 1.5.0-0.1 [16.9 kB] 681s Get:80 http://ftpmaster.internal/ubuntu plucky/main arm64 libsm6 arm64 2:1.2.4-1 [16.4 kB] 681s Get:81 http://ftpmaster.internal/ubuntu plucky/main arm64 libtcl8.6 arm64 8.6.16+dfsg-1 [987 kB] 682s Get:82 http://ftpmaster.internal/ubuntu plucky/main arm64 libjbig0 arm64 2.1-6.1ubuntu2 [29.3 kB] 682s Get:83 http://ftpmaster.internal/ubuntu plucky/main arm64 libwebp7 arm64 1.5.0-0.1 [194 kB] 682s Get:84 http://ftpmaster.internal/ubuntu plucky/main arm64 libtiff6 arm64 4.5.1+git230720-4ubuntu4 [193 kB] 683s Get:85 http://ftpmaster.internal/ubuntu plucky/main arm64 libxft2 arm64 2.3.6-1build1 [44.1 kB] 683s Get:86 http://ftpmaster.internal/ubuntu plucky/main arm64 libxss1 arm64 1:1.2.3-1build3 [7244 B] 683s Get:87 http://ftpmaster.internal/ubuntu plucky/main arm64 libtk8.6 arm64 8.6.16-1 [776 kB] 684s Get:88 http://ftpmaster.internal/ubuntu plucky/main arm64 libxt6t64 arm64 1:1.2.1-1.2build1 [168 kB] 684s Get:89 http://ftpmaster.internal/ubuntu plucky/main arm64 zip arm64 3.0-14ubuntu2 [173 kB] 684s Get:90 http://ftpmaster.internal/ubuntu plucky/main arm64 unzip arm64 6.0-28ubuntu6 [178 kB] 685s Get:91 http://ftpmaster.internal/ubuntu plucky/main arm64 xdg-utils all 1.2.1-2ubuntu1 [66.0 kB] 685s Get:92 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-base-core arm64 4.4.3-1 [28.4 MB] 720s Get:93 http://ftpmaster.internal/ubuntu plucky/main arm64 liblzma-dev arm64 5.6.4-1 [180 kB] 720s Get:94 http://ftpmaster.internal/ubuntu plucky/main arm64 pkgconf-bin arm64 1.8.1-4 [20.9 kB] 720s Get:95 http://ftpmaster.internal/ubuntu plucky/main arm64 pkgconf arm64 1.8.1-4 [16.7 kB] 720s Get:96 http://ftpmaster.internal/ubuntu plucky/main arm64 libtirpc-dev arm64 1.3.4+ds-1.3 [201 kB] 721s Get:97 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-base-dev all 4.4.3-1 [4176 B] 721s Get:98 http://ftpmaster.internal/ubuntu plucky/universe arm64 pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 721s Get:99 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-gmp arm64 0.7-5-1 [307 kB] 721s Get:100 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-mass arm64 7.3-64-1 [1110 kB] 722s Get:101 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-rmpfr arm64 0.9-5-1 [1219 kB] 724s Get:102 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-sfsmisc all 1.1-20-1 [674 kB] 725s Preconfiguring packages ... 725s Fetched 134 MB in 2min 43s (825 kB/s) 725s Selecting previously unselected package libisl23:arm64. 726s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 726s Preparing to unpack .../000-libisl23_0.27-1_arm64.deb ... 726s Unpacking libisl23:arm64 (0.27-1) ... 726s Selecting previously unselected package libmpc3:arm64. 726s Preparing to unpack .../001-libmpc3_1.3.1-1build2_arm64.deb ... 726s Unpacking libmpc3:arm64 (1.3.1-1build2) ... 726s Selecting previously unselected package cpp-14-aarch64-linux-gnu. 726s Preparing to unpack .../002-cpp-14-aarch64-linux-gnu_14.2.0-17ubuntu3_arm64.deb ... 726s Unpacking cpp-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 726s Selecting previously unselected package cpp-14. 726s Preparing to unpack .../003-cpp-14_14.2.0-17ubuntu3_arm64.deb ... 726s Unpacking cpp-14 (14.2.0-17ubuntu3) ... 726s Selecting previously unselected package cpp-aarch64-linux-gnu. 726s Preparing to unpack .../004-cpp-aarch64-linux-gnu_4%3a14.2.0-1ubuntu1_arm64.deb ... 726s Unpacking cpp-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 726s Selecting previously unselected package cpp. 726s Preparing to unpack .../005-cpp_4%3a14.2.0-1ubuntu1_arm64.deb ... 726s Unpacking cpp (4:14.2.0-1ubuntu1) ... 726s Selecting previously unselected package libcc1-0:arm64. 726s Preparing to unpack .../006-libcc1-0_15-20250222-0ubuntu1_arm64.deb ... 726s Unpacking libcc1-0:arm64 (15-20250222-0ubuntu1) ... 726s Selecting previously unselected package libgomp1:arm64. 726s Preparing to unpack .../007-libgomp1_15-20250222-0ubuntu1_arm64.deb ... 726s Unpacking libgomp1:arm64 (15-20250222-0ubuntu1) ... 726s Selecting previously unselected package libitm1:arm64. 726s Preparing to unpack .../008-libitm1_15-20250222-0ubuntu1_arm64.deb ... 726s Unpacking libitm1:arm64 (15-20250222-0ubuntu1) ... 726s Selecting previously unselected package libasan8:arm64. 726s Preparing to unpack .../009-libasan8_15-20250222-0ubuntu1_arm64.deb ... 726s Unpacking libasan8:arm64 (15-20250222-0ubuntu1) ... 726s Selecting previously unselected package liblsan0:arm64. 726s Preparing to unpack .../010-liblsan0_15-20250222-0ubuntu1_arm64.deb ... 726s Unpacking liblsan0:arm64 (15-20250222-0ubuntu1) ... 726s Selecting previously unselected package libtsan2:arm64. 726s Preparing to unpack .../011-libtsan2_15-20250222-0ubuntu1_arm64.deb ... 726s Unpacking libtsan2:arm64 (15-20250222-0ubuntu1) ... 727s Selecting previously unselected package libubsan1:arm64. 727s Preparing to unpack .../012-libubsan1_15-20250222-0ubuntu1_arm64.deb ... 727s Unpacking libubsan1:arm64 (15-20250222-0ubuntu1) ... 727s Selecting previously unselected package libhwasan0:arm64. 727s Preparing to unpack .../013-libhwasan0_15-20250222-0ubuntu1_arm64.deb ... 727s Unpacking libhwasan0:arm64 (15-20250222-0ubuntu1) ... 727s Selecting previously unselected package libgcc-14-dev:arm64. 727s Preparing to unpack .../014-libgcc-14-dev_14.2.0-17ubuntu3_arm64.deb ... 727s Unpacking libgcc-14-dev:arm64 (14.2.0-17ubuntu3) ... 727s Selecting previously unselected package gcc-14-aarch64-linux-gnu. 727s Preparing to unpack .../015-gcc-14-aarch64-linux-gnu_14.2.0-17ubuntu3_arm64.deb ... 727s Unpacking gcc-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 727s Selecting previously unselected package gcc-14. 727s Preparing to unpack .../016-gcc-14_14.2.0-17ubuntu3_arm64.deb ... 727s Unpacking gcc-14 (14.2.0-17ubuntu3) ... 727s Selecting previously unselected package gcc-aarch64-linux-gnu. 727s Preparing to unpack .../017-gcc-aarch64-linux-gnu_4%3a14.2.0-1ubuntu1_arm64.deb ... 727s Unpacking gcc-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 727s Selecting previously unselected package gcc. 727s Preparing to unpack .../018-gcc_4%3a14.2.0-1ubuntu1_arm64.deb ... 727s Unpacking gcc (4:14.2.0-1ubuntu1) ... 727s Selecting previously unselected package libstdc++-14-dev:arm64. 727s Preparing to unpack .../019-libstdc++-14-dev_14.2.0-17ubuntu3_arm64.deb ... 727s Unpacking libstdc++-14-dev:arm64 (14.2.0-17ubuntu3) ... 728s Selecting previously unselected package g++-14-aarch64-linux-gnu. 728s Preparing to unpack .../020-g++-14-aarch64-linux-gnu_14.2.0-17ubuntu3_arm64.deb ... 728s Unpacking g++-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 728s Selecting previously unselected package g++-14. 728s Preparing to unpack .../021-g++-14_14.2.0-17ubuntu3_arm64.deb ... 728s Unpacking g++-14 (14.2.0-17ubuntu3) ... 728s Selecting previously unselected package g++-aarch64-linux-gnu. 728s Preparing to unpack .../022-g++-aarch64-linux-gnu_4%3a14.2.0-1ubuntu1_arm64.deb ... 728s Unpacking g++-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 728s Selecting previously unselected package g++. 728s Preparing to unpack .../023-g++_4%3a14.2.0-1ubuntu1_arm64.deb ... 728s Unpacking g++ (4:14.2.0-1ubuntu1) ... 728s Selecting previously unselected package build-essential. 728s Preparing to unpack .../024-build-essential_12.10ubuntu1_arm64.deb ... 728s Unpacking build-essential (12.10ubuntu1) ... 728s Selecting previously unselected package dctrl-tools. 728s Preparing to unpack .../025-dctrl-tools_2.24-3build3_arm64.deb ... 728s Unpacking dctrl-tools (2.24-3build3) ... 728s Selecting previously unselected package fonts-dejavu-mono. 728s Preparing to unpack .../026-fonts-dejavu-mono_2.37-8_all.deb ... 728s Unpacking fonts-dejavu-mono (2.37-8) ... 728s Selecting previously unselected package fonts-dejavu-core. 728s Preparing to unpack .../027-fonts-dejavu-core_2.37-8_all.deb ... 728s Unpacking fonts-dejavu-core (2.37-8) ... 728s Selecting previously unselected package fontconfig-config. 728s Preparing to unpack .../028-fontconfig-config_2.15.0-2ubuntu1_arm64.deb ... 728s Unpacking fontconfig-config (2.15.0-2ubuntu1) ... 728s Selecting previously unselected package libfontconfig1:arm64. 728s Preparing to unpack .../029-libfontconfig1_2.15.0-2ubuntu1_arm64.deb ... 728s Unpacking libfontconfig1:arm64 (2.15.0-2ubuntu1) ... 729s Selecting previously unselected package fontconfig. 729s Preparing to unpack .../030-fontconfig_2.15.0-2ubuntu1_arm64.deb ... 729s Unpacking fontconfig (2.15.0-2ubuntu1) ... 729s Selecting previously unselected package libgfortran5:arm64. 729s Preparing to unpack .../031-libgfortran5_15-20250222-0ubuntu1_arm64.deb ... 729s Unpacking libgfortran5:arm64 (15-20250222-0ubuntu1) ... 729s Selecting previously unselected package libgfortran-14-dev:arm64. 729s Preparing to unpack .../032-libgfortran-14-dev_14.2.0-17ubuntu3_arm64.deb ... 729s Unpacking libgfortran-14-dev:arm64 (14.2.0-17ubuntu3) ... 729s Selecting previously unselected package gfortran-14-aarch64-linux-gnu. 729s Preparing to unpack .../033-gfortran-14-aarch64-linux-gnu_14.2.0-17ubuntu3_arm64.deb ... 729s Unpacking gfortran-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 729s Selecting previously unselected package gfortran-14. 729s Preparing to unpack .../034-gfortran-14_14.2.0-17ubuntu3_arm64.deb ... 729s Unpacking gfortran-14 (14.2.0-17ubuntu3) ... 729s Selecting previously unselected package gfortran-aarch64-linux-gnu. 729s Preparing to unpack .../035-gfortran-aarch64-linux-gnu_4%3a14.2.0-1ubuntu1_arm64.deb ... 729s Unpacking gfortran-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 729s Selecting previously unselected package gfortran. 729s Preparing to unpack .../036-gfortran_4%3a14.2.0-1ubuntu1_arm64.deb ... 729s Unpacking gfortran (4:14.2.0-1ubuntu1) ... 729s Selecting previously unselected package icu-devtools. 729s Preparing to unpack .../037-icu-devtools_76.1-1ubuntu2_arm64.deb ... 729s Unpacking icu-devtools (76.1-1ubuntu2) ... 729s Selecting previously unselected package libblas3:arm64. 729s Preparing to unpack .../038-libblas3_3.12.1-2_arm64.deb ... 729s Unpacking libblas3:arm64 (3.12.1-2) ... 729s Selecting previously unselected package libblas-dev:arm64. 729s Preparing to unpack .../039-libblas-dev_3.12.1-2_arm64.deb ... 729s Unpacking libblas-dev:arm64 (3.12.1-2) ... 729s Selecting previously unselected package libbz2-dev:arm64. 729s Preparing to unpack .../040-libbz2-dev_1.0.8-6_arm64.deb ... 729s Unpacking libbz2-dev:arm64 (1.0.8-6) ... 729s Selecting previously unselected package libpixman-1-0:arm64. 729s Preparing to unpack .../041-libpixman-1-0_0.44.0-3_arm64.deb ... 729s Unpacking libpixman-1-0:arm64 (0.44.0-3) ... 729s Selecting previously unselected package libxcb-render0:arm64. 729s Preparing to unpack .../042-libxcb-render0_1.17.0-2_arm64.deb ... 729s Unpacking libxcb-render0:arm64 (1.17.0-2) ... 729s Selecting previously unselected package libxcb-shm0:arm64. 729s Preparing to unpack .../043-libxcb-shm0_1.17.0-2_arm64.deb ... 729s Unpacking libxcb-shm0:arm64 (1.17.0-2) ... 729s Selecting previously unselected package libxrender1:arm64. 729s Preparing to unpack .../044-libxrender1_1%3a0.9.10-1.1build1_arm64.deb ... 729s Unpacking libxrender1:arm64 (1:0.9.10-1.1build1) ... 729s Selecting previously unselected package libcairo2:arm64. 729s Preparing to unpack .../045-libcairo2_1.18.2-2_arm64.deb ... 729s Unpacking libcairo2:arm64 (1.18.2-2) ... 729s Selecting previously unselected package libdatrie1:arm64. 729s Preparing to unpack .../046-libdatrie1_0.2.13-3build1_arm64.deb ... 729s Unpacking libdatrie1:arm64 (0.2.13-3build1) ... 729s Selecting previously unselected package libdeflate0:arm64. 729s Preparing to unpack .../047-libdeflate0_1.23-1_arm64.deb ... 729s Unpacking libdeflate0:arm64 (1.23-1) ... 730s Selecting previously unselected package libdeflate-dev:arm64. 730s Preparing to unpack .../048-libdeflate-dev_1.23-1_arm64.deb ... 730s Unpacking libdeflate-dev:arm64 (1.23-1) ... 730s Selecting previously unselected package libgraphite2-3:arm64. 730s Preparing to unpack .../049-libgraphite2-3_1.3.14-2ubuntu1_arm64.deb ... 730s Unpacking libgraphite2-3:arm64 (1.3.14-2ubuntu1) ... 730s Selecting previously unselected package libharfbuzz0b:arm64. 730s Preparing to unpack .../050-libharfbuzz0b_10.2.0-1_arm64.deb ... 730s Unpacking libharfbuzz0b:arm64 (10.2.0-1) ... 730s Selecting previously unselected package x11-common. 730s Preparing to unpack .../051-x11-common_1%3a7.7+23ubuntu3_all.deb ... 730s Unpacking x11-common (1:7.7+23ubuntu3) ... 730s Selecting previously unselected package libice6:arm64. 730s Preparing to unpack .../052-libice6_2%3a1.1.1-1_arm64.deb ... 730s Unpacking libice6:arm64 (2:1.1.1-1) ... 730s Selecting previously unselected package libicu-dev:arm64. 730s Preparing to unpack .../053-libicu-dev_76.1-1ubuntu2_arm64.deb ... 730s Unpacking libicu-dev:arm64 (76.1-1ubuntu2) ... 730s Selecting previously unselected package libjpeg-turbo8:arm64. 730s Preparing to unpack .../054-libjpeg-turbo8_2.1.5-3ubuntu2_arm64.deb ... 730s Unpacking libjpeg-turbo8:arm64 (2.1.5-3ubuntu2) ... 730s Selecting previously unselected package libjpeg-turbo8-dev:arm64. 730s Preparing to unpack .../055-libjpeg-turbo8-dev_2.1.5-3ubuntu2_arm64.deb ... 730s Unpacking libjpeg-turbo8-dev:arm64 (2.1.5-3ubuntu2) ... 730s Selecting previously unselected package libjpeg8:arm64. 730s Preparing to unpack .../056-libjpeg8_8c-2ubuntu11_arm64.deb ... 730s Unpacking libjpeg8:arm64 (8c-2ubuntu11) ... 730s Selecting previously unselected package libjpeg8-dev:arm64. 730s Preparing to unpack .../057-libjpeg8-dev_8c-2ubuntu11_arm64.deb ... 730s Unpacking libjpeg8-dev:arm64 (8c-2ubuntu11) ... 730s Selecting previously unselected package libjpeg-dev:arm64. 730s Preparing to unpack .../058-libjpeg-dev_8c-2ubuntu11_arm64.deb ... 730s Unpacking libjpeg-dev:arm64 (8c-2ubuntu11) ... 730s Selecting previously unselected package liblapack3:arm64. 730s Preparing to unpack .../059-liblapack3_3.12.1-2_arm64.deb ... 730s Unpacking liblapack3:arm64 (3.12.1-2) ... 730s Selecting previously unselected package liblapack-dev:arm64. 730s Preparing to unpack .../060-liblapack-dev_3.12.1-2_arm64.deb ... 730s Unpacking liblapack-dev:arm64 (3.12.1-2) ... 731s Selecting previously unselected package liblerc4:arm64. 731s Preparing to unpack .../061-liblerc4_4.0.0+ds-5ubuntu1_arm64.deb ... 731s Unpacking liblerc4:arm64 (4.0.0+ds-5ubuntu1) ... 731s Selecting previously unselected package libncurses-dev:arm64. 731s Preparing to unpack .../062-libncurses-dev_6.5+20250216-2_arm64.deb ... 731s Unpacking libncurses-dev:arm64 (6.5+20250216-2) ... 731s Selecting previously unselected package libthai-data. 731s Preparing to unpack .../063-libthai-data_0.1.29-2build1_all.deb ... 731s Unpacking libthai-data (0.1.29-2build1) ... 731s Selecting previously unselected package libthai0:arm64. 731s Preparing to unpack .../064-libthai0_0.1.29-2build1_arm64.deb ... 731s Unpacking libthai0:arm64 (0.1.29-2build1) ... 731s Selecting previously unselected package libpango-1.0-0:arm64. 731s Preparing to unpack .../065-libpango-1.0-0_1.56.2-1_arm64.deb ... 731s Unpacking libpango-1.0-0:arm64 (1.56.2-1) ... 731s Selecting previously unselected package libpangoft2-1.0-0:arm64. 731s Preparing to unpack .../066-libpangoft2-1.0-0_1.56.2-1_arm64.deb ... 731s Unpacking libpangoft2-1.0-0:arm64 (1.56.2-1) ... 731s Selecting previously unselected package libpangocairo-1.0-0:arm64. 731s Preparing to unpack .../067-libpangocairo-1.0-0_1.56.2-1_arm64.deb ... 731s Unpacking libpangocairo-1.0-0:arm64 (1.56.2-1) ... 731s Selecting previously unselected package libpaper2:arm64. 731s Preparing to unpack .../068-libpaper2_2.2.5-0.3_arm64.deb ... 731s Unpacking libpaper2:arm64 (2.2.5-0.3) ... 731s Selecting previously unselected package libpaper-utils. 731s Preparing to unpack .../069-libpaper-utils_2.2.5-0.3_arm64.deb ... 731s Unpacking libpaper-utils (2.2.5-0.3) ... 731s Selecting previously unselected package libpcre2-16-0:arm64. 731s Preparing to unpack .../070-libpcre2-16-0_10.45-1_arm64.deb ... 731s Unpacking libpcre2-16-0:arm64 (10.45-1) ... 731s Selecting previously unselected package libpcre2-32-0:arm64. 731s Preparing to unpack .../071-libpcre2-32-0_10.45-1_arm64.deb ... 731s Unpacking libpcre2-32-0:arm64 (10.45-1) ... 731s Selecting previously unselected package libpcre2-posix3:arm64. 731s Preparing to unpack .../072-libpcre2-posix3_10.45-1_arm64.deb ... 731s Unpacking libpcre2-posix3:arm64 (10.45-1) ... 731s Selecting previously unselected package libpcre2-dev:arm64. 731s Preparing to unpack .../073-libpcre2-dev_10.45-1_arm64.deb ... 731s Unpacking libpcre2-dev:arm64 (10.45-1) ... 731s Selecting previously unselected package libpkgconf3:arm64. 731s Preparing to unpack .../074-libpkgconf3_1.8.1-4_arm64.deb ... 731s Unpacking libpkgconf3:arm64 (1.8.1-4) ... 731s Selecting previously unselected package zlib1g-dev:arm64. 731s Preparing to unpack .../075-zlib1g-dev_1%3a1.3.dfsg+really1.3.1-1ubuntu1_arm64.deb ... 731s Unpacking zlib1g-dev:arm64 (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 731s Selecting previously unselected package libpng-dev:arm64. 731s Preparing to unpack .../076-libpng-dev_1.6.47-1_arm64.deb ... 731s Unpacking libpng-dev:arm64 (1.6.47-1) ... 731s Selecting previously unselected package libreadline-dev:arm64. 731s Preparing to unpack .../077-libreadline-dev_8.2-6_arm64.deb ... 731s Unpacking libreadline-dev:arm64 (8.2-6) ... 731s Selecting previously unselected package libsharpyuv0:arm64. 731s Preparing to unpack .../078-libsharpyuv0_1.5.0-0.1_arm64.deb ... 731s Unpacking libsharpyuv0:arm64 (1.5.0-0.1) ... 731s Selecting previously unselected package libsm6:arm64. 731s Preparing to unpack .../079-libsm6_2%3a1.2.4-1_arm64.deb ... 731s Unpacking libsm6:arm64 (2:1.2.4-1) ... 731s Selecting previously unselected package libtcl8.6:arm64. 731s Preparing to unpack .../080-libtcl8.6_8.6.16+dfsg-1_arm64.deb ... 731s Unpacking libtcl8.6:arm64 (8.6.16+dfsg-1) ... 731s Selecting previously unselected package libjbig0:arm64. 731s Preparing to unpack .../081-libjbig0_2.1-6.1ubuntu2_arm64.deb ... 731s Unpacking libjbig0:arm64 (2.1-6.1ubuntu2) ... 731s Selecting previously unselected package libwebp7:arm64. 732s Preparing to unpack .../082-libwebp7_1.5.0-0.1_arm64.deb ... 732s Unpacking libwebp7:arm64 (1.5.0-0.1) ... 732s Selecting previously unselected package libtiff6:arm64. 732s Preparing to unpack .../083-libtiff6_4.5.1+git230720-4ubuntu4_arm64.deb ... 732s Unpacking libtiff6:arm64 (4.5.1+git230720-4ubuntu4) ... 732s Selecting previously unselected package libxft2:arm64. 732s Preparing to unpack .../084-libxft2_2.3.6-1build1_arm64.deb ... 732s Unpacking libxft2:arm64 (2.3.6-1build1) ... 732s Selecting previously unselected package libxss1:arm64. 732s Preparing to unpack .../085-libxss1_1%3a1.2.3-1build3_arm64.deb ... 732s Unpacking libxss1:arm64 (1:1.2.3-1build3) ... 732s Selecting previously unselected package libtk8.6:arm64. 732s Preparing to unpack .../086-libtk8.6_8.6.16-1_arm64.deb ... 732s Unpacking libtk8.6:arm64 (8.6.16-1) ... 732s Selecting previously unselected package libxt6t64:arm64. 732s Preparing to unpack .../087-libxt6t64_1%3a1.2.1-1.2build1_arm64.deb ... 732s Unpacking libxt6t64:arm64 (1:1.2.1-1.2build1) ... 732s Selecting previously unselected package zip. 732s Preparing to unpack .../088-zip_3.0-14ubuntu2_arm64.deb ... 732s Unpacking zip (3.0-14ubuntu2) ... 732s Selecting previously unselected package unzip. 732s Preparing to unpack .../089-unzip_6.0-28ubuntu6_arm64.deb ... 732s Unpacking unzip (6.0-28ubuntu6) ... 732s Selecting previously unselected package xdg-utils. 732s Preparing to unpack .../090-xdg-utils_1.2.1-2ubuntu1_all.deb ... 732s Unpacking xdg-utils (1.2.1-2ubuntu1) ... 732s Selecting previously unselected package r-base-core. 732s Preparing to unpack .../091-r-base-core_4.4.3-1_arm64.deb ... 732s Unpacking r-base-core (4.4.3-1) ... 732s Selecting previously unselected package liblzma-dev:arm64. 732s Preparing to unpack .../092-liblzma-dev_5.6.4-1_arm64.deb ... 732s Unpacking liblzma-dev:arm64 (5.6.4-1) ... 732s Selecting previously unselected package pkgconf-bin. 732s Preparing to unpack .../093-pkgconf-bin_1.8.1-4_arm64.deb ... 732s Unpacking pkgconf-bin (1.8.1-4) ... 732s Selecting previously unselected package pkgconf:arm64. 732s Preparing to unpack .../094-pkgconf_1.8.1-4_arm64.deb ... 732s Unpacking pkgconf:arm64 (1.8.1-4) ... 732s Selecting previously unselected package libtirpc-dev:arm64. 732s Preparing to unpack .../095-libtirpc-dev_1.3.4+ds-1.3_arm64.deb ... 732s Unpacking libtirpc-dev:arm64 (1.3.4+ds-1.3) ... 732s Selecting previously unselected package r-base-dev. 732s Preparing to unpack .../096-r-base-dev_4.4.3-1_all.deb ... 732s Unpacking r-base-dev (4.4.3-1) ... 733s Selecting previously unselected package pkg-r-autopkgtest. 733s Preparing to unpack .../097-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 733s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 733s Selecting previously unselected package r-cran-gmp. 733s Preparing to unpack .../098-r-cran-gmp_0.7-5-1_arm64.deb ... 733s Unpacking r-cran-gmp (0.7-5-1) ... 733s Selecting previously unselected package r-cran-mass. 733s Preparing to unpack .../099-r-cran-mass_7.3-64-1_arm64.deb ... 733s Unpacking r-cran-mass (7.3-64-1) ... 733s Selecting previously unselected package r-cran-rmpfr. 733s Preparing to unpack .../100-r-cran-rmpfr_0.9-5-1_arm64.deb ... 733s Unpacking r-cran-rmpfr (0.9-5-1) ... 733s Selecting previously unselected package r-cran-sfsmisc. 733s Preparing to unpack .../101-r-cran-sfsmisc_1.1-20-1_all.deb ... 733s Unpacking r-cran-sfsmisc (1.1-20-1) ... 733s Setting up libgraphite2-3:arm64 (1.3.14-2ubuntu1) ... 733s Setting up libpixman-1-0:arm64 (0.44.0-3) ... 733s Setting up libsharpyuv0:arm64 (1.5.0-0.1) ... 733s Setting up libncurses-dev:arm64 (6.5+20250216-2) ... 733s Setting up liblerc4:arm64 (4.0.0+ds-5ubuntu1) ... 733s Setting up libxrender1:arm64 (1:0.9.10-1.1build1) ... 733s Setting up libdatrie1:arm64 (0.2.13-3build1) ... 733s Setting up libxcb-render0:arm64 (1.17.0-2) ... 733s Setting up unzip (6.0-28ubuntu6) ... 733s Setting up x11-common (1:7.7+23ubuntu3) ... 733s Setting up libdeflate0:arm64 (1.23-1) ... 733s Setting up libxcb-shm0:arm64 (1.17.0-2) ... 733s Setting up libreadline-dev:arm64 (8.2-6) ... 733s Setting up libgomp1:arm64 (15-20250222-0ubuntu1) ... 733s Setting up libjbig0:arm64 (2.1-6.1ubuntu2) ... 733s Setting up libpcre2-16-0:arm64 (10.45-1) ... 733s Setting up zip (3.0-14ubuntu2) ... 733s Setting up libpcre2-32-0:arm64 (10.45-1) ... 733s Setting up libblas3:arm64 (3.12.1-2) ... 733s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/aarch64-linux-gnu/libblas.so.3 (libblas.so.3-aarch64-linux-gnu) in auto mode 733s Setting up libtirpc-dev:arm64 (1.3.4+ds-1.3) ... 733s Setting up libpkgconf3:arm64 (1.8.1-4) ... 733s Setting up fonts-dejavu-mono (2.37-8) ... 733s Setting up libmpc3:arm64 (1.3.1-1build2) ... 733s Setting up libtcl8.6:arm64 (8.6.16+dfsg-1) ... 733s Setting up icu-devtools (76.1-1ubuntu2) ... 733s Setting up fonts-dejavu-core (2.37-8) ... 733s Setting up pkgconf-bin (1.8.1-4) ... 733s Setting up libjpeg-turbo8:arm64 (2.1.5-3ubuntu2) ... 733s Setting up libgfortran5:arm64 (15-20250222-0ubuntu1) ... 733s Setting up libwebp7:arm64 (1.5.0-0.1) ... 733s Setting up liblzma-dev:arm64 (5.6.4-1) ... 733s Setting up libubsan1:arm64 (15-20250222-0ubuntu1) ... 733s Setting up zlib1g-dev:arm64 (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 733s Setting up libpcre2-posix3:arm64 (10.45-1) ... 733s Setting up libhwasan0:arm64 (15-20250222-0ubuntu1) ... 733s Setting up libasan8:arm64 (15-20250222-0ubuntu1) ... 733s Setting up libharfbuzz0b:arm64 (10.2.0-1) ... 733s Setting up libthai-data (0.1.29-2build1) ... 733s Setting up libxss1:arm64 (1:1.2.3-1build3) ... 733s Setting up libpaper2:arm64 (2.2.5-0.3) ... 733s Setting up libtsan2:arm64 (15-20250222-0ubuntu1) ... 733s Setting up libisl23:arm64 (0.27-1) ... 733s Setting up libdeflate-dev:arm64 (1.23-1) ... 733s Setting up libicu-dev:arm64 (76.1-1ubuntu2) ... 733s Setting up xdg-utils (1.2.1-2ubuntu1) ... 733s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 733s Setting up libcc1-0:arm64 (15-20250222-0ubuntu1) ... 733s Setting up liblsan0:arm64 (15-20250222-0ubuntu1) ... 733s Setting up libblas-dev:arm64 (3.12.1-2) ... 733s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so to provide /usr/lib/aarch64-linux-gnu/libblas.so (libblas.so-aarch64-linux-gnu) in auto mode 733s Setting up dctrl-tools (2.24-3build3) ... 733s Setting up libitm1:arm64 (15-20250222-0ubuntu1) ... 733s Setting up libbz2-dev:arm64 (1.0.8-6) ... 733s Setting up libjpeg8:arm64 (8c-2ubuntu11) ... 733s Setting up libice6:arm64 (2:1.1.1-1) ... 733s Setting up libjpeg-turbo8-dev:arm64 (2.1.5-3ubuntu2) ... 733s Setting up liblapack3:arm64 (3.12.1-2) ... 733s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/aarch64-linux-gnu/liblapack.so.3 (liblapack.so.3-aarch64-linux-gnu) in auto mode 733s Setting up libpcre2-dev:arm64 (10.45-1) ... 733s Setting up fontconfig-config (2.15.0-2ubuntu1) ... 734s Setting up libpng-dev:arm64 (1.6.47-1) ... 734s Setting up libpaper-utils (2.2.5-0.3) ... 734s Setting up pkgconf:arm64 (1.8.1-4) ... 734s Setting up libthai0:arm64 (0.1.29-2build1) ... 734s Setting up liblapack-dev:arm64 (3.12.1-2) ... 734s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so to provide /usr/lib/aarch64-linux-gnu/liblapack.so (liblapack.so-aarch64-linux-gnu) in auto mode 734s Setting up cpp-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 734s Setting up libtiff6:arm64 (4.5.1+git230720-4ubuntu4) ... 734s Setting up libfontconfig1:arm64 (2.15.0-2ubuntu1) ... 734s Setting up libgcc-14-dev:arm64 (14.2.0-17ubuntu3) ... 734s Setting up libjpeg8-dev:arm64 (8c-2ubuntu11) ... 734s Setting up libstdc++-14-dev:arm64 (14.2.0-17ubuntu3) ... 734s Setting up libsm6:arm64 (2:1.2.4-1) ... 734s Setting up libgfortran-14-dev:arm64 (14.2.0-17ubuntu3) ... 734s Setting up fontconfig (2.15.0-2ubuntu1) ... 736s Regenerating fonts cache... done. 736s Setting up libxft2:arm64 (2.3.6-1build1) ... 736s Setting up libtk8.6:arm64 (8.6.16-1) ... 736s Setting up libpango-1.0-0:arm64 (1.56.2-1) ... 736s Setting up libjpeg-dev:arm64 (8c-2ubuntu11) ... 736s Setting up libcairo2:arm64 (1.18.2-2) ... 736s Setting up cpp-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 736s Setting up libxt6t64:arm64 (1:1.2.1-1.2build1) ... 736s Setting up cpp-14 (14.2.0-17ubuntu3) ... 736s Setting up cpp (4:14.2.0-1ubuntu1) ... 736s Setting up gcc-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 736s Setting up libpangoft2-1.0-0:arm64 (1.56.2-1) ... 736s Setting up libpangocairo-1.0-0:arm64 (1.56.2-1) ... 736s Setting up gcc-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 736s Setting up g++-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 736s Setting up gcc-14 (14.2.0-17ubuntu3) ... 736s Setting up r-base-core (4.4.3-1) ... 736s Creating config file /etc/R/Renviron with new version 736s Setting up gfortran-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 736s Setting up g++-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 736s Setting up gfortran-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 736s Setting up g++-14 (14.2.0-17ubuntu3) ... 736s Setting up gfortran-14 (14.2.0-17ubuntu3) ... 736s Setting up r-cran-gmp (0.7-5-1) ... 736s Setting up r-cran-sfsmisc (1.1-20-1) ... 736s Setting up r-cran-mass (7.3-64-1) ... 736s Setting up gcc (4:14.2.0-1ubuntu1) ... 736s Setting up g++ (4:14.2.0-1ubuntu1) ... 736s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 736s Setting up build-essential (12.10ubuntu1) ... 736s Setting up r-cran-rmpfr (0.9-5-1) ... 736s Setting up gfortran (4:14.2.0-1ubuntu1) ... 736s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 736s update-alternatives: warning: skip creation of /usr/share/man/man1/f95.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f95) doesn't exist 736s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 736s update-alternatives: warning: skip creation of /usr/share/man/man1/f77.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f77) doesn't exist 736s Setting up r-base-dev (4.4.3-1) ... 736s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 736s Processing triggers for libc-bin (2.41-1ubuntu2) ... 736s Processing triggers for man-db (2.13.0-1) ... 738s Processing triggers for install-info (7.1.1-1) ... 741s autopkgtest [16:04:16]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 741s autopkgtest [16:04:16]: test pkg-r-autopkgtest: [----------------------- 741s Test: Try to load the R library Rmpfr 741s 741s R version 4.4.3 (2025-02-28) -- "Trophy Case" 741s Copyright (C) 2025 The R Foundation for Statistical Computing 741s Platform: aarch64-unknown-linux-gnu 741s 741s R is free software and comes with ABSOLUTELY NO WARRANTY. 741s You are welcome to redistribute it under certain conditions. 741s Type 'license()' or 'licence()' for distribution details. 741s 741s R is a collaborative project with many contributors. 741s Type 'contributors()' for more information and 741s 'citation()' on how to cite R or R packages in publications. 741s 741s Type 'demo()' for some demos, 'help()' for on-line help, or 741s 'help.start()' for an HTML browser interface to help. 741s Type 'q()' to quit R. 741s 741s > library('Rmpfr') 741s Loading required package: gmp 741s 741s Attaching package: ‘gmp’ 741s 741s The following objects are masked from ‘package:base’: 741s 741s %*%, apply, crossprod, matrix, tcrossprod 741s 742s > 742s > 742s C code of R package 'Rmpfr': GMP using 64 bits per limb 742s 742s 742s Attaching package: ‘Rmpfr’ 742s 742s The following object is masked from ‘package:gmp’: 742s 742s outer 742s 742s The following objects are masked from ‘package:stats’: 742s 742s dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm 742s 742s The following objects are masked from ‘package:base’: 742s 742s cbind, pmax, pmin, rbind 742s 742s Other tests are currently unsupported! 742s They will be progressively added. 742s autopkgtest [16:04:17]: test pkg-r-autopkgtest: -----------------------] 743s autopkgtest [16:04:18]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 743s pkg-r-autopkgtest PASS 743s autopkgtest [16:04:18]: @@@@@@@@@@@@@@@@@@@@ summary 743s run-unit-test PASS 743s pkg-r-autopkgtest PASS 762s nova [W] Using flock in prodstack6-arm64 762s Creating nova instance adt-plucky-arm64-r-cran-rmpfr-20250315-155154-juju-7f2275-prod-proposed-migration-environment-2-de644ecf-555a-4178-8ef0-36636bb3ee94 from image adt/ubuntu-plucky-arm64-server-20250315.img (UUID bd6e766c-b51f-4b53-86d6-23aa4d18f524)... 762s nova [W] Timed out waiting for 639772e0-56d4-4d7e-ae1e-ff883de4dc13 to get deleted. 762s nova [W] Using flock in prodstack6-arm64 762s Creating nova instance adt-plucky-arm64-r-cran-rmpfr-20250315-155154-juju-7f2275-prod-proposed-migration-environment-2-de644ecf-555a-4178-8ef0-36636bb3ee94 from image adt/ubuntu-plucky-arm64-server-20250315.img (UUID bd6e766c-b51f-4b53-86d6-23aa4d18f524)... 762s nova [W] Timed out waiting for 997a372d-8982-4b4d-9d4b-f505a8abfad2 to get deleted.