normal distribution

Specification

?
\[\left(0 \leq u1 \land u1 \leq 1\right) \land \left(0 \leq u2 \land u2 \leq 1\right)\]
\[\begin{array}{l} \\ \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 \end{array} \]
(FPCore (u1 u2)
 :precision binary64
 (+
  (* (* (/ 1.0 6.0) (pow (* -2.0 (log u1)) 0.5)) (cos (* (* 2.0 PI) u2)))
  0.5))
double code(double u1, double u2) {
	return (((1.0 / 6.0) * pow((-2.0 * log(u1)), 0.5)) * cos(((2.0 * ((double) M_PI)) * u2))) + 0.5;
}
public static double code(double u1, double u2) {
	return (((1.0 / 6.0) * Math.pow((-2.0 * Math.log(u1)), 0.5)) * Math.cos(((2.0 * Math.PI) * u2))) + 0.5;
}
def code(u1, u2):
	return (((1.0 / 6.0) * math.pow((-2.0 * math.log(u1)), 0.5)) * math.cos(((2.0 * math.pi) * u2))) + 0.5
function code(u1, u2)
	return Float64(Float64(Float64(Float64(1.0 / 6.0) * (Float64(-2.0 * log(u1)) ^ 0.5)) * cos(Float64(Float64(2.0 * pi) * u2))) + 0.5)
end
function tmp = code(u1, u2)
	tmp = (((1.0 / 6.0) * ((-2.0 * log(u1)) ^ 0.5)) * cos(((2.0 * pi) * u2))) + 0.5;
