
(FPCore (re im) :precision binary64 (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * cos(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 * cos(re)) * (exp((0.0d0 - im)) - exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
}
def code(re, im): return (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im))
function code(re, im) return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Cos[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 \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * cos(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 * cos(re)) * (exp((0.0d0 - im)) - exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
}
def code(re, im): return (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im))
function code(re, im) return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Cos[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 \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)
\end{array}
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 -0.2) (not (<= t_0 2e-6)))
(* (* 0.5 (cos re)) t_0)
(* (cos re) (- (* (pow im 3.0) -0.16666666666666666) im)))))
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -0.2) || !(t_0 <= 2e-6)) {
tmp = (0.5 * cos(re)) * t_0;
} else {
tmp = cos(re) * ((pow(im, 3.0) * -0.16666666666666666) - 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 = exp(-im) - exp(im)
if ((t_0 <= (-0.2d0)) .or. (.not. (t_0 <= 2d-6))) then
tmp = (0.5d0 * cos(re)) * t_0
else
tmp = cos(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_0 <= -0.2) || !(t_0 <= 2e-6)) {
tmp = (0.5 * Math.cos(re)) * t_0;
} else {
tmp = Math.cos(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
}
return tmp;
}
def code(re, im): t_0 = math.exp(-im) - math.exp(im) tmp = 0 if (t_0 <= -0.2) or not (t_0 <= 2e-6): tmp = (0.5 * math.cos(re)) * t_0 else: tmp = math.cos(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) return tmp
function code(re, im) t_0 = Float64(exp(Float64(-im)) - exp(im)) tmp = 0.0 if ((t_0 <= -0.2) || !(t_0 <= 2e-6)) tmp = Float64(Float64(0.5 * cos(re)) * t_0); else tmp = Float64(cos(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(-im) - exp(im); tmp = 0.0; if ((t_0 <= -0.2) || ~((t_0 <= 2e-6))) tmp = (0.5 * cos(re)) * t_0; else tmp = cos(re) * (((im ^ 3.0) * -0.16666666666666666) - im); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -0.2], N[Not[LessEqual[t$95$0, 2e-6]], $MachinePrecision]], N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -0.2 \lor \neg \left(t_0 \leq 2 \cdot 10^{-6}\right):\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) < -0.20000000000000001 or 1.99999999999999991e-6 < (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
if -0.20000000000000001 < (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) < 1.99999999999999991e-6Initial program 7.9%
neg-sub07.9%
Simplified7.9%
Taylor expanded in im around 0 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
associate-*r*99.9%
distribute-rgt-out--99.9%
*-commutative99.9%
Simplified99.9%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(let* ((t_0
(/
(*
(cos re)
(/
(- 68719476736.0 (* (* im im) (* im im)))
(+ (* im im) 262144.0)))
(+ im -512.0)))
(t_1 (/ (* (cos re) (- (* im im))) (+ im -512.0)))
(t_2 (* 0.5 (- (exp (- im)) (exp im)))))
(if (<= im -1.35e+154)
t_1
(if (<= im -1.15e+77)
t_0
(if (<= im -0.00195)
t_2
(if (<= im 235000000000.0)
(- (* im (cos re)))
(if (<= im 1.15e+77) t_2 (if (<= im 1.4e+154) t_0 t_1))))))))
double code(double re, double im) {
double t_0 = (cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0);
double t_1 = (cos(re) * -(im * im)) / (im + -512.0);
double t_2 = 0.5 * (exp(-im) - exp(im));
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -1.15e+77) {
tmp = t_0;
} else if (im <= -0.00195) {
tmp = t_2;
} else if (im <= 235000000000.0) {
tmp = -(im * cos(re));
} else if (im <= 1.15e+77) {
tmp = t_2;
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (cos(re) * ((68719476736.0d0 - ((im * im) * (im * im))) / ((im * im) + 262144.0d0))) / (im + (-512.0d0))
t_1 = (cos(re) * -(im * im)) / (im + (-512.0d0))
t_2 = 0.5d0 * (exp(-im) - exp(im))
if (im <= (-1.35d+154)) then
tmp = t_1
else if (im <= (-1.15d+77)) then
tmp = t_0
else if (im <= (-0.00195d0)) then
tmp = t_2
else if (im <= 235000000000.0d0) then
tmp = -(im * cos(re))
else if (im <= 1.15d+77) then
tmp = t_2
else if (im <= 1.4d+154) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (Math.cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0);
double t_1 = (Math.cos(re) * -(im * im)) / (im + -512.0);
double t_2 = 0.5 * (Math.exp(-im) - Math.exp(im));
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -1.15e+77) {
tmp = t_0;
} else if (im <= -0.00195) {
tmp = t_2;
} else if (im <= 235000000000.0) {
tmp = -(im * Math.cos(re));
} else if (im <= 1.15e+77) {
tmp = t_2;
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = (math.cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0) t_1 = (math.cos(re) * -(im * im)) / (im + -512.0) t_2 = 0.5 * (math.exp(-im) - math.exp(im)) tmp = 0 if im <= -1.35e+154: tmp = t_1 elif im <= -1.15e+77: tmp = t_0 elif im <= -0.00195: tmp = t_2 elif im <= 235000000000.0: tmp = -(im * math.cos(re)) elif im <= 1.15e+77: tmp = t_2 elif im <= 1.4e+154: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(Float64(cos(re) * Float64(Float64(68719476736.0 - Float64(Float64(im * im) * Float64(im * im))) / Float64(Float64(im * im) + 262144.0))) / Float64(im + -512.0)) t_1 = Float64(Float64(cos(re) * Float64(-Float64(im * im))) / Float64(im + -512.0)) t_2 = Float64(0.5 * Float64(exp(Float64(-im)) - exp(im))) tmp = 0.0 if (im <= -1.35e+154) tmp = t_1; elseif (im <= -1.15e+77) tmp = t_0; elseif (im <= -0.00195) tmp = t_2; elseif (im <= 235000000000.0) tmp = Float64(-Float64(im * cos(re))); elseif (im <= 1.15e+77) tmp = t_2; elseif (im <= 1.4e+154) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = (cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0); t_1 = (cos(re) * -(im * im)) / (im + -512.0); t_2 = 0.5 * (exp(-im) - exp(im)); tmp = 0.0; if (im <= -1.35e+154) tmp = t_1; elseif (im <= -1.15e+77) tmp = t_0; elseif (im <= -0.00195) tmp = t_2; elseif (im <= 235000000000.0) tmp = -(im * cos(re)); elseif (im <= 1.15e+77) tmp = t_2; elseif (im <= 1.4e+154) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Cos[re], $MachinePrecision] * N[(N[(68719476736.0 - N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(im * im), $MachinePrecision] + 262144.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Cos[re], $MachinePrecision] * (-N[(im * im), $MachinePrecision])), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$1, If[LessEqual[im, -1.15e+77], t$95$0, If[LessEqual[im, -0.00195], t$95$2, If[LessEqual[im, 235000000000.0], (-N[(im * N[Cos[re], $MachinePrecision]), $MachinePrecision]), If[LessEqual[im, 1.15e+77], t$95$2, If[LessEqual[im, 1.4e+154], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cos re \cdot \frac{68719476736 - \left(im \cdot im\right) \cdot \left(im \cdot im\right)}{im \cdot im + 262144}}{im + -512}\\
t_1 := \frac{\cos re \cdot \left(-im \cdot im\right)}{im + -512}\\
t_2 := 0.5 \cdot \left(e^{-im} - e^{im}\right)\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -1.15 \cdot 10^{+77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -0.00195:\\
\;\;\;\;t_2\\
\mathbf{elif}\;im \leq 235000000000:\\
\;\;\;\;-im \cdot \cos re\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.4e154 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.6%
*-commutative7.6%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in im around inf 100.0%
unpow2100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -1.14999999999999997e77 or 1.14999999999999997e77 < im < 1.4e154Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 59.6%
+-commutative59.6%
mul-1-neg59.6%
unsub-neg59.6%
associate-*r*59.6%
distribute-rgt-out--59.6%
*-commutative59.6%
Simplified59.6%
Applied egg-rr4.2%
*-commutative4.2%
flip--4.2%
associate-*l/4.2%
metadata-eval4.2%
+-commutative4.2%
Applied egg-rr4.2%
sub-neg4.2%
flip-+100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if -1.14999999999999997e77 < im < -0.0019499999999999999 or 2.35e11 < im < 1.14999999999999997e77Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 73.7%
if -0.0019499999999999999 < im < 2.35e11Initial program 9.3%
neg-sub09.3%
Simplified9.3%
Taylor expanded in im around 0 98.5%
associate-*r*98.5%
neg-mul-198.5%
Simplified98.5%
Final simplification95.3%
(FPCore (re im)
:precision binary64
(if (or (<= im -1e+113)
(not
(or (<= im -0.07)
(and (not (<= im 235000000000.0)) (<= im 2.25e+101)))))
(* (cos re) (- (* (pow im 3.0) -0.16666666666666666) im))
(* 0.5 (- (exp (- im)) (exp im)))))
double code(double re, double im) {
double tmp;
if ((im <= -1e+113) || !((im <= -0.07) || (!(im <= 235000000000.0) && (im <= 2.25e+101)))) {
tmp = cos(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
} else {
tmp = 0.5 * (exp(-im) - exp(im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-1d+113)) .or. (.not. (im <= (-0.07d0)) .or. (.not. (im <= 235000000000.0d0)) .and. (im <= 2.25d+101))) then
tmp = cos(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
else
tmp = 0.5d0 * (exp(-im) - exp(im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -1e+113) || !((im <= -0.07) || (!(im <= 235000000000.0) && (im <= 2.25e+101)))) {
tmp = Math.cos(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
} else {
tmp = 0.5 * (Math.exp(-im) - Math.exp(im));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -1e+113) or not ((im <= -0.07) or (not (im <= 235000000000.0) and (im <= 2.25e+101))): tmp = math.cos(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) else: tmp = 0.5 * (math.exp(-im) - math.exp(im)) return tmp
function code(re, im) tmp = 0.0 if ((im <= -1e+113) || !((im <= -0.07) || (!(im <= 235000000000.0) && (im <= 2.25e+101)))) tmp = Float64(cos(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); else tmp = Float64(0.5 * Float64(exp(Float64(-im)) - exp(im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -1e+113) || ~(((im <= -0.07) || (~((im <= 235000000000.0)) && (im <= 2.25e+101))))) tmp = cos(re) * (((im ^ 3.0) * -0.16666666666666666) - im); else tmp = 0.5 * (exp(-im) - exp(im)); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -1e+113], N[Not[Or[LessEqual[im, -0.07], And[N[Not[LessEqual[im, 235000000000.0]], $MachinePrecision], LessEqual[im, 2.25e+101]]]], $MachinePrecision]], N[(N[Cos[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1 \cdot 10^{+113} \lor \neg \left(im \leq -0.07 \lor \neg \left(im \leq 235000000000\right) \land im \leq 2.25 \cdot 10^{+101}\right):\\
\;\;\;\;\cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(e^{-im} - e^{im}\right)\\
\end{array}
\end{array}
if im < -1e113 or -0.070000000000000007 < im < 2.35e11 or 2.2500000000000001e101 < im Initial program 42.7%
neg-sub042.7%
Simplified42.7%
Taylor expanded in im around 0 98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
associate-*r*98.7%
distribute-rgt-out--98.7%
*-commutative98.7%
Simplified98.7%
if -1e113 < im < -0.070000000000000007 or 2.35e11 < im < 2.2500000000000001e101Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 74.5%
Final simplification93.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im)))
(t_1 (* (cos re) (- (* (pow im 3.0) -0.16666666666666666) im))))
(if (<= im -5.7e+102)
t_1
(if (<= im -1000.0)
(* t_0 (+ 0.5 (* -0.25 (* re re))))
(if (or (<= im 235000000000.0) (not (<= im 2.25e+101)))
t_1
(* 0.5 t_0))))))
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double t_1 = cos(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -5.7e+102) {
tmp = t_1;
} else if (im <= -1000.0) {
tmp = t_0 * (0.5 + (-0.25 * (re * re)));
} else if ((im <= 235000000000.0) || !(im <= 2.25e+101)) {
tmp = t_1;
} else {
tmp = 0.5 * t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(-im) - exp(im)
t_1 = cos(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
if (im <= (-5.7d+102)) then
tmp = t_1
else if (im <= (-1000.0d0)) then
tmp = t_0 * (0.5d0 + ((-0.25d0) * (re * re)))
else if ((im <= 235000000000.0d0) .or. (.not. (im <= 2.25d+101))) then
tmp = t_1
else
tmp = 0.5d0 * t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double t_1 = Math.cos(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
double tmp;
if (im <= -5.7e+102) {
tmp = t_1;
} else if (im <= -1000.0) {
tmp = t_0 * (0.5 + (-0.25 * (re * re)));
} else if ((im <= 235000000000.0) || !(im <= 2.25e+101)) {
tmp = t_1;
} else {
tmp = 0.5 * t_0;
}
return tmp;
}
def code(re, im): t_0 = math.exp(-im) - math.exp(im) t_1 = math.cos(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) tmp = 0 if im <= -5.7e+102: tmp = t_1 elif im <= -1000.0: tmp = t_0 * (0.5 + (-0.25 * (re * re))) elif (im <= 235000000000.0) or not (im <= 2.25e+101): tmp = t_1 else: tmp = 0.5 * t_0 return tmp
function code(re, im) t_0 = Float64(exp(Float64(-im)) - exp(im)) t_1 = Float64(cos(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) tmp = 0.0 if (im <= -5.7e+102) tmp = t_1; elseif (im <= -1000.0) tmp = Float64(t_0 * Float64(0.5 + Float64(-0.25 * Float64(re * re)))); elseif ((im <= 235000000000.0) || !(im <= 2.25e+101)) tmp = t_1; else tmp = Float64(0.5 * t_0); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(-im) - exp(im); t_1 = cos(re) * (((im ^ 3.0) * -0.16666666666666666) - im); tmp = 0.0; if (im <= -5.7e+102) tmp = t_1; elseif (im <= -1000.0) tmp = t_0 * (0.5 + (-0.25 * (re * re))); elseif ((im <= 235000000000.0) || ~((im <= 2.25e+101))) tmp = t_1; else tmp = 0.5 * t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -5.7e+102], t$95$1, If[LessEqual[im, -1000.0], N[(t$95$0 * N[(0.5 + N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[im, 235000000000.0], N[Not[LessEqual[im, 2.25e+101]], $MachinePrecision]], t$95$1, N[(0.5 * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
t_1 := \cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -1000:\\
\;\;\;\;t_0 \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)\\
\mathbf{elif}\;im \leq 235000000000 \lor \neg \left(im \leq 2.25 \cdot 10^{+101}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot t_0\\
\end{array}
\end{array}
if im < -5.6999999999999999e102 or -1e3 < im < 2.35e11 or 2.2500000000000001e101 < im Initial program 43.5%
neg-sub043.5%
Simplified43.5%
Taylor expanded in im around 0 98.3%
+-commutative98.3%
mul-1-neg98.3%
unsub-neg98.3%
associate-*r*98.3%
distribute-rgt-out--98.3%
*-commutative98.3%
Simplified98.3%
if -5.6999999999999999e102 < im < -1e3Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
+-commutative0.0%
associate-*r*0.0%
distribute-rgt-out87.0%
unpow287.0%
Simplified87.0%
if 2.35e11 < im < 2.2500000000000001e101Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 79.3%
Final simplification95.1%
(FPCore (re im)
:precision binary64
(let* ((t_0
(/
(*
(cos re)
(/
(- 68719476736.0 (* (* im im) (* im im)))
(+ (* im im) 262144.0)))
(+ im -512.0)))
(t_1 (/ (* (cos re) (- (* im im))) (+ im -512.0))))
(if (<= im -1.35e+154)
t_1
(if (<= im -8e+76)
t_0
(if (<= im -1000.0)
(*
(+ (* re (* re -0.5)) 1.0)
(- (* (pow im 3.0) -0.16666666666666666) im))
(if (<= im 750000000000.0)
(- (* im (cos re)))
(if (<= im 1.15e+77)
(log1p (expm1 (* re (* re -6.75))))
(if (<= im 1.4e+154) t_0 t_1))))))))
double code(double re, double im) {
double t_0 = (cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0);
double t_1 = (cos(re) * -(im * im)) / (im + -512.0);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -8e+76) {
tmp = t_0;
} else if (im <= -1000.0) {
tmp = ((re * (re * -0.5)) + 1.0) * ((pow(im, 3.0) * -0.16666666666666666) - im);
} else if (im <= 750000000000.0) {
tmp = -(im * cos(re));
} else if (im <= 1.15e+77) {
tmp = log1p(expm1((re * (re * -6.75))));
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = (Math.cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0);
double t_1 = (Math.cos(re) * -(im * im)) / (im + -512.0);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -8e+76) {
tmp = t_0;
} else if (im <= -1000.0) {
tmp = ((re * (re * -0.5)) + 1.0) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
} else if (im <= 750000000000.0) {
tmp = -(im * Math.cos(re));
} else if (im <= 1.15e+77) {
tmp = Math.log1p(Math.expm1((re * (re * -6.75))));
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = (math.cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0) t_1 = (math.cos(re) * -(im * im)) / (im + -512.0) tmp = 0 if im <= -1.35e+154: tmp = t_1 elif im <= -8e+76: tmp = t_0 elif im <= -1000.0: tmp = ((re * (re * -0.5)) + 1.0) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) elif im <= 750000000000.0: tmp = -(im * math.cos(re)) elif im <= 1.15e+77: tmp = math.log1p(math.expm1((re * (re * -6.75)))) elif im <= 1.4e+154: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(Float64(cos(re) * Float64(Float64(68719476736.0 - Float64(Float64(im * im) * Float64(im * im))) / Float64(Float64(im * im) + 262144.0))) / Float64(im + -512.0)) t_1 = Float64(Float64(cos(re) * Float64(-Float64(im * im))) / Float64(im + -512.0)) tmp = 0.0 if (im <= -1.35e+154) tmp = t_1; elseif (im <= -8e+76) tmp = t_0; elseif (im <= -1000.0) tmp = Float64(Float64(Float64(re * Float64(re * -0.5)) + 1.0) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); elseif (im <= 750000000000.0) tmp = Float64(-Float64(im * cos(re))); elseif (im <= 1.15e+77) tmp = log1p(expm1(Float64(re * Float64(re * -6.75)))); elseif (im <= 1.4e+154) tmp = t_0; else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Cos[re], $MachinePrecision] * N[(N[(68719476736.0 - N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(im * im), $MachinePrecision] + 262144.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Cos[re], $MachinePrecision] * (-N[(im * im), $MachinePrecision])), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$1, If[LessEqual[im, -8e+76], t$95$0, If[LessEqual[im, -1000.0], N[(N[(N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 750000000000.0], (-N[(im * N[Cos[re], $MachinePrecision]), $MachinePrecision]), If[LessEqual[im, 1.15e+77], N[Log[1 + N[(Exp[N[(re * N[(re * -6.75), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 1.4e+154], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cos re \cdot \frac{68719476736 - \left(im \cdot im\right) \cdot \left(im \cdot im\right)}{im \cdot im + 262144}}{im + -512}\\
t_1 := \frac{\cos re \cdot \left(-im \cdot im\right)}{im + -512}\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -8 \cdot 10^{+76}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -1000:\\
\;\;\;\;\left(re \cdot \left(re \cdot -0.5\right) + 1\right) \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{elif}\;im \leq 750000000000:\\
\;\;\;\;-im \cdot \cos re\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot \left(re \cdot -6.75\right)\right)\right)\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.4e154 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.6%
*-commutative7.6%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in im around inf 100.0%
unpow2100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -8.0000000000000004e76 or 1.14999999999999997e77 < im < 1.4e154Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 58.1%
+-commutative58.1%
mul-1-neg58.1%
unsub-neg58.1%
associate-*r*58.1%
distribute-rgt-out--58.1%
*-commutative58.1%
Simplified58.1%
Applied egg-rr4.2%
*-commutative4.2%
flip--4.2%
associate-*l/4.2%
metadata-eval4.2%
+-commutative4.2%
Applied egg-rr4.2%
sub-neg4.2%
flip-+97.4%
metadata-eval97.4%
Applied egg-rr97.4%
if -8.0000000000000004e76 < im < -1e3Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 4.2%
+-commutative4.2%
mul-1-neg4.2%
unsub-neg4.2%
associate-*r*4.2%
distribute-rgt-out--4.2%
*-commutative4.2%
Simplified4.2%
Taylor expanded in re around 0 38.4%
associate--l+38.4%
associate-*r*38.4%
distribute-lft1-in38.4%
unpow238.4%
associate-*r*38.4%
Simplified38.4%
if -1e3 < im < 7.5e11Initial program 10.7%
neg-sub010.7%
Simplified10.7%
Taylor expanded in im around 0 97.0%
associate-*r*97.0%
neg-mul-197.0%
Simplified97.0%
if 7.5e11 < im < 1.14999999999999997e77Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
+-commutative0.0%
associate-*r*0.0%
distribute-rgt-out57.1%
unpow257.1%
Simplified57.1%
Applied egg-rr20.4%
Taylor expanded in re around inf 20.9%
unpow220.9%
*-commutative20.9%
associate-*l*20.9%
Simplified20.9%
log1p-expm1-u43.6%
Applied egg-rr43.6%
Final simplification90.1%
(FPCore (re im)
:precision binary64
(let* ((t_0
(/
(*
(cos re)
(/
(- 68719476736.0 (* (* im im) (* im im)))
(+ (* im im) 262144.0)))
(+ im -512.0)))
(t_1 (/ (* (cos re) (- (* im im))) (+ im -512.0))))
(if (<= im -1.35e+154)
t_1
(if (<= im -8e+76)
t_0
(if (<= im -1000.0)
(*
(+ (* re (* re -0.5)) 1.0)
(- (* (pow im 3.0) -0.16666666666666666) im))
(if (<= im 750000000000.0)
(- (* im (cos re)))
(if (<= im 1.15e+77)
(-
(* (* re re) (* im (+ 0.5 (* (* re re) -0.041666666666666664))))
im)
(if (<= im 1.4e+154) t_0 t_1))))))))
double code(double re, double im) {
double t_0 = (cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0);
double t_1 = (cos(re) * -(im * im)) / (im + -512.0);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -8e+76) {
tmp = t_0;
} else if (im <= -1000.0) {
tmp = ((re * (re * -0.5)) + 1.0) * ((pow(im, 3.0) * -0.16666666666666666) - im);
} else if (im <= 750000000000.0) {
tmp = -(im * cos(re));
} else if (im <= 1.15e+77) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (cos(re) * ((68719476736.0d0 - ((im * im) * (im * im))) / ((im * im) + 262144.0d0))) / (im + (-512.0d0))
t_1 = (cos(re) * -(im * im)) / (im + (-512.0d0))
if (im <= (-1.35d+154)) then
tmp = t_1
else if (im <= (-8d+76)) then
tmp = t_0
else if (im <= (-1000.0d0)) then
tmp = ((re * (re * (-0.5d0))) + 1.0d0) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
else if (im <= 750000000000.0d0) then
tmp = -(im * cos(re))
else if (im <= 1.15d+77) then
tmp = ((re * re) * (im * (0.5d0 + ((re * re) * (-0.041666666666666664d0))))) - im
else if (im <= 1.4d+154) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (Math.cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0);
double t_1 = (Math.cos(re) * -(im * im)) / (im + -512.0);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -8e+76) {
tmp = t_0;
} else if (im <= -1000.0) {
tmp = ((re * (re * -0.5)) + 1.0) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
} else if (im <= 750000000000.0) {
tmp = -(im * Math.cos(re));
} else if (im <= 1.15e+77) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = (math.cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0) t_1 = (math.cos(re) * -(im * im)) / (im + -512.0) tmp = 0 if im <= -1.35e+154: tmp = t_1 elif im <= -8e+76: tmp = t_0 elif im <= -1000.0: tmp = ((re * (re * -0.5)) + 1.0) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) elif im <= 750000000000.0: tmp = -(im * math.cos(re)) elif im <= 1.15e+77: tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im elif im <= 1.4e+154: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(Float64(cos(re) * Float64(Float64(68719476736.0 - Float64(Float64(im * im) * Float64(im * im))) / Float64(Float64(im * im) + 262144.0))) / Float64(im + -512.0)) t_1 = Float64(Float64(cos(re) * Float64(-Float64(im * im))) / Float64(im + -512.0)) tmp = 0.0 if (im <= -1.35e+154) tmp = t_1; elseif (im <= -8e+76) tmp = t_0; elseif (im <= -1000.0) tmp = Float64(Float64(Float64(re * Float64(re * -0.5)) + 1.0) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); elseif (im <= 750000000000.0) tmp = Float64(-Float64(im * cos(re))); elseif (im <= 1.15e+77) tmp = Float64(Float64(Float64(re * re) * Float64(im * Float64(0.5 + Float64(Float64(re * re) * -0.041666666666666664)))) - im); elseif (im <= 1.4e+154) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = (cos(re) * ((68719476736.0 - ((im * im) * (im * im))) / ((im * im) + 262144.0))) / (im + -512.0); t_1 = (cos(re) * -(im * im)) / (im + -512.0); tmp = 0.0; if (im <= -1.35e+154) tmp = t_1; elseif (im <= -8e+76) tmp = t_0; elseif (im <= -1000.0) tmp = ((re * (re * -0.5)) + 1.0) * (((im ^ 3.0) * -0.16666666666666666) - im); elseif (im <= 750000000000.0) tmp = -(im * cos(re)); elseif (im <= 1.15e+77) tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im; elseif (im <= 1.4e+154) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Cos[re], $MachinePrecision] * N[(N[(68719476736.0 - N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(im * im), $MachinePrecision] + 262144.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Cos[re], $MachinePrecision] * (-N[(im * im), $MachinePrecision])), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$1, If[LessEqual[im, -8e+76], t$95$0, If[LessEqual[im, -1000.0], N[(N[(N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 750000000000.0], (-N[(im * N[Cos[re], $MachinePrecision]), $MachinePrecision]), If[LessEqual[im, 1.15e+77], N[(N[(N[(re * re), $MachinePrecision] * N[(im * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 1.4e+154], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cos re \cdot \frac{68719476736 - \left(im \cdot im\right) \cdot \left(im \cdot im\right)}{im \cdot im + 262144}}{im + -512}\\
t_1 := \frac{\cos re \cdot \left(-im \cdot im\right)}{im + -512}\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -8 \cdot 10^{+76}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -1000:\\
\;\;\;\;\left(re \cdot \left(re \cdot -0.5\right) + 1\right) \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{elif}\;im \leq 750000000000:\\
\;\;\;\;-im \cdot \cos re\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.041666666666666664\right)\right) - im\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.4e154 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.6%
*-commutative7.6%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in im around inf 100.0%
unpow2100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -8.0000000000000004e76 or 1.14999999999999997e77 < im < 1.4e154Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 58.1%
+-commutative58.1%
mul-1-neg58.1%
unsub-neg58.1%
associate-*r*58.1%
distribute-rgt-out--58.1%
*-commutative58.1%
Simplified58.1%
Applied egg-rr4.2%
*-commutative4.2%
flip--4.2%
associate-*l/4.2%
metadata-eval4.2%
+-commutative4.2%
Applied egg-rr4.2%
sub-neg4.2%
flip-+97.4%
metadata-eval97.4%
Applied egg-rr97.4%
if -8.0000000000000004e76 < im < -1e3Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 4.2%
+-commutative4.2%
mul-1-neg4.2%
unsub-neg4.2%
associate-*r*4.2%
distribute-rgt-out--4.2%
*-commutative4.2%
Simplified4.2%
Taylor expanded in re around 0 38.4%
associate--l+38.4%
associate-*r*38.4%
distribute-lft1-in38.4%
unpow238.4%
associate-*r*38.4%
Simplified38.4%
if -1e3 < im < 7.5e11Initial program 10.7%
neg-sub010.7%
Simplified10.7%
Taylor expanded in im around 0 97.0%
associate-*r*97.0%
neg-mul-197.0%
Simplified97.0%
if 7.5e11 < im < 1.14999999999999997e77Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
associate-*r*3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in re around 0 12.0%
neg-mul-112.0%
+-commutative12.0%
unsub-neg12.0%
associate-*r*12.0%
metadata-eval12.0%
pow-sqr12.0%
associate-*r*12.0%
associate-*r*12.0%
distribute-rgt-out31.0%
unpow231.0%
*-commutative31.0%
associate-*l*31.0%
*-commutative31.0%
distribute-lft-out31.0%
unpow231.0%
Simplified31.0%
Final simplification89.1%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
(+ (* re (* re -0.5)) 1.0)
(- (* (pow im 3.0) -0.16666666666666666) im)))
(t_1 (/ (* (cos re) (- (* im im))) (+ im -512.0))))
(if (<= im -1.35e+154)
t_1
(if (<= im -1000.0)
t_0
(if (<= im 750000000000.0)
(- (* im (cos re)))
(if (<= im 3.1e+92)
(-
(* (* re re) (* im (+ 0.5 (* (* re re) -0.041666666666666664))))
im)
(if (<= im 1.4e+154) t_0 t_1)))))))
double code(double re, double im) {
double t_0 = ((re * (re * -0.5)) + 1.0) * ((pow(im, 3.0) * -0.16666666666666666) - im);
double t_1 = (cos(re) * -(im * im)) / (im + -512.0);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -1000.0) {
tmp = t_0;
} else if (im <= 750000000000.0) {
tmp = -(im * cos(re));
} else if (im <= 3.1e+92) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((re * (re * (-0.5d0))) + 1.0d0) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
t_1 = (cos(re) * -(im * im)) / (im + (-512.0d0))
if (im <= (-1.35d+154)) then
tmp = t_1
else if (im <= (-1000.0d0)) then
tmp = t_0
else if (im <= 750000000000.0d0) then
tmp = -(im * cos(re))
else if (im <= 3.1d+92) then
tmp = ((re * re) * (im * (0.5d0 + ((re * re) * (-0.041666666666666664d0))))) - im
else if (im <= 1.4d+154) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = ((re * (re * -0.5)) + 1.0) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
double t_1 = (Math.cos(re) * -(im * im)) / (im + -512.0);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -1000.0) {
tmp = t_0;
} else if (im <= 750000000000.0) {
tmp = -(im * Math.cos(re));
} else if (im <= 3.1e+92) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = ((re * (re * -0.5)) + 1.0) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) t_1 = (math.cos(re) * -(im * im)) / (im + -512.0) tmp = 0 if im <= -1.35e+154: tmp = t_1 elif im <= -1000.0: tmp = t_0 elif im <= 750000000000.0: tmp = -(im * math.cos(re)) elif im <= 3.1e+92: tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im elif im <= 1.4e+154: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(Float64(Float64(re * Float64(re * -0.5)) + 1.0) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) t_1 = Float64(Float64(cos(re) * Float64(-Float64(im * im))) / Float64(im + -512.0)) tmp = 0.0 if (im <= -1.35e+154) tmp = t_1; elseif (im <= -1000.0) tmp = t_0; elseif (im <= 750000000000.0) tmp = Float64(-Float64(im * cos(re))); elseif (im <= 3.1e+92) tmp = Float64(Float64(Float64(re * re) * Float64(im * Float64(0.5 + Float64(Float64(re * re) * -0.041666666666666664)))) - im); elseif (im <= 1.4e+154) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = ((re * (re * -0.5)) + 1.0) * (((im ^ 3.0) * -0.16666666666666666) - im); t_1 = (cos(re) * -(im * im)) / (im + -512.0); tmp = 0.0; if (im <= -1.35e+154) tmp = t_1; elseif (im <= -1000.0) tmp = t_0; elseif (im <= 750000000000.0) tmp = -(im * cos(re)); elseif (im <= 3.1e+92) tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im; elseif (im <= 1.4e+154) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Cos[re], $MachinePrecision] * (-N[(im * im), $MachinePrecision])), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$1, If[LessEqual[im, -1000.0], t$95$0, If[LessEqual[im, 750000000000.0], (-N[(im * N[Cos[re], $MachinePrecision]), $MachinePrecision]), If[LessEqual[im, 3.1e+92], N[(N[(N[(re * re), $MachinePrecision] * N[(im * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 1.4e+154], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(re \cdot \left(re \cdot -0.5\right) + 1\right) \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
t_1 := \frac{\cos re \cdot \left(-im \cdot im\right)}{im + -512}\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -1000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 750000000000:\\
\;\;\;\;-im \cdot \cos re\\
\mathbf{elif}\;im \leq 3.1 \cdot 10^{+92}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.041666666666666664\right)\right) - im\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.4e154 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.6%
*-commutative7.6%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in im around inf 100.0%
unpow2100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -1e3 or 3.1000000000000002e92 < im < 1.4e154Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 45.6%
+-commutative45.6%
mul-1-neg45.6%
unsub-neg45.6%
associate-*r*45.6%
distribute-rgt-out--45.6%
*-commutative45.6%
Simplified45.6%
Taylor expanded in re around 0 22.8%
associate--l+22.8%
associate-*r*22.8%
distribute-lft1-in58.3%
unpow258.3%
associate-*r*58.3%
Simplified58.3%
if -1e3 < im < 7.5e11Initial program 10.7%
neg-sub010.7%
Simplified10.7%
Taylor expanded in im around 0 97.0%
associate-*r*97.0%
neg-mul-197.0%
Simplified97.0%
if 7.5e11 < im < 3.1000000000000002e92Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
associate-*r*3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in re around 0 14.8%
neg-mul-114.8%
+-commutative14.8%
unsub-neg14.8%
associate-*r*14.8%
metadata-eval14.8%
pow-sqr14.8%
associate-*r*14.8%
associate-*r*14.8%
distribute-rgt-out35.6%
unpow235.6%
*-commutative35.6%
associate-*l*35.6%
*-commutative35.6%
distribute-lft-out35.6%
unpow235.6%
Simplified35.6%
Final simplification84.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666))
(t_1
(/
(+
262144.0
(- (* -0.5 (* (* re re) (- 262144.0 (* im im)))) (* im im)))
(+ im -512.0))))
(if (<= im -6.4e+100)
t_0
(if (<= im -150000000000.0)
t_1
(if (<= im 750000000000.0)
(- (* im (cos re)))
(if (<= im 1.35e+95)
(-
(* (* re re) (* im (+ 0.5 (* (* re re) -0.041666666666666664))))
im)
(if (<= im 5.4e+133)
t_1
(if (<= im 1.4e+154)
t_0
(/ (* (cos re) (- (* im im))) (+ im -512.0))))))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -6.4e+100) {
tmp = t_0;
} else if (im <= -150000000000.0) {
tmp = t_1;
} else if (im <= 750000000000.0) {
tmp = -(im * cos(re));
} else if (im <= 1.35e+95) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 5.4e+133) {
tmp = t_1;
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = (cos(re) * -(im * im)) / (im + -512.0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (im ** 3.0d0) * (-0.16666666666666666d0)
t_1 = (262144.0d0 + (((-0.5d0) * ((re * re) * (262144.0d0 - (im * im)))) - (im * im))) / (im + (-512.0d0))
if (im <= (-6.4d+100)) then
tmp = t_0
else if (im <= (-150000000000.0d0)) then
tmp = t_1
else if (im <= 750000000000.0d0) then
tmp = -(im * cos(re))
else if (im <= 1.35d+95) then
tmp = ((re * re) * (im * (0.5d0 + ((re * re) * (-0.041666666666666664d0))))) - im
else if (im <= 5.4d+133) then
tmp = t_1
else if (im <= 1.4d+154) then
tmp = t_0
else
tmp = (cos(re) * -(im * im)) / (im + (-512.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.pow(im, 3.0) * -0.16666666666666666;
double t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -6.4e+100) {
tmp = t_0;
} else if (im <= -150000000000.0) {
tmp = t_1;
} else if (im <= 750000000000.0) {
tmp = -(im * Math.cos(re));
} else if (im <= 1.35e+95) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 5.4e+133) {
tmp = t_1;
} else if (im <= 1.4e+154) {
tmp = t_0;
} else {
tmp = (Math.cos(re) * -(im * im)) / (im + -512.0);
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0) tmp = 0 if im <= -6.4e+100: tmp = t_0 elif im <= -150000000000.0: tmp = t_1 elif im <= 750000000000.0: tmp = -(im * math.cos(re)) elif im <= 1.35e+95: tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im elif im <= 5.4e+133: tmp = t_1 elif im <= 1.4e+154: tmp = t_0 else: tmp = (math.cos(re) * -(im * im)) / (im + -512.0) return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) t_1 = Float64(Float64(262144.0 + Float64(Float64(-0.5 * Float64(Float64(re * re) * Float64(262144.0 - Float64(im * im)))) - Float64(im * im))) / Float64(im + -512.0)) tmp = 0.0 if (im <= -6.4e+100) tmp = t_0; elseif (im <= -150000000000.0) tmp = t_1; elseif (im <= 750000000000.0) tmp = Float64(-Float64(im * cos(re))); elseif (im <= 1.35e+95) tmp = Float64(Float64(Float64(re * re) * Float64(im * Float64(0.5 + Float64(Float64(re * re) * -0.041666666666666664)))) - im); elseif (im <= 5.4e+133) tmp = t_1; elseif (im <= 1.4e+154) tmp = t_0; else tmp = Float64(Float64(cos(re) * Float64(-Float64(im * im))) / Float64(im + -512.0)); end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.16666666666666666; t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0); tmp = 0.0; if (im <= -6.4e+100) tmp = t_0; elseif (im <= -150000000000.0) tmp = t_1; elseif (im <= 750000000000.0) tmp = -(im * cos(re)); elseif (im <= 1.35e+95) tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im; elseif (im <= 5.4e+133) tmp = t_1; elseif (im <= 1.4e+154) tmp = t_0; else tmp = (cos(re) * -(im * im)) / (im + -512.0); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]}, Block[{t$95$1 = N[(N[(262144.0 + N[(N[(-0.5 * N[(N[(re * re), $MachinePrecision] * N[(262144.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -6.4e+100], t$95$0, If[LessEqual[im, -150000000000.0], t$95$1, If[LessEqual[im, 750000000000.0], (-N[(im * N[Cos[re], $MachinePrecision]), $MachinePrecision]), If[LessEqual[im, 1.35e+95], N[(N[(N[(re * re), $MachinePrecision] * N[(im * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 5.4e+133], t$95$1, If[LessEqual[im, 1.4e+154], t$95$0, N[(N[(N[Cos[re], $MachinePrecision] * (-N[(im * im), $MachinePrecision])), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
t_1 := \frac{262144 + \left(-0.5 \cdot \left(\left(re \cdot re\right) \cdot \left(262144 - im \cdot im\right)\right) - im \cdot im\right)}{im + -512}\\
\mathbf{if}\;im \leq -6.4 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -150000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 750000000000:\\
\;\;\;\;-im \cdot \cos re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+95}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.041666666666666664\right)\right) - im\\
\mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos re \cdot \left(-im \cdot im\right)}{im + -512}\\
\end{array}
\end{array}
if im < -6.3999999999999998e100 or 5.4000000000000004e133 < im < 1.4e154Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 98.0%
+-commutative98.0%
mul-1-neg98.0%
unsub-neg98.0%
associate-*r*98.0%
distribute-rgt-out--98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in re around 0 86.6%
Taylor expanded in im around inf 86.6%
if -6.3999999999999998e100 < im < -1.5e11 or 1.35e95 < im < 5.4000000000000004e133Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 30.0%
+-commutative30.0%
mul-1-neg30.0%
unsub-neg30.0%
associate-*r*30.0%
distribute-rgt-out--30.0%
*-commutative30.0%
Simplified30.0%
Applied egg-rr3.8%
*-commutative3.8%
flip--3.8%
associate-*l/3.8%
metadata-eval3.8%
+-commutative3.8%
Applied egg-rr3.8%
Taylor expanded in re around 0 51.5%
unpow251.5%
associate--l+51.5%
unpow251.5%
unpow251.5%
Simplified51.5%
if -1.5e11 < im < 7.5e11Initial program 12.1%
neg-sub012.1%
Simplified12.1%
Taylor expanded in im around 0 95.6%
associate-*r*95.6%
neg-mul-195.6%
Simplified95.6%
if 7.5e11 < im < 1.35e95Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
associate-*r*3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in re around 0 14.4%
neg-mul-114.4%
+-commutative14.4%
unsub-neg14.4%
associate-*r*14.4%
metadata-eval14.4%
pow-sqr14.4%
associate-*r*14.4%
associate-*r*14.4%
distribute-rgt-out34.4%
unpow234.4%
*-commutative34.4%
associate-*l*34.4%
*-commutative34.4%
distribute-lft-out34.4%
unpow234.4%
Simplified34.4%
if 1.4e154 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.4%
*-commutative7.4%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in im around inf 100.0%
unpow2100.0%
neg-mul-1100.0%
Simplified100.0%
Final simplification83.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666))
(t_1
(/
(+
262144.0
(- (* -0.5 (* (* re re) (- 262144.0 (* im im)))) (* im im)))
(+ im -512.0))))
(if (<= im -6.8e+100)
t_0
(if (<= im -150000000000.0)
t_1
(if (<= im 1500000000000.0)
(- (* im (cos re)))
(if (<= im 1.5e+93)
(-
(* (* re re) (* im (+ 0.5 (* (* re re) -0.041666666666666664))))
im)
(if (<= im 3e+134) t_1 (- t_0 im))))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -6.8e+100) {
tmp = t_0;
} else if (im <= -150000000000.0) {
tmp = t_1;
} else if (im <= 1500000000000.0) {
tmp = -(im * cos(re));
} else if (im <= 1.5e+93) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 3e+134) {
tmp = t_1;
} else {
tmp = t_0 - 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) :: t_1
real(8) :: tmp
t_0 = (im ** 3.0d0) * (-0.16666666666666666d0)
t_1 = (262144.0d0 + (((-0.5d0) * ((re * re) * (262144.0d0 - (im * im)))) - (im * im))) / (im + (-512.0d0))
if (im <= (-6.8d+100)) then
tmp = t_0
else if (im <= (-150000000000.0d0)) then
tmp = t_1
else if (im <= 1500000000000.0d0) then
tmp = -(im * cos(re))
else if (im <= 1.5d+93) then
tmp = ((re * re) * (im * (0.5d0 + ((re * re) * (-0.041666666666666664d0))))) - im
else if (im <= 3d+134) then
tmp = t_1
else
tmp = t_0 - im
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.pow(im, 3.0) * -0.16666666666666666;
double t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -6.8e+100) {
tmp = t_0;
} else if (im <= -150000000000.0) {
tmp = t_1;
} else if (im <= 1500000000000.0) {
tmp = -(im * Math.cos(re));
} else if (im <= 1.5e+93) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 3e+134) {
tmp = t_1;
} else {
tmp = t_0 - im;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0) tmp = 0 if im <= -6.8e+100: tmp = t_0 elif im <= -150000000000.0: tmp = t_1 elif im <= 1500000000000.0: tmp = -(im * math.cos(re)) elif im <= 1.5e+93: tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im elif im <= 3e+134: tmp = t_1 else: tmp = t_0 - im return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) t_1 = Float64(Float64(262144.0 + Float64(Float64(-0.5 * Float64(Float64(re * re) * Float64(262144.0 - Float64(im * im)))) - Float64(im * im))) / Float64(im + -512.0)) tmp = 0.0 if (im <= -6.8e+100) tmp = t_0; elseif (im <= -150000000000.0) tmp = t_1; elseif (im <= 1500000000000.0) tmp = Float64(-Float64(im * cos(re))); elseif (im <= 1.5e+93) tmp = Float64(Float64(Float64(re * re) * Float64(im * Float64(0.5 + Float64(Float64(re * re) * -0.041666666666666664)))) - im); elseif (im <= 3e+134) tmp = t_1; else tmp = Float64(t_0 - im); end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.16666666666666666; t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0); tmp = 0.0; if (im <= -6.8e+100) tmp = t_0; elseif (im <= -150000000000.0) tmp = t_1; elseif (im <= 1500000000000.0) tmp = -(im * cos(re)); elseif (im <= 1.5e+93) tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im; elseif (im <= 3e+134) tmp = t_1; else tmp = t_0 - im; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]}, Block[{t$95$1 = N[(N[(262144.0 + N[(N[(-0.5 * N[(N[(re * re), $MachinePrecision] * N[(262144.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -6.8e+100], t$95$0, If[LessEqual[im, -150000000000.0], t$95$1, If[LessEqual[im, 1500000000000.0], (-N[(im * N[Cos[re], $MachinePrecision]), $MachinePrecision]), If[LessEqual[im, 1.5e+93], N[(N[(N[(re * re), $MachinePrecision] * N[(im * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 3e+134], t$95$1, N[(t$95$0 - im), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
t_1 := \frac{262144 + \left(-0.5 \cdot \left(\left(re \cdot re\right) \cdot \left(262144 - im \cdot im\right)\right) - im \cdot im\right)}{im + -512}\\
\mathbf{if}\;im \leq -6.8 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -150000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 1500000000000:\\
\;\;\;\;-im \cdot \cos re\\
\mathbf{elif}\;im \leq 1.5 \cdot 10^{+93}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.041666666666666664\right)\right) - im\\
\mathbf{elif}\;im \leq 3 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 - im\\
\end{array}
\end{array}
if im < -6.79999999999999988e100Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 97.7%
+-commutative97.7%
mul-1-neg97.7%
unsub-neg97.7%
associate-*r*97.7%
distribute-rgt-out--97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in re around 0 84.9%
Taylor expanded in im around inf 84.9%
if -6.79999999999999988e100 < im < -1.5e11 or 1.49999999999999989e93 < im < 2.99999999999999997e134Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 30.0%
+-commutative30.0%
mul-1-neg30.0%
unsub-neg30.0%
associate-*r*30.0%
distribute-rgt-out--30.0%
*-commutative30.0%
Simplified30.0%
Applied egg-rr3.8%
*-commutative3.8%
flip--3.8%
associate-*l/3.8%
metadata-eval3.8%
+-commutative3.8%
Applied egg-rr3.8%
Taylor expanded in re around 0 51.5%
unpow251.5%
associate--l+51.5%
unpow251.5%
unpow251.5%
Simplified51.5%
if -1.5e11 < im < 1.5e12Initial program 12.1%
neg-sub012.1%
Simplified12.1%
Taylor expanded in im around 0 95.6%
associate-*r*95.6%
neg-mul-195.6%
Simplified95.6%
if 1.5e12 < im < 1.49999999999999989e93Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
associate-*r*3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in re around 0 14.4%
neg-mul-114.4%
+-commutative14.4%
unsub-neg14.4%
associate-*r*14.4%
metadata-eval14.4%
pow-sqr14.4%
associate-*r*14.4%
associate-*r*14.4%
distribute-rgt-out34.4%
unpow234.4%
*-commutative34.4%
associate-*l*34.4%
*-commutative34.4%
distribute-lft-out34.4%
unpow234.4%
Simplified34.4%
if 2.99999999999999997e134 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in re around 0 82.8%
Final simplification81.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666))
(t_1
(/
(+
262144.0
(- (* -0.5 (* (* re re) (- 262144.0 (* im im)))) (* im im)))
(+ im -512.0))))
(if (<= im -7e+100)
t_0
(if (<= im -150000000000.0)
t_1
(if (<= im 235000000000.0)
(- im)
(if (<= im 3.9e+93)
(-
(* (* re re) (* im (+ 0.5 (* (* re re) -0.041666666666666664))))
im)
(if (<= im 5.4e+133) t_1 t_0)))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -7e+100) {
tmp = t_0;
} else if (im <= -150000000000.0) {
tmp = t_1;
} else if (im <= 235000000000.0) {
tmp = -im;
} else if (im <= 3.9e+93) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 5.4e+133) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (im ** 3.0d0) * (-0.16666666666666666d0)
t_1 = (262144.0d0 + (((-0.5d0) * ((re * re) * (262144.0d0 - (im * im)))) - (im * im))) / (im + (-512.0d0))
if (im <= (-7d+100)) then
tmp = t_0
else if (im <= (-150000000000.0d0)) then
tmp = t_1
else if (im <= 235000000000.0d0) then
tmp = -im
else if (im <= 3.9d+93) then
tmp = ((re * re) * (im * (0.5d0 + ((re * re) * (-0.041666666666666664d0))))) - im
else if (im <= 5.4d+133) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.pow(im, 3.0) * -0.16666666666666666;
double t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -7e+100) {
tmp = t_0;
} else if (im <= -150000000000.0) {
tmp = t_1;
} else if (im <= 235000000000.0) {
tmp = -im;
} else if (im <= 3.9e+93) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 5.4e+133) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0) tmp = 0 if im <= -7e+100: tmp = t_0 elif im <= -150000000000.0: tmp = t_1 elif im <= 235000000000.0: tmp = -im elif im <= 3.9e+93: tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im elif im <= 5.4e+133: tmp = t_1 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) t_1 = Float64(Float64(262144.0 + Float64(Float64(-0.5 * Float64(Float64(re * re) * Float64(262144.0 - Float64(im * im)))) - Float64(im * im))) / Float64(im + -512.0)) tmp = 0.0 if (im <= -7e+100) tmp = t_0; elseif (im <= -150000000000.0) tmp = t_1; elseif (im <= 235000000000.0) tmp = Float64(-im); elseif (im <= 3.9e+93) tmp = Float64(Float64(Float64(re * re) * Float64(im * Float64(0.5 + Float64(Float64(re * re) * -0.041666666666666664)))) - im); elseif (im <= 5.4e+133) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.16666666666666666; t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0); tmp = 0.0; if (im <= -7e+100) tmp = t_0; elseif (im <= -150000000000.0) tmp = t_1; elseif (im <= 235000000000.0) tmp = -im; elseif (im <= 3.9e+93) tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im; elseif (im <= 5.4e+133) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]}, Block[{t$95$1 = N[(N[(262144.0 + N[(N[(-0.5 * N[(N[(re * re), $MachinePrecision] * N[(262144.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7e+100], t$95$0, If[LessEqual[im, -150000000000.0], t$95$1, If[LessEqual[im, 235000000000.0], (-im), If[LessEqual[im, 3.9e+93], N[(N[(N[(re * re), $MachinePrecision] * N[(im * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 5.4e+133], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
t_1 := \frac{262144 + \left(-0.5 \cdot \left(\left(re \cdot re\right) \cdot \left(262144 - im \cdot im\right)\right) - im \cdot im\right)}{im + -512}\\
\mathbf{if}\;im \leq -7 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -150000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 235000000000:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 3.9 \cdot 10^{+93}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.041666666666666664\right)\right) - im\\
\mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -6.99999999999999953e100 or 5.4000000000000004e133 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
associate-*r*98.7%
distribute-rgt-out--98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in re around 0 84.0%
Taylor expanded in im around inf 84.0%
if -6.99999999999999953e100 < im < -1.5e11 or 3.9000000000000002e93 < im < 5.4000000000000004e133Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 30.0%
+-commutative30.0%
mul-1-neg30.0%
unsub-neg30.0%
associate-*r*30.0%
distribute-rgt-out--30.0%
*-commutative30.0%
Simplified30.0%
Applied egg-rr3.8%
*-commutative3.8%
flip--3.8%
associate-*l/3.8%
metadata-eval3.8%
+-commutative3.8%
Applied egg-rr3.8%
Taylor expanded in re around 0 51.5%
unpow251.5%
associate--l+51.5%
unpow251.5%
unpow251.5%
Simplified51.5%
if -1.5e11 < im < 2.35e11Initial program 11.4%
neg-sub011.4%
Simplified11.4%
Taylor expanded in im around 0 96.5%
+-commutative96.5%
mul-1-neg96.5%
unsub-neg96.5%
associate-*r*96.5%
distribute-rgt-out--96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in re around 0 57.0%
Taylor expanded in im around 0 57.0%
neg-mul-157.0%
Simplified57.0%
if 2.35e11 < im < 3.9000000000000002e93Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
associate-*r*3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in re around 0 13.9%
neg-mul-113.9%
+-commutative13.9%
unsub-neg13.9%
associate-*r*13.9%
metadata-eval13.9%
pow-sqr13.9%
associate-*r*13.9%
associate-*r*13.9%
distribute-rgt-out33.2%
unpow233.2%
*-commutative33.2%
associate-*l*33.2%
*-commutative33.2%
distribute-lft-out33.2%
unpow233.2%
Simplified33.2%
Final simplification61.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666))
(t_1
(/
(+
262144.0
(- (* -0.5 (* (* re re) (- 262144.0 (* im im)))) (* im im)))
(+ im -512.0))))
(if (<= im -7e+100)
t_0
(if (<= im -150000000000.0)
t_1
(if (<= im 750000000000.0)
(- (* im (cos re)))
(if (<= im 1e+97)
(-
(* (* re re) (* im (+ 0.5 (* (* re re) -0.041666666666666664))))
im)
(if (<= im 5.4e+133) t_1 t_0)))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -7e+100) {
tmp = t_0;
} else if (im <= -150000000000.0) {
tmp = t_1;
} else if (im <= 750000000000.0) {
tmp = -(im * cos(re));
} else if (im <= 1e+97) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 5.4e+133) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (im ** 3.0d0) * (-0.16666666666666666d0)
t_1 = (262144.0d0 + (((-0.5d0) * ((re * re) * (262144.0d0 - (im * im)))) - (im * im))) / (im + (-512.0d0))
if (im <= (-7d+100)) then
tmp = t_0
else if (im <= (-150000000000.0d0)) then
tmp = t_1
else if (im <= 750000000000.0d0) then
tmp = -(im * cos(re))
else if (im <= 1d+97) then
tmp = ((re * re) * (im * (0.5d0 + ((re * re) * (-0.041666666666666664d0))))) - im
else if (im <= 5.4d+133) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.pow(im, 3.0) * -0.16666666666666666;
double t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -7e+100) {
tmp = t_0;
} else if (im <= -150000000000.0) {
tmp = t_1;
} else if (im <= 750000000000.0) {
tmp = -(im * Math.cos(re));
} else if (im <= 1e+97) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 5.4e+133) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0) tmp = 0 if im <= -7e+100: tmp = t_0 elif im <= -150000000000.0: tmp = t_1 elif im <= 750000000000.0: tmp = -(im * math.cos(re)) elif im <= 1e+97: tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im elif im <= 5.4e+133: tmp = t_1 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) t_1 = Float64(Float64(262144.0 + Float64(Float64(-0.5 * Float64(Float64(re * re) * Float64(262144.0 - Float64(im * im)))) - Float64(im * im))) / Float64(im + -512.0)) tmp = 0.0 if (im <= -7e+100) tmp = t_0; elseif (im <= -150000000000.0) tmp = t_1; elseif (im <= 750000000000.0) tmp = Float64(-Float64(im * cos(re))); elseif (im <= 1e+97) tmp = Float64(Float64(Float64(re * re) * Float64(im * Float64(0.5 + Float64(Float64(re * re) * -0.041666666666666664)))) - im); elseif (im <= 5.4e+133) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.16666666666666666; t_1 = (262144.0 + ((-0.5 * ((re * re) * (262144.0 - (im * im)))) - (im * im))) / (im + -512.0); tmp = 0.0; if (im <= -7e+100) tmp = t_0; elseif (im <= -150000000000.0) tmp = t_1; elseif (im <= 750000000000.0) tmp = -(im * cos(re)); elseif (im <= 1e+97) tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im; elseif (im <= 5.4e+133) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]}, Block[{t$95$1 = N[(N[(262144.0 + N[(N[(-0.5 * N[(N[(re * re), $MachinePrecision] * N[(262144.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7e+100], t$95$0, If[LessEqual[im, -150000000000.0], t$95$1, If[LessEqual[im, 750000000000.0], (-N[(im * N[Cos[re], $MachinePrecision]), $MachinePrecision]), If[LessEqual[im, 1e+97], N[(N[(N[(re * re), $MachinePrecision] * N[(im * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 5.4e+133], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
t_1 := \frac{262144 + \left(-0.5 \cdot \left(\left(re \cdot re\right) \cdot \left(262144 - im \cdot im\right)\right) - im \cdot im\right)}{im + -512}\\
\mathbf{if}\;im \leq -7 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -150000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 750000000000:\\
\;\;\;\;-im \cdot \cos re\\
\mathbf{elif}\;im \leq 10^{+97}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.041666666666666664\right)\right) - im\\
\mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -6.99999999999999953e100 or 5.4000000000000004e133 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
associate-*r*98.7%
distribute-rgt-out--98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in re around 0 84.0%
Taylor expanded in im around inf 84.0%
if -6.99999999999999953e100 < im < -1.5e11 or 1.0000000000000001e97 < im < 5.4000000000000004e133Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 30.0%
+-commutative30.0%
mul-1-neg30.0%
unsub-neg30.0%
associate-*r*30.0%
distribute-rgt-out--30.0%
*-commutative30.0%
Simplified30.0%
Applied egg-rr3.8%
*-commutative3.8%
flip--3.8%
associate-*l/3.8%
metadata-eval3.8%
+-commutative3.8%
Applied egg-rr3.8%
Taylor expanded in re around 0 51.5%
unpow251.5%
associate--l+51.5%
unpow251.5%
unpow251.5%
Simplified51.5%
if -1.5e11 < im < 7.5e11Initial program 12.1%
neg-sub012.1%
Simplified12.1%
Taylor expanded in im around 0 95.6%
associate-*r*95.6%
neg-mul-195.6%
Simplified95.6%
if 7.5e11 < im < 1.0000000000000001e97Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
associate-*r*3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in re around 0 14.4%
neg-mul-114.4%
+-commutative14.4%
unsub-neg14.4%
associate-*r*14.4%
metadata-eval14.4%
pow-sqr14.4%
associate-*r*14.4%
associate-*r*14.4%
distribute-rgt-out34.4%
unpow234.4%
*-commutative34.4%
associate-*l*34.4%
*-commutative34.4%
distribute-lft-out34.4%
unpow234.4%
Simplified34.4%
Final simplification81.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- 262144.0 (* im im)))
(t_1 (/ t_0 (+ im -512.0)))
(t_2
(/
(+ 262144.0 (- (* -0.5 (* (* re re) t_0)) (* im im)))
(+ im -512.0))))
(if (<= im -7.2e+141)
t_1
(if (<= im -150000000000.0)
t_2
(if (<= im 235000000000.0)
(- im)
(if (<= im 2.5e+96)
(-
(* (* re re) (* im (+ 0.5 (* (* re re) -0.041666666666666664))))
im)
(if (<= im 1.55e+135) t_2 t_1)))))))
double code(double re, double im) {
double t_0 = 262144.0 - (im * im);
double t_1 = t_0 / (im + -512.0);
double t_2 = (262144.0 + ((-0.5 * ((re * re) * t_0)) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -7.2e+141) {
tmp = t_1;
} else if (im <= -150000000000.0) {
tmp = t_2;
} else if (im <= 235000000000.0) {
tmp = -im;
} else if (im <= 2.5e+96) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 1.55e+135) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 262144.0d0 - (im * im)
t_1 = t_0 / (im + (-512.0d0))
t_2 = (262144.0d0 + (((-0.5d0) * ((re * re) * t_0)) - (im * im))) / (im + (-512.0d0))
if (im <= (-7.2d+141)) then
tmp = t_1
else if (im <= (-150000000000.0d0)) then
tmp = t_2
else if (im <= 235000000000.0d0) then
tmp = -im
else if (im <= 2.5d+96) then
tmp = ((re * re) * (im * (0.5d0 + ((re * re) * (-0.041666666666666664d0))))) - im
else if (im <= 1.55d+135) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 262144.0 - (im * im);
double t_1 = t_0 / (im + -512.0);
double t_2 = (262144.0 + ((-0.5 * ((re * re) * t_0)) - (im * im))) / (im + -512.0);
double tmp;
if (im <= -7.2e+141) {
tmp = t_1;
} else if (im <= -150000000000.0) {
tmp = t_2;
} else if (im <= 235000000000.0) {
tmp = -im;
} else if (im <= 2.5e+96) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 1.55e+135) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 262144.0 - (im * im) t_1 = t_0 / (im + -512.0) t_2 = (262144.0 + ((-0.5 * ((re * re) * t_0)) - (im * im))) / (im + -512.0) tmp = 0 if im <= -7.2e+141: tmp = t_1 elif im <= -150000000000.0: tmp = t_2 elif im <= 235000000000.0: tmp = -im elif im <= 2.5e+96: tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im elif im <= 1.55e+135: tmp = t_2 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(262144.0 - Float64(im * im)) t_1 = Float64(t_0 / Float64(im + -512.0)) t_2 = Float64(Float64(262144.0 + Float64(Float64(-0.5 * Float64(Float64(re * re) * t_0)) - Float64(im * im))) / Float64(im + -512.0)) tmp = 0.0 if (im <= -7.2e+141) tmp = t_1; elseif (im <= -150000000000.0) tmp = t_2; elseif (im <= 235000000000.0) tmp = Float64(-im); elseif (im <= 2.5e+96) tmp = Float64(Float64(Float64(re * re) * Float64(im * Float64(0.5 + Float64(Float64(re * re) * -0.041666666666666664)))) - im); elseif (im <= 1.55e+135) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 262144.0 - (im * im); t_1 = t_0 / (im + -512.0); t_2 = (262144.0 + ((-0.5 * ((re * re) * t_0)) - (im * im))) / (im + -512.0); tmp = 0.0; if (im <= -7.2e+141) tmp = t_1; elseif (im <= -150000000000.0) tmp = t_2; elseif (im <= 235000000000.0) tmp = -im; elseif (im <= 2.5e+96) tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im; elseif (im <= 1.55e+135) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(262144.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(262144.0 + N[(N[(-0.5 * N[(N[(re * re), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.2e+141], t$95$1, If[LessEqual[im, -150000000000.0], t$95$2, If[LessEqual[im, 235000000000.0], (-im), If[LessEqual[im, 2.5e+96], N[(N[(N[(re * re), $MachinePrecision] * N[(im * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 1.55e+135], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 262144 - im \cdot im\\
t_1 := \frac{t_0}{im + -512}\\
t_2 := \frac{262144 + \left(-0.5 \cdot \left(\left(re \cdot re\right) \cdot t_0\right) - im \cdot im\right)}{im + -512}\\
\mathbf{if}\;im \leq -7.2 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -150000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;im \leq 235000000000:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 2.5 \cdot 10^{+96}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.041666666666666664\right)\right) - im\\
\mathbf{elif}\;im \leq 1.55 \cdot 10^{+135}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -7.2000000000000003e141 or 1.55000000000000011e135 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.2%
*-commutative7.2%
flip--87.9%
associate-*l/87.9%
metadata-eval87.9%
+-commutative87.9%
Applied egg-rr87.9%
Taylor expanded in re around 0 73.6%
unpow273.6%
sub-neg73.6%
metadata-eval73.6%
Simplified73.6%
if -7.2000000000000003e141 < im < -1.5e11 or 2.5000000000000002e96 < im < 1.55000000000000011e135Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 37.1%
+-commutative37.1%
mul-1-neg37.1%
unsub-neg37.1%
associate-*r*37.1%
distribute-rgt-out--37.1%
*-commutative37.1%
Simplified37.1%
Applied egg-rr3.9%
*-commutative3.9%
flip--3.9%
associate-*l/3.9%
metadata-eval3.9%
+-commutative3.9%
Applied egg-rr3.9%
Taylor expanded in re around 0 47.5%
unpow247.5%
associate--l+47.5%
unpow247.5%
unpow247.5%
Simplified47.5%
if -1.5e11 < im < 2.35e11Initial program 11.4%
neg-sub011.4%
Simplified11.4%
Taylor expanded in im around 0 96.5%
+-commutative96.5%
mul-1-neg96.5%
unsub-neg96.5%
associate-*r*96.5%
distribute-rgt-out--96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in re around 0 57.0%
Taylor expanded in im around 0 57.0%
neg-mul-157.0%
Simplified57.0%
if 2.35e11 < im < 2.5000000000000002e96Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
associate-*r*3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in re around 0 13.9%
neg-mul-113.9%
+-commutative13.9%
unsub-neg13.9%
associate-*r*13.9%
metadata-eval13.9%
pow-sqr13.9%
associate-*r*13.9%
associate-*r*13.9%
distribute-rgt-out33.2%
unpow233.2%
*-commutative33.2%
associate-*l*33.2%
*-commutative33.2%
distribute-lft-out33.2%
unpow233.2%
Simplified33.2%
Final simplification57.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (/ (- 262144.0 (* im im)) (+ im -512.0)))
(t_1 (* (* im 0.5) (+ (* re re) -2.0))))
(if (<= im -7.2e+141)
t_0
(if (<= im -5.5e-14)
t_1
(if (<= im 235000000000.0)
(- im)
(if (<= im 2.9e+93)
(-
(* (* re re) (* im (+ 0.5 (* (* re re) -0.041666666666666664))))
im)
(if (<= im 1.55e+135) t_1 t_0)))))))
double code(double re, double im) {
double t_0 = (262144.0 - (im * im)) / (im + -512.0);
double t_1 = (im * 0.5) * ((re * re) + -2.0);
double tmp;
if (im <= -7.2e+141) {
tmp = t_0;
} else if (im <= -5.5e-14) {
tmp = t_1;
} else if (im <= 235000000000.0) {
tmp = -im;
} else if (im <= 2.9e+93) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 1.55e+135) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (262144.0d0 - (im * im)) / (im + (-512.0d0))
t_1 = (im * 0.5d0) * ((re * re) + (-2.0d0))
if (im <= (-7.2d+141)) then
tmp = t_0
else if (im <= (-5.5d-14)) then
tmp = t_1
else if (im <= 235000000000.0d0) then
tmp = -im
else if (im <= 2.9d+93) then
tmp = ((re * re) * (im * (0.5d0 + ((re * re) * (-0.041666666666666664d0))))) - im
else if (im <= 1.55d+135) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (262144.0 - (im * im)) / (im + -512.0);
double t_1 = (im * 0.5) * ((re * re) + -2.0);
double tmp;
if (im <= -7.2e+141) {
tmp = t_0;
} else if (im <= -5.5e-14) {
tmp = t_1;
} else if (im <= 235000000000.0) {
tmp = -im;
} else if (im <= 2.9e+93) {
tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im;
} else if (im <= 1.55e+135) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (262144.0 - (im * im)) / (im + -512.0) t_1 = (im * 0.5) * ((re * re) + -2.0) tmp = 0 if im <= -7.2e+141: tmp = t_0 elif im <= -5.5e-14: tmp = t_1 elif im <= 235000000000.0: tmp = -im elif im <= 2.9e+93: tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im elif im <= 1.55e+135: tmp = t_1 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(262144.0 - Float64(im * im)) / Float64(im + -512.0)) t_1 = Float64(Float64(im * 0.5) * Float64(Float64(re * re) + -2.0)) tmp = 0.0 if (im <= -7.2e+141) tmp = t_0; elseif (im <= -5.5e-14) tmp = t_1; elseif (im <= 235000000000.0) tmp = Float64(-im); elseif (im <= 2.9e+93) tmp = Float64(Float64(Float64(re * re) * Float64(im * Float64(0.5 + Float64(Float64(re * re) * -0.041666666666666664)))) - im); elseif (im <= 1.55e+135) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (262144.0 - (im * im)) / (im + -512.0); t_1 = (im * 0.5) * ((re * re) + -2.0); tmp = 0.0; if (im <= -7.2e+141) tmp = t_0; elseif (im <= -5.5e-14) tmp = t_1; elseif (im <= 235000000000.0) tmp = -im; elseif (im <= 2.9e+93) tmp = ((re * re) * (im * (0.5 + ((re * re) * -0.041666666666666664)))) - im; elseif (im <= 1.55e+135) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(262144.0 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * 0.5), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.2e+141], t$95$0, If[LessEqual[im, -5.5e-14], t$95$1, If[LessEqual[im, 235000000000.0], (-im), If[LessEqual[im, 2.9e+93], N[(N[(N[(re * re), $MachinePrecision] * N[(im * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 1.55e+135], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{262144 - im \cdot im}{im + -512}\\
t_1 := \left(im \cdot 0.5\right) \cdot \left(re \cdot re + -2\right)\\
\mathbf{if}\;im \leq -7.2 \cdot 10^{+141}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -5.5 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 235000000000:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 2.9 \cdot 10^{+93}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.041666666666666664\right)\right) - im\\
\mathbf{elif}\;im \leq 1.55 \cdot 10^{+135}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -7.2000000000000003e141 or 1.55000000000000011e135 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.2%
*-commutative7.2%
flip--87.9%
associate-*l/87.9%
metadata-eval87.9%
+-commutative87.9%
Applied egg-rr87.9%
Taylor expanded in re around 0 73.6%
unpow273.6%
sub-neg73.6%
metadata-eval73.6%
Simplified73.6%
if -7.2000000000000003e141 < im < -5.49999999999999991e-14 or 2.8999999999999998e93 < im < 1.55000000000000011e135Initial program 95.7%
neg-sub095.7%
Simplified95.7%
Taylor expanded in im around 0 12.2%
associate-*r*12.2%
neg-mul-112.2%
Simplified12.2%
Taylor expanded in re around 0 38.7%
neg-mul-138.7%
+-commutative38.7%
associate-*r*38.7%
neg-mul-138.7%
metadata-eval38.7%
associate-*r*38.7%
*-commutative38.7%
distribute-lft-out38.7%
*-commutative38.7%
unpow238.7%
Simplified38.7%
if -5.49999999999999991e-14 < im < 2.35e11Initial program 7.9%
neg-sub07.9%
Simplified7.9%
Taylor expanded in im around 0 98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
associate-*r*98.7%
distribute-rgt-out--98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in re around 0 58.5%
Taylor expanded in im around 0 58.5%
neg-mul-158.5%
Simplified58.5%
if 2.35e11 < im < 2.8999999999999998e93Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
associate-*r*3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in re around 0 13.9%
neg-mul-113.9%
+-commutative13.9%
unsub-neg13.9%
associate-*r*13.9%
metadata-eval13.9%
pow-sqr13.9%
associate-*r*13.9%
associate-*r*13.9%
distribute-rgt-out33.2%
unpow233.2%
*-commutative33.2%
associate-*l*33.2%
*-commutative33.2%
distribute-lft-out33.2%
unpow233.2%
Simplified33.2%
Final simplification56.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (/ (- 262144.0 (* im im)) (+ im -512.0))))
(if (<= im -7.2e+141)
t_0
(if (<= im -9e-14)
(* (* im 0.5) (+ (* re re) -2.0))
(if (<= im 0.175)
(- im)
(if (<= im 1.55e+135)
(* (+ im 512.0) (+ -1.0 (* re (* 0.5 re))))
t_0))))))
double code(double re, double im) {
double t_0 = (262144.0 - (im * im)) / (im + -512.0);
double tmp;
if (im <= -7.2e+141) {
tmp = t_0;
} else if (im <= -9e-14) {
tmp = (im * 0.5) * ((re * re) + -2.0);
} else if (im <= 0.175) {
tmp = -im;
} else if (im <= 1.55e+135) {
tmp = (im + 512.0) * (-1.0 + (re * (0.5 * re)));
} else {
tmp = t_0;
}
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 = (262144.0d0 - (im * im)) / (im + (-512.0d0))
if (im <= (-7.2d+141)) then
tmp = t_0
else if (im <= (-9d-14)) then
tmp = (im * 0.5d0) * ((re * re) + (-2.0d0))
else if (im <= 0.175d0) then
tmp = -im
else if (im <= 1.55d+135) then
tmp = (im + 512.0d0) * ((-1.0d0) + (re * (0.5d0 * re)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (262144.0 - (im * im)) / (im + -512.0);
double tmp;
if (im <= -7.2e+141) {
tmp = t_0;
} else if (im <= -9e-14) {
tmp = (im * 0.5) * ((re * re) + -2.0);
} else if (im <= 0.175) {
tmp = -im;
} else if (im <= 1.55e+135) {
tmp = (im + 512.0) * (-1.0 + (re * (0.5 * re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (262144.0 - (im * im)) / (im + -512.0) tmp = 0 if im <= -7.2e+141: tmp = t_0 elif im <= -9e-14: tmp = (im * 0.5) * ((re * re) + -2.0) elif im <= 0.175: tmp = -im elif im <= 1.55e+135: tmp = (im + 512.0) * (-1.0 + (re * (0.5 * re))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(262144.0 - Float64(im * im)) / Float64(im + -512.0)) tmp = 0.0 if (im <= -7.2e+141) tmp = t_0; elseif (im <= -9e-14) tmp = Float64(Float64(im * 0.5) * Float64(Float64(re * re) + -2.0)); elseif (im <= 0.175) tmp = Float64(-im); elseif (im <= 1.55e+135) tmp = Float64(Float64(im + 512.0) * Float64(-1.0 + Float64(re * Float64(0.5 * re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (262144.0 - (im * im)) / (im + -512.0); tmp = 0.0; if (im <= -7.2e+141) tmp = t_0; elseif (im <= -9e-14) tmp = (im * 0.5) * ((re * re) + -2.0); elseif (im <= 0.175) tmp = -im; elseif (im <= 1.55e+135) tmp = (im + 512.0) * (-1.0 + (re * (0.5 * re))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(262144.0 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.2e+141], t$95$0, If[LessEqual[im, -9e-14], N[(N[(im * 0.5), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 0.175], (-im), If[LessEqual[im, 1.55e+135], N[(N[(im + 512.0), $MachinePrecision] * N[(-1.0 + N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{262144 - im \cdot im}{im + -512}\\
\mathbf{if}\;im \leq -7.2 \cdot 10^{+141}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -9 \cdot 10^{-14}:\\
\;\;\;\;\left(im \cdot 0.5\right) \cdot \left(re \cdot re + -2\right)\\
\mathbf{elif}\;im \leq 0.175:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 1.55 \cdot 10^{+135}:\\
\;\;\;\;\left(im + 512\right) \cdot \left(-1 + re \cdot \left(0.5 \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -7.2000000000000003e141 or 1.55000000000000011e135 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.2%
*-commutative7.2%
flip--87.9%
associate-*l/87.9%
metadata-eval87.9%
+-commutative87.9%
Applied egg-rr87.9%
Taylor expanded in re around 0 73.6%
unpow273.6%
sub-neg73.6%
metadata-eval73.6%
Simplified73.6%
if -7.2000000000000003e141 < im < -8.9999999999999995e-14Initial program 94.0%
neg-sub094.0%
Simplified94.0%
Taylor expanded in im around 0 15.2%
associate-*r*15.2%
neg-mul-115.2%
Simplified15.2%
Taylor expanded in re around 0 33.3%
neg-mul-133.3%
+-commutative33.3%
associate-*r*33.3%
neg-mul-133.3%
metadata-eval33.3%
associate-*r*33.3%
*-commutative33.3%
distribute-lft-out33.3%
*-commutative33.3%
unpow233.3%
Simplified33.3%
if -8.9999999999999995e-14 < im < 0.17499999999999999Initial program 6.4%
neg-sub06.4%
Simplified6.4%
Taylor expanded in im around 0 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
associate-*r*99.9%
distribute-rgt-out--99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in re around 0 59.5%
Taylor expanded in im around 0 59.5%
neg-mul-159.5%
Simplified59.5%
if 0.17499999999999999 < im < 1.55000000000000011e135Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 25.4%
+-commutative25.4%
mul-1-neg25.4%
unsub-neg25.4%
associate-*r*25.4%
distribute-rgt-out--25.4%
*-commutative25.4%
Simplified25.4%
Applied egg-rr3.9%
Taylor expanded in re around 0 20.0%
unpow220.0%
associate-*r*20.0%
distribute-rgt-out20.0%
+-commutative20.0%
metadata-eval20.0%
distribute-lft-neg-in20.0%
associate-*r*20.0%
*-commutative20.0%
distribute-rgt-neg-in20.0%
distribute-lft-neg-in20.0%
metadata-eval20.0%
Simplified20.0%
Final simplification53.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (/ (- 262144.0 (* im im)) (+ im -512.0)))
(t_1 (* (* im 0.5) (+ (* re re) -2.0))))
(if (<= im -7.2e+141)
t_0
(if (<= im -1.02e-13)
t_1
(if (<= im 0.175) (- im) (if (<= im 1.55e+135) t_1 t_0))))))
double code(double re, double im) {
double t_0 = (262144.0 - (im * im)) / (im + -512.0);
double t_1 = (im * 0.5) * ((re * re) + -2.0);
double tmp;
if (im <= -7.2e+141) {
tmp = t_0;
} else if (im <= -1.02e-13) {
tmp = t_1;
} else if (im <= 0.175) {
tmp = -im;
} else if (im <= 1.55e+135) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (262144.0d0 - (im * im)) / (im + (-512.0d0))
t_1 = (im * 0.5d0) * ((re * re) + (-2.0d0))
if (im <= (-7.2d+141)) then
tmp = t_0
else if (im <= (-1.02d-13)) then
tmp = t_1
else if (im <= 0.175d0) then
tmp = -im
else if (im <= 1.55d+135) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (262144.0 - (im * im)) / (im + -512.0);
double t_1 = (im * 0.5) * ((re * re) + -2.0);
double tmp;
if (im <= -7.2e+141) {
tmp = t_0;
} else if (im <= -1.02e-13) {
tmp = t_1;
} else if (im <= 0.175) {
tmp = -im;
} else if (im <= 1.55e+135) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (262144.0 - (im * im)) / (im + -512.0) t_1 = (im * 0.5) * ((re * re) + -2.0) tmp = 0 if im <= -7.2e+141: tmp = t_0 elif im <= -1.02e-13: tmp = t_1 elif im <= 0.175: tmp = -im elif im <= 1.55e+135: tmp = t_1 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(262144.0 - Float64(im * im)) / Float64(im + -512.0)) t_1 = Float64(Float64(im * 0.5) * Float64(Float64(re * re) + -2.0)) tmp = 0.0 if (im <= -7.2e+141) tmp = t_0; elseif (im <= -1.02e-13) tmp = t_1; elseif (im <= 0.175) tmp = Float64(-im); elseif (im <= 1.55e+135) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (262144.0 - (im * im)) / (im + -512.0); t_1 = (im * 0.5) * ((re * re) + -2.0); tmp = 0.0; if (im <= -7.2e+141) tmp = t_0; elseif (im <= -1.02e-13) tmp = t_1; elseif (im <= 0.175) tmp = -im; elseif (im <= 1.55e+135) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(262144.0 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(im + -512.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * 0.5), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.2e+141], t$95$0, If[LessEqual[im, -1.02e-13], t$95$1, If[LessEqual[im, 0.175], (-im), If[LessEqual[im, 1.55e+135], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{262144 - im \cdot im}{im + -512}\\
t_1 := \left(im \cdot 0.5\right) \cdot \left(re \cdot re + -2\right)\\
\mathbf{if}\;im \leq -7.2 \cdot 10^{+141}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -1.02 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 0.175:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 1.55 \cdot 10^{+135}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -7.2000000000000003e141 or 1.55000000000000011e135 < im Initial program 100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out--100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr7.2%
*-commutative7.2%
flip--87.9%
associate-*l/87.9%
metadata-eval87.9%
+-commutative87.9%
Applied egg-rr87.9%
Taylor expanded in re around 0 73.6%
unpow273.6%
sub-neg73.6%
metadata-eval73.6%
Simplified73.6%
if -7.2000000000000003e141 < im < -1.0199999999999999e-13 or 0.17499999999999999 < im < 1.55000000000000011e135Initial program 97.3%
neg-sub097.3%
Simplified97.3%
Taylor expanded in im around 0 9.2%
associate-*r*9.2%
neg-mul-19.2%
Simplified9.2%
Taylor expanded in re around 0 25.9%
neg-mul-125.9%
+-commutative25.9%
associate-*r*25.9%
neg-mul-125.9%
metadata-eval25.9%
associate-*r*25.9%
*-commutative25.9%
distribute-lft-out25.9%
*-commutative25.9%
unpow225.9%
Simplified25.9%
if -1.0199999999999999e-13 < im < 0.17499999999999999Initial program 6.4%
neg-sub06.4%
Simplified6.4%
Taylor expanded in im around 0 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
associate-*r*99.9%
distribute-rgt-out--99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in re around 0 59.5%
Taylor expanded in im around 0 59.5%
neg-mul-159.5%
Simplified59.5%
Final simplification53.5%
(FPCore (re im)
:precision binary64
(if (<= re 6.5e+157)
(* (* im 0.5) (+ (* re re) -2.0))
(if (<= re 1.75e+233)
(* (* re re) -6.75)
(* (+ 0.5 (* -0.25 (* re re))) -3.0))))
double code(double re, double im) {
double tmp;
if (re <= 6.5e+157) {
tmp = (im * 0.5) * ((re * re) + -2.0);
} else if (re <= 1.75e+233) {
tmp = (re * re) * -6.75;
} else {
tmp = (0.5 + (-0.25 * (re * re))) * -3.0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 6.5d+157) then
tmp = (im * 0.5d0) * ((re * re) + (-2.0d0))
else if (re <= 1.75d+233) then
tmp = (re * re) * (-6.75d0)
else
tmp = (0.5d0 + ((-0.25d0) * (re * re))) * (-3.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 6.5e+157) {
tmp = (im * 0.5) * ((re * re) + -2.0);
} else if (re <= 1.75e+233) {
tmp = (re * re) * -6.75;
} else {
tmp = (0.5 + (-0.25 * (re * re))) * -3.0;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 6.5e+157: tmp = (im * 0.5) * ((re * re) + -2.0) elif re <= 1.75e+233: tmp = (re * re) * -6.75 else: tmp = (0.5 + (-0.25 * (re * re))) * -3.0 return tmp
function code(re, im) tmp = 0.0 if (re <= 6.5e+157) tmp = Float64(Float64(im * 0.5) * Float64(Float64(re * re) + -2.0)); elseif (re <= 1.75e+233) tmp = Float64(Float64(re * re) * -6.75); else tmp = Float64(Float64(0.5 + Float64(-0.25 * Float64(re * re))) * -3.0); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 6.5e+157) tmp = (im * 0.5) * ((re * re) + -2.0); elseif (re <= 1.75e+233) tmp = (re * re) * -6.75; else tmp = (0.5 + (-0.25 * (re * re))) * -3.0; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 6.5e+157], N[(N[(im * 0.5), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.75e+233], N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision], N[(N[(0.5 + N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 6.5 \cdot 10^{+157}:\\
\;\;\;\;\left(im \cdot 0.5\right) \cdot \left(re \cdot re + -2\right)\\
\mathbf{elif}\;re \leq 1.75 \cdot 10^{+233}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -6.75\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right) \cdot -3\\
\end{array}
\end{array}
if re < 6.5e157Initial program 55.9%
neg-sub055.9%
Simplified55.9%
Taylor expanded in im around 0 50.7%
associate-*r*50.7%
neg-mul-150.7%
Simplified50.7%
Taylor expanded in re around 0 39.1%
neg-mul-139.1%
+-commutative39.1%
associate-*r*39.1%
neg-mul-139.1%
metadata-eval39.1%
associate-*r*39.1%
*-commutative39.1%
distribute-lft-out39.1%
*-commutative39.1%
unpow239.1%
Simplified39.1%
if 6.5e157 < re < 1.7499999999999999e233Initial program 39.0%
neg-sub039.0%
Simplified39.0%
Taylor expanded in re around 0 0.0%
+-commutative0.0%
associate-*r*0.0%
distribute-rgt-out21.4%
unpow221.4%
Simplified21.4%
Applied egg-rr29.8%
Taylor expanded in re around inf 29.8%
unpow229.8%
*-commutative29.8%
associate-*l*29.8%
Simplified29.8%
Taylor expanded in re around 0 29.8%
unpow229.8%
Simplified29.8%
if 1.7499999999999999e233 < re Initial program 56.5%
neg-sub056.5%
Simplified56.5%
Taylor expanded in re around 0 0.2%
+-commutative0.2%
associate-*r*0.2%
distribute-rgt-out26.9%
unpow226.9%
Simplified26.9%
Applied egg-rr27.6%
Final simplification37.9%
(FPCore (re im)
:precision binary64
(if (<= re 3.6e+171)
(- (* 0.5 (* re (* im re))) im)
(if (<= re 2.3e+231)
(* (* re re) -6.75)
(* (+ 0.5 (* -0.25 (* re re))) -3.0))))
double code(double re, double im) {
double tmp;
if (re <= 3.6e+171) {
tmp = (0.5 * (re * (im * re))) - im;
} else if (re <= 2.3e+231) {
tmp = (re * re) * -6.75;
} else {
tmp = (0.5 + (-0.25 * (re * re))) * -3.0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 3.6d+171) then
tmp = (0.5d0 * (re * (im * re))) - im
else if (re <= 2.3d+231) then
tmp = (re * re) * (-6.75d0)
else
tmp = (0.5d0 + ((-0.25d0) * (re * re))) * (-3.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 3.6e+171) {
tmp = (0.5 * (re * (im * re))) - im;
} else if (re <= 2.3e+231) {
tmp = (re * re) * -6.75;
} else {
tmp = (0.5 + (-0.25 * (re * re))) * -3.0;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 3.6e+171: tmp = (0.5 * (re * (im * re))) - im elif re <= 2.3e+231: tmp = (re * re) * -6.75 else: tmp = (0.5 + (-0.25 * (re * re))) * -3.0 return tmp
function code(re, im) tmp = 0.0 if (re <= 3.6e+171) tmp = Float64(Float64(0.5 * Float64(re * Float64(im * re))) - im); elseif (re <= 2.3e+231) tmp = Float64(Float64(re * re) * -6.75); else tmp = Float64(Float64(0.5 + Float64(-0.25 * Float64(re * re))) * -3.0); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 3.6e+171) tmp = (0.5 * (re * (im * re))) - im; elseif (re <= 2.3e+231) tmp = (re * re) * -6.75; else tmp = (0.5 + (-0.25 * (re * re))) * -3.0; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 3.6e+171], N[(N[(0.5 * N[(re * N[(im * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[re, 2.3e+231], N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision], N[(N[(0.5 + N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 3.6 \cdot 10^{+171}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot re\right)\right) - im\\
\mathbf{elif}\;re \leq 2.3 \cdot 10^{+231}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -6.75\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right) \cdot -3\\
\end{array}
\end{array}
if re < 3.60000000000000018e171Initial program 56.1%
neg-sub056.1%
Simplified56.1%
Taylor expanded in im around 0 50.6%
associate-*r*50.6%
neg-mul-150.6%
Simplified50.6%
Taylor expanded in re around 0 39.4%
neg-mul-139.4%
+-commutative39.4%
unsub-neg39.4%
*-commutative39.4%
unpow239.4%
associate-*l*39.4%
Simplified39.4%
if 3.60000000000000018e171 < re < 2.29999999999999999e231Initial program 34.3%
neg-sub034.3%
Simplified34.3%
Taylor expanded in re around 0 0.0%
+-commutative0.0%
associate-*r*0.0%
distribute-rgt-out15.4%
unpow215.4%
Simplified15.4%
Applied egg-rr24.4%
Taylor expanded in re around inf 24.4%
unpow224.4%
*-commutative24.4%
associate-*l*24.4%
Simplified24.4%
Taylor expanded in re around 0 24.4%
unpow224.4%
Simplified24.4%
if 2.29999999999999999e231 < re Initial program 56.5%
neg-sub056.5%
Simplified56.5%
Taylor expanded in re around 0 0.2%
+-commutative0.2%
associate-*r*0.2%
distribute-rgt-out26.9%
unpow226.9%
Simplified26.9%
Applied egg-rr27.6%
Final simplification38.0%
(FPCore (re im) :precision binary64 (if (<= re 1.05e+162) (- im) (* (* re re) -6.75)))
double code(double re, double im) {
double tmp;
if (re <= 1.05e+162) {
tmp = -im;
} else {
tmp = (re * re) * -6.75;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.05d+162) then
tmp = -im
else
tmp = (re * re) * (-6.75d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.05e+162) {
tmp = -im;
} else {
tmp = (re * re) * -6.75;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.05e+162: tmp = -im else: tmp = (re * re) * -6.75 return tmp
function code(re, im) tmp = 0.0 if (re <= 1.05e+162) tmp = Float64(-im); else tmp = Float64(Float64(re * re) * -6.75); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.05e+162) tmp = -im; else tmp = (re * re) * -6.75; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.05e+162], (-im), N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.05 \cdot 10^{+162}:\\
\;\;\;\;-im\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -6.75\\
\end{array}
\end{array}
if re < 1.05e162Initial program 55.9%
neg-sub055.9%
Simplified55.9%
Taylor expanded in im around 0 79.2%
+-commutative79.2%
mul-1-neg79.2%
unsub-neg79.2%
associate-*r*79.2%
distribute-rgt-out--79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in re around 0 56.9%
Taylor expanded in im around 0 34.1%
neg-mul-134.1%
Simplified34.1%
if 1.05e162 < re Initial program 48.0%
neg-sub048.0%
Simplified48.0%
Taylor expanded in re around 0 0.1%
+-commutative0.1%
associate-*r*0.1%
distribute-rgt-out24.2%
unpow224.2%
Simplified24.2%
Applied egg-rr25.1%
Taylor expanded in re around inf 25.1%
unpow225.1%
*-commutative25.1%
associate-*l*25.1%
Simplified25.1%
Taylor expanded in re around 0 25.1%
unpow225.1%
Simplified25.1%
Final simplification33.1%
(FPCore (re im) :precision binary64 (if (<= re 8.6e+161) (* 0.5 (* im -2.0)) (* (* re re) -6.75)))
double code(double re, double im) {
double tmp;
if (re <= 8.6e+161) {
tmp = 0.5 * (im * -2.0);
} else {
tmp = (re * re) * -6.75;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 8.6d+161) then
tmp = 0.5d0 * (im * (-2.0d0))
else
tmp = (re * re) * (-6.75d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 8.6e+161) {
tmp = 0.5 * (im * -2.0);
} else {
tmp = (re * re) * -6.75;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 8.6e+161: tmp = 0.5 * (im * -2.0) else: tmp = (re * re) * -6.75 return tmp
function code(re, im) tmp = 0.0 if (re <= 8.6e+161) tmp = Float64(0.5 * Float64(im * -2.0)); else tmp = Float64(Float64(re * re) * -6.75); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 8.6e+161) tmp = 0.5 * (im * -2.0); else tmp = (re * re) * -6.75; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 8.6e+161], N[(0.5 * N[(im * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 8.6 \cdot 10^{+161}:\\
\;\;\;\;0.5 \cdot \left(im \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -6.75\\
\end{array}
\end{array}
if re < 8.6e161Initial program 55.9%
neg-sub055.9%
Simplified55.9%
Taylor expanded in re around 0 44.1%
Taylor expanded in im around 0 34.4%
if 8.6e161 < re Initial program 48.0%
neg-sub048.0%
Simplified48.0%
Taylor expanded in re around 0 0.1%
+-commutative0.1%
associate-*r*0.1%
distribute-rgt-out24.2%
unpow224.2%
Simplified24.2%
Applied egg-rr25.1%
Taylor expanded in re around inf 25.1%
unpow225.1%
*-commutative25.1%
associate-*l*25.1%
Simplified25.1%
Taylor expanded in re around 0 25.1%
unpow225.1%
Simplified25.1%
Final simplification33.4%
(FPCore (re im) :precision binary64 (- im))
double code(double re, double im) {
return -im;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -im
end function
public static double code(double re, double im) {
return -im;
}
def code(re, im): return -im
function code(re, im) return Float64(-im) end
function tmp = code(re, im) tmp = -im; end
code[re_, im_] := (-im)
\begin{array}{l}
\\
-im
\end{array}
Initial program 55.0%
neg-sub055.0%
Simplified55.0%
Taylor expanded in im around 0 79.5%
+-commutative79.5%
mul-1-neg79.5%
unsub-neg79.5%
associate-*r*79.5%
distribute-rgt-out--79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in re around 0 52.8%
Taylor expanded in im around 0 31.1%
neg-mul-131.1%
Simplified31.1%
Final simplification31.1%
(FPCore (re im) :precision binary64 13.5)
double code(double re, double im) {
return 13.5;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 13.5d0
end function
public static double code(double re, double im) {
return 13.5;
}
def code(re, im): return 13.5
function code(re, im) return 13.5 end
function tmp = code(re, im) tmp = 13.5; end
code[re_, im_] := 13.5
\begin{array}{l}
\\
13.5
\end{array}
Initial program 55.0%
neg-sub055.0%
Simplified55.0%
Taylor expanded in re around 0 2.4%
+-commutative2.4%
associate-*r*2.4%
distribute-rgt-out39.5%
unpow239.5%
Simplified39.5%
Applied egg-rr8.4%
Taylor expanded in re around 0 2.8%
Final simplification2.8%
(FPCore (re im)
:precision binary64
(if (< (fabs im) 1.0)
(-
(*
(cos re)
(+
(+ im (* (* (* 0.16666666666666666 im) im) im))
(* (* (* (* (* 0.008333333333333333 im) im) im) im) im))))
(* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im)))))
double code(double re, double im) {
double tmp;
if (fabs(im) < 1.0) {
tmp = -(cos(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
} else {
tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (abs(im) < 1.0d0) then
tmp = -(cos(re) * ((im + (((0.16666666666666666d0 * im) * im) * im)) + (((((0.008333333333333333d0 * im) * im) * im) * im) * im)))
else
tmp = (0.5d0 * cos(re)) * (exp((0.0d0 - im)) - exp(im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.abs(im) < 1.0) {
tmp = -(Math.cos(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
} else {
tmp = (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
}
return tmp;
}
def code(re, im): tmp = 0 if math.fabs(im) < 1.0: tmp = -(math.cos(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im))) else: tmp = (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im)) return tmp
function code(re, im) tmp = 0.0 if (abs(im) < 1.0) tmp = Float64(-Float64(cos(re) * Float64(Float64(im + Float64(Float64(Float64(0.16666666666666666 * im) * im) * im)) + Float64(Float64(Float64(Float64(Float64(0.008333333333333333 * im) * im) * im) * im) * im)))); else tmp = Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (abs(im) < 1.0) tmp = -(cos(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im))); else tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im)); end tmp_2 = tmp; end
code[re_, im_] := If[Less[N[Abs[im], $MachinePrecision], 1.0], (-N[(N[Cos[re], $MachinePrecision] * N[(N[(im + N[(N[(N[(0.16666666666666666 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(0.008333333333333333 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|im\right| < 1:\\
\;\;\;\;-\cos re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)\\
\end{array}
\end{array}
herbie shell --seed 2023271
(FPCore (re im)
:name "math.sin on complex, imaginary part"
:precision binary64
:herbie-target
(if (< (fabs im) 1.0) (- (* (cos re) (+ (+ im (* (* (* 0.16666666666666666 im) im) im)) (* (* (* (* (* 0.008333333333333333 im) im) im) im) im)))) (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))
(* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))