
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (* 0.5 (* (sin re) (+ (exp (- im)) (exp im)))))
double code(double re, double im) {
return 0.5 * (sin(re) * (exp(-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(-im) + exp(im)))
end function
public static double code(double re, double im) {
return 0.5 * (Math.sin(re) * (Math.exp(-im) + Math.exp(im)));
}
def code(re, im): return 0.5 * (math.sin(re) * (math.exp(-im) + math.exp(im)))
function code(re, im) return Float64(0.5 * Float64(sin(re) * Float64(exp(Float64(-im)) + exp(im)))) end
function tmp = code(re, im) tmp = 0.5 * (sin(re) * (exp(-im) + exp(im))); end
code[re_, im_] := N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(\sin re \cdot \left(e^{-im} + e^{im}\right)\right)
\end{array}
Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
(FPCore (re im)
:precision binary64
(if (or (<= im 0.88) (not (<= im 6.5e+51)))
(*
0.5
(*
(sin re)
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* im (* im 0.002777777777777778)))))))))
(* 0.5 (* re (+ (exp (- im)) (exp im))))))
double code(double re, double im) {
double tmp;
if ((im <= 0.88) || !(im <= 6.5e+51)) {
tmp = 0.5 * (sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))));
} else {
tmp = 0.5 * (re * (exp(-im) + exp(im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= 0.88d0) .or. (.not. (im <= 6.5d+51))) then
tmp = 0.5d0 * (sin(re) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0))))))))
else
tmp = 0.5d0 * (re * (exp(-im) + exp(im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= 0.88) || !(im <= 6.5e+51)) {
tmp = 0.5 * (Math.sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))));
} else {
tmp = 0.5 * (re * (Math.exp(-im) + Math.exp(im)));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 0.88) or not (im <= 6.5e+51): tmp = 0.5 * (math.sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) else: tmp = 0.5 * (re * (math.exp(-im) + math.exp(im))) return tmp
function code(re, im) tmp = 0.0 if ((im <= 0.88) || !(im <= 6.5e+51)) tmp = Float64(0.5 * Float64(sin(re) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778))))))))); else tmp = Float64(0.5 * Float64(re * Float64(exp(Float64(-im)) + exp(im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 0.88) || ~((im <= 6.5e+51))) tmp = 0.5 * (sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))); else tmp = 0.5 * (re * (exp(-im) + exp(im))); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 0.88], N[Not[LessEqual[im, 6.5e+51]], $MachinePrecision]], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.88 \lor \neg \left(im \leq 6.5 \cdot 10^{+51}\right):\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(e^{-im} + e^{im}\right)\right)\\
\end{array}
\end{array}
if im < 0.880000000000000004 or 6.5e51 < im Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 96.3%
distribute-rgt-in96.3%
*-commutative96.3%
associate-+r+96.3%
distribute-rgt-out96.3%
*-commutative96.3%
associate-*l*96.7%
associate-*r*96.7%
distribute-rgt-out96.7%
+-commutative96.7%
Simplified98.3%
if 0.880000000000000004 < im < 6.5e51Initial program 99.9%
remove-double-neg99.9%
sin-neg99.9%
distribute-rgt-neg-in99.9%
/-rgt-identity99.9%
exp-099.9%
distribute-neg-frac299.9%
exp-099.9%
metadata-eval99.9%
associate-*l/99.9%
associate-*l*99.9%
associate-*r/99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in re around 0 67.1%
Final simplification96.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 1.0 (* re (* re -0.16666666666666666))))
(t_1 (+ 2.0 (* im im))))
(if (<= im 64000000.0)
(* 0.5 (* (sin re) t_1))
(if (<= im 1e+98)
(* 0.5 (* t_0 (* re (* 2.0 (cosh im)))))
(if (<= im 4e+113)
(* 0.5 (* 0.08333333333333333 (* re (* im (* im (* im im))))))
(if (<= im 3.7e+151)
(*
0.5
(*
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* im (* im 0.002777777777777778)))))))
(* re t_0)))
(+ -1.0 (+ 1.0 (* t_1 (* 0.5 (sin re)))))))))))
double code(double re, double im) {
double t_0 = 1.0 + (re * (re * -0.16666666666666666));
double t_1 = 2.0 + (im * im);
double tmp;
if (im <= 64000000.0) {
tmp = 0.5 * (sin(re) * t_1);
} else if (im <= 1e+98) {
tmp = 0.5 * (t_0 * (re * (2.0 * cosh(im))));
} else if (im <= 4e+113) {
tmp = 0.5 * (0.08333333333333333 * (re * (im * (im * (im * im)))));
} else if (im <= 3.7e+151) {
tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * t_0));
} else {
tmp = -1.0 + (1.0 + (t_1 * (0.5 * sin(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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + (re * (re * (-0.16666666666666666d0)))
t_1 = 2.0d0 + (im * im)
if (im <= 64000000.0d0) then
tmp = 0.5d0 * (sin(re) * t_1)
else if (im <= 1d+98) then
tmp = 0.5d0 * (t_0 * (re * (2.0d0 * cosh(im))))
else if (im <= 4d+113) then
tmp = 0.5d0 * (0.08333333333333333d0 * (re * (im * (im * (im * im)))))
else if (im <= 3.7d+151) then
tmp = 0.5d0 * ((2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0))))))) * (re * t_0))
else
tmp = (-1.0d0) + (1.0d0 + (t_1 * (0.5d0 * sin(re))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 1.0 + (re * (re * -0.16666666666666666));
double t_1 = 2.0 + (im * im);
double tmp;
if (im <= 64000000.0) {
tmp = 0.5 * (Math.sin(re) * t_1);
} else if (im <= 1e+98) {
tmp = 0.5 * (t_0 * (re * (2.0 * Math.cosh(im))));
} else if (im <= 4e+113) {
tmp = 0.5 * (0.08333333333333333 * (re * (im * (im * (im * im)))));
} else if (im <= 3.7e+151) {
tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * t_0));
} else {
tmp = -1.0 + (1.0 + (t_1 * (0.5 * Math.sin(re))));
}
return tmp;
}
def code(re, im): t_0 = 1.0 + (re * (re * -0.16666666666666666)) t_1 = 2.0 + (im * im) tmp = 0 if im <= 64000000.0: tmp = 0.5 * (math.sin(re) * t_1) elif im <= 1e+98: tmp = 0.5 * (t_0 * (re * (2.0 * math.cosh(im)))) elif im <= 4e+113: tmp = 0.5 * (0.08333333333333333 * (re * (im * (im * (im * im))))) elif im <= 3.7e+151: tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * t_0)) else: tmp = -1.0 + (1.0 + (t_1 * (0.5 * math.sin(re)))) return tmp
function code(re, im) t_0 = Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))) t_1 = Float64(2.0 + Float64(im * im)) tmp = 0.0 if (im <= 64000000.0) tmp = Float64(0.5 * Float64(sin(re) * t_1)); elseif (im <= 1e+98) tmp = Float64(0.5 * Float64(t_0 * Float64(re * Float64(2.0 * cosh(im))))); elseif (im <= 4e+113) tmp = Float64(0.5 * Float64(0.08333333333333333 * Float64(re * Float64(im * Float64(im * Float64(im * im)))))); elseif (im <= 3.7e+151) tmp = Float64(0.5 * Float64(Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778))))))) * Float64(re * t_0))); else tmp = Float64(-1.0 + Float64(1.0 + Float64(t_1 * Float64(0.5 * sin(re))))); end return tmp end
function tmp_2 = code(re, im) t_0 = 1.0 + (re * (re * -0.16666666666666666)); t_1 = 2.0 + (im * im); tmp = 0.0; if (im <= 64000000.0) tmp = 0.5 * (sin(re) * t_1); elseif (im <= 1e+98) tmp = 0.5 * (t_0 * (re * (2.0 * cosh(im)))); elseif (im <= 4e+113) tmp = 0.5 * (0.08333333333333333 * (re * (im * (im * (im * im))))); elseif (im <= 3.7e+151) tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * t_0)); else tmp = -1.0 + (1.0 + (t_1 * (0.5 * sin(re)))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 64000000.0], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+98], N[(0.5 * N[(t$95$0 * N[(re * N[(2.0 * N[Cosh[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4e+113], N[(0.5 * N[(0.08333333333333333 * N[(re * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.7e+151], N[(0.5 * N[(N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(1.0 + N[(t$95$1 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + re \cdot \left(re \cdot -0.16666666666666666\right)\\
t_1 := 2 + im \cdot im\\
\mathbf{if}\;im \leq 64000000:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot t\_1\right)\\
\mathbf{elif}\;im \leq 10^{+98}:\\
\;\;\;\;0.5 \cdot \left(t\_0 \cdot \left(re \cdot \left(2 \cdot \cosh im\right)\right)\right)\\
\mathbf{elif}\;im \leq 4 \cdot 10^{+113}:\\
\;\;\;\;0.5 \cdot \left(0.08333333333333333 \cdot \left(re \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\\
\mathbf{elif}\;im \leq 3.7 \cdot 10^{+151}:\\
\;\;\;\;0.5 \cdot \left(\left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right) \cdot \left(re \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(1 + t\_1 \cdot \left(0.5 \cdot \sin re\right)\right)\\
\end{array}
\end{array}
if im < 6.4e7Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 84.6%
distribute-rgt-out84.6%
unpow284.6%
Simplified84.6%
if 6.4e7 < im < 9.99999999999999998e97Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in re around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
associate-*l*100.0%
associate-*r*100.0%
+-commutative100.0%
cosh-undef100.0%
Applied egg-rr100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
if 9.99999999999999998e97 < im < 4e113Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 53.7%
associate-*r*53.7%
distribute-rgt1-in53.7%
+-commutative53.7%
associate-*r*100.0%
distribute-rgt-out100.0%
unpow2100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in re around 0 100.0%
unpow2100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
metadata-eval100.0%
pow-sqr100.0%
unpow2100.0%
unpow2100.0%
sub-neg100.0%
*-commutative100.0%
unpow2100.0%
metadata-eval100.0%
unpow2100.0%
+-commutative100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in re around 0 100.0%
*-commutative100.0%
metadata-eval100.0%
pow-plus100.0%
cube-unmult100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
Simplified100.0%
if 4e113 < im < 3.6999999999999997e151Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
distribute-rgt-in100.0%
*-commutative100.0%
associate-+r+100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in re around 0 83.3%
*-commutative83.3%
unpow283.3%
associate-*l*83.3%
Simplified83.3%
if 3.6999999999999997e151 < im Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 97.7%
distribute-rgt-out97.7%
unpow297.7%
Simplified97.7%
expm1-log1p-u60.8%
expm1-undefine60.8%
*-commutative60.8%
Applied egg-rr60.8%
sub-neg60.8%
metadata-eval60.8%
+-commutative60.8%
log1p-undefine60.8%
rem-exp-log97.7%
*-commutative97.7%
associate-*r*97.7%
*-commutative97.7%
*-commutative97.7%
Simplified97.7%
Final simplification87.6%
(FPCore (re im)
:precision binary64
(if (<= re 2e-5)
(*
0.5
(* (+ 1.0 (* re (* re -0.16666666666666666))) (* re (* 2.0 (cosh im)))))
(*
0.5
(*
(sin re)
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* im (* im 0.002777777777777778)))))))))))
double code(double re, double im) {
double tmp;
if (re <= 2e-5) {
tmp = 0.5 * ((1.0 + (re * (re * -0.16666666666666666))) * (re * (2.0 * cosh(im))));
} else {
tmp = 0.5 * (sin(re) * (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 (re <= 2d-5) then
tmp = 0.5d0 * ((1.0d0 + (re * (re * (-0.16666666666666666d0)))) * (re * (2.0d0 * cosh(im))))
else
tmp = 0.5d0 * (sin(re) * (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 (re <= 2e-5) {
tmp = 0.5 * ((1.0 + (re * (re * -0.16666666666666666))) * (re * (2.0 * Math.cosh(im))));
} else {
tmp = 0.5 * (Math.sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2e-5: tmp = 0.5 * ((1.0 + (re * (re * -0.16666666666666666))) * (re * (2.0 * math.cosh(im)))) else: tmp = 0.5 * (math.sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2e-5) tmp = Float64(0.5 * Float64(Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))) * Float64(re * Float64(2.0 * cosh(im))))); else tmp = Float64(0.5 * Float64(sin(re) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778))))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2e-5) tmp = 0.5 * ((1.0 + (re * (re * -0.16666666666666666))) * (re * (2.0 * cosh(im)))); else tmp = 0.5 * (sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2e-5], N[(0.5 * N[(N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(2.0 * N[Cosh[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2 \cdot 10^{-5}:\\
\;\;\;\;0.5 \cdot \left(\left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(2 \cdot \cosh im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if re < 2.00000000000000016e-5Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in re around 0 75.1%
*-commutative75.1%
unpow275.1%
associate-*l*75.1%
Simplified75.1%
associate-*l*75.1%
associate-*r*75.1%
+-commutative75.1%
cosh-undef75.1%
Applied egg-rr75.1%
associate-*r*75.1%
*-commutative75.1%
associate-*r*75.1%
*-commutative75.1%
associate-*r*75.1%
*-commutative75.1%
Simplified75.1%
if 2.00000000000000016e-5 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 95.8%
distribute-rgt-in95.8%
*-commutative95.8%
associate-+r+95.8%
distribute-rgt-out95.8%
*-commutative95.8%
associate-*l*95.8%
associate-*r*95.8%
distribute-rgt-out95.8%
+-commutative95.8%
Simplified95.8%
(FPCore (re im)
:precision binary64
(if (or (<= im 64000000.0) (not (<= im 2e+77)))
(*
0.5
(*
(sin re)
(+ 2.0 (* (* im im) (+ 1.0 (* (* im im) 0.08333333333333333))))))
(*
0.5
(* (+ 1.0 (* re (* re -0.16666666666666666))) (* re (* 2.0 (cosh im)))))))
double code(double re, double im) {
double tmp;
if ((im <= 64000000.0) || !(im <= 2e+77)) {
tmp = 0.5 * (sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * 0.08333333333333333)))));
} else {
tmp = 0.5 * ((1.0 + (re * (re * -0.16666666666666666))) * (re * (2.0 * 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 <= 64000000.0d0) .or. (.not. (im <= 2d+77))) then
tmp = 0.5d0 * (sin(re) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * 0.08333333333333333d0)))))
else
tmp = 0.5d0 * ((1.0d0 + (re * (re * (-0.16666666666666666d0)))) * (re * (2.0d0 * cosh(im))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= 64000000.0) || !(im <= 2e+77)) {
tmp = 0.5 * (Math.sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * 0.08333333333333333)))));
} else {
tmp = 0.5 * ((1.0 + (re * (re * -0.16666666666666666))) * (re * (2.0 * Math.cosh(im))));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 64000000.0) or not (im <= 2e+77): tmp = 0.5 * (math.sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * 0.08333333333333333))))) else: tmp = 0.5 * ((1.0 + (re * (re * -0.16666666666666666))) * (re * (2.0 * math.cosh(im)))) return tmp
function code(re, im) tmp = 0.0 if ((im <= 64000000.0) || !(im <= 2e+77)) tmp = Float64(0.5 * Float64(sin(re) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * 0.08333333333333333)))))); else tmp = Float64(0.5 * Float64(Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))) * Float64(re * Float64(2.0 * cosh(im))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 64000000.0) || ~((im <= 2e+77))) tmp = 0.5 * (sin(re) * (2.0 + ((im * im) * (1.0 + ((im * im) * 0.08333333333333333))))); else tmp = 0.5 * ((1.0 + (re * (re * -0.16666666666666666))) * (re * (2.0 * cosh(im)))); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 64000000.0], N[Not[LessEqual[im, 2e+77]], $MachinePrecision]], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(2.0 * N[Cosh[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 64000000 \lor \neg \left(im \leq 2 \cdot 10^{+77}\right):\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot 0.08333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(2 \cdot \cosh im\right)\right)\right)\\
\end{array}
\end{array}
if im < 6.4e7 or 1.99999999999999997e77 < im Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 92.7%
associate-*r*92.7%
distribute-rgt1-in92.7%
+-commutative92.7%
associate-*r*95.3%
distribute-rgt-out95.3%
unpow295.3%
*-commutative95.3%
unpow295.3%
Simplified95.3%
if 6.4e7 < im < 1.99999999999999997e77Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in re around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
associate-*l*100.0%
associate-*r*100.0%
+-commutative100.0%
cosh-undef100.0%
Applied egg-rr100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Final simplification95.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 2.0 (* im im))))
(if (<= im 1.5e+19)
(* 0.5 (* (sin re) t_0))
(if (<= im 3.7e+151)
(*
0.5
(*
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* im (* im 0.002777777777777778)))))))
(* re (+ 1.0 (* re (* re -0.16666666666666666))))))
(+ -1.0 (+ 1.0 (* t_0 (* 0.5 (sin re)))))))))
double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double tmp;
if (im <= 1.5e+19) {
tmp = 0.5 * (sin(re) * t_0);
} else if (im <= 3.7e+151) {
tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666)))));
} else {
tmp = -1.0 + (1.0 + (t_0 * (0.5 * sin(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 = 2.0d0 + (im * im)
if (im <= 1.5d+19) then
tmp = 0.5d0 * (sin(re) * t_0)
else if (im <= 3.7d+151) then
tmp = 0.5d0 * ((2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0))))))) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))))
else
tmp = (-1.0d0) + (1.0d0 + (t_0 * (0.5d0 * sin(re))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double tmp;
if (im <= 1.5e+19) {
tmp = 0.5 * (Math.sin(re) * t_0);
} else if (im <= 3.7e+151) {
tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666)))));
} else {
tmp = -1.0 + (1.0 + (t_0 * (0.5 * Math.sin(re))));
}
return tmp;
}
def code(re, im): t_0 = 2.0 + (im * im) tmp = 0 if im <= 1.5e+19: tmp = 0.5 * (math.sin(re) * t_0) elif im <= 3.7e+151: tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666))))) else: tmp = -1.0 + (1.0 + (t_0 * (0.5 * math.sin(re)))) return tmp
function code(re, im) t_0 = Float64(2.0 + Float64(im * im)) tmp = 0.0 if (im <= 1.5e+19) tmp = Float64(0.5 * Float64(sin(re) * t_0)); elseif (im <= 3.7e+151) tmp = Float64(0.5 * Float64(Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778))))))) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))))); else tmp = Float64(-1.0 + Float64(1.0 + Float64(t_0 * Float64(0.5 * sin(re))))); end return tmp end
function tmp_2 = code(re, im) t_0 = 2.0 + (im * im); tmp = 0.0; if (im <= 1.5e+19) tmp = 0.5 * (sin(re) * t_0); elseif (im <= 3.7e+151) tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666))))); else tmp = -1.0 + (1.0 + (t_0 * (0.5 * sin(re)))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 1.5e+19], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.7e+151], N[(0.5 * N[(N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(1.0 + N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + im \cdot im\\
\mathbf{if}\;im \leq 1.5 \cdot 10^{+19}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot t\_0\right)\\
\mathbf{elif}\;im \leq 3.7 \cdot 10^{+151}:\\
\;\;\;\;0.5 \cdot \left(\left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right) \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(1 + t\_0 \cdot \left(0.5 \cdot \sin re\right)\right)\\
\end{array}
\end{array}
if im < 1.5e19Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 83.8%
distribute-rgt-out83.8%
unpow283.8%
Simplified83.8%
if 1.5e19 < im < 3.6999999999999997e151Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 61.3%
distribute-rgt-in61.3%
*-commutative61.3%
associate-+r+61.3%
distribute-rgt-out61.3%
*-commutative61.3%
associate-*l*65.6%
associate-*r*65.6%
distribute-rgt-out65.6%
+-commutative65.6%
Simplified69.9%
Taylor expanded in re around 0 73.6%
*-commutative90.9%
unpow290.9%
associate-*l*90.9%
Simplified73.6%
if 3.6999999999999997e151 < im Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 97.7%
distribute-rgt-out97.7%
unpow297.7%
Simplified97.7%
expm1-log1p-u60.8%
expm1-undefine60.8%
*-commutative60.8%
Applied egg-rr60.8%
sub-neg60.8%
metadata-eval60.8%
+-commutative60.8%
log1p-undefine60.8%
rem-exp-log97.7%
*-commutative97.7%
associate-*r*97.7%
*-commutative97.7%
*-commutative97.7%
Simplified97.7%
Final simplification85.0%
(FPCore (re im)
:precision binary64
(if (or (<= im 1.36e+20) (not (<= im 3.7e+151)))
(* 0.5 (* (sin re) (+ 2.0 (* im im))))
(*
0.5
(*
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* im (* im 0.002777777777777778)))))))
(* re (+ 1.0 (* re (* re -0.16666666666666666))))))))
double code(double re, double im) {
double tmp;
if ((im <= 1.36e+20) || !(im <= 3.7e+151)) {
tmp = 0.5 * (sin(re) * (2.0 + (im * im)));
} else {
tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= 1.36d+20) .or. (.not. (im <= 3.7d+151))) then
tmp = 0.5d0 * (sin(re) * (2.0d0 + (im * im)))
else
tmp = 0.5d0 * ((2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0))))))) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= 1.36e+20) || !(im <= 3.7e+151)) {
tmp = 0.5 * (Math.sin(re) * (2.0 + (im * im)));
} else {
tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666)))));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 1.36e+20) or not (im <= 3.7e+151): tmp = 0.5 * (math.sin(re) * (2.0 + (im * im))) else: tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666))))) return tmp
function code(re, im) tmp = 0.0 if ((im <= 1.36e+20) || !(im <= 3.7e+151)) tmp = Float64(0.5 * Float64(sin(re) * Float64(2.0 + Float64(im * im)))); else tmp = Float64(0.5 * Float64(Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778))))))) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 1.36e+20) || ~((im <= 3.7e+151))) tmp = 0.5 * (sin(re) * (2.0 + (im * im))); else tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666))))); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 1.36e+20], N[Not[LessEqual[im, 3.7e+151]], $MachinePrecision]], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.36 \cdot 10^{+20} \lor \neg \left(im \leq 3.7 \cdot 10^{+151}\right):\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot \left(2 + im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right) \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 1.36e20 or 3.6999999999999997e151 < im Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 86.0%
distribute-rgt-out86.0%
unpow286.0%
Simplified86.0%
if 1.36e20 < im < 3.6999999999999997e151Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 61.3%
distribute-rgt-in61.3%
*-commutative61.3%
associate-+r+61.3%
distribute-rgt-out61.3%
*-commutative61.3%
associate-*l*65.6%
associate-*r*65.6%
distribute-rgt-out65.6%
+-commutative65.6%
Simplified69.9%
Taylor expanded in re around 0 73.6%
*-commutative90.9%
unpow290.9%
associate-*l*90.9%
Simplified73.6%
Final simplification85.0%
(FPCore (re im)
:precision binary64
(if (<= im 1.5e+19)
(sin re)
(*
0.5
(*
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* im (* im 0.002777777777777778)))))))
(* re (+ 1.0 (* re (* re -0.16666666666666666))))))))
double code(double re, double im) {
double tmp;
if (im <= 1.5e+19) {
tmp = sin(re);
} else {
tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.5d+19) then
tmp = sin(re)
else
tmp = 0.5d0 * ((2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0))))))) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.5e+19) {
tmp = Math.sin(re);
} else {
tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666)))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.5e+19: tmp = math.sin(re) else: tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.5e+19) tmp = sin(re); else tmp = Float64(0.5 * Float64(Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778))))))) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.5e+19) tmp = sin(re); else tmp = 0.5 * ((2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))) * (re * (1.0 + (re * (re * -0.16666666666666666))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.5e+19], N[Sin[re], $MachinePrecision], N[(0.5 * N[(N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.5 \cdot 10^{+19}:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right) \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 1.5e19Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 83.8%
distribute-rgt-out83.8%
unpow283.8%
Simplified83.8%
Taylor expanded in im around 0 59.3%
if 1.5e19 < im Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 85.8%
distribute-rgt-in85.8%
*-commutative85.8%
associate-+r+85.8%
distribute-rgt-out85.8%
*-commutative85.8%
associate-*l*87.4%
associate-*r*87.4%
distribute-rgt-out87.4%
+-commutative87.4%
Simplified89.0%
Taylor expanded in re around 0 80.3%
*-commutative86.7%
unpow286.7%
associate-*l*86.7%
Simplified80.3%
Final simplification64.2%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+69)
(*
0.5
(*
re
(+
2.0
(*
(* im im)
(+
1.0
(*
im
(*
im
(+ 0.08333333333333333 (* im (* im 0.002777777777777778))))))))))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (* (+ 2.0 (* im im)) (+ 0.5 (* (* re re) -0.08333333333333333))))
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333))))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+69) then
tmp = 0.5d0 * (re * (2.0d0 + ((im * im) * (1.0d0 + (im * (im * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0)))))))))
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * ((2.0d0 + (im * im)) * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
else
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+69: tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))))) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))) else: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+69) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(im * Float64(im * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778)))))))))); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333)))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+69) tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * (0.08333333333333333 + (im * (im * 0.002777777777777778))))))))); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))); else tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+69], N[(0.5 * N[(re * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + im \cdot \left(im \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
\end{array}
\end{array}
if re < 2.50000000000000018e69Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 90.5%
distribute-rgt-in90.5%
*-commutative90.5%
associate-+r+90.5%
distribute-rgt-out90.5%
*-commutative90.5%
associate-*l*91.0%
associate-*r*91.0%
distribute-rgt-out91.0%
+-commutative91.0%
Simplified92.8%
Taylor expanded in re around 0 64.9%
unpow264.9%
+-commutative64.9%
*-commutative64.9%
unpow264.9%
associate-*r*64.9%
unpow264.9%
+-commutative64.9%
associate-*r*64.9%
Simplified64.9%
if 2.50000000000000018e69 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 83.1%
distribute-rgt-out83.1%
unpow283.1%
Simplified83.1%
Taylor expanded in re around 0 11.8%
associate-*r*11.8%
distribute-rgt-out45.8%
unpow245.8%
*-commutative45.8%
unpow245.8%
Simplified45.8%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 76.3%
distribute-rgt-out76.3%
unpow276.3%
Simplified76.3%
Taylor expanded in im around 0 51.6%
Taylor expanded in re around 0 50.9%
unpow250.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
*-commutative50.9%
unpow250.9%
Simplified50.9%
Final simplification61.1%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+69)
(*
0.5
(*
re
(+
2.0
(* (* im im) (+ 1.0 (* im (* im (* (* im im) 0.002777777777777778))))))))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (* (+ 2.0 (* im im)) (+ 0.5 (* (* re re) -0.08333333333333333))))
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333))))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * ((im * im) * 0.002777777777777778)))))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+69) then
tmp = 0.5d0 * (re * (2.0d0 + ((im * im) * (1.0d0 + (im * (im * ((im * im) * 0.002777777777777778d0)))))))
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * ((2.0d0 + (im * im)) * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
else
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * ((im * im) * 0.002777777777777778)))))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+69: tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * ((im * im) * 0.002777777777777778))))))) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))) else: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+69) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(im * Float64(im * Float64(Float64(im * im) * 0.002777777777777778)))))))); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333)))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+69) tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * ((im * im) * 0.002777777777777778))))))); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))); else tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+69], N[(0.5 * N[(re * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
\end{array}
\end{array}
if re < 2.50000000000000018e69Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 90.5%
distribute-rgt-in90.5%
*-commutative90.5%
associate-+r+90.5%
distribute-rgt-out90.5%
*-commutative90.5%
associate-*l*91.0%
associate-*r*91.0%
distribute-rgt-out91.0%
+-commutative91.0%
Simplified92.8%
Taylor expanded in re around 0 64.9%
unpow264.9%
+-commutative64.9%
*-commutative64.9%
unpow264.9%
associate-*r*64.9%
unpow264.9%
+-commutative64.9%
associate-*r*64.9%
Simplified64.9%
Taylor expanded in im around inf 64.8%
*-commutative64.8%
cube-mult64.8%
unpow264.8%
associate-*r*64.8%
unpow264.8%
Simplified64.8%
if 2.50000000000000018e69 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 83.1%
distribute-rgt-out83.1%
unpow283.1%
Simplified83.1%
Taylor expanded in re around 0 11.8%
associate-*r*11.8%
distribute-rgt-out45.8%
unpow245.8%
*-commutative45.8%
unpow245.8%
Simplified45.8%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 76.3%
distribute-rgt-out76.3%
unpow276.3%
Simplified76.3%
Taylor expanded in im around 0 51.6%
Taylor expanded in re around 0 50.9%
unpow250.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
*-commutative50.9%
unpow250.9%
Simplified50.9%
Final simplification61.1%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+69)
(*
0.5
(* re (+ 2.0 (* (* im im) (+ 1.0 (* im (* im 0.08333333333333333)))))))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (* (+ 2.0 (* im im)) (+ 0.5 (* (* re re) -0.08333333333333333))))
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333))))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * 0.08333333333333333))))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+69) then
tmp = 0.5d0 * (re * (2.0d0 + ((im * im) * (1.0d0 + (im * (im * 0.08333333333333333d0))))))
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * ((2.0d0 + (im * im)) * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
else
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * 0.08333333333333333))))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+69: tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * 0.08333333333333333)))))) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))) else: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+69) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(im * Float64(im * 0.08333333333333333))))))); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333)))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+69) tmp = 0.5 * (re * (2.0 + ((im * im) * (1.0 + (im * (im * 0.08333333333333333)))))); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))); else tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+69], N[(0.5 * N[(re * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(im * N[(im * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + im \cdot \left(im \cdot 0.08333333333333333\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
\end{array}
\end{array}
if re < 2.50000000000000018e69Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 85.9%
associate-*r*85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
associate-*r*89.0%
distribute-rgt-out89.0%
unpow289.0%
*-commutative89.0%
unpow289.0%
Simplified89.0%
Taylor expanded in re around 0 62.0%
+-commutative62.0%
*-commutative62.0%
unpow262.0%
associate-*r*62.0%
unpow262.0%
+-commutative62.0%
Simplified62.0%
if 2.50000000000000018e69 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 83.1%
distribute-rgt-out83.1%
unpow283.1%
Simplified83.1%
Taylor expanded in re around 0 11.8%
associate-*r*11.8%
distribute-rgt-out45.8%
unpow245.8%
*-commutative45.8%
unpow245.8%
Simplified45.8%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 76.3%
distribute-rgt-out76.3%
unpow276.3%
Simplified76.3%
Taylor expanded in im around 0 51.6%
Taylor expanded in re around 0 50.9%
unpow250.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
*-commutative50.9%
unpow250.9%
Simplified50.9%
Final simplification58.9%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+69)
(* 0.5 (* re (+ 2.0 (* 0.08333333333333333 (* (* im im) (* im im))))))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (* (+ 2.0 (* im im)) (+ 0.5 (* (* re re) -0.08333333333333333))))
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333))))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im)))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+69) then
tmp = 0.5d0 * (re * (2.0d0 + (0.08333333333333333d0 * ((im * im) * (im * im)))))
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * ((2.0d0 + (im * im)) * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
else
tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im)))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+69: tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im))))) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))) else: tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+69) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(0.08333333333333333 * Float64(Float64(im * im) * Float64(im * im)))))); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333)))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+69) tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im))))); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))); else tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+69], N[(0.5 * N[(re * N[(2.0 + N[(0.08333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + 0.08333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
\end{array}
\end{array}
if re < 2.50000000000000018e69Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 85.9%
associate-*r*85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
associate-*r*89.0%
distribute-rgt-out89.0%
unpow289.0%
*-commutative89.0%
unpow289.0%
Simplified89.0%
Taylor expanded in re around 0 62.0%
Taylor expanded in im around inf 61.8%
metadata-eval61.8%
pow-sqr61.8%
unpow261.8%
unpow261.8%
Simplified61.8%
if 2.50000000000000018e69 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 83.1%
distribute-rgt-out83.1%
unpow283.1%
Simplified83.1%
Taylor expanded in re around 0 11.8%
associate-*r*11.8%
distribute-rgt-out45.8%
unpow245.8%
*-commutative45.8%
unpow245.8%
Simplified45.8%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 76.3%
distribute-rgt-out76.3%
unpow276.3%
Simplified76.3%
Taylor expanded in im around 0 51.6%
Taylor expanded in re around 0 50.9%
unpow250.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
*-commutative50.9%
unpow250.9%
Simplified50.9%
Final simplification58.7%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+69)
(* 0.5 (* re (+ 2.0 (* 0.08333333333333333 (* (* im im) (* im im))))))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (* (+ 2.0 (* im im)) (+ 0.5 (* (* re re) -0.08333333333333333))))
(* 0.5 (* (* im im) (* re (+ 1.0 (* (* im im) 0.08333333333333333))))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im)))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = 0.5 * ((im * im) * (re * (1.0 + ((im * im) * 0.08333333333333333))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+69) then
tmp = 0.5d0 * (re * (2.0d0 + (0.08333333333333333d0 * ((im * im) * (im * im)))))
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * ((2.0d0 + (im * im)) * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
else
tmp = 0.5d0 * ((im * im) * (re * (1.0d0 + ((im * im) * 0.08333333333333333d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+69) {
tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im)))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = 0.5 * ((im * im) * (re * (1.0 + ((im * im) * 0.08333333333333333))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+69: tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im))))) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))) else: tmp = 0.5 * ((im * im) * (re * (1.0 + ((im * im) * 0.08333333333333333)))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+69) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(0.08333333333333333 * Float64(Float64(im * im) * Float64(im * im)))))); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333)))); else tmp = Float64(0.5 * Float64(Float64(im * im) * Float64(re * Float64(1.0 + Float64(Float64(im * im) * 0.08333333333333333))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+69) tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im))))); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * ((2.0 + (im * im)) * (0.5 + ((re * re) * -0.08333333333333333))); else tmp = 0.5 * ((im * im) * (re * (1.0 + ((im * im) * 0.08333333333333333)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+69], N[(0.5 * N[(re * N[(2.0 + N[(0.08333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(im * im), $MachinePrecision] * N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + 0.08333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(im \cdot im\right) \cdot \left(re \cdot \left(1 + \left(im \cdot im\right) \cdot 0.08333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if re < 2.50000000000000018e69Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 85.9%
associate-*r*85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
associate-*r*89.0%
distribute-rgt-out89.0%
unpow289.0%
*-commutative89.0%
unpow289.0%
Simplified89.0%
Taylor expanded in re around 0 62.0%
Taylor expanded in im around inf 61.8%
metadata-eval61.8%
pow-sqr61.8%
unpow261.8%
unpow261.8%
Simplified61.8%
if 2.50000000000000018e69 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 83.1%
distribute-rgt-out83.1%
unpow283.1%
Simplified83.1%
Taylor expanded in re around 0 11.8%
associate-*r*11.8%
distribute-rgt-out45.8%
unpow245.8%
*-commutative45.8%
unpow245.8%
Simplified45.8%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
associate-*r*100.0%
distribute-rgt1-in100.0%
+-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
unpow2100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in re around 0 51.0%
Taylor expanded in im around inf 50.0%
metadata-eval50.0%
pow-sqr50.0%
unpow250.0%
unpow250.0%
*-commutative50.0%
unpow250.0%
Simplified50.0%
Taylor expanded in im around 0 52.0%
unpow252.0%
*-commutative52.0%
*-lft-identity52.0%
unpow252.0%
associate-*r*52.0%
distribute-rgt-out52.0%
Simplified52.0%
Final simplification58.7%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+93)
(* 0.5 (* re (+ 2.0 (* 0.08333333333333333 (* (* im im) (* im im))))))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (+ 1.0 (* re (* re -0.16666666666666666))))
(* 0.5 (* (* im im) (* re (+ 1.0 (* (* im im) 0.08333333333333333))))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+93) {
tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im)))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * ((im * im) * (re * (1.0 + ((im * im) * 0.08333333333333333))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+93) then
tmp = 0.5d0 * (re * (2.0d0 + (0.08333333333333333d0 * ((im * im) * (im * im)))))
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = 0.5d0 * ((im * im) * (re * (1.0d0 + ((im * im) * 0.08333333333333333d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+93) {
tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im)))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * ((im * im) * (re * (1.0 + ((im * im) * 0.08333333333333333))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+93: tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im))))) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = 0.5 * ((im * im) * (re * (1.0 + ((im * im) * 0.08333333333333333)))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+93) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(0.08333333333333333 * Float64(Float64(im * im) * Float64(im * im)))))); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(0.5 * Float64(Float64(im * im) * Float64(re * Float64(1.0 + Float64(Float64(im * im) * 0.08333333333333333))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+93) tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im))))); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = 0.5 * ((im * im) * (re * (1.0 + ((im * im) * 0.08333333333333333)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+93], N[(0.5 * N[(re * N[(2.0 + N[(0.08333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(im * im), $MachinePrecision] * N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+93}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + 0.08333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(im \cdot im\right) \cdot \left(re \cdot \left(1 + \left(im \cdot im\right) \cdot 0.08333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if re < 2.5000000000000001e93Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 86.2%
associate-*r*86.2%
distribute-rgt1-in86.2%
+-commutative86.2%
associate-*r*89.2%
distribute-rgt-out89.2%
unpow289.2%
*-commutative89.2%
unpow289.2%
Simplified89.2%
Taylor expanded in re around 0 60.0%
Taylor expanded in im around inf 59.8%
metadata-eval59.8%
pow-sqr59.8%
unpow259.8%
unpow259.8%
Simplified59.8%
if 2.5000000000000001e93 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 81.4%
distribute-rgt-out81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in im around 0 44.3%
Taylor expanded in re around 0 48.5%
*-commutative48.5%
unpow248.5%
associate-*l*48.5%
Simplified48.5%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
associate-*r*100.0%
distribute-rgt1-in100.0%
+-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
unpow2100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in re around 0 51.0%
Taylor expanded in im around inf 50.0%
metadata-eval50.0%
pow-sqr50.0%
unpow250.0%
unpow250.0%
*-commutative50.0%
unpow250.0%
Simplified50.0%
Taylor expanded in im around 0 52.0%
unpow252.0%
*-commutative52.0%
*-lft-identity52.0%
unpow252.0%
associate-*r*52.0%
distribute-rgt-out52.0%
Simplified52.0%
Final simplification57.9%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+93)
(* 0.5 (* re (+ 2.0 (* 0.08333333333333333 (* (* im im) (* im im))))))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (+ 1.0 (* re (* re -0.16666666666666666))))
(* 0.5 (* re (* im im))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+93) {
tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im)))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+93) then
tmp = 0.5d0 * (re * (2.0d0 + (0.08333333333333333d0 * ((im * im) * (im * im)))))
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = 0.5d0 * (re * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+93) {
tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im)))));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+93: tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im))))) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = 0.5 * (re * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+93) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(0.08333333333333333 * Float64(Float64(im * im) * Float64(im * im)))))); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(0.5 * Float64(re * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+93) tmp = 0.5 * (re * (2.0 + (0.08333333333333333 * ((im * im) * (im * im))))); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = 0.5 * (re * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+93], N[(0.5 * N[(re * N[(2.0 + N[(0.08333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+93}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + 0.08333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if re < 2.5000000000000001e93Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 86.2%
associate-*r*86.2%
distribute-rgt1-in86.2%
+-commutative86.2%
associate-*r*89.2%
distribute-rgt-out89.2%
unpow289.2%
*-commutative89.2%
unpow289.2%
Simplified89.2%
Taylor expanded in re around 0 60.0%
Taylor expanded in im around inf 59.8%
metadata-eval59.8%
pow-sqr59.8%
unpow259.8%
unpow259.8%
Simplified59.8%
if 2.5000000000000001e93 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 81.4%
distribute-rgt-out81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in im around 0 44.3%
Taylor expanded in re around 0 48.5%
*-commutative48.5%
unpow248.5%
associate-*l*48.5%
Simplified48.5%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 76.3%
distribute-rgt-out76.3%
unpow276.3%
Simplified76.3%
Taylor expanded in re around 0 51.0%
associate-*r*51.0%
*-commutative51.0%
unpow251.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in im around inf 52.0%
unpow252.0%
*-commutative52.0%
Simplified52.0%
Final simplification57.9%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+93)
(+ (* (* im im) (* 0.5 re)) (* 2.0 (* 0.5 re)))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (+ 1.0 (* re (* re -0.16666666666666666))))
(* 0.5 (* re (* im im))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+93) {
tmp = ((im * im) * (0.5 * re)) + (2.0 * (0.5 * re));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+93) then
tmp = ((im * im) * (0.5d0 * re)) + (2.0d0 * (0.5d0 * re))
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = 0.5d0 * (re * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+93) {
tmp = ((im * im) * (0.5 * re)) + (2.0 * (0.5 * re));
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+93: tmp = ((im * im) * (0.5 * re)) + (2.0 * (0.5 * re)) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = 0.5 * (re * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+93) tmp = Float64(Float64(Float64(im * im) * Float64(0.5 * re)) + Float64(2.0 * Float64(0.5 * re))); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(0.5 * Float64(re * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+93) tmp = ((im * im) * (0.5 * re)) + (2.0 * (0.5 * re)); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = 0.5 * (re * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+93], N[(N[(N[(im * im), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+93}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 \cdot re\right) + 2 \cdot \left(0.5 \cdot re\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if re < 2.5000000000000001e93Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 78.6%
distribute-rgt-out78.6%
unpow278.6%
Simplified78.6%
Taylor expanded in re around 0 53.1%
associate-*r*53.1%
*-commutative53.1%
unpow253.1%
*-commutative53.1%
Simplified53.1%
*-commutative53.1%
+-commutative53.1%
distribute-lft-in53.1%
Applied egg-rr53.1%
if 2.5000000000000001e93 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 81.4%
distribute-rgt-out81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in im around 0 44.3%
Taylor expanded in re around 0 48.5%
*-commutative48.5%
unpow248.5%
associate-*l*48.5%
Simplified48.5%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 76.3%
distribute-rgt-out76.3%
unpow276.3%
Simplified76.3%
Taylor expanded in re around 0 51.0%
associate-*r*51.0%
*-commutative51.0%
unpow251.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in im around inf 52.0%
unpow252.0%
*-commutative52.0%
Simplified52.0%
Final simplification52.4%
(FPCore (re im)
:precision binary64
(if (<= re 2.5e+93)
(* (+ 2.0 (* im im)) (* 0.5 re))
(if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
(* re (+ 1.0 (* re (* re -0.16666666666666666))))
(* 0.5 (* re (* im im))))))
double code(double re, double im) {
double tmp;
if (re <= 2.5e+93) {
tmp = (2.0 + (im * im)) * (0.5 * re);
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 2.5d+93) then
tmp = (2.0d0 + (im * im)) * (0.5d0 * re)
else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = 0.5d0 * (re * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.5e+93) {
tmp = (2.0 + (im * im)) * (0.5 * re);
} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.5e+93: tmp = (2.0 + (im * im)) * (0.5 * re) elif (re <= 1.9e+263) or not (re <= 1.15e+293): tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = 0.5 * (re * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.5e+93) tmp = Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 * re)); elseif ((re <= 1.9e+263) || !(re <= 1.15e+293)) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(0.5 * Float64(re * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.5e+93) tmp = (2.0 + (im * im)) * (0.5 * re); elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293))) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = 0.5 * (re * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.5e+93], N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+93}:\\
\;\;\;\;\left(2 + im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if re < 2.5000000000000001e93Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 78.6%
distribute-rgt-out78.6%
unpow278.6%
Simplified78.6%
Taylor expanded in re around 0 53.1%
associate-*r*53.1%
*-commutative53.1%
unpow253.1%
*-commutative53.1%
Simplified53.1%
if 2.5000000000000001e93 < re < 1.9e263 or 1.14999999999999995e293 < re Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 81.4%
distribute-rgt-out81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in im around 0 44.3%
Taylor expanded in re around 0 48.5%
*-commutative48.5%
unpow248.5%
associate-*l*48.5%
Simplified48.5%
if 1.9e263 < re < 1.14999999999999995e293Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 76.3%
distribute-rgt-out76.3%
unpow276.3%
Simplified76.3%
Taylor expanded in re around 0 51.0%
associate-*r*51.0%
*-commutative51.0%
unpow251.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in im around inf 52.0%
unpow252.0%
*-commutative52.0%
Simplified52.0%
Final simplification52.4%
(FPCore (re im) :precision binary64 (if (or (<= im 5e+61) (and (not (<= im 2.7e+208)) (<= im 1.58e+227))) (* re (+ 1.0 (* re (* re -0.16666666666666666)))) (* 0.5 (* re (* im im)))))
double code(double re, double im) {
double tmp;
if ((im <= 5e+61) || (!(im <= 2.7e+208) && (im <= 1.58e+227))) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * (re * (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 <= 5d+61) .or. (.not. (im <= 2.7d+208)) .and. (im <= 1.58d+227)) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = 0.5d0 * (re * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= 5e+61) || (!(im <= 2.7e+208) && (im <= 1.58e+227))) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 5e+61) or (not (im <= 2.7e+208) and (im <= 1.58e+227)): tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = 0.5 * (re * (im * im)) return tmp
function code(re, im) tmp = 0.0 if ((im <= 5e+61) || (!(im <= 2.7e+208) && (im <= 1.58e+227))) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(0.5 * Float64(re * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 5e+61) || (~((im <= 2.7e+208)) && (im <= 1.58e+227))) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = 0.5 * (re * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 5e+61], And[N[Not[LessEqual[im, 2.7e+208]], $MachinePrecision], LessEqual[im, 1.58e+227]]], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 5 \cdot 10^{+61} \lor \neg \left(im \leq 2.7 \cdot 10^{+208}\right) \land im \leq 1.58 \cdot 10^{+227}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 5.00000000000000018e61 or 2.7e208 < im < 1.57999999999999994e227Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 80.3%
distribute-rgt-out80.3%
unpow280.3%
Simplified80.3%
Taylor expanded in im around 0 55.3%
Taylor expanded in re around 0 38.1%
*-commutative60.4%
unpow260.4%
associate-*l*60.4%
Simplified38.1%
if 5.00000000000000018e61 < im < 2.7e208 or 1.57999999999999994e227 < im Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 72.8%
distribute-rgt-out72.8%
unpow272.8%
Simplified72.8%
Taylor expanded in re around 0 53.9%
associate-*r*53.9%
*-commutative53.9%
unpow253.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in im around inf 53.9%
unpow253.9%
*-commutative53.9%
Simplified53.9%
Final simplification40.8%
(FPCore (re im) :precision binary64 (if (<= im 0.056) re (* 0.5 (* re (* im im)))))
double code(double re, double im) {
double tmp;
if (im <= 0.056) {
tmp = re;
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.056d0) then
tmp = re
else
tmp = 0.5d0 * (re * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.056) {
tmp = re;
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.056: tmp = re else: tmp = 0.5 * (re * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.056) tmp = re; else tmp = Float64(0.5 * Float64(re * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.056) tmp = re; else tmp = 0.5 * (re * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.056], re, N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.056:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 0.0560000000000000012Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 86.1%
distribute-rgt-out86.1%
unpow286.1%
Simplified86.1%
Taylor expanded in re around 0 48.6%
associate-*r*48.6%
*-commutative48.6%
unpow248.6%
*-commutative48.6%
Simplified48.6%
Taylor expanded in im around 0 30.6%
if 0.0560000000000000012 < im Initial program 100.0%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 58.8%
distribute-rgt-out58.8%
unpow258.8%
Simplified58.8%
Taylor expanded in re around 0 40.4%
associate-*r*40.4%
*-commutative40.4%
unpow240.4%
*-commutative40.4%
Simplified40.4%
Taylor expanded in im around inf 40.4%
unpow240.4%
*-commutative40.4%
Simplified40.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%
remove-double-neg100.0%
sin-neg100.0%
distribute-rgt-neg-in100.0%
/-rgt-identity100.0%
exp-0100.0%
distribute-neg-frac2100.0%
exp-0100.0%
metadata-eval100.0%
associate-*l/100.0%
associate-*l*100.0%
associate-*r/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in im around 0 79.0%
distribute-rgt-out79.0%
unpow279.0%
Simplified79.0%
Taylor expanded in re around 0 46.5%
associate-*r*46.5%
*-commutative46.5%
unpow246.5%
*-commutative46.5%
Simplified46.5%
Taylor expanded in im around 0 23.3%
herbie shell --seed 2024107
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))