
(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 -400.0) (not (<= t_0 0.2)))
(* t_0 (* (sin re) 0.5))
(*
(sin re)
(+
(- (* (pow im 5.0) -0.008333333333333333) im)
(+
(* (pow im 7.0) -0.0001984126984126984)
(* (* im im) (* im -0.16666666666666666))))))))
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -400.0) || !(t_0 <= 0.2)) {
tmp = t_0 * (sin(re) * 0.5);
} else {
tmp = sin(re) * (((pow(im, 5.0) * -0.008333333333333333) - im) + ((pow(im, 7.0) * -0.0001984126984126984) + ((im * im) * (im * -0.16666666666666666))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = exp(-im) - exp(im)
if ((t_0 <= (-400.0d0)) .or. (.not. (t_0 <= 0.2d0))) then
tmp = t_0 * (sin(re) * 0.5d0)
else
tmp = sin(re) * ((((im ** 5.0d0) * (-0.008333333333333333d0)) - im) + (((im ** 7.0d0) * (-0.0001984126984126984d0)) + ((im * im) * (im * (-0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_0 <= -400.0) || !(t_0 <= 0.2)) {
tmp = t_0 * (Math.sin(re) * 0.5);
} else {
tmp = Math.sin(re) * (((Math.pow(im, 5.0) * -0.008333333333333333) - im) + ((Math.pow(im, 7.0) * -0.0001984126984126984) + ((im * im) * (im * -0.16666666666666666))));
}
return tmp;
}
def code(re, im): t_0 = math.exp(-im) - math.exp(im) tmp = 0 if (t_0 <= -400.0) or not (t_0 <= 0.2): tmp = t_0 * (math.sin(re) * 0.5) else: tmp = math.sin(re) * (((math.pow(im, 5.0) * -0.008333333333333333) - im) + ((math.pow(im, 7.0) * -0.0001984126984126984) + ((im * im) * (im * -0.16666666666666666)))) return tmp
function code(re, im) t_0 = Float64(exp(Float64(-im)) - exp(im)) tmp = 0.0 if ((t_0 <= -400.0) || !(t_0 <= 0.2)) tmp = Float64(t_0 * Float64(sin(re) * 0.5)); else tmp = Float64(sin(re) * Float64(Float64(Float64((im ^ 5.0) * -0.008333333333333333) - im) + Float64(Float64((im ^ 7.0) * -0.0001984126984126984) + Float64(Float64(im * im) * Float64(im * -0.16666666666666666))))); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(-im) - exp(im); tmp = 0.0; if ((t_0 <= -400.0) || ~((t_0 <= 0.2))) tmp = t_0 * (sin(re) * 0.5); else tmp = sin(re) * ((((im ^ 5.0) * -0.008333333333333333) - im) + (((im ^ 7.0) * -0.0001984126984126984) + ((im * im) * (im * -0.16666666666666666)))); 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, -400.0], N[Not[LessEqual[t$95$0, 0.2]], $MachinePrecision]], N[(t$95$0 * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[(N[Power[im, 5.0], $MachinePrecision] * -0.008333333333333333), $MachinePrecision] - im), $MachinePrecision] + N[(N[(N[Power[im, 7.0], $MachinePrecision] * -0.0001984126984126984), $MachinePrecision] + N[(N[(im * im), $MachinePrecision] * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -400 \lor \neg \left(t_0 \leq 0.2\right):\\
\;\;\;\;t_0 \cdot \left(\sin re \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(\left({im}^{5} \cdot -0.008333333333333333 - im\right) + \left({im}^{7} \cdot -0.0001984126984126984 + \left(im \cdot im\right) \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -400 or 0.20000000000000001 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) Initial program 100.0%
if -400 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 0.20000000000000001Initial program 35.5%
Taylor expanded in im around 0 99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
mul-1-neg99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt-out99.8%
*-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-*r*99.8%
Simplified99.8%
add-log-exp99.5%
Applied egg-rr99.5%
add-log-exp99.8%
unpow399.8%
associate-*l*99.8%
Applied egg-rr99.8%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 -400.0) (not (<= t_0 0.02)))
(* t_0 (* (sin re) 0.5))
(*
(sin re)
(+
(* (pow im 5.0) -0.008333333333333333)
(- (* (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 <= -400.0) || !(t_0 <= 0.02)) {
tmp = t_0 * (sin(re) * 0.5);
} else {
tmp = sin(re) * ((pow(im, 5.0) * -0.008333333333333333) + ((pow(im, 3.0) * -0.16666666666666666) - im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = exp(-im) - exp(im)
if ((t_0 <= (-400.0d0)) .or. (.not. (t_0 <= 0.02d0))) then
tmp = t_0 * (sin(re) * 0.5d0)
else
tmp = sin(re) * (((im ** 5.0d0) * (-0.008333333333333333d0)) + (((im ** 3.0d0) * (-0.16666666666666666d0)) - im))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_0 <= -400.0) || !(t_0 <= 0.02)) {
tmp = t_0 * (Math.sin(re) * 0.5);
} else {
tmp = Math.sin(re) * ((Math.pow(im, 5.0) * -0.008333333333333333) + ((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 <= -400.0) or not (t_0 <= 0.02): tmp = t_0 * (math.sin(re) * 0.5) else: tmp = math.sin(re) * ((math.pow(im, 5.0) * -0.008333333333333333) + ((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 <= -400.0) || !(t_0 <= 0.02)) tmp = Float64(t_0 * Float64(sin(re) * 0.5)); else tmp = Float64(sin(re) * Float64(Float64((im ^ 5.0) * -0.008333333333333333) + 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 <= -400.0) || ~((t_0 <= 0.02))) tmp = t_0 * (sin(re) * 0.5); else tmp = sin(re) * (((im ^ 5.0) * -0.008333333333333333) + (((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, -400.0], N[Not[LessEqual[t$95$0, 0.02]], $MachinePrecision]], N[(t$95$0 * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 5.0], $MachinePrecision] * -0.008333333333333333), $MachinePrecision] + N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -400 \lor \neg \left(t_0 \leq 0.02\right):\\
\;\;\;\;t_0 \cdot \left(\sin re \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 + \left({im}^{3} \cdot -0.16666666666666666 - im\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -400 or 0.0200000000000000004 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) Initial program 99.9%
if -400 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 0.0200000000000000004Initial program 35.1%
Taylor expanded in im around 0 99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
mul-1-neg99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt-out99.9%
associate-*r*99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-lft-out99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 -400.0) (not (<= t_0 0.001)))
(* t_0 (* (sin re) 0.5))
(* (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 <= -400.0) || !(t_0 <= 0.001)) {
tmp = t_0 * (sin(re) * 0.5);
} else {
tmp = sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = exp(-im) - exp(im)
if ((t_0 <= (-400.0d0)) .or. (.not. (t_0 <= 0.001d0))) then
tmp = t_0 * (sin(re) * 0.5d0)
else
tmp = sin(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_0 <= -400.0) || !(t_0 <= 0.001)) {
tmp = t_0 * (Math.sin(re) * 0.5);
} 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 <= -400.0) or not (t_0 <= 0.001): tmp = t_0 * (math.sin(re) * 0.5) 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 <= -400.0) || !(t_0 <= 0.001)) tmp = Float64(t_0 * Float64(sin(re) * 0.5)); 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 <= -400.0) || ~((t_0 <= 0.001))) tmp = t_0 * (sin(re) * 0.5); 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, -400.0], N[Not[LessEqual[t$95$0, 0.001]], $MachinePrecision]], N[(t$95$0 * N[(N[Sin[re], $MachinePrecision] * 0.5), $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 -400 \lor \neg \left(t_0 \leq 0.001\right):\\
\;\;\;\;t_0 \cdot \left(\sin re \cdot 0.5\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)) < -400 or 1e-3 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) Initial program 99.9%
if -400 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 1e-3Initial program 34.7%
Taylor expanded in im around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-lft-out--99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(*
(sin re)
(+
(- (* (pow im 5.0) -0.008333333333333333) im)
(+
(* (pow im 7.0) -0.0001984126984126984)
(log (exp (* (pow im 3.0) -0.16666666666666666)))))))
double code(double re, double im) {
return sin(re) * (((pow(im, 5.0) * -0.008333333333333333) - im) + ((pow(im, 7.0) * -0.0001984126984126984) + log(exp((pow(im, 3.0) * -0.16666666666666666)))));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sin(re) * ((((im ** 5.0d0) * (-0.008333333333333333d0)) - im) + (((im ** 7.0d0) * (-0.0001984126984126984d0)) + log(exp(((im ** 3.0d0) * (-0.16666666666666666d0))))))
end function
public static double code(double re, double im) {
return Math.sin(re) * (((Math.pow(im, 5.0) * -0.008333333333333333) - im) + ((Math.pow(im, 7.0) * -0.0001984126984126984) + Math.log(Math.exp((Math.pow(im, 3.0) * -0.16666666666666666)))));
}
def code(re, im): return math.sin(re) * (((math.pow(im, 5.0) * -0.008333333333333333) - im) + ((math.pow(im, 7.0) * -0.0001984126984126984) + math.log(math.exp((math.pow(im, 3.0) * -0.16666666666666666)))))
function code(re, im) return Float64(sin(re) * Float64(Float64(Float64((im ^ 5.0) * -0.008333333333333333) - im) + Float64(Float64((im ^ 7.0) * -0.0001984126984126984) + log(exp(Float64((im ^ 3.0) * -0.16666666666666666)))))) end
function tmp = code(re, im) tmp = sin(re) * ((((im ^ 5.0) * -0.008333333333333333) - im) + (((im ^ 7.0) * -0.0001984126984126984) + log(exp(((im ^ 3.0) * -0.16666666666666666))))); end
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[(N[(N[(N[Power[im, 5.0], $MachinePrecision] * -0.008333333333333333), $MachinePrecision] - im), $MachinePrecision] + N[(N[(N[Power[im, 7.0], $MachinePrecision] * -0.0001984126984126984), $MachinePrecision] + N[Log[N[Exp[N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin re \cdot \left(\left({im}^{5} \cdot -0.008333333333333333 - im\right) + \left({im}^{7} \cdot -0.0001984126984126984 + \log \left(e^{{im}^{3} \cdot -0.16666666666666666}\right)\right)\right)
\end{array}
Initial program 65.2%
Taylor expanded in im around 0 95.5%
associate-+r+95.5%
+-commutative95.5%
+-commutative95.5%
mul-1-neg95.5%
*-commutative95.5%
distribute-lft-neg-in95.5%
*-commutative95.5%
associate-*r*95.5%
distribute-rgt-out95.5%
*-commutative95.5%
associate-*r*95.5%
*-commutative95.5%
associate-*r*95.5%
Simplified95.5%
add-log-exp99.0%
Applied egg-rr99.0%
Final simplification99.0%
(FPCore (re im) :precision binary64 (if (or (<= im -8e+54) (not (<= im 1.1e+44))) (* -0.0001984126984126984 (* (sin re) (pow im 7.0))) (log1p (expm1 (* (sin re) (- im))))))
double code(double re, double im) {
double tmp;
if ((im <= -8e+54) || !(im <= 1.1e+44)) {
tmp = -0.0001984126984126984 * (sin(re) * pow(im, 7.0));
} else {
tmp = log1p(expm1((sin(re) * -im)));
}
return tmp;
}
public static double code(double re, double im) {
double tmp;
if ((im <= -8e+54) || !(im <= 1.1e+44)) {
tmp = -0.0001984126984126984 * (Math.sin(re) * Math.pow(im, 7.0));
} else {
tmp = Math.log1p(Math.expm1((Math.sin(re) * -im)));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -8e+54) or not (im <= 1.1e+44): tmp = -0.0001984126984126984 * (math.sin(re) * math.pow(im, 7.0)) else: tmp = math.log1p(math.expm1((math.sin(re) * -im))) return tmp
function code(re, im) tmp = 0.0 if ((im <= -8e+54) || !(im <= 1.1e+44)) tmp = Float64(-0.0001984126984126984 * Float64(sin(re) * (im ^ 7.0))); else tmp = log1p(expm1(Float64(sin(re) * Float64(-im)))); end return tmp end
code[re_, im_] := If[Or[LessEqual[im, -8e+54], N[Not[LessEqual[im, 1.1e+44]], $MachinePrecision]], N[(-0.0001984126984126984 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[N[(N[Sin[re], $MachinePrecision] * (-im)), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -8 \cdot 10^{+54} \lor \neg \left(im \leq 1.1 \cdot 10^{+44}\right):\\
\;\;\;\;-0.0001984126984126984 \cdot \left(\sin re \cdot {im}^{7}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\sin re \cdot \left(-im\right)\right)\right)\\
\end{array}
\end{array}
if im < -8.0000000000000006e54 or 1.09999999999999998e44 < im Initial program 100.0%
Taylor expanded in im around 0 100.0%
associate-+r+100.0%
+-commutative100.0%
+-commutative100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
if -8.0000000000000006e54 < im < 1.09999999999999998e44Initial program 41.8%
Taylor expanded in im around 0 89.5%
mul-1-neg89.5%
*-commutative89.5%
distribute-rgt-neg-in89.5%
Simplified89.5%
log1p-expm1-u95.1%
Applied egg-rr95.1%
Final simplification97.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.008333333333333333 (* (sin re) (pow im 5.0)))))
(if (<= im -2e+97)
t_0
(if (<= im -75000000.0)
(* -0.0001984126984126984 (* re (pow im 7.0)))
(if (<= im 3.3) (* (sin re) (- im)) t_0)))))
double code(double re, double im) {
double t_0 = -0.008333333333333333 * (sin(re) * pow(im, 5.0));
double tmp;
if (im <= -2e+97) {
tmp = t_0;
} else if (im <= -75000000.0) {
tmp = -0.0001984126984126984 * (re * pow(im, 7.0));
} else if (im <= 3.3) {
tmp = sin(re) * -im;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (-0.008333333333333333d0) * (sin(re) * (im ** 5.0d0))
if (im <= (-2d+97)) then
tmp = t_0
else if (im <= (-75000000.0d0)) then
tmp = (-0.0001984126984126984d0) * (re * (im ** 7.0d0))
else if (im <= 3.3d0) then
tmp = sin(re) * -im
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = -0.008333333333333333 * (Math.sin(re) * Math.pow(im, 5.0));
double tmp;
if (im <= -2e+97) {
tmp = t_0;
} else if (im <= -75000000.0) {
tmp = -0.0001984126984126984 * (re * Math.pow(im, 7.0));
} else if (im <= 3.3) {
tmp = Math.sin(re) * -im;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = -0.008333333333333333 * (math.sin(re) * math.pow(im, 5.0)) tmp = 0 if im <= -2e+97: tmp = t_0 elif im <= -75000000.0: tmp = -0.0001984126984126984 * (re * math.pow(im, 7.0)) elif im <= 3.3: tmp = math.sin(re) * -im else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(-0.008333333333333333 * Float64(sin(re) * (im ^ 5.0))) tmp = 0.0 if (im <= -2e+97) tmp = t_0; elseif (im <= -75000000.0) tmp = Float64(-0.0001984126984126984 * Float64(re * (im ^ 7.0))); elseif (im <= 3.3) tmp = Float64(sin(re) * Float64(-im)); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = -0.008333333333333333 * (sin(re) * (im ^ 5.0)); tmp = 0.0; if (im <= -2e+97) tmp = t_0; elseif (im <= -75000000.0) tmp = -0.0001984126984126984 * (re * (im ^ 7.0)); elseif (im <= 3.3) tmp = sin(re) * -im; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.008333333333333333 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2e+97], t$95$0, If[LessEqual[im, -75000000.0], N[(-0.0001984126984126984 * N[(re * N[Power[im, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.3], N[(N[Sin[re], $MachinePrecision] * (-im)), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\
\mathbf{if}\;im \leq -2 \cdot 10^{+97}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -75000000:\\
\;\;\;\;-0.0001984126984126984 \cdot \left(re \cdot {im}^{7}\right)\\
\mathbf{elif}\;im \leq 3.3:\\
\;\;\;\;\sin re \cdot \left(-im\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -2.0000000000000001e97 or 3.2999999999999998 < im Initial program 100.0%
Taylor expanded in im around 0 91.6%
+-commutative91.6%
associate-+r+91.6%
+-commutative91.6%
mul-1-neg91.6%
*-commutative91.6%
distribute-lft-neg-in91.6%
*-commutative91.6%
associate-*r*91.6%
distribute-rgt-out91.6%
associate-*r*91.6%
*-commutative91.6%
associate-*l*91.6%
distribute-lft-out91.6%
Simplified91.6%
Taylor expanded in im around inf 91.5%
*-commutative91.5%
Simplified91.5%
if -2.0000000000000001e97 < im < -7.5e7Initial program 100.0%
Taylor expanded in im around 0 74.8%
associate-+r+74.8%
+-commutative74.8%
+-commutative74.8%
mul-1-neg74.8%
*-commutative74.8%
distribute-lft-neg-in74.8%
*-commutative74.8%
associate-*r*74.8%
distribute-rgt-out74.8%
*-commutative74.8%
associate-*r*74.8%
*-commutative74.8%
associate-*r*74.8%
Simplified74.8%
Taylor expanded in im around inf 74.8%
associate-*r*74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in re around 0 87.1%
*-commutative87.1%
Simplified87.1%
if -7.5e7 < im < 3.2999999999999998Initial program 36.9%
Taylor expanded in im around 0 96.7%
mul-1-neg96.7%
*-commutative96.7%
distribute-rgt-neg-in96.7%
Simplified96.7%
Final simplification94.1%
(FPCore (re im) :precision binary64 (if (or (<= im -5.6) (not (<= im 5.5))) (* -0.0001984126984126984 (* (sin re) (pow im 7.0))) (* (sin re) (- (* (pow im 3.0) -0.16666666666666666) im))))
double code(double re, double im) {
double tmp;
if ((im <= -5.6) || !(im <= 5.5)) {
tmp = -0.0001984126984126984 * (sin(re) * pow(im, 7.0));
} else {
tmp = sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-5.6d0)) .or. (.not. (im <= 5.5d0))) then
tmp = (-0.0001984126984126984d0) * (sin(re) * (im ** 7.0d0))
else
tmp = sin(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -5.6) || !(im <= 5.5)) {
tmp = -0.0001984126984126984 * (Math.sin(re) * Math.pow(im, 7.0));
} else {
tmp = Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -5.6) or not (im <= 5.5): tmp = -0.0001984126984126984 * (math.sin(re) * math.pow(im, 7.0)) else: tmp = math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) return tmp
function code(re, im) tmp = 0.0 if ((im <= -5.6) || !(im <= 5.5)) tmp = Float64(-0.0001984126984126984 * Float64(sin(re) * (im ^ 7.0))); else tmp = Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -5.6) || ~((im <= 5.5))) tmp = -0.0001984126984126984 * (sin(re) * (im ^ 7.0)); else tmp = sin(re) * (((im ^ 3.0) * -0.16666666666666666) - im); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -5.6], N[Not[LessEqual[im, 5.5]], $MachinePrecision]], N[(-0.0001984126984126984 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 7.0], $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}
\mathbf{if}\;im \leq -5.6 \lor \neg \left(im \leq 5.5\right):\\
\;\;\;\;-0.0001984126984126984 \cdot \left(\sin re \cdot {im}^{7}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
\end{array}
if im < -5.5999999999999996 or 5.5 < im Initial program 100.0%
Taylor expanded in im around 0 90.5%
associate-+r+90.5%
+-commutative90.5%
+-commutative90.5%
mul-1-neg90.5%
*-commutative90.5%
distribute-lft-neg-in90.5%
*-commutative90.5%
associate-*r*90.5%
distribute-rgt-out90.5%
*-commutative90.5%
associate-*r*90.5%
*-commutative90.5%
associate-*r*90.5%
Simplified90.5%
Taylor expanded in im around inf 90.5%
if -5.5999999999999996 < im < 5.5Initial program 36.0%
Taylor expanded in im around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
associate-*l*98.9%
distribute-lft-out--98.9%
Simplified98.9%
Final simplification95.0%
(FPCore (re im) :precision binary64 (if (or (<= im -4.2) (not (<= im 4.1))) (* -0.0001984126984126984 (* (sin re) (pow im 7.0))) (* (sin re) (- im))))
double code(double re, double im) {
double tmp;
if ((im <= -4.2) || !(im <= 4.1)) {
tmp = -0.0001984126984126984 * (sin(re) * pow(im, 7.0));
} else {
tmp = sin(re) * -im;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-4.2d0)) .or. (.not. (im <= 4.1d0))) then
tmp = (-0.0001984126984126984d0) * (sin(re) * (im ** 7.0d0))
else
tmp = sin(re) * -im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -4.2) || !(im <= 4.1)) {
tmp = -0.0001984126984126984 * (Math.sin(re) * Math.pow(im, 7.0));
} else {
tmp = Math.sin(re) * -im;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -4.2) or not (im <= 4.1): tmp = -0.0001984126984126984 * (math.sin(re) * math.pow(im, 7.0)) else: tmp = math.sin(re) * -im return tmp
function code(re, im) tmp = 0.0 if ((im <= -4.2) || !(im <= 4.1)) tmp = Float64(-0.0001984126984126984 * Float64(sin(re) * (im ^ 7.0))); else tmp = Float64(sin(re) * Float64(-im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -4.2) || ~((im <= 4.1))) tmp = -0.0001984126984126984 * (sin(re) * (im ^ 7.0)); else tmp = sin(re) * -im; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -4.2], N[Not[LessEqual[im, 4.1]], $MachinePrecision]], N[(-0.0001984126984126984 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * (-im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -4.2 \lor \neg \left(im \leq 4.1\right):\\
\;\;\;\;-0.0001984126984126984 \cdot \left(\sin re \cdot {im}^{7}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(-im\right)\\
\end{array}
\end{array}
if im < -4.20000000000000018 or 4.0999999999999996 < im Initial program 100.0%
Taylor expanded in im around 0 90.5%
associate-+r+90.5%
+-commutative90.5%
+-commutative90.5%
mul-1-neg90.5%
*-commutative90.5%
distribute-lft-neg-in90.5%
*-commutative90.5%
associate-*r*90.5%
distribute-rgt-out90.5%
*-commutative90.5%
associate-*r*90.5%
*-commutative90.5%
associate-*r*90.5%
Simplified90.5%
Taylor expanded in im around inf 90.5%
if -4.20000000000000018 < im < 4.0999999999999996Initial program 36.0%
Taylor expanded in im around 0 98.0%
mul-1-neg98.0%
*-commutative98.0%
distribute-rgt-neg-in98.0%
Simplified98.0%
Final simplification94.6%
(FPCore (re im) :precision binary64 (if (or (<= im -32000000.0) (not (<= im 850.0))) (* -0.0001984126984126984 (* re (pow im 7.0))) (* (sin re) (- im))))
double code(double re, double im) {
double tmp;
if ((im <= -32000000.0) || !(im <= 850.0)) {
tmp = -0.0001984126984126984 * (re * pow(im, 7.0));
} else {
tmp = sin(re) * -im;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-32000000.0d0)) .or. (.not. (im <= 850.0d0))) then
tmp = (-0.0001984126984126984d0) * (re * (im ** 7.0d0))
else
tmp = sin(re) * -im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -32000000.0) || !(im <= 850.0)) {
tmp = -0.0001984126984126984 * (re * Math.pow(im, 7.0));
} else {
tmp = Math.sin(re) * -im;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -32000000.0) or not (im <= 850.0): tmp = -0.0001984126984126984 * (re * math.pow(im, 7.0)) else: tmp = math.sin(re) * -im return tmp
function code(re, im) tmp = 0.0 if ((im <= -32000000.0) || !(im <= 850.0)) tmp = Float64(-0.0001984126984126984 * Float64(re * (im ^ 7.0))); else tmp = Float64(sin(re) * Float64(-im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -32000000.0) || ~((im <= 850.0))) tmp = -0.0001984126984126984 * (re * (im ^ 7.0)); else tmp = sin(re) * -im; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -32000000.0], N[Not[LessEqual[im, 850.0]], $MachinePrecision]], N[(-0.0001984126984126984 * N[(re * N[Power[im, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * (-im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -32000000 \lor \neg \left(im \leq 850\right):\\
\;\;\;\;-0.0001984126984126984 \cdot \left(re \cdot {im}^{7}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(-im\right)\\
\end{array}
\end{array}
if im < -3.2e7 or 850 < im Initial program 100.0%
Taylor expanded in im around 0 92.5%
associate-+r+92.5%
+-commutative92.5%
+-commutative92.5%
mul-1-neg92.5%
*-commutative92.5%
distribute-lft-neg-in92.5%
*-commutative92.5%
associate-*r*92.5%
distribute-rgt-out92.5%
*-commutative92.5%
associate-*r*92.5%
*-commutative92.5%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in im around inf 92.5%
associate-*r*92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in re around 0 75.6%
*-commutative75.6%
Simplified75.6%
if -3.2e7 < im < 850Initial program 37.3%
Taylor expanded in im around 0 96.2%
mul-1-neg96.2%
*-commutative96.2%
distribute-rgt-neg-in96.2%
Simplified96.2%
Final simplification87.0%
(FPCore (re im) :precision binary64 (if (<= im -4.8e+18) (* im (- re)) (* (sin re) (- im))))
double code(double re, double im) {
double tmp;
if (im <= -4.8e+18) {
tmp = im * -re;
} else {
tmp = sin(re) * -im;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-4.8d+18)) then
tmp = im * -re
else
tmp = sin(re) * -im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -4.8e+18) {
tmp = im * -re;
} else {
tmp = Math.sin(re) * -im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -4.8e+18: tmp = im * -re else: tmp = math.sin(re) * -im return tmp
function code(re, im) tmp = 0.0 if (im <= -4.8e+18) tmp = Float64(im * Float64(-re)); else tmp = Float64(sin(re) * Float64(-im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -4.8e+18) tmp = im * -re; else tmp = sin(re) * -im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -4.8e+18], N[(im * (-re)), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * (-im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -4.8 \cdot 10^{+18}:\\
\;\;\;\;im \cdot \left(-re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(-im\right)\\
\end{array}
\end{array}
if im < -4.8e18Initial program 100.0%
Taylor expanded in im around 0 4.3%
mul-1-neg4.3%
*-commutative4.3%
distribute-rgt-neg-in4.3%
Simplified4.3%
Taylor expanded in re around 0 20.6%
mul-1-neg20.6%
*-commutative20.6%
distribute-rgt-neg-in20.6%
Simplified20.6%
if -4.8e18 < im Initial program 55.5%
Taylor expanded in im around 0 69.5%
mul-1-neg69.5%
*-commutative69.5%
distribute-rgt-neg-in69.5%
Simplified69.5%
Final simplification58.8%
(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(im * Float64(-re)) end
function tmp = code(re, im) tmp = im * -re; end
code[re_, im_] := N[(im * (-re)), $MachinePrecision]
\begin{array}{l}
\\
im \cdot \left(-re\right)
\end{array}
Initial program 65.2%
Taylor expanded in im around 0 55.2%
mul-1-neg55.2%
*-commutative55.2%
distribute-rgt-neg-in55.2%
Simplified55.2%
Taylor expanded in re around 0 35.1%
mul-1-neg35.1%
*-commutative35.1%
distribute-rgt-neg-in35.1%
Simplified35.1%
Final simplification35.1%
(FPCore (re im) :precision binary64 (* re 13.5))
double code(double re, double im) {
return re * 13.5;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * 13.5d0
end function
public static double code(double re, double im) {
return re * 13.5;
}
def code(re, im): return re * 13.5
function code(re, im) return Float64(re * 13.5) end
function tmp = code(re, im) tmp = re * 13.5; end
code[re_, im_] := N[(re * 13.5), $MachinePrecision]
\begin{array}{l}
\\
re \cdot 13.5
\end{array}
Initial program 65.2%
Applied egg-rr3.5%
Taylor expanded in re around 0 3.8%
*-commutative3.8%
Simplified3.8%
Final simplification3.8%
(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 2023182
(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))))