
(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 (* (cosh im) (sin re)))
double code(double re, double im) {
return cosh(im) * sin(re);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = cosh(im) * sin(re)
end function
public static double code(double re, double im) {
return Math.cosh(im) * Math.sin(re);
}
def code(re, im): return math.cosh(im) * math.sin(re)
function code(re, im) return Float64(cosh(im) * sin(re)) end
function tmp = code(re, im) tmp = cosh(im) * sin(re); end
code[re_, im_] := N[(N[Cosh[im], $MachinePrecision] * N[Sin[re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh im \cdot \sin re
\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%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(if (<= im 9.5e-13)
(sin re)
(if (<= im 1.8e+51)
(* (cosh im) re)
(*
(* (sin re) 0.5)
(+
2.0
(*
im
(*
im
(+
1.0
(*
im
(*
im
(+
0.08333333333333333
(* (* im im) 0.002777777777777778))))))))))))
double code(double re, double im) {
double tmp;
if (im <= 9.5e-13) {
tmp = sin(re);
} else if (im <= 1.8e+51) {
tmp = cosh(im) * re;
} else {
tmp = (sin(re) * 0.5) * (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 <= 9.5d-13) then
tmp = sin(re)
else if (im <= 1.8d+51) then
tmp = cosh(im) * re
else
tmp = (sin(re) * 0.5d0) * (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 <= 9.5e-13) {
tmp = Math.sin(re);
} else if (im <= 1.8e+51) {
tmp = Math.cosh(im) * re;
} else {
tmp = (Math.sin(re) * 0.5) * (2.0 + (im * (im * (1.0 + (im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 9.5e-13: tmp = math.sin(re) elif im <= 1.8e+51: tmp = math.cosh(im) * re else: tmp = (math.sin(re) * 0.5) * (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 <= 9.5e-13) tmp = sin(re); elseif (im <= 1.8e+51) tmp = Float64(cosh(im) * re); else tmp = Float64(Float64(sin(re) * 0.5) * Float64(2.0 + Float64(im * Float64(im * Float64(1.0 + Float64(im * Float64(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 <= 9.5e-13) tmp = sin(re); elseif (im <= 1.8e+51) tmp = cosh(im) * re; else tmp = (sin(re) * 0.5) * (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, 9.5e-13], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.8e+51], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(2.0 + N[(im * N[(im * N[(1.0 + N[(im * N[(im * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.8 \cdot 10^{+51}:\\
\;\;\;\;\cosh im \cdot re\\
\mathbf{else}:\\
\;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 9.49999999999999991e-13Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.7%
Simplified69.7%
if 9.49999999999999991e-13 < im < 1.80000000000000005e51Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified80.0%
*-lft-identityN/A
cosh-lowering-cosh.f6480.0%
Applied egg-rr80.0%
if 1.80000000000000005e51 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification75.4%
(FPCore (re im)
:precision binary64
(if (<= im 9.5e-13)
(sin re)
(if (<= im 2.6e+77)
(* (cosh im) re)
(*
(sin re)
(+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664)))))))))
double code(double re, double im) {
double tmp;
if (im <= 9.5e-13) {
tmp = sin(re);
} else if (im <= 2.6e+77) {
tmp = cosh(im) * re;
} 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 <= 9.5d-13) then
tmp = sin(re)
else if (im <= 2.6d+77) then
tmp = cosh(im) * re
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 <= 9.5e-13) {
tmp = Math.sin(re);
} else if (im <= 2.6e+77) {
tmp = Math.cosh(im) * re;
} 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 <= 9.5e-13: tmp = math.sin(re) elif im <= 2.6e+77: tmp = math.cosh(im) * re 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 <= 9.5e-13) tmp = sin(re); elseif (im <= 2.6e+77) tmp = Float64(cosh(im) * re); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 9.5e-13) tmp = sin(re); elseif (im <= 2.6e+77) tmp = cosh(im) * re; 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, 9.5e-13], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.6e+77], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;\cosh im \cdot re\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if im < 9.49999999999999991e-13Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.7%
Simplified69.7%
if 9.49999999999999991e-13 < 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%
Taylor expanded in re around 0
Simplified83.3%
*-lft-identityN/A
cosh-lowering-cosh.f6483.3%
Applied egg-rr83.3%
if 2.6000000000000002e77 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Final simplification75.4%
(FPCore (re im)
:precision binary64
(if (<= im 9.5e-13)
(sin re)
(if (<= im 2.1e+146)
(* (cosh im) re)
(* (* (sin re) 0.5) (+ 2.0 (* im im))))))
double code(double re, double im) {
double tmp;
if (im <= 9.5e-13) {
tmp = sin(re);
} else if (im <= 2.1e+146) {
tmp = cosh(im) * re;
} else {
tmp = (sin(re) * 0.5) * (2.0 + (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 9.5d-13) then
tmp = sin(re)
else if (im <= 2.1d+146) then
tmp = cosh(im) * re
else
tmp = (sin(re) * 0.5d0) * (2.0d0 + (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 9.5e-13) {
tmp = Math.sin(re);
} else if (im <= 2.1e+146) {
tmp = Math.cosh(im) * re;
} else {
tmp = (Math.sin(re) * 0.5) * (2.0 + (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 9.5e-13: tmp = math.sin(re) elif im <= 2.1e+146: tmp = math.cosh(im) * re else: tmp = (math.sin(re) * 0.5) * (2.0 + (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 9.5e-13) tmp = sin(re); elseif (im <= 2.1e+146) tmp = Float64(cosh(im) * re); else tmp = Float64(Float64(sin(re) * 0.5) * Float64(2.0 + Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 9.5e-13) tmp = sin(re); elseif (im <= 2.1e+146) tmp = cosh(im) * re; else tmp = (sin(re) * 0.5) * (2.0 + (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 9.5e-13], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.1e+146], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.1 \cdot 10^{+146}:\\
\;\;\;\;\cosh im \cdot re\\
\mathbf{else}:\\
\;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\end{array}
\end{array}
if im < 9.49999999999999991e-13Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.7%
Simplified69.7%
if 9.49999999999999991e-13 < im < 2.1000000000000001e146Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified85.7%
*-lft-identityN/A
cosh-lowering-cosh.f6485.7%
Applied egg-rr85.7%
if 2.1000000000000001e146 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6497.1%
Simplified97.1%
Final simplification74.6%
(FPCore (re im) :precision binary64 (if (<= im 9.5e-13) (sin re) (* (cosh im) re)))
double code(double re, double im) {
double tmp;
if (im <= 9.5e-13) {
tmp = sin(re);
} else {
tmp = cosh(im) * re;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 9.5d-13) then
tmp = sin(re)
else
tmp = cosh(im) * re
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 9.5e-13) {
tmp = Math.sin(re);
} else {
tmp = Math.cosh(im) * re;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 9.5e-13: tmp = math.sin(re) else: tmp = math.cosh(im) * re return tmp
function code(re, im) tmp = 0.0 if (im <= 9.5e-13) tmp = sin(re); else tmp = Float64(cosh(im) * re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 9.5e-13) tmp = sin(re); else tmp = cosh(im) * re; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 9.5e-13], N[Sin[re], $MachinePrecision], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;\cosh im \cdot re\\
\end{array}
\end{array}
if im < 9.49999999999999991e-13Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.7%
Simplified69.7%
if 9.49999999999999991e-13 < 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%
Taylor expanded in re around 0
Simplified74.1%
*-lft-identityN/A
cosh-lowering-cosh.f6474.1%
Applied egg-rr74.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* im (* im im))))
(t_1 (* im (+ 0.5 (* (* im im) -0.041666666666666664)))))
(if (<= im 9.5e-13)
(sin re)
(if (<= im 3.4e+38)
(*
(* re 0.5)
(/
(*
(- 64.0 (* (* im im) (* t_0 (* (* im im) t_0))))
(/ 1.0 (- 2.0 (* im im))))
(+ 16.0 (* t_0 (+ t_0 4.0)))))
(if (<= im 3e+99)
(*
re
(+
1.0
(/
(* im (* (* im (+ 0.5 (* im (* im 0.041666666666666664)))) t_1))
t_1)))
(* re (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664))))))))))
double code(double re, double im) {
double t_0 = im * (im * (im * im));
double t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
double tmp;
if (im <= 9.5e-13) {
tmp = sin(re);
} else if (im <= 3.4e+38) {
tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
} else if (im <= 3e+99) {
tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
} else {
tmp = re * (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = im * (im * (im * im))
t_1 = im * (0.5d0 + ((im * im) * (-0.041666666666666664d0)))
if (im <= 9.5d-13) then
tmp = sin(re)
else if (im <= 3.4d+38) then
tmp = (re * 0.5d0) * (((64.0d0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0d0 / (2.0d0 - (im * im)))) / (16.0d0 + (t_0 * (t_0 + 4.0d0))))
else if (im <= 3d+99) then
tmp = re * (1.0d0 + ((im * ((im * (0.5d0 + (im * (im * 0.041666666666666664d0)))) * t_1)) / t_1))
else
tmp = re * (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (im * (im * im));
double t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
double tmp;
if (im <= 9.5e-13) {
tmp = Math.sin(re);
} else if (im <= 3.4e+38) {
tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
} else if (im <= 3e+99) {
tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
} else {
tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
}
return tmp;
}
def code(re, im): t_0 = im * (im * (im * im)) t_1 = im * (0.5 + ((im * im) * -0.041666666666666664)) tmp = 0 if im <= 9.5e-13: tmp = math.sin(re) elif im <= 3.4e+38: tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0)))) elif im <= 3e+99: tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1)) else: tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))) return tmp
function code(re, im) t_0 = Float64(im * Float64(im * Float64(im * im))) t_1 = Float64(im * Float64(0.5 + Float64(Float64(im * im) * -0.041666666666666664))) tmp = 0.0 if (im <= 9.5e-13) tmp = sin(re); elseif (im <= 3.4e+38) tmp = Float64(Float64(re * 0.5) * Float64(Float64(Float64(64.0 - Float64(Float64(im * im) * Float64(t_0 * Float64(Float64(im * im) * t_0)))) * Float64(1.0 / Float64(2.0 - Float64(im * im)))) / Float64(16.0 + Float64(t_0 * Float64(t_0 + 4.0))))); elseif (im <= 3e+99) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * Float64(Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))) * t_1)) / t_1))); else tmp = Float64(re * Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (im * (im * im)); t_1 = im * (0.5 + ((im * im) * -0.041666666666666664)); tmp = 0.0; if (im <= 9.5e-13) tmp = sin(re); elseif (im <= 3.4e+38) tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0)))); elseif (im <= 3e+99) tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1)); else tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 9.5e-13], N[Sin[re], $MachinePrecision], If[LessEqual[im, 3.4e+38], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(N[(64.0 - N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(16.0 + N[(t$95$0 * N[(t$95$0 + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3e+99], N[(re * N[(1.0 + N[(N[(im * N[(N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\
t_1 := im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\\
\mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 3.4 \cdot 10^{+38}:\\
\;\;\;\;\left(re \cdot 0.5\right) \cdot \frac{\left(64 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(\left(im \cdot im\right) \cdot t\_0\right)\right)\right) \cdot \frac{1}{2 - im \cdot im}}{16 + t\_0 \cdot \left(t\_0 + 4\right)}\\
\mathbf{elif}\;im \leq 3 \cdot 10^{+99}:\\
\;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot t\_1\right)}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if im < 9.49999999999999991e-13Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.7%
Simplified69.7%
if 9.49999999999999991e-13 < im < 3.39999999999999996e38Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f642.8%
Simplified2.8%
Taylor expanded in re around 0
Simplified2.9%
flip-+N/A
div-invN/A
flip3--N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr31.3%
if 3.39999999999999996e38 < im < 3.00000000000000014e99Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified30.2%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
Simplified20.6%
*-commutativeN/A
distribute-rgt-inN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr81.8%
if 3.00000000000000014e99 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
Simplified70.3%
Taylor expanded in im around inf
distribute-rgt-inN/A
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
unpow2N/A
times-fracN/A
metadata-evalN/A
pow-plusN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
Simplified70.3%
Final simplification68.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* im (* im im))))
(t_1 (* im (+ 0.5 (* (* im im) -0.041666666666666664)))))
(if (<= im 3.4e+38)
(*
(* re 0.5)
(/
(*
(- 64.0 (* (* im im) (* t_0 (* (* im im) t_0))))
(/ 1.0 (- 2.0 (* im im))))
(+ 16.0 (* t_0 (+ t_0 4.0)))))
(if (<= im 3e+99)
(*
re
(+
1.0
(/
(* im (* (* im (+ 0.5 (* im (* im 0.041666666666666664)))) t_1))
t_1)))
(* re (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664)))))))))
double code(double re, double im) {
double t_0 = im * (im * (im * im));
double t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
double tmp;
if (im <= 3.4e+38) {
tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
} else if (im <= 3e+99) {
tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
} else {
tmp = re * (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = im * (im * (im * im))
t_1 = im * (0.5d0 + ((im * im) * (-0.041666666666666664d0)))
if (im <= 3.4d+38) then
tmp = (re * 0.5d0) * (((64.0d0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0d0 / (2.0d0 - (im * im)))) / (16.0d0 + (t_0 * (t_0 + 4.0d0))))
else if (im <= 3d+99) then
tmp = re * (1.0d0 + ((im * ((im * (0.5d0 + (im * (im * 0.041666666666666664d0)))) * t_1)) / t_1))
else
tmp = re * (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (im * (im * im));
double t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
double tmp;
if (im <= 3.4e+38) {
tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
} else if (im <= 3e+99) {
tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
} else {
tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
}
return tmp;
}
def code(re, im): t_0 = im * (im * (im * im)) t_1 = im * (0.5 + ((im * im) * -0.041666666666666664)) tmp = 0 if im <= 3.4e+38: tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0)))) elif im <= 3e+99: tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1)) else: tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))) return tmp
function code(re, im) t_0 = Float64(im * Float64(im * Float64(im * im))) t_1 = Float64(im * Float64(0.5 + Float64(Float64(im * im) * -0.041666666666666664))) tmp = 0.0 if (im <= 3.4e+38) tmp = Float64(Float64(re * 0.5) * Float64(Float64(Float64(64.0 - Float64(Float64(im * im) * Float64(t_0 * Float64(Float64(im * im) * t_0)))) * Float64(1.0 / Float64(2.0 - Float64(im * im)))) / Float64(16.0 + Float64(t_0 * Float64(t_0 + 4.0))))); elseif (im <= 3e+99) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * Float64(Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))) * t_1)) / t_1))); else tmp = Float64(re * Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (im * (im * im)); t_1 = im * (0.5 + ((im * im) * -0.041666666666666664)); tmp = 0.0; if (im <= 3.4e+38) tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0)))); elseif (im <= 3e+99) tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1)); else tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 3.4e+38], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(N[(64.0 - N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(16.0 + N[(t$95$0 * N[(t$95$0 + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3e+99], N[(re * N[(1.0 + N[(N[(im * N[(N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\
t_1 := im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\\
\mathbf{if}\;im \leq 3.4 \cdot 10^{+38}:\\
\;\;\;\;\left(re \cdot 0.5\right) \cdot \frac{\left(64 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(\left(im \cdot im\right) \cdot t\_0\right)\right)\right) \cdot \frac{1}{2 - im \cdot im}}{16 + t\_0 \cdot \left(t\_0 + 4\right)}\\
\mathbf{elif}\;im \leq 3 \cdot 10^{+99}:\\
\;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot t\_1\right)}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if im < 3.39999999999999996e38Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6481.3%
Simplified81.3%
Taylor expanded in re around 0
Simplified50.8%
flip-+N/A
div-invN/A
flip3--N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr39.3%
if 3.39999999999999996e38 < im < 3.00000000000000014e99Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified30.2%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
Simplified20.6%
*-commutativeN/A
distribute-rgt-inN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr81.8%
if 3.00000000000000014e99 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
Simplified70.3%
Taylor expanded in im around inf
distribute-rgt-inN/A
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
unpow2N/A
times-fracN/A
metadata-evalN/A
pow-plusN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
Simplified70.3%
Final simplification45.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (+ 0.5 (* (* im im) -0.041666666666666664)))))
(if (<= im 3e+99)
(*
re
(+
1.0
(/
(* im (* (* im (+ 0.5 (* im (* im 0.041666666666666664)))) t_0))
t_0)))
(* re (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664))))))))
double code(double re, double im) {
double t_0 = im * (0.5 + ((im * im) * -0.041666666666666664));
double tmp;
if (im <= 3e+99) {
tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_0)) / t_0));
} else {
tmp = re * (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) :: t_0
real(8) :: tmp
t_0 = im * (0.5d0 + ((im * im) * (-0.041666666666666664d0)))
if (im <= 3d+99) then
tmp = re * (1.0d0 + ((im * ((im * (0.5d0 + (im * (im * 0.041666666666666664d0)))) * t_0)) / t_0))
else
tmp = re * (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (0.5 + ((im * im) * -0.041666666666666664));
double tmp;
if (im <= 3e+99) {
tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_0)) / t_0));
} else {
tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
}
return tmp;
}
def code(re, im): t_0 = im * (0.5 + ((im * im) * -0.041666666666666664)) tmp = 0 if im <= 3e+99: tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_0)) / t_0)) else: tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))) return tmp
function code(re, im) t_0 = Float64(im * Float64(0.5 + Float64(Float64(im * im) * -0.041666666666666664))) tmp = 0.0 if (im <= 3e+99) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * Float64(Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))) * t_0)) / t_0))); else tmp = Float64(re * Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (0.5 + ((im * im) * -0.041666666666666664)); tmp = 0.0; if (im <= 3e+99) tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_0)) / t_0)); else tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 3e+99], N[(re * N[(1.0 + N[(N[(im * N[(N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\\
\mathbf{if}\;im \leq 3 \cdot 10^{+99}:\\
\;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot t\_0\right)}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if im < 3.00000000000000014e99Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified85.9%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
Simplified53.8%
*-commutativeN/A
distribute-rgt-inN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr42.1%
if 3.00000000000000014e99 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
Simplified70.3%
Taylor expanded in im around inf
distribute-rgt-inN/A
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
unpow2N/A
times-fracN/A
metadata-evalN/A
pow-plusN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
Simplified70.3%
Final simplification46.2%
(FPCore (re im)
:precision binary64
(if (<= re 5.6e+58)
(*
re
(+
1.0
(*
(* im im)
(+
0.5
(*
im
(* im (+ 0.041666666666666664 (* im (* im 0.001388888888888889)))))))))
(if (<= re 9.8e+216)
(* (+ 2.0 (* im im)) (* re (+ 0.5 (* -0.08333333333333333 (* re re)))))
(* (* im (+ 0.5 (* im (* im 0.041666666666666664)))) (* im re)))))
double code(double re, double im) {
double tmp;
if (re <= 5.6e+58) {
tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))));
} else if (re <= 9.8e+216) {
tmp = (2.0 + (im * im)) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = (im * (0.5 + (im * (im * 0.041666666666666664)))) * (im * re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 5.6d+58) then
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))))))))
else if (re <= 9.8d+216) then
tmp = (2.0d0 + (im * im)) * (re * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else
tmp = (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))) * (im * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 5.6e+58) {
tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))));
} else if (re <= 9.8e+216) {
tmp = (2.0 + (im * im)) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = (im * (0.5 + (im * (im * 0.041666666666666664)))) * (im * re);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 5.6e+58: tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))) elif re <= 9.8e+216: tmp = (2.0 + (im * im)) * (re * (0.5 + (-0.08333333333333333 * (re * re)))) else: tmp = (im * (0.5 + (im * (im * 0.041666666666666664)))) * (im * re) return tmp
function code(re, im) tmp = 0.0 if (re <= 5.6e+58) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889))))))))); elseif (re <= 9.8e+216) tmp = Float64(Float64(2.0 + Float64(im * im)) * Float64(re * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); else tmp = Float64(Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))) * Float64(im * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 5.6e+58) tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))); elseif (re <= 9.8e+216) tmp = (2.0 + (im * im)) * (re * (0.5 + (-0.08333333333333333 * (re * re)))); else tmp = (im * (0.5 + (im * (im * 0.041666666666666664)))) * (im * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 5.6e+58], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 9.8e+216], N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(re * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * re), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 5.6 \cdot 10^{+58}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 9.8 \cdot 10^{+216}:\\
\;\;\;\;\left(2 + im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(im \cdot re\right)\\
\end{array}
\end{array}
if re < 5.5999999999999996e58Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified75.9%
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
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.4%
Simplified66.4%
if 5.5999999999999996e58 < re < 9.80000000000000027e216Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6478.3%
Simplified78.3%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6439.5%
Simplified39.5%
if 9.80000000000000027e216 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified89.9%
Taylor expanded in re around 0
Simplified32.9%
Taylor expanded in im around inf
Simplified33.7%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6433.7%
Applied egg-rr33.7%
Final simplification61.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 0.5 (* im (* im 0.041666666666666664)))))
(if (<= re 5.6e+58)
(* re (+ 1.0 (* (* im im) t_0)))
(if (<= re 9.8e+216)
(* (+ 2.0 (* im im)) (* re (+ 0.5 (* -0.08333333333333333 (* re re)))))
(* (* im t_0) (* im re))))))
double code(double re, double im) {
double t_0 = 0.5 + (im * (im * 0.041666666666666664));
double tmp;
if (re <= 5.6e+58) {
tmp = re * (1.0 + ((im * im) * t_0));
} else if (re <= 9.8e+216) {
tmp = (2.0 + (im * im)) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = (im * t_0) * (im * 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 = 0.5d0 + (im * (im * 0.041666666666666664d0))
if (re <= 5.6d+58) then
tmp = re * (1.0d0 + ((im * im) * t_0))
else if (re <= 9.8d+216) then
tmp = (2.0d0 + (im * im)) * (re * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
else
tmp = (im * t_0) * (im * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 + (im * (im * 0.041666666666666664));
double tmp;
if (re <= 5.6e+58) {
tmp = re * (1.0 + ((im * im) * t_0));
} else if (re <= 9.8e+216) {
tmp = (2.0 + (im * im)) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
} else {
tmp = (im * t_0) * (im * re);
}
return tmp;
}
def code(re, im): t_0 = 0.5 + (im * (im * 0.041666666666666664)) tmp = 0 if re <= 5.6e+58: tmp = re * (1.0 + ((im * im) * t_0)) elif re <= 9.8e+216: tmp = (2.0 + (im * im)) * (re * (0.5 + (-0.08333333333333333 * (re * re)))) else: tmp = (im * t_0) * (im * re) return tmp
function code(re, im) t_0 = Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))) tmp = 0.0 if (re <= 5.6e+58) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * t_0))); elseif (re <= 9.8e+216) tmp = Float64(Float64(2.0 + Float64(im * im)) * Float64(re * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))); else tmp = Float64(Float64(im * t_0) * Float64(im * re)); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 + (im * (im * 0.041666666666666664)); tmp = 0.0; if (re <= 5.6e+58) tmp = re * (1.0 + ((im * im) * t_0)); elseif (re <= 9.8e+216) tmp = (2.0 + (im * im)) * (re * (0.5 + (-0.08333333333333333 * (re * re)))); else tmp = (im * t_0) * (im * re); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 5.6e+58], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 9.8e+216], N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(re * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * t$95$0), $MachinePrecision] * N[(im * re), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\\
\mathbf{if}\;re \leq 5.6 \cdot 10^{+58}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot t\_0\right)\\
\mathbf{elif}\;re \leq 9.8 \cdot 10^{+216}:\\
\;\;\;\;\left(2 + im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot t\_0\right) \cdot \left(im \cdot re\right)\\
\end{array}
\end{array}
if re < 5.5999999999999996e58Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified87.1%
Taylor expanded in re around 0
Simplified64.0%
if 5.5999999999999996e58 < re < 9.80000000000000027e216Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6478.3%
Simplified78.3%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6439.5%
Simplified39.5%
if 9.80000000000000027e216 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified89.9%
Taylor expanded in re around 0
Simplified32.9%
Taylor expanded in im around inf
Simplified33.7%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6433.7%
Applied egg-rr33.7%
Final simplification59.3%
(FPCore (re im) :precision binary64 (if (<= im 3.1e+78) (* re (+ 1.0 (* re (* re -0.16666666666666666)))) (* re (* im (* im (* (* im im) 0.041666666666666664))))))
double code(double re, double im) {
double tmp;
if (im <= 3.1e+78) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3.1d+78) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = re * (im * (im * ((im * im) * 0.041666666666666664d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3.1e+78) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.1e+78: tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = re * (im * (im * ((im * im) * 0.041666666666666664))) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.1e+78) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(re * Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.1e+78) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = re * (im * (im * ((im * im) * 0.041666666666666664))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.1e+78], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.1 \cdot 10^{+78}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if im < 3.1e78Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6464.1%
Simplified64.1%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6439.5%
Simplified39.5%
if 3.1e78 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
Simplified70.0%
Taylor expanded in im around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.0%
Simplified70.0%
Final simplification44.2%
(FPCore (re im) :precision binary64 (if (<= im 3.35e+78) (* re (+ 1.0 (* re (* re -0.16666666666666666)))) (* im (* (* im (* im 0.041666666666666664)) (* im re)))))
double code(double re, double im) {
double tmp;
if (im <= 3.35e+78) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = im * ((im * (im * 0.041666666666666664)) * (im * re));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3.35d+78) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = im * ((im * (im * 0.041666666666666664d0)) * (im * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3.35e+78) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = im * ((im * (im * 0.041666666666666664)) * (im * re));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.35e+78: tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = im * ((im * (im * 0.041666666666666664)) * (im * re)) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.35e+78) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(im * Float64(Float64(im * Float64(im * 0.041666666666666664)) * Float64(im * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.35e+78) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = im * ((im * (im * 0.041666666666666664)) * (im * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.35e+78], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] * N[(im * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.35 \cdot 10^{+78}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(\left(im \cdot \left(im \cdot 0.041666666666666664\right)\right) \cdot \left(im \cdot re\right)\right)\\
\end{array}
\end{array}
if im < 3.34999999999999983e78Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6464.1%
Simplified64.1%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6439.5%
Simplified39.5%
if 3.34999999999999983e78 < im Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified100.0%
Taylor expanded in re around 0
Simplified70.0%
Taylor expanded in im around inf
Simplified63.0%
Taylor expanded in im around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6463.0%
Simplified63.0%
(FPCore (re im) :precision binary64 (* re (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664)))))))
double code(double re, double im) {
return re * (1.0 + ((im * im) * (0.5 + (im * (im * 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 * 0.041666666666666664d0)))))
end function
public static double code(double re, double im) {
return re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
def code(re, im): return re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))))
function code(re, im) return Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))) end
function tmp = code(re, im) tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))); end
code[re_, im_] := 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]
\begin{array}{l}
\\
re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
Simplified87.9%
Taylor expanded in re around 0
Simplified56.1%
Final simplification56.1%
(FPCore (re im) :precision binary64 (if (<= im 9.6e+105) (* re (+ 1.0 (* re (* re -0.16666666666666666)))) (* (* im im) (* re 0.5))))
double code(double re, double im) {
double tmp;
if (im <= 9.6e+105) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = (im * im) * (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 <= 9.6d+105) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = (im * im) * (re * 0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 9.6e+105) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = (im * im) * (re * 0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 9.6e+105: tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = (im * im) * (re * 0.5) return tmp
function code(re, im) tmp = 0.0 if (im <= 9.6e+105) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(Float64(im * im) * Float64(re * 0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 9.6e+105) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = (im * im) * (re * 0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 9.6e+105], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9.6 \cdot 10^{+105}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\
\end{array}
\end{array}
if im < 9.599999999999999e105Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6463.0%
Simplified63.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-*.f6439.2%
Simplified39.2%
if 9.599999999999999e105 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6482.1%
Simplified82.1%
Taylor expanded in re around 0
Simplified66.8%
Taylor expanded in im around inf
unpow2N/A
*-lowering-*.f6466.8%
Simplified66.8%
Final simplification43.1%
(FPCore (re im) :precision binary64 (if (<= im 1.4) re (* re (* im (* im 0.5)))))
double code(double re, double im) {
double tmp;
if (im <= 1.4) {
tmp = re;
} else {
tmp = re * (im * (im * 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.4d0) then
tmp = re
else
tmp = re * (im * (im * 0.5d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.4) {
tmp = re;
} else {
tmp = re * (im * (im * 0.5));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.4: tmp = re else: tmp = re * (im * (im * 0.5)) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.4) tmp = re; else tmp = Float64(re * Float64(im * Float64(im * 0.5))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.4) tmp = re; else tmp = re * (im * (im * 0.5)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.4], re, N[(re * N[(im * N[(im * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.4:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if im < 1.3999999999999999Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.7%
Simplified69.7%
Taylor expanded in re around 0
Simplified38.3%
if 1.3999999999999999 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6452.1%
Simplified52.1%
Taylor expanded in re around 0
Simplified44.1%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6431.3%
Simplified31.3%
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6444.1%
Applied egg-rr44.1%
Final simplification39.6%
(FPCore (re im) :precision binary64 (if (<= im 1.4) re (* (* im im) (* re 0.5))))
double code(double re, double im) {
double tmp;
if (im <= 1.4) {
tmp = re;
} else {
tmp = (im * im) * (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.4d0) then
tmp = re
else
tmp = (im * im) * (re * 0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.4) {
tmp = re;
} else {
tmp = (im * im) * (re * 0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.4: tmp = re else: tmp = (im * im) * (re * 0.5) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.4) tmp = re; else tmp = Float64(Float64(im * im) * Float64(re * 0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.4) tmp = re; else tmp = (im * im) * (re * 0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.4], re, N[(N[(im * im), $MachinePrecision] * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.4:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\
\end{array}
\end{array}
if im < 1.3999999999999999Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.7%
Simplified69.7%
Taylor expanded in re around 0
Simplified38.3%
if 1.3999999999999999 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6452.1%
Simplified52.1%
Taylor expanded in re around 0
Simplified44.1%
Taylor expanded in im around inf
unpow2N/A
*-lowering-*.f6444.1%
Simplified44.1%
Final simplification39.6%
(FPCore (re im) :precision binary64 (if (<= im 1.4) re (* 0.5 (* im (* im re)))))
double code(double re, double im) {
double tmp;
if (im <= 1.4) {
tmp = re;
} else {
tmp = 0.5 * (im * (im * re));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.4d0) then
tmp = re
else
tmp = 0.5d0 * (im * (im * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.4) {
tmp = re;
} else {
tmp = 0.5 * (im * (im * re));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.4: tmp = re else: tmp = 0.5 * (im * (im * re)) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.4) tmp = re; else tmp = Float64(0.5 * Float64(im * Float64(im * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.4) tmp = re; else tmp = 0.5 * (im * (im * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.4], re, N[(0.5 * N[(im * N[(im * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.4:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(im \cdot re\right)\right)\\
\end{array}
\end{array}
if im < 1.3999999999999999Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6469.7%
Simplified69.7%
Taylor expanded in re around 0
Simplified38.3%
if 1.3999999999999999 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6452.1%
Simplified52.1%
Taylor expanded in re around 0
Simplified44.1%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6431.3%
Simplified31.3%
(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.f6454.5%
Simplified54.5%
Taylor expanded in re around 0
Simplified30.2%
herbie shell --seed 2024186
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))