bug323 (missed optimization)

Specification

?
\[0 \leq x \land x \leq 0.5\]
\[\begin{array}{l} \\ \cos^{-1} \left(1 - x\right) \end{array} \]
(FPCore (x) :precision binary64 (acos (- 1.0 x)))
double code(double x) {
	return acos((1.0 - x));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = acos((1.0d0 - x))
end function
public static double code(double x) {
	return Math.acos((1.0 - x));
}
def code(x):
	return math.acos((1.0 - x))
function code(x)
	return acos(Float64(1.0 - x))
end
function tmp = code(x)
	tmp = acos((1.0 - x));
end
code[x_] := N[ArcCos[N[(1.0 - x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\cos^{-1} \left(1 - x\right)
\end{array}

Reproduce

?
herbie shell --seed 2024146 
(FPCore (x)
  :name "bug323 (missed optimization)"
  :precision binary64
  :pre (and (<= 0.0 x) (<= x 0.5))

  :alt
  (! :herbie-platform default (* 2 (asin (sqrt (/ x 2)))))

  (acos (- 1.0 x)))

Please file a bug report with this information.

Backtrace

application: not a procedure; expected a procedure that can be applied to arguments given: #fLC
backward-pass/home/nightlies/herbie/jackson-mergable-platform-changes/src/correct-round.rkt1460
compiled-spec/home/nightlies/herbie/jackson-mergable-platform-changes/src/correct-round.rkt272
compiled-spec/home/nightlies/herbie/jackson-mergable-platform-changes/src/correct-round.rkt1432
compiled-spec/home/nightlies/herbie/jackson-mergable-platform-changes/src/correct-round.rkt272
compiled-spec/home/nightlies/herbie/jackson-mergable-platform-changes/src/ground-truth.rkt312
ival-eval/home/nightlies/herbie/jackson-mergable-platform-changes/src/ground-truth.rkt550
<eval-prog-real>/home/nightlies/herbie/jackson-mergable-platform-changes/src/ground-truth.rkt862
compute-local-errors/home/nightlies/herbie/jackson-mergable-platform-changes/src/core/localize.rkt750
batch-localize-errors/home/nightlies/herbie/jackson-mergable-platform-changes/src/core/localize.rkt610
localize!/home/nightlies/herbie/jackson-mergable-platform-changes/src/mainloop.rkt2010
run-iter!/home/nightlies/herbie/jackson-mergable-platform-changes/src/mainloop.rkt730
mutate!/home/nightlies/herbie/jackson-mergable-platform-changes/src/mainloop.rkt650
run-improve!/home/nightlies/herbie/jackson-mergable-platform-changes/src/mainloop.rkt510
get-alternatives/report/home/nightlies/herbie/jackson-mergable-platform-changes/src/sandbox.rkt1690
(unnamed)/home/nightlies/herbie/jackson-mergable-platform-changes/src/sandbox.rkt2636
(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