
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(-im) - exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp(-im) - exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(-im) - exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp(-im) - exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)
\end{array}
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 0.01)))
(* t_0 (* 0.5 (sin re)))
(-
(*
(sin re)
(+
(* (pow im 3.0) -0.16666666666666666)
(* (pow im 5.0) -0.008333333333333333)))
(* im (sin re))))))
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 0.01)) {
tmp = t_0 * (0.5 * sin(re));
} else {
tmp = (sin(re) * ((pow(im, 3.0) * -0.16666666666666666) + (pow(im, 5.0) * -0.008333333333333333))) - (im * sin(re));
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 0.01)) {
tmp = t_0 * (0.5 * Math.sin(re));
} else {
tmp = (Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) + (Math.pow(im, 5.0) * -0.008333333333333333))) - (im * Math.sin(re));
}
return tmp;
}
def code(re, im): t_0 = math.exp(-im) - math.exp(im) tmp = 0 if (t_0 <= -math.inf) or not (t_0 <= 0.01): tmp = t_0 * (0.5 * math.sin(re)) else: tmp = (math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) + (math.pow(im, 5.0) * -0.008333333333333333))) - (im * math.sin(re)) return tmp
function code(re, im) t_0 = Float64(exp(Float64(-im)) - exp(im)) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 0.01)) tmp = Float64(t_0 * Float64(0.5 * sin(re))); else tmp = Float64(Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) + Float64((im ^ 5.0) * -0.008333333333333333))) - Float64(im * sin(re))); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(-im) - exp(im); tmp = 0.0; if ((t_0 <= -Inf) || ~((t_0 <= 0.01))) tmp = t_0 * (0.5 * sin(re)); else tmp = (sin(re) * (((im ^ 3.0) * -0.16666666666666666) + ((im ^ 5.0) * -0.008333333333333333))) - (im * sin(re)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 0.01]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + N[(N[Power[im, 5.0], $MachinePrecision] * -0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(im * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.01\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 + {im}^{5} \cdot -0.008333333333333333\right) - im \cdot \sin re\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 0.0100000000000000002 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) Initial program 100.0%
if -inf.0 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 0.0100000000000000002Initial program 30.0%
Taylor expanded in im around 0 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-rgt-out99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (sin re))) (t_1 (- (exp (- im)) (exp im))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 0.01)))
(* t_1 t_0)
(*
t_0
(+
(* im -2.0)
(+
(* (pow im 3.0) -0.3333333333333333)
(* (pow im 5.0) -0.016666666666666666)))))))
double code(double re, double im) {
double t_0 = 0.5 * sin(re);
double t_1 = exp(-im) - exp(im);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 0.01)) {
tmp = t_1 * t_0;
} else {
tmp = t_0 * ((im * -2.0) + ((pow(im, 3.0) * -0.3333333333333333) + (pow(im, 5.0) * -0.016666666666666666)));
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = 0.5 * Math.sin(re);
double t_1 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 0.01)) {
tmp = t_1 * t_0;
} else {
tmp = t_0 * ((im * -2.0) + ((Math.pow(im, 3.0) * -0.3333333333333333) + (Math.pow(im, 5.0) * -0.016666666666666666)));
}
return tmp;
}
def code(re, im): t_0 = 0.5 * math.sin(re) t_1 = math.exp(-im) - math.exp(im) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 0.01): tmp = t_1 * t_0 else: tmp = t_0 * ((im * -2.0) + ((math.pow(im, 3.0) * -0.3333333333333333) + (math.pow(im, 5.0) * -0.016666666666666666))) return tmp
function code(re, im) t_0 = Float64(0.5 * sin(re)) t_1 = Float64(exp(Float64(-im)) - exp(im)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 0.01)) tmp = Float64(t_1 * t_0); else tmp = Float64(t_0 * Float64(Float64(im * -2.0) + Float64(Float64((im ^ 3.0) * -0.3333333333333333) + Float64((im ^ 5.0) * -0.016666666666666666)))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * sin(re); t_1 = exp(-im) - exp(im); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 0.01))) tmp = t_1 * t_0; else tmp = t_0 * ((im * -2.0) + (((im ^ 3.0) * -0.3333333333333333) + ((im ^ 5.0) * -0.016666666666666666))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 0.01]], $MachinePrecision]], N[(t$95$1 * t$95$0), $MachinePrecision], N[(t$95$0 * N[(N[(im * -2.0), $MachinePrecision] + N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.3333333333333333), $MachinePrecision] + N[(N[Power[im, 5.0], $MachinePrecision] * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \sin re\\
t_1 := e^{-im} - e^{im}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 0.01\right):\\
\;\;\;\;t_1 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(im \cdot -2 + \left({im}^{3} \cdot -0.3333333333333333 + {im}^{5} \cdot -0.016666666666666666\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 0.0100000000000000002 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) Initial program 100.0%
if -inf.0 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 0.0100000000000000002Initial program 30.0%
Taylor expanded in im around 0 99.8%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 2e-6)))
(* t_0 (* 0.5 (sin re)))
(* (sin re) (- (* (pow im 3.0) -0.16666666666666666) im)))))
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 2e-6)) {
tmp = t_0 * (0.5 * sin(re));
} else {
tmp = sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 2e-6)) {
tmp = t_0 * (0.5 * Math.sin(re));
} else {
tmp = Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
}
return tmp;
}
def code(re, im): t_0 = math.exp(-im) - math.exp(im) tmp = 0 if (t_0 <= -math.inf) or not (t_0 <= 2e-6): tmp = t_0 * (0.5 * math.sin(re)) else: tmp = math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) return tmp
function code(re, im) t_0 = Float64(exp(Float64(-im)) - exp(im)) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 2e-6)) tmp = Float64(t_0 * Float64(0.5 * sin(re))); else tmp = Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(-im) - exp(im); tmp = 0.0; if ((t_0 <= -Inf) || ~((t_0 <= 2e-6))) tmp = t_0 * (0.5 * sin(re)); else tmp = sin(re) * (((im ^ 3.0) * -0.16666666666666666) - im); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 2e-6]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 2 \cdot 10^{-6}\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 1.99999999999999991e-6 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) Initial program 99.9%
if -inf.0 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 1.99999999999999991e-6Initial program 29.5%
Taylor expanded in im around 0 99.9%
+-commutative99.9%
associate-*r*99.9%
+-rgt-identity99.9%
associate-*r*99.9%
distribute-rgt-in99.9%
+-commutative99.9%
mul-1-neg99.9%
+-rgt-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in re around inf 99.9%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(if (or (<= im -2.8e+122)
(and (not (<= im -0.0031)) (or (<= im 0.235) (not (<= im 5.6e+97)))))
(* (sin re) (- (* (pow im 3.0) -0.16666666666666666) im))
(* (- (exp (- im)) (exp im)) (* 0.5 re))))
double code(double re, double im) {
double tmp;
if ((im <= -2.8e+122) || (!(im <= -0.0031) && ((im <= 0.235) || !(im <= 5.6e+97)))) {
tmp = sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
} else {
tmp = (exp(-im) - exp(im)) * (0.5 * re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-2.8d+122)) .or. (.not. (im <= (-0.0031d0))) .and. (im <= 0.235d0) .or. (.not. (im <= 5.6d+97))) then
tmp = sin(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
else
tmp = (exp(-im) - exp(im)) * (0.5d0 * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -2.8e+122) || (!(im <= -0.0031) && ((im <= 0.235) || !(im <= 5.6e+97)))) {
tmp = Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
} else {
tmp = (Math.exp(-im) - Math.exp(im)) * (0.5 * re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -2.8e+122) or (not (im <= -0.0031) and ((im <= 0.235) or not (im <= 5.6e+97))): tmp = math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) else: tmp = (math.exp(-im) - math.exp(im)) * (0.5 * re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -2.8e+122) || (!(im <= -0.0031) && ((im <= 0.235) || !(im <= 5.6e+97)))) tmp = Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); else tmp = Float64(Float64(exp(Float64(-im)) - exp(im)) * Float64(0.5 * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -2.8e+122) || (~((im <= -0.0031)) && ((im <= 0.235) || ~((im <= 5.6e+97))))) tmp = sin(re) * (((im ^ 3.0) * -0.16666666666666666) - im); else tmp = (exp(-im) - exp(im)) * (0.5 * re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -2.8e+122], And[N[Not[LessEqual[im, -0.0031]], $MachinePrecision], Or[LessEqual[im, 0.235], N[Not[LessEqual[im, 5.6e+97]], $MachinePrecision]]]], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -2.8 \cdot 10^{+122} \lor \neg \left(im \leq -0.0031\right) \land \left(im \leq 0.235 \lor \neg \left(im \leq 5.6 \cdot 10^{+97}\right)\right):\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
\end{array}
\end{array}
if im < -2.8e122 or -0.00309999999999999989 < im < 0.23499999999999999 or 5.5999999999999998e97 < im Initial program 58.8%
Taylor expanded in im around 0 99.1%
+-commutative99.1%
associate-*r*99.1%
+-rgt-identity99.1%
associate-*r*99.1%
distribute-rgt-in99.1%
+-commutative99.1%
mul-1-neg99.1%
+-rgt-identity99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in re around inf 99.1%
if -2.8e122 < im < -0.00309999999999999989 or 0.23499999999999999 < im < 5.5999999999999998e97Initial program 99.8%
Taylor expanded in re around 0 86.2%
associate-*r*86.2%
*-commutative86.2%
Simplified86.2%
Final simplification96.9%
(FPCore (re im)
:precision binary64
(if (<= im -0.00027)
(* re (- (sqrt (* (pow im 6.0) 0.027777777777777776)) im))
(if (<= im 2.4e+23)
(* (- im) (sin re))
(* re (- (/ -0.16666666666666666 (/ im (* im (pow im 3.0)))) im)))))
double code(double re, double im) {
double tmp;
if (im <= -0.00027) {
tmp = re * (sqrt((pow(im, 6.0) * 0.027777777777777776)) - im);
} else if (im <= 2.4e+23) {
tmp = -im * sin(re);
} else {
tmp = re * ((-0.16666666666666666 / (im / (im * pow(im, 3.0)))) - im);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-0.00027d0)) then
tmp = re * (sqrt(((im ** 6.0d0) * 0.027777777777777776d0)) - im)
else if (im <= 2.4d+23) then
tmp = -im * sin(re)
else
tmp = re * (((-0.16666666666666666d0) / (im / (im * (im ** 3.0d0)))) - im)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -0.00027) {
tmp = re * (Math.sqrt((Math.pow(im, 6.0) * 0.027777777777777776)) - im);
} else if (im <= 2.4e+23) {
tmp = -im * Math.sin(re);
} else {
tmp = re * ((-0.16666666666666666 / (im / (im * Math.pow(im, 3.0)))) - im);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -0.00027: tmp = re * (math.sqrt((math.pow(im, 6.0) * 0.027777777777777776)) - im) elif im <= 2.4e+23: tmp = -im * math.sin(re) else: tmp = re * ((-0.16666666666666666 / (im / (im * math.pow(im, 3.0)))) - im) return tmp
function code(re, im) tmp = 0.0 if (im <= -0.00027) tmp = Float64(re * Float64(sqrt(Float64((im ^ 6.0) * 0.027777777777777776)) - im)); elseif (im <= 2.4e+23) tmp = Float64(Float64(-im) * sin(re)); else tmp = Float64(re * Float64(Float64(-0.16666666666666666 / Float64(im / Float64(im * (im ^ 3.0)))) - im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -0.00027) tmp = re * (sqrt(((im ^ 6.0) * 0.027777777777777776)) - im); elseif (im <= 2.4e+23) tmp = -im * sin(re); else tmp = re * ((-0.16666666666666666 / (im / (im * (im ^ 3.0)))) - im); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -0.00027], N[(re * N[(N[Sqrt[N[(N[Power[im, 6.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]], $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.4e+23], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(-0.16666666666666666 / N[(im / N[(im * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -0.00027:\\
\;\;\;\;re \cdot \left(\sqrt{{im}^{6} \cdot 0.027777777777777776} - im\right)\\
\mathbf{elif}\;im \leq 2.4 \cdot 10^{+23}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(\frac{-0.16666666666666666}{\frac{im}{im \cdot {im}^{3}}} - im\right)\\
\end{array}
\end{array}
if im < -2.70000000000000003e-4Initial program 99.9%
Taylor expanded in re around 0 73.4%
associate-*r*73.4%
*-commutative73.4%
Simplified73.4%
Taylor expanded in im around 0 54.8%
+-commutative54.8%
mul-1-neg54.8%
unsub-neg54.8%
associate-*r*54.8%
distribute-rgt-out--54.8%
Simplified54.8%
add-sqr-sqrt54.8%
sqrt-unprod61.8%
swap-sqr61.8%
*-commutative61.8%
pow-sqr61.8%
metadata-eval61.8%
metadata-eval61.8%
Applied egg-rr61.8%
if -2.70000000000000003e-4 < im < 2.4e23Initial program 31.7%
Taylor expanded in im around 0 96.7%
associate-*r*96.7%
mul-1-neg96.7%
Simplified96.7%
if 2.4e23 < im Initial program 100.0%
Taylor expanded in re around 0 75.0%
associate-*r*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in im around 0 57.5%
+-commutative57.5%
mul-1-neg57.5%
unsub-neg57.5%
associate-*r*57.5%
distribute-rgt-out--57.5%
Simplified57.5%
Applied egg-rr60.7%
associate-/l*57.5%
+-rgt-identity57.5%
associate-/l*60.7%
associate-*r*60.7%
unpow260.7%
associate-*r*60.7%
unpow260.7%
cube-mult60.7%
associate-/l*60.7%
Simplified60.7%
Final simplification79.0%
(FPCore (re im) :precision binary64 (* (sin re) (- (* (pow im 3.0) -0.16666666666666666) im)))
double code(double re, double im) {
return sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sin(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
end function
public static double code(double re, double im) {
return Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
}
def code(re, im): return math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im)
function code(re, im) return Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) end
function tmp = code(re, im) tmp = sin(re) * (((im ^ 3.0) * -0.16666666666666666) - im); end
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)
\end{array}
Initial program 65.8%
Taylor expanded in im around 0 83.8%
+-commutative83.8%
associate-*r*83.8%
+-rgt-identity83.8%
associate-*r*83.8%
distribute-rgt-in83.8%
+-commutative83.8%
mul-1-neg83.8%
+-rgt-identity83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in re around inf 83.8%
Final simplification83.8%
(FPCore (re im) :precision binary64 (if (or (<= im -0.0031) (not (<= im 4.6e+22))) (* re (- (/ -0.16666666666666666 (/ im (* im (pow im 3.0)))) im)) (* (- im) (sin re))))
double code(double re, double im) {
double tmp;
if ((im <= -0.0031) || !(im <= 4.6e+22)) {
tmp = re * ((-0.16666666666666666 / (im / (im * pow(im, 3.0)))) - im);
} else {
tmp = -im * sin(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-0.0031d0)) .or. (.not. (im <= 4.6d+22))) then
tmp = re * (((-0.16666666666666666d0) / (im / (im * (im ** 3.0d0)))) - im)
else
tmp = -im * sin(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -0.0031) || !(im <= 4.6e+22)) {
tmp = re * ((-0.16666666666666666 / (im / (im * Math.pow(im, 3.0)))) - im);
} else {
tmp = -im * Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -0.0031) or not (im <= 4.6e+22): tmp = re * ((-0.16666666666666666 / (im / (im * math.pow(im, 3.0)))) - im) else: tmp = -im * math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -0.0031) || !(im <= 4.6e+22)) tmp = Float64(re * Float64(Float64(-0.16666666666666666 / Float64(im / Float64(im * (im ^ 3.0)))) - im)); else tmp = Float64(Float64(-im) * sin(re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -0.0031) || ~((im <= 4.6e+22))) tmp = re * ((-0.16666666666666666 / (im / (im * (im ^ 3.0)))) - im); else tmp = -im * sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -0.0031], N[Not[LessEqual[im, 4.6e+22]], $MachinePrecision]], N[(re * N[(N[(-0.16666666666666666 / N[(im / N[(im * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -0.0031 \lor \neg \left(im \leq 4.6 \cdot 10^{+22}\right):\\
\;\;\;\;re \cdot \left(\frac{-0.16666666666666666}{\frac{im}{im \cdot {im}^{3}}} - im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\end{array}
\end{array}
if im < -0.00309999999999999989 or 4.6000000000000004e22 < im Initial program 99.9%
Taylor expanded in re around 0 74.2%
associate-*r*74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in im around 0 56.1%
+-commutative56.1%
mul-1-neg56.1%
unsub-neg56.1%
associate-*r*56.1%
distribute-rgt-out--56.1%
Simplified56.1%
Applied egg-rr58.3%
associate-/l*56.1%
+-rgt-identity56.1%
associate-/l*58.3%
associate-*r*58.3%
unpow258.3%
associate-*r*58.3%
unpow258.3%
cube-mult58.3%
associate-/l*58.3%
Simplified58.3%
if -0.00309999999999999989 < im < 4.6000000000000004e22Initial program 31.7%
Taylor expanded in im around 0 96.7%
associate-*r*96.7%
mul-1-neg96.7%
Simplified96.7%
Final simplification77.5%
(FPCore (re im) :precision binary64 (if (or (<= im -0.0024) (not (<= im 7.5e+22))) (* re (- (* (pow im 3.0) -0.16666666666666666) im)) (* (- im) (sin re))))
double code(double re, double im) {
double tmp;
if ((im <= -0.0024) || !(im <= 7.5e+22)) {
tmp = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
} else {
tmp = -im * sin(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-0.0024d0)) .or. (.not. (im <= 7.5d+22))) then
tmp = re * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
else
tmp = -im * sin(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -0.0024) || !(im <= 7.5e+22)) {
tmp = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
} else {
tmp = -im * Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -0.0024) or not (im <= 7.5e+22): tmp = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im) else: tmp = -im * math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -0.0024) || !(im <= 7.5e+22)) tmp = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); else tmp = Float64(Float64(-im) * sin(re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -0.0024) || ~((im <= 7.5e+22))) tmp = re * (((im ^ 3.0) * -0.16666666666666666) - im); else tmp = -im * sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -0.0024], N[Not[LessEqual[im, 7.5e+22]], $MachinePrecision]], N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -0.0024 \lor \neg \left(im \leq 7.5 \cdot 10^{+22}\right):\\
\;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\end{array}
\end{array}
if im < -0.00239999999999999979 or 7.5000000000000002e22 < im Initial program 99.9%
Taylor expanded in re around 0 74.2%
associate-*r*74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in im around 0 56.1%
+-commutative56.1%
mul-1-neg56.1%
unsub-neg56.1%
associate-*r*56.1%
distribute-rgt-out--56.1%
Simplified56.1%
if -0.00239999999999999979 < im < 7.5000000000000002e22Initial program 31.7%
Taylor expanded in im around 0 96.7%
associate-*r*96.7%
mul-1-neg96.7%
Simplified96.7%
Final simplification76.4%
(FPCore (re im) :precision binary64 (if (or (<= im -1.32e+51) (not (<= im 3.75e+22))) (* -0.16666666666666666 (* re (pow im 3.0))) (* (- im) (sin re))))
double code(double re, double im) {
double tmp;
if ((im <= -1.32e+51) || !(im <= 3.75e+22)) {
tmp = -0.16666666666666666 * (re * pow(im, 3.0));
} else {
tmp = -im * sin(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-1.32d+51)) .or. (.not. (im <= 3.75d+22))) then
tmp = (-0.16666666666666666d0) * (re * (im ** 3.0d0))
else
tmp = -im * sin(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -1.32e+51) || !(im <= 3.75e+22)) {
tmp = -0.16666666666666666 * (re * Math.pow(im, 3.0));
} else {
tmp = -im * Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -1.32e+51) or not (im <= 3.75e+22): tmp = -0.16666666666666666 * (re * math.pow(im, 3.0)) else: tmp = -im * math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -1.32e+51) || !(im <= 3.75e+22)) tmp = Float64(-0.16666666666666666 * Float64(re * (im ^ 3.0))); else tmp = Float64(Float64(-im) * sin(re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -1.32e+51) || ~((im <= 3.75e+22))) tmp = -0.16666666666666666 * (re * (im ^ 3.0)); else tmp = -im * sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -1.32e+51], N[Not[LessEqual[im, 3.75e+22]], $MachinePrecision]], N[(-0.16666666666666666 * N[(re * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1.32 \cdot 10^{+51} \lor \neg \left(im \leq 3.75 \cdot 10^{+22}\right):\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot {im}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\end{array}
\end{array}
if im < -1.32e51 or 3.7500000000000001e22 < im Initial program 100.0%
Taylor expanded in re around 0 73.5%
associate-*r*73.5%
*-commutative73.5%
Simplified73.5%
Taylor expanded in im around 0 60.5%
+-commutative60.5%
mul-1-neg60.5%
unsub-neg60.5%
associate-*r*60.5%
distribute-rgt-out--60.5%
Simplified60.5%
Taylor expanded in im around inf 60.5%
if -1.32e51 < im < 3.7500000000000001e22Initial program 37.1%
Taylor expanded in im around 0 89.6%
associate-*r*89.6%
mul-1-neg89.6%
Simplified89.6%
Final simplification76.3%
(FPCore (re im)
:precision binary64
(if (<= im -5e+50)
(* -0.16666666666666666 (* re (pow im 3.0)))
(if (<= im 1.85e+23)
(* (- im) (sin re))
(* re (* (pow im 3.0) -0.16666666666666666)))))
double code(double re, double im) {
double tmp;
if (im <= -5e+50) {
tmp = -0.16666666666666666 * (re * pow(im, 3.0));
} else if (im <= 1.85e+23) {
tmp = -im * sin(re);
} else {
tmp = re * (pow(im, 3.0) * -0.16666666666666666);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-5d+50)) then
tmp = (-0.16666666666666666d0) * (re * (im ** 3.0d0))
else if (im <= 1.85d+23) then
tmp = -im * sin(re)
else
tmp = re * ((im ** 3.0d0) * (-0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -5e+50) {
tmp = -0.16666666666666666 * (re * Math.pow(im, 3.0));
} else if (im <= 1.85e+23) {
tmp = -im * Math.sin(re);
} else {
tmp = re * (Math.pow(im, 3.0) * -0.16666666666666666);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -5e+50: tmp = -0.16666666666666666 * (re * math.pow(im, 3.0)) elif im <= 1.85e+23: tmp = -im * math.sin(re) else: tmp = re * (math.pow(im, 3.0) * -0.16666666666666666) return tmp
function code(re, im) tmp = 0.0 if (im <= -5e+50) tmp = Float64(-0.16666666666666666 * Float64(re * (im ^ 3.0))); elseif (im <= 1.85e+23) tmp = Float64(Float64(-im) * sin(re)); else tmp = Float64(re * Float64((im ^ 3.0) * -0.16666666666666666)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -5e+50) tmp = -0.16666666666666666 * (re * (im ^ 3.0)); elseif (im <= 1.85e+23) tmp = -im * sin(re); else tmp = re * ((im ^ 3.0) * -0.16666666666666666); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -5e+50], N[(-0.16666666666666666 * N[(re * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.85e+23], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], N[(re * N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -5 \cdot 10^{+50}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot {im}^{3}\right)\\
\mathbf{elif}\;im \leq 1.85 \cdot 10^{+23}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if im < -5e50Initial program 100.0%
Taylor expanded in re around 0 71.9%
associate-*r*71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in im around 0 63.5%
+-commutative63.5%
mul-1-neg63.5%
unsub-neg63.5%
associate-*r*63.5%
distribute-rgt-out--63.5%
Simplified63.5%
Taylor expanded in im around inf 63.5%
if -5e50 < im < 1.85000000000000006e23Initial program 37.1%
Taylor expanded in im around 0 89.6%
associate-*r*89.6%
mul-1-neg89.6%
Simplified89.6%
if 1.85000000000000006e23 < im Initial program 100.0%
Taylor expanded in re around 0 75.0%
associate-*r*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in im around 0 57.5%
+-commutative57.5%
mul-1-neg57.5%
unsub-neg57.5%
associate-*r*57.5%
distribute-rgt-out--57.5%
Simplified57.5%
Taylor expanded in im around inf 57.5%
Final simplification76.3%
(FPCore (re im) :precision binary64 (if (or (<= im -3.6e+61) (not (<= im 6e+22))) (* (- im) re) (* (- im) (sin re))))
double code(double re, double im) {
double tmp;
if ((im <= -3.6e+61) || !(im <= 6e+22)) {
tmp = -im * re;
} else {
tmp = -im * sin(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-3.6d+61)) .or. (.not. (im <= 6d+22))) then
tmp = -im * re
else
tmp = -im * sin(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -3.6e+61) || !(im <= 6e+22)) {
tmp = -im * re;
} else {
tmp = -im * Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -3.6e+61) or not (im <= 6e+22): tmp = -im * re else: tmp = -im * math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -3.6e+61) || !(im <= 6e+22)) tmp = Float64(Float64(-im) * re); else tmp = Float64(Float64(-im) * sin(re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -3.6e+61) || ~((im <= 6e+22))) tmp = -im * re; else tmp = -im * sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -3.6e+61], N[Not[LessEqual[im, 6e+22]], $MachinePrecision]], N[((-im) * re), $MachinePrecision], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -3.6 \cdot 10^{+61} \lor \neg \left(im \leq 6 \cdot 10^{+22}\right):\\
\;\;\;\;\left(-im\right) \cdot re\\
\mathbf{else}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\end{array}
\end{array}
if im < -3.6000000000000001e61 or 6e22 < im Initial program 100.0%
Taylor expanded in im around 0 4.9%
associate-*r*4.9%
mul-1-neg4.9%
Simplified4.9%
Taylor expanded in re around 0 19.9%
associate-*r*19.9%
mul-1-neg19.9%
Simplified19.9%
if -3.6000000000000001e61 < im < 6e22Initial program 38.4%
Taylor expanded in im around 0 87.8%
associate-*r*87.8%
mul-1-neg87.8%
Simplified87.8%
Final simplification57.5%
(FPCore (re im) :precision binary64 (* (- im) re))
double code(double re, double im) {
return -im * re;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -im * re
end function
public static double code(double re, double im) {
return -im * re;
}
def code(re, im): return -im * re
function code(re, im) return Float64(Float64(-im) * re) end
function tmp = code(re, im) tmp = -im * re; end
code[re_, im_] := N[((-im) * re), $MachinePrecision]
\begin{array}{l}
\\
\left(-im\right) \cdot re
\end{array}
Initial program 65.8%
Taylor expanded in im around 0 50.9%
associate-*r*50.9%
mul-1-neg50.9%
Simplified50.9%
Taylor expanded in re around 0 36.6%
associate-*r*36.6%
mul-1-neg36.6%
Simplified36.6%
Final simplification36.6%
(FPCore (re im)
:precision binary64
(if (< (fabs im) 1.0)
(-
(*
(sin re)
(+
(+ im (* (* (* 0.16666666666666666 im) im) im))
(* (* (* (* (* 0.008333333333333333 im) im) im) im) im))))
(* (* 0.5 (sin re)) (- (exp (- im)) (exp im)))))
double code(double re, double im) {
double tmp;
if (fabs(im) < 1.0) {
tmp = -(sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
} else {
tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (abs(im) < 1.0d0) then
tmp = -(sin(re) * ((im + (((0.16666666666666666d0 * im) * im) * im)) + (((((0.008333333333333333d0 * im) * im) * im) * im) * im)))
else
tmp = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.abs(im) < 1.0) {
tmp = -(Math.sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
} else {
tmp = (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
return tmp;
}
def code(re, im): tmp = 0 if math.fabs(im) < 1.0: tmp = -(math.sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im))) else: tmp = (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im)) return tmp
function code(re, im) tmp = 0.0 if (abs(im) < 1.0) tmp = Float64(-Float64(sin(re) * Float64(Float64(im + Float64(Float64(Float64(0.16666666666666666 * im) * im) * im)) + Float64(Float64(Float64(Float64(Float64(0.008333333333333333 * im) * im) * im) * im) * im)))); else tmp = Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (abs(im) < 1.0) tmp = -(sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im))); else tmp = (0.5 * sin(re)) * (exp(-im) - exp(im)); end tmp_2 = tmp; end
code[re_, im_] := If[Less[N[Abs[im], $MachinePrecision], 1.0], (-N[(N[Sin[re], $MachinePrecision] * N[(N[(im + N[(N[(N[(0.16666666666666666 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(0.008333333333333333 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|im\right| < 1:\\
\;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\\
\end{array}
\end{array}
herbie shell --seed 2023305
(FPCore (re im)
:name "math.cos on complex, imaginary part"
:precision binary64
:herbie-target
(if (< (fabs im) 1.0) (- (* (sin re) (+ (+ im (* (* (* 0.16666666666666666 im) im) im)) (* (* (* (* (* 0.008333333333333333 im) im) im) im) im)))) (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
(* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))