ENA, Section 1.4, Exercise 1

Specification

?
\[1.99 \leq x \land x \leq 2.01\]
\[\begin{array}{l} \\ \cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * x)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x)
use fmin_fmax_functions
    real(8), intent (in) :: x
    code = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
	return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}

Reproduce

?
herbie shell --seed 2025032 
(FPCore (x)
  :name "ENA, Section 1.4, Exercise 1"
  :precision binary64
  :pre (and (<= 1.99 x) (<= x 2.01))
  (* (cos x) (exp (* 10.0 (* x x)))))

Please file a bug report with this information.

Backtrace

operator-info: Unknown operator $literalLC
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt37933
rebuild-enode/home/nightlies/herbie/really-crazy-encodings/src/core/egg-herbie.rkt5810
split-untyped-eclasses/home/nightlies/herbie/really-crazy-encodings/src/core/egg-herbie.rkt6220
make-typed-eclasses/home/nightlies/herbie/really-crazy-encodings/src/core/egg-herbie.rkt8120
make-regraph/home/nightlies/herbie/really-crazy-encodings/src/core/egg-herbie.rkt8590
egraph-best/home/nightlies/herbie/really-crazy-encodings/src/core/egg-herbie.rkt14160
simplify-batch/home/nightlies/herbie/really-crazy-encodings/src/core/simplify.rkt190
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt48618
initial-simplify/home/nightlies/herbie/really-crazy-encodings/src/core/preprocess.rkt540
find-preprocessing/home/nightlies/herbie/really-crazy-encodings/src/core/preprocess.rkt810
run-improve!/home/nightlies/herbie/really-crazy-encodings/src/core/mainloop.rkt450
get-alternatives/report/home/nightlies/herbie/really-crazy-encodings/src/api/sandbox.rkt1740
(unnamed)/home/nightlies/herbie/really-crazy-encodings/src/api/sandbox.rkt2656
(unnamed)/usr/share/racket/pkgs/profile-lib/main.rkt4010
profile-thunk/usr/share/racket/pkgs/profile-lib/main.rkt90
in-engine/home/nightlies/herbie/really-crazy-encodings/src/api/sandbox.rkt2832
(unnamed)/usr/share/racket/collects/racket/engine.rkt4224