\[\left(0 < cosTheta \land cosTheta < 0.9999\right) \land \left(-1 < c \land c < 1\right)\]
\[\frac{1}{\left(1 + c\right) + \left(\frac{1}{\sqrt{\pi}} \cdot \frac{\sqrt{\left(1 - cosTheta\right) - cosTheta}}{cosTheta}\right) \cdot e^{\left(-cosTheta\right) \cdot cosTheta}} \]
(FPCore (cosTheta c)
 :precision binary64
 (/
  1.0
  (+
   (+ 1.0 c)
   (*
    (* (/ 1.0 (sqrt PI)) (/ (sqrt (- (- 1.0 cosTheta) cosTheta)) cosTheta))
    (exp (* (- cosTheta) cosTheta))))))
double code(double cosTheta, double c) {
	return 1.0 / ((1.0 + c) + (((1.0 / sqrt(((double) M_PI))) * (sqrt(((1.0 - cosTheta) - cosTheta)) / cosTheta)) * exp((-cosTheta * cosTheta))));
}
public static double code(double cosTheta, double c) {
	return 1.0 / ((1.0 + c) + (((1.0 / Math.sqrt(Math.PI)) * (Math.sqrt(((1.0 - cosTheta) - cosTheta)) / cosTheta)) * Math.exp((-cosTheta * cosTheta))));
}
def code(cosTheta, c):
	return 1.0 / ((1.0 + c) + (((1.0 / math.sqrt(math.pi)) * (math.sqrt(((1.0 - cosTheta) - cosTheta)) / cosTheta)) * math.exp((-cosTheta * cosTheta))))
function code(cosTheta, c)
	return Float64(1.0 / Float64(Float64(1.0 + c) + Float64(Float64(Float64(1.0 / sqrt(pi)) * Float64(sqrt(Float64(Float64(1.0 - cosTheta) - cosTheta)) / cosTheta)) * exp(Float64(Float64(-cosTheta) * cosTheta)))))
end
function tmp = code(cosTheta, c)
	tmp = 1.0 / ((1.0 + c) + (((1.0 / sqrt(pi)) * (sqrt(((1.0 - cosTheta) - cosTheta)) / cosTheta)) * exp((-cosTheta * cosTheta))));
end
code[cosTheta_, c_] := N[(1.0 / N[(N[(1.0 + c), $MachinePrecision] + N[(N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[(1.0 - cosTheta), $MachinePrecision] - cosTheta), $MachinePrecision]], $MachinePrecision] / cosTheta), $MachinePrecision]), $MachinePrecision] * N[Exp[N[((-cosTheta) * cosTheta), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{1}{\left(1 + c\right) + \left(\frac{1}{\sqrt{\pi}} \cdot \frac{\sqrt{\left(1 - cosTheta\right) - cosTheta}}{cosTheta}\right) \cdot e^{\left(-cosTheta\right) \cdot cosTheta}}

Reproduce

Please include this information when filing a bug report:

herbie shell --seed 2022349 
(FPCore (cosTheta c)
  :name "Beckmann Sample, normalization factor"
  :precision binary64
  :pre (and (and (< 0.0 cosTheta) (< cosTheta 0.9999)) (and (< -1.0 c) (< c 1.0)))
  (/ 1.0 (+ (+ 1.0 c) (* (* (/ 1.0 (sqrt PI)) (/ (sqrt (- (- 1.0 cosTheta) cosTheta)) cosTheta)) (exp (* (- cosTheta) cosTheta))))))

Backtrace

error writing to stream port system error: Broken pipe; errno=32LC
writeln/usr/share/racket/collects/racket/private/misc.rkt1564
run-egglog/home/nightlies/nightlies/herbie/oflatt-egglog-ctx/src/egglog/run-egglog.rkt13010
run-simplify-input/home/nightlies/nightlies/herbie/oflatt-egglog-ctx/src/core/simplify.rkt740
simplify-batch/home/nightlies/nightlies/herbie/oflatt-egglog-ctx/src/core/simplify.rkt510
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt37933
get-swaps/home/nightlies/nightlies/herbie/oflatt-egglog-ctx/src/symmetry.rkt60
connected-components/home/nightlies/nightlies/herbie/oflatt-egglog-ctx/src/symmetry.rkt200
run-improve!/home/nightlies/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt3200
(unnamed)/home/nightlies/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