?

Average Error: 100.0% → 100.0%
Time: 9.3s
Precision: binary64
Cost: 12992.00

?

\[e^{re} \cdot \cos im \]
\[e^{re} \cdot \cos im \]
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
	return exp(re) * cos(im);
}
double code(double re, double im) {
	return exp(re) * cos(im);
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = exp(re) * cos(im)
end function
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
	return Math.exp(re) * Math.cos(im);
}
public static double code(double re, double im) {
	return Math.exp(re) * Math.cos(im);
}
def code(re, im):
	return math.exp(re) * math.cos(im)
def code(re, im):
	return math.exp(re) * math.cos(im)
function code(re, im)
	return Float64(exp(re) * cos(im))
end
function code(re, im)
	return Float64(exp(re) * cos(im))
end
function tmp = code(re, im)
	tmp = exp(re) * cos(im);
end
function tmp = code(re, im)
	tmp = exp(re) * cos(im);
end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
e^{re} \cdot \cos im
e^{re} \cdot \cos im

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 100.0

    \[e^{re} \cdot \cos im \]
  2. Final simplification100.0

    \[\leadsto e^{re} \cdot \cos im \]

Alternatives

Alternative 1
Error98.3%
Cost19528.00
\[\begin{array}{l} \mathbf{if}\;e^{re} \leq 0.99:\\ \;\;\;\;e^{re}\\ \mathbf{elif}\;e^{re} \leq 1:\\ \;\;\;\;\cos im\\ \mathbf{else}:\\ \;\;\;\;e^{re}\\ \end{array} \]
Alternative 2
Error99.2%
Cost13892.00
\[\begin{array}{l} \mathbf{if}\;e^{re} \leq 0.99:\\ \;\;\;\;e^{re}\\ \mathbf{else}:\\ \;\;\;\;\cos im \cdot \left(\left(re + 1\right) + \left(re \cdot re\right) \cdot \left(re \cdot 0.16666666666666666 + 0.5\right)\right)\\ \end{array} \]
Alternative 3
Error99.0%
Cost13636.00
\[\begin{array}{l} \mathbf{if}\;e^{re} \leq 0.99:\\ \;\;\;\;e^{re}\\ \mathbf{else}:\\ \;\;\;\;\cos im \cdot \left(\left(re + 1\right) + re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \]
Alternative 4
Error98.8%
Cost13252.00
\[\begin{array}{l} \mathbf{if}\;e^{re} \leq 0.99:\\ \;\;\;\;e^{re}\\ \mathbf{else}:\\ \;\;\;\;\cos im \cdot \left(re + 1\right)\\ \end{array} \]
Alternative 5
Error67.0%
Cost6464.00
\[\cos im \]
Alternative 6
Error36.9%
Cost192.00
\[re + 1 \]

Error

Reproduce?

herbie shell --seed 2023093 
(FPCore (re im)
  :name "math.exp on complex, real part"
  :precision binary64
  (* (exp re) (cos im)))