
(FPCore (wj x) :precision binary64 (let* ((t_0 (* wj (exp wj)))) (- wj (/ (- t_0 x) (+ (exp wj) t_0)))))
double code(double wj, double x) {
double t_0 = wj * exp(wj);
return wj - ((t_0 - x) / (exp(wj) + t_0));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
t_0 = wj * exp(wj)
code = wj - ((t_0 - x) / (exp(wj) + t_0))
end function
public static double code(double wj, double x) {
double t_0 = wj * Math.exp(wj);
return wj - ((t_0 - x) / (Math.exp(wj) + t_0));
}
def code(wj, x): t_0 = wj * math.exp(wj) return wj - ((t_0 - x) / (math.exp(wj) + t_0))
function code(wj, x) t_0 = Float64(wj * exp(wj)) return Float64(wj - Float64(Float64(t_0 - x) / Float64(exp(wj) + t_0))) end
function tmp = code(wj, x) t_0 = wj * exp(wj); tmp = wj - ((t_0 - x) / (exp(wj) + t_0)); end
code[wj_, x_] := Block[{t$95$0 = N[(wj * N[Exp[wj], $MachinePrecision]), $MachinePrecision]}, N[(wj - N[(N[(t$95$0 - x), $MachinePrecision] / N[(N[Exp[wj], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj \cdot e^{wj}\\
wj - \frac{t\_0 - x}{e^{wj} + t\_0}
\end{array}
\end{array}
herbie shell --seed 2024257
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:precision binary64
:alt
(! :herbie-platform default (let ((ew (exp wj))) (- wj (- (/ wj (+ wj 1)) (/ x (+ ew (* wj ew)))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))
Please file a bug report with this information.
| first: contract violation expected: (and/c list? (not/c empty?)) given: #f | L | C | |
|---|---|---|---|
| run-egg | /home/nightlies/herbie/eclass-test-rev/src/core/egg-herbie.rkt | 1179 | 0 |
| simplify-batch | /home/nightlies/herbie/eclass-test-rev/src/core/simplify.rkt | 21 | 0 |
| (unnamed) | /usr/local/racket/collects/racket/contract/private/arrow-higher-order.rkt | 379 | 33 |
| lower-approximations | /home/nightlies/herbie/eclass-test-rev/src/core/patch.rkt | 20 | 0 |
| generate-candidates | /home/nightlies/herbie/eclass-test-rev/src/core/patch.rkt | 145 | 0 |
| run-iter! | /home/nightlies/herbie/eclass-test-rev/src/core/mainloop.rkt | 66 | 0 |
| run-improve! | /home/nightlies/herbie/eclass-test-rev/src/core/mainloop.rkt | 43 | 0 |
| get-alternatives/report | /home/nightlies/herbie/eclass-test-rev/src/api/sandbox.rkt | 187 | 0 |
| (unnamed) | /home/nightlies/herbie/eclass-test-rev/src/api/sandbox.rkt | 283 | 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 |