Quadratic roots, medium range

Specification

?
\[\left(\left(1.1102230246251565 \cdot 10^{-16} < a \land a < 9007199254740992\right) \land \left(1.1102230246251565 \cdot 10^{-16} < b \land b < 9007199254740992\right)\right) \land \left(1.1102230246251565 \cdot 10^{-16} < c \land c < 9007199254740992\right)\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
(FPCore (a b c)
  :precision binary64
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}

Reproduce

?
herbie shell --seed 2025255 
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :precision binary64
  :pre (and (and (and (< 1.1102230246251565e-16 a) (< a 9007199254740992.0)) (and (< 1.1102230246251565e-16 b) (< b 9007199254740992.0))) (and (< 1.1102230246251565e-16 c) (< c 9007199254740992.0)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))

Please file a bug report with this information.

Backtrace

gather-multiplicative-terms: broke its own contract promised: number? produced: (cons 1 (batchref #<batch> 75)) in: the car of an element of the cdr of the range of (-> batchref? procedure? (cons/c number? (listof (cons/c number? batchref?)))) contract from: (function gather-multiplicative-terms) blaming: (function gather-multiplicative-terms) (assuming the contract is correct) at: <pkgs>/herbie/core/batch-reduce.rkt:192:20LC
raise-blame-error/usr/share/racket/collects/racket/contract/private/blame.rkt3460
(unnamed)/usr/share/racket/collects/racket/contract/private/list.rkt3764
(unnamed)/usr/share/racket/collects/racket/contract/private/list.rkt21514
(unnamed)/usr/share/racket/collects/racket/contract/private/list.rkt3764
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt37533
loop/home/nightlies/herbie/batch-full-taylor/src/core/batch.rkt1264
reduce-node/home/nightlies/herbie/batch-full-taylor/src/core/batch-reduce.rkt1452
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt37533
loop/home/nightlies/herbie/batch-full-taylor/src/core/batch.rkt1264
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt37533
loop/home/nightlies/herbie/batch-full-taylor/src/core/batch.rkt1264
taylor-quotient/home/nightlies/herbie/batch-full-taylor/src/core/taylor.rkt3350
loop/home/nightlies/herbie/batch-full-taylor/src/core/batch.rkt1264
taylor-coefficients/home/nightlies/herbie/batch-full-taylor/src/core/taylor.rkt300
taylor-alts/home/nightlies/herbie/batch-full-taylor/src/core/patch.rkt330
run-taylor/home/nightlies/herbie/batch-full-taylor/src/core/patch.rkt750
generate-candidates/home/nightlies/herbie/batch-full-taylor/src/core/patch.rkt1960
run-iteration!/home/nightlies/herbie/batch-full-taylor/src/core/mainloop.rkt2370
run-improve!/home/nightlies/herbie/batch-full-taylor/src/core/mainloop.rkt440
get-alternatives/home/nightlies/herbie/batch-full-taylor/src/api/sandbox.rkt610
(unnamed)/home/nightlies/herbie/batch-full-taylor/src/api/sandbox.rkt1816
(unnamed)/usr/share/racket/pkgs/profile-lib/main.rkt4010
profile-thunk/usr/share/racket/pkgs/profile-lib/main.rkt90
in-engine/home/nightlies/herbie/batch-full-taylor/src/api/sandbox.rkt1972
(unnamed)/usr/share/racket/collects/racket/engine.rkt4224