
(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 15 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 1e-6)))
(* t_0 (* 0.5 (sin re)))
(- (* -0.16666666666666666 (* (sin re) (pow im 3.0))) (* 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 <= 1e-6)) {
tmp = t_0 * (0.5 * sin(re));
} else {
tmp = (-0.16666666666666666 * (sin(re) * pow(im, 3.0))) - (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 <= 1e-6)) {
tmp = t_0 * (0.5 * Math.sin(re));
} else {
tmp = (-0.16666666666666666 * (Math.sin(re) * Math.pow(im, 3.0))) - (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 <= 1e-6): tmp = t_0 * (0.5 * math.sin(re)) else: tmp = (-0.16666666666666666 * (math.sin(re) * math.pow(im, 3.0))) - (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 <= 1e-6)) tmp = Float64(t_0 * Float64(0.5 * sin(re))); else tmp = Float64(Float64(-0.16666666666666666 * Float64(sin(re) * (im ^ 3.0))) - 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 <= 1e-6))) tmp = t_0 * (0.5 * sin(re)); else tmp = (-0.16666666666666666 * (sin(re) * (im ^ 3.0))) - (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, 1e-6]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.16666666666666666 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(im * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{-6}\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - im \cdot \sin re\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 9.99999999999999955e-7 < (-.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)) < 9.99999999999999955e-7Initial program 33.4%
*-commutative33.4%
associate-*l*33.4%
sub-neg33.4%
+-commutative33.4%
distribute-rgt-in33.4%
distribute-lft-neg-out33.4%
distribute-rgt-neg-in33.4%
metadata-eval33.4%
metadata-eval33.4%
fma-def33.4%
metadata-eval33.4%
exp-neg33.3%
associate-*l/33.3%
metadata-eval33.3%
Simplified33.3%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
*-commutative99.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 1e-6)))
(* t_0 (* 0.5 (sin re)))
(* (sin re) (- (* -0.16666666666666666 (pow im 3.0)) im)))))
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 1e-6)) {
tmp = t_0 * (0.5 * sin(re));
} else {
tmp = sin(re) * ((-0.16666666666666666 * pow(im, 3.0)) - 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 <= 1e-6)) {
tmp = t_0 * (0.5 * Math.sin(re));
} else {
tmp = Math.sin(re) * ((-0.16666666666666666 * Math.pow(im, 3.0)) - 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 <= 1e-6): tmp = t_0 * (0.5 * math.sin(re)) else: tmp = math.sin(re) * ((-0.16666666666666666 * math.pow(im, 3.0)) - 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 <= 1e-6)) tmp = Float64(t_0 * Float64(0.5 * sin(re))); else tmp = Float64(sin(re) * Float64(Float64(-0.16666666666666666 * (im ^ 3.0)) - 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 <= 1e-6))) tmp = t_0 * (0.5 * sin(re)); else tmp = sin(re) * ((-0.16666666666666666 * (im ^ 3.0)) - 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, 1e-6]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(-0.16666666666666666 * N[Power[im, 3.0], $MachinePrecision]), $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 10^{-6}\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(-0.16666666666666666 \cdot {im}^{3} - im\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 9.99999999999999955e-7 < (-.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)) < 9.99999999999999955e-7Initial program 33.4%
*-commutative33.4%
associate-*l*33.4%
sub-neg33.4%
+-commutative33.4%
distribute-rgt-in33.4%
distribute-lft-neg-out33.4%
distribute-rgt-neg-in33.4%
metadata-eval33.4%
metadata-eval33.4%
fma-def33.4%
metadata-eval33.4%
exp-neg33.3%
associate-*l/33.3%
metadata-eval33.3%
Simplified33.3%
Taylor expanded in im around 0 99.8%
neg-mul-199.8%
unsub-neg99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
re
(*
(- (exp (- im)) (exp im))
(+ 0.5 (* -0.08333333333333333 (* re re))))))
(t_1 (* -0.16666666666666666 (* (sin re) (pow im 3.0)))))
(if (<= im -8e+91)
t_1
(if (<= im -0.34)
t_0
(if (<= im 0.032)
(* (sin re) (- (* -0.16666666666666666 (pow im 3.0)) im))
(if (<= im 5.6e+102) t_0 t_1))))))
double code(double re, double im) {
double t_0 = re * ((exp(-im) - exp(im)) * (0.5 + (-0.08333333333333333 * (re * re))));
double t_1 = -0.16666666666666666 * (sin(re) * pow(im, 3.0));
double tmp;
if (im <= -8e+91) {
tmp = t_1;
} else if (im <= -0.34) {
tmp = t_0;
} else if (im <= 0.032) {
tmp = sin(re) * ((-0.16666666666666666 * pow(im, 3.0)) - im);
} else if (im <= 5.6e+102) {
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 = re * ((exp(-im) - exp(im)) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
t_1 = (-0.16666666666666666d0) * (sin(re) * (im ** 3.0d0))
if (im <= (-8d+91)) then
tmp = t_1
else if (im <= (-0.34d0)) then
tmp = t_0
else if (im <= 0.032d0) then
tmp = sin(re) * (((-0.16666666666666666d0) * (im ** 3.0d0)) - im)
else if (im <= 5.6d+102) 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 = re * ((Math.exp(-im) - Math.exp(im)) * (0.5 + (-0.08333333333333333 * (re * re))));
double t_1 = -0.16666666666666666 * (Math.sin(re) * Math.pow(im, 3.0));
double tmp;
if (im <= -8e+91) {
tmp = t_1;
} else if (im <= -0.34) {
tmp = t_0;
} else if (im <= 0.032) {
tmp = Math.sin(re) * ((-0.16666666666666666 * Math.pow(im, 3.0)) - im);
} else if (im <= 5.6e+102) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = re * ((math.exp(-im) - math.exp(im)) * (0.5 + (-0.08333333333333333 * (re * re)))) t_1 = -0.16666666666666666 * (math.sin(re) * math.pow(im, 3.0)) tmp = 0 if im <= -8e+91: tmp = t_1 elif im <= -0.34: tmp = t_0 elif im <= 0.032: tmp = math.sin(re) * ((-0.16666666666666666 * math.pow(im, 3.0)) - im) elif im <= 5.6e+102: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(re * Float64(Float64(exp(Float64(-im)) - exp(im)) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))) t_1 = Float64(-0.16666666666666666 * Float64(sin(re) * (im ^ 3.0))) tmp = 0.0 if (im <= -8e+91) tmp = t_1; elseif (im <= -0.34) tmp = t_0; elseif (im <= 0.032) tmp = Float64(sin(re) * Float64(Float64(-0.16666666666666666 * (im ^ 3.0)) - im)); elseif (im <= 5.6e+102) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = re * ((exp(-im) - exp(im)) * (0.5 + (-0.08333333333333333 * (re * re)))); t_1 = -0.16666666666666666 * (sin(re) * (im ^ 3.0)); tmp = 0.0; if (im <= -8e+91) tmp = t_1; elseif (im <= -0.34) tmp = t_0; elseif (im <= 0.032) tmp = sin(re) * ((-0.16666666666666666 * (im ^ 3.0)) - im); elseif (im <= 5.6e+102) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.16666666666666666 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -8e+91], t$95$1, If[LessEqual[im, -0.34], t$95$0, If[LessEqual[im, 0.032], N[(N[Sin[re], $MachinePrecision] * N[(N[(-0.16666666666666666 * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.6e+102], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(\left(e^{-im} - e^{im}\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
t_1 := -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\
\mathbf{if}\;im \leq -8 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -0.34:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 0.032:\\
\;\;\;\;\sin re \cdot \left(-0.16666666666666666 \cdot {im}^{3} - im\right)\\
\mathbf{elif}\;im \leq 5.6 \cdot 10^{+102}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -8.00000000000000064e91 or 5.60000000000000037e102 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in im around 0 98.9%
mul-1-neg98.9%
sub-neg98.9%
*-commutative98.9%
associate-*l*98.9%
*-commutative98.9%
distribute-lft-out--98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in im around inf 98.9%
*-commutative98.9%
Simplified98.9%
if -8.00000000000000064e91 < im < -0.340000000000000024 or 0.032000000000000001 < im < 5.60000000000000037e102Initial program 100.0%
Taylor expanded in re around 0 0.0%
associate-*r*0.0%
unpow30.0%
associate-*r*0.0%
associate-*r*0.0%
distribute-rgt-out0.0%
*-commutative0.0%
associate-*l*0.0%
*-commutative0.0%
distribute-lft-out81.6%
Simplified81.6%
if -0.340000000000000024 < im < 0.032000000000000001Initial program 33.4%
*-commutative33.4%
associate-*l*33.4%
sub-neg33.4%
+-commutative33.4%
distribute-rgt-in33.4%
distribute-lft-neg-out33.4%
distribute-rgt-neg-in33.4%
metadata-eval33.4%
metadata-eval33.4%
fma-def33.4%
metadata-eval33.4%
exp-neg33.3%
associate-*l/33.3%
metadata-eval33.3%
Simplified33.3%
Taylor expanded in im around 0 99.8%
neg-mul-199.8%
unsub-neg99.8%
Simplified99.8%
Final simplification96.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (* (- (exp (- im)) (exp im)) re)))
(t_1 (* -0.16666666666666666 (* (sin re) (pow im 3.0)))))
(if (<= im -7.5e+109)
t_1
(if (<= im -170000000.0)
t_0
(if (<= im 14000.0)
(* im (- (sin re)))
(if (<= im 9.5e+101) t_0 t_1))))))
double code(double re, double im) {
double t_0 = 0.5 * ((exp(-im) - exp(im)) * re);
double t_1 = -0.16666666666666666 * (sin(re) * pow(im, 3.0));
double tmp;
if (im <= -7.5e+109) {
tmp = t_1;
} else if (im <= -170000000.0) {
tmp = t_0;
} else if (im <= 14000.0) {
tmp = im * -sin(re);
} else if (im <= 9.5e+101) {
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.5d0 * ((exp(-im) - exp(im)) * re)
t_1 = (-0.16666666666666666d0) * (sin(re) * (im ** 3.0d0))
if (im <= (-7.5d+109)) then
tmp = t_1
else if (im <= (-170000000.0d0)) then
tmp = t_0
else if (im <= 14000.0d0) then
tmp = im * -sin(re)
else if (im <= 9.5d+101) 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.5 * ((Math.exp(-im) - Math.exp(im)) * re);
double t_1 = -0.16666666666666666 * (Math.sin(re) * Math.pow(im, 3.0));
double tmp;
if (im <= -7.5e+109) {
tmp = t_1;
} else if (im <= -170000000.0) {
tmp = t_0;
} else if (im <= 14000.0) {
tmp = im * -Math.sin(re);
} else if (im <= 9.5e+101) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * ((math.exp(-im) - math.exp(im)) * re) t_1 = -0.16666666666666666 * (math.sin(re) * math.pow(im, 3.0)) tmp = 0 if im <= -7.5e+109: tmp = t_1 elif im <= -170000000.0: tmp = t_0 elif im <= 14000.0: tmp = im * -math.sin(re) elif im <= 9.5e+101: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(Float64(exp(Float64(-im)) - exp(im)) * re)) t_1 = Float64(-0.16666666666666666 * Float64(sin(re) * (im ^ 3.0))) tmp = 0.0 if (im <= -7.5e+109) tmp = t_1; elseif (im <= -170000000.0) tmp = t_0; elseif (im <= 14000.0) tmp = Float64(im * Float64(-sin(re))); elseif (im <= 9.5e+101) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * ((exp(-im) - exp(im)) * re); t_1 = -0.16666666666666666 * (sin(re) * (im ^ 3.0)); tmp = 0.0; if (im <= -7.5e+109) tmp = t_1; elseif (im <= -170000000.0) tmp = t_0; elseif (im <= 14000.0) tmp = im * -sin(re); elseif (im <= 9.5e+101) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.16666666666666666 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.5e+109], t$95$1, If[LessEqual[im, -170000000.0], t$95$0, If[LessEqual[im, 14000.0], N[(im * (-N[Sin[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 9.5e+101], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\
t_1 := -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\
\mathbf{if}\;im \leq -7.5 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -170000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 14000:\\
\;\;\;\;im \cdot \left(-\sin re\right)\\
\mathbf{elif}\;im \leq 9.5 \cdot 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -7.50000000000000018e109 or 9.49999999999999947e101 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in im around 0 99.0%
mul-1-neg99.0%
sub-neg99.0%
*-commutative99.0%
associate-*l*99.0%
*-commutative99.0%
distribute-lft-out--99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in im around inf 99.0%
*-commutative99.0%
Simplified99.0%
if -7.50000000000000018e109 < im < -1.7e8 or 14000 < im < 9.49999999999999947e101Initial program 100.0%
Taylor expanded in re around 0 75.7%
if -1.7e8 < im < 14000Initial program 34.4%
*-commutative34.4%
associate-*l*34.4%
sub-neg34.4%
+-commutative34.4%
distribute-rgt-in34.4%
distribute-lft-neg-out34.4%
distribute-rgt-neg-in34.4%
metadata-eval34.4%
metadata-eval34.4%
fma-def34.4%
metadata-eval34.4%
exp-neg34.3%
associate-*l/34.3%
metadata-eval34.3%
Simplified34.3%
Taylor expanded in im around 0 98.3%
neg-mul-198.3%
Simplified98.3%
Final simplification95.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (* (- (exp (- im)) (exp im)) re)))
(t_1 (* -0.16666666666666666 (* (sin re) (pow im 3.0)))))
(if (<= im -7.5e+109)
t_1
(if (<= im -170000000.0)
t_0
(if (<= im 14000.0)
(* (sin re) (- (* -0.16666666666666666 (pow im 3.0)) im))
(if (<= im 9.5e+101) t_0 t_1))))))
double code(double re, double im) {
double t_0 = 0.5 * ((exp(-im) - exp(im)) * re);
double t_1 = -0.16666666666666666 * (sin(re) * pow(im, 3.0));
double tmp;
if (im <= -7.5e+109) {
tmp = t_1;
} else if (im <= -170000000.0) {
tmp = t_0;
} else if (im <= 14000.0) {
tmp = sin(re) * ((-0.16666666666666666 * pow(im, 3.0)) - im);
} else if (im <= 9.5e+101) {
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.5d0 * ((exp(-im) - exp(im)) * re)
t_1 = (-0.16666666666666666d0) * (sin(re) * (im ** 3.0d0))
if (im <= (-7.5d+109)) then
tmp = t_1
else if (im <= (-170000000.0d0)) then
tmp = t_0
else if (im <= 14000.0d0) then
tmp = sin(re) * (((-0.16666666666666666d0) * (im ** 3.0d0)) - im)
else if (im <= 9.5d+101) 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.5 * ((Math.exp(-im) - Math.exp(im)) * re);
double t_1 = -0.16666666666666666 * (Math.sin(re) * Math.pow(im, 3.0));
double tmp;
if (im <= -7.5e+109) {
tmp = t_1;
} else if (im <= -170000000.0) {
tmp = t_0;
} else if (im <= 14000.0) {
tmp = Math.sin(re) * ((-0.16666666666666666 * Math.pow(im, 3.0)) - im);
} else if (im <= 9.5e+101) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * ((math.exp(-im) - math.exp(im)) * re) t_1 = -0.16666666666666666 * (math.sin(re) * math.pow(im, 3.0)) tmp = 0 if im <= -7.5e+109: tmp = t_1 elif im <= -170000000.0: tmp = t_0 elif im <= 14000.0: tmp = math.sin(re) * ((-0.16666666666666666 * math.pow(im, 3.0)) - im) elif im <= 9.5e+101: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(Float64(exp(Float64(-im)) - exp(im)) * re)) t_1 = Float64(-0.16666666666666666 * Float64(sin(re) * (im ^ 3.0))) tmp = 0.0 if (im <= -7.5e+109) tmp = t_1; elseif (im <= -170000000.0) tmp = t_0; elseif (im <= 14000.0) tmp = Float64(sin(re) * Float64(Float64(-0.16666666666666666 * (im ^ 3.0)) - im)); elseif (im <= 9.5e+101) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * ((exp(-im) - exp(im)) * re); t_1 = -0.16666666666666666 * (sin(re) * (im ^ 3.0)); tmp = 0.0; if (im <= -7.5e+109) tmp = t_1; elseif (im <= -170000000.0) tmp = t_0; elseif (im <= 14000.0) tmp = sin(re) * ((-0.16666666666666666 * (im ^ 3.0)) - im); elseif (im <= 9.5e+101) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.16666666666666666 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.5e+109], t$95$1, If[LessEqual[im, -170000000.0], t$95$0, If[LessEqual[im, 14000.0], N[(N[Sin[re], $MachinePrecision] * N[(N[(-0.16666666666666666 * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 9.5e+101], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\
t_1 := -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\
\mathbf{if}\;im \leq -7.5 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -170000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 14000:\\
\;\;\;\;\sin re \cdot \left(-0.16666666666666666 \cdot {im}^{3} - im\right)\\
\mathbf{elif}\;im \leq 9.5 \cdot 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -7.50000000000000018e109 or 9.49999999999999947e101 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in im around 0 99.0%
mul-1-neg99.0%
sub-neg99.0%
*-commutative99.0%
associate-*l*99.0%
*-commutative99.0%
distribute-lft-out--99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in im around inf 99.0%
*-commutative99.0%
Simplified99.0%
if -7.50000000000000018e109 < im < -1.7e8 or 14000 < im < 9.49999999999999947e101Initial program 100.0%
Taylor expanded in re around 0 75.7%
if -1.7e8 < im < 14000Initial program 34.4%
*-commutative34.4%
associate-*l*34.4%
sub-neg34.4%
+-commutative34.4%
distribute-rgt-in34.4%
distribute-lft-neg-out34.4%
distribute-rgt-neg-in34.4%
metadata-eval34.4%
metadata-eval34.4%
fma-def34.4%
metadata-eval34.4%
exp-neg34.3%
associate-*l/34.3%
metadata-eval34.3%
Simplified34.3%
Taylor expanded in im around 0 98.4%
neg-mul-198.4%
unsub-neg98.4%
Simplified98.4%
Final simplification95.3%
(FPCore (re im) :precision binary64 (if (or (<= im -2.5) (not (<= im 2.5))) (* -0.16666666666666666 (* (sin re) (pow im 3.0))) (* im (- (sin re)))))
double code(double re, double im) {
double tmp;
if ((im <= -2.5) || !(im <= 2.5)) {
tmp = -0.16666666666666666 * (sin(re) * pow(im, 3.0));
} else {
tmp = im * -sin(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-2.5d0)) .or. (.not. (im <= 2.5d0))) then
tmp = (-0.16666666666666666d0) * (sin(re) * (im ** 3.0d0))
else
tmp = im * -sin(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -2.5) || !(im <= 2.5)) {
tmp = -0.16666666666666666 * (Math.sin(re) * Math.pow(im, 3.0));
} else {
tmp = im * -Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -2.5) or not (im <= 2.5): tmp = -0.16666666666666666 * (math.sin(re) * math.pow(im, 3.0)) else: tmp = im * -math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -2.5) || !(im <= 2.5)) tmp = Float64(-0.16666666666666666 * Float64(sin(re) * (im ^ 3.0))); else tmp = Float64(im * Float64(-sin(re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -2.5) || ~((im <= 2.5))) tmp = -0.16666666666666666 * (sin(re) * (im ^ 3.0)); else tmp = im * -sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -2.5], N[Not[LessEqual[im, 2.5]], $MachinePrecision]], N[(-0.16666666666666666 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * (-N[Sin[re], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -2.5 \lor \neg \left(im \leq 2.5\right):\\
\;\;\;\;-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(-\sin re\right)\\
\end{array}
\end{array}
if im < -2.5 or 2.5 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 69.7%
mul-1-neg69.7%
unsub-neg69.7%
*-commutative69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in im around 0 69.7%
mul-1-neg69.7%
sub-neg69.7%
*-commutative69.7%
associate-*l*69.7%
*-commutative69.7%
distribute-lft-out--69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in im around inf 69.7%
*-commutative69.7%
Simplified69.7%
if -2.5 < im < 2.5Initial program 33.4%
*-commutative33.4%
associate-*l*33.4%
sub-neg33.4%
+-commutative33.4%
distribute-rgt-in33.4%
distribute-lft-neg-out33.4%
distribute-rgt-neg-in33.4%
metadata-eval33.4%
metadata-eval33.4%
fma-def33.4%
metadata-eval33.4%
exp-neg33.3%
associate-*l/33.3%
metadata-eval33.3%
Simplified33.3%
Taylor expanded in im around 0 99.7%
neg-mul-199.7%
Simplified99.7%
Final simplification85.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* re (- (* -0.16666666666666666 (pow im 3.0)) im))))
(if (<= im -2.8e+50)
t_0
(if (<= im 2e+23)
(* im (- (sin re)))
(if (or (<= im 1.55e+272) (not (<= im 2.05e+288)))
t_0
(-
-1270932914164.5
(* im (+ re (* -0.16666666666666666 (pow re 3.0))))))))))
double code(double re, double im) {
double t_0 = re * ((-0.16666666666666666 * pow(im, 3.0)) - im);
double tmp;
if (im <= -2.8e+50) {
tmp = t_0;
} else if (im <= 2e+23) {
tmp = im * -sin(re);
} else if ((im <= 1.55e+272) || !(im <= 2.05e+288)) {
tmp = t_0;
} else {
tmp = -1270932914164.5 - (im * (re + (-0.16666666666666666 * pow(re, 3.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 = re * (((-0.16666666666666666d0) * (im ** 3.0d0)) - im)
if (im <= (-2.8d+50)) then
tmp = t_0
else if (im <= 2d+23) then
tmp = im * -sin(re)
else if ((im <= 1.55d+272) .or. (.not. (im <= 2.05d+288))) then
tmp = t_0
else
tmp = (-1270932914164.5d0) - (im * (re + ((-0.16666666666666666d0) * (re ** 3.0d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = re * ((-0.16666666666666666 * Math.pow(im, 3.0)) - im);
double tmp;
if (im <= -2.8e+50) {
tmp = t_0;
} else if (im <= 2e+23) {
tmp = im * -Math.sin(re);
} else if ((im <= 1.55e+272) || !(im <= 2.05e+288)) {
tmp = t_0;
} else {
tmp = -1270932914164.5 - (im * (re + (-0.16666666666666666 * Math.pow(re, 3.0))));
}
return tmp;
}
def code(re, im): t_0 = re * ((-0.16666666666666666 * math.pow(im, 3.0)) - im) tmp = 0 if im <= -2.8e+50: tmp = t_0 elif im <= 2e+23: tmp = im * -math.sin(re) elif (im <= 1.55e+272) or not (im <= 2.05e+288): tmp = t_0 else: tmp = -1270932914164.5 - (im * (re + (-0.16666666666666666 * math.pow(re, 3.0)))) return tmp
function code(re, im) t_0 = Float64(re * Float64(Float64(-0.16666666666666666 * (im ^ 3.0)) - im)) tmp = 0.0 if (im <= -2.8e+50) tmp = t_0; elseif (im <= 2e+23) tmp = Float64(im * Float64(-sin(re))); elseif ((im <= 1.55e+272) || !(im <= 2.05e+288)) tmp = t_0; else tmp = Float64(-1270932914164.5 - Float64(im * Float64(re + Float64(-0.16666666666666666 * (re ^ 3.0))))); end return tmp end
function tmp_2 = code(re, im) t_0 = re * ((-0.16666666666666666 * (im ^ 3.0)) - im); tmp = 0.0; if (im <= -2.8e+50) tmp = t_0; elseif (im <= 2e+23) tmp = im * -sin(re); elseif ((im <= 1.55e+272) || ~((im <= 2.05e+288))) tmp = t_0; else tmp = -1270932914164.5 - (im * (re + (-0.16666666666666666 * (re ^ 3.0)))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(N[(-0.16666666666666666 * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2.8e+50], t$95$0, If[LessEqual[im, 2e+23], N[(im * (-N[Sin[re], $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[im, 1.55e+272], N[Not[LessEqual[im, 2.05e+288]], $MachinePrecision]], t$95$0, N[(-1270932914164.5 - N[(im * N[(re + N[(-0.16666666666666666 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(-0.16666666666666666 \cdot {im}^{3} - im\right)\\
\mathbf{if}\;im \leq -2.8 \cdot 10^{+50}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 2 \cdot 10^{+23}:\\
\;\;\;\;im \cdot \left(-\sin re\right)\\
\mathbf{elif}\;im \leq 1.55 \cdot 10^{+272} \lor \neg \left(im \leq 2.05 \cdot 10^{+288}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-1270932914164.5 - im \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)\\
\end{array}
\end{array}
if im < -2.7999999999999998e50 or 1.9999999999999998e23 < im < 1.54999999999999986e272 or 2.0499999999999999e288 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 77.9%
mul-1-neg77.9%
unsub-neg77.9%
*-commutative77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in re around 0 63.7%
*-commutative63.7%
Simplified63.7%
if -2.7999999999999998e50 < im < 1.9999999999999998e23Initial program 40.1%
*-commutative40.1%
associate-*l*40.1%
sub-neg40.1%
+-commutative40.1%
distribute-rgt-in40.1%
distribute-lft-neg-out40.1%
distribute-rgt-neg-in40.1%
metadata-eval40.1%
metadata-eval40.1%
fma-def40.1%
metadata-eval40.1%
exp-neg40.0%
associate-*l/40.0%
metadata-eval40.0%
Simplified40.0%
Taylor expanded in im around 0 89.9%
neg-mul-189.9%
Simplified89.9%
if 1.54999999999999986e272 < im < 2.0499999999999999e288Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr8.3%
Taylor expanded in re around 0 81.9%
Final simplification79.2%
(FPCore (re im)
:precision binary64
(if (<= im -3.1e-7)
(* 0.5 (+ (* -0.3333333333333333 (* re (pow im 3.0))) (* -2.0 (* im re))))
(if (<= im 5.6e+24)
(* im (- (sin re)))
(if (or (<= im 1.55e+272) (not (<= im 1.22e+288)))
(* re (- (* -0.16666666666666666 (pow im 3.0)) im))
(-
-1270932914164.5
(* im (+ re (* -0.16666666666666666 (pow re 3.0)))))))))
double code(double re, double im) {
double tmp;
if (im <= -3.1e-7) {
tmp = 0.5 * ((-0.3333333333333333 * (re * pow(im, 3.0))) + (-2.0 * (im * re)));
} else if (im <= 5.6e+24) {
tmp = im * -sin(re);
} else if ((im <= 1.55e+272) || !(im <= 1.22e+288)) {
tmp = re * ((-0.16666666666666666 * pow(im, 3.0)) - im);
} else {
tmp = -1270932914164.5 - (im * (re + (-0.16666666666666666 * pow(re, 3.0))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-3.1d-7)) then
tmp = 0.5d0 * (((-0.3333333333333333d0) * (re * (im ** 3.0d0))) + ((-2.0d0) * (im * re)))
else if (im <= 5.6d+24) then
tmp = im * -sin(re)
else if ((im <= 1.55d+272) .or. (.not. (im <= 1.22d+288))) then
tmp = re * (((-0.16666666666666666d0) * (im ** 3.0d0)) - im)
else
tmp = (-1270932914164.5d0) - (im * (re + ((-0.16666666666666666d0) * (re ** 3.0d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -3.1e-7) {
tmp = 0.5 * ((-0.3333333333333333 * (re * Math.pow(im, 3.0))) + (-2.0 * (im * re)));
} else if (im <= 5.6e+24) {
tmp = im * -Math.sin(re);
} else if ((im <= 1.55e+272) || !(im <= 1.22e+288)) {
tmp = re * ((-0.16666666666666666 * Math.pow(im, 3.0)) - im);
} else {
tmp = -1270932914164.5 - (im * (re + (-0.16666666666666666 * Math.pow(re, 3.0))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -3.1e-7: tmp = 0.5 * ((-0.3333333333333333 * (re * math.pow(im, 3.0))) + (-2.0 * (im * re))) elif im <= 5.6e+24: tmp = im * -math.sin(re) elif (im <= 1.55e+272) or not (im <= 1.22e+288): tmp = re * ((-0.16666666666666666 * math.pow(im, 3.0)) - im) else: tmp = -1270932914164.5 - (im * (re + (-0.16666666666666666 * math.pow(re, 3.0)))) return tmp
function code(re, im) tmp = 0.0 if (im <= -3.1e-7) tmp = Float64(0.5 * Float64(Float64(-0.3333333333333333 * Float64(re * (im ^ 3.0))) + Float64(-2.0 * Float64(im * re)))); elseif (im <= 5.6e+24) tmp = Float64(im * Float64(-sin(re))); elseif ((im <= 1.55e+272) || !(im <= 1.22e+288)) tmp = Float64(re * Float64(Float64(-0.16666666666666666 * (im ^ 3.0)) - im)); else tmp = Float64(-1270932914164.5 - Float64(im * Float64(re + Float64(-0.16666666666666666 * (re ^ 3.0))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -3.1e-7) tmp = 0.5 * ((-0.3333333333333333 * (re * (im ^ 3.0))) + (-2.0 * (im * re))); elseif (im <= 5.6e+24) tmp = im * -sin(re); elseif ((im <= 1.55e+272) || ~((im <= 1.22e+288))) tmp = re * ((-0.16666666666666666 * (im ^ 3.0)) - im); else tmp = -1270932914164.5 - (im * (re + (-0.16666666666666666 * (re ^ 3.0)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -3.1e-7], N[(0.5 * N[(N[(-0.3333333333333333 * N[(re * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(im * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.6e+24], N[(im * (-N[Sin[re], $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[im, 1.55e+272], N[Not[LessEqual[im, 1.22e+288]], $MachinePrecision]], N[(re * N[(N[(-0.16666666666666666 * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], N[(-1270932914164.5 - N[(im * N[(re + N[(-0.16666666666666666 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -3.1 \cdot 10^{-7}:\\
\;\;\;\;0.5 \cdot \left(-0.3333333333333333 \cdot \left(re \cdot {im}^{3}\right) + -2 \cdot \left(im \cdot re\right)\right)\\
\mathbf{elif}\;im \leq 5.6 \cdot 10^{+24}:\\
\;\;\;\;im \cdot \left(-\sin re\right)\\
\mathbf{elif}\;im \leq 1.55 \cdot 10^{+272} \lor \neg \left(im \leq 1.22 \cdot 10^{+288}\right):\\
\;\;\;\;re \cdot \left(-0.16666666666666666 \cdot {im}^{3} - im\right)\\
\mathbf{else}:\\
\;\;\;\;-1270932914164.5 - im \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)\\
\end{array}
\end{array}
if im < -3.1e-7Initial program 99.5%
Taylor expanded in re around 0 72.9%
Taylor expanded in im around 0 58.9%
if -3.1e-7 < im < 5.6000000000000003e24Initial program 35.1%
*-commutative35.1%
associate-*l*35.1%
sub-neg35.1%
+-commutative35.1%
distribute-rgt-in35.1%
distribute-lft-neg-out35.1%
distribute-rgt-neg-in35.1%
metadata-eval35.1%
metadata-eval35.1%
fma-def35.1%
metadata-eval35.1%
exp-neg35.0%
associate-*l/35.0%
metadata-eval35.0%
Simplified35.0%
Taylor expanded in im around 0 96.9%
neg-mul-196.9%
Simplified96.9%
if 5.6000000000000003e24 < im < 1.54999999999999986e272 or 1.22000000000000011e288 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 72.3%
mul-1-neg72.3%
unsub-neg72.3%
*-commutative72.3%
*-commutative72.3%
Simplified72.3%
Taylor expanded in re around 0 57.2%
*-commutative57.2%
Simplified57.2%
if 1.54999999999999986e272 < im < 1.22000000000000011e288Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr8.3%
Taylor expanded in re around 0 81.9%
Final simplification79.2%
(FPCore (re im) :precision binary64 (if (or (<= im -2.8e+50) (not (<= im 1.5e+25))) (* re (- (* -0.16666666666666666 (pow im 3.0)) im)) (* im (- (sin re)))))
double code(double re, double im) {
double tmp;
if ((im <= -2.8e+50) || !(im <= 1.5e+25)) {
tmp = re * ((-0.16666666666666666 * pow(im, 3.0)) - im);
} else {
tmp = im * -sin(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-2.8d+50)) .or. (.not. (im <= 1.5d+25))) then
tmp = re * (((-0.16666666666666666d0) * (im ** 3.0d0)) - im)
else
tmp = im * -sin(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -2.8e+50) || !(im <= 1.5e+25)) {
tmp = re * ((-0.16666666666666666 * Math.pow(im, 3.0)) - im);
} else {
tmp = im * -Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -2.8e+50) or not (im <= 1.5e+25): tmp = re * ((-0.16666666666666666 * math.pow(im, 3.0)) - im) else: tmp = im * -math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -2.8e+50) || !(im <= 1.5e+25)) tmp = Float64(re * Float64(Float64(-0.16666666666666666 * (im ^ 3.0)) - im)); else tmp = Float64(im * Float64(-sin(re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -2.8e+50) || ~((im <= 1.5e+25))) tmp = re * ((-0.16666666666666666 * (im ^ 3.0)) - im); else tmp = im * -sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -2.8e+50], N[Not[LessEqual[im, 1.5e+25]], $MachinePrecision]], N[(re * N[(N[(-0.16666666666666666 * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], N[(im * (-N[Sin[re], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -2.8 \cdot 10^{+50} \lor \neg \left(im \leq 1.5 \cdot 10^{+25}\right):\\
\;\;\;\;re \cdot \left(-0.16666666666666666 \cdot {im}^{3} - im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(-\sin re\right)\\
\end{array}
\end{array}
if im < -2.7999999999999998e50 or 1.50000000000000003e25 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 78.9%
mul-1-neg78.9%
unsub-neg78.9%
*-commutative78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in re around 0 60.7%
*-commutative60.7%
Simplified60.7%
if -2.7999999999999998e50 < im < 1.50000000000000003e25Initial program 40.1%
*-commutative40.1%
associate-*l*40.1%
sub-neg40.1%
+-commutative40.1%
distribute-rgt-in40.1%
distribute-lft-neg-out40.1%
distribute-rgt-neg-in40.1%
metadata-eval40.1%
metadata-eval40.1%
fma-def40.1%
metadata-eval40.1%
exp-neg40.0%
associate-*l/40.0%
metadata-eval40.0%
Simplified40.0%
Taylor expanded in im around 0 89.9%
neg-mul-189.9%
Simplified89.9%
Final simplification77.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (pow re 3.0))))
(if (<= im -1.95e+34)
t_0
(if (<= im 680.0)
(* im (- (sin re)))
(if (<= im 5.5e+288) t_0 (* 0.5 (* -2.0 (* im re))))))))
double code(double re, double im) {
double t_0 = 0.5 * pow(re, 3.0);
double tmp;
if (im <= -1.95e+34) {
tmp = t_0;
} else if (im <= 680.0) {
tmp = im * -sin(re);
} else if (im <= 5.5e+288) {
tmp = t_0;
} else {
tmp = 0.5 * (-2.0 * (im * re));
}
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.5d0 * (re ** 3.0d0)
if (im <= (-1.95d+34)) then
tmp = t_0
else if (im <= 680.0d0) then
tmp = im * -sin(re)
else if (im <= 5.5d+288) then
tmp = t_0
else
tmp = 0.5d0 * ((-2.0d0) * (im * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * Math.pow(re, 3.0);
double tmp;
if (im <= -1.95e+34) {
tmp = t_0;
} else if (im <= 680.0) {
tmp = im * -Math.sin(re);
} else if (im <= 5.5e+288) {
tmp = t_0;
} else {
tmp = 0.5 * (-2.0 * (im * re));
}
return tmp;
}
def code(re, im): t_0 = 0.5 * math.pow(re, 3.0) tmp = 0 if im <= -1.95e+34: tmp = t_0 elif im <= 680.0: tmp = im * -math.sin(re) elif im <= 5.5e+288: tmp = t_0 else: tmp = 0.5 * (-2.0 * (im * re)) return tmp
function code(re, im) t_0 = Float64(0.5 * (re ^ 3.0)) tmp = 0.0 if (im <= -1.95e+34) tmp = t_0; elseif (im <= 680.0) tmp = Float64(im * Float64(-sin(re))); elseif (im <= 5.5e+288) tmp = t_0; else tmp = Float64(0.5 * Float64(-2.0 * Float64(im * re))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (re ^ 3.0); tmp = 0.0; if (im <= -1.95e+34) tmp = t_0; elseif (im <= 680.0) tmp = im * -sin(re); elseif (im <= 5.5e+288) tmp = t_0; else tmp = 0.5 * (-2.0 * (im * re)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.95e+34], t$95$0, If[LessEqual[im, 680.0], N[(im * (-N[Sin[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 5.5e+288], t$95$0, N[(0.5 * N[(-2.0 * N[(im * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot {re}^{3}\\
\mathbf{if}\;im \leq -1.95 \cdot 10^{+34}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 680:\\
\;\;\;\;im \cdot \left(-\sin re\right)\\
\mathbf{elif}\;im \leq 5.5 \cdot 10^{+288}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(-2 \cdot \left(im \cdot re\right)\right)\\
\end{array}
\end{array}
if im < -1.9500000000000001e34 or 680 < im < 5.5e288Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-def100.0%
metadata-eval100.0%
exp-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Applied egg-rr1.8%
Taylor expanded in re around 0 21.1%
Taylor expanded in re around inf 21.0%
*-commutative21.0%
Simplified21.0%
if -1.9500000000000001e34 < im < 680Initial program 35.8%
*-commutative35.8%
associate-*l*35.8%
sub-neg35.8%
+-commutative35.8%
distribute-rgt-in35.8%
distribute-lft-neg-out35.8%
distribute-rgt-neg-in35.8%
metadata-eval35.8%
metadata-eval35.8%
fma-def35.8%
metadata-eval35.8%
exp-neg35.7%
associate-*l/35.7%
metadata-eval35.7%
Simplified35.7%
Taylor expanded in im around 0 96.2%
neg-mul-196.2%
Simplified96.2%
if 5.5e288 < im Initial program 100.0%
Taylor expanded in re around 0 100.0%
Taylor expanded in im around 0 69.3%
*-commutative69.3%
Simplified69.3%
Final simplification62.7%
(FPCore (re im) :precision binary64 (if (or (<= im -6.5e+51) (not (<= im 4.6e+222))) (* 0.5 (* -2.0 (* im re))) (* im (- (sin re)))))
double code(double re, double im) {
double tmp;
if ((im <= -6.5e+51) || !(im <= 4.6e+222)) {
tmp = 0.5 * (-2.0 * (im * re));
} else {
tmp = im * -sin(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-6.5d+51)) .or. (.not. (im <= 4.6d+222))) then
tmp = 0.5d0 * ((-2.0d0) * (im * re))
else
tmp = im * -sin(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -6.5e+51) || !(im <= 4.6e+222)) {
tmp = 0.5 * (-2.0 * (im * re));
} else {
tmp = im * -Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -6.5e+51) or not (im <= 4.6e+222): tmp = 0.5 * (-2.0 * (im * re)) else: tmp = im * -math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -6.5e+51) || !(im <= 4.6e+222)) tmp = Float64(0.5 * Float64(-2.0 * Float64(im * re))); else tmp = Float64(im * Float64(-sin(re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -6.5e+51) || ~((im <= 4.6e+222))) tmp = 0.5 * (-2.0 * (im * re)); else tmp = im * -sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -6.5e+51], N[Not[LessEqual[im, 4.6e+222]], $MachinePrecision]], N[(0.5 * N[(-2.0 * N[(im * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * (-N[Sin[re], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -6.5 \cdot 10^{+51} \lor \neg \left(im \leq 4.6 \cdot 10^{+222}\right):\\
\;\;\;\;0.5 \cdot \left(-2 \cdot \left(im \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(-\sin re\right)\\
\end{array}
\end{array}
if im < -6.5e51 or 4.60000000000000021e222 < im Initial program 100.0%
Taylor expanded in re around 0 74.6%
Taylor expanded in im around 0 23.4%
*-commutative23.4%
Simplified23.4%
if -6.5e51 < im < 4.60000000000000021e222Initial program 53.1%
*-commutative53.1%
associate-*l*53.1%
sub-neg53.1%
+-commutative53.1%
distribute-rgt-in53.1%
distribute-lft-neg-out53.1%
distribute-rgt-neg-in53.1%
metadata-eval53.1%
metadata-eval53.1%
fma-def53.1%
metadata-eval53.1%
exp-neg53.1%
associate-*l/53.1%
metadata-eval53.1%
Simplified53.1%
Taylor expanded in im around 0 71.2%
neg-mul-171.2%
Simplified71.2%
Final simplification58.7%
(FPCore (re im) :precision binary64 (* 0.5 (* -2.0 (* im re))))
double code(double re, double im) {
return 0.5 * (-2.0 * (im * re));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.5d0 * ((-2.0d0) * (im * re))
end function
public static double code(double re, double im) {
return 0.5 * (-2.0 * (im * re));
}
def code(re, im): return 0.5 * (-2.0 * (im * re))
function code(re, im) return Float64(0.5 * Float64(-2.0 * Float64(im * re))) end
function tmp = code(re, im) tmp = 0.5 * (-2.0 * (im * re)); end
code[re_, im_] := N[(0.5 * N[(-2.0 * N[(im * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(-2 \cdot \left(im \cdot re\right)\right)
\end{array}
Initial program 65.4%
Taylor expanded in re around 0 51.0%
Taylor expanded in im around 0 35.3%
*-commutative35.3%
Simplified35.3%
Final simplification35.3%
(FPCore (re im) :precision binary64 (* re -3.0))
double code(double re, double im) {
return re * -3.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (-3.0d0)
end function
public static double code(double re, double im) {
return re * -3.0;
}
def code(re, im): return re * -3.0
function code(re, im) return Float64(re * -3.0) end
function tmp = code(re, im) tmp = re * -3.0; end
code[re_, im_] := N[(re * -3.0), $MachinePrecision]
\begin{array}{l}
\\
re \cdot -3
\end{array}
Initial program 65.4%
*-commutative65.4%
associate-*l*65.4%
sub-neg65.4%
+-commutative65.4%
distribute-rgt-in65.4%
distribute-lft-neg-out65.4%
distribute-rgt-neg-in65.4%
metadata-eval65.4%
metadata-eval65.4%
fma-def65.4%
metadata-eval65.4%
exp-neg65.3%
associate-*l/65.3%
metadata-eval65.3%
Simplified65.3%
Applied egg-rr3.3%
Taylor expanded in re around 0 3.1%
*-commutative3.1%
Simplified3.1%
Final simplification3.1%
(FPCore (re im) :precision binary64 (* re -0.001953125))
double code(double re, double im) {
return re * -0.001953125;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (-0.001953125d0)
end function
public static double code(double re, double im) {
return re * -0.001953125;
}
def code(re, im): return re * -0.001953125
function code(re, im) return Float64(re * -0.001953125) end
function tmp = code(re, im) tmp = re * -0.001953125; end
code[re_, im_] := N[(re * -0.001953125), $MachinePrecision]
\begin{array}{l}
\\
re \cdot -0.001953125
\end{array}
Initial program 65.4%
*-commutative65.4%
associate-*l*65.4%
sub-neg65.4%
+-commutative65.4%
distribute-rgt-in65.4%
distribute-lft-neg-out65.4%
distribute-rgt-neg-in65.4%
metadata-eval65.4%
metadata-eval65.4%
fma-def65.4%
metadata-eval65.4%
exp-neg65.3%
associate-*l/65.3%
metadata-eval65.3%
Simplified65.3%
Applied egg-rr3.4%
Taylor expanded in re around 0 3.2%
Final simplification3.2%
(FPCore (re im) :precision binary64 (* re 0.0))
double code(double re, double im) {
return re * 0.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * 0.0d0
end function
public static double code(double re, double im) {
return re * 0.0;
}
def code(re, im): return re * 0.0
function code(re, im) return Float64(re * 0.0) end
function tmp = code(re, im) tmp = re * 0.0; end
code[re_, im_] := N[(re * 0.0), $MachinePrecision]
\begin{array}{l}
\\
re \cdot 0
\end{array}
Initial program 65.4%
*-commutative65.4%
associate-*l*65.4%
sub-neg65.4%
+-commutative65.4%
distribute-rgt-in65.4%
distribute-lft-neg-out65.4%
distribute-rgt-neg-in65.4%
metadata-eval65.4%
metadata-eval65.4%
fma-def65.4%
metadata-eval65.4%
exp-neg65.3%
associate-*l/65.3%
metadata-eval65.3%
Simplified65.3%
Applied egg-rr16.7%
Taylor expanded in re around 0 16.7%
Final simplification16.7%
(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 2023188
(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))))