11 "cell_type": "markdown",
14 "## Test the performance of numerical operations"
27 "output_type": "stream",
30 "Populating the interactive namespace from numpy and matplotlib\n"
40 "from common import *"
51 "for b in [\"single\", \"double\", \"GMPrat\", \"ParanoidNumber\"]:\n",
52 " os.system(\"make -C %s clean\" % options[\"ipdf_src\"])\n",
53 " os.system(\"make -C %s REALTYPE=%d tests/identitytests\" % (options[\"ipdf_src\"], options[\"real_names\"].index(b)))\n",
54 " os.system(\"mv %s/tests/identitytests %s/identity-%s\" % (options[\"ipdf_src\"], options[\"local_bin\"], b))\n",
55 " display(\"Built %s\" % b)"
62 "output_type": "display_data",
69 "output_type": "display_data",
76 "output_type": "display_data",
83 "output_type": "display_data",
85 "'Built ParanoidNumber'"
95 "def IdentityTest(real):\n",
96 " start = time.time()\n",
97 " display(\"%s starts at %d\" % (b, start))\n",
98 " p = subprocess.Popen(\"./identity-%s\" % real, bufsize=0, stdin=subprocess.PIPE, \\\n",
99 " stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\n",
101 " display(\"%s completed, took %d\" % (real,time.time() - start))\n",
104 "language": "python",
115 "language": "python",
124 "for b in [\"single\", \"double\", \"GMPrat\", \"ParanoidNumber\"]:\n",
125 " threading.Thread(target=IdentityTest, args=(b,)).start()"
127 "language": "python",
132 "output_type": "display_data",
134 "'double starts at 1411243678'"
139 "output_type": "display_data",
141 "'GMPrat starts at 1411243678'"
146 "output_type": "display_data",
148 "'ParanoidNumber starts at 1411243678'"
158 "language": "python",