
(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 (* (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 (<= im 0.016)
(* (* (sin re) 0.5) (+ 2.0 (* im im)))
(if (<= im 7.2e+51)
(* re (cosh im))
(*
(sin re)
(+
1.0
(*
(* im im)
(+ 0.5 (* im (* im (* (* im im) 0.001388888888888889))))))))))
double code(double re, double im) {
double tmp;
if (im <= 0.016) {
tmp = (sin(re) * 0.5) * (2.0 + (im * im));
} else if (im <= 7.2e+51) {
tmp = re * cosh(im);
} else {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * ((im * im) * 0.001388888888888889))))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.016d0) then
tmp = (sin(re) * 0.5d0) * (2.0d0 + (im * im))
else if (im <= 7.2d+51) then
tmp = re * cosh(im)
else
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * ((im * im) * 0.001388888888888889d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.016) {
tmp = (Math.sin(re) * 0.5) * (2.0 + (im * im));
} else if (im <= 7.2e+51) {
tmp = re * Math.cosh(im);
} else {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * ((im * im) * 0.001388888888888889))))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.016: tmp = (math.sin(re) * 0.5) * (2.0 + (im * im)) elif im <= 7.2e+51: tmp = re * math.cosh(im) else: tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * ((im * im) * 0.001388888888888889)))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.016) tmp = Float64(Float64(sin(re) * 0.5) * Float64(2.0 + Float64(im * im))); elseif (im <= 7.2e+51) 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(Float64(im * im) * 0.001388888888888889))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.016) tmp = (sin(re) * 0.5) * (2.0 + (im * im)); elseif (im <= 7.2e+51) tmp = re * cosh(im); else tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * ((im * im) * 0.001388888888888889)))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.016], N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.2e+51], 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[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.016:\\
\;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\
\;\;\;\;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(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 0.016Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
if 0.016 < im < 7.20000000000000022e51Initial 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
Simplified70.8%
if 7.20000000000000022e51 < 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%
*-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 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-*.f64100.0%
Simplified100.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification88.0%
(FPCore (re im)
:precision binary64
(if (<= im 0.32)
(* (* (sin re) 0.5) (+ 2.0 (* im im)))
(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.32) {
tmp = (sin(re) * 0.5) * (2.0 + (im * im));
} 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.32d0) then
tmp = (sin(re) * 0.5d0) * (2.0d0 + (im * im))
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.32) {
tmp = (Math.sin(re) * 0.5) * (2.0 + (im * im));
} 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.32: tmp = (math.sin(re) * 0.5) * (2.0 + (im * im)) 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.32) tmp = Float64(Float64(sin(re) * 0.5) * Float64(2.0 + Float64(im * im))); elseif (im <= 2.6e+77) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(re) * Float64(Float64(im * im) * Float64(im * Float64(im * 0.041666666666666664)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.32) tmp = (sin(re) * 0.5) * (2.0 + (im * im)); 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.32], N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.6e+77], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.32:\\
\;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if im < 0.320000000000000007Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
if 0.320000000000000007 < 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%
*-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
Simplified75.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification87.6%
(FPCore (re im) :precision binary64 (let* ((t_0 (* (* (sin re) 0.5) (+ 2.0 (* im im))))) (if (<= im 0.09) t_0 (if (<= im 1.35e+154) (* re (cosh im)) t_0))))
double code(double re, double im) {
double t_0 = (sin(re) * 0.5) * (2.0 + (im * im));
double tmp;
if (im <= 0.09) {
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 = (sin(re) * 0.5d0) * (2.0d0 + (im * im))
if (im <= 0.09d0) 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 = (Math.sin(re) * 0.5) * (2.0 + (im * im));
double tmp;
if (im <= 0.09) {
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 = (math.sin(re) * 0.5) * (2.0 + (im * im)) tmp = 0 if im <= 0.09: 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(sin(re) * 0.5) * Float64(2.0 + Float64(im * im))) tmp = 0.0 if (im <= 0.09) 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 = (sin(re) * 0.5) * (2.0 + (im * im)); tmp = 0.0; if (im <= 0.09) 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[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.09], 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(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{if}\;im \leq 0.09:\\
\;\;\;\;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.089999999999999997 or 1.35000000000000003e154 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6488.0%
Simplified88.0%
if 0.089999999999999997 < 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
Simplified80.1%
Final simplification86.8%
(FPCore (re im) :precision binary64 (if (<= im 0.00088) (sin re) (* re (cosh im))))
double code(double re, double im) {
double tmp;
if (im <= 0.00088) {
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.00088d0) 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.00088) {
tmp = Math.sin(re);
} else {
tmp = re * Math.cosh(im);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.00088: tmp = math.sin(re) else: tmp = re * math.cosh(im) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.00088) 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.00088) tmp = sin(re); else tmp = re * cosh(im); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.00088], N[Sin[re], $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.00088:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if im < 8.80000000000000031e-4Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6463.9%
Simplified63.9%
if 8.80000000000000031e-4 < 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%
*-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
Simplified76.3%
(FPCore (re im)
:precision binary64
(if (<= im 0.0065)
(sin re)
(*
(*
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)))))))))
double code(double re, double im) {
double tmp;
if (im <= 0.0065) {
tmp = sin(re);
} else {
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))))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.0065d0) then
tmp = sin(re)
else
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))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.0065) {
tmp = Math.sin(re);
} else {
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))))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.0065: tmp = math.sin(re) else: 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)))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.0065) tmp = sin(re); else tmp = Float64(Float64(re * Float64(0.5 + Float64(Float64(re * re) * Float64(-0.08333333333333333 + Float64(re * Float64(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))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.0065) tmp = sin(re); else 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)))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.0065], N[Sin[re], $MachinePrecision], N[(N[(re * N[(0.5 + N[(N[(re * re), $MachinePrecision] * N[(-0.08333333333333333 + N[(re * N[(re * 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.0065:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \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)\\
\end{array}
\end{array}
if im < 0.0064999999999999997Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6463.9%
Simplified63.9%
if 0.0064999999999999997 < im Initial 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-*.f6474.6%
Simplified74.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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6464.4%
Simplified64.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664)))))))
(if (<= re 4.5e+24)
(*
re
(+
1.0
(*
im
(*
im
(+
0.5
(*
(* im im)
(+ (* (* im im) 0.001388888888888889) 0.041666666666666664)))))))
(if (<= re 1.12e+150)
(* t_0 (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
(* (* re (* 0.008333333333333333 (* (* re re) (* re re)))) t_0)))))
double code(double re, double im) {
double t_0 = 1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))));
double tmp;
if (re <= 4.5e+24) {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
} else if (re <= 1.12e+150) {
tmp = t_0 * (re * (1.0 + ((re * re) * -0.16666666666666666)));
} else {
tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * 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 = 1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0))))
if (re <= 4.5d+24) then
tmp = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0))))))
else if (re <= 1.12d+150) then
tmp = t_0 * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
else
tmp = (re * (0.008333333333333333d0 * ((re * re) * (re * re)))) * t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))));
double tmp;
if (re <= 4.5e+24) {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
} else if (re <= 1.12e+150) {
tmp = t_0 * (re * (1.0 + ((re * re) * -0.16666666666666666)));
} else {
tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * t_0;
}
return tmp;
}
def code(re, im): t_0 = 1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))) tmp = 0 if re <= 4.5e+24: tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))) elif re <= 1.12e+150: tmp = t_0 * (re * (1.0 + ((re * re) * -0.16666666666666666))) else: tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * t_0 return tmp
function code(re, im) t_0 = Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))) tmp = 0.0 if (re <= 4.5e+24) tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664))))))); elseif (re <= 1.12e+150) tmp = Float64(t_0 * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666)))); else tmp = Float64(Float64(re * Float64(0.008333333333333333 * Float64(Float64(re * re) * Float64(re * re)))) * t_0); end return tmp end
function tmp_2 = code(re, im) t_0 = 1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))); tmp = 0.0; if (re <= 4.5e+24) tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))); elseif (re <= 1.12e+150) tmp = t_0 * (re * (1.0 + ((re * re) * -0.16666666666666666))); else tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 4.5e+24], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.12e+150], N[(t$95$0 * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(0.008333333333333333 * N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\\
\mathbf{if}\;re \leq 4.5 \cdot 10^{+24}:\\
\;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\
\;\;\;\;t\_0 \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\right) \cdot t\_0\\
\end{array}
\end{array}
if re < 4.50000000000000019e24Initial 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 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.5%
Simplified90.5%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.2%
Simplified68.2%
if 4.50000000000000019e24 < re < 1.12e150Initial 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
Simplified88.6%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.8%
Simplified36.8%
if 1.12e150 < 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
Simplified73.5%
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-*.f6435.4%
Simplified35.4%
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-*.f6435.4%
Simplified35.4%
Final simplification61.0%
(FPCore (re im)
:precision binary64
(*
(*
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))))))))
double code(double re, double im) {
return (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))))));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (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))))))
end function
public static double code(double re, double im) {
return (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))))));
}
def code(re, im): return (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))))))
function code(re, im) return Float64(Float64(re * Float64(0.5 + Float64(Float64(re * re) * Float64(-0.08333333333333333 + Float64(re * Float64(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))))))) end
function tmp = code(re, im) 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)))))); end
code[re_, im_] := N[(N[(re * N[(0.5 + N[(N[(re * re), $MachinePrecision] * N[(-0.08333333333333333 + N[(re * N[(re * 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]
\begin{array}{l}
\\
\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \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)
\end{array}
Initial 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.8%
Simplified90.8%
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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6459.4%
Simplified59.4%
(FPCore (re im)
:precision binary64
(if (<= re 1.12e+150)
(*
re
(*
(+
2.0
(*
im
(*
im
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* im (* im 0.002777777777777778))))))))
(+ 0.5 (* (* re re) -0.08333333333333333))))
(*
(* re (* 0.008333333333333333 (* (* re re) (* re re))))
(+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664))))))))
double code(double re, double im) {
double tmp;
if (re <= 1.12e+150) {
tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = (re * (0.008333333333333333 * ((re * re) * (re * 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 <= 1.12d+150) then
tmp = re * ((2.0d0 + (im * (im * (1.0d0 + ((im * im) * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0)))))))) * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
else
tmp = (re * (0.008333333333333333d0 * ((re * re) * (re * 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 <= 1.12e+150) {
tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.12e+150: tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333))) else: tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.12e+150) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * Float64(im * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778)))))))) * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333)))); else tmp = Float64(Float64(re * Float64(0.008333333333333333 * Float64(Float64(re * re) * Float64(re * 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 <= 1.12e+150) tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333))); else tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.12e+150], N[(re * N[(N[(2.0 + N[(im * N[(im * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(0.008333333333333333 * N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 1.12 \cdot 10^{+150}:\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot \left(im \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\right) \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 < 1.12e150Initial 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.7%
Simplified90.7%
Taylor expanded in re around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified62.4%
if 1.12e150 < 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
Simplified73.5%
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-*.f6435.4%
Simplified35.4%
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-*.f6435.4%
Simplified35.4%
Final simplification59.0%
(FPCore (re im)
:precision binary64
(if (<= re 4.5e+24)
(*
re
(+
1.0
(*
im
(*
im
(+
0.5
(*
(* im im)
(+ (* (* im im) 0.001388888888888889) 0.041666666666666664)))))))
(if (<= re 1.12e+150)
(*
(+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664)))))
(* re (+ 1.0 (* (* re re) -0.16666666666666666))))
(*
re
(+
1.0
(*
re
(*
re
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))))))
double code(double re, double im) {
double tmp;
if (re <= 4.5e+24) {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
} else if (re <= 1.12e+150) {
tmp = (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
} else {
tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 4.5d+24) then
tmp = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0))))))
else if (re <= 1.12d+150) then
tmp = (1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0))))) * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
else
tmp = re * (1.0d0 + (re * (re * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 4.5e+24) {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
} else if (re <= 1.12e+150) {
tmp = (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
} else {
tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 4.5e+24: tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))) elif re <= 1.12e+150: tmp = (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) * (re * (1.0 + ((re * re) * -0.16666666666666666))) else: tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 4.5e+24) tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664))))))); elseif (re <= 1.12e+150) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666)))); else tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 4.5e+24) tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))); elseif (re <= 1.12e+150) tmp = (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) * (re * (1.0 + ((re * re) * -0.16666666666666666))); else tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 4.5e+24], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.12e+150], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(re * N[(re * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 4.5 \cdot 10^{+24}:\\
\;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if re < 4.50000000000000019e24Initial 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 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.5%
Simplified90.5%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.2%
Simplified68.2%
if 4.50000000000000019e24 < re < 1.12e150Initial 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
Simplified88.6%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.8%
Simplified36.8%
if 1.12e150 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6451.6%
Simplified51.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
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.4%
Simplified35.4%
Final simplification61.0%
(FPCore (re im)
:precision binary64
(if (<= re 1.35e+110)
(*
(* re 0.5)
(+ 2.0 (* (* im im) (+ 1.0 (* (* im im) 0.08333333333333333)))))
(if (<= re 1.12e+150)
(* -0.16666666666666666 (* re (* re re)))
(*
re
(+
1.0
(*
re
(*
re
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))))))
double code(double re, double im) {
double tmp;
if (re <= 1.35e+110) {
tmp = (re * 0.5) * (2.0 + ((im * im) * (1.0 + ((im * im) * 0.08333333333333333))));
} else if (re <= 1.12e+150) {
tmp = -0.16666666666666666 * (re * (re * re));
} else {
tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.35d+110) then
tmp = (re * 0.5d0) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * 0.08333333333333333d0))))
else if (re <= 1.12d+150) then
tmp = (-0.16666666666666666d0) * (re * (re * re))
else
tmp = re * (1.0d0 + (re * (re * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.35e+110) {
tmp = (re * 0.5) * (2.0 + ((im * im) * (1.0 + ((im * im) * 0.08333333333333333))));
} else if (re <= 1.12e+150) {
tmp = -0.16666666666666666 * (re * (re * re));
} else {
tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.35e+110: tmp = (re * 0.5) * (2.0 + ((im * im) * (1.0 + ((im * im) * 0.08333333333333333)))) elif re <= 1.12e+150: tmp = -0.16666666666666666 * (re * (re * re)) else: tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.35e+110) tmp = Float64(Float64(re * 0.5) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * 0.08333333333333333))))); elseif (re <= 1.12e+150) tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re))); else tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.35e+110) tmp = (re * 0.5) * (2.0 + ((im * im) * (1.0 + ((im * im) * 0.08333333333333333)))); elseif (re <= 1.12e+150) tmp = -0.16666666666666666 * (re * (re * re)); else tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.35e+110], N[(N[(re * 0.5), $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.12e+150], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(re * N[(re * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.35 \cdot 10^{+110}:\\
\;\;\;\;\left(re \cdot 0.5\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot 0.08333333333333333\right)\right)\\
\mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if re < 1.35000000000000005e110Initial 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-*.f6491.3%
Simplified91.3%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f6464.5%
Simplified64.5%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.8%
Simplified62.8%
if 1.35000000000000005e110 < re < 1.12e150Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6439.5%
Simplified39.5%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.7%
Simplified62.7%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.7%
Simplified62.7%
if 1.12e150 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6451.6%
Simplified51.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
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.4%
Simplified35.4%
(FPCore (re im)
:precision binary64
(if (<= re 1.35e+110)
(* re (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664))))))
(if (<= re 1.12e+150)
(* -0.16666666666666666 (* re (* re re)))
(*
re
(+
1.0
(*
re
(*
re
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))))))
double code(double re, double im) {
double tmp;
if (re <= 1.35e+110) {
tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (re <= 1.12e+150) {
tmp = -0.16666666666666666 * (re * (re * re));
} else {
tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.35d+110) then
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
else if (re <= 1.12d+150) then
tmp = (-0.16666666666666666d0) * (re * (re * re))
else
tmp = re * (1.0d0 + (re * (re * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.35e+110) {
tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
} else if (re <= 1.12e+150) {
tmp = -0.16666666666666666 * (re * (re * re));
} else {
tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.35e+110: tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) elif re <= 1.12e+150: tmp = -0.16666666666666666 * (re * (re * re)) else: tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.35e+110) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); elseif (re <= 1.12e+150) tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re))); else tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.35e+110) tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))); elseif (re <= 1.12e+150) tmp = -0.16666666666666666 * (re * (re * re)); else tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.35e+110], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.12e+150], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(re * N[(re * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.35 \cdot 10^{+110}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if re < 1.35000000000000005e110Initial 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
Simplified89.4%
Taylor expanded in re around 0
Simplified62.3%
if 1.35000000000000005e110 < re < 1.12e150Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6439.5%
Simplified39.5%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.7%
Simplified62.7%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.7%
Simplified62.7%
if 1.12e150 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6451.6%
Simplified51.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
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.4%
Simplified35.4%
(FPCore (re im)
:precision binary64
(if (<= re 1.35e+110)
(* (+ 2.0 (* im im)) (* re 0.5))
(if (<= re 1.12e+150)
(* -0.16666666666666666 (* re (* re re)))
(*
re
(+
1.0
(*
re
(*
re
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))))))
double code(double re, double im) {
double tmp;
if (re <= 1.35e+110) {
tmp = (2.0 + (im * im)) * (re * 0.5);
} else if (re <= 1.12e+150) {
tmp = -0.16666666666666666 * (re * (re * re));
} else {
tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.35d+110) then
tmp = (2.0d0 + (im * im)) * (re * 0.5d0)
else if (re <= 1.12d+150) then
tmp = (-0.16666666666666666d0) * (re * (re * re))
else
tmp = re * (1.0d0 + (re * (re * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.35e+110) {
tmp = (2.0 + (im * im)) * (re * 0.5);
} else if (re <= 1.12e+150) {
tmp = -0.16666666666666666 * (re * (re * re));
} else {
tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.35e+110: tmp = (2.0 + (im * im)) * (re * 0.5) elif re <= 1.12e+150: tmp = -0.16666666666666666 * (re * (re * re)) else: tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.35e+110) tmp = Float64(Float64(2.0 + Float64(im * im)) * Float64(re * 0.5)); elseif (re <= 1.12e+150) tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re))); else tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.35e+110) tmp = (2.0 + (im * im)) * (re * 0.5); elseif (re <= 1.12e+150) tmp = -0.16666666666666666 * (re * (re * re)); else tmp = re * (1.0 + (re * (re * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.35e+110], N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(re * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.12e+150], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(re * N[(re * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.35 \cdot 10^{+110}:\\
\;\;\;\;\left(2 + im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\
\mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if re < 1.35000000000000005e110Initial 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-*.f6491.3%
Simplified91.3%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f6464.5%
Simplified64.5%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6452.5%
Simplified52.5%
if 1.35000000000000005e110 < re < 1.12e150Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6439.5%
Simplified39.5%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.7%
Simplified62.7%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.7%
Simplified62.7%
if 1.12e150 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6451.6%
Simplified51.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
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.4%
Simplified35.4%
Final simplification50.6%
(FPCore (re im)
:precision binary64
(*
re
(+
1.0
(*
im
(*
im
(+
0.5
(*
(* im im)
(+ (* (* im im) 0.001388888888888889) 0.041666666666666664))))))))
double code(double re, double im) {
return re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0))))))
end function
public static double code(double re, double im) {
return re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
}
def code(re, im): return re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))))
function code(re, im) return Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664))))))) end
function tmp = code(re, im) tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))); end
code[re_, im_] := N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)
\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%
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.8%
Simplified90.8%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.2%
Simplified58.2%
Final simplification58.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (+ 2.0 (* im im)) (* re 0.5))))
(if (<= re 1.35e+110)
t_0
(if (<= re 2.8e+227) (* -0.16666666666666666 (* re (* re re))) t_0))))
double code(double re, double im) {
double t_0 = (2.0 + (im * im)) * (re * 0.5);
double tmp;
if (re <= 1.35e+110) {
tmp = t_0;
} else if (re <= 2.8e+227) {
tmp = -0.16666666666666666 * (re * (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 = (2.0d0 + (im * im)) * (re * 0.5d0)
if (re <= 1.35d+110) then
tmp = t_0
else if (re <= 2.8d+227) then
tmp = (-0.16666666666666666d0) * (re * (re * re))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (2.0 + (im * im)) * (re * 0.5);
double tmp;
if (re <= 1.35e+110) {
tmp = t_0;
} else if (re <= 2.8e+227) {
tmp = -0.16666666666666666 * (re * (re * re));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (2.0 + (im * im)) * (re * 0.5) tmp = 0 if re <= 1.35e+110: tmp = t_0 elif re <= 2.8e+227: tmp = -0.16666666666666666 * (re * (re * re)) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(2.0 + Float64(im * im)) * Float64(re * 0.5)) tmp = 0.0 if (re <= 1.35e+110) tmp = t_0; elseif (re <= 2.8e+227) tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (2.0 + (im * im)) * (re * 0.5); tmp = 0.0; if (re <= 1.35e+110) tmp = t_0; elseif (re <= 2.8e+227) tmp = -0.16666666666666666 * (re * (re * re)); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 1.35e+110], t$95$0, If[LessEqual[re, 2.8e+227], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(2 + im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\
\mathbf{if}\;re \leq 1.35 \cdot 10^{+110}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 2.8 \cdot 10^{+227}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < 1.35000000000000005e110 or 2.79999999999999984e227 < re Initial 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-*.f6491.5%
Simplified91.5%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f6462.2%
Simplified62.2%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6450.7%
Simplified50.7%
if 1.35000000000000005e110 < re < 2.79999999999999984e227Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6442.8%
Simplified42.8%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.7%
Simplified36.7%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.7%
Simplified36.7%
Final simplification49.5%
(FPCore (re im) :precision binary64 (if (<= im 14500000000000.0) re (* -0.16666666666666666 (* re (* re re)))))
double code(double re, double im) {
double tmp;
if (im <= 14500000000000.0) {
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 (im <= 14500000000000.0d0) 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 (im <= 14500000000000.0) {
tmp = re;
} else {
tmp = -0.16666666666666666 * (re * (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 14500000000000.0: tmp = re else: tmp = -0.16666666666666666 * (re * (re * re)) return tmp
function code(re, im) tmp = 0.0 if (im <= 14500000000000.0) 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 (im <= 14500000000000.0) tmp = re; else tmp = -0.16666666666666666 * (re * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 14500000000000.0], re, N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 14500000000000:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if im < 1.45e13Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6462.2%
Simplified62.2%
Taylor expanded in re around 0
Simplified32.7%
if 1.45e13 < im Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f642.8%
Simplified2.8%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.0%
Simplified14.0%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6413.5%
Simplified13.5%
(FPCore (re im) :precision binary64 (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
double code(double re, double im) {
return re * (1.0 + ((re * re) * -0.16666666666666666));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + ((re * re) * (-0.16666666666666666d0)))
end function
public static double code(double re, double im) {
return re * (1.0 + ((re * re) * -0.16666666666666666));
}
def code(re, im): return re * (1.0 + ((re * re) * -0.16666666666666666))
function code(re, im) return Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))) end
function tmp = code(re, im) tmp = re * (1.0 + ((re * re) * -0.16666666666666666)); end
code[re_, im_] := N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6448.9%
Simplified48.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.0%
Simplified34.0%
(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.f6448.9%
Simplified48.9%
Taylor expanded in re around 0
Simplified26.0%
herbie shell --seed 2024154
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))