Average Error: 0.4 → 0.4
Time: 44.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{1}{6} \cdot {\left(-2 \cdot \log u1\right)}^{0.5}\right) \cdot \cos \left(\left(\sqrt[3]{\left(2 \cdot \pi\right) \cdot u2} \cdot \sqrt[3]{\left(2 \cdot \pi\right) \cdot u2}\right) \cdot \sqrt[3]{\left(2 \cdot \pi\right) \cdot u2}\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. Using strategy rm
  3. Applied add-cube-cbrt0.4

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

Runtime

Time bar (total: 44.3s)Debug log

herbie shell --seed '#(2151728608 3767143998 4065594768 704903143 4284770345 1704475780)' 
(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))