
(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
double code(double a, double b) {
return exp(a) / (exp(a) + exp(b));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp(a) / (exp(a) + exp(b))
end function
public static double code(double a, double b) {
return Math.exp(a) / (Math.exp(a) + Math.exp(b));
}
def code(a, b): return math.exp(a) / (math.exp(a) + math.exp(b))
function code(a, b) return Float64(exp(a) / Float64(exp(a) + exp(b))) end
function tmp = code(a, b) tmp = exp(a) / (exp(a) + exp(b)); end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{a}}{e^{a} + e^{b}}
\end{array}
herbie shell --seed 2024170
(FPCore (a b)
:name "Quotient of sum of exps"
:precision binary64
:alt
(! :herbie-platform default (/ 1 (+ 1 (exp (- b a)))))
(/ (exp a) (+ (exp a) (exp b))))
Please file a bug report with this information.
| timeline-push!: contract violation expected: jsexpr? given: '#hash((#t . 0.12487795948982239) (unknown . 0.7804872468113899) (precondition . 0.0009763240814208984) (valid . 0.09365846961736679)) 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 |