
(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 18 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.001)))
(* t_0 (* 0.5 (sin re)))
(fma
(pow im 3.0)
(* (sin re) -0.16666666666666666)
(* (sin re) (- (* (pow im 5.0) -0.008333333333333333) im))))))
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 0.001)) {
tmp = t_0 * (0.5 * sin(re));
} else {
tmp = fma(pow(im, 3.0), (sin(re) * -0.16666666666666666), (sin(re) * ((pow(im, 5.0) * -0.008333333333333333) - 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 <= 0.001)) tmp = Float64(t_0 * Float64(0.5 * sin(re))); else tmp = fma((im ^ 3.0), Float64(sin(re) * -0.16666666666666666), Float64(sin(re) * Float64(Float64((im ^ 5.0) * -0.008333333333333333) - im))); end return 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.001]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[im, 3.0], $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 5.0], $MachinePrecision] * -0.008333333333333333), $MachinePrecision] - im), $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.001\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 - im\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 1e-3 < (-.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)) < 1e-3Initial program 26.4%
Taylor expanded in im around 0 99.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
*-commutative99.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
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 0.001)))
(* t_0 (* 0.5 (sin re)))
(*
(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 <= -((double) INFINITY)) || !(t_0 <= 0.001)) {
tmp = t_0 * (0.5 * sin(re));
} else {
tmp = sin(re) * ((pow(im, 5.0) * -0.008333333333333333) + ((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 <= 0.001)) {
tmp = t_0 * (0.5 * Math.sin(re));
} 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 <= -math.inf) or not (t_0 <= 0.001): tmp = t_0 * (0.5 * math.sin(re)) 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 <= Float64(-Inf)) || !(t_0 <= 0.001)) tmp = Float64(t_0 * Float64(0.5 * sin(re))); 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 <= -Inf) || ~((t_0 <= 0.001))) tmp = t_0 * (0.5 * sin(re)); 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, (-Infinity)], N[Not[LessEqual[t$95$0, 0.001]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $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 -\infty \lor \neg \left(t_0 \leq 0.001\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\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)) < -inf.0 or 1e-3 < (-.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)) < 1e-3Initial program 26.4%
Taylor expanded in im around 0 99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
mul-1-neg99.9%
*-commutative99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
associate-*r*99.9%
distribute-rgt-out99.8%
associate-*r*99.8%
*-commutative99.8%
associate-*l*99.8%
distribute-lft-out99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 0.001)))
(* t_0 (* 0.5 (sin re)))
(- (* (sin re) (* (pow im 3.0) -0.16666666666666666)) (* 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.001)) {
tmp = t_0 * (0.5 * sin(re));
} else {
tmp = (sin(re) * (pow(im, 3.0) * -0.16666666666666666)) - (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.001)) {
tmp = t_0 * (0.5 * Math.sin(re));
} else {
tmp = (Math.sin(re) * (Math.pow(im, 3.0) * -0.16666666666666666)) - (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.001): tmp = t_0 * (0.5 * math.sin(re)) else: tmp = (math.sin(re) * (math.pow(im, 3.0) * -0.16666666666666666)) - (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.001)) tmp = Float64(t_0 * Float64(0.5 * sin(re))); else tmp = Float64(Float64(sin(re) * Float64((im ^ 3.0) * -0.16666666666666666)) - 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.001))) tmp = t_0 * (0.5 * sin(re)); else tmp = (sin(re) * ((im ^ 3.0) * -0.16666666666666666)) - (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.001]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $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.001\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right) - im \cdot \sin re\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 1e-3 < (-.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)) < 1e-3Initial program 26.4%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*l*99.8%
distribute-lft-out--99.8%
Simplified99.8%
sub-neg99.8%
distribute-lft-in99.8%
Applied egg-rr99.8%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 0.001)))
(* 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 <= 0.001)) {
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 <= 0.001)) {
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 <= 0.001): 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 <= 0.001)) 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 <= 0.001))) 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, 0.001]], $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 0.001\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 1e-3 < (-.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)) < 1e-3Initial program 26.4%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*l*99.8%
distribute-lft-out--99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.16666666666666666 (* (sin re) (pow im 3.0)))))
(if (<= im -6.2e+97)
t_0
(if (<= im -420000000.0)
(log1p (expm1 (* re -1.5)))
(if (<= im 1.45e-29)
(/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
(if (<= im 8.5e+59)
(* im (- (* (pow re 3.0) 0.16666666666666666) re))
t_0))))))
double code(double re, double im) {
double t_0 = -0.16666666666666666 * (sin(re) * pow(im, 3.0));
double tmp;
if (im <= -6.2e+97) {
tmp = t_0;
} else if (im <= -420000000.0) {
tmp = log1p(expm1((re * -1.5)));
} else if (im <= 1.45e-29) {
tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 8.5e+59) {
tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = -0.16666666666666666 * (Math.sin(re) * Math.pow(im, 3.0));
double tmp;
if (im <= -6.2e+97) {
tmp = t_0;
} else if (im <= -420000000.0) {
tmp = Math.log1p(Math.expm1((re * -1.5)));
} else if (im <= 1.45e-29) {
tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 8.5e+59) {
tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = -0.16666666666666666 * (math.sin(re) * math.pow(im, 3.0)) tmp = 0 if im <= -6.2e+97: tmp = t_0 elif im <= -420000000.0: tmp = math.log1p(math.expm1((re * -1.5))) elif im <= 1.45e-29: tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im)) elif im <= 8.5e+59: tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(-0.16666666666666666 * Float64(sin(re) * (im ^ 3.0))) tmp = 0.0 if (im <= -6.2e+97) tmp = t_0; elseif (im <= -420000000.0) tmp = log1p(expm1(Float64(re * -1.5))); elseif (im <= 1.45e-29) tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im))); elseif (im <= 8.5e+59) tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re)); else tmp = t_0; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(-0.16666666666666666 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -6.2e+97], t$95$0, If[LessEqual[im, -420000000.0], N[Log[1 + N[(Exp[N[(re * -1.5), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.5e+59], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\
\mathbf{if}\;im \leq -6.2 \cdot 10^{+97}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\
\mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\
\;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -6.19999999999999962e97 or 8.4999999999999999e59 < im Initial program 100.0%
Taylor expanded in im around 0 88.4%
mul-1-neg88.4%
unsub-neg88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out--88.4%
Simplified88.4%
Taylor expanded in im around inf 88.4%
if -6.19999999999999962e97 < im < -4.2e8Initial program 100.0%
Taylor expanded in re around 0 57.9%
Applied egg-rr2.5%
log1p-expm1-u42.7%
associate-*r*42.7%
metadata-eval42.7%
Applied egg-rr42.7%
if -4.2e8 < im < 1.45000000000000012e-29Initial program 27.6%
Taylor expanded in im around 0 99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
associate-*l*99.0%
distribute-lft-out--99.0%
Simplified99.0%
flip--64.6%
associate-*r/59.2%
swap-sqr59.2%
pow-prod-up59.2%
metadata-eval59.2%
metadata-eval59.2%
fma-def59.2%
Applied egg-rr59.2%
associate-/l*64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in im around 0 98.7%
*-commutative98.7%
Simplified98.7%
if 1.45000000000000012e-29 < im < 8.4999999999999999e59Initial program 74.4%
Taylor expanded in im around 0 29.6%
mul-1-neg29.6%
*-commutative29.6%
distribute-rgt-neg-in29.6%
Simplified29.6%
Taylor expanded in re around 0 55.7%
associate-*r*55.7%
associate-*r*55.7%
distribute-rgt-out73.9%
mul-1-neg73.9%
*-commutative73.9%
Simplified73.9%
Final simplification88.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.008333333333333333 (* (sin re) (pow im 5.0)))))
(if (<= im -5e+61)
t_0
(if (<= im -0.07)
(* 0.5 (* (- (exp (- im)) (exp im)) re))
(if (<= im 1.45e-29)
(/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
(if (<= im 8.5e+59)
(* im (- (* (pow re 3.0) 0.16666666666666666) re))
t_0))))))
double code(double re, double im) {
double t_0 = -0.008333333333333333 * (sin(re) * pow(im, 5.0));
double tmp;
if (im <= -5e+61) {
tmp = t_0;
} else if (im <= -0.07) {
tmp = 0.5 * ((exp(-im) - exp(im)) * re);
} else if (im <= 1.45e-29) {
tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 8.5e+59) {
tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
} 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 <= (-5d+61)) then
tmp = t_0
else if (im <= (-0.07d0)) then
tmp = 0.5d0 * ((exp(-im) - exp(im)) * re)
else if (im <= 1.45d-29) then
tmp = sin(re) / ((im * 0.16666666666666666d0) + ((-1.0d0) / im))
else if (im <= 8.5d+59) then
tmp = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
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 <= -5e+61) {
tmp = t_0;
} else if (im <= -0.07) {
tmp = 0.5 * ((Math.exp(-im) - Math.exp(im)) * re);
} else if (im <= 1.45e-29) {
tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 8.5e+59) {
tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
} 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 <= -5e+61: tmp = t_0 elif im <= -0.07: tmp = 0.5 * ((math.exp(-im) - math.exp(im)) * re) elif im <= 1.45e-29: tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im)) elif im <= 8.5e+59: tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re) 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 <= -5e+61) tmp = t_0; elseif (im <= -0.07) tmp = Float64(0.5 * Float64(Float64(exp(Float64(-im)) - exp(im)) * re)); elseif (im <= 1.45e-29) tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im))); elseif (im <= 8.5e+59) tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re)); 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 <= -5e+61) tmp = t_0; elseif (im <= -0.07) tmp = 0.5 * ((exp(-im) - exp(im)) * re); elseif (im <= 1.45e-29) tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im)); elseif (im <= 8.5e+59) tmp = im * (((re ^ 3.0) * 0.16666666666666666) - re); 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, -5e+61], t$95$0, If[LessEqual[im, -0.07], N[(0.5 * N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * re), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.5e+59], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $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 -5 \cdot 10^{+61}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -0.07:\\
\;\;\;\;0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\
\mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\
\;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -5.00000000000000018e61 or 8.4999999999999999e59 < im Initial program 100.0%
Taylor expanded in im around 0 98.5%
+-commutative98.5%
associate-+r+98.5%
+-commutative98.5%
mul-1-neg98.5%
*-commutative98.5%
distribute-lft-neg-in98.5%
*-commutative98.5%
associate-*r*98.5%
distribute-rgt-out98.5%
associate-*r*98.5%
*-commutative98.5%
associate-*l*98.5%
distribute-lft-out98.5%
Simplified98.5%
Taylor expanded in im around inf 98.5%
*-commutative98.5%
Simplified98.5%
if -5.00000000000000018e61 < im < -0.070000000000000007Initial program 100.0%
Taylor expanded in re around 0 60.0%
if -0.070000000000000007 < im < 1.45000000000000012e-29Initial program 27.0%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*l*99.8%
distribute-lft-out--99.8%
Simplified99.8%
flip--65.2%
associate-*r/59.7%
swap-sqr59.7%
pow-prod-up59.7%
metadata-eval59.7%
metadata-eval59.7%
fma-def59.7%
Applied egg-rr59.7%
associate-/l*65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in im around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 1.45000000000000012e-29 < im < 8.4999999999999999e59Initial program 74.4%
Taylor expanded in im around 0 29.6%
mul-1-neg29.6%
*-commutative29.6%
distribute-rgt-neg-in29.6%
Simplified29.6%
Taylor expanded in re around 0 55.7%
associate-*r*55.7%
associate-*r*55.7%
distribute-rgt-out73.9%
mul-1-neg73.9%
*-commutative73.9%
Simplified73.9%
Final simplification96.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.008333333333333333 (* (sin re) (pow im 5.0)))))
(if (<= im -5e+61)
t_0
(if (<= im -0.135)
(* 0.5 (* (- (exp (- im)) (exp im)) re))
(if (<= im 1.45e-29)
(* (sin re) (- (* (pow im 3.0) -0.16666666666666666) im))
(if (<= im 8.5e+59)
(* im (- (* (pow re 3.0) 0.16666666666666666) re))
t_0))))))
double code(double re, double im) {
double t_0 = -0.008333333333333333 * (sin(re) * pow(im, 5.0));
double tmp;
if (im <= -5e+61) {
tmp = t_0;
} else if (im <= -0.135) {
tmp = 0.5 * ((exp(-im) - exp(im)) * re);
} else if (im <= 1.45e-29) {
tmp = sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
} else if (im <= 8.5e+59) {
tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
} 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 <= (-5d+61)) then
tmp = t_0
else if (im <= (-0.135d0)) then
tmp = 0.5d0 * ((exp(-im) - exp(im)) * re)
else if (im <= 1.45d-29) then
tmp = sin(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
else if (im <= 8.5d+59) then
tmp = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
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 <= -5e+61) {
tmp = t_0;
} else if (im <= -0.135) {
tmp = 0.5 * ((Math.exp(-im) - Math.exp(im)) * re);
} else if (im <= 1.45e-29) {
tmp = Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
} else if (im <= 8.5e+59) {
tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
} 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 <= -5e+61: tmp = t_0 elif im <= -0.135: tmp = 0.5 * ((math.exp(-im) - math.exp(im)) * re) elif im <= 1.45e-29: tmp = math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) elif im <= 8.5e+59: tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re) 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 <= -5e+61) tmp = t_0; elseif (im <= -0.135) tmp = Float64(0.5 * Float64(Float64(exp(Float64(-im)) - exp(im)) * re)); elseif (im <= 1.45e-29) tmp = Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); elseif (im <= 8.5e+59) tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re)); 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 <= -5e+61) tmp = t_0; elseif (im <= -0.135) tmp = 0.5 * ((exp(-im) - exp(im)) * re); elseif (im <= 1.45e-29) tmp = sin(re) * (((im ^ 3.0) * -0.16666666666666666) - im); elseif (im <= 8.5e+59) tmp = im * (((re ^ 3.0) * 0.16666666666666666) - re); 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, -5e+61], t$95$0, If[LessEqual[im, -0.135], N[(0.5 * N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * re), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.5e+59], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $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 -5 \cdot 10^{+61}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -0.135:\\
\;\;\;\;0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\
\;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -5.00000000000000018e61 or 8.4999999999999999e59 < im Initial program 100.0%
Taylor expanded in im around 0 98.5%
+-commutative98.5%
associate-+r+98.5%
+-commutative98.5%
mul-1-neg98.5%
*-commutative98.5%
distribute-lft-neg-in98.5%
*-commutative98.5%
associate-*r*98.5%
distribute-rgt-out98.5%
associate-*r*98.5%
*-commutative98.5%
associate-*l*98.5%
distribute-lft-out98.5%
Simplified98.5%
Taylor expanded in im around inf 98.5%
*-commutative98.5%
Simplified98.5%
if -5.00000000000000018e61 < im < -0.13500000000000001Initial program 100.0%
Taylor expanded in re around 0 60.0%
if -0.13500000000000001 < im < 1.45000000000000012e-29Initial program 27.0%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*l*99.8%
distribute-lft-out--99.8%
Simplified99.8%
if 1.45000000000000012e-29 < im < 8.4999999999999999e59Initial program 74.4%
Taylor expanded in im around 0 29.6%
mul-1-neg29.6%
*-commutative29.6%
distribute-rgt-neg-in29.6%
Simplified29.6%
Taylor expanded in re around 0 55.7%
associate-*r*55.7%
associate-*r*55.7%
distribute-rgt-out73.9%
mul-1-neg73.9%
*-commutative73.9%
Simplified73.9%
Final simplification96.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.008333333333333333 (* (sin re) (pow im 5.0)))))
(if (<= im -2.35)
t_0
(if (<= im 1.45e-29)
(/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
(if (<= im 7.2e+59)
(* im (- (* (pow re 3.0) 0.16666666666666666) re))
t_0)))))
double code(double re, double im) {
double t_0 = -0.008333333333333333 * (sin(re) * pow(im, 5.0));
double tmp;
if (im <= -2.35) {
tmp = t_0;
} else if (im <= 1.45e-29) {
tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 7.2e+59) {
tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
} 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 <= (-2.35d0)) then
tmp = t_0
else if (im <= 1.45d-29) then
tmp = sin(re) / ((im * 0.16666666666666666d0) + ((-1.0d0) / im))
else if (im <= 7.2d+59) then
tmp = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
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 <= -2.35) {
tmp = t_0;
} else if (im <= 1.45e-29) {
tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 7.2e+59) {
tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
} 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 <= -2.35: tmp = t_0 elif im <= 1.45e-29: tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im)) elif im <= 7.2e+59: tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re) 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 <= -2.35) tmp = t_0; elseif (im <= 1.45e-29) tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im))); elseif (im <= 7.2e+59) tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re)); 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 <= -2.35) tmp = t_0; elseif (im <= 1.45e-29) tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im)); elseif (im <= 7.2e+59) tmp = im * (((re ^ 3.0) * 0.16666666666666666) - re); 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, -2.35], t$95$0, If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.2e+59], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $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.35:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\
\mathbf{elif}\;im \leq 7.2 \cdot 10^{+59}:\\
\;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -2.35000000000000009 or 7.1999999999999997e59 < im Initial program 100.0%
Taylor expanded in im around 0 92.2%
+-commutative92.2%
associate-+r+92.2%
+-commutative92.2%
mul-1-neg92.2%
*-commutative92.2%
distribute-lft-neg-in92.2%
*-commutative92.2%
associate-*r*92.2%
distribute-rgt-out92.2%
associate-*r*92.2%
*-commutative92.2%
associate-*l*92.2%
distribute-lft-out92.2%
Simplified92.2%
Taylor expanded in im around inf 92.2%
*-commutative92.2%
Simplified92.2%
if -2.35000000000000009 < im < 1.45000000000000012e-29Initial program 27.0%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*l*99.8%
distribute-lft-out--99.8%
Simplified99.8%
flip--65.2%
associate-*r/59.7%
swap-sqr59.7%
pow-prod-up59.7%
metadata-eval59.7%
metadata-eval59.7%
fma-def59.7%
Applied egg-rr59.7%
associate-/l*65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in im around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 1.45000000000000012e-29 < im < 7.1999999999999997e59Initial program 74.4%
Taylor expanded in im around 0 29.6%
mul-1-neg29.6%
*-commutative29.6%
distribute-rgt-neg-in29.6%
Simplified29.6%
Taylor expanded in re around 0 55.7%
associate-*r*55.7%
associate-*r*55.7%
distribute-rgt-out73.9%
mul-1-neg73.9%
*-commutative73.9%
Simplified73.9%
Final simplification94.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (log1p (expm1 (* re -1.5))))
(t_1 (* re (- (* (pow im 3.0) -0.16666666666666666) im))))
(if (<= im -4.9e+202)
t_1
(if (<= im -4.7e+155)
t_0
(if (<= im -5e+96)
t_1
(if (<= im -420000000.0)
t_0
(if (<= im 1.45e-29)
(/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
(if (<= im 8e+69)
(* im (- (* (pow re 3.0) 0.16666666666666666) re))
t_1))))))))
double code(double re, double im) {
double t_0 = log1p(expm1((re * -1.5)));
double t_1 = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -4.9e+202) {
tmp = t_1;
} else if (im <= -4.7e+155) {
tmp = t_0;
} else if (im <= -5e+96) {
tmp = t_1;
} else if (im <= -420000000.0) {
tmp = t_0;
} else if (im <= 1.45e-29) {
tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 8e+69) {
tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = Math.log1p(Math.expm1((re * -1.5)));
double t_1 = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -4.9e+202) {
tmp = t_1;
} else if (im <= -4.7e+155) {
tmp = t_0;
} else if (im <= -5e+96) {
tmp = t_1;
} else if (im <= -420000000.0) {
tmp = t_0;
} else if (im <= 1.45e-29) {
tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 8e+69) {
tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = math.log1p(math.expm1((re * -1.5))) t_1 = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im) tmp = 0 if im <= -4.9e+202: tmp = t_1 elif im <= -4.7e+155: tmp = t_0 elif im <= -5e+96: tmp = t_1 elif im <= -420000000.0: tmp = t_0 elif im <= 1.45e-29: tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im)) elif im <= 8e+69: tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re) else: tmp = t_1 return tmp
function code(re, im) t_0 = log1p(expm1(Float64(re * -1.5))) t_1 = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) tmp = 0.0 if (im <= -4.9e+202) tmp = t_1; elseif (im <= -4.7e+155) tmp = t_0; elseif (im <= -5e+96) tmp = t_1; elseif (im <= -420000000.0) tmp = t_0; elseif (im <= 1.45e-29) tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im))); elseif (im <= 8e+69) tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re)); else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[Log[1 + N[(Exp[N[(re * -1.5), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4.9e+202], t$95$1, If[LessEqual[im, -4.7e+155], t$95$0, If[LessEqual[im, -5e+96], t$95$1, If[LessEqual[im, -420000000.0], t$95$0, If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8e+69], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\
t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -4.9 \cdot 10^{+202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -4.7 \cdot 10^{+155}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -5 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\
\mathbf{elif}\;im \leq 8 \cdot 10^{+69}:\\
\;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -4.9e202 or -4.70000000000000019e155 < im < -5.0000000000000004e96 or 8.0000000000000006e69 < im Initial program 100.0%
Taylor expanded in im around 0 89.5%
mul-1-neg89.5%
unsub-neg89.5%
*-commutative89.5%
associate-*l*89.5%
distribute-lft-out--89.5%
Simplified89.5%
Taylor expanded in re around 0 73.9%
if -4.9e202 < im < -4.70000000000000019e155 or -5.0000000000000004e96 < im < -4.2e8Initial program 100.0%
Taylor expanded in re around 0 46.9%
Applied egg-rr3.4%
log1p-expm1-u53.6%
associate-*r*53.6%
metadata-eval53.6%
Applied egg-rr53.6%
if -4.2e8 < im < 1.45000000000000012e-29Initial program 27.6%
Taylor expanded in im around 0 99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
associate-*l*99.0%
distribute-lft-out--99.0%
Simplified99.0%
flip--64.6%
associate-*r/59.2%
swap-sqr59.2%
pow-prod-up59.2%
metadata-eval59.2%
metadata-eval59.2%
fma-def59.2%
Applied egg-rr59.2%
associate-/l*64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in im around 0 98.7%
*-commutative98.7%
Simplified98.7%
if 1.45000000000000012e-29 < im < 8.0000000000000006e69Initial program 79.9%
Taylor expanded in im around 0 23.9%
mul-1-neg23.9%
*-commutative23.9%
distribute-rgt-neg-in23.9%
Simplified23.9%
Taylor expanded in re around 0 44.4%
associate-*r*44.4%
associate-*r*44.4%
distribute-rgt-out58.7%
mul-1-neg58.7%
*-commutative58.7%
Simplified58.7%
Final simplification81.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* im (pow re 3.0))))
(t_1 (* re (- (* (pow im 3.0) -0.16666666666666666) im))))
(if (<= im -4.5e+202)
t_1
(if (<= im -1e+157)
t_0
(if (<= im -8e+93)
t_1
(if (<= im -420000000.0)
t_0
(if (<= im 700.0)
(* (- im) (sin re))
(if (<= im 1.45e+68) t_0 t_1))))))))
double code(double re, double im) {
double t_0 = 0.16666666666666666 * (im * pow(re, 3.0));
double t_1 = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -4.5e+202) {
tmp = t_1;
} else if (im <= -1e+157) {
tmp = t_0;
} else if (im <= -8e+93) {
tmp = t_1;
} else if (im <= -420000000.0) {
tmp = t_0;
} else if (im <= 700.0) {
tmp = -im * sin(re);
} else if (im <= 1.45e+68) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (im * (re ** 3.0d0))
t_1 = re * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
if (im <= (-4.5d+202)) then
tmp = t_1
else if (im <= (-1d+157)) then
tmp = t_0
else if (im <= (-8d+93)) then
tmp = t_1
else if (im <= (-420000000.0d0)) then
tmp = t_0
else if (im <= 700.0d0) then
tmp = -im * sin(re)
else if (im <= 1.45d+68) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.16666666666666666 * (im * Math.pow(re, 3.0));
double t_1 = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -4.5e+202) {
tmp = t_1;
} else if (im <= -1e+157) {
tmp = t_0;
} else if (im <= -8e+93) {
tmp = t_1;
} else if (im <= -420000000.0) {
tmp = t_0;
} else if (im <= 700.0) {
tmp = -im * Math.sin(re);
} else if (im <= 1.45e+68) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 0.16666666666666666 * (im * math.pow(re, 3.0)) t_1 = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im) tmp = 0 if im <= -4.5e+202: tmp = t_1 elif im <= -1e+157: tmp = t_0 elif im <= -8e+93: tmp = t_1 elif im <= -420000000.0: tmp = t_0 elif im <= 700.0: tmp = -im * math.sin(re) elif im <= 1.45e+68: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(0.16666666666666666 * Float64(im * (re ^ 3.0))) t_1 = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) tmp = 0.0 if (im <= -4.5e+202) tmp = t_1; elseif (im <= -1e+157) tmp = t_0; elseif (im <= -8e+93) tmp = t_1; elseif (im <= -420000000.0) tmp = t_0; elseif (im <= 700.0) tmp = Float64(Float64(-im) * sin(re)); elseif (im <= 1.45e+68) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.16666666666666666 * (im * (re ^ 3.0)); t_1 = re * (((im ^ 3.0) * -0.16666666666666666) - im); tmp = 0.0; if (im <= -4.5e+202) tmp = t_1; elseif (im <= -1e+157) tmp = t_0; elseif (im <= -8e+93) tmp = t_1; elseif (im <= -420000000.0) tmp = t_0; elseif (im <= 700.0) tmp = -im * sin(re); elseif (im <= 1.45e+68) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(im * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4.5e+202], t$95$1, If[LessEqual[im, -1e+157], t$95$0, If[LessEqual[im, -8e+93], t$95$1, If[LessEqual[im, -420000000.0], t$95$0, If[LessEqual[im, 700.0], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.45e+68], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\
t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -4.5 \cdot 10^{+202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -8 \cdot 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 700:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{+68}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -4.49999999999999978e202 or -9.99999999999999983e156 < im < -8.00000000000000035e93 or 1.45000000000000006e68 < im Initial program 100.0%
Taylor expanded in im around 0 89.5%
mul-1-neg89.5%
unsub-neg89.5%
*-commutative89.5%
associate-*l*89.5%
distribute-lft-out--89.5%
Simplified89.5%
Taylor expanded in re around 0 73.9%
if -4.49999999999999978e202 < im < -9.99999999999999983e156 or -8.00000000000000035e93 < im < -4.2e8 or 700 < im < 1.45000000000000006e68Initial program 100.0%
Taylor expanded in im around 0 3.5%
mul-1-neg3.5%
*-commutative3.5%
distribute-rgt-neg-in3.5%
Simplified3.5%
Taylor expanded in re around 0 25.2%
associate-*r*25.2%
associate-*r*25.2%
distribute-rgt-out43.8%
mul-1-neg43.8%
*-commutative43.8%
Simplified43.8%
Taylor expanded in re around inf 43.3%
if -4.2e8 < im < 700Initial program 27.1%
Taylor expanded in im around 0 98.6%
mul-1-neg98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Final simplification79.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (- (* (pow re 3.0) 0.16666666666666666) re)))
(t_1 (* re (- (* (pow im 3.0) -0.16666666666666666) im))))
(if (<= im -1.2e+207)
t_1
(if (<= im -1e+157)
t_0
(if (<= im -4e+97)
t_1
(if (<= im -420000000.0)
t_0
(if (<= im 1.45e-29)
(* (- im) (sin re))
(if (<= im 1.85e+70) t_0 t_1))))))))
double code(double re, double im) {
double t_0 = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
double t_1 = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -1.2e+207) {
tmp = t_1;
} else if (im <= -1e+157) {
tmp = t_0;
} else if (im <= -4e+97) {
tmp = t_1;
} else if (im <= -420000000.0) {
tmp = t_0;
} else if (im <= 1.45e-29) {
tmp = -im * sin(re);
} else if (im <= 1.85e+70) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
t_1 = re * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
if (im <= (-1.2d+207)) then
tmp = t_1
else if (im <= (-1d+157)) then
tmp = t_0
else if (im <= (-4d+97)) then
tmp = t_1
else if (im <= (-420000000.0d0)) then
tmp = t_0
else if (im <= 1.45d-29) then
tmp = -im * sin(re)
else if (im <= 1.85d+70) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
double t_1 = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -1.2e+207) {
tmp = t_1;
} else if (im <= -1e+157) {
tmp = t_0;
} else if (im <= -4e+97) {
tmp = t_1;
} else if (im <= -420000000.0) {
tmp = t_0;
} else if (im <= 1.45e-29) {
tmp = -im * Math.sin(re);
} else if (im <= 1.85e+70) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re) t_1 = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im) tmp = 0 if im <= -1.2e+207: tmp = t_1 elif im <= -1e+157: tmp = t_0 elif im <= -4e+97: tmp = t_1 elif im <= -420000000.0: tmp = t_0 elif im <= 1.45e-29: tmp = -im * math.sin(re) elif im <= 1.85e+70: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re)) t_1 = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) tmp = 0.0 if (im <= -1.2e+207) tmp = t_1; elseif (im <= -1e+157) tmp = t_0; elseif (im <= -4e+97) tmp = t_1; elseif (im <= -420000000.0) tmp = t_0; elseif (im <= 1.45e-29) tmp = Float64(Float64(-im) * sin(re)); elseif (im <= 1.85e+70) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = im * (((re ^ 3.0) * 0.16666666666666666) - re); t_1 = re * (((im ^ 3.0) * -0.16666666666666666) - im); tmp = 0.0; if (im <= -1.2e+207) tmp = t_1; elseif (im <= -1e+157) tmp = t_0; elseif (im <= -4e+97) tmp = t_1; elseif (im <= -420000000.0) tmp = t_0; elseif (im <= 1.45e-29) tmp = -im * sin(re); elseif (im <= 1.85e+70) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.2e+207], t$95$1, If[LessEqual[im, -1e+157], t$95$0, If[LessEqual[im, -4e+97], t$95$1, If[LessEqual[im, -420000000.0], t$95$0, If[LessEqual[im, 1.45e-29], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.85e+70], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -1.2 \cdot 10^{+207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -4 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\mathbf{elif}\;im \leq 1.85 \cdot 10^{+70}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.2e207 or -9.99999999999999983e156 < im < -4.0000000000000003e97 or 1.84999999999999994e70 < im Initial program 100.0%
Taylor expanded in im around 0 89.5%
mul-1-neg89.5%
unsub-neg89.5%
*-commutative89.5%
associate-*l*89.5%
distribute-lft-out--89.5%
Simplified89.5%
Taylor expanded in re around 0 73.9%
if -1.2e207 < im < -9.99999999999999983e156 or -4.0000000000000003e97 < im < -4.2e8 or 1.45000000000000012e-29 < im < 1.84999999999999994e70Initial program 93.9%
Taylor expanded in im around 0 9.8%
mul-1-neg9.8%
*-commutative9.8%
distribute-rgt-neg-in9.8%
Simplified9.8%
Taylor expanded in re around 0 30.1%
associate-*r*30.1%
associate-*r*30.1%
distribute-rgt-out47.5%
mul-1-neg47.5%
*-commutative47.5%
Simplified47.5%
if -4.2e8 < im < 1.45000000000000012e-29Initial program 27.6%
Taylor expanded in im around 0 98.6%
mul-1-neg98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Final simplification80.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (- (* (pow re 3.0) 0.16666666666666666) re)))
(t_1 (* re (- (* (pow im 3.0) -0.16666666666666666) im))))
(if (<= im -3.1e+203)
t_1
(if (<= im -1e+157)
t_0
(if (<= im -7.7e+93)
t_1
(if (<= im -2.4)
t_0
(if (<= im 1.45e-29)
(/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
(if (<= im 7.6e+68) t_0 t_1))))))))
double code(double re, double im) {
double t_0 = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
double t_1 = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -3.1e+203) {
tmp = t_1;
} else if (im <= -1e+157) {
tmp = t_0;
} else if (im <= -7.7e+93) {
tmp = t_1;
} else if (im <= -2.4) {
tmp = t_0;
} else if (im <= 1.45e-29) {
tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 7.6e+68) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
t_1 = re * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
if (im <= (-3.1d+203)) then
tmp = t_1
else if (im <= (-1d+157)) then
tmp = t_0
else if (im <= (-7.7d+93)) then
tmp = t_1
else if (im <= (-2.4d0)) then
tmp = t_0
else if (im <= 1.45d-29) then
tmp = sin(re) / ((im * 0.16666666666666666d0) + ((-1.0d0) / im))
else if (im <= 7.6d+68) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
double t_1 = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -3.1e+203) {
tmp = t_1;
} else if (im <= -1e+157) {
tmp = t_0;
} else if (im <= -7.7e+93) {
tmp = t_1;
} else if (im <= -2.4) {
tmp = t_0;
} else if (im <= 1.45e-29) {
tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
} else if (im <= 7.6e+68) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re) t_1 = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im) tmp = 0 if im <= -3.1e+203: tmp = t_1 elif im <= -1e+157: tmp = t_0 elif im <= -7.7e+93: tmp = t_1 elif im <= -2.4: tmp = t_0 elif im <= 1.45e-29: tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im)) elif im <= 7.6e+68: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re)) t_1 = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) tmp = 0.0 if (im <= -3.1e+203) tmp = t_1; elseif (im <= -1e+157) tmp = t_0; elseif (im <= -7.7e+93) tmp = t_1; elseif (im <= -2.4) tmp = t_0; elseif (im <= 1.45e-29) tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im))); elseif (im <= 7.6e+68) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = im * (((re ^ 3.0) * 0.16666666666666666) - re); t_1 = re * (((im ^ 3.0) * -0.16666666666666666) - im); tmp = 0.0; if (im <= -3.1e+203) tmp = t_1; elseif (im <= -1e+157) tmp = t_0; elseif (im <= -7.7e+93) tmp = t_1; elseif (im <= -2.4) tmp = t_0; elseif (im <= 1.45e-29) tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im)); elseif (im <= 7.6e+68) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -3.1e+203], t$95$1, If[LessEqual[im, -1e+157], t$95$0, If[LessEqual[im, -7.7e+93], t$95$1, If[LessEqual[im, -2.4], t$95$0, If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.6e+68], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -3.1 \cdot 10^{+203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -7.7 \cdot 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -2.4:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\
\mathbf{elif}\;im \leq 7.6 \cdot 10^{+68}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -3.1e203 or -9.99999999999999983e156 < im < -7.70000000000000004e93 or 7.6000000000000002e68 < im Initial program 100.0%
Taylor expanded in im around 0 89.5%
mul-1-neg89.5%
unsub-neg89.5%
*-commutative89.5%
associate-*l*89.5%
distribute-lft-out--89.5%
Simplified89.5%
Taylor expanded in re around 0 73.9%
if -3.1e203 < im < -9.99999999999999983e156 or -7.70000000000000004e93 < im < -2.39999999999999991 or 1.45000000000000012e-29 < im < 7.6000000000000002e68Initial program 94.0%
Taylor expanded in im around 0 9.7%
mul-1-neg9.7%
*-commutative9.7%
distribute-rgt-neg-in9.7%
Simplified9.7%
Taylor expanded in re around 0 29.5%
associate-*r*29.5%
associate-*r*29.5%
distribute-rgt-out46.5%
mul-1-neg46.5%
*-commutative46.5%
Simplified46.5%
if -2.39999999999999991 < im < 1.45000000000000012e-29Initial program 27.0%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*l*99.8%
distribute-lft-out--99.8%
Simplified99.8%
flip--65.2%
associate-*r/59.7%
swap-sqr59.7%
pow-prod-up59.7%
metadata-eval59.7%
metadata-eval59.7%
fma-def59.7%
Applied egg-rr59.7%
associate-/l*65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in im around 0 99.6%
*-commutative99.6%
Simplified99.6%
Final simplification80.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (pow re 3.0)))
(t_1 (* -0.16666666666666666 t_0))
(t_2 (* 0.16666666666666666 t_0)))
(if (<= im -3.2e+215)
t_1
(if (<= im -420000000.0)
t_2
(if (<= im 420.0) (* (- im) (sin re)) (if (<= im 4.1e+125) t_2 t_1))))))
double code(double re, double im) {
double t_0 = im * pow(re, 3.0);
double t_1 = -0.16666666666666666 * t_0;
double t_2 = 0.16666666666666666 * t_0;
double tmp;
if (im <= -3.2e+215) {
tmp = t_1;
} else if (im <= -420000000.0) {
tmp = t_2;
} else if (im <= 420.0) {
tmp = -im * sin(re);
} else if (im <= 4.1e+125) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = im * (re ** 3.0d0)
t_1 = (-0.16666666666666666d0) * t_0
t_2 = 0.16666666666666666d0 * t_0
if (im <= (-3.2d+215)) then
tmp = t_1
else if (im <= (-420000000.0d0)) then
tmp = t_2
else if (im <= 420.0d0) then
tmp = -im * sin(re)
else if (im <= 4.1d+125) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * Math.pow(re, 3.0);
double t_1 = -0.16666666666666666 * t_0;
double t_2 = 0.16666666666666666 * t_0;
double tmp;
if (im <= -3.2e+215) {
tmp = t_1;
} else if (im <= -420000000.0) {
tmp = t_2;
} else if (im <= 420.0) {
tmp = -im * Math.sin(re);
} else if (im <= 4.1e+125) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = im * math.pow(re, 3.0) t_1 = -0.16666666666666666 * t_0 t_2 = 0.16666666666666666 * t_0 tmp = 0 if im <= -3.2e+215: tmp = t_1 elif im <= -420000000.0: tmp = t_2 elif im <= 420.0: tmp = -im * math.sin(re) elif im <= 4.1e+125: tmp = t_2 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(im * (re ^ 3.0)) t_1 = Float64(-0.16666666666666666 * t_0) t_2 = Float64(0.16666666666666666 * t_0) tmp = 0.0 if (im <= -3.2e+215) tmp = t_1; elseif (im <= -420000000.0) tmp = t_2; elseif (im <= 420.0) tmp = Float64(Float64(-im) * sin(re)); elseif (im <= 4.1e+125) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = im * (re ^ 3.0); t_1 = -0.16666666666666666 * t_0; t_2 = 0.16666666666666666 * t_0; tmp = 0.0; if (im <= -3.2e+215) tmp = t_1; elseif (im <= -420000000.0) tmp = t_2; elseif (im <= 420.0) tmp = -im * sin(re); elseif (im <= 4.1e+125) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.16666666666666666 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(0.16666666666666666 * t$95$0), $MachinePrecision]}, If[LessEqual[im, -3.2e+215], t$95$1, If[LessEqual[im, -420000000.0], t$95$2, If[LessEqual[im, 420.0], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.1e+125], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot {re}^{3}\\
t_1 := -0.16666666666666666 \cdot t_0\\
t_2 := 0.16666666666666666 \cdot t_0\\
\mathbf{if}\;im \leq -3.2 \cdot 10^{+215}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;im \leq 420:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\mathbf{elif}\;im \leq 4.1 \cdot 10^{+125}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -3.1999999999999999e215 or 4.09999999999999992e125 < im Initial program 100.0%
Taylor expanded in im around 0 5.3%
mul-1-neg5.3%
*-commutative5.3%
distribute-rgt-neg-in5.3%
Simplified5.3%
Taylor expanded in re around 0 6.6%
associate-*r*6.6%
associate-*r*6.6%
distribute-rgt-out18.3%
mul-1-neg18.3%
*-commutative18.3%
Simplified18.3%
add-sqr-sqrt10.3%
sqrt-unprod24.1%
*-commutative24.1%
*-commutative24.1%
swap-sqr24.1%
metadata-eval24.1%
pow-prod-up24.1%
metadata-eval24.1%
Applied egg-rr24.1%
Taylor expanded in re around -inf 30.6%
if -3.1999999999999999e215 < im < -4.2e8 or 420 < im < 4.09999999999999992e125Initial program 100.0%
Taylor expanded in im around 0 3.5%
mul-1-neg3.5%
*-commutative3.5%
distribute-rgt-neg-in3.5%
Simplified3.5%
Taylor expanded in re around 0 17.0%
associate-*r*17.0%
associate-*r*17.0%
distribute-rgt-out32.1%
mul-1-neg32.1%
*-commutative32.1%
Simplified32.1%
Taylor expanded in re around inf 31.5%
if -4.2e8 < im < 420Initial program 27.1%
Taylor expanded in im around 0 98.6%
mul-1-neg98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Final simplification61.4%
(FPCore (re im) :precision binary64 (if (or (<= im -1.4e+30) (not (<= im 8.2e+73))) (* -0.16666666666666666 (* im (pow re 3.0))) (* (- im) (sin re))))
double code(double re, double im) {
double tmp;
if ((im <= -1.4e+30) || !(im <= 8.2e+73)) {
tmp = -0.16666666666666666 * (im * pow(re, 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.4d+30)) .or. (.not. (im <= 8.2d+73))) then
tmp = (-0.16666666666666666d0) * (im * (re ** 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.4e+30) || !(im <= 8.2e+73)) {
tmp = -0.16666666666666666 * (im * Math.pow(re, 3.0));
} else {
tmp = -im * Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -1.4e+30) or not (im <= 8.2e+73): tmp = -0.16666666666666666 * (im * math.pow(re, 3.0)) else: tmp = -im * math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -1.4e+30) || !(im <= 8.2e+73)) tmp = Float64(-0.16666666666666666 * Float64(im * (re ^ 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.4e+30) || ~((im <= 8.2e+73))) tmp = -0.16666666666666666 * (im * (re ^ 3.0)); else tmp = -im * sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -1.4e+30], N[Not[LessEqual[im, 8.2e+73]], $MachinePrecision]], N[(-0.16666666666666666 * N[(im * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1.4 \cdot 10^{+30} \lor \neg \left(im \leq 8.2 \cdot 10^{+73}\right):\\
\;\;\;\;-0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\end{array}
\end{array}
if im < -1.39999999999999992e30 or 8.1999999999999996e73 < im Initial program 100.0%
Taylor expanded in im around 0 4.6%
mul-1-neg4.6%
*-commutative4.6%
distribute-rgt-neg-in4.6%
Simplified4.6%
Taylor expanded in re around 0 10.1%
associate-*r*10.1%
associate-*r*10.1%
distribute-rgt-out23.9%
mul-1-neg23.9%
*-commutative23.9%
Simplified23.9%
add-sqr-sqrt13.6%
sqrt-unprod24.6%
*-commutative24.6%
*-commutative24.6%
swap-sqr24.6%
metadata-eval24.6%
pow-prod-up24.6%
metadata-eval24.6%
Applied egg-rr24.6%
Taylor expanded in re around -inf 23.9%
if -1.39999999999999992e30 < im < 8.1999999999999996e73Initial program 36.9%
Taylor expanded in im around 0 85.7%
mul-1-neg85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
Simplified85.7%
Final simplification56.0%
(FPCore (re im) :precision binary64 (if (<= im -1e+98) (* im (- re)) (if (<= im 5e+127) (* (- im) (sin re)) (* 0.5 (* re (* im -2.0))))))
double code(double re, double im) {
double tmp;
if (im <= -1e+98) {
tmp = im * -re;
} else if (im <= 5e+127) {
tmp = -im * sin(re);
} else {
tmp = 0.5 * (re * (im * -2.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-1d+98)) then
tmp = im * -re
else if (im <= 5d+127) then
tmp = -im * sin(re)
else
tmp = 0.5d0 * (re * (im * (-2.0d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -1e+98) {
tmp = im * -re;
} else if (im <= 5e+127) {
tmp = -im * Math.sin(re);
} else {
tmp = 0.5 * (re * (im * -2.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -1e+98: tmp = im * -re elif im <= 5e+127: tmp = -im * math.sin(re) else: tmp = 0.5 * (re * (im * -2.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= -1e+98) tmp = Float64(im * Float64(-re)); elseif (im <= 5e+127) tmp = Float64(Float64(-im) * sin(re)); else tmp = Float64(0.5 * Float64(re * Float64(im * -2.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -1e+98) tmp = im * -re; elseif (im <= 5e+127) tmp = -im * sin(re); else tmp = 0.5 * (re * (im * -2.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -1e+98], N[(im * (-re)), $MachinePrecision], If[LessEqual[im, 5e+127], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(im * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1 \cdot 10^{+98}:\\
\;\;\;\;im \cdot \left(-re\right)\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+127}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot -2\right)\right)\\
\end{array}
\end{array}
if im < -9.99999999999999998e97Initial program 100.0%
Taylor expanded in im around 0 5.1%
mul-1-neg5.1%
*-commutative5.1%
distribute-rgt-neg-in5.1%
Simplified5.1%
Taylor expanded in re around 0 19.4%
mul-1-neg19.4%
*-commutative19.4%
distribute-rgt-neg-in19.4%
Simplified19.4%
if -9.99999999999999998e97 < im < 5.0000000000000004e127Initial program 48.2%
Taylor expanded in im around 0 70.9%
mul-1-neg70.9%
*-commutative70.9%
distribute-rgt-neg-in70.9%
Simplified70.9%
if 5.0000000000000004e127 < im Initial program 100.0%
Taylor expanded in re around 0 80.9%
Taylor expanded in im around 0 25.9%
Final simplification53.2%
(FPCore (re im) :precision binary64 (* 0.5 (* re (* im -2.0))))
double code(double re, double im) {
return 0.5 * (re * (im * -2.0));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.5d0 * (re * (im * (-2.0d0)))
end function
public static double code(double re, double im) {
return 0.5 * (re * (im * -2.0));
}
def code(re, im): return 0.5 * (re * (im * -2.0))
function code(re, im) return Float64(0.5 * Float64(re * Float64(im * -2.0))) end
function tmp = code(re, im) tmp = 0.5 * (re * (im * -2.0)); end
code[re_, im_] := N[(0.5 * N[(re * N[(im * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(re \cdot \left(im \cdot -2\right)\right)
\end{array}
Initial program 67.2%
Taylor expanded in re around 0 50.5%
Taylor expanded in im around 0 30.8%
Final simplification30.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 67.2%
Taylor expanded in im around 0 46.7%
mul-1-neg46.7%
*-commutative46.7%
distribute-rgt-neg-in46.7%
Simplified46.7%
Taylor expanded in re around 0 30.5%
mul-1-neg30.5%
*-commutative30.5%
distribute-rgt-neg-in30.5%
Simplified30.5%
Final simplification30.5%
(FPCore (re im) :precision binary64 (* re -1.5))
double code(double re, double im) {
return re * -1.5;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (-1.5d0)
end function
public static double code(double re, double im) {
return re * -1.5;
}
def code(re, im): return re * -1.5
function code(re, im) return Float64(re * -1.5) end
function tmp = code(re, im) tmp = re * -1.5; end
code[re_, im_] := N[(re * -1.5), $MachinePrecision]
\begin{array}{l}
\\
re \cdot -1.5
\end{array}
Initial program 67.2%
Taylor expanded in re around 0 50.5%
Applied egg-rr2.9%
Taylor expanded in re around 0 2.9%
*-commutative2.9%
Simplified2.9%
Final simplification2.9%
(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 2023196
(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))))