
(FPCore (re im) :precision binary64 (* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))
double code(double re, double im) {
return (0.5 * cos(re)) * (exp(-im) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * cos(re)) * (exp(-im) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp(-im) + Math.exp(im));
}
def code(re, im): return (0.5 * math.cos(re)) * (math.exp(-im) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(-im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) * (exp(-im) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 29 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))
double code(double re, double im) {
return (0.5 * cos(re)) * (exp(-im) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * cos(re)) * (exp(-im) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp(-im) + Math.exp(im));
}
def code(re, im): return (0.5 * math.cos(re)) * (math.exp(-im) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(-im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) * (exp(-im) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (* (cos re) (cosh im)))
double code(double re, double im) {
return cos(re) * cosh(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = cos(re) * cosh(im)
end function
public static double code(double re, double im) {
return Math.cos(re) * Math.cosh(im);
}
def code(re, im): return math.cos(re) * math.cosh(im)
function code(re, im) return Float64(cos(re) * cosh(im)) end
function tmp = code(re, im) tmp = cos(re) * cosh(im); end
code[re_, im_] := N[(N[Cos[re], $MachinePrecision] * N[Cosh[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos re \cdot \cosh im
\end{array}
Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
*-lowering-*.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))
(if (<= im 235.0)
(* (cos re) (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_0)))))))
(if (<= im 4.6e+51)
(cosh im)
(* (cos re) (+ 1.0 (* t_0 (* im (* im (* im im))))))))))
double code(double re, double im) {
double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double tmp;
if (im <= 235.0) {
tmp = cos(re) * (1.0 + (im * (im * (0.5 + (im * (im * t_0))))));
} else if (im <= 4.6e+51) {
tmp = cosh(im);
} else {
tmp = cos(re) * (1.0 + (t_0 * (im * (im * (im * im)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
if (im <= 235.0d0) then
tmp = cos(re) * (1.0d0 + (im * (im * (0.5d0 + (im * (im * t_0))))))
else if (im <= 4.6d+51) then
tmp = cosh(im)
else
tmp = cos(re) * (1.0d0 + (t_0 * (im * (im * (im * im)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double tmp;
if (im <= 235.0) {
tmp = Math.cos(re) * (1.0 + (im * (im * (0.5 + (im * (im * t_0))))));
} else if (im <= 4.6e+51) {
tmp = Math.cosh(im);
} else {
tmp = Math.cos(re) * (1.0 + (t_0 * (im * (im * (im * im)))));
}
return tmp;
}
def code(re, im): t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889) tmp = 0 if im <= 235.0: tmp = math.cos(re) * (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) elif im <= 4.6e+51: tmp = math.cosh(im) else: tmp = math.cos(re) * (1.0 + (t_0 * (im * (im * (im * im))))) return tmp
function code(re, im) t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)) tmp = 0.0 if (im <= 235.0) tmp = Float64(cos(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_0))))))); elseif (im <= 4.6e+51) tmp = cosh(im); else tmp = Float64(cos(re) * Float64(1.0 + Float64(t_0 * Float64(im * Float64(im * Float64(im * im)))))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889); tmp = 0.0; if (im <= 235.0) tmp = cos(re) * (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))); elseif (im <= 4.6e+51) tmp = cosh(im); else tmp = cos(re) * (1.0 + (t_0 * (im * (im * (im * im))))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 235.0], N[(N[Cos[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[Cosh[im], $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(1.0 + N[(t$95$0 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
\mathbf{if}\;im \leq 235:\\
\;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\right)\\
\mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left(1 + t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 235Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in im around 0
Simplified93.2%
if 235 < im < 4.6000000000000001e51Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
*-lowering-*.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified86.7%
if 4.6000000000000001e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in im around 0
Simplified100.0%
Final simplification94.1%
(FPCore (re im)
:precision binary64
(if (<= im 3.7e-9)
(cos re)
(if (<= im 4.6e+51)
(cosh im)
(*
(cos re)
(+
1.0
(*
(+ 0.041666666666666664 (* (* im im) 0.001388888888888889))
(* im (* im (* im im)))))))))
double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = cos(re);
} else if (im <= 4.6e+51) {
tmp = cosh(im);
} else {
tmp = cos(re) * (1.0 + ((0.041666666666666664 + ((im * im) * 0.001388888888888889)) * (im * (im * (im * im)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3.7d-9) then
tmp = cos(re)
else if (im <= 4.6d+51) then
tmp = cosh(im)
else
tmp = cos(re) * (1.0d0 + ((0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)) * (im * (im * (im * im)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = Math.cos(re);
} else if (im <= 4.6e+51) {
tmp = Math.cosh(im);
} else {
tmp = Math.cos(re) * (1.0 + ((0.041666666666666664 + ((im * im) * 0.001388888888888889)) * (im * (im * (im * im)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.7e-9: tmp = math.cos(re) elif im <= 4.6e+51: tmp = math.cosh(im) else: tmp = math.cos(re) * (1.0 + ((0.041666666666666664 + ((im * im) * 0.001388888888888889)) * (im * (im * (im * im))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 4.6e+51) tmp = cosh(im); else tmp = Float64(cos(re) * Float64(1.0 + Float64(Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)) * Float64(im * Float64(im * Float64(im * im)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 4.6e+51) tmp = cosh(im); else tmp = cos(re) * (1.0 + ((0.041666666666666664 + ((im * im) * 0.001388888888888889)) * (im * (im * (im * im))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 4.6e+51], N[Cosh[im], $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(1.0 + N[(N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision] * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left(1 + \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6463.1%
Simplified63.1%
if 3.7e-9 < im < 4.6000000000000001e51Initial program 99.9%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f6499.9%
Applied egg-rr99.9%
*-lowering-*.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f6499.9%
Applied egg-rr99.9%
Taylor expanded in re around 0
Simplified82.4%
if 4.6000000000000001e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in im around 0
Simplified100.0%
Final simplification71.5%
(FPCore (re im)
:precision binary64
(if (<= im 3.7e-9)
(cos re)
(if (<= im 1.4e+77)
(cosh im)
(*
(cos re)
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))))))
double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = cos(re);
} else if (im <= 1.4e+77) {
tmp = cosh(im);
} else {
tmp = cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3.7d-9) then
tmp = cos(re)
else if (im <= 1.4d+77) then
tmp = cosh(im)
else
tmp = cos(re) * (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = Math.cos(re);
} else if (im <= 1.4e+77) {
tmp = Math.cosh(im);
} else {
tmp = Math.cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.7e-9: tmp = math.cos(re) elif im <= 1.4e+77: tmp = math.cosh(im) else: tmp = math.cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.4e+77) tmp = cosh(im); else tmp = Float64(cos(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.4e+77) tmp = cosh(im); else tmp = cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 1.4e+77], N[Cosh[im], $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+77}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
\end{array}
\end{array}
if im < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6463.1%
Simplified63.1%
if 3.7e-9 < im < 1.4e77Initial program 99.9%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f6499.9%
Applied egg-rr99.9%
*-lowering-*.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f6499.9%
Applied egg-rr99.9%
Taylor expanded in re around 0
Simplified73.1%
if 1.4e77 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Final simplification69.9%
(FPCore (re im)
:precision binary64
(if (<= im 3.7e-9)
(cos re)
(if (<= im 1.4e+77)
(cosh im)
(* (cos re) (+ 1.0 (* im (* im (* 0.041666666666666664 (* im im)))))))))
double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = cos(re);
} else if (im <= 1.4e+77) {
tmp = cosh(im);
} else {
tmp = cos(re) * (1.0 + (im * (im * (0.041666666666666664 * (im * im)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3.7d-9) then
tmp = cos(re)
else if (im <= 1.4d+77) then
tmp = cosh(im)
else
tmp = cos(re) * (1.0d0 + (im * (im * (0.041666666666666664d0 * (im * im)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = Math.cos(re);
} else if (im <= 1.4e+77) {
tmp = Math.cosh(im);
} else {
tmp = Math.cos(re) * (1.0 + (im * (im * (0.041666666666666664 * (im * im)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.7e-9: tmp = math.cos(re) elif im <= 1.4e+77: tmp = math.cosh(im) else: tmp = math.cos(re) * (1.0 + (im * (im * (0.041666666666666664 * (im * im))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.4e+77) tmp = cosh(im); else tmp = Float64(cos(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.041666666666666664 * Float64(im * im)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.4e+77) tmp = cosh(im); else tmp = cos(re) * (1.0 + (im * (im * (0.041666666666666664 * (im * im))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 1.4e+77], N[Cosh[im], $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+77}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6463.1%
Simplified63.1%
if 3.7e-9 < im < 1.4e77Initial program 99.9%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f6499.9%
Applied egg-rr99.9%
*-lowering-*.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f6499.9%
Applied egg-rr99.9%
Taylor expanded in re around 0
Simplified73.1%
if 1.4e77 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification69.9%
(FPCore (re im)
:precision binary64
(if (<= im 3.7e-9)
(cos re)
(if (<= im 1.4e+77)
(cosh im)
(* (cos re) (* im (* im (* 0.041666666666666664 (* im im))))))))
double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = cos(re);
} else if (im <= 1.4e+77) {
tmp = cosh(im);
} else {
tmp = cos(re) * (im * (im * (0.041666666666666664 * (im * im))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3.7d-9) then
tmp = cos(re)
else if (im <= 1.4d+77) then
tmp = cosh(im)
else
tmp = cos(re) * (im * (im * (0.041666666666666664d0 * (im * im))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = Math.cos(re);
} else if (im <= 1.4e+77) {
tmp = Math.cosh(im);
} else {
tmp = Math.cos(re) * (im * (im * (0.041666666666666664 * (im * im))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.7e-9: tmp = math.cos(re) elif im <= 1.4e+77: tmp = math.cosh(im) else: tmp = math.cos(re) * (im * (im * (0.041666666666666664 * (im * im)))) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.4e+77) tmp = cosh(im); else tmp = Float64(cos(re) * Float64(im * Float64(im * Float64(0.041666666666666664 * Float64(im * im))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.4e+77) tmp = cosh(im); else tmp = cos(re) * (im * (im * (0.041666666666666664 * (im * im)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 1.4e+77], N[Cosh[im], $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(im * N[(im * N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+77}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6463.1%
Simplified63.1%
if 3.7e-9 < im < 1.4e77Initial program 99.9%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f6499.9%
Applied egg-rr99.9%
*-lowering-*.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f6499.9%
Applied egg-rr99.9%
Taylor expanded in re around 0
Simplified73.1%
if 1.4e77 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification69.9%
(FPCore (re im) :precision binary64 (if (<= im 3.7e-9) (cos re) (if (<= im 1.35e+154) (cosh im) (* (cos re) (* 0.5 (* im im))))))
double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = cos(re);
} else if (im <= 1.35e+154) {
tmp = cosh(im);
} else {
tmp = cos(re) * (0.5 * (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3.7d-9) then
tmp = cos(re)
else if (im <= 1.35d+154) then
tmp = cosh(im)
else
tmp = cos(re) * (0.5d0 * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = Math.cos(re);
} else if (im <= 1.35e+154) {
tmp = Math.cosh(im);
} else {
tmp = Math.cos(re) * (0.5 * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.7e-9: tmp = math.cos(re) elif im <= 1.35e+154: tmp = math.cosh(im) else: tmp = math.cos(re) * (0.5 * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.35e+154) tmp = cosh(im); else tmp = Float64(cos(re) * Float64(0.5 * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.35e+154) tmp = cosh(im); else tmp = cos(re) * (0.5 * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[Cosh[im], $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6463.1%
Simplified63.1%
if 3.7e-9 < im < 1.35000000000000003e154Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
*-lowering-*.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified71.1%
if 1.35000000000000003e154 < im Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification68.4%
(FPCore (re im)
:precision binary64
(if (<= im 3.7e-9)
(cos re)
(if (<= im 2e+132)
(cosh im)
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332))))))
double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = cos(re);
} else if (im <= 2e+132) {
tmp = cosh(im);
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3.7d-9) then
tmp = cos(re)
else if (im <= 2d+132) then
tmp = cosh(im)
else
tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3.7e-9) {
tmp = Math.cos(re);
} else if (im <= 2e+132) {
tmp = Math.cosh(im);
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.7e-9: tmp = math.cos(re) elif im <= 2e+132: tmp = math.cosh(im) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 2e+132) tmp = cosh(im); else tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 2e+132) tmp = cosh(im); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 2e+132], N[Cosh[im], $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 2 \cdot 10^{+132}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
\end{array}
\end{array}
if im < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6463.1%
Simplified63.1%
if 3.7e-9 < im < 1.99999999999999998e132Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
*-lowering-*.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified72.2%
if 1.99999999999999998e132 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Final simplification66.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))
(t_1
(+
0.5
(*
(* im im)
(+ 0.041666666666666664 (* im (* im 0.001388888888888889))))))
(t_2 (* (* im im) t_1)))
(if (<= im 3.7e-9)
(cos re)
(if (<= im 1.45e+26)
(*
(+ 1.0 (* (* re re) (+ -0.5 (* re (* re 0.041666666666666664)))))
(+ (* t_0 (* im (* im (* im im)))) (+ 1.0 (* 0.5 (* im im)))))
(if (<= im 4.6e+51)
(/ (+ (* im (* (* im t_1) t_2)) -1.0) (+ t_2 -1.0))
(*
(+ 1.0 (* im (* im (+ 0.5 (* im (* im t_0))))))
(+ 1.0 (* re (* re -0.5)))))))))
double code(double re, double im) {
double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double t_1 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))));
double t_2 = (im * im) * t_1;
double tmp;
if (im <= 3.7e-9) {
tmp = cos(re);
} else if (im <= 1.45e+26) {
tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
} else if (im <= 4.6e+51) {
tmp = ((im * ((im * t_1) * t_2)) + -1.0) / (t_2 + -1.0);
} else {
tmp = (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
t_1 = 0.5d0 + ((im * im) * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))))
t_2 = (im * im) * t_1
if (im <= 3.7d-9) then
tmp = cos(re)
else if (im <= 1.45d+26) then
tmp = (1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * 0.041666666666666664d0))))) * ((t_0 * (im * (im * (im * im)))) + (1.0d0 + (0.5d0 * (im * im))))
else if (im <= 4.6d+51) then
tmp = ((im * ((im * t_1) * t_2)) + (-1.0d0)) / (t_2 + (-1.0d0))
else
tmp = (1.0d0 + (im * (im * (0.5d0 + (im * (im * t_0)))))) * (1.0d0 + (re * (re * (-0.5d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double t_1 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))));
double t_2 = (im * im) * t_1;
double tmp;
if (im <= 3.7e-9) {
tmp = Math.cos(re);
} else if (im <= 1.45e+26) {
tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
} else if (im <= 4.6e+51) {
tmp = ((im * ((im * t_1) * t_2)) + -1.0) / (t_2 + -1.0);
} else {
tmp = (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
def code(re, im): t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889) t_1 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))) t_2 = (im * im) * t_1 tmp = 0 if im <= 3.7e-9: tmp = math.cos(re) elif im <= 1.45e+26: tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im)))) elif im <= 4.6e+51: tmp = ((im * ((im * t_1) * t_2)) + -1.0) / (t_2 + -1.0) else: tmp = (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) * (1.0 + (re * (re * -0.5))) return tmp
function code(re, im) t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)) t_1 = Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889))))) t_2 = Float64(Float64(im * im) * t_1) tmp = 0.0 if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.45e+26) tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * 0.041666666666666664))))) * Float64(Float64(t_0 * Float64(im * Float64(im * Float64(im * im)))) + Float64(1.0 + Float64(0.5 * Float64(im * im))))); elseif (im <= 4.6e+51) tmp = Float64(Float64(Float64(im * Float64(Float64(im * t_1) * t_2)) + -1.0) / Float64(t_2 + -1.0)); else tmp = Float64(Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_0)))))) * Float64(1.0 + Float64(re * Float64(re * -0.5)))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889); t_1 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))); t_2 = (im * im) * t_1; tmp = 0.0; if (im <= 3.7e-9) tmp = cos(re); elseif (im <= 1.45e+26) tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im)))); elseif (im <= 4.6e+51) tmp = ((im * ((im * t_1) * t_2)) + -1.0) / (t_2 + -1.0); else tmp = (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) * (1.0 + (re * (re * -0.5))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(im * im), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 1.45e+26], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(N[(N[(im * N[(N[(im * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
t_1 := 0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\\
t_2 := \left(im \cdot im\right) \cdot t\_1\\
\mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 1.45 \cdot 10^{+26}:\\
\;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;\frac{im \cdot \left(\left(im \cdot t\_1\right) \cdot t\_2\right) + -1}{t\_2 + -1}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if im < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6463.1%
Simplified63.1%
if 3.7e-9 < im < 1.45e26Initial program 99.8%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified16.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6439.0%
Simplified39.0%
if 1.45e26 < im < 4.6000000000000001e51Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified6.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified5.6%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr88.9%
if 4.6000000000000001e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
Simplified75.5%
Final simplification65.7%
(FPCore (re im)
:precision binary64
(let* ((t_0
(+
0.5
(*
(* im im)
(+ 0.041666666666666664 (* im (* im 0.001388888888888889))))))
(t_1 (* (* im im) t_0)))
(if (<= im 4.6e+51)
(/ (+ (* im (* (* im t_0) t_1)) -1.0) (+ t_1 -1.0))
(*
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(*
im
(+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))))
(+ 1.0 (* re (* re -0.5)))))))
double code(double re, double im) {
double t_0 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))));
double t_1 = (im * im) * t_0;
double tmp;
if (im <= 4.6e+51) {
tmp = ((im * ((im * t_0) * t_1)) + -1.0) / (t_1 + -1.0);
} else {
tmp = (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))) * (1.0 + (re * (re * -0.5)));
}
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 + ((im * im) * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))))
t_1 = (im * im) * t_0
if (im <= 4.6d+51) then
tmp = ((im * ((im * t_0) * t_1)) + (-1.0d0)) / (t_1 + (-1.0d0))
else
tmp = (1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))))) * (1.0d0 + (re * (re * (-0.5d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))));
double t_1 = (im * im) * t_0;
double tmp;
if (im <= 4.6e+51) {
tmp = ((im * ((im * t_0) * t_1)) + -1.0) / (t_1 + -1.0);
} else {
tmp = (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))) * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
def code(re, im): t_0 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))) t_1 = (im * im) * t_0 tmp = 0 if im <= 4.6e+51: tmp = ((im * ((im * t_0) * t_1)) + -1.0) / (t_1 + -1.0) else: tmp = (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))) * (1.0 + (re * (re * -0.5))) return tmp
function code(re, im) t_0 = Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889))))) t_1 = Float64(Float64(im * im) * t_0) tmp = 0.0 if (im <= 4.6e+51) tmp = Float64(Float64(Float64(im * Float64(Float64(im * t_0) * t_1)) + -1.0) / Float64(t_1 + -1.0)); else tmp = Float64(Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))))))) * Float64(1.0 + Float64(re * Float64(re * -0.5)))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))); t_1 = (im * im) * t_0; tmp = 0.0; if (im <= 4.6e+51) tmp = ((im * ((im * t_0) * t_1)) + -1.0) / (t_1 + -1.0); else tmp = (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))) * (1.0 + (re * (re * -0.5))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[im, 4.6e+51], N[(N[(N[(im * N[(N[(im * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\\
t_1 := \left(im \cdot im\right) \cdot t\_0\\
\mathbf{if}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;\frac{im \cdot \left(\left(im \cdot t\_0\right) \cdot t\_1\right) + -1}{t\_1 + -1}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if im < 4.6000000000000001e51Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified86.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified55.7%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr39.3%
if 4.6000000000000001e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
Simplified75.5%
Final simplification46.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 0.041666666666666664 (* im (* im 0.001388888888888889))))
(t_1 (* (* im im) t_0))
(t_2 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))
(t_3 (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_2))))))))
(if (<= im 380.0)
t_3
(if (<= im 9.5e+30)
(*
(+ 1.0 (* (* re re) (+ -0.5 (* re (* re 0.041666666666666664)))))
(+ (* t_2 (* im (* im (* im im)))) (+ 1.0 (* 0.5 (* im im)))))
(if (<= im 4.6e+51)
(+
1.0
(* im (/ (* im (- 0.25 (* (* im im) (* t_0 t_1)))) (- 0.5 t_1))))
(* t_3 (+ 1.0 (* re (* re -0.5)))))))))
double code(double re, double im) {
double t_0 = 0.041666666666666664 + (im * (im * 0.001388888888888889));
double t_1 = (im * im) * t_0;
double t_2 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double t_3 = 1.0 + (im * (im * (0.5 + (im * (im * t_2)))));
double tmp;
if (im <= 380.0) {
tmp = t_3;
} else if (im <= 9.5e+30) {
tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_2 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
} else if (im <= 4.6e+51) {
tmp = 1.0 + (im * ((im * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
} else {
tmp = t_3 * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = 0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))
t_1 = (im * im) * t_0
t_2 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
t_3 = 1.0d0 + (im * (im * (0.5d0 + (im * (im * t_2)))))
if (im <= 380.0d0) then
tmp = t_3
else if (im <= 9.5d+30) then
tmp = (1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * 0.041666666666666664d0))))) * ((t_2 * (im * (im * (im * im)))) + (1.0d0 + (0.5d0 * (im * im))))
else if (im <= 4.6d+51) then
tmp = 1.0d0 + (im * ((im * (0.25d0 - ((im * im) * (t_0 * t_1)))) / (0.5d0 - t_1)))
else
tmp = t_3 * (1.0d0 + (re * (re * (-0.5d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.041666666666666664 + (im * (im * 0.001388888888888889));
double t_1 = (im * im) * t_0;
double t_2 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double t_3 = 1.0 + (im * (im * (0.5 + (im * (im * t_2)))));
double tmp;
if (im <= 380.0) {
tmp = t_3;
} else if (im <= 9.5e+30) {
tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_2 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
} else if (im <= 4.6e+51) {
tmp = 1.0 + (im * ((im * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
} else {
tmp = t_3 * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
def code(re, im): t_0 = 0.041666666666666664 + (im * (im * 0.001388888888888889)) t_1 = (im * im) * t_0 t_2 = 0.041666666666666664 + ((im * im) * 0.001388888888888889) t_3 = 1.0 + (im * (im * (0.5 + (im * (im * t_2))))) tmp = 0 if im <= 380.0: tmp = t_3 elif im <= 9.5e+30: tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_2 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im)))) elif im <= 4.6e+51: tmp = 1.0 + (im * ((im * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1))) else: tmp = t_3 * (1.0 + (re * (re * -0.5))) return tmp
function code(re, im) t_0 = Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889))) t_1 = Float64(Float64(im * im) * t_0) t_2 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)) t_3 = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_2)))))) tmp = 0.0 if (im <= 380.0) tmp = t_3; elseif (im <= 9.5e+30) tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * 0.041666666666666664))))) * Float64(Float64(t_2 * Float64(im * Float64(im * Float64(im * im)))) + Float64(1.0 + Float64(0.5 * Float64(im * im))))); elseif (im <= 4.6e+51) tmp = Float64(1.0 + Float64(im * Float64(Float64(im * Float64(0.25 - Float64(Float64(im * im) * Float64(t_0 * t_1)))) / Float64(0.5 - t_1)))); else tmp = Float64(t_3 * Float64(1.0 + Float64(re * Float64(re * -0.5)))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.041666666666666664 + (im * (im * 0.001388888888888889)); t_1 = (im * im) * t_0; t_2 = 0.041666666666666664 + ((im * im) * 0.001388888888888889); t_3 = 1.0 + (im * (im * (0.5 + (im * (im * t_2))))); tmp = 0.0; if (im <= 380.0) tmp = t_3; elseif (im <= 9.5e+30) tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_2 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im)))); elseif (im <= 4.6e+51) tmp = 1.0 + (im * ((im * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1))); else tmp = t_3 * (1.0 + (re * (re * -0.5))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 380.0], t$95$3, If[LessEqual[im, 9.5e+30], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$2 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(1.0 + N[(im * N[(N[(im * N[(0.25 - N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.5 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\\
t_1 := \left(im \cdot im\right) \cdot t\_0\\
t_2 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
t_3 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_2\right)\right)\right)\\
\mathbf{if}\;im \leq 380:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;im \leq 9.5 \cdot 10^{+30}:\\
\;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_2 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;1 + im \cdot \frac{im \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_1\right)\right)}{0.5 - t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if im < 380Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
if 380 < im < 9.5000000000000003e30Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified4.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.5%
Simplified51.5%
if 9.5000000000000003e30 < im < 4.6000000000000001e51Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified6.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified5.8%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr72.2%
if 4.6000000000000001e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
Simplified75.5%
Final simplification62.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* im im)))
(t_1 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))
(t_2 (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_1)))))))
(t_3 (* im (* im 0.001388888888888889))))
(if (<= im 320.0)
t_2
(if (<= im 9.5e+30)
(*
(+ 1.0 (* (* re re) (+ -0.5 (* re (* re 0.041666666666666664)))))
(+ (* t_1 (* im t_0)) (+ 1.0 (* 0.5 (* im im)))))
(if (<= im 4.6e+51)
(+
1.0
(*
im
(*
im
(+
0.5
(/
(*
(* im im)
(+ 7.233796296296296e-5 (* t_0 (* t_0 2.6791838134430728e-9))))
(+
0.001736111111111111
(* t_3 (- t_3 0.041666666666666664))))))))
(* t_2 (+ 1.0 (* re (* re -0.5)))))))))
double code(double re, double im) {
double t_0 = im * (im * im);
double t_1 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double t_2 = 1.0 + (im * (im * (0.5 + (im * (im * t_1)))));
double t_3 = im * (im * 0.001388888888888889);
double tmp;
if (im <= 320.0) {
tmp = t_2;
} else if (im <= 9.5e+30) {
tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_1 * (im * t_0)) + (1.0 + (0.5 * (im * im))));
} else if (im <= 4.6e+51) {
tmp = 1.0 + (im * (im * (0.5 + (((im * im) * (7.233796296296296e-5 + (t_0 * (t_0 * 2.6791838134430728e-9)))) / (0.001736111111111111 + (t_3 * (t_3 - 0.041666666666666664)))))));
} else {
tmp = t_2 * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = im * (im * im)
t_1 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
t_2 = 1.0d0 + (im * (im * (0.5d0 + (im * (im * t_1)))))
t_3 = im * (im * 0.001388888888888889d0)
if (im <= 320.0d0) then
tmp = t_2
else if (im <= 9.5d+30) then
tmp = (1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * 0.041666666666666664d0))))) * ((t_1 * (im * t_0)) + (1.0d0 + (0.5d0 * (im * im))))
else if (im <= 4.6d+51) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (((im * im) * (7.233796296296296d-5 + (t_0 * (t_0 * 2.6791838134430728d-9)))) / (0.001736111111111111d0 + (t_3 * (t_3 - 0.041666666666666664d0)))))))
else
tmp = t_2 * (1.0d0 + (re * (re * (-0.5d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (im * im);
double t_1 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double t_2 = 1.0 + (im * (im * (0.5 + (im * (im * t_1)))));
double t_3 = im * (im * 0.001388888888888889);
double tmp;
if (im <= 320.0) {
tmp = t_2;
} else if (im <= 9.5e+30) {
tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_1 * (im * t_0)) + (1.0 + (0.5 * (im * im))));
} else if (im <= 4.6e+51) {
tmp = 1.0 + (im * (im * (0.5 + (((im * im) * (7.233796296296296e-5 + (t_0 * (t_0 * 2.6791838134430728e-9)))) / (0.001736111111111111 + (t_3 * (t_3 - 0.041666666666666664)))))));
} else {
tmp = t_2 * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
def code(re, im): t_0 = im * (im * im) t_1 = 0.041666666666666664 + ((im * im) * 0.001388888888888889) t_2 = 1.0 + (im * (im * (0.5 + (im * (im * t_1))))) t_3 = im * (im * 0.001388888888888889) tmp = 0 if im <= 320.0: tmp = t_2 elif im <= 9.5e+30: tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_1 * (im * t_0)) + (1.0 + (0.5 * (im * im)))) elif im <= 4.6e+51: tmp = 1.0 + (im * (im * (0.5 + (((im * im) * (7.233796296296296e-5 + (t_0 * (t_0 * 2.6791838134430728e-9)))) / (0.001736111111111111 + (t_3 * (t_3 - 0.041666666666666664))))))) else: tmp = t_2 * (1.0 + (re * (re * -0.5))) return tmp
function code(re, im) t_0 = Float64(im * Float64(im * im)) t_1 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)) t_2 = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_1)))))) t_3 = Float64(im * Float64(im * 0.001388888888888889)) tmp = 0.0 if (im <= 320.0) tmp = t_2; elseif (im <= 9.5e+30) tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * 0.041666666666666664))))) * Float64(Float64(t_1 * Float64(im * t_0)) + Float64(1.0 + Float64(0.5 * Float64(im * im))))); elseif (im <= 4.6e+51) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(Float64(im * im) * Float64(7.233796296296296e-5 + Float64(t_0 * Float64(t_0 * 2.6791838134430728e-9)))) / Float64(0.001736111111111111 + Float64(t_3 * Float64(t_3 - 0.041666666666666664)))))))); else tmp = Float64(t_2 * Float64(1.0 + Float64(re * Float64(re * -0.5)))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (im * im); t_1 = 0.041666666666666664 + ((im * im) * 0.001388888888888889); t_2 = 1.0 + (im * (im * (0.5 + (im * (im * t_1))))); t_3 = im * (im * 0.001388888888888889); tmp = 0.0; if (im <= 320.0) tmp = t_2; elseif (im <= 9.5e+30) tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_1 * (im * t_0)) + (1.0 + (0.5 * (im * im)))); elseif (im <= 4.6e+51) tmp = 1.0 + (im * (im * (0.5 + (((im * im) * (7.233796296296296e-5 + (t_0 * (t_0 * 2.6791838134430728e-9)))) / (0.001736111111111111 + (t_3 * (t_3 - 0.041666666666666664))))))); else tmp = t_2 * (1.0 + (re * (re * -0.5))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 320.0], t$95$2, If[LessEqual[im, 9.5e+30], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(N[(im * im), $MachinePrecision] * N[(7.233796296296296e-5 + N[(t$95$0 * N[(t$95$0 * 2.6791838134430728e-9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.001736111111111111 + N[(t$95$3 * N[(t$95$3 - 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(im \cdot im\right)\\
t_1 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
t_2 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_1\right)\right)\right)\\
t_3 := im \cdot \left(im \cdot 0.001388888888888889\right)\\
\mathbf{if}\;im \leq 320:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;im \leq 9.5 \cdot 10^{+30}:\\
\;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_1 \cdot \left(im \cdot t\_0\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + \frac{\left(im \cdot im\right) \cdot \left(7.233796296296296 \cdot 10^{-5} + t\_0 \cdot \left(t\_0 \cdot 2.6791838134430728 \cdot 10^{-9}\right)\right)}{0.001736111111111111 + t\_3 \cdot \left(t\_3 - 0.041666666666666664\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if im < 320Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
if 320 < im < 9.5000000000000003e30Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified4.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.5%
Simplified51.5%
if 9.5000000000000003e30 < im < 4.6000000000000001e51Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified6.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified5.8%
associate-*r*N/A
flip3-+N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr58.7%
if 4.6000000000000001e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
Simplified75.5%
Final simplification62.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))
(if (<= im 360.0)
(+ 1.0 (* im (* im (+ 0.5 (* im (* im t_0))))))
(if (<= im 5.2e+134)
(*
(+ 1.0 (* (* re re) (+ -0.5 (* re (* re 0.041666666666666664)))))
(+ (* t_0 (* im (* im (* im im)))) (+ 1.0 (* 0.5 (* im im)))))
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332)))))))
double code(double re, double im) {
double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double tmp;
if (im <= 360.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0)))));
} else if (im <= 5.2e+134) {
tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
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.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
if (im <= 360.0d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * t_0)))))
else if (im <= 5.2d+134) then
tmp = (1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * 0.041666666666666664d0))))) * ((t_0 * (im * (im * (im * im)))) + (1.0d0 + (0.5d0 * (im * im))))
else
tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
double tmp;
if (im <= 360.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0)))));
} else if (im <= 5.2e+134) {
tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889) tmp = 0 if im <= 360.0: tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0))))) elif im <= 5.2e+134: tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im)))) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)) tmp = 0.0 if (im <= 360.0) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_0)))))); elseif (im <= 5.2e+134) tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * 0.041666666666666664))))) * Float64(Float64(t_0 * Float64(im * Float64(im * Float64(im * im)))) + Float64(1.0 + Float64(0.5 * Float64(im * im))))); else tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889); tmp = 0.0; if (im <= 360.0) tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0))))); elseif (im <= 5.2e+134) tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im)))); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 360.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.2e+134], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
\mathbf{if}\;im \leq 360:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;im \leq 5.2 \cdot 10^{+134}:\\
\;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
\end{array}
\end{array}
if im < 360Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
if 360 < im < 5.2000000000000003e134Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified58.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.4%
Simplified51.4%
if 5.2000000000000003e134 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
(FPCore (re im)
:precision binary64
(let* ((t_0
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(*
im
(+
0.041666666666666664
(* (* im im) 0.001388888888888889))))))))))
(if (<= im 420.0)
t_0
(if (<= im 1.18e+51)
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(+ 1.0 (* (* re re) (+ -0.5 (* re (* re 0.041666666666666664))))))
(* t_0 (+ 1.0 (* re (* re -0.5))))))))
double code(double re, double im) {
double t_0 = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
double tmp;
if (im <= 420.0) {
tmp = t_0;
} else if (im <= 1.18e+51) {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664)))));
} else {
tmp = t_0 * (1.0 + (re * (re * -0.5)));
}
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 = 1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))))
if (im <= 420.0d0) then
tmp = t_0
else if (im <= 1.18d+51) then
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * 0.041666666666666664d0)))))
else
tmp = t_0 * (1.0d0 + (re * (re * (-0.5d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
double tmp;
if (im <= 420.0) {
tmp = t_0;
} else if (im <= 1.18e+51) {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664)))));
} else {
tmp = t_0 * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
def code(re, im): t_0 = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))) tmp = 0 if im <= 420.0: tmp = t_0 elif im <= 1.18e+51: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) else: tmp = t_0 * (1.0 + (re * (re * -0.5))) return tmp
function code(re, im) t_0 = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))))))) tmp = 0.0 if (im <= 420.0) tmp = t_0; elseif (im <= 1.18e+51) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im))))) * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * 0.041666666666666664)))))); else tmp = Float64(t_0 * Float64(1.0 + Float64(re * Float64(re * -0.5)))); end return tmp end
function tmp_2 = code(re, im) t_0 = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))); tmp = 0.0; if (im <= 420.0) tmp = t_0; elseif (im <= 1.18e+51) tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))); else tmp = t_0 * (1.0 + (re * (re * -0.5))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 420.0], t$95$0, If[LessEqual[im, 1.18e+51], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\
\mathbf{if}\;im \leq 420:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 1.18 \cdot 10^{+51}:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if im < 420Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
if 420 < im < 1.18e51Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified4.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6435.7%
Simplified35.7%
if 1.18e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
Simplified75.5%
Final simplification61.3%
(FPCore (re im)
:precision binary64
(let* ((t_0
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(*
im
(+
0.041666666666666664
(* (* im im) 0.001388888888888889))))))))))
(if (<= im 550.0)
t_0
(if (<= im 1.25e+51)
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(* 0.041666666666666664 (* (* re re) (* re re))))
(* t_0 (+ 1.0 (* re (* re -0.5))))))))
double code(double re, double im) {
double t_0 = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
double tmp;
if (im <= 550.0) {
tmp = t_0;
} else if (im <= 1.25e+51) {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (0.041666666666666664 * ((re * re) * (re * re)));
} else {
tmp = t_0 * (1.0 + (re * (re * -0.5)));
}
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 = 1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))))
if (im <= 550.0d0) then
tmp = t_0
else if (im <= 1.25d+51) then
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (0.041666666666666664d0 * ((re * re) * (re * re)))
else
tmp = t_0 * (1.0d0 + (re * (re * (-0.5d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
double tmp;
if (im <= 550.0) {
tmp = t_0;
} else if (im <= 1.25e+51) {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (0.041666666666666664 * ((re * re) * (re * re)));
} else {
tmp = t_0 * (1.0 + (re * (re * -0.5)));
}
return tmp;
}
def code(re, im): t_0 = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))) tmp = 0 if im <= 550.0: tmp = t_0 elif im <= 1.25e+51: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (0.041666666666666664 * ((re * re) * (re * re))) else: tmp = t_0 * (1.0 + (re * (re * -0.5))) return tmp
function code(re, im) t_0 = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))))))) tmp = 0.0 if (im <= 550.0) tmp = t_0; elseif (im <= 1.25e+51) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im))))) * Float64(0.041666666666666664 * Float64(Float64(re * re) * Float64(re * re)))); else tmp = Float64(t_0 * Float64(1.0 + Float64(re * Float64(re * -0.5)))); end return tmp end
function tmp_2 = code(re, im) t_0 = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))); tmp = 0.0; if (im <= 550.0) tmp = t_0; elseif (im <= 1.25e+51) tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (0.041666666666666664 * ((re * re) * (re * re))); else tmp = t_0 * (1.0 + (re * (re * -0.5))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 550.0], t$95$0, If[LessEqual[im, 1.25e+51], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 * N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\
\mathbf{if}\;im \leq 550:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 1.25 \cdot 10^{+51}:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(0.041666666666666664 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if im < 550Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
if 550 < im < 1.25e51Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified4.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6435.7%
Simplified35.7%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.6%
Simplified34.6%
if 1.25e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
Simplified75.5%
Final simplification61.3%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
im
(* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))
(if (<= im 550.0)
(+ 1.0 (* im (* im (+ 0.5 t_0))))
(if (<= im 4.6e+51)
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(* 0.041666666666666664 (* (* re re) (* re re))))
(if (<= im 4.1e+123)
(+ 1.0 (* (* im im) t_0))
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332))))))))
double code(double re, double im) {
double t_0 = im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)));
double tmp;
if (im <= 550.0) {
tmp = 1.0 + (im * (im * (0.5 + t_0)));
} else if (im <= 4.6e+51) {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (0.041666666666666664 * ((re * re) * (re * re)));
} else if (im <= 4.1e+123) {
tmp = 1.0 + ((im * im) * t_0);
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
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 = im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))
if (im <= 550.0d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + t_0)))
else if (im <= 4.6d+51) then
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (0.041666666666666664d0 * ((re * re) * (re * re)))
else if (im <= 4.1d+123) then
tmp = 1.0d0 + ((im * im) * t_0)
else
tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)));
double tmp;
if (im <= 550.0) {
tmp = 1.0 + (im * (im * (0.5 + t_0)));
} else if (im <= 4.6e+51) {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (0.041666666666666664 * ((re * re) * (re * re)));
} else if (im <= 4.1e+123) {
tmp = 1.0 + ((im * im) * t_0);
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): t_0 = im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))) tmp = 0 if im <= 550.0: tmp = 1.0 + (im * (im * (0.5 + t_0))) elif im <= 4.6e+51: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (0.041666666666666664 * ((re * re) * (re * re))) elif im <= 4.1e+123: tmp = 1.0 + ((im * im) * t_0) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) t_0 = Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))) tmp = 0.0 if (im <= 550.0) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + t_0)))); elseif (im <= 4.6e+51) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im))))) * Float64(0.041666666666666664 * Float64(Float64(re * re) * Float64(re * re)))); elseif (im <= 4.1e+123) tmp = Float64(1.0 + Float64(Float64(im * im) * t_0)); else tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))); tmp = 0.0; if (im <= 550.0) tmp = 1.0 + (im * (im * (0.5 + t_0))); elseif (im <= 4.6e+51) tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (0.041666666666666664 * ((re * re) * (re * re))); elseif (im <= 4.1e+123) tmp = 1.0 + ((im * im) * t_0); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 550.0], N[(1.0 + N[(im * N[(im * N[(0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 * N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.1e+123], N[(1.0 + N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\\
\mathbf{if}\;im \leq 550:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + t\_0\right)\right)\\
\mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(0.041666666666666664 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;im \leq 4.1 \cdot 10^{+123}:\\
\;\;\;\;1 + \left(im \cdot im\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
\end{array}
\end{array}
if im < 550Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
if 550 < im < 4.6000000000000001e51Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified4.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6435.7%
Simplified35.7%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.6%
Simplified34.6%
if 4.6000000000000001e51 < im < 4.09999999999999989e123Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified66.7%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.7%
Simplified66.7%
Taylor expanded in im around inf
+-commutativeN/A
distribute-lft-inN/A
Simplified66.7%
if 4.09999999999999989e123 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.9%
Simplified83.9%
Final simplification61.7%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
im
(* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))
(if (<= im 320.0)
(+ 1.0 (* im (* im (+ 0.5 t_0))))
(if (<= im 2.2e+51)
(*
(* 0.5 (* im im))
(+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re)))))))
(if (<= im 3.2e+123)
(+ 1.0 (* (* im im) t_0))
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332))))))))
double code(double re, double im) {
double t_0 = im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)));
double tmp;
if (im <= 320.0) {
tmp = 1.0 + (im * (im * (0.5 + t_0)));
} else if (im <= 2.2e+51) {
tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))));
} else if (im <= 3.2e+123) {
tmp = 1.0 + ((im * im) * t_0);
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
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 = im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))
if (im <= 320.0d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + t_0)))
else if (im <= 2.2d+51) then
tmp = (0.5d0 * (im * im)) * (1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re))))))
else if (im <= 3.2d+123) then
tmp = 1.0d0 + ((im * im) * t_0)
else
tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)));
double tmp;
if (im <= 320.0) {
tmp = 1.0 + (im * (im * (0.5 + t_0)));
} else if (im <= 2.2e+51) {
tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))));
} else if (im <= 3.2e+123) {
tmp = 1.0 + ((im * im) * t_0);
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): t_0 = im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))) tmp = 0 if im <= 320.0: tmp = 1.0 + (im * (im * (0.5 + t_0))) elif im <= 2.2e+51: tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))))) elif im <= 3.2e+123: tmp = 1.0 + ((im * im) * t_0) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) t_0 = Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))) tmp = 0.0 if (im <= 320.0) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + t_0)))); elseif (im <= 2.2e+51) tmp = Float64(Float64(0.5 * Float64(im * im)) * Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re))))))); elseif (im <= 3.2e+123) tmp = Float64(1.0 + Float64(Float64(im * im) * t_0)); else tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))); tmp = 0.0; if (im <= 320.0) tmp = 1.0 + (im * (im * (0.5 + t_0))); elseif (im <= 2.2e+51) tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))))); elseif (im <= 3.2e+123) tmp = 1.0 + ((im * im) * t_0); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 320.0], N[(1.0 + N[(im * N[(im * N[(0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.2e+51], N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.2e+123], N[(1.0 + N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\\
\mathbf{if}\;im \leq 320:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + t\_0\right)\right)\\
\mathbf{elif}\;im \leq 2.2 \cdot 10^{+51}:\\
\;\;\;\;\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\right)\\
\mathbf{elif}\;im \leq 3.2 \cdot 10^{+123}:\\
\;\;\;\;1 + \left(im \cdot im\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
\end{array}
\end{array}
if im < 320Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
if 320 < im < 2.19999999999999992e51Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.6%
Simplified3.6%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.6%
Simplified3.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.2%
Simplified29.2%
if 2.19999999999999992e51 < im < 3.20000000000000005e123Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified66.7%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.7%
Simplified66.7%
Taylor expanded in im around inf
+-commutativeN/A
distribute-lft-inN/A
Simplified66.7%
if 3.20000000000000005e123 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.9%
Simplified83.9%
Final simplification61.4%
(FPCore (re im)
:precision binary64
(if (<= im 360.0)
(+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
(if (<= im 4.2e+51)
(*
(* 0.5 (* im im))
(+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re)))))))
(if (<= im 8.2e+122)
(+
1.0
(*
(* im im)
(*
im
(* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332)))))))
double code(double re, double im) {
double tmp;
if (im <= 360.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (im <= 4.2e+51) {
tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))));
} else if (im <= 8.2e+122) {
tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 360.0d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
else if (im <= 4.2d+51) then
tmp = (0.5d0 * (im * im)) * (1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re))))))
else if (im <= 8.2d+122) then
tmp = 1.0d0 + ((im * im) * (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))
else
tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 360.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (im <= 4.2e+51) {
tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))));
} else if (im <= 8.2e+122) {
tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 360.0: tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))) elif im <= 4.2e+51: tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))))) elif im <= 8.2e+122: tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) tmp = 0.0 if (im <= 360.0) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); elseif (im <= 4.2e+51) tmp = Float64(Float64(0.5 * Float64(im * im)) * Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re))))))); elseif (im <= 8.2e+122) tmp = Float64(1.0 + Float64(Float64(im * im) * Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))))); else tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 360.0) tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))); elseif (im <= 4.2e+51) tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))))); elseif (im <= 8.2e+122) tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 360.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.2e+51], N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.2e+122], N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 360:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{+51}:\\
\;\;\;\;\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\right)\\
\mathbf{elif}\;im \leq 8.2 \cdot 10^{+122}:\\
\;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
\end{array}
\end{array}
if im < 360Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
Taylor expanded in im around 0
*-commutativeN/A
*-lowering-*.f6453.8%
Simplified53.8%
if 360 < im < 4.2000000000000002e51Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.6%
Simplified3.6%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.6%
Simplified3.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.2%
Simplified29.2%
if 4.2000000000000002e51 < im < 8.2000000000000004e122Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified66.7%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.7%
Simplified66.7%
Taylor expanded in im around inf
+-commutativeN/A
distribute-lft-inN/A
Simplified66.7%
if 8.2000000000000004e122 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.9%
Simplified83.9%
Final simplification56.9%
(FPCore (re im)
:precision binary64
(if (<= im 410.0)
(+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
(if (<= im 4.6e+51)
(+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re))))))
(if (<= im 1.4e+123)
(+
1.0
(*
(* im im)
(*
im
(* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332)))))))
double code(double re, double im) {
double tmp;
if (im <= 410.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (im <= 4.6e+51) {
tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
} else if (im <= 1.4e+123) {
tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 410.0d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
else if (im <= 4.6d+51) then
tmp = 1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
else if (im <= 1.4d+123) then
tmp = 1.0d0 + ((im * im) * (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))
else
tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 410.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (im <= 4.6e+51) {
tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
} else if (im <= 1.4e+123) {
tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 410.0: tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))) elif im <= 4.6e+51: tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))) elif im <= 1.4e+123: tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) tmp = 0.0 if (im <= 410.0) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); elseif (im <= 4.6e+51) tmp = Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re)))))); elseif (im <= 1.4e+123) tmp = Float64(1.0 + Float64(Float64(im * im) * Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))))); else tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 410.0) tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))); elseif (im <= 4.6e+51) tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))); elseif (im <= 1.4e+123) tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 410.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.4e+123], N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 410:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+123}:\\
\;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
\end{array}
\end{array}
if im < 410Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
Taylor expanded in im around 0
*-commutativeN/A
*-lowering-*.f6453.8%
Simplified53.8%
if 410 < im < 4.6000000000000001e51Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified4.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6435.7%
Simplified35.7%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6428.8%
Simplified28.8%
if 4.6000000000000001e51 < im < 1.40000000000000006e123Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified66.7%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.7%
Simplified66.7%
Taylor expanded in im around inf
+-commutativeN/A
distribute-lft-inN/A
Simplified66.7%
if 1.40000000000000006e123 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.9%
Simplified83.9%
(FPCore (re im)
:precision binary64
(if (<= im 950.0)
(+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
(if (<= im 3e+51)
(+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re))))))
(if (<= im 5e+123)
(+ 1.0 (* im (* im (* im (* im (* (* im im) 0.001388888888888889))))))
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332)))))))
double code(double re, double im) {
double tmp;
if (im <= 950.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (im <= 3e+51) {
tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
} else if (im <= 5e+123) {
tmp = 1.0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 950.0d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
else if (im <= 3d+51) then
tmp = 1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
else if (im <= 5d+123) then
tmp = 1.0d0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889d0)))))
else
tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 950.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (im <= 3e+51) {
tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
} else if (im <= 5e+123) {
tmp = 1.0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 950.0: tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))) elif im <= 3e+51: tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))) elif im <= 5e+123: tmp = 1.0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889))))) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) tmp = 0.0 if (im <= 950.0) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); elseif (im <= 3e+51) tmp = Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re)))))); elseif (im <= 5e+123) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(im * Float64(im * Float64(Float64(im * im) * 0.001388888888888889)))))); else tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 950.0) tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))); elseif (im <= 3e+51) tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))); elseif (im <= 5e+123) tmp = 1.0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889))))); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 950.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3e+51], N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5e+123], N[(1.0 + N[(im * N[(im * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 950:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;im \leq 3 \cdot 10^{+51}:\\
\;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+123}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
\end{array}
\end{array}
if im < 950Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
Taylor expanded in im around 0
*-commutativeN/A
*-lowering-*.f6453.8%
Simplified53.8%
if 950 < im < 3e51Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified4.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6435.7%
Simplified35.7%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6428.8%
Simplified28.8%
if 3e51 < im < 4.99999999999999974e123Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified66.7%
Taylor expanded in im around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.7%
Simplified66.7%
if 4.99999999999999974e123 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.9%
Simplified83.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))))
(if (<= im 400.0)
t_0
(if (<= im 6e+75)
(+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re))))))
(if (<= im 1.02e+139) t_0 (* (* im im) (+ 0.5 (* (* re re) -0.25))))))))
double code(double re, double im) {
double t_0 = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
double tmp;
if (im <= 400.0) {
tmp = t_0;
} else if (im <= 6e+75) {
tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
} else if (im <= 1.02e+139) {
tmp = t_0;
} else {
tmp = (im * im) * (0.5 + ((re * re) * -0.25));
}
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 = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
if (im <= 400.0d0) then
tmp = t_0
else if (im <= 6d+75) then
tmp = 1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
else if (im <= 1.02d+139) then
tmp = t_0
else
tmp = (im * im) * (0.5d0 + ((re * re) * (-0.25d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
double tmp;
if (im <= 400.0) {
tmp = t_0;
} else if (im <= 6e+75) {
tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
} else if (im <= 1.02e+139) {
tmp = t_0;
} else {
tmp = (im * im) * (0.5 + ((re * re) * -0.25));
}
return tmp;
}
def code(re, im): t_0 = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))) tmp = 0 if im <= 400.0: tmp = t_0 elif im <= 6e+75: tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))) elif im <= 1.02e+139: tmp = t_0 else: tmp = (im * im) * (0.5 + ((re * re) * -0.25)) return tmp
function code(re, im) t_0 = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))) tmp = 0.0 if (im <= 400.0) tmp = t_0; elseif (im <= 6e+75) tmp = Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re)))))); elseif (im <= 1.02e+139) tmp = t_0; else tmp = Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(re * re) * -0.25))); end return tmp end
function tmp_2 = code(re, im) t_0 = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))); tmp = 0.0; if (im <= 400.0) tmp = t_0; elseif (im <= 6e+75) tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))); elseif (im <= 1.02e+139) tmp = t_0; else tmp = (im * im) * (0.5 + ((re * re) * -0.25)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 400.0], t$95$0, If[LessEqual[im, 6e+75], N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.02e+139], t$95$0, N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{if}\;im \leq 400:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 6 \cdot 10^{+75}:\\
\;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;im \leq 1.02 \cdot 10^{+139}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if im < 400 or 6e75 < im < 1.02e139Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified60.6%
Taylor expanded in im around 0
*-commutativeN/A
*-lowering-*.f6454.6%
Simplified54.6%
if 400 < im < 6e75Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified5.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.6%
Simplified36.6%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.9%
Simplified27.9%
if 1.02e139 < im Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.8%
Simplified96.8%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.8%
Simplified96.8%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6482.8%
Simplified82.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) (+ 0.5 (* (* re re) -0.25)))))
(if (<= im 760000.0)
(+ 1.0 (* 0.5 (* im im)))
(if (<= im 2.15e+77)
t_0
(if (<= im 1.02e+139)
(* im (* im (* 0.041666666666666664 (* im im))))
t_0)))))
double code(double re, double im) {
double t_0 = (im * im) * (0.5 + ((re * re) * -0.25));
double tmp;
if (im <= 760000.0) {
tmp = 1.0 + (0.5 * (im * im));
} else if (im <= 2.15e+77) {
tmp = t_0;
} else if (im <= 1.02e+139) {
tmp = im * (im * (0.041666666666666664 * (im * im)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (im * im) * (0.5d0 + ((re * re) * (-0.25d0)))
if (im <= 760000.0d0) then
tmp = 1.0d0 + (0.5d0 * (im * im))
else if (im <= 2.15d+77) then
tmp = t_0
else if (im <= 1.02d+139) then
tmp = im * (im * (0.041666666666666664d0 * (im * im)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (im * im) * (0.5 + ((re * re) * -0.25));
double tmp;
if (im <= 760000.0) {
tmp = 1.0 + (0.5 * (im * im));
} else if (im <= 2.15e+77) {
tmp = t_0;
} else if (im <= 1.02e+139) {
tmp = im * (im * (0.041666666666666664 * (im * im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * (0.5 + ((re * re) * -0.25)) tmp = 0 if im <= 760000.0: tmp = 1.0 + (0.5 * (im * im)) elif im <= 2.15e+77: tmp = t_0 elif im <= 1.02e+139: tmp = im * (im * (0.041666666666666664 * (im * im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(re * re) * -0.25))) tmp = 0.0 if (im <= 760000.0) tmp = Float64(1.0 + Float64(0.5 * Float64(im * im))); elseif (im <= 2.15e+77) tmp = t_0; elseif (im <= 1.02e+139) tmp = Float64(im * Float64(im * Float64(0.041666666666666664 * Float64(im * im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (im * im) * (0.5 + ((re * re) * -0.25)); tmp = 0.0; if (im <= 760000.0) tmp = 1.0 + (0.5 * (im * im)); elseif (im <= 2.15e+77) tmp = t_0; elseif (im <= 1.02e+139) tmp = im * (im * (0.041666666666666664 * (im * im))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 760000.0], N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.15e+77], t$95$0, If[LessEqual[im, 1.02e+139], N[(im * N[(im * N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\
\mathbf{if}\;im \leq 760000:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;im \leq 2.15 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 1.02 \cdot 10^{+139}:\\
\;\;\;\;im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if im < 7.6e5Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.3%
Simplified79.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.9%
Simplified47.9%
if 7.6e5 < im < 2.14999999999999996e77 or 1.02e139 < im Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.8%
Simplified54.8%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.8%
Simplified54.8%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.9%
Simplified51.9%
if 2.14999999999999996e77 < im < 1.02e139Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified100.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.7%
Simplified72.7%
Final simplification49.8%
(FPCore (re im)
:precision binary64
(if (<= im 380.0)
(+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
(if (<= im 1.05e+51)
(+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re))))))
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332))))))
double code(double re, double im) {
double tmp;
if (im <= 380.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (im <= 1.05e+51) {
tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 380.0d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
else if (im <= 1.05d+51) then
tmp = 1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
else
tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 380.0) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (im <= 1.05e+51) {
tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 380.0: tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))) elif im <= 1.05e+51: tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) tmp = 0.0 if (im <= 380.0) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); elseif (im <= 1.05e+51) tmp = Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re)))))); else tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 380.0) tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))); elseif (im <= 1.05e+51) tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 380.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.05e+51], N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 380:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;im \leq 1.05 \cdot 10^{+51}:\\
\;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
\end{array}
\end{array}
if im < 380Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified59.7%
Taylor expanded in im around 0
*-commutativeN/A
*-lowering-*.f6453.8%
Simplified53.8%
if 380 < im < 1.0500000000000001e51Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified4.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6435.7%
Simplified35.7%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6428.8%
Simplified28.8%
if 1.0500000000000001e51 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified83.2%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.2%
Simplified83.2%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6471.8%
Simplified71.8%
(FPCore (re im) :precision binary64 (if (<= re 3.1e+86) (+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664)))))) (* (* im im) (+ 0.5 (* (* re re) -0.25)))))
double code(double re, double im) {
double tmp;
if (re <= 3.1e+86) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else {
tmp = (im * im) * (0.5 + ((re * re) * -0.25));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 3.1d+86) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
else
tmp = (im * im) * (0.5d0 + ((re * re) * (-0.25d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 3.1e+86) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
} else {
tmp = (im * im) * (0.5 + ((re * re) * -0.25));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 3.1e+86: tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))) else: tmp = (im * im) * (0.5 + ((re * re) * -0.25)) return tmp
function code(re, im) tmp = 0.0 if (re <= 3.1e+86) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); else tmp = Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(re * re) * -0.25))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 3.1e+86) tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664))))); else tmp = (im * im) * (0.5 + ((re * re) * -0.25)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 3.1e+86], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 3.1 \cdot 10^{+86}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if re < 3.1000000000000002e86Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified89.4%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified64.6%
Taylor expanded in im around 0
*-commutativeN/A
*-lowering-*.f6458.4%
Simplified58.4%
if 3.1000000000000002e86 < re Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6471.3%
Simplified71.3%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.8%
Simplified17.8%
Taylor expanded in re around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.6%
Simplified17.6%
(FPCore (re im) :precision binary64 (if (<= im 235.0) (+ 1.0 (* 0.5 (* im im))) (* im (* im (* 0.041666666666666664 (* im im))))))
double code(double re, double im) {
double tmp;
if (im <= 235.0) {
tmp = 1.0 + (0.5 * (im * im));
} else {
tmp = im * (im * (0.041666666666666664 * (im * im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 235.0d0) then
tmp = 1.0d0 + (0.5d0 * (im * im))
else
tmp = im * (im * (0.041666666666666664d0 * (im * im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 235.0) {
tmp = 1.0 + (0.5 * (im * im));
} else {
tmp = im * (im * (0.041666666666666664 * (im * im)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 235.0: tmp = 1.0 + (0.5 * (im * im)) else: tmp = im * (im * (0.041666666666666664 * (im * im))) return tmp
function code(re, im) tmp = 0.0 if (im <= 235.0) tmp = Float64(1.0 + Float64(0.5 * Float64(im * im))); else tmp = Float64(im * Float64(im * Float64(0.041666666666666664 * Float64(im * im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 235.0) tmp = 1.0 + (0.5 * (im * im)); else tmp = im * (im * (0.041666666666666664 * (im * im))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 235.0], N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(im * N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 235:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
\end{array}
\end{array}
if im < 235Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.3%
Simplified79.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.9%
Simplified47.9%
if 235 < im Initial program 100.0%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
associate-+r+N/A
+-commutativeN/A
Simplified64.7%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.7%
Simplified64.7%
Taylor expanded in re around 0
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6445.4%
Simplified45.4%
Final simplification47.3%
(FPCore (re im) :precision binary64 (if (<= re 2.15e+139) (+ 1.0 (* 0.5 (* im im))) (+ 1.0 (* re (* re -0.5)))))
double code(double re, double im) {
double tmp;
if (re <= 2.15e+139) {
tmp = 1.0 + (0.5 * (im * im));
} else {
tmp = 1.0 + (re * (re * -0.5));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.15d+139) then
tmp = 1.0d0 + (0.5d0 * (im * im))
else
tmp = 1.0d0 + (re * (re * (-0.5d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.15e+139) {
tmp = 1.0 + (0.5 * (im * im));
} else {
tmp = 1.0 + (re * (re * -0.5));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.15e+139: tmp = 1.0 + (0.5 * (im * im)) else: tmp = 1.0 + (re * (re * -0.5)) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.15e+139) tmp = Float64(1.0 + Float64(0.5 * Float64(im * im))); else tmp = Float64(1.0 + Float64(re * Float64(re * -0.5))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.15e+139) tmp = 1.0 + (0.5 * (im * im)); else tmp = 1.0 + (re * (re * -0.5)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.15e+139], N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.15 \cdot 10^{+139}:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;1 + re \cdot \left(re \cdot -0.5\right)\\
\end{array}
\end{array}
if re < 2.1499999999999999e139Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.6%
Simplified70.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.2%
Simplified48.2%
if 2.1499999999999999e139 < re Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6461.2%
Simplified61.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6418.0%
Simplified18.0%
(FPCore (re im) :precision binary64 (if (<= im 235.0) 1.0 (* 0.5 (* im im))))
double code(double re, double im) {
double tmp;
if (im <= 235.0) {
tmp = 1.0;
} else {
tmp = 0.5 * (im * im);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 235.0d0) then
tmp = 1.0d0
else
tmp = 0.5d0 * (im * im)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 235.0) {
tmp = 1.0;
} else {
tmp = 0.5 * (im * im);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 235.0: tmp = 1.0 else: tmp = 0.5 * (im * im) return tmp
function code(re, im) tmp = 0.0 if (im <= 235.0) tmp = 1.0; else tmp = Float64(0.5 * Float64(im * im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 235.0) tmp = 1.0; else tmp = 0.5 * (im * im); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 235.0], 1.0, N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 235:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot im\right)\\
\end{array}
\end{array}
if im < 235Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6462.9%
Simplified62.9%
Taylor expanded in re around 0
Simplified35.1%
if 235 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified77.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
Simplified52.7%
Taylor expanded in im around 0
Simplified33.1%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6433.1%
Simplified33.1%
(FPCore (re im) :precision binary64 (+ 1.0 (* 0.5 (* im im))))
double code(double re, double im) {
return 1.0 + (0.5 * (im * im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0 + (0.5d0 * (im * im))
end function
public static double code(double re, double im) {
return 1.0 + (0.5 * (im * im));
}
def code(re, im): return 1.0 + (0.5 * (im * im))
function code(re, im) return Float64(1.0 + Float64(0.5 * Float64(im * im))) end
function tmp = code(re, im) tmp = 1.0 + (0.5 * (im * im)); end
code[re_, im_] := N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + 0.5 \cdot \left(im \cdot im\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-rgt1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6471.1%
Simplified71.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6444.2%
Simplified44.2%
(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%
Taylor expanded in im around 0
cos-lowering-cos.f6447.9%
Simplified47.9%
Taylor expanded in re around 0
Simplified26.9%
herbie shell --seed 2024139
(FPCore (re im)
:name "math.cos on complex, real part"
:precision binary64
(* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))