Average Error: 0.4 → 0.3
Time: 43.3s
Precision: 64
Internal Precision: 384
\[\left(\frac{1}{6} \cdot {\left(-2 \cdot \log u1\right)}^{0.5}\right) \cdot \cos \left(\left(2 \cdot \pi\right) \cdot u2\right) + 0.5\]
\[(\left(\frac{{\left(-2 \cdot \log u1\right)}^{0.5}}{6}\right) \cdot \left(\cos \left(\left(u2 \cdot \left(\sqrt[3]{\pi + \pi} \cdot \sqrt[3]{\pi + \pi}\right)\right) \cdot \sqrt[3]{\pi + \pi}\right)\right) + 0.5)_*\]

Error

Bits error versus u1

Bits error versus u2

Derivation

  1. Initial program 0.4

    \[\left(\frac{1}{6} \cdot {\left(-2 \cdot \log u1\right)}^{0.5}\right) \cdot \cos \left(\left(2 \cdot \pi\right) \cdot u2\right) + 0.5\]
  2. Applied simplify0.3

    \[\leadsto \color{blue}{(\left(\frac{{\left(-2 \cdot \log u1\right)}^{0.5}}{6}\right) \cdot \left(\cos \left(u2 \cdot \left(\pi + \pi\right)\right)\right) + 0.5)_*}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.3

    \[\leadsto (\left(\frac{{\left(-2 \cdot \log u1\right)}^{0.5}}{6}\right) \cdot \left(\cos \left(u2 \cdot \color{blue}{\left(\left(\sqrt[3]{\pi + \pi} \cdot \sqrt[3]{\pi + \pi}\right) \cdot \sqrt[3]{\pi + \pi}\right)}\right)\right) + 0.5)_*\]
  5. Applied associate-*r*0.3

    \[\leadsto (\left(\frac{{\left(-2 \cdot \log u1\right)}^{0.5}}{6}\right) \cdot \left(\cos \color{blue}{\left(\left(u2 \cdot \left(\sqrt[3]{\pi + \pi} \cdot \sqrt[3]{\pi + \pi}\right)\right) \cdot \sqrt[3]{\pi + \pi}\right)}\right) + 0.5)_*\]

Runtime

Time bar (total: 43.3s)Debug logProfile

herbie shell --seed '#(1064300848 3212030778 2049303162 3567222883 2277747821 1384278011)' +o rules:numerics
(FPCore (u1 u2)
  :name "normal distribution"
  :pre (and (<= 0 u1 1) (<= 0 u2 1))
  (+ (* (* (/ 1 6) (pow (* -2 (log u1)) 0.5)) (cos (* (* 2 PI) u2))) 0.5))