
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - 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((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - 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((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(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}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
(FPCore (re im)
:precision binary64
(if (<= im 0.22)
(* (sin re) (+ 1.0 (* 0.5 (pow im 2.0))))
(if (<= im 1.1e+98)
(* (+ (exp (- im)) (exp im)) (* 0.5 re))
(if (<= im 1e+152)
(log1p (expm1 (* -0.16666666666666666 (pow re 3.0))))
(* 0.5 (* (sin re) (pow im 2.0)))))))
double code(double re, double im) {
double tmp;
if (im <= 0.22) {
tmp = sin(re) * (1.0 + (0.5 * pow(im, 2.0)));
} else if (im <= 1.1e+98) {
tmp = (exp(-im) + exp(im)) * (0.5 * re);
} else if (im <= 1e+152) {
tmp = log1p(expm1((-0.16666666666666666 * pow(re, 3.0))));
} else {
tmp = 0.5 * (sin(re) * pow(im, 2.0));
}
return tmp;
}
public static double code(double re, double im) {
double tmp;
if (im <= 0.22) {
tmp = Math.sin(re) * (1.0 + (0.5 * Math.pow(im, 2.0)));
} else if (im <= 1.1e+98) {
tmp = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
} else if (im <= 1e+152) {
tmp = Math.log1p(Math.expm1((-0.16666666666666666 * Math.pow(re, 3.0))));
} else {
tmp = 0.5 * (Math.sin(re) * Math.pow(im, 2.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.22: tmp = math.sin(re) * (1.0 + (0.5 * math.pow(im, 2.0))) elif im <= 1.1e+98: tmp = (math.exp(-im) + math.exp(im)) * (0.5 * re) elif im <= 1e+152: tmp = math.log1p(math.expm1((-0.16666666666666666 * math.pow(re, 3.0)))) else: tmp = 0.5 * (math.sin(re) * math.pow(im, 2.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.22) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); elseif (im <= 1.1e+98) tmp = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re)); elseif (im <= 1e+152) tmp = log1p(expm1(Float64(-0.16666666666666666 * (re ^ 3.0)))); else tmp = Float64(0.5 * Float64(sin(re) * (im ^ 2.0))); end return tmp end
code[re_, im_] := If[LessEqual[im, 0.22], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.1e+98], N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+152], N[Log[1 + N[(Exp[N[(-0.16666666666666666 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.22:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+98}:\\
\;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{elif}\;im \leq 10^{+152}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-0.16666666666666666 \cdot {re}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 0.220000000000000001Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 82.0%
*-lft-identity82.0%
associate-*r*82.0%
distribute-rgt-out82.0%
Simplified82.0%
if 0.220000000000000001 < im < 1.10000000000000004e98Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 87.5%
if 1.10000000000000004e98 < im < 1e152Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.0%
Taylor expanded in re around 0 32.7%
Taylor expanded in re around inf 32.3%
log1p-expm1-u54.2%
Applied egg-rr54.2%
if 1e152 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in im around inf 97.3%
Final simplification83.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (+ (exp (- im)) (exp im)) (* 0.5 re)))
(t_1 (+ 1.0 (* 0.5 (pow im 2.0)))))
(if (<= im 0.15)
(* (sin re) t_1)
(if (<= im 1.1e+98)
t_0
(if (<= im 1.7e+142)
(* t_1 (* re (+ 1.0 (* -0.16666666666666666 (pow re 2.0)))))
(if (<= im 1.35e+154) t_0 (* 0.5 (* (sin re) (pow im 2.0)))))))))
double code(double re, double im) {
double t_0 = (exp(-im) + exp(im)) * (0.5 * re);
double t_1 = 1.0 + (0.5 * pow(im, 2.0));
double tmp;
if (im <= 0.15) {
tmp = sin(re) * t_1;
} else if (im <= 1.1e+98) {
tmp = t_0;
} else if (im <= 1.7e+142) {
tmp = t_1 * (re * (1.0 + (-0.16666666666666666 * pow(re, 2.0))));
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.5 * (sin(re) * pow(im, 2.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) :: t_1
real(8) :: tmp
t_0 = (exp(-im) + exp(im)) * (0.5d0 * re)
t_1 = 1.0d0 + (0.5d0 * (im ** 2.0d0))
if (im <= 0.15d0) then
tmp = sin(re) * t_1
else if (im <= 1.1d+98) then
tmp = t_0
else if (im <= 1.7d+142) then
tmp = t_1 * (re * (1.0d0 + ((-0.16666666666666666d0) * (re ** 2.0d0))))
else if (im <= 1.35d+154) then
tmp = t_0
else
tmp = 0.5d0 * (sin(re) * (im ** 2.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
double t_1 = 1.0 + (0.5 * Math.pow(im, 2.0));
double tmp;
if (im <= 0.15) {
tmp = Math.sin(re) * t_1;
} else if (im <= 1.1e+98) {
tmp = t_0;
} else if (im <= 1.7e+142) {
tmp = t_1 * (re * (1.0 + (-0.16666666666666666 * Math.pow(re, 2.0))));
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.5 * (Math.sin(re) * Math.pow(im, 2.0));
}
return tmp;
}
def code(re, im): t_0 = (math.exp(-im) + math.exp(im)) * (0.5 * re) t_1 = 1.0 + (0.5 * math.pow(im, 2.0)) tmp = 0 if im <= 0.15: tmp = math.sin(re) * t_1 elif im <= 1.1e+98: tmp = t_0 elif im <= 1.7e+142: tmp = t_1 * (re * (1.0 + (-0.16666666666666666 * math.pow(re, 2.0)))) elif im <= 1.35e+154: tmp = t_0 else: tmp = 0.5 * (math.sin(re) * math.pow(im, 2.0)) return tmp
function code(re, im) t_0 = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re)) t_1 = Float64(1.0 + Float64(0.5 * (im ^ 2.0))) tmp = 0.0 if (im <= 0.15) tmp = Float64(sin(re) * t_1); elseif (im <= 1.1e+98) tmp = t_0; elseif (im <= 1.7e+142) tmp = Float64(t_1 * Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * (re ^ 2.0))))); elseif (im <= 1.35e+154) tmp = t_0; else tmp = Float64(0.5 * Float64(sin(re) * (im ^ 2.0))); end return tmp end
function tmp_2 = code(re, im) t_0 = (exp(-im) + exp(im)) * (0.5 * re); t_1 = 1.0 + (0.5 * (im ^ 2.0)); tmp = 0.0; if (im <= 0.15) tmp = sin(re) * t_1; elseif (im <= 1.1e+98) tmp = t_0; elseif (im <= 1.7e+142) tmp = t_1 * (re * (1.0 + (-0.16666666666666666 * (re ^ 2.0)))); elseif (im <= 1.35e+154) tmp = t_0; else tmp = 0.5 * (sin(re) * (im ^ 2.0)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.15], N[(N[Sin[re], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[im, 1.1e+98], t$95$0, If[LessEqual[im, 1.7e+142], N[(t$95$1 * N[(re * N[(1.0 + N[(-0.16666666666666666 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], t$95$0, N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
t_1 := 1 + 0.5 \cdot {im}^{2}\\
\mathbf{if}\;im \leq 0.15:\\
\;\;\;\;\sin re \cdot t\_1\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 1.7 \cdot 10^{+142}:\\
\;\;\;\;t\_1 \cdot \left(re \cdot \left(1 + -0.16666666666666666 \cdot {re}^{2}\right)\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 0.149999999999999994Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 82.0%
*-lft-identity82.0%
associate-*r*82.0%
distribute-rgt-out82.0%
Simplified82.0%
if 0.149999999999999994 < im < 1.10000000000000004e98 or 1.6999999999999999e142 < im < 1.35000000000000003e154Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 85.0%
if 1.10000000000000004e98 < im < 1.6999999999999999e142Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 6.1%
*-lft-identity6.1%
associate-*r*6.1%
distribute-rgt-out6.1%
Simplified6.1%
Taylor expanded in re around 0 43.4%
if 1.35000000000000003e154 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
*-lft-identity100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
Final simplification83.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (+ (exp (- im)) (exp im)) (* 0.5 re))))
(if (<= im 0.056)
(* (sin re) (+ 1.0 (* 0.5 (pow im 2.0))))
(if (<= im 1.1e+98)
t_0
(if (<= im 2.2e+142)
(*
0.5
(*
(pow im 2.0)
(* re (+ 1.0 (* -0.16666666666666666 (pow re 2.0))))))
(if (<= im 1.35e+154) t_0 (* 0.5 (* (sin re) (pow im 2.0)))))))))
double code(double re, double im) {
double t_0 = (exp(-im) + exp(im)) * (0.5 * re);
double tmp;
if (im <= 0.056) {
tmp = sin(re) * (1.0 + (0.5 * pow(im, 2.0)));
} else if (im <= 1.1e+98) {
tmp = t_0;
} else if (im <= 2.2e+142) {
tmp = 0.5 * (pow(im, 2.0) * (re * (1.0 + (-0.16666666666666666 * pow(re, 2.0)))));
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.5 * (sin(re) * pow(im, 2.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 = (exp(-im) + exp(im)) * (0.5d0 * re)
if (im <= 0.056d0) then
tmp = sin(re) * (1.0d0 + (0.5d0 * (im ** 2.0d0)))
else if (im <= 1.1d+98) then
tmp = t_0
else if (im <= 2.2d+142) then
tmp = 0.5d0 * ((im ** 2.0d0) * (re * (1.0d0 + ((-0.16666666666666666d0) * (re ** 2.0d0)))))
else if (im <= 1.35d+154) then
tmp = t_0
else
tmp = 0.5d0 * (sin(re) * (im ** 2.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
double tmp;
if (im <= 0.056) {
tmp = Math.sin(re) * (1.0 + (0.5 * Math.pow(im, 2.0)));
} else if (im <= 1.1e+98) {
tmp = t_0;
} else if (im <= 2.2e+142) {
tmp = 0.5 * (Math.pow(im, 2.0) * (re * (1.0 + (-0.16666666666666666 * Math.pow(re, 2.0)))));
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.5 * (Math.sin(re) * Math.pow(im, 2.0));
}
return tmp;
}
def code(re, im): t_0 = (math.exp(-im) + math.exp(im)) * (0.5 * re) tmp = 0 if im <= 0.056: tmp = math.sin(re) * (1.0 + (0.5 * math.pow(im, 2.0))) elif im <= 1.1e+98: tmp = t_0 elif im <= 2.2e+142: tmp = 0.5 * (math.pow(im, 2.0) * (re * (1.0 + (-0.16666666666666666 * math.pow(re, 2.0))))) elif im <= 1.35e+154: tmp = t_0 else: tmp = 0.5 * (math.sin(re) * math.pow(im, 2.0)) return tmp
function code(re, im) t_0 = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re)) tmp = 0.0 if (im <= 0.056) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); elseif (im <= 1.1e+98) tmp = t_0; elseif (im <= 2.2e+142) tmp = Float64(0.5 * Float64((im ^ 2.0) * Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * (re ^ 2.0)))))); elseif (im <= 1.35e+154) tmp = t_0; else tmp = Float64(0.5 * Float64(sin(re) * (im ^ 2.0))); end return tmp end
function tmp_2 = code(re, im) t_0 = (exp(-im) + exp(im)) * (0.5 * re); tmp = 0.0; if (im <= 0.056) tmp = sin(re) * (1.0 + (0.5 * (im ^ 2.0))); elseif (im <= 1.1e+98) tmp = t_0; elseif (im <= 2.2e+142) tmp = 0.5 * ((im ^ 2.0) * (re * (1.0 + (-0.16666666666666666 * (re ^ 2.0))))); elseif (im <= 1.35e+154) tmp = t_0; else tmp = 0.5 * (sin(re) * (im ^ 2.0)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.056], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.1e+98], t$95$0, If[LessEqual[im, 2.2e+142], N[(0.5 * N[(N[Power[im, 2.0], $MachinePrecision] * N[(re * N[(1.0 + N[(-0.16666666666666666 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], t$95$0, N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{if}\;im \leq 0.056:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 2.2 \cdot 10^{+142}:\\
\;\;\;\;0.5 \cdot \left({im}^{2} \cdot \left(re \cdot \left(1 + -0.16666666666666666 \cdot {re}^{2}\right)\right)\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 0.0560000000000000012Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 82.0%
*-lft-identity82.0%
associate-*r*82.0%
distribute-rgt-out82.0%
Simplified82.0%
if 0.0560000000000000012 < im < 1.10000000000000004e98 or 2.19999999999999987e142 < im < 1.35000000000000003e154Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 85.0%
if 1.10000000000000004e98 < im < 2.19999999999999987e142Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 6.1%
*-lft-identity6.1%
associate-*r*6.1%
distribute-rgt-out6.1%
Simplified6.1%
Taylor expanded in re around 0 43.4%
Taylor expanded in im around inf 43.4%
if 1.35000000000000003e154 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
*-lft-identity100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
Final simplification83.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (+ (exp (- im)) (exp im)) (* 0.5 re))))
(if (<= im 0.019)
(* (sin re) (+ 1.0 (* 0.5 (pow im 2.0))))
(if (<= im 1.1e+98)
t_0
(if (<= im 1.7e+142)
(*
(pow re 3.0)
(+ -0.16666666666666666 (* (pow im 2.0) -0.08333333333333333)))
(if (<= im 1.35e+154) t_0 (* 0.5 (* (sin re) (pow im 2.0)))))))))
double code(double re, double im) {
double t_0 = (exp(-im) + exp(im)) * (0.5 * re);
double tmp;
if (im <= 0.019) {
tmp = sin(re) * (1.0 + (0.5 * pow(im, 2.0)));
} else if (im <= 1.1e+98) {
tmp = t_0;
} else if (im <= 1.7e+142) {
tmp = pow(re, 3.0) * (-0.16666666666666666 + (pow(im, 2.0) * -0.08333333333333333));
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.5 * (sin(re) * pow(im, 2.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 = (exp(-im) + exp(im)) * (0.5d0 * re)
if (im <= 0.019d0) then
tmp = sin(re) * (1.0d0 + (0.5d0 * (im ** 2.0d0)))
else if (im <= 1.1d+98) then
tmp = t_0
else if (im <= 1.7d+142) then
tmp = (re ** 3.0d0) * ((-0.16666666666666666d0) + ((im ** 2.0d0) * (-0.08333333333333333d0)))
else if (im <= 1.35d+154) then
tmp = t_0
else
tmp = 0.5d0 * (sin(re) * (im ** 2.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
double tmp;
if (im <= 0.019) {
tmp = Math.sin(re) * (1.0 + (0.5 * Math.pow(im, 2.0)));
} else if (im <= 1.1e+98) {
tmp = t_0;
} else if (im <= 1.7e+142) {
tmp = Math.pow(re, 3.0) * (-0.16666666666666666 + (Math.pow(im, 2.0) * -0.08333333333333333));
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.5 * (Math.sin(re) * Math.pow(im, 2.0));
}
return tmp;
}
def code(re, im): t_0 = (math.exp(-im) + math.exp(im)) * (0.5 * re) tmp = 0 if im <= 0.019: tmp = math.sin(re) * (1.0 + (0.5 * math.pow(im, 2.0))) elif im <= 1.1e+98: tmp = t_0 elif im <= 1.7e+142: tmp = math.pow(re, 3.0) * (-0.16666666666666666 + (math.pow(im, 2.0) * -0.08333333333333333)) elif im <= 1.35e+154: tmp = t_0 else: tmp = 0.5 * (math.sin(re) * math.pow(im, 2.0)) return tmp
function code(re, im) t_0 = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re)) tmp = 0.0 if (im <= 0.019) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); elseif (im <= 1.1e+98) tmp = t_0; elseif (im <= 1.7e+142) tmp = Float64((re ^ 3.0) * Float64(-0.16666666666666666 + Float64((im ^ 2.0) * -0.08333333333333333))); elseif (im <= 1.35e+154) tmp = t_0; else tmp = Float64(0.5 * Float64(sin(re) * (im ^ 2.0))); end return tmp end
function tmp_2 = code(re, im) t_0 = (exp(-im) + exp(im)) * (0.5 * re); tmp = 0.0; if (im <= 0.019) tmp = sin(re) * (1.0 + (0.5 * (im ^ 2.0))); elseif (im <= 1.1e+98) tmp = t_0; elseif (im <= 1.7e+142) tmp = (re ^ 3.0) * (-0.16666666666666666 + ((im ^ 2.0) * -0.08333333333333333)); elseif (im <= 1.35e+154) tmp = t_0; else tmp = 0.5 * (sin(re) * (im ^ 2.0)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.019], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.1e+98], t$95$0, If[LessEqual[im, 1.7e+142], N[(N[Power[re, 3.0], $MachinePrecision] * N[(-0.16666666666666666 + N[(N[Power[im, 2.0], $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], t$95$0, N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{if}\;im \leq 0.019:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 1.7 \cdot 10^{+142}:\\
\;\;\;\;{re}^{3} \cdot \left(-0.16666666666666666 + {im}^{2} \cdot -0.08333333333333333\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 0.0189999999999999995Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 82.0%
*-lft-identity82.0%
associate-*r*82.0%
distribute-rgt-out82.0%
Simplified82.0%
if 0.0189999999999999995 < im < 1.10000000000000004e98 or 1.6999999999999999e142 < im < 1.35000000000000003e154Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 85.0%
if 1.10000000000000004e98 < im < 1.6999999999999999e142Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 6.1%
*-lft-identity6.1%
associate-*r*6.1%
distribute-rgt-out6.1%
Simplified6.1%
Taylor expanded in re around 0 43.4%
Taylor expanded in re around inf 42.2%
associate-*r*42.2%
*-commutative42.2%
+-commutative42.2%
fma-undefine42.2%
associate-*r*42.2%
fma-undefine42.2%
+-commutative42.2%
distribute-rgt-in42.2%
metadata-eval42.2%
*-commutative42.2%
associate-*l*42.2%
metadata-eval42.2%
Simplified42.2%
if 1.35000000000000003e154 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
*-lft-identity100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
Final simplification83.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (+ (exp (- im)) (exp im)) (* 0.5 re))))
(if (<= im 0.45)
(* (sin re) (+ 1.0 (* 0.5 (pow im 2.0))))
(if (<= im 1.1e+98)
t_0
(if (<= im 5e+142)
(* re (+ 1.0 (cbrt (* (pow re 6.0) -0.004629629629629629))))
(if (<= im 1.35e+154) t_0 (* 0.5 (* (sin re) (pow im 2.0)))))))))
double code(double re, double im) {
double t_0 = (exp(-im) + exp(im)) * (0.5 * re);
double tmp;
if (im <= 0.45) {
tmp = sin(re) * (1.0 + (0.5 * pow(im, 2.0)));
} else if (im <= 1.1e+98) {
tmp = t_0;
} else if (im <= 5e+142) {
tmp = re * (1.0 + cbrt((pow(re, 6.0) * -0.004629629629629629)));
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.5 * (sin(re) * pow(im, 2.0));
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
double tmp;
if (im <= 0.45) {
tmp = Math.sin(re) * (1.0 + (0.5 * Math.pow(im, 2.0)));
} else if (im <= 1.1e+98) {
tmp = t_0;
} else if (im <= 5e+142) {
tmp = re * (1.0 + Math.cbrt((Math.pow(re, 6.0) * -0.004629629629629629)));
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.5 * (Math.sin(re) * Math.pow(im, 2.0));
}
return tmp;
}
function code(re, im) t_0 = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re)) tmp = 0.0 if (im <= 0.45) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); elseif (im <= 1.1e+98) tmp = t_0; elseif (im <= 5e+142) tmp = Float64(re * Float64(1.0 + cbrt(Float64((re ^ 6.0) * -0.004629629629629629)))); elseif (im <= 1.35e+154) tmp = t_0; else tmp = Float64(0.5 * Float64(sin(re) * (im ^ 2.0))); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.45], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.1e+98], t$95$0, If[LessEqual[im, 5e+142], N[(re * N[(1.0 + N[Power[N[(N[Power[re, 6.0], $MachinePrecision] * -0.004629629629629629), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], t$95$0, N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{if}\;im \leq 0.45:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+142}:\\
\;\;\;\;re \cdot \left(1 + \sqrt[3]{{re}^{6} \cdot -0.004629629629629629}\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 0.450000000000000011Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 82.0%
*-lft-identity82.0%
associate-*r*82.0%
distribute-rgt-out82.0%
Simplified82.0%
if 0.450000000000000011 < im < 1.10000000000000004e98 or 5.0000000000000001e142 < im < 1.35000000000000003e154Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 85.0%
if 1.10000000000000004e98 < im < 5.0000000000000001e142Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 2.9%
Taylor expanded in re around 0 32.2%
add-cbrt-cube41.4%
pow1/310.2%
pow310.2%
*-commutative10.2%
unpow-prod-down10.2%
unpow210.2%
pow-prod-down10.2%
pow-prod-up10.2%
metadata-eval10.2%
metadata-eval10.2%
Applied egg-rr10.2%
unpow1/341.4%
Simplified41.4%
if 1.35000000000000003e154 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
*-lft-identity100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
Final simplification83.1%
(FPCore (re im)
:precision binary64
(if (<= im 2.1e+15)
(* (sin re) (+ 1.0 (* 0.5 (pow im 2.0))))
(if (<= im 4.3e+97)
(* 2.0 (pow (sin re) -2.0))
(if (<= im 1e+152)
(* re (+ 1.0 (cbrt (* (pow re 6.0) -0.004629629629629629))))
(* 0.5 (* (sin re) (pow im 2.0)))))))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = sin(re) * (1.0 + (0.5 * pow(im, 2.0)));
} else if (im <= 4.3e+97) {
tmp = 2.0 * pow(sin(re), -2.0);
} else if (im <= 1e+152) {
tmp = re * (1.0 + cbrt((pow(re, 6.0) * -0.004629629629629629)));
} else {
tmp = 0.5 * (sin(re) * pow(im, 2.0));
}
return tmp;
}
public static double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = Math.sin(re) * (1.0 + (0.5 * Math.pow(im, 2.0)));
} else if (im <= 4.3e+97) {
tmp = 2.0 * Math.pow(Math.sin(re), -2.0);
} else if (im <= 1e+152) {
tmp = re * (1.0 + Math.cbrt((Math.pow(re, 6.0) * -0.004629629629629629)));
} else {
tmp = 0.5 * (Math.sin(re) * Math.pow(im, 2.0));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (im <= 2.1e+15) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); elseif (im <= 4.3e+97) tmp = Float64(2.0 * (sin(re) ^ -2.0)); elseif (im <= 1e+152) tmp = Float64(re * Float64(1.0 + cbrt(Float64((re ^ 6.0) * -0.004629629629629629)))); else tmp = Float64(0.5 * Float64(sin(re) * (im ^ 2.0))); end return tmp end
code[re_, im_] := If[LessEqual[im, 2.1e+15], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.3e+97], N[(2.0 * N[Power[N[Sin[re], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+152], N[(re * N[(1.0 + N[Power[N[(N[Power[re, 6.0], $MachinePrecision] * -0.004629629629629629), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\mathbf{elif}\;im \leq 4.3 \cdot 10^{+97}:\\
\;\;\;\;2 \cdot {\sin re}^{-2}\\
\mathbf{elif}\;im \leq 10^{+152}:\\
\;\;\;\;re \cdot \left(1 + \sqrt[3]{{re}^{6} \cdot -0.004629629629629629}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 2.1e15Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 82.0%
*-lft-identity82.0%
associate-*r*82.0%
distribute-rgt-out82.0%
Simplified82.0%
if 2.1e15 < im < 4.2999999999999998e97Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.4%
count-22.4%
Simplified2.4%
Applied egg-rr8.2%
if 4.2999999999999998e97 < im < 1e152Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.0%
Taylor expanded in re around 0 32.7%
add-cbrt-cube39.8%
pow1/37.8%
pow37.8%
*-commutative7.8%
unpow-prod-down7.8%
unpow27.8%
pow-prod-down7.8%
pow-prod-up7.8%
metadata-eval7.8%
metadata-eval7.8%
Applied egg-rr7.8%
unpow1/339.8%
Simplified39.8%
if 1e152 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in im around inf 97.3%
Final simplification77.4%
(FPCore (re im)
:precision binary64
(if (<= im 60000000000.0)
(sin re)
(if (<= im 4.6e+97)
(* 2.0 (pow (sin re) -2.0))
(if (<= im 1e+152)
(* re (+ 1.0 (cbrt (* (pow re 6.0) -0.004629629629629629))))
(* 0.5 (* (sin re) (pow im 2.0)))))))
double code(double re, double im) {
double tmp;
if (im <= 60000000000.0) {
tmp = sin(re);
} else if (im <= 4.6e+97) {
tmp = 2.0 * pow(sin(re), -2.0);
} else if (im <= 1e+152) {
tmp = re * (1.0 + cbrt((pow(re, 6.0) * -0.004629629629629629)));
} else {
tmp = 0.5 * (sin(re) * pow(im, 2.0));
}
return tmp;
}
public static double code(double re, double im) {
double tmp;
if (im <= 60000000000.0) {
tmp = Math.sin(re);
} else if (im <= 4.6e+97) {
tmp = 2.0 * Math.pow(Math.sin(re), -2.0);
} else if (im <= 1e+152) {
tmp = re * (1.0 + Math.cbrt((Math.pow(re, 6.0) * -0.004629629629629629)));
} else {
tmp = 0.5 * (Math.sin(re) * Math.pow(im, 2.0));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (im <= 60000000000.0) tmp = sin(re); elseif (im <= 4.6e+97) tmp = Float64(2.0 * (sin(re) ^ -2.0)); elseif (im <= 1e+152) tmp = Float64(re * Float64(1.0 + cbrt(Float64((re ^ 6.0) * -0.004629629629629629)))); else tmp = Float64(0.5 * Float64(sin(re) * (im ^ 2.0))); end return tmp end
code[re_, im_] := If[LessEqual[im, 60000000000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 4.6e+97], N[(2.0 * N[Power[N[Sin[re], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+152], N[(re * N[(1.0 + N[Power[N[(N[Power[re, 6.0], $MachinePrecision] * -0.004629629629629629), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 60000000000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 4.6 \cdot 10^{+97}:\\
\;\;\;\;2 \cdot {\sin re}^{-2}\\
\mathbf{elif}\;im \leq 10^{+152}:\\
\;\;\;\;re \cdot \left(1 + \sqrt[3]{{re}^{6} \cdot -0.004629629629629629}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 6e10Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 6e10 < im < 4.60000000000000011e97Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.4%
count-22.4%
Simplified2.4%
Applied egg-rr8.2%
if 4.60000000000000011e97 < im < 1e152Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.0%
Taylor expanded in re around 0 32.7%
add-cbrt-cube39.8%
pow1/37.8%
pow37.8%
*-commutative7.8%
unpow-prod-down7.8%
unpow27.8%
pow-prod-down7.8%
pow-prod-up7.8%
metadata-eval7.8%
metadata-eval7.8%
Applied egg-rr7.8%
unpow1/339.8%
Simplified39.8%
if 1e152 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in im around inf 97.3%
Final simplification64.1%
(FPCore (re im)
:precision binary64
(if (<= im 60000000000.0)
(sin re)
(if (<= im 1.55e+101)
(* 2.0 (pow (sin re) -2.0))
(if (<= im 1e+152)
(* 2.0 (* re (+ 1.0 (* -0.16666666666666666 (pow re 2.0)))))
(* 0.5 (* (sin re) (pow im 2.0)))))))
double code(double re, double im) {
double tmp;
if (im <= 60000000000.0) {
tmp = sin(re);
} else if (im <= 1.55e+101) {
tmp = 2.0 * pow(sin(re), -2.0);
} else if (im <= 1e+152) {
tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * pow(re, 2.0))));
} else {
tmp = 0.5 * (sin(re) * pow(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 <= 60000000000.0d0) then
tmp = sin(re)
else if (im <= 1.55d+101) then
tmp = 2.0d0 * (sin(re) ** (-2.0d0))
else if (im <= 1d+152) then
tmp = 2.0d0 * (re * (1.0d0 + ((-0.16666666666666666d0) * (re ** 2.0d0))))
else
tmp = 0.5d0 * (sin(re) * (im ** 2.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 60000000000.0) {
tmp = Math.sin(re);
} else if (im <= 1.55e+101) {
tmp = 2.0 * Math.pow(Math.sin(re), -2.0);
} else if (im <= 1e+152) {
tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * Math.pow(re, 2.0))));
} else {
tmp = 0.5 * (Math.sin(re) * Math.pow(im, 2.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 60000000000.0: tmp = math.sin(re) elif im <= 1.55e+101: tmp = 2.0 * math.pow(math.sin(re), -2.0) elif im <= 1e+152: tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * math.pow(re, 2.0)))) else: tmp = 0.5 * (math.sin(re) * math.pow(im, 2.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 60000000000.0) tmp = sin(re); elseif (im <= 1.55e+101) tmp = Float64(2.0 * (sin(re) ^ -2.0)); elseif (im <= 1e+152) tmp = Float64(2.0 * Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * (re ^ 2.0))))); else tmp = Float64(0.5 * Float64(sin(re) * (im ^ 2.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 60000000000.0) tmp = sin(re); elseif (im <= 1.55e+101) tmp = 2.0 * (sin(re) ^ -2.0); elseif (im <= 1e+152) tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * (re ^ 2.0)))); else tmp = 0.5 * (sin(re) * (im ^ 2.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 60000000000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.55e+101], N[(2.0 * N[Power[N[Sin[re], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+152], N[(2.0 * N[(re * N[(1.0 + N[(-0.16666666666666666 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 60000000000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.55 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot {\sin re}^{-2}\\
\mathbf{elif}\;im \leq 10^{+152}:\\
\;\;\;\;2 \cdot \left(re \cdot \left(1 + -0.16666666666666666 \cdot {re}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 6e10Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 6e10 < im < 1.55e101Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.5%
count-22.5%
Simplified2.5%
Applied egg-rr12.2%
if 1.55e101 < im < 1e152Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr3.1%
count-23.1%
Simplified3.1%
Taylor expanded in re around 0 41.3%
if 1e152 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in im around inf 97.3%
Final simplification64.0%
(FPCore (re im)
:precision binary64
(if (<= im 60000000000.0)
(sin re)
(if (<= im 1.9e+101)
(* 2.0 (pow (sin re) -2.0))
(if (<= im 1e+152)
(* 2.0 (* re (+ 1.0 (* -0.16666666666666666 (pow re 2.0)))))
(* re (+ 1.0 (* 0.5 (pow im 2.0))))))))
double code(double re, double im) {
double tmp;
if (im <= 60000000000.0) {
tmp = sin(re);
} else if (im <= 1.9e+101) {
tmp = 2.0 * pow(sin(re), -2.0);
} else if (im <= 1e+152) {
tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * pow(re, 2.0))));
} else {
tmp = re * (1.0 + (0.5 * pow(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 <= 60000000000.0d0) then
tmp = sin(re)
else if (im <= 1.9d+101) then
tmp = 2.0d0 * (sin(re) ** (-2.0d0))
else if (im <= 1d+152) then
tmp = 2.0d0 * (re * (1.0d0 + ((-0.16666666666666666d0) * (re ** 2.0d0))))
else
tmp = re * (1.0d0 + (0.5d0 * (im ** 2.0d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 60000000000.0) {
tmp = Math.sin(re);
} else if (im <= 1.9e+101) {
tmp = 2.0 * Math.pow(Math.sin(re), -2.0);
} else if (im <= 1e+152) {
tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * Math.pow(re, 2.0))));
} else {
tmp = re * (1.0 + (0.5 * Math.pow(im, 2.0)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 60000000000.0: tmp = math.sin(re) elif im <= 1.9e+101: tmp = 2.0 * math.pow(math.sin(re), -2.0) elif im <= 1e+152: tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * math.pow(re, 2.0)))) else: tmp = re * (1.0 + (0.5 * math.pow(im, 2.0))) return tmp
function code(re, im) tmp = 0.0 if (im <= 60000000000.0) tmp = sin(re); elseif (im <= 1.9e+101) tmp = Float64(2.0 * (sin(re) ^ -2.0)); elseif (im <= 1e+152) tmp = Float64(2.0 * Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * (re ^ 2.0))))); else tmp = Float64(re * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 60000000000.0) tmp = sin(re); elseif (im <= 1.9e+101) tmp = 2.0 * (sin(re) ^ -2.0); elseif (im <= 1e+152) tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * (re ^ 2.0)))); else tmp = re * (1.0 + (0.5 * (im ^ 2.0))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 60000000000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.9e+101], N[(2.0 * N[Power[N[Sin[re], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+152], N[(2.0 * N[(re * N[(1.0 + N[(-0.16666666666666666 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 60000000000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.9 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot {\sin re}^{-2}\\
\mathbf{elif}\;im \leq 10^{+152}:\\
\;\;\;\;2 \cdot \left(re \cdot \left(1 + -0.16666666666666666 \cdot {re}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 6e10Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 6e10 < im < 1.8999999999999999e101Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.5%
count-22.5%
Simplified2.5%
Applied egg-rr12.2%
if 1.8999999999999999e101 < im < 1e152Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr3.1%
count-23.1%
Simplified3.1%
Taylor expanded in re around 0 41.3%
if 1e152 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in re around 0 77.9%
(FPCore (re im)
:precision binary64
(if (<= im 11500000000000.0)
(sin re)
(if (<= im 2.05e+101)
(pow (sin re) -2.0)
(if (<= im 9.2e+151)
(* 2.0 (* re (+ 1.0 (* -0.16666666666666666 (pow re 2.0)))))
(* re (+ 1.0 (* 0.5 (pow im 2.0))))))))
double code(double re, double im) {
double tmp;
if (im <= 11500000000000.0) {
tmp = sin(re);
} else if (im <= 2.05e+101) {
tmp = pow(sin(re), -2.0);
} else if (im <= 9.2e+151) {
tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * pow(re, 2.0))));
} else {
tmp = re * (1.0 + (0.5 * pow(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 <= 11500000000000.0d0) then
tmp = sin(re)
else if (im <= 2.05d+101) then
tmp = sin(re) ** (-2.0d0)
else if (im <= 9.2d+151) then
tmp = 2.0d0 * (re * (1.0d0 + ((-0.16666666666666666d0) * (re ** 2.0d0))))
else
tmp = re * (1.0d0 + (0.5d0 * (im ** 2.0d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 11500000000000.0) {
tmp = Math.sin(re);
} else if (im <= 2.05e+101) {
tmp = Math.pow(Math.sin(re), -2.0);
} else if (im <= 9.2e+151) {
tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * Math.pow(re, 2.0))));
} else {
tmp = re * (1.0 + (0.5 * Math.pow(im, 2.0)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 11500000000000.0: tmp = math.sin(re) elif im <= 2.05e+101: tmp = math.pow(math.sin(re), -2.0) elif im <= 9.2e+151: tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * math.pow(re, 2.0)))) else: tmp = re * (1.0 + (0.5 * math.pow(im, 2.0))) return tmp
function code(re, im) tmp = 0.0 if (im <= 11500000000000.0) tmp = sin(re); elseif (im <= 2.05e+101) tmp = sin(re) ^ -2.0; elseif (im <= 9.2e+151) tmp = Float64(2.0 * Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * (re ^ 2.0))))); else tmp = Float64(re * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 11500000000000.0) tmp = sin(re); elseif (im <= 2.05e+101) tmp = sin(re) ^ -2.0; elseif (im <= 9.2e+151) tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * (re ^ 2.0)))); else tmp = re * (1.0 + (0.5 * (im ^ 2.0))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 11500000000000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.05e+101], N[Power[N[Sin[re], $MachinePrecision], -2.0], $MachinePrecision], If[LessEqual[im, 9.2e+151], N[(2.0 * N[(re * N[(1.0 + N[(-0.16666666666666666 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 11500000000000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.05 \cdot 10^{+101}:\\
\;\;\;\;{\sin re}^{-2}\\
\mathbf{elif}\;im \leq 9.2 \cdot 10^{+151}:\\
\;\;\;\;2 \cdot \left(re \cdot \left(1 + -0.16666666666666666 \cdot {re}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 1.15e13Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 1.15e13 < im < 2.05e101Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 2.5%
Applied egg-rr12.2%
if 2.05e101 < im < 9.2000000000000003e151Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr3.1%
count-23.1%
Simplified3.1%
Taylor expanded in re around 0 41.3%
if 9.2000000000000003e151 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in re around 0 77.9%
(FPCore (re im)
:precision binary64
(if (<= im 2.1e+15)
(sin re)
(if (<= im 1.4e+101)
(* 2.0 (pow re -2.0))
(if (<= im 1e+152)
(* 2.0 (* re (+ 1.0 (* -0.16666666666666666 (pow re 2.0)))))
(* re (+ 1.0 (* 0.5 (pow im 2.0))))))))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = sin(re);
} else if (im <= 1.4e+101) {
tmp = 2.0 * pow(re, -2.0);
} else if (im <= 1e+152) {
tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * pow(re, 2.0))));
} else {
tmp = re * (1.0 + (0.5 * pow(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 <= 2.1d+15) then
tmp = sin(re)
else if (im <= 1.4d+101) then
tmp = 2.0d0 * (re ** (-2.0d0))
else if (im <= 1d+152) then
tmp = 2.0d0 * (re * (1.0d0 + ((-0.16666666666666666d0) * (re ** 2.0d0))))
else
tmp = re * (1.0d0 + (0.5d0 * (im ** 2.0d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = Math.sin(re);
} else if (im <= 1.4e+101) {
tmp = 2.0 * Math.pow(re, -2.0);
} else if (im <= 1e+152) {
tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * Math.pow(re, 2.0))));
} else {
tmp = re * (1.0 + (0.5 * Math.pow(im, 2.0)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.1e+15: tmp = math.sin(re) elif im <= 1.4e+101: tmp = 2.0 * math.pow(re, -2.0) elif im <= 1e+152: tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * math.pow(re, 2.0)))) else: tmp = re * (1.0 + (0.5 * math.pow(im, 2.0))) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.1e+15) tmp = sin(re); elseif (im <= 1.4e+101) tmp = Float64(2.0 * (re ^ -2.0)); elseif (im <= 1e+152) tmp = Float64(2.0 * Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * (re ^ 2.0))))); else tmp = Float64(re * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.1e+15) tmp = sin(re); elseif (im <= 1.4e+101) tmp = 2.0 * (re ^ -2.0); elseif (im <= 1e+152) tmp = 2.0 * (re * (1.0 + (-0.16666666666666666 * (re ^ 2.0)))); else tmp = re * (1.0 + (0.5 * (im ^ 2.0))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.1e+15], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.4e+101], N[(2.0 * N[Power[re, -2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+152], N[(2.0 * N[(re * N[(1.0 + N[(-0.16666666666666666 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot {re}^{-2}\\
\mathbf{elif}\;im \leq 10^{+152}:\\
\;\;\;\;2 \cdot \left(re \cdot \left(1 + -0.16666666666666666 \cdot {re}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 2.1e15Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 2.1e15 < im < 1.39999999999999991e101Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.5%
count-22.5%
Simplified2.5%
Applied egg-rr12.2%
Taylor expanded in re around 0 12.1%
if 1.39999999999999991e101 < im < 1e152Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr3.1%
count-23.1%
Simplified3.1%
Taylor expanded in re around 0 41.3%
if 1e152 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in re around 0 77.9%
(FPCore (re im)
:precision binary64
(if (<= im 2.1e+15)
(sin re)
(if (<= im 2.05e+101)
(* 2.0 (pow re -2.0))
(if (<= im 9.2e+151)
(* re (+ 1.0 (* -0.16666666666666666 (pow re 2.0))))
(* re (+ 1.0 (* 0.5 (pow im 2.0))))))))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = sin(re);
} else if (im <= 2.05e+101) {
tmp = 2.0 * pow(re, -2.0);
} else if (im <= 9.2e+151) {
tmp = re * (1.0 + (-0.16666666666666666 * pow(re, 2.0)));
} else {
tmp = re * (1.0 + (0.5 * pow(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 <= 2.1d+15) then
tmp = sin(re)
else if (im <= 2.05d+101) then
tmp = 2.0d0 * (re ** (-2.0d0))
else if (im <= 9.2d+151) then
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re ** 2.0d0)))
else
tmp = re * (1.0d0 + (0.5d0 * (im ** 2.0d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = Math.sin(re);
} else if (im <= 2.05e+101) {
tmp = 2.0 * Math.pow(re, -2.0);
} else if (im <= 9.2e+151) {
tmp = re * (1.0 + (-0.16666666666666666 * Math.pow(re, 2.0)));
} else {
tmp = re * (1.0 + (0.5 * Math.pow(im, 2.0)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.1e+15: tmp = math.sin(re) elif im <= 2.05e+101: tmp = 2.0 * math.pow(re, -2.0) elif im <= 9.2e+151: tmp = re * (1.0 + (-0.16666666666666666 * math.pow(re, 2.0))) else: tmp = re * (1.0 + (0.5 * math.pow(im, 2.0))) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.1e+15) tmp = sin(re); elseif (im <= 2.05e+101) tmp = Float64(2.0 * (re ^ -2.0)); elseif (im <= 9.2e+151) tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * (re ^ 2.0)))); else tmp = Float64(re * Float64(1.0 + Float64(0.5 * (im ^ 2.0)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.1e+15) tmp = sin(re); elseif (im <= 2.05e+101) tmp = 2.0 * (re ^ -2.0); elseif (im <= 9.2e+151) tmp = re * (1.0 + (-0.16666666666666666 * (re ^ 2.0))); else tmp = re * (1.0 + (0.5 * (im ^ 2.0))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.1e+15], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.05e+101], N[(2.0 * N[Power[re, -2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 9.2e+151], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.05 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot {re}^{-2}\\
\mathbf{elif}\;im \leq 9.2 \cdot 10^{+151}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot {re}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 2.1e15Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 2.1e15 < im < 2.05e101Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.5%
count-22.5%
Simplified2.5%
Applied egg-rr12.2%
Taylor expanded in re around 0 12.1%
if 2.05e101 < im < 9.2000000000000003e151Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.1%
Taylor expanded in re around 0 41.3%
if 9.2000000000000003e151 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in re around 0 77.9%
(FPCore (re im)
:precision binary64
(if (<= im 2.1e+15)
(sin re)
(if (<= im 1.3e+101)
(* 2.0 (pow re -2.0))
(if (<= im 9.2e+151)
(* re (+ 1.0 (* -0.16666666666666666 (pow re 2.0))))
(* re (* 0.5 (pow im 2.0)))))))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = sin(re);
} else if (im <= 1.3e+101) {
tmp = 2.0 * pow(re, -2.0);
} else if (im <= 9.2e+151) {
tmp = re * (1.0 + (-0.16666666666666666 * pow(re, 2.0)));
} else {
tmp = re * (0.5 * pow(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 <= 2.1d+15) then
tmp = sin(re)
else if (im <= 1.3d+101) then
tmp = 2.0d0 * (re ** (-2.0d0))
else if (im <= 9.2d+151) then
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re ** 2.0d0)))
else
tmp = re * (0.5d0 * (im ** 2.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = Math.sin(re);
} else if (im <= 1.3e+101) {
tmp = 2.0 * Math.pow(re, -2.0);
} else if (im <= 9.2e+151) {
tmp = re * (1.0 + (-0.16666666666666666 * Math.pow(re, 2.0)));
} else {
tmp = re * (0.5 * Math.pow(im, 2.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.1e+15: tmp = math.sin(re) elif im <= 1.3e+101: tmp = 2.0 * math.pow(re, -2.0) elif im <= 9.2e+151: tmp = re * (1.0 + (-0.16666666666666666 * math.pow(re, 2.0))) else: tmp = re * (0.5 * math.pow(im, 2.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.1e+15) tmp = sin(re); elseif (im <= 1.3e+101) tmp = Float64(2.0 * (re ^ -2.0)); elseif (im <= 9.2e+151) tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * (re ^ 2.0)))); else tmp = Float64(re * Float64(0.5 * (im ^ 2.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.1e+15) tmp = sin(re); elseif (im <= 1.3e+101) tmp = 2.0 * (re ^ -2.0); elseif (im <= 9.2e+151) tmp = re * (1.0 + (-0.16666666666666666 * (re ^ 2.0))); else tmp = re * (0.5 * (im ^ 2.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.1e+15], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.3e+101], N[(2.0 * N[Power[re, -2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 9.2e+151], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.3 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot {re}^{-2}\\
\mathbf{elif}\;im \leq 9.2 \cdot 10^{+151}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot {re}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 2.1e15Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 2.1e15 < im < 1.3e101Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.5%
count-22.5%
Simplified2.5%
Applied egg-rr12.2%
Taylor expanded in re around 0 12.1%
if 1.3e101 < im < 9.2000000000000003e151Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.1%
Taylor expanded in re around 0 41.3%
if 9.2000000000000003e151 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in re around 0 77.9%
Taylor expanded in im around inf 77.9%
associate-*r*77.9%
*-commutative77.9%
Simplified77.9%
(FPCore (re im)
:precision binary64
(if (<= im 2.1e+15)
(sin re)
(if (<= im 2.5e+101)
(* 2.0 (pow re -2.0))
(if (<= im 9.2e+151)
(* -0.16666666666666666 (pow re 3.0))
(* re (* 0.5 (pow im 2.0)))))))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = sin(re);
} else if (im <= 2.5e+101) {
tmp = 2.0 * pow(re, -2.0);
} else if (im <= 9.2e+151) {
tmp = -0.16666666666666666 * pow(re, 3.0);
} else {
tmp = re * (0.5 * pow(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 <= 2.1d+15) then
tmp = sin(re)
else if (im <= 2.5d+101) then
tmp = 2.0d0 * (re ** (-2.0d0))
else if (im <= 9.2d+151) then
tmp = (-0.16666666666666666d0) * (re ** 3.0d0)
else
tmp = re * (0.5d0 * (im ** 2.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = Math.sin(re);
} else if (im <= 2.5e+101) {
tmp = 2.0 * Math.pow(re, -2.0);
} else if (im <= 9.2e+151) {
tmp = -0.16666666666666666 * Math.pow(re, 3.0);
} else {
tmp = re * (0.5 * Math.pow(im, 2.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.1e+15: tmp = math.sin(re) elif im <= 2.5e+101: tmp = 2.0 * math.pow(re, -2.0) elif im <= 9.2e+151: tmp = -0.16666666666666666 * math.pow(re, 3.0) else: tmp = re * (0.5 * math.pow(im, 2.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.1e+15) tmp = sin(re); elseif (im <= 2.5e+101) tmp = Float64(2.0 * (re ^ -2.0)); elseif (im <= 9.2e+151) tmp = Float64(-0.16666666666666666 * (re ^ 3.0)); else tmp = Float64(re * Float64(0.5 * (im ^ 2.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.1e+15) tmp = sin(re); elseif (im <= 2.5e+101) tmp = 2.0 * (re ^ -2.0); elseif (im <= 9.2e+151) tmp = -0.16666666666666666 * (re ^ 3.0); else tmp = re * (0.5 * (im ^ 2.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.1e+15], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.5e+101], N[(2.0 * N[Power[re, -2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 9.2e+151], N[(-0.16666666666666666 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision], N[(re * N[(0.5 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot {re}^{-2}\\
\mathbf{elif}\;im \leq 9.2 \cdot 10^{+151}:\\
\;\;\;\;-0.16666666666666666 \cdot {re}^{3}\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 2.1e15Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 2.1e15 < im < 2.49999999999999994e101Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.5%
count-22.5%
Simplified2.5%
Applied egg-rr12.2%
Taylor expanded in re around 0 12.1%
if 2.49999999999999994e101 < im < 9.2000000000000003e151Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.1%
Taylor expanded in re around 0 41.3%
Taylor expanded in re around inf 40.7%
if 9.2000000000000003e151 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.3%
*-lft-identity97.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in re around 0 77.9%
Taylor expanded in im around inf 77.9%
associate-*r*77.9%
*-commutative77.9%
Simplified77.9%
(FPCore (re im)
:precision binary64
(if (<= im 2.1e+15)
(sin re)
(if (or (<= im 1.05e+101) (not (<= im 7.5e+259)))
(* 2.0 (pow re -2.0))
(* -0.16666666666666666 (pow re 3.0)))))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = sin(re);
} else if ((im <= 1.05e+101) || !(im <= 7.5e+259)) {
tmp = 2.0 * pow(re, -2.0);
} else {
tmp = -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 <= 2.1d+15) then
tmp = sin(re)
else if ((im <= 1.05d+101) .or. (.not. (im <= 7.5d+259))) then
tmp = 2.0d0 * (re ** (-2.0d0))
else
tmp = (-0.16666666666666666d0) * (re ** 3.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = Math.sin(re);
} else if ((im <= 1.05e+101) || !(im <= 7.5e+259)) {
tmp = 2.0 * Math.pow(re, -2.0);
} else {
tmp = -0.16666666666666666 * Math.pow(re, 3.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.1e+15: tmp = math.sin(re) elif (im <= 1.05e+101) or not (im <= 7.5e+259): tmp = 2.0 * math.pow(re, -2.0) else: tmp = -0.16666666666666666 * math.pow(re, 3.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.1e+15) tmp = sin(re); elseif ((im <= 1.05e+101) || !(im <= 7.5e+259)) tmp = Float64(2.0 * (re ^ -2.0)); else tmp = Float64(-0.16666666666666666 * (re ^ 3.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.1e+15) tmp = sin(re); elseif ((im <= 1.05e+101) || ~((im <= 7.5e+259))) tmp = 2.0 * (re ^ -2.0); else tmp = -0.16666666666666666 * (re ^ 3.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.1e+15], N[Sin[re], $MachinePrecision], If[Or[LessEqual[im, 1.05e+101], N[Not[LessEqual[im, 7.5e+259]], $MachinePrecision]], N[(2.0 * N[Power[re, -2.0], $MachinePrecision]), $MachinePrecision], N[(-0.16666666666666666 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.05 \cdot 10^{+101} \lor \neg \left(im \leq 7.5 \cdot 10^{+259}\right):\\
\;\;\;\;2 \cdot {re}^{-2}\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot {re}^{3}\\
\end{array}
\end{array}
if im < 2.1e15Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 2.1e15 < im < 1.05e101 or 7.4999999999999995e259 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.5%
count-22.5%
Simplified2.5%
Applied egg-rr8.2%
Taylor expanded in re around 0 8.0%
if 1.05e101 < im < 7.4999999999999995e259Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 2.8%
Taylor expanded in re around 0 27.8%
Taylor expanded in re around inf 27.3%
Final simplification52.4%
(FPCore (re im)
:precision binary64
(if (<= im 2.1e+15)
(sin re)
(if (or (<= im 1.35e+101) (not (<= im 3.4e+260)))
(pow re -2.0)
(* -0.16666666666666666 (pow re 3.0)))))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = sin(re);
} else if ((im <= 1.35e+101) || !(im <= 3.4e+260)) {
tmp = pow(re, -2.0);
} else {
tmp = -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 <= 2.1d+15) then
tmp = sin(re)
else if ((im <= 1.35d+101) .or. (.not. (im <= 3.4d+260))) then
tmp = re ** (-2.0d0)
else
tmp = (-0.16666666666666666d0) * (re ** 3.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = Math.sin(re);
} else if ((im <= 1.35e+101) || !(im <= 3.4e+260)) {
tmp = Math.pow(re, -2.0);
} else {
tmp = -0.16666666666666666 * Math.pow(re, 3.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.1e+15: tmp = math.sin(re) elif (im <= 1.35e+101) or not (im <= 3.4e+260): tmp = math.pow(re, -2.0) else: tmp = -0.16666666666666666 * math.pow(re, 3.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.1e+15) tmp = sin(re); elseif ((im <= 1.35e+101) || !(im <= 3.4e+260)) tmp = re ^ -2.0; else tmp = Float64(-0.16666666666666666 * (re ^ 3.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.1e+15) tmp = sin(re); elseif ((im <= 1.35e+101) || ~((im <= 3.4e+260))) tmp = re ^ -2.0; else tmp = -0.16666666666666666 * (re ^ 3.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.1e+15], N[Sin[re], $MachinePrecision], If[Or[LessEqual[im, 1.35e+101], N[Not[LessEqual[im, 3.4e+260]], $MachinePrecision]], N[Power[re, -2.0], $MachinePrecision], N[(-0.16666666666666666 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+101} \lor \neg \left(im \leq 3.4 \cdot 10^{+260}\right):\\
\;\;\;\;{re}^{-2}\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot {re}^{3}\\
\end{array}
\end{array}
if im < 2.1e15Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 2.1e15 < im < 1.35000000000000003e101 or 3.3999999999999998e260 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 2.5%
Applied egg-rr8.2%
Taylor expanded in re around 0 8.0%
if 1.35000000000000003e101 < im < 3.3999999999999998e260Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 2.8%
Taylor expanded in re around 0 27.8%
Taylor expanded in re around inf 27.3%
Final simplification52.4%
(FPCore (re im) :precision binary64 (if (<= im 2.1e+15) (sin re) (pow re -2.0)))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = sin(re);
} else {
tmp = pow(re, -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 <= 2.1d+15) then
tmp = sin(re)
else
tmp = re ** (-2.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2.1e+15) {
tmp = Math.sin(re);
} else {
tmp = Math.pow(re, -2.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.1e+15: tmp = math.sin(re) else: tmp = math.pow(re, -2.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.1e+15) tmp = sin(re); else tmp = re ^ -2.0; end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.1e+15) tmp = sin(re); else tmp = re ^ -2.0; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.1e+15], N[Sin[re], $MachinePrecision], N[Power[re, -2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;{re}^{-2}\\
\end{array}
\end{array}
if im < 2.1e15Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 64.1%
if 2.1e15 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 2.7%
Applied egg-rr9.7%
Taylor expanded in re around 0 9.5%
(FPCore (re im) :precision binary64 (sin re))
double code(double re, double im) {
return sin(re);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sin(re)
end function
public static double code(double re, double im) {
return Math.sin(re);
}
def code(re, im): return math.sin(re)
function code(re, im) return sin(re) end
function tmp = code(re, im) tmp = sin(re); end
code[re_, im_] := N[Sin[re], $MachinePrecision]
\begin{array}{l}
\\
\sin re
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 48.5%
(FPCore (re im) :precision binary64 re)
double code(double re, double im) {
return re;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re
end function
public static double code(double re, double im) {
return re;
}
def code(re, im): return re
function code(re, im) return re end
function tmp = code(re, im) tmp = re; end
code[re_, im_] := re
\begin{array}{l}
\\
re
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 48.5%
Taylor expanded in re around 0 25.0%
(FPCore (re im) :precision binary64 1.0)
double code(double re, double im) {
return 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0
end function
public static double code(double re, double im) {
return 1.0;
}
def code(re, im): return 1.0
function code(re, im) return 1.0 end
function tmp = code(re, im) tmp = 1.0; end
code[re_, im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr4.8%
+-inverses4.8%
+-rgt-identity4.8%
*-inverses4.8%
Simplified4.8%
(FPCore (re im) :precision binary64 0.0)
double code(double re, double im) {
return 0.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.0d0
end function
public static double code(double re, double im) {
return 0.0;
}
def code(re, im): return 0.0
function code(re, im) return 0.0 end
function tmp = code(re, im) tmp = 0.0; end
code[re_, im_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Applied egg-rr2.8%
pow-base-12.8%
metadata-eval2.8%
Simplified2.8%
herbie shell --seed 2024101
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))