
(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);
}
real(8) function code(a, b, c)
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]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}
herbie shell --seed 2024170
(FPCore (a b c)
:name "Quadratic roots, wide range"
:precision binary64
:pre (and (and (and (< 4.930380657631324e-32 a) (< a 2.028240960365167e+31)) (and (< 4.930380657631324e-32 b) (< b 2.028240960365167e+31))) (and (< 4.930380657631324e-32 c) (< c 2.028240960365167e+31)))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
Please file a bug report with this information.
| timeline-push!: contract violation expected: jsexpr? given: '#hash((#t . 1.636892557144165e-5) (unknown . 0.00011458247900009155) (precondition . 0.9998690485954285) (valid . 0.0)) in: the repeated argument of (-> symbol? jsexpr? ... void?) contract from: <pkgs>/herbie/timeline.rkt blaming: <pkgs>/herbie/searchreals.rkt (assuming the contract is correct) at: <pkgs>/herbie/timeline.rkt:10:3 | L | C | |
|---|---|---|---|
| raise-blame-error | /usr/local/racket/collects/racket/contract/private/blame.rkt | 346 | 0 |
| loop | /usr/local/racket/collects/racket/contract/private/list.rkt | 991 | 12 |
| (unnamed) | .../private/arrow-val-first.rkt | 486 | 18 |
| find-intervals | /home/nightlies/herbie/zane-job-abstraction3/src/searchreals.rkt | 86 | 0 |
| make-sampler | /home/nightlies/herbie/zane-job-abstraction3/src/sampling.rkt | 110 | 0 |
| sample-points | /home/nightlies/herbie/zane-job-abstraction3/src/sampling.rkt | 244 | 0 |
| setup-context! | /home/nightlies/herbie/zane-job-abstraction3/src/mainloop.rkt | 45 | 0 |
| get-alternatives/report | /home/nightlies/herbie/zane-job-abstraction3/src/sandbox.rkt | 166 | 0 |
| (unnamed) | /home/nightlies/herbie/zane-job-abstraction3/src/sandbox.rkt | 260 | 6 |
| (unnamed) | /usr/local/racket/share/pkgs/profile-lib/main.rkt | 40 | 10 |
| profile-thunk | /usr/local/racket/share/pkgs/profile-lib/main.rkt | 9 | 0 |
| (unnamed) | /usr/local/racket/collects/racket/engine.rkt | 42 | 24 |