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