Average Error: 0.0 → 0.0
Time: 8.3s
Precision: binary64
Cost: 12992
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
\[\sin re \cdot \cosh im \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
(FPCore (re im) :precision binary64 (* (sin re) (cosh im)))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
double code(double re, double im) {
	return sin(re) * cosh(im);
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = sin(re) * cosh(im)
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
public static double code(double re, double im) {
	return Math.sin(re) * Math.cosh(im);
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
def code(re, im):
	return math.sin(re) * math.cosh(im)
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im)))
end
function code(re, im)
	return Float64(sin(re) * cosh(im))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
end
function tmp = code(re, im)
	tmp = sin(re) * cosh(im);
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[Cosh[im], $MachinePrecision]), $MachinePrecision]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\sin re \cdot \cosh im

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
  2. Applied egg-rr0.0

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(2 \cdot \cosh im\right)} \]
  3. Applied egg-rr34.0

    \[\leadsto \color{blue}{e^{\log \left(\sin re \cdot \cosh im\right)}} \]
  4. Applied egg-rr0.0

    \[\leadsto \color{blue}{\sin re \cdot \cosh im} \]
  5. Final simplification0.0

    \[\leadsto \sin re \cdot \cosh im \]

Alternatives

Alternative 1
Error0.7
Cost6976
\[\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right) \]
Alternative 2
Error1.1
Cost6464
\[\sin re \]
Alternative 3
Error31.4
Cost704
\[0.5 \cdot \left(re \cdot \left(im \cdot im\right) + re \cdot 2\right) \]
Alternative 4
Error31.6
Cost320
\[0.5 \cdot \left(re \cdot 2\right) \]
Alternative 5
Error61.3
Cost64
\[0 \]

Error

Reproduce

herbie shell --seed 2022228 
(FPCore (re im)
  :name "math.sin on complex, real part"
  :precision binary64
  (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))