
(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-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
(FPCore (re im)
:precision binary64
(if (<= im 1.75e-12)
(sin re)
(if (<= im 7e+51)
(* (cosh im) (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
(*
(sin re)
(+
1.0
(*
(* im im)
(+ 0.5 (* im (* im (* (* im im) 0.001388888888888889))))))))))
double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
tmp = sin(re);
} else if (im <= 7e+51) {
tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
} 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 <= 1.75d-12) then
tmp = sin(re)
else if (im <= 7d+51) then
tmp = cosh(im) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))
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 <= 1.75e-12) {
tmp = Math.sin(re);
} else if (im <= 7e+51) {
tmp = Math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
} 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 <= 1.75e-12: tmp = math.sin(re) elif im <= 7e+51: tmp = math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666)))) 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 <= 1.75e-12) tmp = sin(re); elseif (im <= 7e+51) tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))); 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 <= 1.75e-12) tmp = sin(re); elseif (im <= 7e+51) tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666)))); 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, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 7e+51], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\
\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 < 1.75e-12Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.3%
Simplified69.3%
if 1.75e-12 < im < 7e51Initial program 100.0%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.2%
Simplified88.2%
if 7e51 < im Initial program 100.0%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/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 simplification76.8%
(FPCore (re im)
:precision binary64
(if (<= im 1.75e-12)
(sin re)
(if (<= im 2.6e+77)
(* (cosh im) (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
(*
(sin re)
(+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664))))))))
double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
tmp = sin(re);
} else if (im <= 2.6e+77) {
tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
} 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 (im <= 1.75d-12) then
tmp = sin(re)
else if (im <= 2.6d+77) then
tmp = cosh(im) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))
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 (im <= 1.75e-12) {
tmp = Math.sin(re);
} else if (im <= 2.6e+77) {
tmp = Math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
} else {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.75e-12: tmp = math.sin(re) elif im <= 2.6e+77: tmp = math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666)))) 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 (im <= 1.75e-12) tmp = sin(re); elseif (im <= 2.6e+77) tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))); 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 (im <= 1.75e-12) tmp = sin(re); elseif (im <= 2.6e+77) tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666)))); else tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.6e+77], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\
\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 im < 1.75e-12Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.3%
Simplified69.3%
if 1.75e-12 < im < 2.6000000000000002e77Initial program 100.0%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6485.7%
Simplified85.7%
if 2.6000000000000002e77 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified100.0%
Final simplification76.4%
(FPCore (re im)
:precision binary64
(if (<= im 1.75e-12)
(sin re)
(if (<= im 1.35e+154)
(* (cosh im) (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
(* (* im im) (* (sin re) 0.5)))))
double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
tmp = sin(re);
} else if (im <= 1.35e+154) {
tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
} else {
tmp = (im * im) * (sin(re) * 0.5);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.75d-12) then
tmp = sin(re)
else if (im <= 1.35d+154) then
tmp = cosh(im) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))
else
tmp = (im * im) * (sin(re) * 0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
tmp = Math.sin(re);
} else if (im <= 1.35e+154) {
tmp = Math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
} else {
tmp = (im * im) * (Math.sin(re) * 0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.75e-12: tmp = math.sin(re) elif im <= 1.35e+154: tmp = math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666)))) else: tmp = (im * im) * (math.sin(re) * 0.5) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.75e-12) tmp = sin(re); elseif (im <= 1.35e+154) tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))); else tmp = Float64(Float64(im * im) * Float64(sin(re) * 0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.75e-12) tmp = sin(re); elseif (im <= 1.35e+154) tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666)))); else tmp = (im * im) * (sin(re) * 0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\
\end{array}
\end{array}
if im < 1.75e-12Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.3%
Simplified69.3%
if 1.75e-12 < im < 1.35000000000000003e154Initial program 100.0%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6482.5%
Simplified82.5%
if 1.35000000000000003e154 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in im around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification74.8%
(FPCore (re im) :precision binary64 (if (<= im 1.75e-12) (sin re) (if (<= im 1.35e+154) (* re (cosh im)) (* (* im im) (* (sin re) 0.5)))))
double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
tmp = sin(re);
} else if (im <= 1.35e+154) {
tmp = re * cosh(im);
} else {
tmp = (im * im) * (sin(re) * 0.5);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.75d-12) then
tmp = sin(re)
else if (im <= 1.35d+154) then
tmp = re * cosh(im)
else
tmp = (im * im) * (sin(re) * 0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
tmp = Math.sin(re);
} else if (im <= 1.35e+154) {
tmp = re * Math.cosh(im);
} else {
tmp = (im * im) * (Math.sin(re) * 0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.75e-12: tmp = math.sin(re) elif im <= 1.35e+154: tmp = re * math.cosh(im) else: tmp = (im * im) * (math.sin(re) * 0.5) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.75e-12) tmp = sin(re); elseif (im <= 1.35e+154) tmp = Float64(re * cosh(im)); else tmp = Float64(Float64(im * im) * Float64(sin(re) * 0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.75e-12) tmp = sin(re); elseif (im <= 1.35e+154) tmp = re * cosh(im); else tmp = (im * im) * (sin(re) * 0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\
\end{array}
\end{array}
if im < 1.75e-12Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.3%
Simplified69.3%
if 1.75e-12 < im < 1.35000000000000003e154Initial program 100.0%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified77.5%
if 1.35000000000000003e154 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in im around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification74.1%
(FPCore (re im) :precision binary64 (if (<= im 1.75e-12) (sin re) (* re (cosh im))))
double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
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 <= 1.75d-12) 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 <= 1.75e-12) {
tmp = Math.sin(re);
} else {
tmp = re * Math.cosh(im);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.75e-12: tmp = math.sin(re) else: tmp = re * math.cosh(im) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.75e-12) tmp = sin(re); else tmp = Float64(re * cosh(im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.75e-12) tmp = sin(re); else tmp = re * cosh(im); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if im < 1.75e-12Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.3%
Simplified69.3%
if 1.75e-12 < im Initial program 100.0%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified76.8%
(FPCore (re im)
:precision binary64
(if (<= im 1.75e-12)
(sin re)
(if (<= im 9e+172)
(*
(*
re
(+
0.5
(*
re
(*
re
(+
-0.08333333333333333
(*
(* re re)
(+ 0.004166666666666667 (* (* re re) -9.92063492063492e-5))))))))
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))))
(* (* re 0.5) (+ (* im im) 2.0)))))
double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
tmp = sin(re);
} else if (im <= 9e+172) {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
} else {
tmp = (re * 0.5) * ((im * im) + 2.0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.75d-12) then
tmp = sin(re)
else if (im <= 9d+172) then
tmp = (re * (0.5d0 + (re * (re * ((-0.08333333333333333d0) + ((re * re) * (0.004166666666666667d0 + ((re * re) * (-9.92063492063492d-5))))))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
else
tmp = (re * 0.5d0) * ((im * im) + 2.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.75e-12) {
tmp = Math.sin(re);
} else if (im <= 9e+172) {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
} else {
tmp = (re * 0.5) * ((im * im) + 2.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.75e-12: tmp = math.sin(re) elif im <= 9e+172: tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) else: tmp = (re * 0.5) * ((im * im) + 2.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.75e-12) tmp = sin(re); elseif (im <= 9e+172) tmp = Float64(Float64(re * Float64(0.5 + Float64(re * Float64(re * Float64(-0.08333333333333333 + Float64(Float64(re * re) * Float64(0.004166666666666667 + Float64(Float64(re * re) * -9.92063492063492e-5)))))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778))))))); else tmp = Float64(Float64(re * 0.5) * Float64(Float64(im * im) + 2.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.75e-12) tmp = sin(re); elseif (im <= 9e+172) tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))); else tmp = (re * 0.5) * ((im * im) + 2.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 9e+172], N[(N[(re * N[(0.5 + N[(re * N[(re * N[(-0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * N[(0.004166666666666667 + N[(N[(re * re), $MachinePrecision] * -9.92063492063492e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 9 \cdot 10^{+172}:\\
\;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
\end{array}
\end{array}
if im < 1.75e-12Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.3%
Simplified69.3%
if 1.75e-12 < im < 9.0000000000000004e172Initial 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-*.f6470.2%
Simplified70.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.2%
Simplified61.2%
if 9.0000000000000004e172 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
Simplified79.2%
Final simplification68.8%
(FPCore (re im)
:precision binary64
(if (<= re 1.2e+154)
(*
(*
re
(+
0.5
(*
re
(*
re
(+
-0.08333333333333333
(*
(* re re)
(+ 0.004166666666666667 (* (* re re) -9.92063492063492e-5))))))))
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))))
(if (<= re 6.5e+296)
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))
(* re (+ 1.0 (* -0.16666666666666666 (* re re)))))))
double code(double re, double im) {
double tmp;
if (re <= 1.2e+154) {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
} else if (re <= 6.5e+296) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.2d+154) then
tmp = (re * (0.5d0 + (re * (re * ((-0.08333333333333333d0) + ((re * re) * (0.004166666666666667d0 + ((re * re) * (-9.92063492063492d-5))))))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
else if (re <= 6.5d+296) then
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
else
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.2e+154) {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
} else if (re <= 6.5e+296) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.2e+154: tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) elif re <= 6.5e+296: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))) else: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.2e+154) tmp = Float64(Float64(re * Float64(0.5 + Float64(re * Float64(re * Float64(-0.08333333333333333 + Float64(Float64(re * re) * Float64(0.004166666666666667 + Float64(Float64(re * re) * -9.92063492063492e-5)))))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778))))))); elseif (re <= 6.5e+296) tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))); else tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.2e+154) tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))); elseif (re <= 6.5e+296) tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))); else tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.2e+154], N[(N[(re * N[(0.5 + N[(re * N[(re * N[(-0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * N[(0.004166666666666667 + N[(N[(re * re), $MachinePrecision] * -9.92063492063492e-5), $MachinePrecision]), $MachinePrecision]), $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], If[LessEqual[re, 6.5e+296], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.2 \cdot 10^{+154}:\\
\;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\
\mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 1.20000000000000007e154Initial 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-*.f6489.9%
Simplified89.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.0%
Simplified61.0%
if 1.20000000000000007e154 < re < 6.5e296Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6472.9%
Simplified72.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.5%
Simplified29.5%
if 6.5e296 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.9%
Simplified66.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.9%
Simplified66.9%
(FPCore (re im)
:precision binary64
(if (<= im 2e+172)
(*
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778))))))
(* re (+ 0.5 (* -0.08333333333333333 (* re re)))))
(* (* re 0.5) (+ (* im im) 2.0))))
double code(double re, double im) {
double tmp;
if (im <= 2e+172) {
tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = (re * 0.5) * ((im * im) + 2.0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2d+172) then
tmp = (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0)))))) * (re * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else
tmp = (re * 0.5d0) * ((im * im) + 2.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2e+172) {
tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = (re * 0.5) * ((im * im) + 2.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2e+172: tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + (-0.08333333333333333 * (re * re)))) else: tmp = (re * 0.5) * ((im * im) + 2.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 2e+172) tmp = Float64(Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))) * Float64(re * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); else tmp = Float64(Float64(re * 0.5) * Float64(Float64(im * im) + 2.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2e+172) tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + (-0.08333333333333333 * (re * re)))); else tmp = (re * 0.5) * ((im * im) + 2.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2e+172], N[(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] * N[(re * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2 \cdot 10^{+172}:\\
\;\;\;\;\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) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
\end{array}
\end{array}
if im < 2.0000000000000002e172Initial 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-*.f6489.7%
Simplified89.7%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.0%
Simplified52.0%
if 2.0000000000000002e172 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in re around 0
Simplified79.2%
Final simplification54.5%
(FPCore (re im)
:precision binary64
(if (<= re 6.2e+41)
(*
re
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(*
im
(+ (* (* im im) 0.001388888888888889) 0.041666666666666664))))))))
(if (<= re 1.2e+154)
(*
re
(+
1.0
(*
(* re re)
(+
-0.16666666666666666
(*
re
(*
re
(+ 0.008333333333333333 (* (* re re) -0.0001984126984126984))))))))
(if (<= re 6.5e+296)
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))
(* re (+ 1.0 (* -0.16666666666666666 (* re re))))))))
double code(double re, double im) {
double tmp;
if (re <= 6.2e+41) {
tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
} else if (re <= 1.2e+154) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984)))))));
} else if (re <= 6.5e+296) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 6.2d+41) then
tmp = re * (1.0d0 + (im * (im * (0.5d0 + (im * (im * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0)))))))
else if (re <= 1.2d+154) then
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + (re * (re * (0.008333333333333333d0 + ((re * re) * (-0.0001984126984126984d0))))))))
else if (re <= 6.5d+296) then
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
else
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 6.2e+41) {
tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
} else if (re <= 1.2e+154) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984)))))));
} else if (re <= 6.5e+296) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 6.2e+41: tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))))) elif re <= 1.2e+154: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984))))))) elif re <= 6.5e+296: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))) else: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 6.2e+41) tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664)))))))); elseif (re <= 1.2e+154) tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(re * Float64(re * Float64(0.008333333333333333 + Float64(Float64(re * re) * -0.0001984126984126984)))))))); elseif (re <= 6.5e+296) tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))); else tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 6.2e+41) tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))))); elseif (re <= 1.2e+154) tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984))))))); elseif (re <= 6.5e+296) tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))); else tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 6.2e+41], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.2e+154], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(re * N[(re * N[(0.008333333333333333 + N[(N[(re * re), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
\;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + re \cdot \left(re \cdot \left(0.008333333333333333 + \left(re \cdot re\right) \cdot -0.0001984126984126984\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 6.2e41Initial program 100.0%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/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-*.f6489.9%
Simplified89.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.0%
Simplified63.0%
if 6.2e41 < re < 1.20000000000000007e154Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6456.4%
Simplified56.4%
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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6426.0%
Simplified26.0%
if 1.20000000000000007e154 < re < 6.5e296Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6472.9%
Simplified72.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.5%
Simplified29.5%
if 6.5e296 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.9%
Simplified66.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.9%
Simplified66.9%
Final simplification56.8%
(FPCore (re im)
:precision binary64
(if (<= re 6.2e+41)
(*
re
(+
1.0
(*
im
(*
im
(+
0.5
(*
im
(*
im
(+ (* (* im im) 0.001388888888888889) 0.041666666666666664))))))))
(if (<= re 1.2e+154)
(* re (* (* im im) (+ 0.5 (* -0.08333333333333333 (* re re)))))
(if (<= re 6.5e+296)
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))
(* re (+ 1.0 (* -0.16666666666666666 (* re re))))))))
double code(double re, double im) {
double tmp;
if (re <= 6.2e+41) {
tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
} else if (re <= 1.2e+154) {
tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
} else if (re <= 6.5e+296) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 6.2d+41) then
tmp = re * (1.0d0 + (im * (im * (0.5d0 + (im * (im * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0)))))))
else if (re <= 1.2d+154) then
tmp = re * ((im * im) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else if (re <= 6.5d+296) then
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
else
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 6.2e+41) {
tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
} else if (re <= 1.2e+154) {
tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
} else if (re <= 6.5e+296) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 6.2e+41: tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))))) elif re <= 1.2e+154: tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re)))) elif re <= 6.5e+296: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))) else: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 6.2e+41) tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664)))))))); elseif (re <= 1.2e+154) tmp = Float64(re * Float64(Float64(im * im) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); elseif (re <= 6.5e+296) tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))); else tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 6.2e+41) tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))))); elseif (re <= 1.2e+154) tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re)))); elseif (re <= 6.5e+296) tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))); else tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 6.2e+41], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.2e+154], N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
\;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 6.2e41Initial program 100.0%
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
+-commutativeN/A
sub0-negN/A
cosh-defN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/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-*.f6489.9%
Simplified89.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.0%
Simplified63.0%
if 6.2e41 < re < 1.20000000000000007e154Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6462.0%
Simplified62.0%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6426.2%
Simplified26.2%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.1%
Simplified27.1%
if 1.20000000000000007e154 < re < 6.5e296Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6472.9%
Simplified72.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.5%
Simplified29.5%
if 6.5e296 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.9%
Simplified66.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.9%
Simplified66.9%
Final simplification56.9%
(FPCore (re im)
:precision binary64
(if (<= re 6.2e+41)
(* re (+ 1.0 (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664))))))
(if (<= re 1.2e+154)
(* re (* (* im im) (+ 0.5 (* -0.08333333333333333 (* re re)))))
(if (<= re 6.5e+296)
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))
(* re (+ 1.0 (* -0.16666666666666666 (* re re))))))))
double code(double re, double im) {
double tmp;
if (re <= 6.2e+41) {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
} else if (re <= 1.2e+154) {
tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
} else if (re <= 6.5e+296) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 6.2d+41) then
tmp = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0)))))
else if (re <= 1.2d+154) then
tmp = re * ((im * im) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else if (re <= 6.5d+296) then
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
else
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 6.2e+41) {
tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
} else if (re <= 1.2e+154) {
tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
} else if (re <= 6.5e+296) {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 6.2e+41: tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))) elif re <= 1.2e+154: tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re)))) elif re <= 6.5e+296: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))) else: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 6.2e+41) tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664)))))); elseif (re <= 1.2e+154) tmp = Float64(re * Float64(Float64(im * im) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); elseif (re <= 6.5e+296) tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))); else tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 6.2e+41) tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))); elseif (re <= 1.2e+154) tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re)))); elseif (re <= 6.5e+296) tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))); else tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 6.2e+41], 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], If[LessEqual[re, 1.2e+154], N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
\;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 6.2e41Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified86.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-*.f6460.7%
Simplified60.7%
if 6.2e41 < re < 1.20000000000000007e154Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6462.0%
Simplified62.0%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6426.2%
Simplified26.2%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.1%
Simplified27.1%
if 1.20000000000000007e154 < re < 6.5e296Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6472.9%
Simplified72.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.5%
Simplified29.5%
if 6.5e296 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.9%
Simplified66.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.9%
Simplified66.9%
Final simplification55.1%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
re
(+ 1.0 (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664))))))))
(if (<= re 6.2e+41)
t_0
(if (<= re 1.2e+154)
(* re (* (* im im) (+ 0.5 (* -0.08333333333333333 (* re re)))))
(if (<= re 6.5e+296)
t_0
(* re (+ 1.0 (* -0.16666666666666666 (* re re)))))))))
double code(double re, double im) {
double t_0 = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
double tmp;
if (re <= 6.2e+41) {
tmp = t_0;
} else if (re <= 1.2e+154) {
tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
} else if (re <= 6.5e+296) {
tmp = t_0;
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0)))))
if (re <= 6.2d+41) then
tmp = t_0
else if (re <= 1.2d+154) then
tmp = re * ((im * im) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else if (re <= 6.5d+296) then
tmp = t_0
else
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
double tmp;
if (re <= 6.2e+41) {
tmp = t_0;
} else if (re <= 1.2e+154) {
tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
} else if (re <= 6.5e+296) {
tmp = t_0;
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): t_0 = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))) tmp = 0 if re <= 6.2e+41: tmp = t_0 elif re <= 1.2e+154: tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re)))) elif re <= 6.5e+296: tmp = t_0 else: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) return tmp
function code(re, im) t_0 = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664)))))) tmp = 0.0 if (re <= 6.2e+41) tmp = t_0; elseif (re <= 1.2e+154) tmp = Float64(re * Float64(Float64(im * im) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); elseif (re <= 6.5e+296) tmp = t_0; else tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) t_0 = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))); tmp = 0.0; if (re <= 6.2e+41) tmp = t_0; elseif (re <= 1.2e+154) tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re)))); elseif (re <= 6.5e+296) tmp = t_0; else tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = 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]}, If[LessEqual[re, 6.2e+41], t$95$0, If[LessEqual[re, 1.2e+154], N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], t$95$0, N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 6.2e41 or 1.20000000000000007e154 < re < 6.5e296Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified87.7%
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.9%
Simplified56.9%
if 6.2e41 < re < 1.20000000000000007e154Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6462.0%
Simplified62.0%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6426.2%
Simplified26.2%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.1%
Simplified27.1%
if 6.5e296 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.9%
Simplified66.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.9%
Simplified66.9%
Final simplification54.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* re 0.5) (+ (* im im) 2.0))))
(if (<= re 6.2e+41)
t_0
(if (<= re 1.2e+154)
(* re (* (* im im) (+ 0.5 (* -0.08333333333333333 (* re re)))))
(if (<= re 6.5e+296)
t_0
(* re (+ 1.0 (* -0.16666666666666666 (* re re)))))))))
double code(double re, double im) {
double t_0 = (re * 0.5) * ((im * im) + 2.0);
double tmp;
if (re <= 6.2e+41) {
tmp = t_0;
} else if (re <= 1.2e+154) {
tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
} else if (re <= 6.5e+296) {
tmp = t_0;
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (re * 0.5d0) * ((im * im) + 2.0d0)
if (re <= 6.2d+41) then
tmp = t_0
else if (re <= 1.2d+154) then
tmp = re * ((im * im) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else if (re <= 6.5d+296) then
tmp = t_0
else
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (re * 0.5) * ((im * im) + 2.0);
double tmp;
if (re <= 6.2e+41) {
tmp = t_0;
} else if (re <= 1.2e+154) {
tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
} else if (re <= 6.5e+296) {
tmp = t_0;
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): t_0 = (re * 0.5) * ((im * im) + 2.0) tmp = 0 if re <= 6.2e+41: tmp = t_0 elif re <= 1.2e+154: tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re)))) elif re <= 6.5e+296: tmp = t_0 else: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) return tmp
function code(re, im) t_0 = Float64(Float64(re * 0.5) * Float64(Float64(im * im) + 2.0)) tmp = 0.0 if (re <= 6.2e+41) tmp = t_0; elseif (re <= 1.2e+154) tmp = Float64(re * Float64(Float64(im * im) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); elseif (re <= 6.5e+296) tmp = t_0; else tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) t_0 = (re * 0.5) * ((im * im) + 2.0); tmp = 0.0; if (re <= 6.2e+41) tmp = t_0; elseif (re <= 1.2e+154) tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re)))); elseif (re <= 6.5e+296) tmp = t_0; else tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(re * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 6.2e+41], t$95$0, If[LessEqual[re, 1.2e+154], N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], t$95$0, N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
\mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 6.2e41 or 1.20000000000000007e154 < re < 6.5e296Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6476.9%
Simplified76.9%
Taylor expanded in re around 0
Simplified50.3%
if 6.2e41 < re < 1.20000000000000007e154Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6462.0%
Simplified62.0%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6426.2%
Simplified26.2%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.1%
Simplified27.1%
if 6.5e296 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.9%
Simplified66.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.9%
Simplified66.9%
Final simplification48.7%
(FPCore (re im) :precision binary64 (if (<= im 1.8e+81) (* re (+ 1.0 (* -0.16666666666666666 (* re re)))) (* (* re 0.5) (+ (* im im) 2.0))))
double code(double re, double im) {
double tmp;
if (im <= 1.8e+81) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = (re * 0.5) * ((im * im) + 2.0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.8d+81) then
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
else
tmp = (re * 0.5d0) * ((im * im) + 2.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.8e+81) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = (re * 0.5) * ((im * im) + 2.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.8e+81: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) else: tmp = (re * 0.5) * ((im * im) + 2.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.8e+81) tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); else tmp = Float64(Float64(re * 0.5) * Float64(Float64(im * im) + 2.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.8e+81) tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); else tmp = (re * 0.5) * ((im * im) + 2.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.8e+81], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.8 \cdot 10^{+81}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
\end{array}
\end{array}
if im < 1.80000000000000003e81Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified84.5%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6446.9%
Simplified46.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.1%
Simplified34.1%
if 1.80000000000000003e81 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6464.9%
Simplified64.9%
Taylor expanded in re around 0
Simplified57.2%
Final simplification38.3%
(FPCore (re im) :precision binary64 (if (<= re 39000000000000.0) re (* re (* re (* re -0.16666666666666666)))))
double code(double re, double im) {
double tmp;
if (re <= 39000000000000.0) {
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 <= 39000000000000.0d0) 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 <= 39000000000000.0) {
tmp = re;
} else {
tmp = re * (re * (re * -0.16666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 39000000000000.0: tmp = re else: tmp = re * (re * (re * -0.16666666666666666)) return tmp
function code(re, im) tmp = 0.0 if (re <= 39000000000000.0) tmp = re; else tmp = Float64(re * Float64(re * Float64(re * -0.16666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 39000000000000.0) tmp = re; else tmp = re * (re * (re * -0.16666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 39000000000000.0], re, N[(re * N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 39000000000000:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if re < 3.9e13Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6448.9%
Simplified48.9%
Taylor expanded in re around 0
Simplified30.9%
if 3.9e13 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified91.3%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6414.2%
Simplified14.2%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f649.1%
Simplified9.1%
Taylor expanded in re around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f649.1%
Simplified9.1%
(FPCore (re im) :precision binary64 (* re (+ 1.0 (* -0.16666666666666666 (* re re)))))
double code(double re, double im) {
return re * (1.0 + (-0.16666666666666666 * (re * re)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end function
public static double code(double re, double im) {
return re * (1.0 + (-0.16666666666666666 * (re * re)));
}
def code(re, im): return re * (1.0 + (-0.16666666666666666 * (re * re)))
function code(re, im) return Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))) end
function tmp = code(re, im) tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end
code[re_, im_] := N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-outN/A
Simplified87.3%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6453.0%
Simplified53.0%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/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.f6452.3%
Simplified52.3%
Taylor expanded in re around 0
Simplified25.0%
herbie shell --seed 2024159
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))