\[0.0 \lt x \lt 1 \land y \lt 1\]
\[\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\]
\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}
double code(double x, double y) {
	return ((double) (((double) (((double) (x - y)) * ((double) (x + y)))) / ((double) (((double) (x * x)) + ((double) (y * y))))));
}

Reproduce

Please include this information when filing a bug report:

herbie shell --seed 2020128 
(FPCore (x y)
  :name "Kahan p9 Example"
  :precision binary64
  :pre (and (< 0.0 x 1.0) (< y 1.0))

  :herbie-target
  (if (< 0.5 (fabs (/ x y)) 2.0) (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) (- 1.0 (/ 2.0 (+ 1.0 (* (/ x y) (/ x y))))))

  (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))

Backtrace

random-bits: contract violation expected: Positive-Integer given: 0LC
random-ranges/data/pavpan/nightlies/herbie/separate-biginterval/src/common.rkt1390
sample-multi-bounded/data/pavpan/nightlies/herbie/separate-biginterval/src/points.rkt140
(unnamed)/data/pavpan/nightlies/herbie/separate-biginterval/src/points.rkt1276
prepare-points-intervals/data/pavpan/nightlies/herbie/separate-biginterval/src/points.rkt1340
pred/data/pavpan/nightlies/herbie/separate-biginterval/src/core/regimes.rkt2004
for-loop/data/pavpan/nightlies/herbie/separate-biginterval/src/core/regimes.rkt2309
sindices->spoints/data/pavpan/nightlies/herbie/separate-biginterval/src/core/regimes.rkt1900
f37unknown
get-final-combination/data/pavpan/nightlies/herbie/separate-biginterval/src/mainloop.rkt3900
.../more-scheme.rkt:261:28unknown
run/opt/racket-7.5/share/pkgs/profile-lib/main.rkt392
profile-thunk16/opt/racket-7.5/share/pkgs/profile-lib/main.rkt90
(unnamed)/opt/racket-7.5/collects/racket/private/more-scheme.rkt26128

Reproduce

herbie shell --seed 2020128 
(FPCore (x y)
  :name "Kahan p9 Example"
  :precision binary64
  :pre (and (< 0.0 x 1.0) (< y 1.0))

  :herbie-target
  (if (< 0.5 (fabs (/ x y)) 2.0) (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) (- 1.0 (/ 2.0 (+ 1.0 (* (/ x y) (/ x y))))))

  (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))