Kahan's Monster

Specification

?
\[1 \leq y \land y \leq 9999\]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{y \cdot y + 1}\\ t_1 := \left|y - t\_0\right| - \frac{1}{y + t\_0}\\ t_2 := t\_1 \cdot t\_1\\ \mathbf{if}\;t\_2 = 0:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{t\_2} - 1}{t\_2}\\ \end{array} \end{array} \]
(FPCore (y)
 :precision binary64
 (let* ((t_0 (sqrt (+ (* y y) 1.0)))
        (t_1 (- (fabs (- y t_0)) (/ 1.0 (+ y t_0))))
        (t_2 (* t_1 t_1)))
   (if (== t_2 0.0) 1.0 (/ (- (exp t_2) 1.0) t_2))))
double code(double y) {
	double t_0 = sqrt(((y * y) + 1.0));
	double t_1 = fabs((y - t_0)) - (1.0 / (y + t_0));
	double t_2 = t_1 * t_1;
	double tmp;
	if (t_2 == 0.0) {
		tmp = 1.0;
	} else {
		tmp = (exp(t_2) - 1.0) / t_2;
	}
	return tmp;
}
real(8) function code(y)
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = sqrt(((y * y) + 1.0d0))
    t_1 = abs((y - t_0)) - (1.0d0 / (y + t_0))
    t_2 = t_1 * t_1
    if (t_2 == 0.0d0) then
        tmp = 1.0d0
    else
        tmp = (exp(t_2) - 1.0d0) / t_2
    end if
    code = tmp
end function
public static double code(double y) {
	double t_0 = Math.sqrt(((y * y) + 1.0));
	double t_1 = Math.abs((y - t_0)) - (1.0 / (y + t_0));
	double t_2 = t_1 * t_1;
	double tmp;
	if (t_2 == 0.0) {
		tmp = 1.0;
	} else {
		tmp = (Math.exp(t_2) - 1.0) / t_2;
	}
	return tmp;
}
def code(y):
	t_0 = math.sqrt(((y * y) + 1.0))
	t_1 = math.fabs((y - t_0)) - (1.0 / (y + t_0))
	t_2 = t_1 * t_1
	tmp = 0
	if t_2 == 0.0:
		tmp = 1.0
	else:
		tmp = (math.exp(t_2) - 1.0) / t_2
	return tmp
function code(y)
	t_0 = sqrt(Float64(Float64(y * y) + 1.0))
	t_1 = Float64(abs(Float64(y - t_0)) - Float64(1.0 / Float64(y + t_0)))
	t_2 = Float64(t_1 * t_1)
	tmp = 0.0
	if (t_2 == 0.0)
		tmp = 1.0;
	else
		tmp = Float64(Float64(exp(t_2) - 1.0) / t_2);
	end
	return tmp
end
function tmp_2 = code(y)
	t_0 = sqrt(((y * y) + 1.0));
	t_1 = abs((y - t_0)) - (1.0 / (y + t_0));
	t_2 = t_1 * t_1;
	tmp = 0.0;
	if (t_2 == 0.0)
		tmp = 1.0;
	else
		tmp = (exp(t_2) - 1.0) / t_2;
	end
	tmp_2 = tmp;
end
code[y_] := Block[{t$95$0 = N[Sqrt[N[(N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[N[(y - t$95$0), $MachinePrecision]], $MachinePrecision] - N[(1.0 / N[(y + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, If[Equal[t$95$2, 0.0], 1.0, N[(N[(N[Exp[t$95$2], $MachinePrecision] - 1.0), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{y \cdot y + 1}\\
t_1 := \left|y - t\_0\right| - \frac{1}{y + t\_0}\\
t_2 := t\_1 \cdot t\_1\\
\mathbf{if}\;t\_2 = 0:\\
\;\;\;\;1\\

\mathbf{else}:\\
\;\;\;\;\frac{e^{t\_2} - 1}{t\_2}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024154 -o setup:simplify
(FPCore (y)
  :name "Kahan's Monster"
  :precision binary64
  :pre (and (<= 1.0 y) (<= y 9999.0))
  (if (== (* (- (fabs (- y (sqrt (+ (* y y) 1.0)))) (/ 1.0 (+ y (sqrt (+ (* y y) 1.0))))) (- (fabs (- y (sqrt (+ (* y y) 1.0)))) (/ 1.0 (+ y (sqrt (+ (* y y) 1.0)))))) 0.0) 1.0 (/ (- (exp (* (- (fabs (- y (sqrt (+ (* y y) 1.0)))) (/ 1.0 (+ y (sqrt (+ (* y y) 1.0))))) (- (fabs (- y (sqrt (+ (* y y) 1.0)))) (/ 1.0 (+ y (sqrt (+ (* y y) 1.0))))))) 1.0) (* (- (fabs (- y (sqrt (+ (* y y) 1.0)))) (/ 1.0 (+ y (sqrt (+ (* y y) 1.0))))) (- (fabs (- y (sqrt (+ (* y y) 1.0)))) (/ 1.0 (+ y (sqrt (+ (* y y) 1.0)))))))))

Please file a bug report with this information.

Backtrace

hash-ref: no value found for key key: '==LC
f100.../match/compiler.rkt55940
f100.../match/compiler.rkt55940
exprs+ctxs->sollya/home/nightlies/herbie/artem-popl-s-eval/src/run-sollya.rkt1270
run-sollya/home/nightlies/herbie/artem-popl-s-eval/src/run-sollya.rkt1800
sample-points/home/nightlies/herbie/artem-popl-s-eval/src/sampling.rkt1760
setup-context!/home/nightlies/herbie/artem-popl-s-eval/src/mainloop.rkt450
get-alternatives/report/home/nightlies/herbie/artem-popl-s-eval/src/sandbox.rkt1710
(unnamed)/home/nightlies/herbie/artem-popl-s-eval/src/sandbox.rkt2656
(unnamed)/usr/local/racket/share/pkgs/profile-lib/main.rkt4010
profile-thunk/usr/local/racket/share/pkgs/profile-lib/main.rkt90
(unnamed)/usr/local/racket/collects/racket/engine.rkt4224