?

Average Error: 0.0 → 0.1
Time: 13.7s
Precision: binary64
Cost: 19904

?

\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
\[\frac{\left(1 + e^{im \cdot -2}\right) \cdot \left(e^{im} \cdot \sin re\right)}{2} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
(FPCore (re im)
 :precision binary64
 (/ (* (+ 1.0 (exp (* im -2.0))) (* (exp im) (sin re))) 2.0))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
double code(double re, double im) {
	return ((1.0 + exp((im * -2.0))) * (exp(im) * sin(re))) / 2.0;
}
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 = ((1.0d0 + exp((im * (-2.0d0)))) * (exp(im) * sin(re))) / 2.0d0
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 ((1.0 + Math.exp((im * -2.0))) * (Math.exp(im) * Math.sin(re))) / 2.0;
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
def code(re, im):
	return ((1.0 + math.exp((im * -2.0))) * (math.exp(im) * math.sin(re))) / 2.0
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(Float64(Float64(1.0 + exp(Float64(im * -2.0))) * Float64(exp(im) * sin(re))) / 2.0)
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
end
function tmp = code(re, im)
	tmp = ((1.0 + exp((im * -2.0))) * (exp(im) * sin(re))) / 2.0;
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[(N[(1.0 + N[Exp[N[(im * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[im], $MachinePrecision] * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\frac{\left(1 + e^{im \cdot -2}\right) \cdot \left(e^{im} \cdot \sin re\right)}{2}

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. Simplified0.0

    \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + e^{im}\right)} \]
    Proof

    [Start]0.0

    \[ \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]

    rational_best-simplify-10 [=>]0.0

    \[ \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + e^{im}\right) \]
  3. Applied egg-rr0.1

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{im} \cdot \left(1 + e^{im \cdot -2}\right)\right)} \]
  4. Applied egg-rr0.1

    \[\leadsto \color{blue}{\frac{\left(1 + e^{im \cdot -2}\right) \cdot \left(e^{im} \cdot \sin re\right)}{2}} \]
  5. Final simplification0.1

    \[\leadsto \frac{\left(1 + e^{im \cdot -2}\right) \cdot \left(e^{im} \cdot \sin re\right)}{2} \]

Alternatives

Alternative 1
Error0.0
Cost19712
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + e^{im}\right) \]
Alternative 2
Error0.8
Cost13312
\[\left(0.5 \cdot \sin re\right) \cdot \left(2 + {im}^{2}\right) \]
Alternative 3
Error1.2
Cost6464
\[\sin re \]
Alternative 4
Error31.9
Cost64
\[re \]

Error

Reproduce?

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