?

\[im > 0\]
\[0.5 \cdot \sqrt{2 \cdot \left(\sqrt{re \cdot re + im \cdot im} - re\right)} \]
(FPCore (re im)
 :precision binary64
 (* 0.5 (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re)))))
double code(double re, double im) {
	return 0.5 * sqrt((2.0 * (sqrt(((re * re) + (im * im))) - re)));
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = 0.5d0 * sqrt((2.0d0 * (sqrt(((re * re) + (im * im))) - re)))
end function
public static double code(double re, double im) {
	return 0.5 * Math.sqrt((2.0 * (Math.sqrt(((re * re) + (im * im))) - re)));
}
def code(re, im):
	return 0.5 * math.sqrt((2.0 * (math.sqrt(((re * re) + (im * im))) - re)))
function code(re, im)
	return Float64(0.5 * sqrt(Float64(2.0 * Float64(sqrt(Float64(Float64(re * re) + Float64(im * im))) - re))))
end
function tmp = code(re, im)
	tmp = 0.5 * sqrt((2.0 * (sqrt(((re * re) + (im * im))) - re)));
end
code[re_, im_] := N[(0.5 * N[Sqrt[N[(2.0 * N[(N[Sqrt[N[(N[(re * re), $MachinePrecision] + N[(im * im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
0.5 \cdot \sqrt{2 \cdot \left(\sqrt{re \cdot re + im \cdot im} - re\right)}

Reproduce?

Please include this information when filing a bug report:

herbie shell --seed 2023033 
(FPCore (re im)
  :name "math.sqrt on complex, imaginary part, im greater than 0 branch"
  :precision binary64
  :pre (> im 0.0)
  (* 0.5 (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re)))))

Backtrace

map: contract violation expected: list? given: #<eof>LC
gen-map/usr/share/racket/collects/racket/private/map.rkt2572
run-egglog/home/nightlies/herbie/oflatt-egglog-ctx/src/egglog/run-egglog.rkt14560
run-simplify-input/home/nightlies/herbie/oflatt-egglog-ctx/src/core/simplify.rkt730
simplify-batch/home/nightlies/herbie/oflatt-egglog-ctx/src/core/simplify.rkt480
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt37933
simplify!/home/nightlies/herbie/oflatt-egglog-ctx/src/patch.rkt2460
patch-table-run/home/nightlies/herbie/oflatt-egglog-ctx/src/patch.rkt3180
(unnamed)/usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt48618
run-iter!/home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt2620
mutate!/home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt3720
run-improve!/home/nightlies/herbie/oflatt-egglog-ctx/src/mainloop.rkt3200
run-herbie/home/nightlies/herbie/oflatt-egglog-ctx/src/sandbox.rkt570
(unnamed)/home/nightlies/herbie/oflatt-egglog-ctx/src/sandbox.rkt1336
(unnamed)/usr/share/racket/pkgs/profile-lib/main.rkt4010
profile-thunk/usr/share/racket/pkgs/profile-lib/main.rkt90
(unnamed)/usr/share/racket/collects/racket/engine.rkt4224