
(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 2024309
(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.
| rest: contract violation expected: (and/c list? (not/c empty?)) given: '() | L | C | |
|---|---|---|---|
| initial-simplify | /home/nightlies/herbie/aditya-make-egglog-runner/src/core/preprocess.rkt | 60 | 0 |
| find-preprocessing | /home/nightlies/herbie/aditya-make-egglog-runner/src/core/preprocess.rkt | 91 | 0 |
| run-improve! | /home/nightlies/herbie/aditya-make-egglog-runner/src/core/mainloop.rkt | 46 | 0 |
| get-alternatives/report | /home/nightlies/herbie/aditya-make-egglog-runner/src/api/sandbox.rkt | 186 | 0 |
| (unnamed) | /home/nightlies/herbie/aditya-make-egglog-runner/src/api/sandbox.rkt | 282 | 6 |
| (unnamed) | /usr/share/racket/pkgs/profile-lib/main.rkt | 40 | 10 |
| profile-thunk | /usr/share/racket/pkgs/profile-lib/main.rkt | 9 | 0 |
| (unnamed) | /usr/share/racket/collects/racket/engine.rkt | 42 | 24 |