
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (+ (/ (* 0.5 (sin re)) (exp im)) (* (sin re) (* 0.5 (exp im)))))
double code(double re, double im) {
return ((0.5 * sin(re)) / exp(im)) + (sin(re) * (0.5 * exp(im)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = ((0.5d0 * sin(re)) / exp(im)) + (sin(re) * (0.5d0 * exp(im)))
end function
public static double code(double re, double im) {
return ((0.5 * Math.sin(re)) / Math.exp(im)) + (Math.sin(re) * (0.5 * Math.exp(im)));
}
def code(re, im): return ((0.5 * math.sin(re)) / math.exp(im)) + (math.sin(re) * (0.5 * math.exp(im)))
function code(re, im) return Float64(Float64(Float64(0.5 * sin(re)) / exp(im)) + Float64(sin(re) * Float64(0.5 * exp(im)))) end
function tmp = code(re, im) tmp = ((0.5 * sin(re)) / exp(im)) + (sin(re) * (0.5 * exp(im))); end
code[re_, im_] := N[(N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] / N[Exp[im], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5 \cdot \sin re}{e^{im}} + \sin re \cdot \left(0.5 \cdot e^{im}\right)
\end{array}
Initial program 100.0%
distribute-rgt-inN/A
+-lowering-+.f64N/A
*-commutativeN/A
sub0-negN/A
exp-negN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
exp-lowering-exp.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64100.0%
Applied egg-rr100.0%
(FPCore (re im) :precision binary64 (* (sin re) (cosh im)))
double code(double re, double im) {
return sin(re) * cosh(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sin(re) * cosh(im)
end function
public static double code(double re, double im) {
return Math.sin(re) * Math.cosh(im);
}
def code(re, im): return math.sin(re) * math.cosh(im)
function code(re, im) return Float64(sin(re) * cosh(im)) end
function tmp = code(re, im) tmp = sin(re) * cosh(im); end
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[Cosh[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin re \cdot \cosh im
\end{array}
Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
(FPCore (re im)
:precision binary64
(if (<= re 1.2e-8)
(* re (cosh im))
(*
(sin re)
(+
1.0
(*
(* im im)
(+
0.5
(*
im
(*
im
(+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))))))
double code(double re, double im) {
double tmp;
if (re <= 1.2e-8) {
tmp = re * cosh(im);
} else {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (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 (re <= 1.2d-8) then
tmp = re * cosh(im)
else
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + (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 (re <= 1.2e-8) {
tmp = re * Math.cosh(im);
} else {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.2e-8: tmp = re * math.cosh(im) else: tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.2e-8) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.2e-8) tmp = re * cosh(im); else tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.2e-8], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * 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]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.2 \cdot 10^{-8}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(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)\right)\\
\end{array}
\end{array}
if re < 1.19999999999999999e-8Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified78.8%
if 1.19999999999999999e-8 < re Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
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-*.f6491.7%
Simplified91.7%
Final simplification82.2%
(FPCore (re im)
:precision binary64
(if (<= re 2e-9)
(* re (cosh im))
(*
(sin re)
(+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664))))))))
double code(double re, double im) {
double tmp;
if (re <= 2e-9) {
tmp = re * cosh(im);
} else {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2d-9) then
tmp = re * cosh(im)
else
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2e-9) {
tmp = re * Math.cosh(im);
} else {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2e-9: tmp = re * math.cosh(im) else: tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2e-9) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2e-9) tmp = re * cosh(im); else tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2e-9], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2 \cdot 10^{-9}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if re < 2.00000000000000012e-9Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified78.8%
if 2.00000000000000012e-9 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified90.2%
(FPCore (re im) :precision binary64 (let* ((t_0 (* (* 0.5 (sin re)) (+ (* im im) 2.0)))) (if (<= im 0.016) t_0 (if (<= im 1.35e+154) (* re (cosh im)) t_0))))
double code(double re, double im) {
double t_0 = (0.5 * sin(re)) * ((im * im) + 2.0);
double tmp;
if (im <= 0.016) {
tmp = t_0;
} else if (im <= 1.35e+154) {
tmp = re * 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 = (0.5d0 * sin(re)) * ((im * im) + 2.0d0)
if (im <= 0.016d0) then
tmp = t_0
else if (im <= 1.35d+154) then
tmp = re * cosh(im)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (0.5 * Math.sin(re)) * ((im * im) + 2.0);
double tmp;
if (im <= 0.016) {
tmp = t_0;
} else if (im <= 1.35e+154) {
tmp = re * Math.cosh(im);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (0.5 * math.sin(re)) * ((im * im) + 2.0) tmp = 0 if im <= 0.016: tmp = t_0 elif im <= 1.35e+154: tmp = re * math.cosh(im) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(0.5 * sin(re)) * Float64(Float64(im * im) + 2.0)) tmp = 0.0 if (im <= 0.016) tmp = t_0; elseif (im <= 1.35e+154) tmp = Float64(re * cosh(im)); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (0.5 * sin(re)) * ((im * im) + 2.0); tmp = 0.0; if (im <= 0.016) tmp = t_0; elseif (im <= 1.35e+154) tmp = re * cosh(im); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.016], t$95$0, If[LessEqual[im, 1.35e+154], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im + 2\right)\\
\mathbf{if}\;im \leq 0.016:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if im < 0.016 or 1.35000000000000003e154 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6481.9%
Simplified81.9%
if 0.016 < im < 1.35000000000000003e154Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified77.4%
Final simplification81.4%
(FPCore (re im)
:precision binary64
(if (<= im 9.2e-7)
(sin re)
(if (<= im 2e+156)
(* re (cosh im))
(*
(* im (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
(* im (* (* im im) 0.041666666666666664))))))
double code(double re, double im) {
double tmp;
if (im <= 9.2e-7) {
tmp = sin(re);
} else if (im <= 2e+156) {
tmp = re * cosh(im);
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 9.2d-7) then
tmp = sin(re)
else if (im <= 2d+156) then
tmp = re * cosh(im)
else
tmp = (im * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))) * (im * ((im * im) * 0.041666666666666664d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 9.2e-7) {
tmp = Math.sin(re);
} else if (im <= 2e+156) {
tmp = re * Math.cosh(im);
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 9.2e-7: tmp = math.sin(re) elif im <= 2e+156: tmp = re * math.cosh(im) else: tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664)) return tmp
function code(re, im) tmp = 0.0 if (im <= 9.2e-7) tmp = sin(re); elseif (im <= 2e+156) tmp = Float64(re * cosh(im)); else tmp = Float64(Float64(im * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))) * Float64(im * Float64(Float64(im * im) * 0.041666666666666664))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 9.2e-7) tmp = sin(re); elseif (im <= 2e+156) tmp = re * cosh(im); else tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 9.2e-7], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2e+156], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2 \cdot 10^{+156}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right) \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\end{array}
\end{array}
if im < 9.1999999999999998e-7Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6466.0%
Simplified66.0%
if 9.1999999999999998e-7 < im < 2e156Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified79.4%
if 2e156 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.3%
Applied egg-rr83.3%
Final simplification69.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) 0.041666666666666664))
(t_1 (* im (+ 0.5 t_0)))
(t_2 (* im t_0)))
(if (<= im 9.2e-7)
(sin re)
(if (<= im 2.6e+77)
(/
(*
(- 1.0 (* (* im im) (* t_1 t_1)))
(* re (+ 1.0 (* -0.16666666666666666 (* re re)))))
(- 1.0 (* im t_1)))
(if (<= im 4e+154)
(* re (* im t_2))
(* (* im (* re (+ 1.0 (* re (* re -0.16666666666666666))))) t_2))))))
double code(double re, double im) {
double t_0 = (im * im) * 0.041666666666666664;
double t_1 = im * (0.5 + t_0);
double t_2 = im * t_0;
double tmp;
if (im <= 9.2e-7) {
tmp = sin(re);
} else if (im <= 2.6e+77) {
tmp = ((1.0 - ((im * im) * (t_1 * t_1))) * (re * (1.0 + (-0.16666666666666666 * (re * re))))) / (1.0 - (im * t_1));
} else if (im <= 4e+154) {
tmp = re * (im * t_2);
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_2;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (im * im) * 0.041666666666666664d0
t_1 = im * (0.5d0 + t_0)
t_2 = im * t_0
if (im <= 9.2d-7) then
tmp = sin(re)
else if (im <= 2.6d+77) then
tmp = ((1.0d0 - ((im * im) * (t_1 * t_1))) * (re * (1.0d0 + ((-0.16666666666666666d0) * (re * re))))) / (1.0d0 - (im * t_1))
else if (im <= 4d+154) then
tmp = re * (im * t_2)
else
tmp = (im * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))) * t_2
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (im * im) * 0.041666666666666664;
double t_1 = im * (0.5 + t_0);
double t_2 = im * t_0;
double tmp;
if (im <= 9.2e-7) {
tmp = Math.sin(re);
} else if (im <= 2.6e+77) {
tmp = ((1.0 - ((im * im) * (t_1 * t_1))) * (re * (1.0 + (-0.16666666666666666 * (re * re))))) / (1.0 - (im * t_1));
} else if (im <= 4e+154) {
tmp = re * (im * t_2);
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_2;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * 0.041666666666666664 t_1 = im * (0.5 + t_0) t_2 = im * t_0 tmp = 0 if im <= 9.2e-7: tmp = math.sin(re) elif im <= 2.6e+77: tmp = ((1.0 - ((im * im) * (t_1 * t_1))) * (re * (1.0 + (-0.16666666666666666 * (re * re))))) / (1.0 - (im * t_1)) elif im <= 4e+154: tmp = re * (im * t_2) else: tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_2 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * 0.041666666666666664) t_1 = Float64(im * Float64(0.5 + t_0)) t_2 = Float64(im * t_0) tmp = 0.0 if (im <= 9.2e-7) tmp = sin(re); elseif (im <= 2.6e+77) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(im * im) * Float64(t_1 * t_1))) * Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))))) / Float64(1.0 - Float64(im * t_1))); elseif (im <= 4e+154) tmp = Float64(re * Float64(im * t_2)); else tmp = Float64(Float64(im * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))) * t_2); end return tmp end
function tmp_2 = code(re, im) t_0 = (im * im) * 0.041666666666666664; t_1 = im * (0.5 + t_0); t_2 = im * t_0; tmp = 0.0; if (im <= 9.2e-7) tmp = sin(re); elseif (im <= 2.6e+77) tmp = ((1.0 - ((im * im) * (t_1 * t_1))) * (re * (1.0 + (-0.16666666666666666 * (re * re))))) / (1.0 - (im * t_1)); elseif (im <= 4e+154) tmp = re * (im * t_2); else tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_2; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]}, Block[{t$95$1 = N[(im * N[(0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(im * t$95$0), $MachinePrecision]}, If[LessEqual[im, 9.2e-7], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.6e+77], N[(N[(N[(1.0 - N[(N[(im * im), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(im * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4e+154], N[(re * N[(im * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(im \cdot im\right) \cdot 0.041666666666666664\\
t_1 := im \cdot \left(0.5 + t\_0\right)\\
t_2 := im \cdot t\_0\\
\mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{\left(1 - \left(im \cdot im\right) \cdot \left(t\_1 \cdot t\_1\right)\right) \cdot \left(re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)}{1 - im \cdot t\_1}\\
\mathbf{elif}\;im \leq 4 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(im \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right) \cdot t\_2\\
\end{array}
\end{array}
if im < 9.1999999999999998e-7Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6466.0%
Simplified66.0%
if 9.1999999999999998e-7 < im < 2.6000000000000002e77Initial program 99.9%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified22.2%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.3%
Simplified47.3%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr79.5%
if 2.6000000000000002e77 < im < 4.00000000000000015e154Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.9%
Simplified57.9%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.9%
Simplified57.9%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.2%
Simplified84.2%
if 4.00000000000000015e154 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.3%
Applied egg-rr83.3%
Final simplification70.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) 0.041666666666666664))
(t_1 (* im (+ 0.5 t_0)))
(t_2 (* im t_0)))
(if (<= im 2.6e+77)
(/
(*
(- 1.0 (* (* im im) (* t_1 t_1)))
(* re (+ 1.0 (* -0.16666666666666666 (* re re)))))
(- 1.0 (* im t_1)))
(if (<= im 4e+154)
(* re (* im t_2))
(* (* im (* re (+ 1.0 (* re (* re -0.16666666666666666))))) t_2)))))
double code(double re, double im) {
double t_0 = (im * im) * 0.041666666666666664;
double t_1 = im * (0.5 + t_0);
double t_2 = im * t_0;
double tmp;
if (im <= 2.6e+77) {
tmp = ((1.0 - ((im * im) * (t_1 * t_1))) * (re * (1.0 + (-0.16666666666666666 * (re * re))))) / (1.0 - (im * t_1));
} else if (im <= 4e+154) {
tmp = re * (im * t_2);
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_2;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (im * im) * 0.041666666666666664d0
t_1 = im * (0.5d0 + t_0)
t_2 = im * t_0
if (im <= 2.6d+77) then
tmp = ((1.0d0 - ((im * im) * (t_1 * t_1))) * (re * (1.0d0 + ((-0.16666666666666666d0) * (re * re))))) / (1.0d0 - (im * t_1))
else if (im <= 4d+154) then
tmp = re * (im * t_2)
else
tmp = (im * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))) * t_2
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (im * im) * 0.041666666666666664;
double t_1 = im * (0.5 + t_0);
double t_2 = im * t_0;
double tmp;
if (im <= 2.6e+77) {
tmp = ((1.0 - ((im * im) * (t_1 * t_1))) * (re * (1.0 + (-0.16666666666666666 * (re * re))))) / (1.0 - (im * t_1));
} else if (im <= 4e+154) {
tmp = re * (im * t_2);
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_2;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * 0.041666666666666664 t_1 = im * (0.5 + t_0) t_2 = im * t_0 tmp = 0 if im <= 2.6e+77: tmp = ((1.0 - ((im * im) * (t_1 * t_1))) * (re * (1.0 + (-0.16666666666666666 * (re * re))))) / (1.0 - (im * t_1)) elif im <= 4e+154: tmp = re * (im * t_2) else: tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_2 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * 0.041666666666666664) t_1 = Float64(im * Float64(0.5 + t_0)) t_2 = Float64(im * t_0) tmp = 0.0 if (im <= 2.6e+77) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(im * im) * Float64(t_1 * t_1))) * Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))))) / Float64(1.0 - Float64(im * t_1))); elseif (im <= 4e+154) tmp = Float64(re * Float64(im * t_2)); else tmp = Float64(Float64(im * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))) * t_2); end return tmp end
function tmp_2 = code(re, im) t_0 = (im * im) * 0.041666666666666664; t_1 = im * (0.5 + t_0); t_2 = im * t_0; tmp = 0.0; if (im <= 2.6e+77) tmp = ((1.0 - ((im * im) * (t_1 * t_1))) * (re * (1.0 + (-0.16666666666666666 * (re * re))))) / (1.0 - (im * t_1)); elseif (im <= 4e+154) tmp = re * (im * t_2); else tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_2; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]}, Block[{t$95$1 = N[(im * N[(0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(im * t$95$0), $MachinePrecision]}, If[LessEqual[im, 2.6e+77], N[(N[(N[(1.0 - N[(N[(im * im), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(im * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4e+154], N[(re * N[(im * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(im \cdot im\right) \cdot 0.041666666666666664\\
t_1 := im \cdot \left(0.5 + t\_0\right)\\
t_2 := im \cdot t\_0\\
\mathbf{if}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{\left(1 - \left(im \cdot im\right) \cdot \left(t\_1 \cdot t\_1\right)\right) \cdot \left(re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)}{1 - im \cdot t\_1}\\
\mathbf{elif}\;im \leq 4 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(im \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right) \cdot t\_2\\
\end{array}
\end{array}
if im < 2.6000000000000002e77Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified85.1%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.8%
Simplified50.8%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr41.4%
if 2.6000000000000002e77 < im < 4.00000000000000015e154Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.9%
Simplified57.9%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.9%
Simplified57.9%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.2%
Simplified84.2%
if 4.00000000000000015e154 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.3%
Applied egg-rr83.3%
Final simplification49.5%
(FPCore (re im)
:precision binary64
(if (<= im 1e+158)
(*
(*
re
(+
0.5
(*
re
(* re (+ -0.08333333333333333 (* (* re re) 0.004166666666666667))))))
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))))
(*
(* im (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
(* im (* (* im im) 0.041666666666666664)))))
double code(double re, double im) {
double tmp;
if (im <= 1e+158) {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1d+158) then
tmp = (re * (0.5d0 + (re * (re * ((-0.08333333333333333d0) + ((re * re) * 0.004166666666666667d0)))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
else
tmp = (im * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))) * (im * ((im * im) * 0.041666666666666664d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1e+158) {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1e+158: tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) else: tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664)) return tmp
function code(re, im) tmp = 0.0 if (im <= 1e+158) tmp = Float64(Float64(re * Float64(0.5 + Float64(re * Float64(re * Float64(-0.08333333333333333 + Float64(Float64(re * re) * 0.004166666666666667)))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778))))))); else tmp = Float64(Float64(im * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))) * Float64(im * Float64(Float64(im * im) * 0.041666666666666664))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1e+158) tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))); else tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1e+158], N[(N[(re * N[(0.5 + N[(re * N[(re * N[(-0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * 0.004166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 10^{+158}:\\
\;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot 0.004166666666666667\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right) \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\end{array}
\end{array}
if im < 9.99999999999999953e157Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.9%
Simplified90.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.7%
Simplified57.7%
if 9.99999999999999953e157 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.3%
Applied egg-rr83.3%
Final simplification60.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* (* im im) 0.041666666666666664))))
(if (<= im 1.1e+78)
(*
(* re (+ 1.0 (* -0.16666666666666666 (* re re))))
(+ 1.0 (* 0.5 (* im im))))
(if (<= im 1.42e+155)
(* re (* im t_0))
(* (* im (* re (+ 1.0 (* re (* re -0.16666666666666666))))) t_0)))))
double code(double re, double im) {
double t_0 = im * ((im * im) * 0.041666666666666664);
double tmp;
if (im <= 1.1e+78) {
tmp = (re * (1.0 + (-0.16666666666666666 * (re * re)))) * (1.0 + (0.5 * (im * im)));
} else if (im <= 1.42e+155) {
tmp = re * (im * t_0);
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = im * ((im * im) * 0.041666666666666664d0)
if (im <= 1.1d+78) then
tmp = (re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))) * (1.0d0 + (0.5d0 * (im * im)))
else if (im <= 1.42d+155) then
tmp = re * (im * t_0)
else
tmp = (im * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))) * t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * ((im * im) * 0.041666666666666664);
double tmp;
if (im <= 1.1e+78) {
tmp = (re * (1.0 + (-0.16666666666666666 * (re * re)))) * (1.0 + (0.5 * (im * im)));
} else if (im <= 1.42e+155) {
tmp = re * (im * t_0);
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_0;
}
return tmp;
}
def code(re, im): t_0 = im * ((im * im) * 0.041666666666666664) tmp = 0 if im <= 1.1e+78: tmp = (re * (1.0 + (-0.16666666666666666 * (re * re)))) * (1.0 + (0.5 * (im * im))) elif im <= 1.42e+155: tmp = re * (im * t_0) else: tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_0 return tmp
function code(re, im) t_0 = Float64(im * Float64(Float64(im * im) * 0.041666666666666664)) tmp = 0.0 if (im <= 1.1e+78) tmp = Float64(Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))) * Float64(1.0 + Float64(0.5 * Float64(im * im)))); elseif (im <= 1.42e+155) tmp = Float64(re * Float64(im * t_0)); else tmp = Float64(Float64(im * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))) * t_0); end return tmp end
function tmp_2 = code(re, im) t_0 = im * ((im * im) * 0.041666666666666664); tmp = 0.0; if (im <= 1.1e+78) tmp = (re * (1.0 + (-0.16666666666666666 * (re * re)))) * (1.0 + (0.5 * (im * im))); elseif (im <= 1.42e+155) tmp = re * (im * t_0); else tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 1.1e+78], N[(N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.42e+155], N[(re * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\\
\mathbf{if}\;im \leq 1.1 \cdot 10^{+78}:\\
\;\;\;\;\left(re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right) \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{elif}\;im \leq 1.42 \cdot 10^{+155}:\\
\;\;\;\;re \cdot \left(im \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right) \cdot t\_0\\
\end{array}
\end{array}
if im < 1.10000000000000007e78Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified85.2%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.0%
Simplified51.0%
Taylor expanded in im around 0
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6445.2%
Simplified45.2%
if 1.10000000000000007e78 < im < 1.41999999999999994e155Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6488.9%
Simplified88.9%
if 1.41999999999999994e155 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.3%
Applied egg-rr83.3%
Final simplification52.8%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
(* re (+ 1.0 (* -0.16666666666666666 (* re re))))
(+ 1.0 (* 0.5 (* im im))))))
(if (<= im 1.1e+78)
t_0
(if (<= im 4e+154)
(* re (* im (* im (* (* im im) 0.041666666666666664))))
t_0))))
double code(double re, double im) {
double t_0 = (re * (1.0 + (-0.16666666666666666 * (re * re)))) * (1.0 + (0.5 * (im * im)));
double tmp;
if (im <= 1.1e+78) {
tmp = t_0;
} else if (im <= 4e+154) {
tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
} 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 = (re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))) * (1.0d0 + (0.5d0 * (im * im)))
if (im <= 1.1d+78) then
tmp = t_0
else if (im <= 4d+154) then
tmp = re * (im * (im * ((im * im) * 0.041666666666666664d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (re * (1.0 + (-0.16666666666666666 * (re * re)))) * (1.0 + (0.5 * (im * im)));
double tmp;
if (im <= 1.1e+78) {
tmp = t_0;
} else if (im <= 4e+154) {
tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (re * (1.0 + (-0.16666666666666666 * (re * re)))) * (1.0 + (0.5 * (im * im))) tmp = 0 if im <= 1.1e+78: tmp = t_0 elif im <= 4e+154: tmp = re * (im * (im * ((im * im) * 0.041666666666666664))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))) * Float64(1.0 + Float64(0.5 * Float64(im * im)))) tmp = 0.0 if (im <= 1.1e+78) tmp = t_0; elseif (im <= 4e+154) tmp = Float64(re * Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (re * (1.0 + (-0.16666666666666666 * (re * re)))) * (1.0 + (0.5 * (im * im))); tmp = 0.0; if (im <= 1.1e+78) tmp = t_0; elseif (im <= 4e+154) tmp = re * (im * (im * ((im * im) * 0.041666666666666664))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 1.1e+78], t$95$0, If[LessEqual[im, 4e+154], N[(re * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right) \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{if}\;im \leq 1.1 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 4 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if im < 1.10000000000000007e78 or 4.00000000000000015e154 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified87.1%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.1%
Simplified55.1%
Taylor expanded in im around 0
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.0%
Simplified50.0%
if 1.10000000000000007e78 < im < 4.00000000000000015e154Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6488.9%
Simplified88.9%
Final simplification52.8%
(FPCore (re im)
:precision binary64
(if (<= im 2e+159)
(*
re
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(*
im
(+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))))))))
(*
(* im (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
(* im (* (* im im) 0.041666666666666664)))))
double code(double re, double im) {
double tmp;
if (im <= 2e+159) {
tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))));
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2d+159) then
tmp = re * (1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0))))))))
else
tmp = (im * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))) * (im * ((im * im) * 0.041666666666666664d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2e+159) {
tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))));
} else {
tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2e+159: tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))) else: tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664)) return tmp
function code(re, im) tmp = 0.0 if (im <= 2e+159) tmp = Float64(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 = Float64(Float64(im * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))) * Float64(im * Float64(Float64(im * im) * 0.041666666666666664))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2e+159) tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))); else tmp = (im * (re * (1.0 + (re * (re * -0.16666666666666666))))) * (im * ((im * im) * 0.041666666666666664)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2e+159], N[(re * 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[(N[(im * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2 \cdot 10^{+159}:\\
\;\;\;\;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}:\\
\;\;\;\;\left(im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right) \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\end{array}
\end{array}
if im < 1.9999999999999999e159Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
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-*.f6490.9%
Simplified90.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-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-*.f6456.9%
Simplified56.9%
if 1.9999999999999999e159 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.3%
Applied egg-rr83.3%
Final simplification60.0%
(FPCore (re im) :precision binary64 (if (<= im 1.1e+78) (* re (+ 1.0 (* -0.16666666666666666 (* re re)))) (* re (+ 1.0 (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664))))))))
double code(double re, double im) {
double tmp;
if (im <= 1.1e+78) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.1d+78) then
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
else
tmp = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.1e+78) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.1e+78: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) else: tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.1e+78) tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); else tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.1e+78) tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); else tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.1e+78], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.1 \cdot 10^{+78}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if im < 1.10000000000000007e78Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6462.0%
Simplified62.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6438.2%
Simplified38.2%
if 1.10000000000000007e78 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-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-*.f6483.3%
Simplified83.3%
Final simplification46.6%
(FPCore (re im) :precision binary64 (if (<= im 1.1e+78) (* re (+ 1.0 (* -0.16666666666666666 (* re re)))) (* re (* im (* im (* (* im im) 0.041666666666666664))))))
double code(double re, double im) {
double tmp;
if (im <= 1.1e+78) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.1d+78) then
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
else
tmp = re * (im * (im * ((im * im) * 0.041666666666666664d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.1e+78) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.1e+78: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) else: tmp = re * (im * (im * ((im * im) * 0.041666666666666664))) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.1e+78) tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); else tmp = Float64(re * Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.1e+78) tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); else tmp = re * (im * (im * ((im * im) * 0.041666666666666664))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.1e+78], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.1 \cdot 10^{+78}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if im < 1.10000000000000007e78Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6462.0%
Simplified62.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6438.2%
Simplified38.2%
if 1.10000000000000007e78 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.9%
Simplified72.9%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.9%
Simplified72.9%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Final simplification46.6%
(FPCore (re im) :precision binary64 (if (<= im 1.58e+78) (* re (+ 1.0 (* -0.16666666666666666 (* re re)))) (* re (* 0.008333333333333333 (* (* re re) (* re re))))))
double code(double re, double im) {
double tmp;
if (im <= 1.58e+78) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = re * (0.008333333333333333 * ((re * re) * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.58d+78) then
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
else
tmp = re * (0.008333333333333333d0 * ((re * re) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.58e+78) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = re * (0.008333333333333333 * ((re * re) * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.58e+78: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) else: tmp = re * (0.008333333333333333 * ((re * re) * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.58e+78) tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); else tmp = Float64(re * Float64(0.008333333333333333 * Float64(Float64(re * re) * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.58e+78) tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); else tmp = re * (0.008333333333333333 * ((re * re) * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.58e+78], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(0.008333333333333333 * N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.58 \cdot 10^{+78}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.008333333333333333 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if im < 1.58000000000000004e78Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6462.0%
Simplified62.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6438.2%
Simplified38.2%
if 1.58000000000000004e78 < im Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f642.6%
Simplified2.6%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.5%
Simplified14.5%
Taylor expanded in re around inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.1%
Simplified14.1%
Final simplification33.7%
(FPCore (re im) :precision binary64 (if (<= re 1.12e+64) re (* -0.16666666666666666 (* re (* re re)))))
double code(double re, double im) {
double tmp;
if (re <= 1.12e+64) {
tmp = re;
} else {
tmp = -0.16666666666666666 * (re * (re * re));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.12d+64) then
tmp = re
else
tmp = (-0.16666666666666666d0) * (re * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.12e+64) {
tmp = re;
} else {
tmp = -0.16666666666666666 * (re * (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.12e+64: tmp = re else: tmp = -0.16666666666666666 * (re * (re * re)) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.12e+64) tmp = re; else tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.12e+64) tmp = re; else tmp = -0.16666666666666666 * (re * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.12e+64], re, N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.12 \cdot 10^{+64}:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 1.11999999999999995e64Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6450.7%
Simplified50.7%
Taylor expanded in re around 0
Simplified33.4%
if 1.11999999999999995e64 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6451.4%
Simplified51.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6422.1%
Simplified22.1%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6422.1%
Simplified22.1%
(FPCore (re im) :precision binary64 (* re (+ 1.0 (* -0.16666666666666666 (* re re)))))
double code(double re, double im) {
return re * (1.0 + (-0.16666666666666666 * (re * re)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end function
public static double code(double re, double im) {
return re * (1.0 + (-0.16666666666666666 * (re * re)));
}
def code(re, im): return re * (1.0 + (-0.16666666666666666 * (re * re)))
function code(re, im) return Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))) end
function tmp = code(re, im) tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end
code[re_, im_] := N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6450.9%
Simplified50.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6432.9%
Simplified32.9%
Final simplification32.9%
(FPCore (re im) :precision binary64 re)
double code(double re, double im) {
return re;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re
end function
public static double code(double re, double im) {
return re;
}
def code(re, im): return re
function code(re, im) return re end
function tmp = code(re, im) tmp = re; end
code[re_, im_] := re
\begin{array}{l}
\\
re
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6450.9%
Simplified50.9%
Taylor expanded in re around 0
Simplified26.9%
herbie shell --seed 2024158
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))