
(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 21 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 (/ (* 0.5 (cos re)) (/ 1.0 (* 2.0 (cosh im)))))
double code(double re, double im) {
return (0.5 * cos(re)) / (1.0 / (2.0 * cosh(im)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * cos(re)) / (1.0d0 / (2.0d0 * cosh(im)))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) / (1.0 / (2.0 * Math.cosh(im)));
}
def code(re, im): return (0.5 * math.cos(re)) / (1.0 / (2.0 * math.cosh(im)))
function code(re, im) return Float64(Float64(0.5 * cos(re)) / Float64(1.0 / Float64(2.0 * cosh(im)))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) / (1.0 / (2.0 * cosh(im))); end
code[re_, im_] := N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(2.0 * N[Cosh[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5 \cdot \cos re}{\frac{1}{2 \cdot \cosh im}}
\end{array}
Initial program 100.0%
flip-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
cosh-undefN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
(FPCore (re im)
:precision binary64
(if (<= (cos re) 0.985)
(*
(cos re)
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(*
im
(+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))))))))
(cosh im)))
double code(double re, double im) {
double tmp;
if (cos(re) <= 0.985) {
tmp = cos(re) * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))));
} else {
tmp = cosh(im);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (cos(re) <= 0.985d0) then
tmp = cos(re) * (1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0))))))))
else
tmp = cosh(im)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.cos(re) <= 0.985) {
tmp = Math.cos(re) * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))));
} else {
tmp = Math.cosh(im);
}
return tmp;
}
def code(re, im): tmp = 0 if math.cos(re) <= 0.985: tmp = math.cos(re) * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))) else: tmp = math.cosh(im) return tmp
function code(re, im) tmp = 0.0 if (cos(re) <= 0.985) tmp = Float64(cos(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))))))); else tmp = cosh(im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (cos(re) <= 0.985) tmp = cos(re) * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))); else tmp = cosh(im); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Cos[re], $MachinePrecision], 0.985], N[(N[Cos[re], $MachinePrecision] * 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]), $MachinePrecision], N[Cosh[im], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos re \leq 0.985:\\
\;\;\;\;\cos re \cdot \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)\\
\mathbf{else}:\\
\;\;\;\;\cosh im\\
\end{array}
\end{array}
if (cos.f64 re) < 0.984999999999999987Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified94.9%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
Simplified94.9%
if 0.984999999999999987 < (cos.f64 re) 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%
Taylor expanded in re around 0
Simplified99.0%
Final simplification97.1%
(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
(*
(cos re)
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im))))))))
(if (<= im 0.017) t_0 (if (<= im 2.6e+77) (cosh im) t_0))))
double code(double re, double im) {
double t_0 = cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im)))));
double tmp;
if (im <= 0.017) {
tmp = t_0;
} else if (im <= 2.6e+77) {
tmp = cosh(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 = cos(re) * (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im)))))
if (im <= 0.017d0) then
tmp = t_0
else if (im <= 2.6d+77) then
tmp = cosh(im)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im)))));
double tmp;
if (im <= 0.017) {
tmp = t_0;
} else if (im <= 2.6e+77) {
tmp = Math.cosh(im);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) tmp = 0 if im <= 0.017: tmp = t_0 elif im <= 2.6e+77: tmp = math.cosh(im) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(cos(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im)))))) tmp = 0.0 if (im <= 0.017) tmp = t_0; elseif (im <= 2.6e+77) tmp = cosh(im); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))); tmp = 0.0; if (im <= 0.017) tmp = t_0; elseif (im <= 2.6e+77) tmp = cosh(im); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = 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]}, If[LessEqual[im, 0.017], t$95$0, If[LessEqual[im, 2.6e+77], N[Cosh[im], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{if}\;im \leq 0.017:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if im < 0.017000000000000001 or 2.6000000000000002e77 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified92.3%
if 0.017000000000000001 < im < 2.6000000000000002e77Initial 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
Simplified92.3%
Final simplification92.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* 0.5 (cos re)) (+ 2.0 (* im im)))))
(if (<= im 0.015)
t_0
(if (<= im 5e+80)
(cosh im)
(if (<= im 1.35e+154)
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(+ 1.0 (* (* re re) -0.5)))
t_0)))))
double code(double re, double im) {
double t_0 = (0.5 * cos(re)) * (2.0 + (im * im));
double tmp;
if (im <= 0.015) {
tmp = t_0;
} else if (im <= 5e+80) {
tmp = cosh(im);
} else if (im <= 1.35e+154) {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (0.5d0 * cos(re)) * (2.0d0 + (im * im))
if (im <= 0.015d0) then
tmp = t_0
else if (im <= 5d+80) then
tmp = cosh(im)
else if (im <= 1.35d+154) then
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (1.0d0 + ((re * re) * (-0.5d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (0.5 * Math.cos(re)) * (2.0 + (im * im));
double tmp;
if (im <= 0.015) {
tmp = t_0;
} else if (im <= 5e+80) {
tmp = Math.cosh(im);
} else if (im <= 1.35e+154) {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (0.5 * math.cos(re)) * (2.0 + (im * im)) tmp = 0 if im <= 0.015: tmp = t_0 elif im <= 5e+80: tmp = math.cosh(im) elif im <= 1.35e+154: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(0.5 * cos(re)) * Float64(2.0 + Float64(im * im))) tmp = 0.0 if (im <= 0.015) tmp = t_0; elseif (im <= 5e+80) tmp = cosh(im); elseif (im <= 1.35e+154) 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) * -0.5))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (0.5 * cos(re)) * (2.0 + (im * im)); tmp = 0.0; if (im <= 0.015) tmp = t_0; elseif (im <= 5e+80) tmp = cosh(im); elseif (im <= 1.35e+154) tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.015], t$95$0, If[LessEqual[im, 5e+80], N[Cosh[im], $MachinePrecision], If[LessEqual[im, 1.35e+154], 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] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.5 \cdot \cos re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{if}\;im \leq 0.015:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+80}:\\
\;\;\;\;\cosh im\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\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 -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if im < 0.014999999999999999 or 1.35000000000000003e154 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6482.1%
Simplified82.1%
if 0.014999999999999999 < im < 4.99999999999999961e80Initial 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
Simplified85.7%
if 4.99999999999999961e80 < im < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
Final simplification81.9%
(FPCore (re im)
:precision binary64
(if (<= im 7e-7)
(cos re)
(if (<= im 5e+80)
(cosh im)
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(+ 1.0 (* (* re re) -0.5))))))
double code(double re, double im) {
double tmp;
if (im <= 7e-7) {
tmp = cos(re);
} else if (im <= 5e+80) {
tmp = cosh(im);
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (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 (im <= 7d-7) then
tmp = cos(re)
else if (im <= 5d+80) then
tmp = cosh(im)
else
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (1.0d0 + ((re * re) * (-0.5d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 7e-7) {
tmp = Math.cos(re);
} else if (im <= 5e+80) {
tmp = Math.cosh(im);
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 7e-7: tmp = math.cos(re) elif im <= 5e+80: tmp = math.cosh(im) else: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)) return tmp
function code(re, im) tmp = 0.0 if (im <= 7e-7) tmp = cos(re); elseif (im <= 5e+80) tmp = cosh(im); else 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) * -0.5))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 7e-7) tmp = cos(re); elseif (im <= 5e+80) tmp = cosh(im); else tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 7e-7], N[Cos[re], $MachinePrecision], If[LessEqual[im, 5e+80], N[Cosh[im], $MachinePrecision], 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] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 7 \cdot 10^{-7}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+80}:\\
\;\;\;\;\cosh im\\
\mathbf{else}:\\
\;\;\;\;\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 -0.5\right)\\
\end{array}
\end{array}
if im < 6.99999999999999968e-7Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6466.1%
Simplified66.1%
if 6.99999999999999968e-7 < im < 4.99999999999999961e80Initial 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.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
Simplified87.5%
if 4.99999999999999961e80 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.2%
Simplified79.2%
Final simplification69.9%
(FPCore (re im)
:precision binary64
(let* ((t_0
(* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))))
(if (<= im 9.2e-7)
(cos re)
(if (<= im 8e+69)
(+
1.0
(/
(* (* im im) (- 0.25 (* (* im im) (* t_0 t_0))))
(- 0.5 (* im t_0))))
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(+ 1.0 (* (* re re) -0.5)))))))
double code(double re, double im) {
double t_0 = im * (0.041666666666666664 + ((im * im) * 0.001388888888888889));
double tmp;
if (im <= 9.2e-7) {
tmp = cos(re);
} else if (im <= 8e+69) {
tmp = 1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_0)))) / (0.5 - (im * t_0)));
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (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 = im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0))
if (im <= 9.2d-7) then
tmp = cos(re)
else if (im <= 8d+69) then
tmp = 1.0d0 + (((im * im) * (0.25d0 - ((im * im) * (t_0 * t_0)))) / (0.5d0 - (im * t_0)))
else
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (1.0d0 + ((re * re) * (-0.5d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (0.041666666666666664 + ((im * im) * 0.001388888888888889));
double tmp;
if (im <= 9.2e-7) {
tmp = Math.cos(re);
} else if (im <= 8e+69) {
tmp = 1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_0)))) / (0.5 - (im * t_0)));
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5));
}
return tmp;
}
def code(re, im): t_0 = im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)) tmp = 0 if im <= 9.2e-7: tmp = math.cos(re) elif im <= 8e+69: tmp = 1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_0)))) / (0.5 - (im * t_0))) else: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)) return tmp
function code(re, im) t_0 = Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))) tmp = 0.0 if (im <= 9.2e-7) tmp = cos(re); elseif (im <= 8e+69) tmp = Float64(1.0 + Float64(Float64(Float64(im * im) * Float64(0.25 - Float64(Float64(im * im) * Float64(t_0 * t_0)))) / Float64(0.5 - Float64(im * t_0)))); else 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) * -0.5))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)); tmp = 0.0; if (im <= 9.2e-7) tmp = cos(re); elseif (im <= 8e+69) tmp = 1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_0)))) / (0.5 - (im * t_0))); else tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 9.2e-7], N[Cos[re], $MachinePrecision], If[LessEqual[im, 8e+69], N[(1.0 + N[(N[(N[(im * im), $MachinePrecision] * N[(0.25 - N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\\
\mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 8 \cdot 10^{+69}:\\
\;\;\;\;1 + \frac{\left(im \cdot im\right) \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_0\right)\right)}{0.5 - im \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\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 -0.5\right)\\
\end{array}
\end{array}
if im < 9.1999999999999998e-7Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6466.1%
Simplified66.1%
if 9.1999999999999998e-7 < im < 8.0000000000000006e69Initial program 99.9%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified49.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified49.6%
associate-*r*N/A
flip-+N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr74.2%
if 8.0000000000000006e69 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.6%
Simplified79.6%
Final simplification69.2%
(FPCore (re im)
:precision binary64
(let* ((t_0
(* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))))
(if (<= im 8.5e+69)
(+
1.0
(/ (* (* im im) (- 0.25 (* (* im im) (* t_0 t_0)))) (- 0.5 (* im t_0))))
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(+ 1.0 (* (* re re) -0.5))))))
double code(double re, double im) {
double t_0 = im * (0.041666666666666664 + ((im * im) * 0.001388888888888889));
double tmp;
if (im <= 8.5e+69) {
tmp = 1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_0)))) / (0.5 - (im * t_0)));
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (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 = im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0))
if (im <= 8.5d+69) then
tmp = 1.0d0 + (((im * im) * (0.25d0 - ((im * im) * (t_0 * t_0)))) / (0.5d0 - (im * t_0)))
else
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (1.0d0 + ((re * re) * (-0.5d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (0.041666666666666664 + ((im * im) * 0.001388888888888889));
double tmp;
if (im <= 8.5e+69) {
tmp = 1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_0)))) / (0.5 - (im * t_0)));
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5));
}
return tmp;
}
def code(re, im): t_0 = im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)) tmp = 0 if im <= 8.5e+69: tmp = 1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_0)))) / (0.5 - (im * t_0))) else: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)) return tmp
function code(re, im) t_0 = Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))) tmp = 0.0 if (im <= 8.5e+69) tmp = Float64(1.0 + Float64(Float64(Float64(im * im) * Float64(0.25 - Float64(Float64(im * im) * Float64(t_0 * t_0)))) / Float64(0.5 - Float64(im * t_0)))); else 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) * -0.5))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)); tmp = 0.0; if (im <= 8.5e+69) tmp = 1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_0)))) / (0.5 - (im * t_0))); else tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 8.5e+69], N[(1.0 + N[(N[(N[(im * im), $MachinePrecision] * N[(0.25 - N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\\
\mathbf{if}\;im \leq 8.5 \cdot 10^{+69}:\\
\;\;\;\;1 + \frac{\left(im \cdot im\right) \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_0\right)\right)}{0.5 - im \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\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 -0.5\right)\\
\end{array}
\end{array}
if im < 8.5000000000000002e69Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified90.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified54.6%
associate-*r*N/A
flip-+N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr43.6%
if 8.5000000000000002e69 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.6%
Simplified79.6%
Final simplification50.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* im (* im im)))))
(if (<= im 3e+80)
(+
(+
1.0
(/
(* t_0 (- 0.001736111111111111 (* t_0 1.9290123456790124e-6)))
(+ 0.041666666666666664 (* (* im im) -0.001388888888888889))))
(* 0.5 (* im im)))
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(+ 1.0 (* (* re re) -0.5))))))
double code(double re, double im) {
double t_0 = im * (im * (im * im));
double tmp;
if (im <= 3e+80) {
tmp = (1.0 + ((t_0 * (0.001736111111111111 - (t_0 * 1.9290123456790124e-6))) / (0.041666666666666664 + ((im * im) * -0.001388888888888889)))) + (0.5 * (im * im));
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (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 = im * (im * (im * im))
if (im <= 3d+80) then
tmp = (1.0d0 + ((t_0 * (0.001736111111111111d0 - (t_0 * 1.9290123456790124d-6))) / (0.041666666666666664d0 + ((im * im) * (-0.001388888888888889d0))))) + (0.5d0 * (im * im))
else
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (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 * im));
double tmp;
if (im <= 3e+80) {
tmp = (1.0 + ((t_0 * (0.001736111111111111 - (t_0 * 1.9290123456790124e-6))) / (0.041666666666666664 + ((im * im) * -0.001388888888888889)))) + (0.5 * (im * im));
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5));
}
return tmp;
}
def code(re, im): t_0 = im * (im * (im * im)) tmp = 0 if im <= 3e+80: tmp = (1.0 + ((t_0 * (0.001736111111111111 - (t_0 * 1.9290123456790124e-6))) / (0.041666666666666664 + ((im * im) * -0.001388888888888889)))) + (0.5 * (im * im)) else: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)) return tmp
function code(re, im) t_0 = Float64(im * Float64(im * Float64(im * im))) tmp = 0.0 if (im <= 3e+80) tmp = Float64(Float64(1.0 + Float64(Float64(t_0 * Float64(0.001736111111111111 - Float64(t_0 * 1.9290123456790124e-6))) / Float64(0.041666666666666664 + Float64(Float64(im * im) * -0.001388888888888889)))) + Float64(0.5 * Float64(im * im))); else 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) * -0.5))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (im * (im * im)); tmp = 0.0; if (im <= 3e+80) tmp = (1.0 + ((t_0 * (0.001736111111111111 - (t_0 * 1.9290123456790124e-6))) / (0.041666666666666664 + ((im * im) * -0.001388888888888889)))) + (0.5 * (im * im)); else tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 3e+80], N[(N[(1.0 + N[(N[(t$95$0 * N[(0.001736111111111111 - N[(t$95$0 * 1.9290123456790124e-6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\
\mathbf{if}\;im \leq 3 \cdot 10^{+80}:\\
\;\;\;\;\left(1 + \frac{t\_0 \cdot \left(0.001736111111111111 - t\_0 \cdot 1.9290123456790124 \cdot 10^{-6}\right)}{0.041666666666666664 + \left(im \cdot im\right) \cdot -0.001388888888888889}\right) + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;\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 -0.5\right)\\
\end{array}
\end{array}
if im < 2.99999999999999987e80Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified90.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified54.3%
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-+l+N/A
+-commutativeN/A
associate-+r+N/A
+-lowering-+.f64N/A
Applied egg-rr54.3%
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr50.2%
if 2.99999999999999987e80 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.2%
Simplified79.2%
Final simplification55.6%
(FPCore (re im)
:precision binary64
(if (<= re 9e+70)
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(* im (+ 0.041666666666666664 (* im (* im 0.001388888888888889)))))))))
(*
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im)))))
(+ 1.0 (* (* re re) -0.5)))))
double code(double re, double im) {
double tmp;
if (re <= 9e+70) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))));
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (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 <= 9d+70) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))))))))
else
tmp = (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im))))) * (1.0d0 + ((re * re) * (-0.5d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 9e+70) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))));
} else {
tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 9e+70: tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))) else: tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)) return tmp
function code(re, im) tmp = 0.0 if (re <= 9e+70) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889))))))))); else 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) * -0.5))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 9e+70) tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))); else tmp = (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) * (1.0 + ((re * re) * -0.5)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 9e+70], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 9 \cdot 10^{+70}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\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 -0.5\right)\\
\end{array}
\end{array}
if re < 8.9999999999999999e70Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified92.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified68.4%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6468.4%
Applied egg-rr68.4%
if 8.9999999999999999e70 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified89.2%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6431.2%
Simplified31.2%
Final simplification60.7%
(FPCore (re im)
:precision binary64
(if (<= re 9e+70)
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(* im (+ 0.041666666666666664 (* im (* im 0.001388888888888889)))))))))
(+
1.0
(*
(* re re)
(+
-0.5
(*
re
(*
re
(+ 0.041666666666666664 (* (* re re) -0.001388888888888889)))))))))
double code(double re, double im) {
double tmp;
if (re <= 9e+70) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))));
} else {
tmp = 1.0 + ((re * re) * (-0.5 + (re * (re * (0.041666666666666664 + ((re * re) * -0.001388888888888889))))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 9d+70) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))))))))
else
tmp = 1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * (0.041666666666666664d0 + ((re * re) * (-0.001388888888888889d0)))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 9e+70) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))));
} else {
tmp = 1.0 + ((re * re) * (-0.5 + (re * (re * (0.041666666666666664 + ((re * re) * -0.001388888888888889))))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 9e+70: tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))) else: tmp = 1.0 + ((re * re) * (-0.5 + (re * (re * (0.041666666666666664 + ((re * re) * -0.001388888888888889)))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 9e+70) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889))))))))); else tmp = Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.001388888888888889))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 9e+70) tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))); else tmp = 1.0 + ((re * re) * (-0.5 + (re * (re * (0.041666666666666664 + ((re * re) * -0.001388888888888889)))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 9e+70], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 9 \cdot 10^{+70}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.001388888888888889\right)\right)\right)\\
\end{array}
\end{array}
if re < 8.9999999999999999e70Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified92.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified68.4%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6468.4%
Applied egg-rr68.4%
if 8.9999999999999999e70 < re Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6450.5%
Simplified50.5%
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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6431.1%
Simplified31.1%
Final simplification60.7%
(FPCore (re im)
:precision binary64
(if (<= re 1.7e+176)
(+
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 tmp;
if (re <= 1.7e+176) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))));
} 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 <= 1.7d+176) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))))))))
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 <= 1.7e+176) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))));
} else {
tmp = 1.0 + ((re * re) * -0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.7e+176: tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))) else: tmp = 1.0 + ((re * re) * -0.5) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.7e+176) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889))))))))); else tmp = Float64(1.0 + Float64(Float64(re * re) * -0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.7e+176) tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))); else tmp = 1.0 + ((re * re) * -0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.7e+176], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.7 \cdot 10^{+176}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if re < 1.70000000000000007e176Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified92.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified64.2%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6464.2%
Applied egg-rr64.2%
if 1.70000000000000007e176 < re Initial program 99.9%
Taylor expanded in im around 0
cos-lowering-cos.f6457.8%
Simplified57.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.9%
Simplified27.9%
Final simplification60.0%
(FPCore (re im)
:precision binary64
(if (<= re 1.7e+176)
(+
1.0
(* im (* im (+ 0.5 (* im (* im (* (* im im) 0.001388888888888889)))))))
(+ 1.0 (* (* re re) -0.5))))
double code(double re, double im) {
double tmp;
if (re <= 1.7e+176) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * ((im * im) * 0.001388888888888889))))));
} 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 <= 1.7d+176) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * ((im * im) * 0.001388888888888889d0))))))
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 <= 1.7e+176) {
tmp = 1.0 + (im * (im * (0.5 + (im * (im * ((im * im) * 0.001388888888888889))))));
} else {
tmp = 1.0 + ((re * re) * -0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.7e+176: tmp = 1.0 + (im * (im * (0.5 + (im * (im * ((im * im) * 0.001388888888888889)))))) else: tmp = 1.0 + ((re * re) * -0.5) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.7e+176) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(Float64(im * im) * 0.001388888888888889))))))); else tmp = Float64(1.0 + Float64(Float64(re * re) * -0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.7e+176) tmp = 1.0 + (im * (im * (0.5 + (im * (im * ((im * im) * 0.001388888888888889)))))); else tmp = 1.0 + ((re * re) * -0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.7e+176], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.7 \cdot 10^{+176}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if re < 1.70000000000000007e176Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified92.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified64.2%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.9%
Simplified63.9%
if 1.70000000000000007e176 < re Initial program 99.9%
Taylor expanded in im around 0
cos-lowering-cos.f6457.8%
Simplified57.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.9%
Simplified27.9%
(FPCore (re im) :precision binary64 (if (<= re 1.7e+176) (+ 1.0 (* im (* im (* im (* 0.001388888888888889 (* im (* im im))))))) (+ 1.0 (* (* re re) -0.5))))
double code(double re, double im) {
double tmp;
if (re <= 1.7e+176) {
tmp = 1.0 + (im * (im * (im * (0.001388888888888889 * (im * (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 <= 1.7d+176) then
tmp = 1.0d0 + (im * (im * (im * (0.001388888888888889d0 * (im * (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 <= 1.7e+176) {
tmp = 1.0 + (im * (im * (im * (0.001388888888888889 * (im * (im * im))))));
} else {
tmp = 1.0 + ((re * re) * -0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.7e+176: tmp = 1.0 + (im * (im * (im * (0.001388888888888889 * (im * (im * im)))))) else: tmp = 1.0 + ((re * re) * -0.5) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.7e+176) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(im * Float64(0.001388888888888889 * Float64(im * Float64(im * im))))))); else tmp = Float64(1.0 + Float64(Float64(re * re) * -0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.7e+176) tmp = 1.0 + (im * (im * (im * (0.001388888888888889 * (im * (im * im)))))); else tmp = 1.0 + ((re * re) * -0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.7e+176], N[(1.0 + N[(im * N[(im * N[(im * N[(0.001388888888888889 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.7 \cdot 10^{+176}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(im \cdot \left(0.001388888888888889 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if re < 1.70000000000000007e176Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified92.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified64.2%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.9%
Simplified63.9%
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
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.5%
Simplified63.5%
if 1.70000000000000007e176 < re Initial program 99.9%
Taylor expanded in im around 0
cos-lowering-cos.f6457.8%
Simplified57.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.9%
Simplified27.9%
(FPCore (re im)
:precision binary64
(if (<= im 4.5)
(+ 1.0 (* im (* im (+ 0.5 (* 0.041666666666666664 (* im im))))))
(*
(* im im)
(*
(* im im)
(+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))
double code(double re, double im) {
double tmp;
if (im <= 4.5) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
} else {
tmp = (im * im) * ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 4.5d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (0.041666666666666664d0 * (im * im)))))
else
tmp = (im * im) * ((im * im) * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 4.5) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
} else {
tmp = (im * im) * ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 4.5: tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))) else: tmp = (im * im) * ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889))) return tmp
function code(re, im) tmp = 0.0 if (im <= 4.5) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im)))))); else tmp = Float64(Float64(im * im) * Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 4.5) tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))); else tmp = (im * im) * ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 4.5], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 4.5:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\\
\end{array}
\end{array}
if im < 4.5Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified55.6%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
if 4.5 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified87.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified67.9%
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-+l+N/A
+-commutativeN/A
associate-+r+N/A
+-lowering-+.f64N/A
Applied egg-rr67.9%
Taylor expanded in im around inf
metadata-evalN/A
pow-plusN/A
metadata-evalN/A
pow-plusN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Simplified67.9%
Final simplification56.6%
(FPCore (re im) :precision binary64 (if (<= im 6.4) (+ 1.0 (* im (* im (+ 0.5 (* 0.041666666666666664 (* im im)))))) (* im (* 0.001388888888888889 (* im (* im (* im (* im im))))))))
double code(double re, double im) {
double tmp;
if (im <= 6.4) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
} else {
tmp = im * (0.001388888888888889 * (im * (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 <= 6.4d0) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (0.041666666666666664d0 * (im * im)))))
else
tmp = im * (0.001388888888888889d0 * (im * (im * (im * (im * im)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 6.4) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
} else {
tmp = im * (0.001388888888888889 * (im * (im * (im * (im * im)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 6.4: tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))) else: tmp = im * (0.001388888888888889 * (im * (im * (im * (im * im))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 6.4) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im)))))); else tmp = Float64(im * Float64(0.001388888888888889 * Float64(im * Float64(im * Float64(im * Float64(im * im)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 6.4) tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))); else tmp = im * (0.001388888888888889 * (im * (im * (im * (im * im))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 6.4], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(0.001388888888888889 * N[(im * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 6.4:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.001388888888888889 \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 6.4000000000000004Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified55.6%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
if 6.4000000000000004 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified87.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified67.9%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.9%
Simplified67.9%
Taylor expanded in im around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.9%
Simplified67.9%
Final simplification56.6%
(FPCore (re im) :precision binary64 (if (<= im 4.8) (+ 1.0 (* im (* 0.5 im))) (* im (* 0.001388888888888889 (* im (* im (* im (* im im))))))))
double code(double re, double im) {
double tmp;
if (im <= 4.8) {
tmp = 1.0 + (im * (0.5 * im));
} else {
tmp = im * (0.001388888888888889 * (im * (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 <= 4.8d0) then
tmp = 1.0d0 + (im * (0.5d0 * im))
else
tmp = im * (0.001388888888888889d0 * (im * (im * (im * (im * im)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 4.8) {
tmp = 1.0 + (im * (0.5 * im));
} else {
tmp = im * (0.001388888888888889 * (im * (im * (im * (im * im)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 4.8: tmp = 1.0 + (im * (0.5 * im)) else: tmp = im * (0.001388888888888889 * (im * (im * (im * (im * im))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 4.8) tmp = Float64(1.0 + Float64(im * Float64(0.5 * im))); else tmp = Float64(im * Float64(0.001388888888888889 * Float64(im * Float64(im * Float64(im * Float64(im * im)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 4.8) tmp = 1.0 + (im * (0.5 * im)); else tmp = im * (0.001388888888888889 * (im * (im * (im * (im * im))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 4.8], N[(1.0 + N[(im * N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(0.001388888888888889 * N[(im * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 4.8:\\
\;\;\;\;1 + im \cdot \left(0.5 \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.001388888888888889 \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 4.79999999999999982Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified93.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified55.6%
Taylor expanded in im around 0
Simplified45.0%
if 4.79999999999999982 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified87.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified67.9%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.9%
Simplified67.9%
Taylor expanded in im around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.9%
Simplified67.9%
Final simplification50.5%
(FPCore (re im) :precision binary64 (if (<= re 1.7e+176) (+ 1.0 (* im (* 0.5 im))) (+ 1.0 (* (* re re) -0.5))))
double code(double re, double im) {
double tmp;
if (re <= 1.7e+176) {
tmp = 1.0 + (im * (0.5 * 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 <= 1.7d+176) then
tmp = 1.0d0 + (im * (0.5d0 * 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 <= 1.7e+176) {
tmp = 1.0 + (im * (0.5 * im));
} else {
tmp = 1.0 + ((re * re) * -0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.7e+176: tmp = 1.0 + (im * (0.5 * im)) else: tmp = 1.0 + ((re * re) * -0.5) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.7e+176) tmp = Float64(1.0 + Float64(im * Float64(0.5 * im))); else tmp = Float64(1.0 + Float64(Float64(re * re) * -0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.7e+176) tmp = 1.0 + (im * (0.5 * im)); else tmp = 1.0 + ((re * re) * -0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.7e+176], N[(1.0 + N[(im * N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.7 \cdot 10^{+176}:\\
\;\;\;\;1 + im \cdot \left(0.5 \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if re < 1.70000000000000007e176Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified92.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified64.2%
Taylor expanded in im around 0
Simplified48.8%
if 1.70000000000000007e176 < re Initial program 99.9%
Taylor expanded in im around 0
cos-lowering-cos.f6457.8%
Simplified57.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.9%
Simplified27.9%
Final simplification46.4%
(FPCore (re im) :precision binary64 (if (<= im 1.6) 1.0 (* 0.5 (* im im))))
double code(double re, double im) {
double tmp;
if (im <= 1.6) {
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 <= 1.6d0) 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 <= 1.6) {
tmp = 1.0;
} else {
tmp = 0.5 * (im * im);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.6: tmp = 1.0 else: tmp = 0.5 * (im * im) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.6) 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 <= 1.6) tmp = 1.0; else tmp = 0.5 * (im * im); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.6], 1.0, N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.6:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot im\right)\\
\end{array}
\end{array}
if im < 1.6000000000000001Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6466.1%
Simplified66.1%
Taylor expanded in re around 0
Simplified36.9%
if 1.6000000000000001 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified87.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified67.9%
Taylor expanded in im around 0
Simplified43.1%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6443.1%
Simplified43.1%
(FPCore (re im) :precision binary64 (+ 1.0 (* im (* 0.5 im))))
double code(double re, double im) {
return 1.0 + (im * (0.5 * im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0 + (im * (0.5d0 * im))
end function
public static double code(double re, double im) {
return 1.0 + (im * (0.5 * im));
}
def code(re, im): return 1.0 + (im * (0.5 * im))
function code(re, im) return Float64(1.0 + Float64(im * Float64(0.5 * im))) end
function tmp = code(re, im) tmp = 1.0 + (im * (0.5 * im)); end
code[re_, im_] := N[(1.0 + N[(im * N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + im \cdot \left(0.5 \cdot im\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
Simplified92.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified58.6%
Taylor expanded in im around 0
Simplified44.6%
Final simplification44.6%
(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.f6451.1%
Simplified51.1%
Taylor expanded in re around 0
Simplified28.7%
herbie shell --seed 2024158
(FPCore (re im)
:name "math.cos on complex, real part"
:precision binary64
(* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))