
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (* (* 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(Float64(0.5 * 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[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + e^{im}\right)
\end{array}
Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(if (<= im 0.68)
(*
(* 0.5 (sin re))
(+ (+ 2.0 (* im im)) (* 0.08333333333333333 (pow im 4.0))))
(if (<= im 2e+73)
(* (+ (exp (- im)) (exp im)) (* 0.5 re))
(* 0.041666666666666664 (* (sin re) (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 0.68) {
tmp = (0.5 * sin(re)) * ((2.0 + (im * im)) + (0.08333333333333333 * pow(im, 4.0)));
} else if (im <= 2e+73) {
tmp = (exp(-im) + exp(im)) * (0.5 * re);
} else {
tmp = 0.041666666666666664 * (sin(re) * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.68d0) then
tmp = (0.5d0 * sin(re)) * ((2.0d0 + (im * im)) + (0.08333333333333333d0 * (im ** 4.0d0)))
else if (im <= 2d+73) then
tmp = (exp(-im) + exp(im)) * (0.5d0 * re)
else
tmp = 0.041666666666666664d0 * (sin(re) * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.68) {
tmp = (0.5 * Math.sin(re)) * ((2.0 + (im * im)) + (0.08333333333333333 * Math.pow(im, 4.0)));
} else if (im <= 2e+73) {
tmp = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
} else {
tmp = 0.041666666666666664 * (Math.sin(re) * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.68: tmp = (0.5 * math.sin(re)) * ((2.0 + (im * im)) + (0.08333333333333333 * math.pow(im, 4.0))) elif im <= 2e+73: tmp = (math.exp(-im) + math.exp(im)) * (0.5 * re) else: tmp = 0.041666666666666664 * (math.sin(re) * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.68) tmp = Float64(Float64(0.5 * sin(re)) * Float64(Float64(2.0 + Float64(im * im)) + Float64(0.08333333333333333 * (im ^ 4.0)))); elseif (im <= 2e+73) tmp = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re)); else tmp = Float64(0.041666666666666664 * Float64(sin(re) * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.68) tmp = (0.5 * sin(re)) * ((2.0 + (im * im)) + (0.08333333333333333 * (im ^ 4.0))); elseif (im <= 2e+73) tmp = (exp(-im) + exp(im)) * (0.5 * re); else tmp = 0.041666666666666664 * (sin(re) * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.68], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] + N[(0.08333333333333333 * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2e+73], N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(0.041666666666666664 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.68:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(2 + im \cdot im\right) + 0.08333333333333333 \cdot {im}^{4}\right)\\
\mathbf{elif}\;im \leq 2 \cdot 10^{+73}:\\
\;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(\sin re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 0.680000000000000049Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 93.5%
Simplified93.5%
if 0.680000000000000049 < im < 1.99999999999999997e73Initial program 99.9%
distribute-lft-in99.9%
*-commutative99.9%
cancel-sign-sub99.9%
distribute-lft-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-out99.9%
neg-mul-199.9%
associate-*r*99.9%
distribute-rgt-out--99.9%
sub-neg99.9%
neg-sub099.9%
*-commutative99.9%
neg-mul-199.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in re around 0 73.6%
if 1.99999999999999997e73 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.2%
Simplified98.2%
Taylor expanded in im around inf 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification92.9%
(FPCore (re im)
:precision binary64
(if (<= im 0.66)
(* (* 0.5 (sin re)) (+ 2.0 (* im im)))
(if (<= im 2e+73)
(* (+ (exp (- im)) (exp im)) (* 0.5 re))
(* 0.041666666666666664 (* (sin re) (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 0.66) {
tmp = (0.5 * sin(re)) * (2.0 + (im * im));
} else if (im <= 2e+73) {
tmp = (exp(-im) + exp(im)) * (0.5 * re);
} else {
tmp = 0.041666666666666664 * (sin(re) * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.66d0) then
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
else if (im <= 2d+73) then
tmp = (exp(-im) + exp(im)) * (0.5d0 * re)
else
tmp = 0.041666666666666664d0 * (sin(re) * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.66) {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * im));
} else if (im <= 2e+73) {
tmp = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
} else {
tmp = 0.041666666666666664 * (Math.sin(re) * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.66: tmp = (0.5 * math.sin(re)) * (2.0 + (im * im)) elif im <= 2e+73: tmp = (math.exp(-im) + math.exp(im)) * (0.5 * re) else: tmp = 0.041666666666666664 * (math.sin(re) * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.66) tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))); elseif (im <= 2e+73) tmp = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re)); else tmp = Float64(0.041666666666666664 * Float64(sin(re) * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.66) tmp = (0.5 * sin(re)) * (2.0 + (im * im)); elseif (im <= 2e+73) tmp = (exp(-im) + exp(im)) * (0.5 * re); else tmp = 0.041666666666666664 * (sin(re) * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.66], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2e+73], N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(0.041666666666666664 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.66:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 2 \cdot 10^{+73}:\\
\;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(\sin re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 0.660000000000000031Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 87.2%
Simplified87.2%
if 0.660000000000000031 < im < 1.99999999999999997e73Initial program 99.9%
distribute-lft-in99.9%
*-commutative99.9%
cancel-sign-sub99.9%
distribute-lft-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-out99.9%
neg-mul-199.9%
associate-*r*99.9%
distribute-rgt-out--99.9%
sub-neg99.9%
neg-sub099.9%
*-commutative99.9%
neg-mul-199.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in re around 0 73.6%
if 1.99999999999999997e73 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.2%
Simplified98.2%
Taylor expanded in im around inf 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification88.3%
(FPCore (re im)
:precision binary64
(if (<= im 2300000.0)
(* (* 0.5 (sin re)) (+ 2.0 (* im im)))
(if (<= im 2e+73)
(pow re -512.0)
(* 0.041666666666666664 (* (sin re) (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = (0.5 * sin(re)) * (2.0 + (im * im));
} else if (im <= 2e+73) {
tmp = pow(re, -512.0);
} else {
tmp = 0.041666666666666664 * (sin(re) * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2300000.0d0) then
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
else if (im <= 2d+73) then
tmp = re ** (-512.0d0)
else
tmp = 0.041666666666666664d0 * (sin(re) * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * im));
} else if (im <= 2e+73) {
tmp = Math.pow(re, -512.0);
} else {
tmp = 0.041666666666666664 * (Math.sin(re) * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2300000.0: tmp = (0.5 * math.sin(re)) * (2.0 + (im * im)) elif im <= 2e+73: tmp = math.pow(re, -512.0) else: tmp = 0.041666666666666664 * (math.sin(re) * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 2300000.0) tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))); elseif (im <= 2e+73) tmp = re ^ -512.0; else tmp = Float64(0.041666666666666664 * Float64(sin(re) * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2300000.0) tmp = (0.5 * sin(re)) * (2.0 + (im * im)); elseif (im <= 2e+73) tmp = re ^ -512.0; else tmp = 0.041666666666666664 * (sin(re) * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2300000.0], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2e+73], N[Power[re, -512.0], $MachinePrecision], N[(0.041666666666666664 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 2 \cdot 10^{+73}:\\
\;\;\;\;{re}^{-512}\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(\sin re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 86.4%
Simplified86.4%
if 2.3e6 < im < 1.99999999999999997e73Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 76.5%
Applied egg-rr41.7%
if 1.99999999999999997e73 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.2%
Simplified98.2%
Taylor expanded in im around inf 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification85.7%
(FPCore (re im)
:precision binary64
(if (<= im 76.0)
(* (* 0.5 (sin re)) (+ 2.0 (* im im)))
(if (<= im 2e+73)
(* 0.5 (+ (exp (- im)) (exp im)))
(* 0.041666666666666664 (* (sin re) (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 76.0) {
tmp = (0.5 * sin(re)) * (2.0 + (im * im));
} else if (im <= 2e+73) {
tmp = 0.5 * (exp(-im) + exp(im));
} else {
tmp = 0.041666666666666664 * (sin(re) * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 76.0d0) then
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
else if (im <= 2d+73) then
tmp = 0.5d0 * (exp(-im) + exp(im))
else
tmp = 0.041666666666666664d0 * (sin(re) * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 76.0) {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * im));
} else if (im <= 2e+73) {
tmp = 0.5 * (Math.exp(-im) + Math.exp(im));
} else {
tmp = 0.041666666666666664 * (Math.sin(re) * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 76.0: tmp = (0.5 * math.sin(re)) * (2.0 + (im * im)) elif im <= 2e+73: tmp = 0.5 * (math.exp(-im) + math.exp(im)) else: tmp = 0.041666666666666664 * (math.sin(re) * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 76.0) tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))); elseif (im <= 2e+73) tmp = Float64(0.5 * Float64(exp(Float64(-im)) + exp(im))); else tmp = Float64(0.041666666666666664 * Float64(sin(re) * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 76.0) tmp = (0.5 * sin(re)) * (2.0 + (im * im)); elseif (im <= 2e+73) tmp = 0.5 * (exp(-im) + exp(im)); else tmp = 0.041666666666666664 * (sin(re) * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 76.0], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2e+73], N[(0.5 * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.041666666666666664 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 76:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 2 \cdot 10^{+73}:\\
\;\;\;\;0.5 \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(\sin re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 76Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 86.8%
Simplified86.8%
if 76 < im < 1.99999999999999997e73Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr100.0%
Applied egg-rr72.2%
+-inverses72.2%
+-rgt-identity72.2%
*-inverses72.2%
Simplified72.2%
if 1.99999999999999997e73 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.2%
Simplified98.2%
Taylor expanded in im around inf 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification88.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 2.0 (* im im))))
(if (<= im 2300000.0)
(* (* 0.5 (sin re)) t_0)
(if (<= im 1.25e+77)
(pow re -512.0)
(if (<= im 4.5e+152)
(* (+ t_0 (* 0.08333333333333333 (pow im 4.0))) (* 0.5 re))
(* (sin re) (* 0.5 (* im im))))))))
double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double tmp;
if (im <= 2300000.0) {
tmp = (0.5 * sin(re)) * t_0;
} else if (im <= 1.25e+77) {
tmp = pow(re, -512.0);
} else if (im <= 4.5e+152) {
tmp = (t_0 + (0.08333333333333333 * pow(im, 4.0))) * (0.5 * re);
} else {
tmp = sin(re) * (0.5 * (im * im));
}
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 <= 2300000.0d0) then
tmp = (0.5d0 * sin(re)) * t_0
else if (im <= 1.25d+77) then
tmp = re ** (-512.0d0)
else if (im <= 4.5d+152) then
tmp = (t_0 + (0.08333333333333333d0 * (im ** 4.0d0))) * (0.5d0 * re)
else
tmp = sin(re) * (0.5d0 * (im * im))
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 <= 2300000.0) {
tmp = (0.5 * Math.sin(re)) * t_0;
} else if (im <= 1.25e+77) {
tmp = Math.pow(re, -512.0);
} else if (im <= 4.5e+152) {
tmp = (t_0 + (0.08333333333333333 * Math.pow(im, 4.0))) * (0.5 * re);
} else {
tmp = Math.sin(re) * (0.5 * (im * im));
}
return tmp;
}
def code(re, im): t_0 = 2.0 + (im * im) tmp = 0 if im <= 2300000.0: tmp = (0.5 * math.sin(re)) * t_0 elif im <= 1.25e+77: tmp = math.pow(re, -512.0) elif im <= 4.5e+152: tmp = (t_0 + (0.08333333333333333 * math.pow(im, 4.0))) * (0.5 * re) else: tmp = math.sin(re) * (0.5 * (im * im)) return tmp
function code(re, im) t_0 = Float64(2.0 + Float64(im * im)) tmp = 0.0 if (im <= 2300000.0) tmp = Float64(Float64(0.5 * sin(re)) * t_0); elseif (im <= 1.25e+77) tmp = re ^ -512.0; elseif (im <= 4.5e+152) tmp = Float64(Float64(t_0 + Float64(0.08333333333333333 * (im ^ 4.0))) * Float64(0.5 * re)); else tmp = Float64(sin(re) * Float64(0.5 * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) t_0 = 2.0 + (im * im); tmp = 0.0; if (im <= 2300000.0) tmp = (0.5 * sin(re)) * t_0; elseif (im <= 1.25e+77) tmp = re ^ -512.0; elseif (im <= 4.5e+152) tmp = (t_0 + (0.08333333333333333 * (im ^ 4.0))) * (0.5 * re); else tmp = sin(re) * (0.5 * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 2300000.0], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[im, 1.25e+77], N[Power[re, -512.0], $MachinePrecision], If[LessEqual[im, 4.5e+152], N[(N[(t$95$0 + N[(0.08333333333333333 * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + im \cdot im\\
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot t_0\\
\mathbf{elif}\;im \leq 1.25 \cdot 10^{+77}:\\
\;\;\;\;{re}^{-512}\\
\mathbf{elif}\;im \leq 4.5 \cdot 10^{+152}:\\
\;\;\;\;\left(t_0 + 0.08333333333333333 \cdot {im}^{4}\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 86.4%
Simplified86.4%
if 2.3e6 < im < 1.25000000000000001e77Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 68.4%
Applied egg-rr37.5%
if 1.25000000000000001e77 < im < 4.5000000000000001e152Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 88.9%
Taylor expanded in im around 0 88.9%
Simplified88.9%
if 4.5000000000000001e152 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
unpow2100.0%
Simplified100.0%
Final simplification84.5%
(FPCore (re im)
:precision binary64
(if (<= im 2300000.0)
(sin re)
(if (<= im 1.25e+77)
(pow re -512.0)
(if (<= im 4.5e+152)
(* 0.041666666666666664 (* re (pow im 4.0)))
(* (sin re) (* 0.5 (* im im)))))))
double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = sin(re);
} else if (im <= 1.25e+77) {
tmp = pow(re, -512.0);
} else if (im <= 4.5e+152) {
tmp = 0.041666666666666664 * (re * pow(im, 4.0));
} else {
tmp = sin(re) * (0.5 * (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2300000.0d0) then
tmp = sin(re)
else if (im <= 1.25d+77) then
tmp = re ** (-512.0d0)
else if (im <= 4.5d+152) then
tmp = 0.041666666666666664d0 * (re * (im ** 4.0d0))
else
tmp = sin(re) * (0.5d0 * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = Math.sin(re);
} else if (im <= 1.25e+77) {
tmp = Math.pow(re, -512.0);
} else if (im <= 4.5e+152) {
tmp = 0.041666666666666664 * (re * Math.pow(im, 4.0));
} else {
tmp = Math.sin(re) * (0.5 * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2300000.0: tmp = math.sin(re) elif im <= 1.25e+77: tmp = math.pow(re, -512.0) elif im <= 4.5e+152: tmp = 0.041666666666666664 * (re * math.pow(im, 4.0)) else: tmp = math.sin(re) * (0.5 * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 2300000.0) tmp = sin(re); elseif (im <= 1.25e+77) tmp = re ^ -512.0; elseif (im <= 4.5e+152) tmp = Float64(0.041666666666666664 * Float64(re * (im ^ 4.0))); else tmp = Float64(sin(re) * Float64(0.5 * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2300000.0) tmp = sin(re); elseif (im <= 1.25e+77) tmp = re ^ -512.0; elseif (im <= 4.5e+152) tmp = 0.041666666666666664 * (re * (im ^ 4.0)); else tmp = sin(re) * (0.5 * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2300000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.25e+77], N[Power[re, -512.0], $MachinePrecision], If[LessEqual[im, 4.5e+152], N[(0.041666666666666664 * N[(re * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.25 \cdot 10^{+77}:\\
\;\;\;\;{re}^{-512}\\
\mathbf{elif}\;im \leq 4.5 \cdot 10^{+152}:\\
\;\;\;\;0.041666666666666664 \cdot \left(re \cdot {im}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.6%
if 2.3e6 < im < 1.25000000000000001e77Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 68.4%
Applied egg-rr37.5%
if 1.25000000000000001e77 < im < 4.5000000000000001e152Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 88.9%
Taylor expanded in im around 0 88.9%
Simplified88.9%
Taylor expanded in im around inf 88.9%
if 4.5000000000000001e152 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
unpow2100.0%
Simplified100.0%
Final simplification69.8%
(FPCore (re im)
:precision binary64
(if (<= im 2300000.0)
(* (* 0.5 (sin re)) (+ 2.0 (* im im)))
(if (<= im 1.25e+77)
(pow re -512.0)
(if (<= im 4.5e+152)
(* 0.041666666666666664 (* re (pow im 4.0)))
(* (sin re) (* 0.5 (* im im)))))))
double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = (0.5 * sin(re)) * (2.0 + (im * im));
} else if (im <= 1.25e+77) {
tmp = pow(re, -512.0);
} else if (im <= 4.5e+152) {
tmp = 0.041666666666666664 * (re * pow(im, 4.0));
} else {
tmp = sin(re) * (0.5 * (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2300000.0d0) then
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
else if (im <= 1.25d+77) then
tmp = re ** (-512.0d0)
else if (im <= 4.5d+152) then
tmp = 0.041666666666666664d0 * (re * (im ** 4.0d0))
else
tmp = sin(re) * (0.5d0 * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * im));
} else if (im <= 1.25e+77) {
tmp = Math.pow(re, -512.0);
} else if (im <= 4.5e+152) {
tmp = 0.041666666666666664 * (re * Math.pow(im, 4.0));
} else {
tmp = Math.sin(re) * (0.5 * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2300000.0: tmp = (0.5 * math.sin(re)) * (2.0 + (im * im)) elif im <= 1.25e+77: tmp = math.pow(re, -512.0) elif im <= 4.5e+152: tmp = 0.041666666666666664 * (re * math.pow(im, 4.0)) else: tmp = math.sin(re) * (0.5 * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 2300000.0) tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))); elseif (im <= 1.25e+77) tmp = re ^ -512.0; elseif (im <= 4.5e+152) tmp = Float64(0.041666666666666664 * Float64(re * (im ^ 4.0))); else tmp = Float64(sin(re) * Float64(0.5 * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2300000.0) tmp = (0.5 * sin(re)) * (2.0 + (im * im)); elseif (im <= 1.25e+77) tmp = re ^ -512.0; elseif (im <= 4.5e+152) tmp = 0.041666666666666664 * (re * (im ^ 4.0)); else tmp = sin(re) * (0.5 * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2300000.0], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.25e+77], N[Power[re, -512.0], $MachinePrecision], If[LessEqual[im, 4.5e+152], N[(0.041666666666666664 * N[(re * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 1.25 \cdot 10^{+77}:\\
\;\;\;\;{re}^{-512}\\
\mathbf{elif}\;im \leq 4.5 \cdot 10^{+152}:\\
\;\;\;\;0.041666666666666664 \cdot \left(re \cdot {im}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 86.4%
Simplified86.4%
if 2.3e6 < im < 1.25000000000000001e77Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 68.4%
Applied egg-rr37.5%
if 1.25000000000000001e77 < im < 4.5000000000000001e152Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 88.9%
Taylor expanded in im around 0 88.9%
Simplified88.9%
Taylor expanded in im around inf 88.9%
if 4.5000000000000001e152 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
unpow2100.0%
Simplified100.0%
Final simplification84.5%
(FPCore (re im)
:precision binary64
(if (<= im 2300000.0)
(sin re)
(if (<= im 1.25e+77)
(pow re -512.0)
(* 0.041666666666666664 (* re (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = sin(re);
} else if (im <= 1.25e+77) {
tmp = pow(re, -512.0);
} else {
tmp = 0.041666666666666664 * (re * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2300000.0d0) then
tmp = sin(re)
else if (im <= 1.25d+77) then
tmp = re ** (-512.0d0)
else
tmp = 0.041666666666666664d0 * (re * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = Math.sin(re);
} else if (im <= 1.25e+77) {
tmp = Math.pow(re, -512.0);
} else {
tmp = 0.041666666666666664 * (re * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2300000.0: tmp = math.sin(re) elif im <= 1.25e+77: tmp = math.pow(re, -512.0) else: tmp = 0.041666666666666664 * (re * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 2300000.0) tmp = sin(re); elseif (im <= 1.25e+77) tmp = re ^ -512.0; else tmp = Float64(0.041666666666666664 * Float64(re * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2300000.0) tmp = sin(re); elseif (im <= 1.25e+77) tmp = re ^ -512.0; else tmp = 0.041666666666666664 * (re * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2300000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.25e+77], N[Power[re, -512.0], $MachinePrecision], N[(0.041666666666666664 * N[(re * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.25 \cdot 10^{+77}:\\
\;\;\;\;{re}^{-512}\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.6%
if 2.3e6 < im < 1.25000000000000001e77Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 68.4%
Applied egg-rr37.5%
if 1.25000000000000001e77 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 72.3%
Taylor expanded in im around 0 72.3%
Simplified72.3%
Taylor expanded in im around inf 72.3%
Final simplification65.5%
(FPCore (re im) :precision binary64 (if (<= im 2300000.0) (sin re) (if (<= im 1.95e+77) (pow re -512.0) (* (+ 2.0 (* im im)) (* 0.5 re)))))
double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = sin(re);
} else if (im <= 1.95e+77) {
tmp = pow(re, -512.0);
} else {
tmp = (2.0 + (im * im)) * (0.5 * re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2300000.0d0) then
tmp = sin(re)
else if (im <= 1.95d+77) then
tmp = re ** (-512.0d0)
else
tmp = (2.0d0 + (im * im)) * (0.5d0 * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = Math.sin(re);
} else if (im <= 1.95e+77) {
tmp = Math.pow(re, -512.0);
} else {
tmp = (2.0 + (im * im)) * (0.5 * re);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2300000.0: tmp = math.sin(re) elif im <= 1.95e+77: tmp = math.pow(re, -512.0) else: tmp = (2.0 + (im * im)) * (0.5 * re) return tmp
function code(re, im) tmp = 0.0 if (im <= 2300000.0) tmp = sin(re); elseif (im <= 1.95e+77) tmp = re ^ -512.0; else tmp = Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2300000.0) tmp = sin(re); elseif (im <= 1.95e+77) tmp = re ^ -512.0; else tmp = (2.0 + (im * im)) * (0.5 * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2300000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.95e+77], N[Power[re, -512.0], $MachinePrecision], N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.95 \cdot 10^{+77}:\\
\;\;\;\;{re}^{-512}\\
\mathbf{else}:\\
\;\;\;\;\left(2 + im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.6%
if 2.3e6 < im < 1.9499999999999999e77Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 68.4%
Applied egg-rr37.5%
if 1.9499999999999999e77 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 72.3%
Taylor expanded in im around 0 56.1%
Simplified56.1%
Final simplification62.5%
(FPCore (re im)
:precision binary64
(if (<= im 2300000.0)
(sin re)
(if (<= im 4.8e+71)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* re (* re 0.016666666666666666))))
(* (+ 2.0 (* im im)) (* 0.5 re)))))
double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = sin(re);
} else if (im <= 4.8e+71) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + (re * (re * 0.016666666666666666)));
} else {
tmp = (2.0 + (im * im)) * (0.5 * re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2300000.0d0) then
tmp = sin(re)
else if (im <= 4.8d+71) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + (re * (re * 0.016666666666666666d0)))
else
tmp = (2.0d0 + (im * im)) * (0.5d0 * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = Math.sin(re);
} else if (im <= 4.8e+71) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + (re * (re * 0.016666666666666666)));
} else {
tmp = (2.0 + (im * im)) * (0.5 * re);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2300000.0: tmp = math.sin(re) elif im <= 4.8e+71: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + (re * (re * 0.016666666666666666))) else: tmp = (2.0 + (im * im)) * (0.5 * re) return tmp
function code(re, im) tmp = 0.0 if (im <= 2300000.0) tmp = sin(re); elseif (im <= 4.8e+71) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(re * Float64(re * 0.016666666666666666)))); else tmp = Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2300000.0) tmp = sin(re); elseif (im <= 4.8e+71) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + (re * (re * 0.016666666666666666))); else tmp = (2.0 + (im * im)) * (0.5 * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2300000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 4.8e+71], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re * N[(re * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 4.8 \cdot 10^{+71}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + re \cdot \left(re \cdot 0.016666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 + im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.6%
if 2.3e6 < im < 4.79999999999999961e71Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr19.9%
Taylor expanded in re around 0 37.4%
associate-*r/37.4%
metadata-eval37.4%
unpow237.4%
*-commutative37.4%
unpow237.4%
Simplified37.4%
Taylor expanded in re around 0 37.4%
unpow237.4%
*-commutative37.4%
associate-*r*37.4%
Simplified37.4%
if 4.79999999999999961e71 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 69.4%
Taylor expanded in im around 0 53.8%
Simplified53.8%
Final simplification62.2%
(FPCore (re im)
:precision binary64
(if (or (<= im 460.0) (not (<= im 4.5e+71)))
(* (+ 2.0 (* im im)) (* 0.5 re))
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* re (* re 0.016666666666666666))))))
double code(double re, double im) {
double tmp;
if ((im <= 460.0) || !(im <= 4.5e+71)) {
tmp = (2.0 + (im * im)) * (0.5 * re);
} else {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + (re * (re * 0.016666666666666666)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= 460.0d0) .or. (.not. (im <= 4.5d+71))) then
tmp = (2.0d0 + (im * im)) * (0.5d0 * re)
else
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + (re * (re * 0.016666666666666666d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= 460.0) || !(im <= 4.5e+71)) {
tmp = (2.0 + (im * im)) * (0.5 * re);
} else {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + (re * (re * 0.016666666666666666)));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 460.0) or not (im <= 4.5e+71): tmp = (2.0 + (im * im)) * (0.5 * re) else: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + (re * (re * 0.016666666666666666))) return tmp
function code(re, im) tmp = 0.0 if ((im <= 460.0) || !(im <= 4.5e+71)) tmp = Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 * re)); else tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(re * Float64(re * 0.016666666666666666)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 460.0) || ~((im <= 4.5e+71))) tmp = (2.0 + (im * im)) * (0.5 * re); else tmp = 0.08333333333333333 + ((0.25 / (re * re)) + (re * (re * 0.016666666666666666))); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 460.0], N[Not[LessEqual[im, 4.5e+71]], $MachinePrecision]], N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re * N[(re * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 460 \lor \neg \left(im \leq 4.5 \cdot 10^{+71}\right):\\
\;\;\;\;\left(2 + im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{else}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + re \cdot \left(re \cdot 0.016666666666666666\right)\right)\\
\end{array}
\end{array}
if im < 460 or 4.50000000000000043e71 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 60.9%
Taylor expanded in im around 0 50.1%
Simplified50.1%
if 460 < im < 4.50000000000000043e71Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr19.0%
Taylor expanded in re around 0 35.5%
associate-*r/35.5%
metadata-eval35.5%
unpow235.5%
*-commutative35.5%
unpow235.5%
Simplified35.5%
Taylor expanded in re around 0 35.5%
unpow235.5%
*-commutative35.5%
associate-*r*35.5%
Simplified35.5%
Final simplification49.1%
(FPCore (re im) :precision binary64 (if (<= im 1200.0) re (+ 0.08333333333333333 (/ 0.25 (* re re)))))
double code(double re, double im) {
double tmp;
if (im <= 1200.0) {
tmp = re;
} else {
tmp = 0.08333333333333333 + (0.25 / (re * re));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1200.0d0) then
tmp = re
else
tmp = 0.08333333333333333d0 + (0.25d0 / (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1200.0) {
tmp = re;
} else {
tmp = 0.08333333333333333 + (0.25 / (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1200.0: tmp = re else: tmp = 0.08333333333333333 + (0.25 / (re * re)) return tmp
function code(re, im) tmp = 0.0 if (im <= 1200.0) tmp = re; else tmp = Float64(0.08333333333333333 + Float64(0.25 / Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1200.0) tmp = re; else tmp = 0.08333333333333333 + (0.25 / (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1200.0], re, N[(0.08333333333333333 + N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1200:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\
\end{array}
\end{array}
if im < 1200Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 67.0%
Taylor expanded in re around 0 33.0%
if 1200 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr10.6%
Taylor expanded in re around 0 10.6%
associate-*r/10.6%
metadata-eval10.6%
unpow210.6%
Simplified10.6%
Final simplification27.1%
(FPCore (re im) :precision binary64 (* (+ 2.0 (* im im)) (* 0.5 re)))
double code(double re, double im) {
return (2.0 + (im * im)) * (0.5 * re);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (2.0d0 + (im * im)) * (0.5d0 * re)
end function
public static double code(double re, double im) {
return (2.0 + (im * im)) * (0.5 * re);
}
def code(re, im): return (2.0 + (im * im)) * (0.5 * re)
function code(re, im) return Float64(Float64(2.0 + Float64(im * im)) * Float64(0.5 * re)) end
function tmp = code(re, im) tmp = (2.0 + (im * im)) * (0.5 * re); end
code[re_, im_] := N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(2 + im \cdot im\right) \cdot \left(0.5 \cdot re\right)
\end{array}
Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 61.7%
Taylor expanded in im around 0 46.8%
Simplified46.8%
Final simplification46.8%
(FPCore (re im) :precision binary64 (if (<= im 2300000.0) re (/ 0.25 (* re re))))
double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = re;
} else {
tmp = 0.25 / (re * re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2300000.0d0) then
tmp = re
else
tmp = 0.25d0 / (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = re;
} else {
tmp = 0.25 / (re * re);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2300000.0: tmp = re else: tmp = 0.25 / (re * re) return tmp
function code(re, im) tmp = 0.0 if (im <= 2300000.0) tmp = re; else tmp = Float64(0.25 / Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2300000.0) tmp = re; else tmp = 0.25 / (re * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2300000.0], re, N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.6%
Taylor expanded in re around 0 32.8%
if 2.3e6 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr10.7%
Taylor expanded in re around 0 10.5%
unpow210.5%
Simplified10.5%
Final simplification27.1%
(FPCore (re im) :precision binary64 (if (<= im 2300000.0) re (/ (/ 0.25 re) re)))
double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = re;
} else {
tmp = (0.25 / re) / re;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2300000.0d0) then
tmp = re
else
tmp = (0.25d0 / re) / re
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2300000.0) {
tmp = re;
} else {
tmp = (0.25 / re) / re;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2300000.0: tmp = re else: tmp = (0.25 / re) / re return tmp
function code(re, im) tmp = 0.0 if (im <= 2300000.0) tmp = re; else tmp = Float64(Float64(0.25 / re) / re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2300000.0) tmp = re; else tmp = (0.25 / re) / re; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2300000.0], re, N[(N[(0.25 / re), $MachinePrecision] / re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2300000:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.25}{re}}{re}\\
\end{array}
\end{array}
if im < 2.3e6Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.6%
Taylor expanded in re around 0 32.8%
if 2.3e6 < im Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr10.7%
Taylor expanded in re around 0 10.7%
associate-*r/10.7%
metadata-eval10.7%
unpow210.7%
Simplified10.7%
Taylor expanded in re around 0 10.5%
unpow210.5%
associate-/r*10.5%
Simplified10.5%
Final simplification27.1%
(FPCore (re im) :precision binary64 0.08333333333333333)
double code(double re, double im) {
return 0.08333333333333333;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.08333333333333333d0
end function
public static double code(double re, double im) {
return 0.08333333333333333;
}
def code(re, im): return 0.08333333333333333
function code(re, im) return 0.08333333333333333 end
function tmp = code(re, im) tmp = 0.08333333333333333; end
code[re_, im_] := 0.08333333333333333
\begin{array}{l}
\\
0.08333333333333333
\end{array}
Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr9.4%
Taylor expanded in re around 0 9.3%
associate-*r/9.3%
metadata-eval9.3%
unpow29.3%
Simplified9.3%
Taylor expanded in re around inf 4.0%
Final simplification4.0%
(FPCore (re im) :precision binary64 re)
double code(double re, double im) {
return re;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re
end function
public static double code(double re, double im) {
return re;
}
def code(re, im): return re
function code(re, im) return re end
function tmp = code(re, im) tmp = re; end
code[re_, im_] := re
\begin{array}{l}
\\
re
\end{array}
Initial program 100.0%
distribute-lft-in100.0%
*-commutative100.0%
cancel-sign-sub100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
neg-mul-1100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
*-commutative100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 50.2%
Taylor expanded in re around 0 25.0%
Final simplification25.0%
herbie shell --seed 2023274
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))