(FPCore (xi yi zi ux uy maxCos)
:precision binary64
(+
(+
(*
(*
(cos (* (* uy 2.0) PI))
(sqrt
(- 1.0 (* (* (* (- 1.0 ux) maxCos) ux) (* (* (- 1.0 ux) maxCos) ux)))))
xi)
(*
(*
(sin (* (* uy 2.0) PI))
(sqrt
(- 1.0 (* (* (* (- 1.0 ux) maxCos) ux) (* (* (- 1.0 ux) maxCos) ux)))))
yi))
(* (* (* (- 1.0 ux) maxCos) ux) zi)))double code(double xi, double yi, double zi, double ux, double uy, double maxCos) {
return (((cos(((uy * 2.0) * ((double) M_PI))) * sqrt((1.0 - ((((1.0 - ux) * maxCos) * ux) * (((1.0 - ux) * maxCos) * ux))))) * xi) + ((sin(((uy * 2.0) * ((double) M_PI))) * sqrt((1.0 - ((((1.0 - ux) * maxCos) * ux) * (((1.0 - ux) * maxCos) * ux))))) * yi)) + ((((1.0 - ux) * maxCos) * ux) * zi);
}
public static double code(double xi, double yi, double zi, double ux, double uy, double maxCos) {
return (((Math.cos(((uy * 2.0) * Math.PI)) * Math.sqrt((1.0 - ((((1.0 - ux) * maxCos) * ux) * (((1.0 - ux) * maxCos) * ux))))) * xi) + ((Math.sin(((uy * 2.0) * Math.PI)) * Math.sqrt((1.0 - ((((1.0 - ux) * maxCos) * ux) * (((1.0 - ux) * maxCos) * ux))))) * yi)) + ((((1.0 - ux) * maxCos) * ux) * zi);
}
def code(xi, yi, zi, ux, uy, maxCos): return (((math.cos(((uy * 2.0) * math.pi)) * math.sqrt((1.0 - ((((1.0 - ux) * maxCos) * ux) * (((1.0 - ux) * maxCos) * ux))))) * xi) + ((math.sin(((uy * 2.0) * math.pi)) * math.sqrt((1.0 - ((((1.0 - ux) * maxCos) * ux) * (((1.0 - ux) * maxCos) * ux))))) * yi)) + ((((1.0 - ux) * maxCos) * ux) * zi)
function code(xi, yi, zi, ux, uy, maxCos) return Float64(Float64(Float64(Float64(cos(Float64(Float64(uy * 2.0) * pi)) * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(1.0 - ux) * maxCos) * ux) * Float64(Float64(Float64(1.0 - ux) * maxCos) * ux))))) * xi) + Float64(Float64(sin(Float64(Float64(uy * 2.0) * pi)) * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(1.0 - ux) * maxCos) * ux) * Float64(Float64(Float64(1.0 - ux) * maxCos) * ux))))) * yi)) + Float64(Float64(Float64(Float64(1.0 - ux) * maxCos) * ux) * zi)) end
function tmp = code(xi, yi, zi, ux, uy, maxCos) tmp = (((cos(((uy * 2.0) * pi)) * sqrt((1.0 - ((((1.0 - ux) * maxCos) * ux) * (((1.0 - ux) * maxCos) * ux))))) * xi) + ((sin(((uy * 2.0) * pi)) * sqrt((1.0 - ((((1.0 - ux) * maxCos) * ux) * (((1.0 - ux) * maxCos) * ux))))) * yi)) + ((((1.0 - ux) * maxCos) * ux) * zi); end
code[xi_, yi_, zi_, ux_, uy_, maxCos_] := N[(N[(N[(N[(N[Cos[N[(N[(uy * 2.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 - N[(N[(N[(N[(1.0 - ux), $MachinePrecision] * maxCos), $MachinePrecision] * ux), $MachinePrecision] * N[(N[(N[(1.0 - ux), $MachinePrecision] * maxCos), $MachinePrecision] * ux), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * xi), $MachinePrecision] + N[(N[(N[Sin[N[(N[(uy * 2.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 - N[(N[(N[(N[(1.0 - ux), $MachinePrecision] * maxCos), $MachinePrecision] * ux), $MachinePrecision] * N[(N[(N[(1.0 - ux), $MachinePrecision] * maxCos), $MachinePrecision] * ux), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * yi), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(1.0 - ux), $MachinePrecision] * maxCos), $MachinePrecision] * ux), $MachinePrecision] * zi), $MachinePrecision]), $MachinePrecision]
\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
Please include this information when filing a bug report:
herbie shell --seed 2023010
(FPCore (xi yi zi ux uy maxCos)
:name "UniformSampleCone 2"
:precision binary64
:pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0)) (and (<= -10000.0 yi) (<= yi 10000.0))) (and (<= -10000.0 zi) (<= zi 10000.0))) (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) maxCos) ux) (* (* (- 1.0 ux) maxCos) ux))))) xi) (* (* (sin (* (* uy 2.0) PI)) (sqrt (- 1.0 (* (* (* (- 1.0 ux) maxCos) ux) (* (* (- 1.0 ux) maxCos) ux))))) yi)) (* (* (* (- 1.0 ux) maxCos) ux) zi)))
| 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 |