
(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 15 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 (* (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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
(FPCore (re im)
:precision binary64
(if (<= re 5e-81)
(* 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 <= 5e-81) {
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 <= 5d-81) 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 <= 5e-81) {
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 <= 5e-81: 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 <= 5e-81) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 5e-81) 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, 5e-81], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 5 \cdot 10^{-81}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\
\end{array}
\end{array}
if re < 4.99999999999999981e-81Initial 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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified67.3%
if 4.99999999999999981e-81 < 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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6493.1%
Simplified93.1%
Final simplification75.1%
(FPCore (re im)
:precision binary64
(if (<= im 0.00325)
(* (* (sin re) 0.5) (+ (* im im) 2.0))
(if (<= im 2.6e+77)
(* re (cosh im))
(* (sin re) (* im (* im (* (* im im) 0.041666666666666664)))))))
double code(double re, double im) {
double tmp;
if (im <= 0.00325) {
tmp = (sin(re) * 0.5) * ((im * im) + 2.0);
} else if (im <= 2.6e+77) {
tmp = re * cosh(im);
} else {
tmp = sin(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 <= 0.00325d0) then
tmp = (sin(re) * 0.5d0) * ((im * im) + 2.0d0)
else if (im <= 2.6d+77) then
tmp = re * cosh(im)
else
tmp = sin(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 <= 0.00325) {
tmp = (Math.sin(re) * 0.5) * ((im * im) + 2.0);
} else if (im <= 2.6e+77) {
tmp = re * Math.cosh(im);
} else {
tmp = Math.sin(re) * (im * (im * ((im * im) * 0.041666666666666664)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.00325: tmp = (math.sin(re) * 0.5) * ((im * im) + 2.0) elif im <= 2.6e+77: tmp = re * math.cosh(im) else: tmp = math.sin(re) * (im * (im * ((im * im) * 0.041666666666666664))) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.00325) tmp = Float64(Float64(sin(re) * 0.5) * Float64(Float64(im * im) + 2.0)); elseif (im <= 2.6e+77) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(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 <= 0.00325) tmp = (sin(re) * 0.5) * ((im * im) + 2.0); elseif (im <= 2.6e+77) tmp = re * cosh(im); else tmp = sin(re) * (im * (im * ((im * im) * 0.041666666666666664))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.00325], N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.6e+77], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * 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 0.00325:\\
\;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
\mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin 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 < 0.00324999999999999985Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6483.0%
Simplified83.0%
if 0.00324999999999999985 < im < 2.6000000000000002e77Initial 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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified59.0%
if 2.6000000000000002e77 < 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 im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification85.5%
(FPCore (re im)
:precision binary64
(if (<= re 5e-81)
(* 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 <= 5e-81) {
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 <= 5d-81) 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 <= 5e-81) {
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 <= 5e-81: 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 <= 5e-81) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 5e-81) 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, 5e-81], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 5 \cdot 10^{-81}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\end{array}
\end{array}
if re < 4.99999999999999981e-81Initial 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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified67.3%
if 4.99999999999999981e-81 < 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.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* (sin re) 0.5) (+ (* im im) 2.0))))
(if (<= im 0.00325)
t_0
(if (<= im 1.35e+154)
(*
re
(*
(+
2.0
(*
im
(*
im
(+
1.0
(*
im
(*
im
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778))))))))
(+ 0.5 (* -0.08333333333333333 (* re re)))))
t_0))))
double code(double re, double im) {
double t_0 = (sin(re) * 0.5) * ((im * im) + 2.0);
double tmp;
if (im <= 0.00325) {
tmp = t_0;
} else if (im <= 1.35e+154) {
tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re))));
} 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 = (sin(re) * 0.5d0) * ((im * im) + 2.0d0)
if (im <= 0.00325d0) then
tmp = t_0
else if (im <= 1.35d+154) then
tmp = re * ((2.0d0 + (im * (im * (1.0d0 + (im * (im * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0)))))))) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (Math.sin(re) * 0.5) * ((im * im) + 2.0);
double tmp;
if (im <= 0.00325) {
tmp = t_0;
} else if (im <= 1.35e+154) {
tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (math.sin(re) * 0.5) * ((im * im) + 2.0) tmp = 0 if im <= 0.00325: tmp = t_0 elif im <= 1.35e+154: tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re)))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(sin(re) * 0.5) * Float64(Float64(im * im) + 2.0)) tmp = 0.0 if (im <= 0.00325) tmp = t_0; elseif (im <= 1.35e+154) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * Float64(im * Float64(1.0 + Float64(im * Float64(im * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))))) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (sin(re) * 0.5) * ((im * im) + 2.0); tmp = 0.0; if (im <= 0.00325) tmp = t_0; elseif (im <= 1.35e+154) tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re)))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.00325], t$95$0, If[LessEqual[im, 1.35e+154], N[(re * N[(N[(2.0 + N[(im * N[(im * N[(1.0 + N[(im * N[(im * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
\mathbf{if}\;im \leq 0.00325:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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-*.f6485.9%
Simplified85.9%
if 0.00324999999999999985 < im < 1.35000000000000003e154Initial 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-*.f6477.5%
Simplified77.5%
Taylor expanded in re around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
Simplified62.5%
Final simplification83.2%
(FPCore (re im) :precision binary64 (if (<= re 9.5e-81) (* re (cosh im)) (* (sin re) (+ 1.0 (* im (* im (* (* im im) 0.041666666666666664)))))))
double code(double re, double im) {
double tmp;
if (re <= 9.5e-81) {
tmp = re * cosh(im);
} else {
tmp = sin(re) * (1.0 + (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 (re <= 9.5d-81) then
tmp = re * cosh(im)
else
tmp = sin(re) * (1.0d0 + (im * (im * ((im * im) * 0.041666666666666664d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 9.5e-81) {
tmp = re * Math.cosh(im);
} else {
tmp = Math.sin(re) * (1.0 + (im * (im * ((im * im) * 0.041666666666666664))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 9.5e-81: tmp = re * math.cosh(im) else: tmp = math.sin(re) * (1.0 + (im * (im * ((im * im) * 0.041666666666666664)))) return tmp
function code(re, im) tmp = 0.0 if (re <= 9.5e-81) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(re) * Float64(1.0 + Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 9.5e-81) tmp = re * cosh(im); else tmp = sin(re) * (1.0 + (im * (im * ((im * im) * 0.041666666666666664)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 9.5e-81], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 9.5 \cdot 10^{-81}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if re < 9.49999999999999917e-81Initial 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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified67.3%
if 9.49999999999999917e-81 < 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.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-*.f6489.3%
Simplified89.3%
(FPCore (re im) :precision binary64 (if (<= im 0.00165) (sin re) (* re (cosh im))))
double code(double re, double im) {
double tmp;
if (im <= 0.00165) {
tmp = sin(re);
} else {
tmp = re * 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.00165d0) then
tmp = sin(re)
else
tmp = re * cosh(im)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.00165) {
tmp = Math.sin(re);
} else {
tmp = re * Math.cosh(im);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.00165: tmp = math.sin(re) else: tmp = re * math.cosh(im) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.00165) tmp = sin(re); else tmp = Float64(re * cosh(im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.00165) tmp = sin(re); else tmp = re * cosh(im); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.00165], N[Sin[re], $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.00165:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if im < 0.00165Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6467.0%
Simplified67.0%
if 0.00165 < im 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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified70.3%
(FPCore (re im)
:precision binary64
(if (<= im 0.00172)
(sin re)
(if (<= im 2.5e+142)
(*
re
(*
(+
2.0
(*
im
(*
im
(+
1.0
(*
im
(*
im
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778))))))))
(+ 0.5 (* -0.08333333333333333 (* re re)))))
(*
re
(+
1.0
(*
(* (* im im) (* im im))
(+ 0.041666666666666664 (/ 0.5 (* im im)))))))))
double code(double re, double im) {
double tmp;
if (im <= 0.00172) {
tmp = sin(re);
} else if (im <= 2.5e+142) {
tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = re * (1.0 + (((im * im) * (im * im)) * (0.041666666666666664 + (0.5 / (im * im)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.00172d0) then
tmp = sin(re)
else if (im <= 2.5d+142) then
tmp = re * ((2.0d0 + (im * (im * (1.0d0 + (im * (im * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0)))))))) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else
tmp = re * (1.0d0 + (((im * im) * (im * im)) * (0.041666666666666664d0 + (0.5d0 / (im * im)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.00172) {
tmp = Math.sin(re);
} else if (im <= 2.5e+142) {
tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = re * (1.0 + (((im * im) * (im * im)) * (0.041666666666666664 + (0.5 / (im * im)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.00172: tmp = math.sin(re) elif im <= 2.5e+142: tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re)))) else: tmp = re * (1.0 + (((im * im) * (im * im)) * (0.041666666666666664 + (0.5 / (im * im))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.00172) tmp = sin(re); elseif (im <= 2.5e+142) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * Float64(im * Float64(1.0 + Float64(im * Float64(im * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))))) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(0.5 / Float64(im * im)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.00172) tmp = sin(re); elseif (im <= 2.5e+142) tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re)))); else tmp = re * (1.0 + (((im * im) * (im * im)) * (0.041666666666666664 + (0.5 / (im * im))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.00172], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.5e+142], N[(re * N[(N[(2.0 + N[(im * N[(im * N[(1.0 + N[(im * N[(im * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(0.5 / N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.00172:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.5 \cdot 10^{+142}:\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \frac{0.5}{im \cdot im}\right)\right)\\
\end{array}
\end{array}
if im < 0.00171999999999999996Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6467.0%
Simplified67.0%
if 0.00171999999999999996 < im < 2.5000000000000001e142Initial 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-*.f6476.7%
Simplified76.7%
Taylor expanded in re around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
Simplified64.7%
if 2.5000000000000001e142 < 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 im around inf
associate-+r+N/A
+-commutativeN/A
distribute-lft-inN/A
rgt-mult-inverseN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
Simplified69.2%
(FPCore (re im)
:precision binary64
(if (<= im 1e+142)
(*
re
(*
(+
2.0
(*
im
(*
im
(+
1.0
(*
im
(*
im
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778))))))))
(+ 0.5 (* -0.08333333333333333 (* re re)))))
(*
re
(+
1.0
(* (* (* im im) (* im im)) (+ 0.041666666666666664 (/ 0.5 (* im im))))))))
double code(double re, double im) {
double tmp;
if (im <= 1e+142) {
tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = re * (1.0 + (((im * im) * (im * im)) * (0.041666666666666664 + (0.5 / (im * im)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1d+142) then
tmp = re * ((2.0d0 + (im * (im * (1.0d0 + (im * (im * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0)))))))) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else
tmp = re * (1.0d0 + (((im * im) * (im * im)) * (0.041666666666666664d0 + (0.5d0 / (im * im)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1e+142) {
tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = re * (1.0 + (((im * im) * (im * im)) * (0.041666666666666664 + (0.5 / (im * im)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1e+142: tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re)))) else: tmp = re * (1.0 + (((im * im) * (im * im)) * (0.041666666666666664 + (0.5 / (im * im))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 1e+142) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * Float64(im * Float64(1.0 + Float64(im * Float64(im * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))))) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(0.5 / Float64(im * im)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1e+142) tmp = re * ((2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))))) * (0.5 + (-0.08333333333333333 * (re * re)))); else tmp = re * (1.0 + (((im * im) * (im * im)) * (0.041666666666666664 + (0.5 / (im * im))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1e+142], N[(re * N[(N[(2.0 + N[(im * N[(im * N[(1.0 + N[(im * N[(im * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(0.5 / N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 10^{+142}:\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \frac{0.5}{im \cdot im}\right)\right)\\
\end{array}
\end{array}
if im < 1.00000000000000005e142Initial 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-*.f6494.4%
Simplified94.4%
Taylor expanded in re around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
Simplified52.6%
if 1.00000000000000005e142 < 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 im around inf
associate-+r+N/A
+-commutativeN/A
distribute-lft-inN/A
rgt-mult-inverseN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
Simplified69.2%
(FPCore (re im)
:precision binary64
(if (<= re 6.2e+216)
(*
re
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(*
im
(+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))))))))
(* re (+ 1.0 (* (* re re) -0.16666666666666666)))))
double code(double re, double im) {
double tmp;
if (re <= 6.2e+216) {
tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))));
} else {
tmp = re * (1.0 + ((re * re) * -0.16666666666666666));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 6.2d+216) then
tmp = re * (1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0))))))))
else
tmp = re * (1.0d0 + ((re * re) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 6.2e+216) {
tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889))))))));
} else {
tmp = re * (1.0 + ((re * re) * -0.16666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 6.2e+216: tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))) else: tmp = re * (1.0 + ((re * re) * -0.16666666666666666)) return tmp
function code(re, im) tmp = 0.0 if (re <= 6.2e+216) 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(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 6.2e+216) tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))); else tmp = re * (1.0 + ((re * re) * -0.16666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 6.2e+216], 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[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 6.2 \cdot 10^{+216}:\\
\;\;\;\;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}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if re < 6.20000000000000007e216Initial 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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified60.5%
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-*.f6458.1%
Simplified58.1%
if 6.20000000000000007e216 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6441.4%
Simplified41.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6432.5%
Simplified32.5%
(FPCore (re im) :precision binary64 (if (<= re 6.2e+216) (* re (+ 1.0 (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664)))))) (* re (+ 1.0 (* (* re re) -0.16666666666666666)))))
double code(double re, double im) {
double tmp;
if (re <= 6.2e+216) {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
} else {
tmp = re * (1.0 + ((re * re) * -0.16666666666666666));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 6.2d+216) then
tmp = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0)))))
else
tmp = re * (1.0d0 + ((re * re) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 6.2e+216) {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
} else {
tmp = re * (1.0 + ((re * re) * -0.16666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 6.2e+216: tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))) else: tmp = re * (1.0 + ((re * re) * -0.16666666666666666)) return tmp
function code(re, im) tmp = 0.0 if (re <= 6.2e+216) tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664)))))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 6.2e+216) tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))); else tmp = re * (1.0 + ((re * re) * -0.16666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 6.2e+216], 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], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 6.2 \cdot 10^{+216}:\\
\;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if re < 6.20000000000000007e216Initial 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
Simplified91.6%
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-*.f6456.4%
Simplified56.4%
if 6.20000000000000007e216 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6441.4%
Simplified41.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6432.5%
Simplified32.5%
(FPCore (re im) :precision binary64 (if (<= re 6.2e+216) (* re (+ 1.0 (* (* im im) 0.5))) (* re (+ 1.0 (* (* re re) -0.16666666666666666)))))
double code(double re, double im) {
double tmp;
if (re <= 6.2e+216) {
tmp = re * (1.0 + ((im * im) * 0.5));
} else {
tmp = re * (1.0 + ((re * re) * -0.16666666666666666));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 6.2d+216) then
tmp = re * (1.0d0 + ((im * im) * 0.5d0))
else
tmp = re * (1.0d0 + ((re * re) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 6.2e+216) {
tmp = re * (1.0 + ((im * im) * 0.5));
} else {
tmp = re * (1.0 + ((re * re) * -0.16666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 6.2e+216: tmp = re * (1.0 + ((im * im) * 0.5)) else: tmp = re * (1.0 + ((re * re) * -0.16666666666666666)) return tmp
function code(re, im) tmp = 0.0 if (re <= 6.2e+216) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * 0.5))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 6.2e+216) tmp = re * (1.0 + ((im * im) * 0.5)); else tmp = re * (1.0 + ((re * re) * -0.16666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 6.2e+216], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 6.2 \cdot 10^{+216}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if re < 6.20000000000000007e216Initial 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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified60.5%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6445.7%
Simplified45.7%
if 6.20000000000000007e216 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6441.4%
Simplified41.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6432.5%
Simplified32.5%
Final simplification44.7%
(FPCore (re im) :precision binary64 (if (<= re 6.2e+216) (* re (+ 1.0 (* (* im im) 0.5))) (* re (* (* re re) -0.16666666666666666))))
double code(double re, double im) {
double tmp;
if (re <= 6.2e+216) {
tmp = re * (1.0 + ((im * im) * 0.5));
} else {
tmp = re * ((re * re) * -0.16666666666666666);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 6.2d+216) then
tmp = re * (1.0d0 + ((im * im) * 0.5d0))
else
tmp = re * ((re * re) * (-0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 6.2e+216) {
tmp = re * (1.0 + ((im * im) * 0.5));
} else {
tmp = re * ((re * re) * -0.16666666666666666);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 6.2e+216: tmp = re * (1.0 + ((im * im) * 0.5)) else: tmp = re * ((re * re) * -0.16666666666666666) return tmp
function code(re, im) tmp = 0.0 if (re <= 6.2e+216) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * 0.5))); else tmp = Float64(re * Float64(Float64(re * re) * -0.16666666666666666)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 6.2e+216) tmp = re * (1.0 + ((im * im) * 0.5)); else tmp = re * ((re * re) * -0.16666666666666666); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 6.2e+216], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 6.2 \cdot 10^{+216}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(\left(re \cdot re\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if re < 6.20000000000000007e216Initial 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%
*-lft-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified60.5%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6445.7%
Simplified45.7%
if 6.20000000000000007e216 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6441.4%
Simplified41.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6432.5%
Simplified32.5%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6432.5%
Simplified32.5%
Final simplification44.7%
(FPCore (re im) :precision binary64 (if (<= re 1.25e+125) re (* re (* (* re re) -0.16666666666666666))))
double code(double re, double im) {
double tmp;
if (re <= 1.25e+125) {
tmp = re;
} else {
tmp = re * ((re * re) * -0.16666666666666666);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.25d+125) then
tmp = re
else
tmp = re * ((re * re) * (-0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.25e+125) {
tmp = re;
} else {
tmp = re * ((re * re) * -0.16666666666666666);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.25e+125: tmp = re else: tmp = re * ((re * re) * -0.16666666666666666) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.25e+125) tmp = re; else tmp = Float64(re * Float64(Float64(re * re) * -0.16666666666666666)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.25e+125) tmp = re; else tmp = re * ((re * re) * -0.16666666666666666); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.25e+125], re, N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.25 \cdot 10^{+125}:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(\left(re \cdot re\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if re < 1.24999999999999991e125Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6451.3%
Simplified51.3%
Taylor expanded in re around 0
Simplified25.8%
if 1.24999999999999991e125 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6444.9%
Simplified44.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6431.4%
Simplified31.4%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6431.4%
Simplified31.4%
(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.4%
Simplified50.4%
Taylor expanded in re around 0
Simplified22.5%
herbie shell --seed 2024138
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))