end
code[u1_, u2_] := N[(N[(N[(N[(1.0 / 6.0), $MachinePrecision] * N[Power[N[(-2.0 * N[Log[u1], $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(2.0 * Pi), $MachinePrecision] * u2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]
\begin{array}{l}

\\
\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
\end{array}

Reproduce

?
herbie shell --seed 2024111 
(FPCore (u1 u2)
  :name "normal distribution"
  :precision binary64
  :pre (and (and (<= 0.0 u1) (<= u1 1.0)) (and (<= 0.0 u2) (<= u2 1.0)))
  (+ (* (* (/ 1.0 6.0) (pow (* -2.0 (log u1)) 0.5)) (cos (* (* 2.0 PI) u2))) 0.5))

Please file a bug report with this information.

Backtrace

regraph-analyze: analysis not run on all eclasses: #<procedure:eclass-set-cost!> #((0 #(1) (1 . 1)) (1 #((+ 1 2) (+ 2 1) (+ 3 4) (+ 4 3) (- 1 2) (- 2 5) (- 3 6) (- 4 7) (* 5 8) (* 8 5) (neg 5)) #f) (2 #(0) (1 . 0)) (3 #(-1/2) (1 . -1/2)) (4 #((+ 2 4) (+ 4 2) (- 2 6) (- 4 2) (* 23 61) (* 19 63) (* 34 39) (* 44 37) (* 6 8) (* 8 6) (* 62 41) (* 41 62) (* 37 44) (* 63 19) (* 61 23) (* 40 33) (* 33 40) (* 39 34) (neg 6)) #f) (5 #((+ 7 6) (+ 6 7) (+ 5 2) (+ 2 5) (- 6 3) (- 5 2)) #f) (6 #((+ 6 2) (+ 2 6) (- 6 2) (* 23 62) (* 19 44) (* 34 40) (* 44 19) (* 62 23) (* 40 34)) #f) (7 #(1/2) (1 . 1/2)) (8 #(-1) (1 . -1)) (9 #((+ 9 2) (+ 2 9) (- 9 2) (- 2 10) (* 10 8) (* 8 10) (neg 10)) (2 neg 10)) (10 #((+ 10 2) (+ 2 10) (- 10 2) $h0) (1 . $h0)) (11 #((+ 2 11) (+ 11 2) (- 11 2) (* 12 13) (* 13 12)) #f) (12 #((+ 12 2) (+ 2 12) (- 12 2) (PI)) #f) (13 #((+ 13 2) (+ 2 13) (- 13 2) $h1) (1 . $h1)) (14 #((* 15 16) (* 16 15)) (4 * 15 16)) (15 #(-2) (1 . -2)) (16 #((log 10)) (2 log 10)) (17 #((+ 2 17) (+ 17 2) (- 17 2) (* 18 19) (* 19 18)) #f) (18 #((+ 18 2) (+ 2 18) (- 18 2) (pow 14 7) (sqrt 14)) (5 sqrt 14)) (19 #((+ 19 2) (+ 2 19) (- 19 2) (cos 35) (cos 36)) #f) (20 #((cos 21)) #f) (21 #((+ 21 2) (+ 2 21) (* 10 49) (* 25 50) (* 12 38) (* 49 10) (* 50 25) (* 38 12)) #f) (22 #((+ 22 2) (+ 2 22) (- 22 2) (- 2 13) (* 13 8) (* 8 13) (neg 13)) (2 neg 13)) (23 #(1/6) (1 . 1/6)) (24 #((+ 2 24) (+ 24 2) (- 24 2) (* 25 13) (* 13 25)) (3 * 25 13)) (25 #(2) (1 . 2)) (26 #((log 13)) (2 log 13)) (27 #((* 15 28) (* 28 15)) (5 * 15 28)) (28 #((log 9)) (3 log 9)) (29 #((+ 2 29) (+ 29 2) (- 2 18) (- 29 2) (* 18 8) (* 8 18) (neg 18)) (6 neg 18)) (30 #((* 23 20) (* 20 23)) #f) (31 #((+ 7 32) (+ 32 7)) #f) (32 #((* 23 45) (* 42 30) (* 56 20) (* 20 56) (* 45 23) (* 30 42)) #f) (33 #((+ 2 33) (+ 33 2) (- 2 34) (- 33 2) (* 34 8) (* 8 34) (neg 34)) (7 neg 34)) (34 #((+ 34 2) (+ 2 34) (- 34 2) (pow 27 7) (sqrt 27)) (6 sqrt 27)) (35 #((+ 35 2) (+ 2 35) (- 35 2) (* 25 11) (* 12 24) (* 49 13) (* 13 49) (* 11 25) (* 24 12)) #f) (36 #((+ 36 2) (+ 2 36) (- 36 2) (- 2 35) (* 15 11) (* 25 57) (* 12 58) (* 49 22) (* 13 59) (* 35 8) (* 22 49) (* 8 35) (* 57 25) (* 11 15) (* 59 13) (* 58 12) (* 24 60) (* 60 24) (neg 35)) #f) (37 #((+ 2 37) (+ 37 2) (- 2 19) (- 37 2) (* 19 8) (* 8 19) (neg 19)) #f) (38 #((+ 2 38) (+ 38 2) (* 10 25) (* 25 10)) (3 * 10 25)) (39 #((+ 2 39) (+ 39 2) (- 2 40) (- 39 2) (* 23 37) (* 19 41) (* 8 40) (* 41 19) (* 37 23) (* 40 8) (neg 40)) #f) (40 #((+ 2 40) (+ 40 2) (- 40 2) (* 23 19) (* 19 23)) #f) (41 #(-1/6) (1 . -1/6)) (42 #((pow 43 7) (sqrt 43)) (5 sqrt 43)) (43 #((* 15 26) (* 26 15)) (4 * 15 26)) (44 #((+ 44 2) (+ 2 44) (- 44 2) (* 23 34) (* 34 23)) (8 * 23 34)) (45 #((* 42 20) (* 20 42)) #f) (46 #((+ 7 47) (+ 47 7) (+ 46 2) (+ 2 46) (- 47 3) (- 46 2)) #f) (47 #((+ 47 2) (+ 2 47) (- 47 2) (* 23 17) (* 18 40) (* 53 19) (* 19 53) (* 17 23) (* 40 18)) #f) (48 #((+ 2 48) (+ 48 2) (- 2 17) (- 48 2) (* 18 37) (* 19 29) (* 8 17) (* 17 8) (* 37 18) (* 29 19) (neg 17)) #f) (49 #((+ 49 2) (+ 2 49) (- 49 2) (* 25 12) (* 12 25)) #f) (50 #((+ 2 50) (+ 50 2) (* 10 12) (* 12 10)) #f) (51 #(6) (1 . 6)) (52 #((+ 2 52) (+ 52 2) (- 2 47) (- 52 2) (* 23 48) (* 18 39) (* 53 37) (* 19 54) (* 47 8) (* 8 47) (* 17 41) (* 41 17) (* 37 53) (* 48 23) (* 40 29) (* 29 40) (* 39 18) (* 54 19) (neg 47)) #f) (53 #((+ 53 2) (+ 2 53) (- 53 2) (* 23 18) (* 18 23)) (7 * 23 18)) (54 #((+ 2 54) (+ 54 2) (- 2 53) (- 54 2) (* 23 29) (* 18 41) (* 53 8) (* 8 53) (* 41 18) (* 29 23) (neg 53)) (7 * 18 41)) (55 #((+ 55 2) (+ 2 55) (+ 52 3) (+ 3 52) (- 55 2) (- 2 46) (- 52 7) (- 3 47) (* 46 8) (* 8 46) (neg 46)) #f) (56 #((* 23 42) (* 42 23)) (7 * 23 42)) (57 #((+ 2 57) (+ 57 2) (- 2 11) (- 57 2) (* 12 22) (* 13 60) (* 22 12) (* 8 11) (* 11 8) (* 60 13) (neg 11)) #f) (58 #((+ 2 58) (+ 58 2) (- 2 24) (- 58 2) (* 15 13) (* 25 22) (* 13 15) (* 22 25) (* 8 24) (* 24 8) (neg 24)) (3 * 15 13)) (59 #((+ 2 59) (+ 59 2) (- 2 49) (- 59 2) (* 15 12) (* 25 60) (* 12 15) (* 49 8) (* 8 49) (* 60 25) (neg 49)) #f) (60 #((+ 2 60) (+ 60 2) (- 2 12) (- 60 2) (* 12 8) (* 8 12) (neg 12)) #f) (61 #((+ 2 61) (+ 61 2) (- 2 62) (- 61 2) (* 19 33) (* 34 37) (* 8 62) (* 62 8) (* 37 34) (* 33 19) (neg 62)) #f) (62 #((+ 2 62) (+ 62 2) (- 62 2) (* 19 34) (* 34 19)) #f) (63 #((+ 2 63) (+ 63 2) (- 2 44) (- 63 2) (* 23 33) (* 34 41) (* 44 8) (* 8 44) (* 41 34) (* 33 23) (neg 44)) (8 * 34 41)))LC
(unnamed)/home/nightlies/herbie/spec-rewriting/src/core/egg-herbie.rkt6460
run-egg/home/nightlies/herbie/spec-rewriting/src/core/egg-herbie.rkt14260
simplify-batch/home/nightlies/herbie/spec-rewriting/src/core/simplify.rkt150
(unnamed)/usr/local/racket/collects/racket/contract/private/arrow-higher-order.rkt37933
find-preprocessing/home/nightlies/herbie/spec-rewriting/src/preprocess.rkt600
run-improve!/home/nightlies/herbie/spec-rewriting/src/mainloop.rkt490
get-alternatives/report/home/nightlies/herbie/spec-rewriting/src/sandbox.rkt1710
(unnamed)/home/nightlies/herbie/spec-rewriting/src/sandbox.rkt2726
(unnamed)/usr/local/racket/share/pkgs/profile-lib/main.rkt4010
profile-thunk/usr/local/racket/share/pkgs/profile-lib/main.rkt90
(unnamed)/usr/local/racket/collects/racket/engine.rkt4224