
(FPCore (x) :precision binary64 (let* ((t_0 (exp (- x)))) (/ (- (exp x) t_0) (+ (exp x) t_0))))
double code(double x) {
double t_0 = exp(-x);
return (exp(x) - t_0) / (exp(x) + t_0);
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = exp(-x)
code = (exp(x) - t_0) / (exp(x) + t_0)
end function
public static double code(double x) {
double t_0 = Math.exp(-x);
return (Math.exp(x) - t_0) / (Math.exp(x) + t_0);
}
def code(x): t_0 = math.exp(-x) return (math.exp(x) - t_0) / (math.exp(x) + t_0)
function code(x) t_0 = exp(Float64(-x)) return Float64(Float64(exp(x) - t_0) / Float64(exp(x) + t_0)) end
function tmp = code(x) t_0 = exp(-x); tmp = (exp(x) - t_0) / (exp(x) + t_0); end
code[x_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, N[(N[(N[Exp[x], $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[Exp[x], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-x}\\
\frac{e^{x} - t\_0}{e^{x} + t\_0}
\end{array}
\end{array}
herbie shell --seed 2024278
(FPCore (x)
:name "Hyperbolic tangent"
:precision binary64
(/ (- (exp x) (exp (- x))) (+ (exp x) (exp (- x)))))
Please file a bug report with this information.
| Invalid input | L | C | |
|---|---|---|---|
| rival-apply | /home/nightlies/.local/share/racket/8.10/pkgs/rival/eval/main.rkt | 65 | 0 |
| (unnamed) | /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt | 486 | 18 |
| f169 | .../match/compiler.rkt | 559 | 40 |
| compute-local-errors | /home/nightlies/herbie/zane-concrete-values/src/core/localize.rkt | 132 | 0 |
| actual-errors | /home/nightlies/herbie/zane-concrete-values/src/core/explain.rkt | 35 | 0 |
| generate-timelines | /home/nightlies/herbie/zane-concrete-values/src/core/explain.rkt | 498 | 0 |
| explain! | /home/nightlies/herbie/zane-concrete-values/src/core/mainloop.rkt | 323 | 0 |
| run-improve! | /home/nightlies/herbie/zane-concrete-values/src/core/mainloop.rkt | 45 | 0 |
| get-alternatives/report | /home/nightlies/herbie/zane-concrete-values/src/api/sandbox.rkt | 186 | 0 |
| (unnamed) | /home/nightlies/herbie/zane-concrete-values/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 |