
(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 17 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%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr100.0%
(FPCore (re im)
:precision binary64
(if (<= (cos re) 1.0)
(*
(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) <= 1.0) {
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) <= 1.0d0) 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) <= 1.0) {
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) <= 1.0: 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) <= 1.0) 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) <= 1.0) 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], 1.0], 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 1:\\
\;\;\;\;\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) < 1Initial 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
+-lowering-+.f64N/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
unpow2N/A
*-lowering-*.f6495.3%
Simplified95.3%
if 1 < (cos.f64 re) Initial program 100.0%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr100.0%
associate-/r/N/A
/-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified59.6%
*-rgt-identityN/A
cosh-lowering-cosh.f6459.6%
Applied egg-rr59.6%
Final simplification95.3%
(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%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr100.0%
associate-/r/N/A
/-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(if (<= im 27.5)
(*
(cos re)
(+ 1.0 (* (* im im) (+ 0.5 (* 0.041666666666666664 (* im im))))))
(if (<= im 1.15e+77)
(* (cosh im) (+ 1.0 (* (* re re) -0.5)))
(* (* (cos re) 0.041666666666666664) (* (* im im) (* im im))))))
double code(double re, double im) {
double tmp;
if (im <= 27.5) {
tmp = cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im)))));
} else if (im <= 1.15e+77) {
tmp = cosh(im) * (1.0 + ((re * re) * -0.5));
} else {
tmp = (cos(re) * 0.041666666666666664) * ((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 <= 27.5d0) then
tmp = cos(re) * (1.0d0 + ((im * im) * (0.5d0 + (0.041666666666666664d0 * (im * im)))))
else if (im <= 1.15d+77) then
tmp = cosh(im) * (1.0d0 + ((re * re) * (-0.5d0)))
else
tmp = (cos(re) * 0.041666666666666664d0) * ((im * im) * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 27.5) {
tmp = Math.cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im)))));
} else if (im <= 1.15e+77) {
tmp = Math.cosh(im) * (1.0 + ((re * re) * -0.5));
} else {
tmp = (Math.cos(re) * 0.041666666666666664) * ((im * im) * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 27.5: tmp = math.cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))) elif im <= 1.15e+77: tmp = math.cosh(im) * (1.0 + ((re * re) * -0.5)) else: tmp = (math.cos(re) * 0.041666666666666664) * ((im * im) * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 27.5) tmp = Float64(cos(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im)))))); elseif (im <= 1.15e+77) tmp = Float64(cosh(im) * Float64(1.0 + Float64(Float64(re * re) * -0.5))); else tmp = Float64(Float64(cos(re) * 0.041666666666666664) * Float64(Float64(im * im) * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 27.5) tmp = cos(re) * (1.0 + ((im * im) * (0.5 + (0.041666666666666664 * (im * im))))); elseif (im <= 1.15e+77) tmp = cosh(im) * (1.0 + ((re * re) * -0.5)); else tmp = (cos(re) * 0.041666666666666664) * ((im * im) * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 27.5], 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, 1.15e+77], N[(N[Cosh[im], $MachinePrecision] * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[re], $MachinePrecision] * 0.041666666666666664), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 27.5:\\
\;\;\;\;\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{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;\cosh im \cdot \left(1 + \left(re \cdot re\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos re \cdot 0.041666666666666664\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 27.5Initial 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
Simplified94.6%
if 27.5 < im < 1.14999999999999997e77Initial 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 re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.0%
Simplified70.0%
if 1.14999999999999997e77 < 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 im around inf
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification94.8%
(FPCore (re im)
:precision binary64
(if (<= im 0.00325)
(* (* 0.5 (cos re)) (+ 2.0 (* im im)))
(if (<= im 1.15e+77)
(* (cosh im) (+ 1.0 (* (* re re) -0.5)))
(* (* (cos re) 0.041666666666666664) (* (* im im) (* im im))))))
double code(double re, double im) {
double tmp;
if (im <= 0.00325) {
tmp = (0.5 * cos(re)) * (2.0 + (im * im));
} else if (im <= 1.15e+77) {
tmp = cosh(im) * (1.0 + ((re * re) * -0.5));
} else {
tmp = (cos(re) * 0.041666666666666664) * ((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 <= 0.00325d0) then
tmp = (0.5d0 * cos(re)) * (2.0d0 + (im * im))
else if (im <= 1.15d+77) then
tmp = cosh(im) * (1.0d0 + ((re * re) * (-0.5d0)))
else
tmp = (cos(re) * 0.041666666666666664d0) * ((im * im) * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.00325) {
tmp = (0.5 * Math.cos(re)) * (2.0 + (im * im));
} else if (im <= 1.15e+77) {
tmp = Math.cosh(im) * (1.0 + ((re * re) * -0.5));
} else {
tmp = (Math.cos(re) * 0.041666666666666664) * ((im * im) * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.00325: tmp = (0.5 * math.cos(re)) * (2.0 + (im * im)) elif im <= 1.15e+77: tmp = math.cosh(im) * (1.0 + ((re * re) * -0.5)) else: tmp = (math.cos(re) * 0.041666666666666664) * ((im * im) * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.00325) tmp = Float64(Float64(0.5 * cos(re)) * Float64(2.0 + Float64(im * im))); elseif (im <= 1.15e+77) tmp = Float64(cosh(im) * Float64(1.0 + Float64(Float64(re * re) * -0.5))); else tmp = Float64(Float64(cos(re) * 0.041666666666666664) * Float64(Float64(im * im) * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.00325) tmp = (0.5 * cos(re)) * (2.0 + (im * im)); elseif (im <= 1.15e+77) tmp = cosh(im) * (1.0 + ((re * re) * -0.5)); else tmp = (cos(re) * 0.041666666666666664) * ((im * im) * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.00325], N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.15e+77], N[(N[Cosh[im], $MachinePrecision] * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[re], $MachinePrecision] * 0.041666666666666664), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.00325:\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;\cosh im \cdot \left(1 + \left(re \cdot re\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos re \cdot 0.041666666666666664\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 0.00324999999999999985Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
if 0.00324999999999999985 < im < 1.14999999999999997e77Initial 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 re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.2%
Simplified67.2%
if 1.14999999999999997e77 < 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 im around inf
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification86.1%
(FPCore (re im) :precision binary64 (if (or (<= im 0.00325) (not (<= im 1.35e+154))) (* (* 0.5 (cos re)) (+ 2.0 (* im im))) (cosh im)))
double code(double re, double im) {
double tmp;
if ((im <= 0.00325) || !(im <= 1.35e+154)) {
tmp = (0.5 * cos(re)) * (2.0 + (im * im));
} 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 ((im <= 0.00325d0) .or. (.not. (im <= 1.35d+154))) then
tmp = (0.5d0 * cos(re)) * (2.0d0 + (im * im))
else
tmp = cosh(im)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= 0.00325) || !(im <= 1.35e+154)) {
tmp = (0.5 * Math.cos(re)) * (2.0 + (im * im));
} else {
tmp = Math.cosh(im);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 0.00325) or not (im <= 1.35e+154): tmp = (0.5 * math.cos(re)) * (2.0 + (im * im)) else: tmp = math.cosh(im) return tmp
function code(re, im) tmp = 0.0 if ((im <= 0.00325) || !(im <= 1.35e+154)) tmp = Float64(Float64(0.5 * cos(re)) * Float64(2.0 + Float64(im * im))); else tmp = cosh(im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 0.00325) || ~((im <= 1.35e+154))) tmp = (0.5 * cos(re)) * (2.0 + (im * im)); else tmp = cosh(im); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 0.00325], N[Not[LessEqual[im, 1.35e+154]], $MachinePrecision]], N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Cosh[im], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.00325 \lor \neg \left(im \leq 1.35 \cdot 10^{+154}\right):\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;\cosh im\\
\end{array}
\end{array}
if im < 0.00324999999999999985 or 1.35000000000000003e154 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6486.1%
Simplified86.1%
if 0.00324999999999999985 < im < 1.35000000000000003e154Initial program 100.0%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr100.0%
associate-/r/N/A
/-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified82.8%
*-rgt-identityN/A
cosh-lowering-cosh.f6482.8%
Applied egg-rr82.8%
Final simplification85.7%
(FPCore (re im)
:precision binary64
(if (<= im 0.0018)
(cos re)
(if (<= im 3e+132)
(cosh im)
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332))))))
double code(double re, double im) {
double tmp;
if (im <= 0.0018) {
tmp = cos(re);
} else if (im <= 3e+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 <= 0.0018d0) then
tmp = cos(re)
else if (im <= 3d+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 <= 0.0018) {
tmp = Math.cos(re);
} else if (im <= 3e+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 <= 0.0018: tmp = math.cos(re) elif im <= 3e+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 <= 0.0018) tmp = cos(re); elseif (im <= 3e+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 <= 0.0018) tmp = cos(re); elseif (im <= 3e+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, 0.0018], N[Cos[re], $MachinePrecision], If[LessEqual[im, 3e+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 0.0018:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 3 \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 < 0.0018Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6467.1%
Simplified67.1%
if 0.0018 < im < 2.9999999999999998e132Initial program 100.0%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr100.0%
associate-/r/N/A
/-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified84.7%
*-rgt-identityN/A
cosh-lowering-cosh.f6484.7%
Applied egg-rr84.7%
if 2.9999999999999998e132 < 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
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
Simplified75.6%
distribute-rgt-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f6475.6%
Applied egg-rr75.6%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6475.6%
Simplified75.6%
(FPCore (re im)
:precision binary64
(if (<= im 0.00325)
(cos re)
(*
(+ 1.0 (* (* re re) -0.5))
(+
1.0
(/
(*
(* im im)
(+
0.125
(* 7.233796296296296e-5 (* (* im im) (* (* im im) (* im im))))))
0.25)))))
double code(double re, double im) {
double tmp;
if (im <= 0.00325) {
tmp = cos(re);
} else {
tmp = (1.0 + ((re * re) * -0.5)) * (1.0 + (((im * im) * (0.125 + (7.233796296296296e-5 * ((im * im) * ((im * im) * (im * im)))))) / 0.25));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.00325d0) then
tmp = cos(re)
else
tmp = (1.0d0 + ((re * re) * (-0.5d0))) * (1.0d0 + (((im * im) * (0.125d0 + (7.233796296296296d-5 * ((im * im) * ((im * im) * (im * im)))))) / 0.25d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.00325) {
tmp = Math.cos(re);
} else {
tmp = (1.0 + ((re * re) * -0.5)) * (1.0 + (((im * im) * (0.125 + (7.233796296296296e-5 * ((im * im) * ((im * im) * (im * im)))))) / 0.25));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.00325: tmp = math.cos(re) else: tmp = (1.0 + ((re * re) * -0.5)) * (1.0 + (((im * im) * (0.125 + (7.233796296296296e-5 * ((im * im) * ((im * im) * (im * im)))))) / 0.25)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.00325) tmp = cos(re); else tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * -0.5)) * Float64(1.0 + Float64(Float64(Float64(im * im) * Float64(0.125 + Float64(7.233796296296296e-5 * Float64(Float64(im * im) * Float64(Float64(im * im) * Float64(im * im)))))) / 0.25))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.00325) tmp = cos(re); else tmp = (1.0 + ((re * re) * -0.5)) * (1.0 + (((im * im) * (0.125 + (7.233796296296296e-5 * ((im * im) * ((im * im) * (im * im)))))) / 0.25)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.00325], N[Cos[re], $MachinePrecision], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(im * im), $MachinePrecision] * N[(0.125 + N[(7.233796296296296e-5 * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.00325:\\
\;\;\;\;\cos re\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(re \cdot re\right) \cdot -0.5\right) \cdot \left(1 + \frac{\left(im \cdot im\right) \cdot \left(0.125 + 7.233796296296296 \cdot 10^{-5} \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)}{0.25}\right)\\
\end{array}
\end{array}
if im < 0.00324999999999999985Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6467.1%
Simplified67.1%
if 0.00324999999999999985 < 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
Simplified84.7%
Taylor expanded in re around 0
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
Simplified63.2%
associate-*r*N/A
flip3-+N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr7.7%
Taylor expanded in im around 0
Simplified65.7%
(FPCore (re im)
:precision binary64
(if (<= im 4e+132)
(+
1.0
(*
(* im im)
(+
0.5
(*
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 <= 4e+132) {
tmp = 1.0 + ((im * im) * (0.5 + (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 <= 4d+132) then
tmp = 1.0d0 + ((im * im) * (0.5d0 + (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 <= 4e+132) {
tmp = 1.0 + ((im * im) * (0.5 + (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 <= 4e+132: tmp = 1.0 + ((im * im) * (0.5 + (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 <= 4e+132) tmp = Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + 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 <= 4e+132) tmp = 1.0 + ((im * im) * (0.5 + (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, 4e+132], N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $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 4 \cdot 10^{+132}:\\
\;\;\;\;1 + \left(im \cdot im\right) \cdot \left(0.5 + 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 < 3.99999999999999996e132Initial program 100.0%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr100.0%
associate-/r/N/A
/-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified57.5%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/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
unpow2N/A
*-lowering-*.f6454.0%
Simplified54.0%
if 3.99999999999999996e132 < 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
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
Simplified75.6%
distribute-rgt-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f6475.6%
Applied egg-rr75.6%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6475.6%
Simplified75.6%
(FPCore (re im)
:precision binary64
(if (<= im 2.65e+132)
(+ 1.0 (* im (* im (+ 0.5 (* 0.041666666666666664 (* im im))))))
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332)))))
double code(double re, double im) {
double tmp;
if (im <= 2.65e+132) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (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) :: tmp
if (im <= 2.65d+132) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (0.041666666666666664d0 * (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 tmp;
if (im <= 2.65e+132) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
} else {
tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.65e+132: tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))) else: tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.65e+132) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(0.041666666666666664 * 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) tmp = 0.0; if (im <= 2.65e+132) tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))); else tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.65e+132], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $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 2.65 \cdot 10^{+132}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + 0.041666666666666664 \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 < 2.65e132Initial 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
Simplified90.8%
Taylor expanded in re around 0
+-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-*.f6451.7%
Simplified51.7%
if 2.65e132 < 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
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
Simplified75.6%
distribute-rgt-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f6475.6%
Applied egg-rr75.6%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6475.6%
Simplified75.6%
Final simplification55.6%
(FPCore (re im)
:precision binary64
(if (<= im 2.1e+142)
(+ 1.0 (* im (* im (+ 0.5 (* 0.041666666666666664 (* im im))))))
(*
(* im im)
(*
(* im im)
(+ 0.041666666666666664 (* (* re re) -0.020833333333333332))))))
double code(double re, double im) {
double tmp;
if (im <= 2.1e+142) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (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) :: tmp
if (im <= 2.1d+142) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (0.041666666666666664d0 * (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 tmp;
if (im <= 2.1e+142) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
} else {
tmp = (im * im) * ((im * im) * (0.041666666666666664 + ((re * re) * -0.020833333333333332)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.1e+142: tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))) else: tmp = (im * im) * ((im * im) * (0.041666666666666664 + ((re * re) * -0.020833333333333332))) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.1e+142) 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(re * re) * -0.020833333333333332)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.1e+142) tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))); else tmp = (im * im) * ((im * im) * (0.041666666666666664 + ((re * re) * -0.020833333333333332))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.1e+142], 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[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.1 \cdot 10^{+142}:\\
\;\;\;\;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(re \cdot re\right) \cdot -0.020833333333333332\right)\right)\\
\end{array}
\end{array}
if im < 2.1e142Initial 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
Simplified90.9%
Taylor expanded in re around 0
+-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-*.f6452.2%
Simplified52.2%
if 2.1e142 < 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
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
Simplified76.9%
Taylor expanded in im around inf
associate-*r*N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
Simplified76.9%
Final simplification56.0%
(FPCore (re im) :precision binary64 (if (<= re 9.8e+204) (+ 1.0 (* im (* im (+ 0.5 (* 0.041666666666666664 (* im im)))))) (* (* re re) -0.5)))
double code(double re, double im) {
double tmp;
if (re <= 9.8e+204) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
} else {
tmp = (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 <= 9.8d+204) then
tmp = 1.0d0 + (im * (im * (0.5d0 + (0.041666666666666664d0 * (im * im)))))
else
tmp = (re * re) * (-0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 9.8e+204) {
tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
} else {
tmp = (re * re) * -0.5;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 9.8e+204: tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))) else: tmp = (re * re) * -0.5 return tmp
function code(re, im) tmp = 0.0 if (re <= 9.8e+204) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im)))))); else tmp = Float64(Float64(re * re) * -0.5); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 9.8e+204) tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im))))); else tmp = (re * re) * -0.5; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 9.8e+204], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 9.8 \cdot 10^{+204}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if re < 9.7999999999999995e204Initial 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
Simplified91.6%
Taylor expanded in re around 0
+-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-*.f6457.8%
Simplified57.8%
if 9.7999999999999995e204 < re Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6445.0%
Simplified45.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6437.3%
Simplified37.3%
Taylor expanded in re around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6437.3%
Simplified37.3%
Final simplification56.1%
(FPCore (re im) :precision binary64 (if (<= re 9.8e+204) (+ 1.0 (* im (* im (* 0.041666666666666664 (* im im))))) (* (* re re) -0.5)))
double code(double re, double im) {
double tmp;
if (re <= 9.8e+204) {
tmp = 1.0 + (im * (im * (0.041666666666666664 * (im * im))));
} else {
tmp = (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 <= 9.8d+204) then
tmp = 1.0d0 + (im * (im * (0.041666666666666664d0 * (im * im))))
else
tmp = (re * re) * (-0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 9.8e+204) {
tmp = 1.0 + (im * (im * (0.041666666666666664 * (im * im))));
} else {
tmp = (re * re) * -0.5;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 9.8e+204: tmp = 1.0 + (im * (im * (0.041666666666666664 * (im * im)))) else: tmp = (re * re) * -0.5 return tmp
function code(re, im) tmp = 0.0 if (re <= 9.8e+204) tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.041666666666666664 * Float64(im * im))))); else tmp = Float64(Float64(re * re) * -0.5); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 9.8e+204) tmp = 1.0 + (im * (im * (0.041666666666666664 * (im * im)))); else tmp = (re * re) * -0.5; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 9.8e+204], N[(1.0 + N[(im * N[(im * N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 9.8 \cdot 10^{+204}:\\
\;\;\;\;1 + im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if re < 9.7999999999999995e204Initial 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
Simplified91.6%
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-*.f6490.7%
Simplified90.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
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-*.f6457.4%
Simplified57.4%
if 9.7999999999999995e204 < re Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6445.0%
Simplified45.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6437.3%
Simplified37.3%
Taylor expanded in re around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6437.3%
Simplified37.3%
Final simplification55.6%
(FPCore (re im) :precision binary64 (if (<= re 1.6e+173) (+ 1.0 (* 0.5 (* im im))) (+ 1.0 (* (* re re) -0.5))))
double code(double re, double im) {
double tmp;
if (re <= 1.6e+173) {
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 <= 1.6d+173) 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 <= 1.6e+173) {
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 <= 1.6e+173: 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 <= 1.6e+173) tmp = Float64(1.0 + Float64(0.5 * 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.6e+173) 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, 1.6e+173], N[(1.0 + N[(0.5 * N[(im * 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.6 \cdot 10^{+173}:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if re < 1.6000000000000001e173Initial program 100.0%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr100.0%
associate-/r/N/A
/-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified64.2%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6444.7%
Simplified44.7%
if 1.6000000000000001e173 < re Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6442.3%
Simplified42.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6443.2%
Simplified43.2%
(FPCore (re im) :precision binary64 (if (<= re 1.6e+173) (+ 1.0 (* 0.5 (* im im))) (* (* re re) -0.5)))
double code(double re, double im) {
double tmp;
if (re <= 1.6e+173) {
tmp = 1.0 + (0.5 * (im * im));
} else {
tmp = (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.6d+173) then
tmp = 1.0d0 + (0.5d0 * (im * im))
else
tmp = (re * re) * (-0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.6e+173) {
tmp = 1.0 + (0.5 * (im * im));
} else {
tmp = (re * re) * -0.5;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.6e+173: tmp = 1.0 + (0.5 * (im * im)) else: tmp = (re * re) * -0.5 return tmp
function code(re, im) tmp = 0.0 if (re <= 1.6e+173) tmp = Float64(1.0 + Float64(0.5 * Float64(im * im))); else tmp = Float64(Float64(re * re) * -0.5); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.6e+173) tmp = 1.0 + (0.5 * (im * im)); else tmp = (re * re) * -0.5; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.6e+173], N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.6 \cdot 10^{+173}:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if re < 1.6000000000000001e173Initial program 100.0%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr100.0%
associate-/r/N/A
/-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
cos-lowering-cos.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified64.2%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6444.7%
Simplified44.7%
if 1.6000000000000001e173 < re Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6442.3%
Simplified42.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6443.2%
Simplified43.2%
Taylor expanded in re around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6443.2%
Simplified43.2%
(FPCore (re im) :precision binary64 (if (<= im 7e+19) 1.0 (* (* re re) -0.5)))
double code(double re, double im) {
double tmp;
if (im <= 7e+19) {
tmp = 1.0;
} else {
tmp = (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+19) then
tmp = 1.0d0
else
tmp = (re * re) * (-0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 7e+19) {
tmp = 1.0;
} else {
tmp = (re * re) * -0.5;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 7e+19: tmp = 1.0 else: tmp = (re * re) * -0.5 return tmp
function code(re, im) tmp = 0.0 if (im <= 7e+19) tmp = 1.0; else tmp = Float64(Float64(re * re) * -0.5); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 7e+19) tmp = 1.0; else tmp = (re * re) * -0.5; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 7e+19], 1.0, N[(N[(re * re), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 7 \cdot 10^{+19}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -0.5\\
\end{array}
\end{array}
if im < 7e19Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f6465.8%
Simplified65.8%
Taylor expanded in re around 0
Simplified31.4%
if 7e19 < im Initial program 100.0%
Taylor expanded in im around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6416.8%
Simplified16.8%
Taylor expanded in re around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.9%
Simplified15.9%
(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.f6450.6%
Simplified50.6%
Taylor expanded in re around 0
Simplified24.4%
herbie shell --seed 2024138
(FPCore (re im)
:name "math.cos on complex, real part"
:precision binary64
(* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))