FastMath dist4

Specification

?
\[\begin{array}{l} \\ \left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1 \end{array} \]
(FPCore (d1 d2 d3 d4)
 :precision binary64
 (- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))
double code(double d1, double d2, double d3, double d4) {
	return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
real(8) function code(d1, d2, d3, d4)
    real(8), intent (in) :: d1
    real(8), intent (in) :: d2
    real(8), intent (in) :: d3
    real(8), intent (in) :: d4
    code = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
end function
public static double code(double d1, double d2, double d3, double d4) {
	return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
def code(d1, d2, d3, d4):
	return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
function code(d1, d2, d3, d4)
	return Float64(Float64(Float64(Float64(d1 * d2) - Float64(d1 * d3)) + Float64(d4 * d1)) - Float64(d1 * d1))
end
function tmp = code(d1, d2, d3, d4)
	tmp = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
end
code[d1_, d2_, d3_, d4_] := N[(N[(N[(N[(d1 * d2), $MachinePrecision] - N[(d1 * d3), $MachinePrecision]), $MachinePrecision] + N[(d4 * d1), $MachinePrecision]), $MachinePrecision] - N[(d1 * d1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
\end{array}

Reproduce

?
herbie shell --seed 2024196 
(FPCore (d1 d2 d3 d4)
  :name "FastMath dist4"
  :precision binary64

  :alt
  (! :herbie-platform default (* d1 (- (+ (- d2 d3) d4) d1)))

  (- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))

Please file a bug report with this information.

Backtrace

vector-set!: contract violation expected: exact-nonnegative-integer? given: -1 argument position: 2nd first argument...: '#(#f #t #f #f #f #f #t #f #f #f #f #f #f #f #f #f #f #f #f #f)LC
backward-pass/home/nightlies/rival/main/eval/adjust.rkt80
rival-machine-adjust/home/nightlies/rival/main/eval/run.rkt980
rival-machine-full/home/nightlies/rival/main/eval/main.rkt160
rival-apply/home/nightlies/rival/main/eval/main.rkt560
(unnamed)/usr/local/racket/collects/racket/contract/private/arrow-val-first.rkt48618
(unnamed)/home/nightlies/herbie/zane-odyssey-timeline/src/sampling.rkt1594
ival-eval/home/nightlies/herbie/zane-odyssey-timeline/src/sampling.rkt1530
<eval-prog-real>/home/nightlies/herbie/zane-odyssey-timeline/src/sampling.rkt1882
compute-local-errors/home/nightlies/herbie/zane-odyssey-timeline/src/core/localize.rkt1050
batch-localize-errors/home/nightlies/herbie/zane-odyssey-timeline/src/core/localize.rkt910
localize!/home/nightlies/herbie/zane-odyssey-timeline/src/mainloop.rkt1870
run-iter!/home/nightlies/herbie/zane-odyssey-timeline/src/mainloop.rkt700
mutate!/home/nightlies/herbie/zane-odyssey-timeline/src/mainloop.rkt620
run-improve!/home/nightlies/herbie/zane-odyssey-timeline/src/mainloop.rkt480
get-alternatives/report/home/nightlies/herbie/zane-odyssey-timeline/src/sandbox.rkt1670
(unnamed)/home/nightlies/herbie/zane-odyssey-timeline/src/sandbox.rkt2616
(unnamed)/usr/local/racket/share/pkgs/profile-lib/main.rkt4010
profile-thunk/usr/local/racket/share/pkgs/profile-lib/main.rkt90
(unnamed)/usr/local/racket/collects/racket/engine.rkt4224