
(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 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (* (sin re) (* 0.5 (+ (exp (- im)) (exp im)))))
double code(double re, double im) {
return sin(re) * (0.5 * (exp(-im) + exp(im)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sin(re) * (0.5d0 * (exp(-im) + exp(im)))
end function
public static double code(double re, double im) {
return Math.sin(re) * (0.5 * (Math.exp(-im) + Math.exp(im)));
}
def code(re, im): return math.sin(re) * (0.5 * (math.exp(-im) + math.exp(im)))
function code(re, im) return Float64(sin(re) * Float64(0.5 * Float64(exp(Float64(-im)) + exp(im)))) end
function tmp = code(re, im) tmp = sin(re) * (0.5 * (exp(-im) + exp(im))); end
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin re \cdot \left(0.5 \cdot \left(e^{-im} + e^{im}\right)\right)
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(if (<= im 4.7e-5)
(* (sin re) (+ (* im (* 0.5 im)) 1.0))
(if (<= im 2.55e+77)
(* (* re 0.5) (+ (exp (- im)) (exp im)))
(*
(sin re)
(+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664))))))))
double code(double re, double im) {
double tmp;
if (im <= 4.7e-5) {
tmp = sin(re) * ((im * (0.5 * im)) + 1.0);
} else if (im <= 2.55e+77) {
tmp = (re * 0.5) * (exp(-im) + exp(im));
} else {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 4.7d-5) then
tmp = sin(re) * ((im * (0.5d0 * im)) + 1.0d0)
else if (im <= 2.55d+77) then
tmp = (re * 0.5d0) * (exp(-im) + exp(im))
else
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 4.7e-5) {
tmp = Math.sin(re) * ((im * (0.5 * im)) + 1.0);
} else if (im <= 2.55e+77) {
tmp = (re * 0.5) * (Math.exp(-im) + Math.exp(im));
} else {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 4.7e-5: tmp = math.sin(re) * ((im * (0.5 * im)) + 1.0) elif im <= 2.55e+77: tmp = (re * 0.5) * (math.exp(-im) + math.exp(im)) else: tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) return tmp
function code(re, im) tmp = 0.0 if (im <= 4.7e-5) tmp = Float64(sin(re) * Float64(Float64(im * Float64(0.5 * im)) + 1.0)); elseif (im <= 2.55e+77) tmp = Float64(Float64(re * 0.5) * Float64(exp(Float64(-im)) + exp(im))); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 4.7e-5) tmp = sin(re) * ((im * (0.5 * im)) + 1.0); elseif (im <= 2.55e+77) tmp = (re * 0.5) * (exp(-im) + exp(im)); else tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 4.7e-5], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * N[(0.5 * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.55e+77], N[(N[(re * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 4.7 \cdot 10^{-5}:\\
\;\;\;\;\sin re \cdot \left(im \cdot \left(0.5 \cdot im\right) + 1\right)\\
\mathbf{elif}\;im \leq 2.55 \cdot 10^{+77}:\\
\;\;\;\;\left(re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\end{array}
\end{array}
if im < 4.69999999999999972e-5Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 78.7%
*-commutative78.7%
associate-*r*78.7%
distribute-rgt1-in78.7%
*-commutative78.7%
unpow278.7%
associate-*l*78.7%
Simplified78.7%
if 4.69999999999999972e-5 < im < 2.54999999999999985e77Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 84.6%
associate-*r*84.6%
Simplified84.6%
if 2.54999999999999985e77 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
*-rgt-identity100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
distribute-lft-out100.0%
metadata-eval100.0%
pow-sqr100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
unpow2100.0%
unpow2100.0%
Simplified100.0%
Final simplification83.0%
(FPCore (re im)
:precision binary64
(if (or (<= im 210000000000.0) (not (<= im 2.55e+77)))
(*
(sin re)
(+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664)))))
(+
(/ 0.25 (* re re))
(/
(- (* (pow re 4.0) 0.0002777777777777778) 0.006944444444444444)
(- (* re (* re 0.016666666666666666)) 0.08333333333333333)))))
double code(double re, double im) {
double tmp;
if ((im <= 210000000000.0) || !(im <= 2.55e+77)) {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = (0.25 / (re * re)) + (((pow(re, 4.0) * 0.0002777777777777778) - 0.006944444444444444) / ((re * (re * 0.016666666666666666)) - 0.08333333333333333));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= 210000000000.0d0) .or. (.not. (im <= 2.55d+77))) then
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
else
tmp = (0.25d0 / (re * re)) + ((((re ** 4.0d0) * 0.0002777777777777778d0) - 0.006944444444444444d0) / ((re * (re * 0.016666666666666666d0)) - 0.08333333333333333d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= 210000000000.0) || !(im <= 2.55e+77)) {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = (0.25 / (re * re)) + (((Math.pow(re, 4.0) * 0.0002777777777777778) - 0.006944444444444444) / ((re * (re * 0.016666666666666666)) - 0.08333333333333333));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 210000000000.0) or not (im <= 2.55e+77): tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) else: tmp = (0.25 / (re * re)) + (((math.pow(re, 4.0) * 0.0002777777777777778) - 0.006944444444444444) / ((re * (re * 0.016666666666666666)) - 0.08333333333333333)) return tmp
function code(re, im) tmp = 0.0 if ((im <= 210000000000.0) || !(im <= 2.55e+77)) tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); else tmp = Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(Float64((re ^ 4.0) * 0.0002777777777777778) - 0.006944444444444444) / Float64(Float64(re * Float64(re * 0.016666666666666666)) - 0.08333333333333333))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 210000000000.0) || ~((im <= 2.55e+77))) tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); else tmp = (0.25 / (re * re)) + ((((re ^ 4.0) * 0.0002777777777777778) - 0.006944444444444444) / ((re * (re * 0.016666666666666666)) - 0.08333333333333333)); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 210000000000.0], N[Not[LessEqual[im, 2.55e+77]], $MachinePrecision]], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Power[re, 4.0], $MachinePrecision] * 0.0002777777777777778), $MachinePrecision] - 0.006944444444444444), $MachinePrecision] / N[(N[(re * N[(re * 0.016666666666666666), $MachinePrecision]), $MachinePrecision] - 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 210000000000 \lor \neg \left(im \leq 2.55 \cdot 10^{+77}\right):\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{re \cdot re} + \frac{{re}^{4} \cdot 0.0002777777777777778 - 0.006944444444444444}{re \cdot \left(re \cdot 0.016666666666666666\right) - 0.08333333333333333}\\
\end{array}
\end{array}
if im < 2.1e11 or 2.54999999999999985e77 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 91.5%
*-rgt-identity91.5%
*-commutative91.5%
associate-*r*91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt-out91.5%
distribute-lft-out91.5%
metadata-eval91.5%
pow-sqr91.5%
associate-*r*91.5%
distribute-rgt-out91.5%
unpow291.5%
unpow291.5%
Simplified91.5%
if 2.1e11 < im < 2.54999999999999985e77Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr31.2%
Taylor expanded in re around 0 40.8%
+-commutative40.8%
associate-+l+40.8%
associate-*r/40.8%
metadata-eval40.8%
unpow240.8%
*-commutative40.8%
unpow240.8%
associate-*l*40.8%
fma-def40.8%
Simplified40.8%
fma-udef40.8%
associate-*l*40.8%
flip-+30.8%
swap-sqr30.8%
pow230.8%
metadata-eval30.8%
pow-prod-down30.8%
pow-prod-up30.8%
metadata-eval30.8%
metadata-eval30.8%
metadata-eval30.8%
metadata-eval30.8%
metadata-eval30.8%
associate-*l*30.8%
Applied egg-rr30.8%
Final simplification89.1%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
re
(+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664)))))))
(if (<= im 600.0)
(* (sin re) (+ (* im (* 0.5 im)) 1.0))
(if (<= im 8.7e+61)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))
(if (<= im 2.15e+112)
t_0
(if (<= im 2.4e+118)
(* 0.5 (* (* im im) (+ re (* -0.16666666666666666 (pow re 3.0)))))
(if (<= im 1.8e+150) t_0 (* 0.5 (* (sin re) (* im im))))))))))
double code(double re, double im) {
double t_0 = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
double tmp;
if (im <= 600.0) {
tmp = sin(re) * ((im * (0.5 * im)) + 1.0);
} else if (im <= 8.7e+61) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 2.15e+112) {
tmp = t_0;
} else if (im <= 2.4e+118) {
tmp = 0.5 * ((im * im) * (re + (-0.16666666666666666 * pow(re, 3.0))));
} else if (im <= 1.8e+150) {
tmp = t_0;
} else {
tmp = 0.5 * (sin(re) * (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 = re * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
if (im <= 600.0d0) then
tmp = sin(re) * ((im * (0.5d0 * im)) + 1.0d0)
else if (im <= 8.7d+61) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + ((re * re) * 0.016666666666666666d0))
else if (im <= 2.15d+112) then
tmp = t_0
else if (im <= 2.4d+118) then
tmp = 0.5d0 * ((im * im) * (re + ((-0.16666666666666666d0) * (re ** 3.0d0))))
else if (im <= 1.8d+150) then
tmp = t_0
else
tmp = 0.5d0 * (sin(re) * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
double tmp;
if (im <= 600.0) {
tmp = Math.sin(re) * ((im * (0.5 * im)) + 1.0);
} else if (im <= 8.7e+61) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 2.15e+112) {
tmp = t_0;
} else if (im <= 2.4e+118) {
tmp = 0.5 * ((im * im) * (re + (-0.16666666666666666 * Math.pow(re, 3.0))));
} else if (im <= 1.8e+150) {
tmp = t_0;
} else {
tmp = 0.5 * (Math.sin(re) * (im * im));
}
return tmp;
}
def code(re, im): t_0 = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) tmp = 0 if im <= 600.0: tmp = math.sin(re) * ((im * (0.5 * im)) + 1.0) elif im <= 8.7e+61: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) elif im <= 2.15e+112: tmp = t_0 elif im <= 2.4e+118: tmp = 0.5 * ((im * im) * (re + (-0.16666666666666666 * math.pow(re, 3.0)))) elif im <= 1.8e+150: tmp = t_0 else: tmp = 0.5 * (math.sin(re) * (im * im)) return tmp
function code(re, im) t_0 = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))) tmp = 0.0 if (im <= 600.0) tmp = Float64(sin(re) * Float64(Float64(im * Float64(0.5 * im)) + 1.0)); elseif (im <= 8.7e+61) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); elseif (im <= 2.15e+112) tmp = t_0; elseif (im <= 2.4e+118) tmp = Float64(0.5 * Float64(Float64(im * im) * Float64(re + Float64(-0.16666666666666666 * (re ^ 3.0))))); elseif (im <= 1.8e+150) tmp = t_0; else tmp = Float64(0.5 * Float64(sin(re) * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) t_0 = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); tmp = 0.0; if (im <= 600.0) tmp = sin(re) * ((im * (0.5 * im)) + 1.0); elseif (im <= 8.7e+61) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); elseif (im <= 2.15e+112) tmp = t_0; elseif (im <= 2.4e+118) tmp = 0.5 * ((im * im) * (re + (-0.16666666666666666 * (re ^ 3.0)))); elseif (im <= 1.8e+150) tmp = t_0; else tmp = 0.5 * (sin(re) * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 600.0], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * N[(0.5 * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.7e+61], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.15e+112], t$95$0, If[LessEqual[im, 2.4e+118], N[(0.5 * N[(N[(im * im), $MachinePrecision] * N[(re + N[(-0.16666666666666666 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.8e+150], t$95$0, N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{if}\;im \leq 600:\\
\;\;\;\;\sin re \cdot \left(im \cdot \left(0.5 \cdot im\right) + 1\right)\\
\mathbf{elif}\;im \leq 8.7 \cdot 10^{+61}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\mathbf{elif}\;im \leq 2.15 \cdot 10^{+112}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 2.4 \cdot 10^{+118}:\\
\;\;\;\;0.5 \cdot \left(\left(im \cdot im\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)\right)\\
\mathbf{elif}\;im \leq 1.8 \cdot 10^{+150}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 600Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 78.6%
*-commutative78.6%
associate-*r*78.6%
distribute-rgt1-in78.6%
*-commutative78.6%
unpow278.6%
associate-*l*78.6%
Simplified78.6%
if 600 < im < 8.7000000000000002e61Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.9%
Taylor expanded in re around 0 56.4%
associate-*r/56.4%
metadata-eval56.4%
unpow256.4%
*-commutative56.4%
unpow256.4%
Simplified56.4%
if 8.7000000000000002e61 < im < 2.14999999999999991e112 or 2.4e118 < im < 1.79999999999999993e150Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 86.8%
*-rgt-identity86.8%
*-commutative86.8%
associate-*r*86.8%
*-commutative86.8%
associate-*r*86.8%
distribute-rgt-out86.8%
distribute-lft-out86.8%
metadata-eval86.8%
pow-sqr86.8%
associate-*r*86.8%
distribute-rgt-out86.8%
unpow286.8%
unpow286.8%
Simplified86.8%
Taylor expanded in re around 0 78.6%
*-commutative78.6%
unpow278.6%
unpow278.6%
Simplified78.6%
if 2.14999999999999991e112 < im < 2.4e118Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 5.3%
*-commutative5.3%
associate-*r*5.3%
distribute-rgt1-in5.3%
*-commutative5.3%
unpow25.3%
associate-*l*5.3%
Simplified5.3%
Taylor expanded in im around inf 5.3%
*-commutative5.3%
unpow25.3%
associate-*l*5.3%
Simplified5.3%
Taylor expanded in re around 0 1.2%
+-commutative1.2%
associate-*r*1.2%
distribute-rgt-out67.8%
unpow267.8%
Simplified67.8%
if 1.79999999999999993e150 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.0%
*-commutative97.0%
associate-*r*97.0%
distribute-rgt1-in97.0%
*-commutative97.0%
unpow297.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in im around inf 97.0%
*-commutative97.0%
unpow297.0%
Simplified97.0%
Final simplification79.7%
(FPCore (re im)
:precision binary64
(if (or (<= im 580.0) (not (<= im 2.8e+70)))
(*
(sin re)
(+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664)))))
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))))
double code(double re, double im) {
double tmp;
if ((im <= 580.0) || !(im <= 2.8e+70)) {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} 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 <= 580.0d0) .or. (.not. (im <= 2.8d+70))) then
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
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 <= 580.0) || !(im <= 2.8e+70)) {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 580.0) or not (im <= 2.8e+70): tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) else: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) return tmp
function code(re, im) tmp = 0.0 if ((im <= 580.0) || !(im <= 2.8e+70)) tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); else tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 580.0) || ~((im <= 2.8e+70))) tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); else tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 580.0], N[Not[LessEqual[im, 2.8e+70]], $MachinePrecision]], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 580 \lor \neg \left(im \leq 2.8 \cdot 10^{+70}\right):\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\end{array}
\end{array}
if im < 580 or 2.7999999999999999e70 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 91.5%
*-rgt-identity91.5%
*-commutative91.5%
associate-*r*91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt-out91.5%
distribute-lft-out91.5%
metadata-eval91.5%
pow-sqr91.5%
associate-*r*91.5%
distribute-rgt-out91.5%
unpow291.5%
unpow291.5%
Simplified91.5%
if 580 < im < 2.7999999999999999e70Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr31.5%
Taylor expanded in re around 0 50.8%
associate-*r/50.8%
metadata-eval50.8%
unpow250.8%
*-commutative50.8%
unpow250.8%
Simplified50.8%
Final simplification89.9%
(FPCore (re im)
:precision binary64
(if (<= im 660.0)
(sin re)
(if (<= im 1.02e+62)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))
(if (<= im 3.55e+193)
(* re (+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664)))))
(* 0.5 (* im (* (sin re) im)))))))
double code(double re, double im) {
double tmp;
if (im <= 660.0) {
tmp = sin(re);
} else if (im <= 1.02e+62) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 3.55e+193) {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = 0.5 * (im * (sin(re) * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 660.0d0) then
tmp = sin(re)
else if (im <= 1.02d+62) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + ((re * re) * 0.016666666666666666d0))
else if (im <= 3.55d+193) then
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
else
tmp = 0.5d0 * (im * (sin(re) * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 660.0) {
tmp = Math.sin(re);
} else if (im <= 1.02e+62) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 3.55e+193) {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = 0.5 * (im * (Math.sin(re) * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 660.0: tmp = math.sin(re) elif im <= 1.02e+62: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) elif im <= 3.55e+193: tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) else: tmp = 0.5 * (im * (math.sin(re) * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 660.0) tmp = sin(re); elseif (im <= 1.02e+62) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); elseif (im <= 3.55e+193) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); else tmp = Float64(0.5 * Float64(im * Float64(sin(re) * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 660.0) tmp = sin(re); elseif (im <= 1.02e+62) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); elseif (im <= 3.55e+193) tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); else tmp = 0.5 * (im * (sin(re) * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 660.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.02e+62], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.55e+193], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(im * N[(N[Sin[re], $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 660:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.02 \cdot 10^{+62}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\mathbf{elif}\;im \leq 3.55 \cdot 10^{+193}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(\sin re \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 660Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 65.5%
if 660 < im < 1.02000000000000002e62Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.9%
Taylor expanded in re around 0 56.4%
associate-*r/56.4%
metadata-eval56.4%
unpow256.4%
*-commutative56.4%
unpow256.4%
Simplified56.4%
if 1.02000000000000002e62 < im < 3.5499999999999999e193Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 93.6%
*-rgt-identity93.6%
*-commutative93.6%
associate-*r*93.6%
*-commutative93.6%
associate-*r*93.6%
distribute-rgt-out93.6%
distribute-lft-out93.6%
metadata-eval93.6%
pow-sqr93.6%
associate-*r*93.6%
distribute-rgt-out93.6%
unpow293.6%
unpow293.6%
Simplified93.6%
Taylor expanded in re around 0 69.0%
*-commutative69.0%
unpow269.0%
unpow269.0%
Simplified69.0%
if 3.5499999999999999e193 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt1-in100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*86.9%
Simplified86.9%
Final simplification67.3%
(FPCore (re im)
:precision binary64
(if (<= im 520.0)
(sin re)
(if (<= im 2.7e+61)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))
(if (<= im 1.8e+150)
(* re (+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664)))))
(* 0.5 (* (sin re) (* im im)))))))
double code(double re, double im) {
double tmp;
if (im <= 520.0) {
tmp = sin(re);
} else if (im <= 2.7e+61) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 1.8e+150) {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = 0.5 * (sin(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 <= 520.0d0) then
tmp = sin(re)
else if (im <= 2.7d+61) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + ((re * re) * 0.016666666666666666d0))
else if (im <= 1.8d+150) then
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
else
tmp = 0.5d0 * (sin(re) * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 520.0) {
tmp = Math.sin(re);
} else if (im <= 2.7e+61) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 1.8e+150) {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = 0.5 * (Math.sin(re) * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 520.0: tmp = math.sin(re) elif im <= 2.7e+61: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) elif im <= 1.8e+150: tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) else: tmp = 0.5 * (math.sin(re) * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 520.0) tmp = sin(re); elseif (im <= 2.7e+61) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); elseif (im <= 1.8e+150) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); else tmp = Float64(0.5 * Float64(sin(re) * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 520.0) tmp = sin(re); elseif (im <= 2.7e+61) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); elseif (im <= 1.8e+150) tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); else tmp = 0.5 * (sin(re) * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 520.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.7e+61], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.8e+150], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 520:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.7 \cdot 10^{+61}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\mathbf{elif}\;im \leq 1.8 \cdot 10^{+150}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 520Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 65.5%
if 520 < im < 2.7000000000000002e61Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.9%
Taylor expanded in re around 0 56.4%
associate-*r/56.4%
metadata-eval56.4%
unpow256.4%
*-commutative56.4%
unpow256.4%
Simplified56.4%
if 2.7000000000000002e61 < im < 1.79999999999999993e150Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 90.8%
*-rgt-identity90.8%
*-commutative90.8%
associate-*r*90.8%
*-commutative90.8%
associate-*r*90.8%
distribute-rgt-out90.8%
distribute-lft-out90.8%
metadata-eval90.8%
pow-sqr90.8%
associate-*r*90.8%
distribute-rgt-out90.8%
unpow290.8%
unpow290.8%
Simplified90.8%
Taylor expanded in re around 0 65.0%
*-commutative65.0%
unpow265.0%
unpow265.0%
Simplified65.0%
if 1.79999999999999993e150 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.0%
*-commutative97.0%
associate-*r*97.0%
distribute-rgt1-in97.0%
*-commutative97.0%
unpow297.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in im around inf 97.0%
*-commutative97.0%
unpow297.0%
Simplified97.0%
Final simplification68.8%
(FPCore (re im)
:precision binary64
(if (<= im 550.0)
(* (sin re) (+ (* im (* 0.5 im)) 1.0))
(if (<= im 2.7e+60)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))
(if (<= im 1.8e+150)
(* re (+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664)))))
(* 0.5 (* (sin re) (* im im)))))))
double code(double re, double im) {
double tmp;
if (im <= 550.0) {
tmp = sin(re) * ((im * (0.5 * im)) + 1.0);
} else if (im <= 2.7e+60) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 1.8e+150) {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = 0.5 * (sin(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 <= 550.0d0) then
tmp = sin(re) * ((im * (0.5d0 * im)) + 1.0d0)
else if (im <= 2.7d+60) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + ((re * re) * 0.016666666666666666d0))
else if (im <= 1.8d+150) then
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
else
tmp = 0.5d0 * (sin(re) * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 550.0) {
tmp = Math.sin(re) * ((im * (0.5 * im)) + 1.0);
} else if (im <= 2.7e+60) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 1.8e+150) {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = 0.5 * (Math.sin(re) * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 550.0: tmp = math.sin(re) * ((im * (0.5 * im)) + 1.0) elif im <= 2.7e+60: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) elif im <= 1.8e+150: tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) else: tmp = 0.5 * (math.sin(re) * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 550.0) tmp = Float64(sin(re) * Float64(Float64(im * Float64(0.5 * im)) + 1.0)); elseif (im <= 2.7e+60) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); elseif (im <= 1.8e+150) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); else tmp = Float64(0.5 * Float64(sin(re) * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 550.0) tmp = sin(re) * ((im * (0.5 * im)) + 1.0); elseif (im <= 2.7e+60) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); elseif (im <= 1.8e+150) tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); else tmp = 0.5 * (sin(re) * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 550.0], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * N[(0.5 * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.7e+60], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.8e+150], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sin[re], $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 550:\\
\;\;\;\;\sin re \cdot \left(im \cdot \left(0.5 \cdot im\right) + 1\right)\\
\mathbf{elif}\;im \leq 2.7 \cdot 10^{+60}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\mathbf{elif}\;im \leq 1.8 \cdot 10^{+150}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 550Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 78.6%
*-commutative78.6%
associate-*r*78.6%
distribute-rgt1-in78.6%
*-commutative78.6%
unpow278.6%
associate-*l*78.6%
Simplified78.6%
if 550 < im < 2.6999999999999999e60Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.9%
Taylor expanded in re around 0 56.4%
associate-*r/56.4%
metadata-eval56.4%
unpow256.4%
*-commutative56.4%
unpow256.4%
Simplified56.4%
if 2.6999999999999999e60 < im < 1.79999999999999993e150Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 90.8%
*-rgt-identity90.8%
*-commutative90.8%
associate-*r*90.8%
*-commutative90.8%
associate-*r*90.8%
distribute-rgt-out90.8%
distribute-lft-out90.8%
metadata-eval90.8%
pow-sqr90.8%
associate-*r*90.8%
distribute-rgt-out90.8%
unpow290.8%
unpow290.8%
Simplified90.8%
Taylor expanded in re around 0 65.0%
*-commutative65.0%
unpow265.0%
unpow265.0%
Simplified65.0%
if 1.79999999999999993e150 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.0%
*-commutative97.0%
associate-*r*97.0%
distribute-rgt1-in97.0%
*-commutative97.0%
unpow297.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in im around inf 97.0%
*-commutative97.0%
unpow297.0%
Simplified97.0%
Final simplification78.9%
(FPCore (re im)
:precision binary64
(if (<= im 820.0)
(sin re)
(if (<= im 3.5e+61)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))
(* re (+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664))))))))
double code(double re, double im) {
double tmp;
if (im <= 820.0) {
tmp = sin(re);
} else if (im <= 3.5e+61) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 820.0d0) then
tmp = sin(re)
else if (im <= 3.5d+61) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + ((re * re) * 0.016666666666666666d0))
else
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 820.0) {
tmp = Math.sin(re);
} else if (im <= 3.5e+61) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 820.0: tmp = math.sin(re) elif im <= 3.5e+61: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) else: tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) return tmp
function code(re, im) tmp = 0.0 if (im <= 820.0) tmp = sin(re); elseif (im <= 3.5e+61) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 820.0) tmp = sin(re); elseif (im <= 3.5e+61) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); else tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 820.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 3.5e+61], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 820:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 3.5 \cdot 10^{+61}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\end{array}
\end{array}
if im < 820Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 65.5%
if 820 < im < 3.50000000000000018e61Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.9%
Taylor expanded in re around 0 56.4%
associate-*r/56.4%
metadata-eval56.4%
unpow256.4%
*-commutative56.4%
unpow256.4%
Simplified56.4%
if 3.50000000000000018e61 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.3%
*-rgt-identity96.3%
*-commutative96.3%
associate-*r*96.3%
*-commutative96.3%
associate-*r*96.3%
distribute-rgt-out96.3%
distribute-lft-out96.3%
metadata-eval96.3%
pow-sqr96.3%
associate-*r*96.3%
distribute-rgt-out96.3%
unpow296.3%
unpow296.3%
Simplified96.3%
Taylor expanded in re around 0 68.0%
*-commutative68.0%
unpow268.0%
unpow268.0%
Simplified68.0%
Final simplification65.7%
(FPCore (re im)
:precision binary64
(if (or (<= im 340.0) (not (<= im 1.85e+61)))
(* re (+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664)))))
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))))
double code(double re, double im) {
double tmp;
if ((im <= 340.0) || !(im <= 1.85e+61)) {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} 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 <= 340.0d0) .or. (.not. (im <= 1.85d+61))) then
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
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 <= 340.0) || !(im <= 1.85e+61)) {
tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
} else {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 340.0) or not (im <= 1.85e+61): tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))) else: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) return tmp
function code(re, im) tmp = 0.0 if ((im <= 340.0) || !(im <= 1.85e+61)) tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))); else tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 340.0) || ~((im <= 1.85e+61))) tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664)))); else tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 340.0], N[Not[LessEqual[im, 1.85e+61]], $MachinePrecision]], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 340 \lor \neg \left(im \leq 1.85 \cdot 10^{+61}\right):\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\end{array}
\end{array}
if im < 340 or 1.85000000000000001e61 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 91.2%
*-rgt-identity91.2%
*-commutative91.2%
associate-*r*91.2%
*-commutative91.2%
associate-*r*91.2%
distribute-rgt-out91.2%
distribute-lft-out91.2%
metadata-eval91.2%
pow-sqr91.2%
associate-*r*91.2%
distribute-rgt-out91.2%
unpow291.2%
unpow291.2%
Simplified91.2%
Taylor expanded in re around 0 59.3%
*-commutative59.3%
unpow259.3%
unpow259.3%
Simplified59.3%
if 340 < im < 1.85000000000000001e61Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.9%
Taylor expanded in re around 0 56.4%
associate-*r/56.4%
metadata-eval56.4%
unpow256.4%
*-commutative56.4%
unpow256.4%
Simplified56.4%
Final simplification59.2%
(FPCore (re im)
:precision binary64
(if (or (<= im 650.0) (not (<= im 1.92e+146)))
(* re (+ 1.0 (* 0.5 (* im im))))
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))))
double code(double re, double im) {
double tmp;
if ((im <= 650.0) || !(im <= 1.92e+146)) {
tmp = re * (1.0 + (0.5 * (im * im)));
} 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 <= 650.0d0) .or. (.not. (im <= 1.92d+146))) then
tmp = re * (1.0d0 + (0.5d0 * (im * im)))
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 <= 650.0) || !(im <= 1.92e+146)) {
tmp = re * (1.0 + (0.5 * (im * im)));
} else {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 650.0) or not (im <= 1.92e+146): tmp = re * (1.0 + (0.5 * (im * im))) else: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) return tmp
function code(re, im) tmp = 0.0 if ((im <= 650.0) || !(im <= 1.92e+146)) tmp = Float64(re * Float64(1.0 + Float64(0.5 * Float64(im * im)))); else tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 650.0) || ~((im <= 1.92e+146))) tmp = re * (1.0 + (0.5 * (im * im))); else tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 650.0], N[Not[LessEqual[im, 1.92e+146]], $MachinePrecision]], N[(re * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 650 \lor \neg \left(im \leq 1.92 \cdot 10^{+146}\right):\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\end{array}
\end{array}
if im < 650 or 1.91999999999999993e146 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 80.4%
*-commutative80.4%
associate-*r*80.4%
distribute-rgt1-in80.4%
*-commutative80.4%
unpow280.4%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in re around 0 52.9%
*-commutative52.9%
unpow252.9%
Simplified52.9%
if 650 < im < 1.91999999999999993e146Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr16.7%
Taylor expanded in re around 0 38.1%
associate-*r/38.1%
metadata-eval38.1%
unpow238.1%
*-commutative38.1%
unpow238.1%
Simplified38.1%
Final simplification51.3%
(FPCore (re im) :precision binary64 (if (or (<= re 1.75e-286) (not (<= re 1.4e-193))) (* re (+ 1.0 (* 0.5 (* im im)))) (/ 0.25 (* re re))))
double code(double re, double im) {
double tmp;
if ((re <= 1.75e-286) || !(re <= 1.4e-193)) {
tmp = re * (1.0 + (0.5 * (im * im)));
} 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 ((re <= 1.75d-286) .or. (.not. (re <= 1.4d-193))) then
tmp = re * (1.0d0 + (0.5d0 * (im * im)))
else
tmp = 0.25d0 / (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((re <= 1.75e-286) || !(re <= 1.4e-193)) {
tmp = re * (1.0 + (0.5 * (im * im)));
} else {
tmp = 0.25 / (re * re);
}
return tmp;
}
def code(re, im): tmp = 0 if (re <= 1.75e-286) or not (re <= 1.4e-193): tmp = re * (1.0 + (0.5 * (im * im))) else: tmp = 0.25 / (re * re) return tmp
function code(re, im) tmp = 0.0 if ((re <= 1.75e-286) || !(re <= 1.4e-193)) tmp = Float64(re * Float64(1.0 + Float64(0.5 * Float64(im * im)))); else tmp = Float64(0.25 / Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((re <= 1.75e-286) || ~((re <= 1.4e-193))) tmp = re * (1.0 + (0.5 * (im * im))); else tmp = 0.25 / (re * re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[re, 1.75e-286], N[Not[LessEqual[re, 1.4e-193]], $MachinePrecision]], N[(re * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.75 \cdot 10^{-286} \lor \neg \left(re \leq 1.4 \cdot 10^{-193}\right):\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\
\end{array}
\end{array}
if re < 1.74999999999999994e-286 or 1.4000000000000001e-193 < re Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 74.1%
*-commutative74.1%
associate-*r*74.1%
distribute-rgt1-in74.1%
*-commutative74.1%
unpow274.1%
associate-*l*74.1%
Simplified74.1%
Taylor expanded in re around 0 47.9%
*-commutative47.9%
unpow247.9%
Simplified47.9%
if 1.74999999999999994e-286 < re < 1.4000000000000001e-193Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr81.3%
Taylor expanded in re around 0 81.3%
unpow281.3%
Simplified81.3%
Final simplification50.6%
(FPCore (re im) :precision binary64 (if (<= im 780000000000.0) re (if (<= im 1.16e+73) (/ 0.25 (* re re)) (* 0.5 (* im (* re im))))))
double code(double re, double im) {
double tmp;
if (im <= 780000000000.0) {
tmp = re;
} else if (im <= 1.16e+73) {
tmp = 0.25 / (re * re);
} else {
tmp = 0.5 * (im * (re * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 780000000000.0d0) then
tmp = re
else if (im <= 1.16d+73) then
tmp = 0.25d0 / (re * re)
else
tmp = 0.5d0 * (im * (re * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 780000000000.0) {
tmp = re;
} else if (im <= 1.16e+73) {
tmp = 0.25 / (re * re);
} else {
tmp = 0.5 * (im * (re * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 780000000000.0: tmp = re elif im <= 1.16e+73: tmp = 0.25 / (re * re) else: tmp = 0.5 * (im * (re * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 780000000000.0) tmp = re; elseif (im <= 1.16e+73) tmp = Float64(0.25 / Float64(re * re)); else tmp = Float64(0.5 * Float64(im * Float64(re * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 780000000000.0) tmp = re; elseif (im <= 1.16e+73) tmp = 0.25 / (re * re); else tmp = 0.5 * (im * (re * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 780000000000.0], re, If[LessEqual[im, 1.16e+73], N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(im * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 780000000000:\\
\;\;\;\;re\\
\mathbf{elif}\;im \leq 1.16 \cdot 10^{+73}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 7.8e11Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 63.3%
associate-*r*63.3%
Simplified63.3%
Taylor expanded in im around 0 38.1%
if 7.8e11 < im < 1.16000000000000007e73Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.4%
Taylor expanded in re around 0 34.4%
unpow234.4%
Simplified34.4%
if 1.16000000000000007e73 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 62.7%
*-commutative62.7%
associate-*r*62.7%
distribute-rgt1-in62.7%
*-commutative62.7%
unpow262.7%
associate-*l*62.7%
Simplified62.7%
Taylor expanded in im around inf 62.7%
*-commutative62.7%
unpow262.7%
associate-*l*51.1%
Simplified51.1%
Taylor expanded in re around 0 37.2%
Final simplification37.8%
(FPCore (re im) :precision binary64 (if (<= im 780000000000.0) re (if (<= im 5.4e+71) (/ 0.25 (* re re)) (* 0.5 (* re (* im im))))))
double code(double re, double im) {
double tmp;
if (im <= 780000000000.0) {
tmp = re;
} else if (im <= 5.4e+71) {
tmp = 0.25 / (re * 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 <= 780000000000.0d0) then
tmp = re
else if (im <= 5.4d+71) then
tmp = 0.25d0 / (re * 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 <= 780000000000.0) {
tmp = re;
} else if (im <= 5.4e+71) {
tmp = 0.25 / (re * re);
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 780000000000.0: tmp = re elif im <= 5.4e+71: tmp = 0.25 / (re * re) else: tmp = 0.5 * (re * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 780000000000.0) tmp = re; elseif (im <= 5.4e+71) tmp = Float64(0.25 / Float64(re * 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 <= 780000000000.0) tmp = re; elseif (im <= 5.4e+71) tmp = 0.25 / (re * re); else tmp = 0.5 * (re * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 780000000000.0], re, If[LessEqual[im, 5.4e+71], N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 780000000000:\\
\;\;\;\;re\\
\mathbf{elif}\;im \leq 5.4 \cdot 10^{+71}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 7.8e11Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 63.3%
associate-*r*63.3%
Simplified63.3%
Taylor expanded in im around 0 38.1%
if 7.8e11 < im < 5.39999999999999993e71Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.4%
Taylor expanded in re around 0 34.4%
unpow234.4%
Simplified34.4%
if 5.39999999999999993e71 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 62.7%
*-commutative62.7%
associate-*r*62.7%
distribute-rgt1-in62.7%
*-commutative62.7%
unpow262.7%
associate-*l*62.7%
Simplified62.7%
Taylor expanded in im around inf 62.7%
*-commutative62.7%
unpow262.7%
associate-*l*51.1%
Simplified51.1%
Taylor expanded in re around 0 48.8%
unpow248.8%
Simplified48.8%
Final simplification40.0%
(FPCore (re im) :precision binary64 (if (<= im 700000000000.0) re (if (<= im 1.8e+71) (* (/ 0.5 re) (/ 0.5 re)) (* 0.5 (* re (* im im))))))
double code(double re, double im) {
double tmp;
if (im <= 700000000000.0) {
tmp = re;
} else if (im <= 1.8e+71) {
tmp = (0.5 / re) * (0.5 / 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 <= 700000000000.0d0) then
tmp = re
else if (im <= 1.8d+71) then
tmp = (0.5d0 / re) * (0.5d0 / 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 <= 700000000000.0) {
tmp = re;
} else if (im <= 1.8e+71) {
tmp = (0.5 / re) * (0.5 / re);
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 700000000000.0: tmp = re elif im <= 1.8e+71: tmp = (0.5 / re) * (0.5 / re) else: tmp = 0.5 * (re * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 700000000000.0) tmp = re; elseif (im <= 1.8e+71) tmp = Float64(Float64(0.5 / re) * Float64(0.5 / 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 <= 700000000000.0) tmp = re; elseif (im <= 1.8e+71) tmp = (0.5 / re) * (0.5 / re); else tmp = 0.5 * (re * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 700000000000.0], re, If[LessEqual[im, 1.8e+71], N[(N[(0.5 / re), $MachinePrecision] * N[(0.5 / re), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 700000000000:\\
\;\;\;\;re\\
\mathbf{elif}\;im \leq 1.8 \cdot 10^{+71}:\\
\;\;\;\;\frac{0.5}{re} \cdot \frac{0.5}{re}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 7e11Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 63.3%
associate-*r*63.3%
Simplified63.3%
Taylor expanded in im around 0 38.1%
if 7e11 < im < 1.8e71Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr34.4%
Taylor expanded in re around 0 34.4%
unpow234.4%
Simplified34.4%
add-sqr-sqrt34.4%
sqrt-div34.4%
metadata-eval34.4%
sqrt-prod34.3%
add-sqr-sqrt45.6%
sqrt-div45.6%
metadata-eval45.6%
sqrt-prod34.3%
add-sqr-sqrt34.4%
Applied egg-rr34.4%
if 1.8e71 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 62.7%
*-commutative62.7%
associate-*r*62.7%
distribute-rgt1-in62.7%
*-commutative62.7%
unpow262.7%
associate-*l*62.7%
Simplified62.7%
Taylor expanded in im around inf 62.7%
*-commutative62.7%
unpow262.7%
associate-*l*51.1%
Simplified51.1%
Taylor expanded in re around 0 48.8%
unpow248.8%
Simplified48.8%
Final simplification40.0%
(FPCore (re im) :precision binary64 (if (<= im 700000000000.0) re (/ 0.25 (* re re))))
double code(double re, double im) {
double tmp;
if (im <= 700000000000.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 <= 700000000000.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 <= 700000000000.0) {
tmp = re;
} else {
tmp = 0.25 / (re * re);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 700000000000.0: tmp = re else: tmp = 0.25 / (re * re) return tmp
function code(re, im) tmp = 0.0 if (im <= 700000000000.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 <= 700000000000.0) tmp = re; else tmp = 0.25 / (re * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 700000000000.0], re, N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 700000000000:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\
\end{array}
\end{array}
if im < 7e11Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 63.3%
associate-*r*63.3%
Simplified63.3%
Taylor expanded in im around 0 38.1%
if 7e11 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr16.0%
Taylor expanded in re around 0 15.8%
unpow215.8%
Simplified15.8%
Final simplification33.1%
(FPCore (re im) :precision binary64 -512.0)
double code(double re, double im) {
return -512.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -512.0d0
end function
public static double code(double re, double im) {
return -512.0;
}
def code(re, im): return -512.0
function code(re, im) return -512.0 end
function tmp = code(re, im) tmp = -512.0; end
code[re_, im_] := -512.0
\begin{array}{l}
\\
-512
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.1%
*-rgt-identity88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
pow-sqr88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Applied egg-rr3.4%
Final simplification3.4%
(FPCore (re im) :precision binary64 -1.0)
double code(double re, double im) {
return -1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -1.0d0
end function
public static double code(double re, double im) {
return -1.0;
}
def code(re, im): return -1.0
function code(re, im) return -1.0 end
function tmp = code(re, im) tmp = -1.0; end
code[re_, im_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.1%
*-rgt-identity88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
pow-sqr88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Applied egg-rr4.1%
Final simplification4.1%
(FPCore (re im) :precision binary64 -0.5)
double code(double re, double im) {
return -0.5;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -0.5d0
end function
public static double code(double re, double im) {
return -0.5;
}
def code(re, im): return -0.5
function code(re, im) return -0.5 end
function tmp = code(re, im) tmp = -0.5; end
code[re_, im_] := -0.5
\begin{array}{l}
\\
-0.5
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.1%
*-rgt-identity88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
pow-sqr88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Applied egg-rr4.1%
Final simplification4.1%
(FPCore (re im) :precision binary64 0.015625)
double code(double re, double im) {
return 0.015625;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.015625d0
end function
public static double code(double re, double im) {
return 0.015625;
}
def code(re, im): return 0.015625
function code(re, im) return 0.015625 end
function tmp = code(re, im) tmp = 0.015625; end
code[re_, im_] := 0.015625
\begin{array}{l}
\\
0.015625
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.1%
*-rgt-identity88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
pow-sqr88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Applied egg-rr4.2%
Final simplification4.2%
(FPCore (re im) :precision binary64 0.125)
double code(double re, double im) {
return 0.125;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.125d0
end function
public static double code(double re, double im) {
return 0.125;
}
def code(re, im): return 0.125
function code(re, im) return 0.125 end
function tmp = code(re, im) tmp = 0.125; end
code[re_, im_] := 0.125
\begin{array}{l}
\\
0.125
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.1%
*-rgt-identity88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
pow-sqr88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Applied egg-rr4.4%
Final simplification4.4%
(FPCore (re im) :precision binary64 0.25)
double code(double re, double im) {
return 0.25;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.25d0
end function
public static double code(double re, double im) {
return 0.25;
}
def code(re, im): return 0.25
function code(re, im) return 0.25 end
function tmp = code(re, im) tmp = 0.25; end
code[re_, im_] := 0.25
\begin{array}{l}
\\
0.25
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.1%
*-rgt-identity88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
pow-sqr88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Applied egg-rr4.6%
Final simplification4.6%
(FPCore (re im) :precision binary64 0.5)
double code(double re, double im) {
return 0.5;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.5d0
end function
public static double code(double re, double im) {
return 0.5;
}
def code(re, im): return 0.5
function code(re, im) return 0.5 end
function tmp = code(re, im) tmp = 0.5; end
code[re_, im_] := 0.5
\begin{array}{l}
\\
0.5
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.1%
*-rgt-identity88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
pow-sqr88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Applied egg-rr4.7%
Final simplification4.7%
(FPCore (re im) :precision binary64 1.0)
double code(double re, double im) {
return 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0
end function
public static double code(double re, double im) {
return 1.0;
}
def code(re, im): return 1.0
function code(re, im) return 1.0 end
function tmp = code(re, im) tmp = 1.0; end
code[re_, im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.1%
*-rgt-identity88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
pow-sqr88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Applied egg-rr4.8%
Final simplification4.8%
(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%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 64.8%
associate-*r*64.8%
Simplified64.8%
Taylor expanded in im around 0 30.2%
Final simplification30.2%
herbie shell --seed 2023189
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))