(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)}
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)))))))
| map: contract violation expected: list? given: #<eof> | L | C | |
|---|---|---|---|
| gen-map | /usr/share/racket/collects/racket/private/map.rkt | 257 | 2 |
| run-egglog | /home/nightlies/herbie/oflatt-egglog-ctx/src/egglog/run-egglog.rkt | 1332 | 0 |
| batch-egg-rewrite | /home/nightlies/herbie/oflatt-egglog-ctx/src/core/matcher.rkt | 71 | 0 |
| rewrite-expressions | /home/nightlies/herbie/oflatt-egglog-ctx/src/core/matcher.rkt | 89 | 0 |
| gen-rewrites! | /home/nightlies/herbie/oflatt-egglog-ctx/src/patch.rkt | 167 | 0 |
| patch-table-run | /home/nightlies/herbie/oflatt-egglog-ctx/src/patch.rkt | 318 | 0 |
| (unnamed) | /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt | 486 | 18 |
| run-iter! | /home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt | 262 | 0 |
| mutate! | /home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt | 372 | 0 |
| run-improve! | /home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt | 320 | 0 |
| (unnamed) | /home/nightlies/herbie/oflatt-egglog-ctx/src/sandbox.rkt | 55 | 6 |
| (unnamed) | /usr/share/racket/pkgs/profile-lib/main.rkt | 40 | 10 |
| profile-thunk | /usr/share/racket/pkgs/profile-lib/main.rkt | 9 | 0 |
| (unnamed) | /usr/share/racket/collects/racket/engine.rkt | 42 | 24 |