(FPCore (x) :precision binary64 (+ (/ 1.0 (- x 1.0)) (/ x (+ x 1.0))))
double code(double x) {
return (1.0 / (x - 1.0)) + (x / (x + 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / (x - 1.0d0)) + (x / (x + 1.0d0))
end function
public static double code(double x) {
return (1.0 / (x - 1.0)) + (x / (x + 1.0));
}
def code(x): return (1.0 / (x - 1.0)) + (x / (x + 1.0))
function code(x) return Float64(Float64(1.0 / Float64(x - 1.0)) + Float64(x / Float64(x + 1.0))) end
function tmp = code(x) tmp = (1.0 / (x - 1.0)) + (x / (x + 1.0)); end
code[x_] := N[(N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] + N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{1}{x - 1} + \frac{x}{x + 1}
Please include this information when filing a bug report:
herbie shell --seed 2022204
(FPCore (x)
:name "Asymptote B"
:precision binary64
(+ (/ 1.0 (- x 1.0)) (/ x (+ x 1.0))))
| 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 |