\[\left(\left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right) \land \left(2.328306437 \cdot 10^{-10} \leq uy \land uy \leq 1\right)\right) \land \left(0 \leq maxCos \land maxCos \leq 1\right)\]
\[\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
(FPCore (ux uy maxCos)
 :precision binary64
 (*
  (cos (* (* uy 2.0) PI))
  (sqrt
   (- 1.0 (* (+ (- 1.0 ux) (* ux maxCos)) (+ (- 1.0 ux) (* ux maxCos)))))))
double code(double ux, double uy, double maxCos) {
	return cos(((uy * 2.0) * ((double) M_PI))) * sqrt((1.0 - (((1.0 - ux) + (ux * maxCos)) * ((1.0 - ux) + (ux * maxCos)))));
}
public static double code(double ux, double uy, double maxCos) {
	return Math.cos(((uy * 2.0) * Math.PI)) * Math.sqrt((1.0 - (((1.0 - ux) + (ux * maxCos)) * ((1.0 - ux) + (ux * maxCos)))));
}
def code(ux, uy, maxCos):
	return math.cos(((uy * 2.0) * math.pi)) * math.sqrt((1.0 - (((1.0 - ux) + (ux * maxCos)) * ((1.0 - ux) + (ux * maxCos)))))
function code(ux, uy, maxCos)
	return Float64(cos(Float64(Float64(uy * 2.0) * pi)) * sqrt(Float64(1.0 - Float64(Float64(Float64(1.0 - ux) + Float64(ux * maxCos)) * Float64(Float64(1.0 - ux) + Float64(ux * maxCos))))))
end
function tmp = code(ux, uy, maxCos)
	tmp = cos(((uy * 2.0) * pi)) * sqrt((1.0 - (((1.0 - ux) + (ux * maxCos)) * ((1.0 - ux) + (ux * maxCos)))));
end
code[ux_, uy_, maxCos_] := N[(N[Cos[N[(N[(uy * 2.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 - N[(N[(N[(1.0 - ux), $MachinePrecision] + N[(ux * maxCos), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - ux), $MachinePrecision] + N[(ux * maxCos), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}

Reproduce

Please include this information when filing a bug report:

herbie shell --seed 2023010 
(FPCore (ux uy maxCos)
  :name "UniformSampleCone, x"
  :precision binary64
  :pre (and (and (and (<= 2.328306437e-10 ux) (<= ux 1.0)) (and (<= 2.328306437e-10 uy) (<= uy 1.0))) (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (* (cos (* (* uy 2.0) PI)) (sqrt (- 1.0 (* (+ (- 1.0 ux) (* ux maxCos)) (+ (- 1.0 ux) (* ux maxCos)))))))

Backtrace

map: contract violation expected: list? given: #<eof>LC
gen-map/usr/share/racket/collects/racket/private/map.rkt2572
run-egglog/home/nightlies/herbie/oflatt-egglog-ctx/src/egglog/run-egglog.rkt13320
batch-egg-rewrite/home/nightlies/herbie/oflatt-egglog-ctx/src/core/matcher.rkt710
rewrite-expressions/home/nightlies/herbie/oflatt-egglog-ctx/src/core/matcher.rkt890
gen-rewrites!/home/nightlies/herbie/oflatt-egglog-ctx/src/patch.rkt1670
patch-table-run/home/nightlies/herbie/oflatt-egglog-ctx/src/patch.rkt3180
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt48618
run-iter!/home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt2620
mutate!/home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt3720
run-improve!/home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt3200
(unnamed)/home/nightlies/herbie/oflatt-egglog-ctx/src/sandbox.rkt556
(unnamed)/usr/share/racket/pkgs/profile-lib/main.rkt4010
profile-thunk/usr/share/racket/pkgs/profile-lib/main.rkt90
(unnamed)/usr/share/racket/collects/racket/engine.rkt4224