(FPCore (x) :precision binary64 (/ (- (exp x) 1.0) x))
double code(double x) {
return (exp(x) - 1.0) / x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (exp(x) - 1.0d0) / x
end function
public static double code(double x) {
return (Math.exp(x) - 1.0) / x;
}
def code(x): return (math.exp(x) - 1.0) / x
function code(x) return Float64(Float64(exp(x) - 1.0) / x) end
function tmp = code(x) tmp = (exp(x) - 1.0) / x; end
code[x_] := N[(N[(N[Exp[x], $MachinePrecision] - 1.0), $MachinePrecision] / x), $MachinePrecision]
\frac{e^{x} - 1}{x}
Please include this information when filing a bug report:
herbie shell --seed 2022204
(FPCore (x)
:name "Kahan's exp quotient"
:precision binary64
:herbie-target
(if (and (< x 1.0) (> x -1.0)) (/ (- (exp x) 1.0) (log (exp x))) (/ (- (exp x) 1.0) x))
(/ (- (exp x) 1.0) x))
| nan?: contract violation expected: real? given: 0.5000000000000001+0.8660254037844386i | L | C | |
|---|---|---|---|
| simplify-node* | /data/pavpan/nightlies/herbie/fix-inf-exact/src/core/reduce.rkt | 61 | 0 |
| hash-ref! | /usr/share/racket/collects/racket/private/more-scheme.rkt | 377 | 2 |
| hash-ref! | /usr/share/racket/collects/racket/private/more-scheme.rkt | 377 | 2 |
| approximate | /data/pavpan/nightlies/herbie/fix-inf-exact/src/core/taylor.rkt | 7 | 0 |
| taylor-expr | /data/pavpan/nightlies/herbie/fix-inf-exact/src/patch.rkt | 78 | 0 |
| taylor-alt | /data/pavpan/nightlies/herbie/fix-inf-exact/src/patch.rkt | 85 | 0 |
| gen-series! | /data/pavpan/nightlies/herbie/fix-inf-exact/src/patch.rkt | 101 | 0 |
| patch-table-run | /data/pavpan/nightlies/herbie/fix-inf-exact/src/patch.rkt | 310 | 0 |
| (unnamed) | /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt | 486 | 18 |
| run-iter! | /data/pavpan/nightlies/herbie/fix-inf-exact/src/mainloop.rkt | 242 | 0 |
| mutate! | /data/pavpan/nightlies/herbie/fix-inf-exact/src/mainloop.rkt | 348 | 0 |
| run-improve! | /data/pavpan/nightlies/herbie/fix-inf-exact/src/mainloop.rkt | 296 | 0 |
| (unnamed) | /data/pavpan/nightlies/herbie/fix-inf-exact/src/sandbox.rkt | 55 | 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 |