
(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 17 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 (- INFINITY)) (not (<= t_0 1e-10)))
(* (* 0.5 (cos re)) t_0)
(* im (- (cos re))))))
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 1e-10)) {
tmp = (0.5 * cos(re)) * t_0;
} else {
tmp = im * -cos(re);
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 1e-10)) {
tmp = (0.5 * Math.cos(re)) * t_0;
} else {
tmp = im * -Math.cos(re);
}
return tmp;
}
def code(re, im): t_0 = math.exp(-im) - math.exp(im) tmp = 0 if (t_0 <= -math.inf) or not (t_0 <= 1e-10): tmp = (0.5 * math.cos(re)) * t_0 else: tmp = im * -math.cos(re) return tmp
function code(re, im) t_0 = Float64(exp(Float64(-im)) - exp(im)) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 1e-10)) tmp = Float64(Float64(0.5 * cos(re)) * t_0); else tmp = Float64(im * Float64(-cos(re))); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(-im) - exp(im); tmp = 0.0; if ((t_0 <= -Inf) || ~((t_0 <= 1e-10))) tmp = (0.5 * cos(re)) * t_0; else tmp = im * -cos(re); 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, (-Infinity)], N[Not[LessEqual[t$95$0, 1e-10]], $MachinePrecision]], N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{-10}\right):\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) < -inf.0 or 1.00000000000000004e-10 < (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
if -inf.0 < (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) < 1.00000000000000004e-10Initial program 6.6%
sub0-neg6.6%
Simplified6.6%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(if (or (<= im -1.25e+101)
(and (not (<= im -1.65)) (or (<= im 0.055) (not (<= im 5.6e+102)))))
(* (cos re) (- (* (pow im 3.0) -0.16666666666666666) im))
(* (- (exp (- im)) (exp im)) (+ 0.5 (* re (* re -0.25))))))
double code(double re, double im) {
double tmp;
if ((im <= -1.25e+101) || (!(im <= -1.65) && ((im <= 0.055) || !(im <= 5.6e+102)))) {
tmp = cos(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
} else {
tmp = (exp(-im) - exp(im)) * (0.5 + (re * (re * -0.25)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-1.25d+101)) .or. (.not. (im <= (-1.65d0))) .and. (im <= 0.055d0) .or. (.not. (im <= 5.6d+102))) then
tmp = cos(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
else
tmp = (exp(-im) - exp(im)) * (0.5d0 + (re * (re * (-0.25d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -1.25e+101) || (!(im <= -1.65) && ((im <= 0.055) || !(im <= 5.6e+102)))) {
tmp = Math.cos(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
} else {
tmp = (Math.exp(-im) - Math.exp(im)) * (0.5 + (re * (re * -0.25)));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -1.25e+101) or (not (im <= -1.65) and ((im <= 0.055) or not (im <= 5.6e+102))): tmp = math.cos(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) else: tmp = (math.exp(-im) - math.exp(im)) * (0.5 + (re * (re * -0.25))) return tmp
function code(re, im) tmp = 0.0 if ((im <= -1.25e+101) || (!(im <= -1.65) && ((im <= 0.055) || !(im <= 5.6e+102)))) tmp = Float64(cos(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)); else tmp = Float64(Float64(exp(Float64(-im)) - exp(im)) * Float64(0.5 + Float64(re * Float64(re * -0.25)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -1.25e+101) || (~((im <= -1.65)) && ((im <= 0.055) || ~((im <= 5.6e+102))))) tmp = cos(re) * (((im ^ 3.0) * -0.16666666666666666) - im); else tmp = (exp(-im) - exp(im)) * (0.5 + (re * (re * -0.25))); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -1.25e+101], And[N[Not[LessEqual[im, -1.65]], $MachinePrecision], Or[LessEqual[im, 0.055], N[Not[LessEqual[im, 5.6e+102]], $MachinePrecision]]]], N[(N[Cos[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1.25 \cdot 10^{+101} \lor \neg \left(im \leq -1.65\right) \land \left(im \leq 0.055 \lor \neg \left(im \leq 5.6 \cdot 10^{+102}\right)\right):\\
\;\;\;\;\cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 + re \cdot \left(re \cdot -0.25\right)\right)\\
\end{array}
\end{array}
if im < -1.24999999999999997e101 or -1.6499999999999999 < im < 0.0550000000000000003 or 5.60000000000000037e102 < im Initial program 43.9%
sub0-neg43.9%
Simplified43.9%
Taylor expanded in im around 0 99.1%
mul-1-neg99.1%
unsub-neg99.1%
*-commutative99.1%
associate-*l*99.1%
distribute-lft-out--99.1%
Simplified99.1%
if -1.24999999999999997e101 < im < -1.6499999999999999 or 0.0550000000000000003 < im < 5.60000000000000037e102Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out83.7%
+-commutative83.7%
*-commutative83.7%
unpow283.7%
associate-*l*83.7%
Simplified83.7%
Final simplification96.5%
(FPCore (re im)
:precision binary64
(if (or (<= im -5.6e+102)
(and (not (<= im -1.65)) (or (<= im 6600.0) (not (<= im 3.3e+102)))))
(* (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 <= -5.6e+102) || (!(im <= -1.65) && ((im <= 6600.0) || !(im <= 3.3e+102)))) {
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 <= (-5.6d+102)) .or. (.not. (im <= (-1.65d0))) .and. (im <= 6600.0d0) .or. (.not. (im <= 3.3d+102))) 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 <= -5.6e+102) || (!(im <= -1.65) && ((im <= 6600.0) || !(im <= 3.3e+102)))) {
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 <= -5.6e+102) or (not (im <= -1.65) and ((im <= 6600.0) or not (im <= 3.3e+102))): 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 <= -5.6e+102) || (!(im <= -1.65) && ((im <= 6600.0) || !(im <= 3.3e+102)))) 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 <= -5.6e+102) || (~((im <= -1.65)) && ((im <= 6600.0) || ~((im <= 3.3e+102))))) 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, -5.6e+102], And[N[Not[LessEqual[im, -1.65]], $MachinePrecision], Or[LessEqual[im, 6600.0], N[Not[LessEqual[im, 3.3e+102]], $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 -5.6 \cdot 10^{+102} \lor \neg \left(im \leq -1.65\right) \land \left(im \leq 6600 \lor \neg \left(im \leq 3.3 \cdot 10^{+102}\right)\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 < -5.60000000000000037e102 or -1.6499999999999999 < im < 6600 or 3.29999999999999999e102 < im Initial program 44.1%
sub0-neg44.1%
Simplified44.1%
Taylor expanded in im around 0 98.7%
mul-1-neg98.7%
unsub-neg98.7%
*-commutative98.7%
associate-*l*98.7%
distribute-lft-out--98.7%
Simplified98.7%
if -5.60000000000000037e102 < im < -1.6499999999999999 or 6600 < im < 3.29999999999999999e102Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 71.4%
Final simplification94.2%
(FPCore (re im)
:precision binary64
(if (<= im -5.5e+150)
(/ (- 387420489.0 (* im im)) (/ im (cos re)))
(if (or (<= im -1.65) (not (<= im 6600.0)))
(* 0.5 (- (exp (- im)) (exp im)))
(* im (- (cos re))))))
double code(double re, double im) {
double tmp;
if (im <= -5.5e+150) {
tmp = (387420489.0 - (im * im)) / (im / cos(re));
} else if ((im <= -1.65) || !(im <= 6600.0)) {
tmp = 0.5 * (exp(-im) - exp(im));
} else {
tmp = im * -cos(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-5.5d+150)) then
tmp = (387420489.0d0 - (im * im)) / (im / cos(re))
else if ((im <= (-1.65d0)) .or. (.not. (im <= 6600.0d0))) then
tmp = 0.5d0 * (exp(-im) - exp(im))
else
tmp = im * -cos(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -5.5e+150) {
tmp = (387420489.0 - (im * im)) / (im / Math.cos(re));
} else if ((im <= -1.65) || !(im <= 6600.0)) {
tmp = 0.5 * (Math.exp(-im) - Math.exp(im));
} else {
tmp = im * -Math.cos(re);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -5.5e+150: tmp = (387420489.0 - (im * im)) / (im / math.cos(re)) elif (im <= -1.65) or not (im <= 6600.0): tmp = 0.5 * (math.exp(-im) - math.exp(im)) else: tmp = im * -math.cos(re) return tmp
function code(re, im) tmp = 0.0 if (im <= -5.5e+150) tmp = Float64(Float64(387420489.0 - Float64(im * im)) / Float64(im / cos(re))); elseif ((im <= -1.65) || !(im <= 6600.0)) tmp = Float64(0.5 * Float64(exp(Float64(-im)) - exp(im))); else tmp = Float64(im * Float64(-cos(re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -5.5e+150) tmp = (387420489.0 - (im * im)) / (im / cos(re)); elseif ((im <= -1.65) || ~((im <= 6600.0))) tmp = 0.5 * (exp(-im) - exp(im)); else tmp = im * -cos(re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -5.5e+150], N[(N[(387420489.0 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(im / N[Cos[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[im, -1.65], N[Not[LessEqual[im, 6600.0]], $MachinePrecision]], N[(0.5 * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -5.5 \cdot 10^{+150}:\\
\;\;\;\;\frac{387420489 - im \cdot im}{\frac{im}{\cos re}}\\
\mathbf{elif}\;im \leq -1.65 \lor \neg \left(im \leq 6600\right):\\
\;\;\;\;0.5 \cdot \left(e^{-im} - e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\end{array}
\end{array}
if im < -5.50000000000000017e150Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out--100.0%
Simplified100.0%
Applied egg-rr7.1%
flip--97.1%
associate-*r/97.1%
metadata-eval97.1%
+-commutative97.1%
Applied egg-rr97.1%
*-commutative97.1%
associate-/l*97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in im around inf 97.1%
if -5.50000000000000017e150 < im < -1.6499999999999999 or 6600 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 73.1%
if -1.6499999999999999 < im < 6600Initial program 8.0%
sub0-neg8.0%
Simplified8.0%
Taylor expanded in im around 0 98.4%
mul-1-neg98.4%
*-commutative98.4%
distribute-lft-neg-in98.4%
Simplified98.4%
Final simplification89.0%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
(+ (* -0.5 (* re re)) 1.0)
(- (* (pow im 3.0) -0.16666666666666666) im)))
(t_1 (/ (- 387420489.0 (* im im)) (/ im (cos re)))))
(if (<= im -7.5e+163)
t_1
(if (<= im -580.0)
t_0
(if (<= im 550.0) (* im (- (cos re))) (if (<= im 2.6e+150) t_0 t_1))))))
double code(double re, double im) {
double t_0 = ((-0.5 * (re * re)) + 1.0) * ((pow(im, 3.0) * -0.16666666666666666) - im);
double t_1 = (387420489.0 - (im * im)) / (im / cos(re));
double tmp;
if (im <= -7.5e+163) {
tmp = t_1;
} else if (im <= -580.0) {
tmp = t_0;
} else if (im <= 550.0) {
tmp = im * -cos(re);
} else if (im <= 2.6e+150) {
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 = (((-0.5d0) * (re * re)) + 1.0d0) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
t_1 = (387420489.0d0 - (im * im)) / (im / cos(re))
if (im <= (-7.5d+163)) then
tmp = t_1
else if (im <= (-580.0d0)) then
tmp = t_0
else if (im <= 550.0d0) then
tmp = im * -cos(re)
else if (im <= 2.6d+150) 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 = ((-0.5 * (re * re)) + 1.0) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
double t_1 = (387420489.0 - (im * im)) / (im / Math.cos(re));
double tmp;
if (im <= -7.5e+163) {
tmp = t_1;
} else if (im <= -580.0) {
tmp = t_0;
} else if (im <= 550.0) {
tmp = im * -Math.cos(re);
} else if (im <= 2.6e+150) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = ((-0.5 * (re * re)) + 1.0) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) t_1 = (387420489.0 - (im * im)) / (im / math.cos(re)) tmp = 0 if im <= -7.5e+163: tmp = t_1 elif im <= -580.0: tmp = t_0 elif im <= 550.0: tmp = im * -math.cos(re) elif im <= 2.6e+150: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(Float64(Float64(-0.5 * Float64(re * re)) + 1.0) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) t_1 = Float64(Float64(387420489.0 - Float64(im * im)) / Float64(im / cos(re))) tmp = 0.0 if (im <= -7.5e+163) tmp = t_1; elseif (im <= -580.0) tmp = t_0; elseif (im <= 550.0) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 2.6e+150) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = ((-0.5 * (re * re)) + 1.0) * (((im ^ 3.0) * -0.16666666666666666) - im); t_1 = (387420489.0 - (im * im)) / (im / cos(re)); tmp = 0.0; if (im <= -7.5e+163) tmp = t_1; elseif (im <= -580.0) tmp = t_0; elseif (im <= 550.0) tmp = im * -cos(re); elseif (im <= 2.6e+150) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[(-0.5 * N[(re * re), $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[(387420489.0 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(im / N[Cos[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.5e+163], t$95$1, If[LessEqual[im, -580.0], t$95$0, If[LessEqual[im, 550.0], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 2.6e+150], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-0.5 \cdot \left(re \cdot re\right) + 1\right) \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
t_1 := \frac{387420489 - im \cdot im}{\frac{im}{\cos re}}\\
\mathbf{if}\;im \leq -7.5 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -580:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 550:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 2.6 \cdot 10^{+150}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -7.50000000000000001e163 or 2.60000000000000006e150 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out--100.0%
Simplified100.0%
Applied egg-rr7.1%
flip--98.4%
associate-*r/98.4%
metadata-eval98.4%
+-commutative98.4%
Applied egg-rr98.4%
*-commutative98.4%
associate-/l*98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in im around inf 98.4%
if -7.50000000000000001e163 < im < -580 or 550 < im < 2.60000000000000006e150Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 39.0%
mul-1-neg39.0%
unsub-neg39.0%
*-commutative39.0%
associate-*l*39.0%
distribute-lft-out--39.0%
Simplified39.0%
Taylor expanded in re around 0 19.7%
associate--l+19.7%
associate-*r*19.7%
distribute-lft1-in46.2%
unpow246.2%
Simplified46.2%
if -580 < im < 550Initial program 7.3%
sub0-neg7.3%
Simplified7.3%
Taylor expanded in im around 0 99.1%
mul-1-neg99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
Simplified99.1%
Final simplification84.9%
(FPCore (re im)
:precision binary64
(let* ((t_0
(* (* -0.5 (* re re)) (- (* (pow im 3.0) -0.16666666666666666) im)))
(t_1 (/ (- 387420489.0 (* im im)) (/ im (cos re)))))
(if (<= im -2.65e+154)
t_1
(if (<= im -88000000.0)
t_0
(if (<= im 700.0) (* im (- (cos re))) (if (<= im 3.3e+145) t_0 t_1))))))
double code(double re, double im) {
double t_0 = (-0.5 * (re * re)) * ((pow(im, 3.0) * -0.16666666666666666) - im);
double t_1 = (387420489.0 - (im * im)) / (im / cos(re));
double tmp;
if (im <= -2.65e+154) {
tmp = t_1;
} else if (im <= -88000000.0) {
tmp = t_0;
} else if (im <= 700.0) {
tmp = im * -cos(re);
} else if (im <= 3.3e+145) {
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 = ((-0.5d0) * (re * re)) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
t_1 = (387420489.0d0 - (im * im)) / (im / cos(re))
if (im <= (-2.65d+154)) then
tmp = t_1
else if (im <= (-88000000.0d0)) then
tmp = t_0
else if (im <= 700.0d0) then
tmp = im * -cos(re)
else if (im <= 3.3d+145) 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 = (-0.5 * (re * re)) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
double t_1 = (387420489.0 - (im * im)) / (im / Math.cos(re));
double tmp;
if (im <= -2.65e+154) {
tmp = t_1;
} else if (im <= -88000000.0) {
tmp = t_0;
} else if (im <= 700.0) {
tmp = im * -Math.cos(re);
} else if (im <= 3.3e+145) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = (-0.5 * (re * re)) * ((math.pow(im, 3.0) * -0.16666666666666666) - im) t_1 = (387420489.0 - (im * im)) / (im / math.cos(re)) tmp = 0 if im <= -2.65e+154: tmp = t_1 elif im <= -88000000.0: tmp = t_0 elif im <= 700.0: tmp = im * -math.cos(re) elif im <= 3.3e+145: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(Float64(-0.5 * Float64(re * re)) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)) t_1 = Float64(Float64(387420489.0 - Float64(im * im)) / Float64(im / cos(re))) tmp = 0.0 if (im <= -2.65e+154) tmp = t_1; elseif (im <= -88000000.0) tmp = t_0; elseif (im <= 700.0) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 3.3e+145) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = (-0.5 * (re * re)) * (((im ^ 3.0) * -0.16666666666666666) - im); t_1 = (387420489.0 - (im * im)) / (im / cos(re)); tmp = 0.0; if (im <= -2.65e+154) tmp = t_1; elseif (im <= -88000000.0) tmp = t_0; elseif (im <= 700.0) tmp = im * -cos(re); elseif (im <= 3.3e+145) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(-0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(387420489.0 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(im / N[Cos[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2.65e+154], t$95$1, If[LessEqual[im, -88000000.0], t$95$0, If[LessEqual[im, 700.0], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 3.3e+145], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-0.5 \cdot \left(re \cdot re\right)\right) \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
t_1 := \frac{387420489 - im \cdot im}{\frac{im}{\cos re}}\\
\mathbf{if}\;im \leq -2.65 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -88000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 700:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 3.3 \cdot 10^{+145}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -2.65000000000000012e154 or 3.30000000000000027e145 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out--100.0%
Simplified100.0%
Applied egg-rr6.9%
flip--96.9%
associate-*r/96.9%
metadata-eval96.9%
+-commutative96.9%
Applied egg-rr96.9%
*-commutative96.9%
associate-/l*96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in im around inf 96.9%
if -2.65000000000000012e154 < im < -8.8e7 or 700 < im < 3.30000000000000027e145Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 36.7%
mul-1-neg36.7%
unsub-neg36.7%
*-commutative36.7%
associate-*l*36.7%
distribute-lft-out--36.7%
Simplified36.7%
Taylor expanded in re around 0 20.9%
associate--l+20.9%
associate-*r*20.9%
distribute-lft1-in44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in re around inf 35.0%
unpow235.0%
associate-*r*35.0%
*-commutative35.0%
Simplified35.0%
if -8.8e7 < im < 700Initial program 8.0%
sub0-neg8.0%
Simplified8.0%
Taylor expanded in im around 0 98.4%
mul-1-neg98.4%
*-commutative98.4%
distribute-lft-neg-in98.4%
Simplified98.4%
Final simplification82.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- 387420489.0 (* im im)))
(t_1
(+
(* -0.5 (/ (* t_0 (* re re)) (+ im 19683.0)))
(/ t_0 (+ im 19683.0))))
(t_2 (/ t_0 (/ im (cos re)))))
(if (<= im -1.32e+154)
t_2
(if (<= im -650.0)
t_1
(if (<= im 86000000000.0)
(* im (- (cos re)))
(if (<= im 3.3e+145) t_1 t_2))))))
double code(double re, double im) {
double t_0 = 387420489.0 - (im * im);
double t_1 = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + (t_0 / (im + 19683.0));
double t_2 = t_0 / (im / cos(re));
double tmp;
if (im <= -1.32e+154) {
tmp = t_2;
} else if (im <= -650.0) {
tmp = t_1;
} else if (im <= 86000000000.0) {
tmp = im * -cos(re);
} else if (im <= 3.3e+145) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 387420489.0d0 - (im * im)
t_1 = ((-0.5d0) * ((t_0 * (re * re)) / (im + 19683.0d0))) + (t_0 / (im + 19683.0d0))
t_2 = t_0 / (im / cos(re))
if (im <= (-1.32d+154)) then
tmp = t_2
else if (im <= (-650.0d0)) then
tmp = t_1
else if (im <= 86000000000.0d0) then
tmp = im * -cos(re)
else if (im <= 3.3d+145) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 387420489.0 - (im * im);
double t_1 = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + (t_0 / (im + 19683.0));
double t_2 = t_0 / (im / Math.cos(re));
double tmp;
if (im <= -1.32e+154) {
tmp = t_2;
} else if (im <= -650.0) {
tmp = t_1;
} else if (im <= 86000000000.0) {
tmp = im * -Math.cos(re);
} else if (im <= 3.3e+145) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(re, im): t_0 = 387420489.0 - (im * im) t_1 = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + (t_0 / (im + 19683.0)) t_2 = t_0 / (im / math.cos(re)) tmp = 0 if im <= -1.32e+154: tmp = t_2 elif im <= -650.0: tmp = t_1 elif im <= 86000000000.0: tmp = im * -math.cos(re) elif im <= 3.3e+145: tmp = t_1 else: tmp = t_2 return tmp
function code(re, im) t_0 = Float64(387420489.0 - Float64(im * im)) t_1 = Float64(Float64(-0.5 * Float64(Float64(t_0 * Float64(re * re)) / Float64(im + 19683.0))) + Float64(t_0 / Float64(im + 19683.0))) t_2 = Float64(t_0 / Float64(im / cos(re))) tmp = 0.0 if (im <= -1.32e+154) tmp = t_2; elseif (im <= -650.0) tmp = t_1; elseif (im <= 86000000000.0) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 3.3e+145) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(re, im) t_0 = 387420489.0 - (im * im); t_1 = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + (t_0 / (im + 19683.0)); t_2 = t_0 / (im / cos(re)); tmp = 0.0; if (im <= -1.32e+154) tmp = t_2; elseif (im <= -650.0) tmp = t_1; elseif (im <= 86000000000.0) tmp = im * -cos(re); elseif (im <= 3.3e+145) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(387420489.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-0.5 * N[(N[(t$95$0 * N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 / N[(im / N[Cos[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.32e+154], t$95$2, If[LessEqual[im, -650.0], t$95$1, If[LessEqual[im, 86000000000.0], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 3.3e+145], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 387420489 - im \cdot im\\
t_1 := -0.5 \cdot \frac{t_0 \cdot \left(re \cdot re\right)}{im + 19683} + \frac{t_0}{im + 19683}\\
t_2 := \frac{t_0}{\frac{im}{\cos re}}\\
\mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;im \leq -650:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 86000000000:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 3.3 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if im < -1.31999999999999998e154 or 3.30000000000000027e145 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out--100.0%
Simplified100.0%
Applied egg-rr6.9%
flip--97.0%
associate-*r/97.0%
metadata-eval97.0%
+-commutative97.0%
Applied egg-rr97.0%
*-commutative97.0%
associate-/l*97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in im around inf 97.0%
if -1.31999999999999998e154 < im < -650 or 8.6e10 < im < 3.30000000000000027e145Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 36.3%
mul-1-neg36.3%
unsub-neg36.3%
*-commutative36.3%
associate-*l*36.3%
distribute-lft-out--36.3%
Simplified36.3%
Applied egg-rr3.8%
flip--3.8%
associate-*r/3.8%
metadata-eval3.8%
+-commutative3.8%
Applied egg-rr3.8%
*-commutative3.8%
associate-/l*3.8%
+-commutative3.8%
Simplified3.8%
Taylor expanded in re around 0 31.0%
associate--l+31.0%
unpow231.0%
*-commutative31.0%
unpow231.0%
+-commutative31.0%
associate-*r/31.0%
metadata-eval31.0%
unpow231.0%
div-sub31.0%
+-commutative31.0%
Simplified31.0%
if -650 < im < 8.6e10Initial program 8.7%
sub0-neg8.7%
Simplified8.7%
Taylor expanded in im around 0 97.7%
mul-1-neg97.7%
*-commutative97.7%
distribute-lft-neg-in97.7%
Simplified97.7%
Final simplification81.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (* (pow im 3.0) -0.16666666666666666) im))
(t_1 (- 387420489.0 (* im im))))
(if (<= im -1.3e+42)
t_0
(if (<= im 16500000000000.0)
(* im (- (cos re)))
(if (<= im 5.6e+102)
(+
(* -0.5 (/ (* t_1 (* re re)) (+ im 19683.0)))
(/ t_1 (+ im 19683.0)))
t_0)))))
double code(double re, double im) {
double t_0 = (pow(im, 3.0) * -0.16666666666666666) - im;
double t_1 = 387420489.0 - (im * im);
double tmp;
if (im <= -1.3e+42) {
tmp = t_0;
} else if (im <= 16500000000000.0) {
tmp = im * -cos(re);
} else if (im <= 5.6e+102) {
tmp = (-0.5 * ((t_1 * (re * re)) / (im + 19683.0))) + (t_1 / (im + 19683.0));
} 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)) - im
t_1 = 387420489.0d0 - (im * im)
if (im <= (-1.3d+42)) then
tmp = t_0
else if (im <= 16500000000000.0d0) then
tmp = im * -cos(re)
else if (im <= 5.6d+102) then
tmp = ((-0.5d0) * ((t_1 * (re * re)) / (im + 19683.0d0))) + (t_1 / (im + 19683.0d0))
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) - im;
double t_1 = 387420489.0 - (im * im);
double tmp;
if (im <= -1.3e+42) {
tmp = t_0;
} else if (im <= 16500000000000.0) {
tmp = im * -Math.cos(re);
} else if (im <= 5.6e+102) {
tmp = (-0.5 * ((t_1 * (re * re)) / (im + 19683.0))) + (t_1 / (im + 19683.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (math.pow(im, 3.0) * -0.16666666666666666) - im t_1 = 387420489.0 - (im * im) tmp = 0 if im <= -1.3e+42: tmp = t_0 elif im <= 16500000000000.0: tmp = im * -math.cos(re) elif im <= 5.6e+102: tmp = (-0.5 * ((t_1 * (re * re)) / (im + 19683.0))) + (t_1 / (im + 19683.0)) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im) t_1 = Float64(387420489.0 - Float64(im * im)) tmp = 0.0 if (im <= -1.3e+42) tmp = t_0; elseif (im <= 16500000000000.0) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 5.6e+102) tmp = Float64(Float64(-0.5 * Float64(Float64(t_1 * Float64(re * re)) / Float64(im + 19683.0))) + Float64(t_1 / Float64(im + 19683.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = ((im ^ 3.0) * -0.16666666666666666) - im; t_1 = 387420489.0 - (im * im); tmp = 0.0; if (im <= -1.3e+42) tmp = t_0; elseif (im <= 16500000000000.0) tmp = im * -cos(re); elseif (im <= 5.6e+102) tmp = (-0.5 * ((t_1 * (re * re)) / (im + 19683.0))) + (t_1 / (im + 19683.0)); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]}, Block[{t$95$1 = N[(387420489.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.3e+42], t$95$0, If[LessEqual[im, 16500000000000.0], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 5.6e+102], N[(N[(-0.5 * N[(N[(t$95$1 * N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666 - im\\
t_1 := 387420489 - im \cdot im\\
\mathbf{if}\;im \leq -1.3 \cdot 10^{+42}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 16500000000000:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 5.6 \cdot 10^{+102}:\\
\;\;\;\;-0.5 \cdot \frac{t_1 \cdot \left(re \cdot re\right)}{im + 19683} + \frac{t_1}{im + 19683}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -1.29999999999999995e42 or 5.60000000000000037e102 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 87.4%
mul-1-neg87.4%
unsub-neg87.4%
*-commutative87.4%
associate-*l*87.4%
distribute-lft-out--87.4%
Simplified87.4%
Taylor expanded in re around 0 68.4%
if -1.29999999999999995e42 < im < 1.65e13Initial program 12.7%
sub0-neg12.7%
Simplified12.7%
Taylor expanded in im around 0 93.5%
mul-1-neg93.5%
*-commutative93.5%
distribute-lft-neg-in93.5%
Simplified93.5%
if 1.65e13 < im < 5.60000000000000037e102Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 5.7%
mul-1-neg5.7%
unsub-neg5.7%
*-commutative5.7%
associate-*l*5.7%
distribute-lft-out--5.7%
Simplified5.7%
Applied egg-rr3.6%
flip--3.6%
associate-*r/3.6%
metadata-eval3.6%
+-commutative3.6%
Applied egg-rr3.6%
*-commutative3.6%
associate-/l*3.6%
+-commutative3.6%
Simplified3.6%
Taylor expanded in re around 0 32.4%
associate--l+32.4%
unpow232.4%
*-commutative32.4%
unpow232.4%
+-commutative32.4%
associate-*r/32.4%
metadata-eval32.4%
unpow232.4%
div-sub32.4%
+-commutative32.4%
Simplified32.4%
Final simplification78.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- 387420489.0 (* im im))) (t_1 (/ t_0 (+ im 19683.0))))
(if (<= im -7.5e+163)
t_1
(if (<= im -88000000.0)
(- (* im (* 0.5 (* re re))) im)
(if (<= im 17000000000.0)
(* im (- (cos re)))
(if (<= im 3.3e+145)
(+ (* -0.5 (/ (* t_0 (* re re)) (+ im 19683.0))) t_1)
t_1))))))
double code(double re, double im) {
double t_0 = 387420489.0 - (im * im);
double t_1 = t_0 / (im + 19683.0);
double tmp;
if (im <= -7.5e+163) {
tmp = t_1;
} else if (im <= -88000000.0) {
tmp = (im * (0.5 * (re * re))) - im;
} else if (im <= 17000000000.0) {
tmp = im * -cos(re);
} else if (im <= 3.3e+145) {
tmp = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + t_1;
} 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 = 387420489.0d0 - (im * im)
t_1 = t_0 / (im + 19683.0d0)
if (im <= (-7.5d+163)) then
tmp = t_1
else if (im <= (-88000000.0d0)) then
tmp = (im * (0.5d0 * (re * re))) - im
else if (im <= 17000000000.0d0) then
tmp = im * -cos(re)
else if (im <= 3.3d+145) then
tmp = ((-0.5d0) * ((t_0 * (re * re)) / (im + 19683.0d0))) + t_1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 387420489.0 - (im * im);
double t_1 = t_0 / (im + 19683.0);
double tmp;
if (im <= -7.5e+163) {
tmp = t_1;
} else if (im <= -88000000.0) {
tmp = (im * (0.5 * (re * re))) - im;
} else if (im <= 17000000000.0) {
tmp = im * -Math.cos(re);
} else if (im <= 3.3e+145) {
tmp = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + t_1;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 387420489.0 - (im * im) t_1 = t_0 / (im + 19683.0) tmp = 0 if im <= -7.5e+163: tmp = t_1 elif im <= -88000000.0: tmp = (im * (0.5 * (re * re))) - im elif im <= 17000000000.0: tmp = im * -math.cos(re) elif im <= 3.3e+145: tmp = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + t_1 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(387420489.0 - Float64(im * im)) t_1 = Float64(t_0 / Float64(im + 19683.0)) tmp = 0.0 if (im <= -7.5e+163) tmp = t_1; elseif (im <= -88000000.0) tmp = Float64(Float64(im * Float64(0.5 * Float64(re * re))) - im); elseif (im <= 17000000000.0) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 3.3e+145) tmp = Float64(Float64(-0.5 * Float64(Float64(t_0 * Float64(re * re)) / Float64(im + 19683.0))) + t_1); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 387420489.0 - (im * im); t_1 = t_0 / (im + 19683.0); tmp = 0.0; if (im <= -7.5e+163) tmp = t_1; elseif (im <= -88000000.0) tmp = (im * (0.5 * (re * re))) - im; elseif (im <= 17000000000.0) tmp = im * -cos(re); elseif (im <= 3.3e+145) tmp = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + t_1; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(387420489.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.5e+163], t$95$1, If[LessEqual[im, -88000000.0], N[(N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 17000000000.0], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 3.3e+145], N[(N[(-0.5 * N[(N[(t$95$0 * N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 387420489 - im \cdot im\\
t_1 := \frac{t_0}{im + 19683}\\
\mathbf{if}\;im \leq -7.5 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -88000000:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right) - im\\
\mathbf{elif}\;im \leq 17000000000:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 3.3 \cdot 10^{+145}:\\
\;\;\;\;-0.5 \cdot \frac{t_0 \cdot \left(re \cdot re\right)}{im + 19683} + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -7.50000000000000001e163 or 3.30000000000000027e145 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out--100.0%
Simplified100.0%
Applied egg-rr7.0%
flip--96.8%
associate-*r/96.8%
metadata-eval96.8%
+-commutative96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in re around 0 85.2%
unpow285.2%
+-commutative85.2%
Simplified85.2%
if -7.50000000000000001e163 < im < -8.8e7Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 4.0%
mul-1-neg4.0%
*-commutative4.0%
distribute-lft-neg-in4.0%
Simplified4.0%
Taylor expanded in re around 0 29.5%
neg-mul-129.5%
+-commutative29.5%
unsub-neg29.5%
*-commutative29.5%
*-commutative29.5%
associate-*l*29.5%
unpow229.5%
Simplified29.5%
if -8.8e7 < im < 1.7e10Initial program 9.4%
sub0-neg9.4%
Simplified9.4%
Taylor expanded in im around 0 97.0%
mul-1-neg97.0%
*-commutative97.0%
distribute-lft-neg-in97.0%
Simplified97.0%
if 1.7e10 < im < 3.30000000000000027e145Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 30.0%
mul-1-neg30.0%
unsub-neg30.0%
*-commutative30.0%
associate-*l*30.0%
distribute-lft-out--30.0%
Simplified30.0%
Applied egg-rr3.7%
flip--3.7%
associate-*r/3.7%
metadata-eval3.7%
+-commutative3.7%
Applied egg-rr3.7%
*-commutative3.7%
associate-/l*3.7%
+-commutative3.7%
Simplified3.7%
Taylor expanded in re around 0 34.0%
associate--l+34.0%
unpow234.0%
*-commutative34.0%
unpow234.0%
+-commutative34.0%
associate-*r/34.0%
metadata-eval34.0%
unpow234.0%
div-sub34.0%
+-commutative34.0%
Simplified34.0%
Final simplification77.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- 387420489.0 (* im im))) (t_1 (/ t_0 (+ im 19683.0))))
(if (<= im -7.5e+163)
t_1
(if (<= im -88000000.0)
(- (* im (* 0.5 (* re re))) im)
(if (<= im 17000000000.0)
(- im)
(if (<= im 3.3e+145)
(+ (* -0.5 (/ (* t_0 (* re re)) (+ im 19683.0))) t_1)
t_1))))))
double code(double re, double im) {
double t_0 = 387420489.0 - (im * im);
double t_1 = t_0 / (im + 19683.0);
double tmp;
if (im <= -7.5e+163) {
tmp = t_1;
} else if (im <= -88000000.0) {
tmp = (im * (0.5 * (re * re))) - im;
} else if (im <= 17000000000.0) {
tmp = -im;
} else if (im <= 3.3e+145) {
tmp = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + t_1;
} 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 = 387420489.0d0 - (im * im)
t_1 = t_0 / (im + 19683.0d0)
if (im <= (-7.5d+163)) then
tmp = t_1
else if (im <= (-88000000.0d0)) then
tmp = (im * (0.5d0 * (re * re))) - im
else if (im <= 17000000000.0d0) then
tmp = -im
else if (im <= 3.3d+145) then
tmp = ((-0.5d0) * ((t_0 * (re * re)) / (im + 19683.0d0))) + t_1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 387420489.0 - (im * im);
double t_1 = t_0 / (im + 19683.0);
double tmp;
if (im <= -7.5e+163) {
tmp = t_1;
} else if (im <= -88000000.0) {
tmp = (im * (0.5 * (re * re))) - im;
} else if (im <= 17000000000.0) {
tmp = -im;
} else if (im <= 3.3e+145) {
tmp = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + t_1;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 387420489.0 - (im * im) t_1 = t_0 / (im + 19683.0) tmp = 0 if im <= -7.5e+163: tmp = t_1 elif im <= -88000000.0: tmp = (im * (0.5 * (re * re))) - im elif im <= 17000000000.0: tmp = -im elif im <= 3.3e+145: tmp = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + t_1 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(387420489.0 - Float64(im * im)) t_1 = Float64(t_0 / Float64(im + 19683.0)) tmp = 0.0 if (im <= -7.5e+163) tmp = t_1; elseif (im <= -88000000.0) tmp = Float64(Float64(im * Float64(0.5 * Float64(re * re))) - im); elseif (im <= 17000000000.0) tmp = Float64(-im); elseif (im <= 3.3e+145) tmp = Float64(Float64(-0.5 * Float64(Float64(t_0 * Float64(re * re)) / Float64(im + 19683.0))) + t_1); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 387420489.0 - (im * im); t_1 = t_0 / (im + 19683.0); tmp = 0.0; if (im <= -7.5e+163) tmp = t_1; elseif (im <= -88000000.0) tmp = (im * (0.5 * (re * re))) - im; elseif (im <= 17000000000.0) tmp = -im; elseif (im <= 3.3e+145) tmp = (-0.5 * ((t_0 * (re * re)) / (im + 19683.0))) + t_1; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(387420489.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -7.5e+163], t$95$1, If[LessEqual[im, -88000000.0], N[(N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 17000000000.0], (-im), If[LessEqual[im, 3.3e+145], N[(N[(-0.5 * N[(N[(t$95$0 * N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 387420489 - im \cdot im\\
t_1 := \frac{t_0}{im + 19683}\\
\mathbf{if}\;im \leq -7.5 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -88000000:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right) - im\\
\mathbf{elif}\;im \leq 17000000000:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 3.3 \cdot 10^{+145}:\\
\;\;\;\;-0.5 \cdot \frac{t_0 \cdot \left(re \cdot re\right)}{im + 19683} + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -7.50000000000000001e163 or 3.30000000000000027e145 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out--100.0%
Simplified100.0%
Applied egg-rr7.0%
flip--96.8%
associate-*r/96.8%
metadata-eval96.8%
+-commutative96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in re around 0 85.2%
unpow285.2%
+-commutative85.2%
Simplified85.2%
if -7.50000000000000001e163 < im < -8.8e7Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 4.0%
mul-1-neg4.0%
*-commutative4.0%
distribute-lft-neg-in4.0%
Simplified4.0%
Taylor expanded in re around 0 29.5%
neg-mul-129.5%
+-commutative29.5%
unsub-neg29.5%
*-commutative29.5%
*-commutative29.5%
associate-*l*29.5%
unpow229.5%
Simplified29.5%
if -8.8e7 < im < 1.7e10Initial program 9.4%
sub0-neg9.4%
Simplified9.4%
Taylor expanded in im around 0 97.0%
mul-1-neg97.0%
*-commutative97.0%
distribute-lft-neg-in97.0%
Simplified97.0%
Taylor expanded in re around 0 51.7%
neg-mul-151.7%
Simplified51.7%
if 1.7e10 < im < 3.30000000000000027e145Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 30.0%
mul-1-neg30.0%
unsub-neg30.0%
*-commutative30.0%
associate-*l*30.0%
distribute-lft-out--30.0%
Simplified30.0%
Applied egg-rr3.7%
flip--3.7%
associate-*r/3.7%
metadata-eval3.7%
+-commutative3.7%
Applied egg-rr3.7%
*-commutative3.7%
associate-/l*3.7%
+-commutative3.7%
Simplified3.7%
Taylor expanded in re around 0 34.0%
associate--l+34.0%
unpow234.0%
*-commutative34.0%
unpow234.0%
+-commutative34.0%
associate-*r/34.0%
metadata-eval34.0%
unpow234.0%
div-sub34.0%
+-commutative34.0%
Simplified34.0%
Final simplification54.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (/ (- 387420489.0 (* im im)) (+ im 19683.0)))
(t_1 (- (* im (* 0.5 (* re re))) im)))
(if (<= im -7.5e+163)
t_0
(if (<= im -2150000000.0)
t_1
(if (<= im 8e-51) (- im) (if (<= im 3.3e+145) t_1 t_0))))))
double code(double re, double im) {
double t_0 = (387420489.0 - (im * im)) / (im + 19683.0);
double t_1 = (im * (0.5 * (re * re))) - im;
double tmp;
if (im <= -7.5e+163) {
tmp = t_0;
} else if (im <= -2150000000.0) {
tmp = t_1;
} else if (im <= 8e-51) {
tmp = -im;
} else if (im <= 3.3e+145) {
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 = (387420489.0d0 - (im * im)) / (im + 19683.0d0)
t_1 = (im * (0.5d0 * (re * re))) - im
if (im <= (-7.5d+163)) then
tmp = t_0
else if (im <= (-2150000000.0d0)) then
tmp = t_1
else if (im <= 8d-51) then
tmp = -im
else if (im <= 3.3d+145) 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 = (387420489.0 - (im * im)) / (im + 19683.0);
double t_1 = (im * (0.5 * (re * re))) - im;
double tmp;
if (im <= -7.5e+163) {
tmp = t_0;
} else if (im <= -2150000000.0) {
tmp = t_1;
} else if (im <= 8e-51) {
tmp = -im;
} else if (im <= 3.3e+145) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (387420489.0 - (im * im)) / (im + 19683.0) t_1 = (im * (0.5 * (re * re))) - im tmp = 0 if im <= -7.5e+163: tmp = t_0 elif im <= -2150000000.0: tmp = t_1 elif im <= 8e-51: tmp = -im elif im <= 3.3e+145: tmp = t_1 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(387420489.0 - Float64(im * im)) / Float64(im + 19683.0)) t_1 = Float64(Float64(im * Float64(0.5 * Float64(re * re))) - im) tmp = 0.0 if (im <= -7.5e+163) tmp = t_0; elseif (im <= -2150000000.0) tmp = t_1; elseif (im <= 8e-51) tmp = Float64(-im); elseif (im <= 3.3e+145) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (387420489.0 - (im * im)) / (im + 19683.0); t_1 = (im * (0.5 * (re * re))) - im; tmp = 0.0; if (im <= -7.5e+163) tmp = t_0; elseif (im <= -2150000000.0) tmp = t_1; elseif (im <= 8e-51) tmp = -im; elseif (im <= 3.3e+145) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(387420489.0 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(im + 19683.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]}, If[LessEqual[im, -7.5e+163], t$95$0, If[LessEqual[im, -2150000000.0], t$95$1, If[LessEqual[im, 8e-51], (-im), If[LessEqual[im, 3.3e+145], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{387420489 - im \cdot im}{im + 19683}\\
t_1 := im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right) - im\\
\mathbf{if}\;im \leq -7.5 \cdot 10^{+163}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -2150000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 8 \cdot 10^{-51}:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 3.3 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -7.50000000000000001e163 or 3.30000000000000027e145 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out--100.0%
Simplified100.0%
Applied egg-rr7.0%
flip--96.8%
associate-*r/96.8%
metadata-eval96.8%
+-commutative96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in re around 0 85.2%
unpow285.2%
+-commutative85.2%
Simplified85.2%
if -7.50000000000000001e163 < im < -2.15e9 or 8.0000000000000001e-51 < im < 3.30000000000000027e145Initial program 92.7%
sub0-neg92.7%
Simplified92.7%
Taylor expanded in im around 0 11.8%
mul-1-neg11.8%
*-commutative11.8%
distribute-lft-neg-in11.8%
Simplified11.8%
Taylor expanded in re around 0 32.8%
neg-mul-132.8%
+-commutative32.8%
unsub-neg32.8%
*-commutative32.8%
*-commutative32.8%
associate-*l*32.8%
unpow232.8%
Simplified32.8%
if -2.15e9 < im < 8.0000000000000001e-51Initial program 7.8%
sub0-neg7.8%
Simplified7.8%
Taylor expanded in im around 0 98.3%
mul-1-neg98.3%
*-commutative98.3%
distribute-lft-neg-in98.3%
Simplified98.3%
Taylor expanded in re around 0 51.7%
neg-mul-151.7%
Simplified51.7%
Final simplification54.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* re re) -6.75)))
(if (<= im -88000000.0)
t_0
(if (<= im 2e-10)
(- im)
(if (<= im 5.5e+113) (* (+ 0.5 (* re (* re -0.25))) -3.0) t_0)))))
double code(double re, double im) {
double t_0 = (re * re) * -6.75;
double tmp;
if (im <= -88000000.0) {
tmp = t_0;
} else if (im <= 2e-10) {
tmp = -im;
} else if (im <= 5.5e+113) {
tmp = (0.5 + (re * (re * -0.25))) * -3.0;
} 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 = (re * re) * (-6.75d0)
if (im <= (-88000000.0d0)) then
tmp = t_0
else if (im <= 2d-10) then
tmp = -im
else if (im <= 5.5d+113) then
tmp = (0.5d0 + (re * (re * (-0.25d0)))) * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (re * re) * -6.75;
double tmp;
if (im <= -88000000.0) {
tmp = t_0;
} else if (im <= 2e-10) {
tmp = -im;
} else if (im <= 5.5e+113) {
tmp = (0.5 + (re * (re * -0.25))) * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (re * re) * -6.75 tmp = 0 if im <= -88000000.0: tmp = t_0 elif im <= 2e-10: tmp = -im elif im <= 5.5e+113: tmp = (0.5 + (re * (re * -0.25))) * -3.0 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(re * re) * -6.75) tmp = 0.0 if (im <= -88000000.0) tmp = t_0; elseif (im <= 2e-10) tmp = Float64(-im); elseif (im <= 5.5e+113) tmp = Float64(Float64(0.5 + Float64(re * Float64(re * -0.25))) * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (re * re) * -6.75; tmp = 0.0; if (im <= -88000000.0) tmp = t_0; elseif (im <= 2e-10) tmp = -im; elseif (im <= 5.5e+113) tmp = (0.5 + (re * (re * -0.25))) * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision]}, If[LessEqual[im, -88000000.0], t$95$0, If[LessEqual[im, 2e-10], (-im), If[LessEqual[im, 5.5e+113], N[(N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(re \cdot re\right) \cdot -6.75\\
\mathbf{if}\;im \leq -88000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 2 \cdot 10^{-10}:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 5.5 \cdot 10^{+113}:\\
\;\;\;\;\left(0.5 + re \cdot \left(re \cdot -0.25\right)\right) \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -8.8e7 or 5.5000000000000001e113 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out71.4%
+-commutative71.4%
*-commutative71.4%
unpow271.4%
associate-*l*71.4%
Simplified71.4%
Applied egg-rr18.1%
Taylor expanded in re around inf 17.7%
unpow217.7%
Simplified17.7%
if -8.8e7 < im < 2.00000000000000007e-10Initial program 7.7%
sub0-neg7.7%
Simplified7.7%
Taylor expanded in im around 0 98.4%
mul-1-neg98.4%
*-commutative98.4%
distribute-lft-neg-in98.4%
Simplified98.4%
Taylor expanded in re around 0 52.8%
neg-mul-152.8%
Simplified52.8%
if 2.00000000000000007e-10 < im < 5.5000000000000001e113Initial program 98.4%
sub0-neg98.4%
Simplified98.4%
Taylor expanded in re around 0 0.2%
*-commutative0.2%
associate-*r*0.2%
distribute-rgt-out76.1%
+-commutative76.1%
*-commutative76.1%
unpow276.1%
associate-*l*76.1%
Simplified76.1%
Applied egg-rr26.4%
Final simplification36.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 0.5 (* re (* re -0.25)))))
(if (<= im -420000000.0)
(* t_0 27.0)
(if (<= im 2e-10)
(- im)
(if (<= im 3e+113) (* t_0 -3.0) (* (* re re) -6.75))))))
double code(double re, double im) {
double t_0 = 0.5 + (re * (re * -0.25));
double tmp;
if (im <= -420000000.0) {
tmp = t_0 * 27.0;
} else if (im <= 2e-10) {
tmp = -im;
} else if (im <= 3e+113) {
tmp = t_0 * -3.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) :: t_0
real(8) :: tmp
t_0 = 0.5d0 + (re * (re * (-0.25d0)))
if (im <= (-420000000.0d0)) then
tmp = t_0 * 27.0d0
else if (im <= 2d-10) then
tmp = -im
else if (im <= 3d+113) then
tmp = t_0 * (-3.0d0)
else
tmp = (re * re) * (-6.75d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 + (re * (re * -0.25));
double tmp;
if (im <= -420000000.0) {
tmp = t_0 * 27.0;
} else if (im <= 2e-10) {
tmp = -im;
} else if (im <= 3e+113) {
tmp = t_0 * -3.0;
} else {
tmp = (re * re) * -6.75;
}
return tmp;
}
def code(re, im): t_0 = 0.5 + (re * (re * -0.25)) tmp = 0 if im <= -420000000.0: tmp = t_0 * 27.0 elif im <= 2e-10: tmp = -im elif im <= 3e+113: tmp = t_0 * -3.0 else: tmp = (re * re) * -6.75 return tmp
function code(re, im) t_0 = Float64(0.5 + Float64(re * Float64(re * -0.25))) tmp = 0.0 if (im <= -420000000.0) tmp = Float64(t_0 * 27.0); elseif (im <= 2e-10) tmp = Float64(-im); elseif (im <= 3e+113) tmp = Float64(t_0 * -3.0); else tmp = Float64(Float64(re * re) * -6.75); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 + (re * (re * -0.25)); tmp = 0.0; if (im <= -420000000.0) tmp = t_0 * 27.0; elseif (im <= 2e-10) tmp = -im; elseif (im <= 3e+113) tmp = t_0 * -3.0; else tmp = (re * re) * -6.75; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -420000000.0], N[(t$95$0 * 27.0), $MachinePrecision], If[LessEqual[im, 2e-10], (-im), If[LessEqual[im, 3e+113], N[(t$95$0 * -3.0), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 + re \cdot \left(re \cdot -0.25\right)\\
\mathbf{if}\;im \leq -420000000:\\
\;\;\;\;t_0 \cdot 27\\
\mathbf{elif}\;im \leq 2 \cdot 10^{-10}:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 3 \cdot 10^{+113}:\\
\;\;\;\;t_0 \cdot -3\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -6.75\\
\end{array}
\end{array}
if im < -4.2e8Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out75.8%
+-commutative75.8%
*-commutative75.8%
unpow275.8%
associate-*l*75.8%
Simplified75.8%
Applied egg-rr16.6%
if -4.2e8 < im < 2.00000000000000007e-10Initial program 7.7%
sub0-neg7.7%
Simplified7.7%
Taylor expanded in im around 0 98.4%
mul-1-neg98.4%
*-commutative98.4%
distribute-lft-neg-in98.4%
Simplified98.4%
Taylor expanded in re around 0 52.8%
neg-mul-152.8%
Simplified52.8%
if 2.00000000000000007e-10 < im < 3e113Initial program 98.4%
sub0-neg98.4%
Simplified98.4%
Taylor expanded in re around 0 0.2%
*-commutative0.2%
associate-*r*0.2%
distribute-rgt-out76.1%
+-commutative76.1%
*-commutative76.1%
unpow276.1%
associate-*l*76.1%
Simplified76.1%
Applied egg-rr26.4%
if 3e113 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out63.9%
+-commutative63.9%
*-commutative63.9%
unpow263.9%
associate-*l*63.9%
Simplified63.9%
Applied egg-rr20.6%
Taylor expanded in re around inf 21.2%
unpow221.2%
Simplified21.2%
Final simplification36.6%
(FPCore (re im) :precision binary64 (if (or (<= im -88000000.0) (not (<= im 8e-51))) (- (* im (* 0.5 (* re re))) im) (- im)))
double code(double re, double im) {
double tmp;
if ((im <= -88000000.0) || !(im <= 8e-51)) {
tmp = (im * (0.5 * (re * re))) - im;
} else {
tmp = -im;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-88000000.0d0)) .or. (.not. (im <= 8d-51))) then
tmp = (im * (0.5d0 * (re * re))) - im
else
tmp = -im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -88000000.0) || !(im <= 8e-51)) {
tmp = (im * (0.5 * (re * re))) - im;
} else {
tmp = -im;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -88000000.0) or not (im <= 8e-51): tmp = (im * (0.5 * (re * re))) - im else: tmp = -im return tmp
function code(re, im) tmp = 0.0 if ((im <= -88000000.0) || !(im <= 8e-51)) tmp = Float64(Float64(im * Float64(0.5 * Float64(re * re))) - im); else tmp = Float64(-im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -88000000.0) || ~((im <= 8e-51))) tmp = (im * (0.5 * (re * re))) - im; else tmp = -im; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -88000000.0], N[Not[LessEqual[im, 8e-51]], $MachinePrecision]], N[(N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], (-im)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -88000000 \lor \neg \left(im \leq 8 \cdot 10^{-51}\right):\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right) - im\\
\mathbf{else}:\\
\;\;\;\;-im\\
\end{array}
\end{array}
if im < -8.8e7 or 8.0000000000000001e-51 < im Initial program 96.0%
sub0-neg96.0%
Simplified96.0%
Taylor expanded in im around 0 9.6%
mul-1-neg9.6%
*-commutative9.6%
distribute-lft-neg-in9.6%
Simplified9.6%
Taylor expanded in re around 0 24.3%
neg-mul-124.3%
+-commutative24.3%
unsub-neg24.3%
*-commutative24.3%
*-commutative24.3%
associate-*l*24.3%
unpow224.3%
Simplified24.3%
if -8.8e7 < im < 8.0000000000000001e-51Initial program 7.8%
sub0-neg7.8%
Simplified7.8%
Taylor expanded in im around 0 98.3%
mul-1-neg98.3%
*-commutative98.3%
distribute-lft-neg-in98.3%
Simplified98.3%
Taylor expanded in re around 0 51.7%
neg-mul-151.7%
Simplified51.7%
Final simplification37.6%
(FPCore (re im) :precision binary64 (if (<= re 2.05e+155) (- im) (* (* re re) -6.75)))
double code(double re, double im) {
double tmp;
if (re <= 2.05e+155) {
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 <= 2.05d+155) 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 <= 2.05e+155) {
tmp = -im;
} else {
tmp = (re * re) * -6.75;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.05e+155: tmp = -im else: tmp = (re * re) * -6.75 return tmp
function code(re, im) tmp = 0.0 if (re <= 2.05e+155) 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 <= 2.05e+155) tmp = -im; else tmp = (re * re) * -6.75; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.05e+155], (-im), N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.05 \cdot 10^{+155}:\\
\;\;\;\;-im\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot -6.75\\
\end{array}
\end{array}
if re < 2.0499999999999999e155Initial program 53.8%
sub0-neg53.8%
Simplified53.8%
Taylor expanded in im around 0 52.3%
mul-1-neg52.3%
*-commutative52.3%
distribute-lft-neg-in52.3%
Simplified52.3%
Taylor expanded in re around 0 31.8%
neg-mul-131.8%
Simplified31.8%
if 2.0499999999999999e155 < re Initial program 49.8%
sub0-neg49.8%
Simplified49.8%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out26.5%
+-commutative26.5%
*-commutative26.5%
unpow226.5%
associate-*l*26.5%
Simplified26.5%
Applied egg-rr27.2%
Taylor expanded in re around inf 27.2%
unpow227.2%
Simplified27.2%
Final simplification31.2%
(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 53.3%
sub0-neg53.3%
Simplified53.3%
Taylor expanded in im around 0 52.6%
mul-1-neg52.6%
*-commutative52.6%
distribute-lft-neg-in52.6%
Simplified52.6%
Taylor expanded in re around 0 28.7%
neg-mul-128.7%
Simplified28.7%
Final simplification28.7%
(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 53.3%
sub0-neg53.3%
Simplified53.3%
Taylor expanded in re around 0 2.2%
*-commutative2.2%
associate-*r*2.2%
distribute-rgt-out38.5%
+-commutative38.5%
*-commutative38.5%
unpow238.5%
associate-*l*38.5%
Simplified38.5%
Applied egg-rr8.8%
Taylor expanded in re around 0 2.9%
Final simplification2.9%
(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 2023217
(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))))