
(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 -0.4) (not (<= t_0 5e-9)))
(* (* 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.4) || !(t_0 <= 5e-9)) {
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.4d0)) .or. (.not. (t_0 <= 5d-9))) 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.4) || !(t_0 <= 5e-9)) {
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.4) or not (t_0 <= 5e-9): 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.4) || !(t_0 <= 5e-9)) 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.4) || ~((t_0 <= 5e-9))) 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.4], N[Not[LessEqual[t$95$0, 5e-9]], $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.4 \lor \neg \left(t_0 \leq 5 \cdot 10^{-9}\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.40000000000000002 or 5.0000000000000001e-9 < (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
if -0.40000000000000002 < (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) < 5.0000000000000001e-9Initial program 7.7%
sub0-neg7.7%
Simplified7.7%
Taylor expanded in im around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-lft-out--99.9%
Simplified99.9%
Final simplification99.9%
(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 -2.5e+116)
t_1
(if (<= im -11.5)
(* 0.5 t_0)
(if (or (<= im 0.046) (not (<= im 5.7e+102)))
t_1
(* t_0 (+ 0.5 (* re (* re -0.25)))))))))
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 <= -2.5e+116) {
tmp = t_1;
} else if (im <= -11.5) {
tmp = 0.5 * t_0;
} else if ((im <= 0.046) || !(im <= 5.7e+102)) {
tmp = t_1;
} else {
tmp = t_0 * (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) :: 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 <= (-2.5d+116)) then
tmp = t_1
else if (im <= (-11.5d0)) then
tmp = 0.5d0 * t_0
else if ((im <= 0.046d0) .or. (.not. (im <= 5.7d+102))) then
tmp = t_1
else
tmp = t_0 * (0.5d0 + (re * (re * (-0.25d0))))
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 <= -2.5e+116) {
tmp = t_1;
} else if (im <= -11.5) {
tmp = 0.5 * t_0;
} else if ((im <= 0.046) || !(im <= 5.7e+102)) {
tmp = t_1;
} else {
tmp = t_0 * (0.5 + (re * (re * -0.25)));
}
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 <= -2.5e+116: tmp = t_1 elif im <= -11.5: tmp = 0.5 * t_0 elif (im <= 0.046) or not (im <= 5.7e+102): tmp = t_1 else: tmp = t_0 * (0.5 + (re * (re * -0.25))) 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 <= -2.5e+116) tmp = t_1; elseif (im <= -11.5) tmp = Float64(0.5 * t_0); elseif ((im <= 0.046) || !(im <= 5.7e+102)) tmp = t_1; else tmp = Float64(t_0 * Float64(0.5 + Float64(re * Float64(re * -0.25)))); 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 <= -2.5e+116) tmp = t_1; elseif (im <= -11.5) tmp = 0.5 * t_0; elseif ((im <= 0.046) || ~((im <= 5.7e+102))) tmp = t_1; else tmp = t_0 * (0.5 + (re * (re * -0.25))); 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, -2.5e+116], t$95$1, If[LessEqual[im, -11.5], N[(0.5 * t$95$0), $MachinePrecision], If[Or[LessEqual[im, 0.046], N[Not[LessEqual[im, 5.7e+102]], $MachinePrecision]], t$95$1, N[(t$95$0 * N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -2.5 \cdot 10^{+116}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -11.5:\\
\;\;\;\;0.5 \cdot t_0\\
\mathbf{elif}\;im \leq 0.046 \lor \neg \left(im \leq 5.7 \cdot 10^{+102}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(0.5 + re \cdot \left(re \cdot -0.25\right)\right)\\
\end{array}
\end{array}
if im < -2.50000000000000013e116 or -11.5 < im < 0.045999999999999999 or 5.6999999999999999e102 < im Initial program 40.8%
sub0-neg40.8%
Simplified40.8%
Taylor expanded in im around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
associate-*l*99.5%
distribute-lft-out--99.5%
Simplified99.5%
if -2.50000000000000013e116 < im < -11.5Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 80.0%
if 0.045999999999999999 < im < 5.6999999999999999e102Initial program 99.9%
sub0-neg99.9%
Simplified99.9%
Taylor expanded in re around 0 15.3%
*-commutative15.3%
associate-*r*15.3%
distribute-rgt-out92.2%
+-commutative92.2%
*-commutative92.2%
unpow292.2%
associate-*l*92.2%
Simplified92.2%
Final simplification96.5%
(FPCore (re im)
:precision binary64
(if (or (<= im -2.2e+116)
(not (or (<= im -11.5) (and (not (<= im 0.046)) (<= im 5.7e+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 <= -2.2e+116) || !((im <= -11.5) || (!(im <= 0.046) && (im <= 5.7e+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 <= (-2.2d+116)) .or. (.not. (im <= (-11.5d0)) .or. (.not. (im <= 0.046d0)) .and. (im <= 5.7d+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 <= -2.2e+116) || !((im <= -11.5) || (!(im <= 0.046) && (im <= 5.7e+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 <= -2.2e+116) or not ((im <= -11.5) or (not (im <= 0.046) and (im <= 5.7e+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 <= -2.2e+116) || !((im <= -11.5) || (!(im <= 0.046) && (im <= 5.7e+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 <= -2.2e+116) || ~(((im <= -11.5) || (~((im <= 0.046)) && (im <= 5.7e+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, -2.2e+116], N[Not[Or[LessEqual[im, -11.5], And[N[Not[LessEqual[im, 0.046]], $MachinePrecision], LessEqual[im, 5.7e+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 -2.2 \cdot 10^{+116} \lor \neg \left(im \leq -11.5 \lor \neg \left(im \leq 0.046\right) \land im \leq 5.7 \cdot 10^{+102}\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 < -2.2e116 or -11.5 < im < 0.045999999999999999 or 5.6999999999999999e102 < im Initial program 40.8%
sub0-neg40.8%
Simplified40.8%
Taylor expanded in im around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
associate-*l*99.5%
distribute-lft-out--99.5%
Simplified99.5%
if -2.2e116 < im < -11.5 or 0.045999999999999999 < im < 5.6999999999999999e102Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 79.1%
Final simplification95.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (- (exp (- im)) (exp im))))
(t_1
(/
(* (cos re) (- 1.4551915228366852e-11 (* im im)))
(+ im -3.814697265625e-6))))
(if (<= im -1.32e+154)
t_1
(if (<= im -11.5)
t_0
(if (<= im 0.0005)
(* (cos re) (- im))
(if (<= im 1.35e+154) t_0 t_1))))))
double code(double re, double im) {
double t_0 = 0.5 * (exp(-im) - exp(im));
double t_1 = (cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6);
double tmp;
if (im <= -1.32e+154) {
tmp = t_1;
} else if (im <= -11.5) {
tmp = t_0;
} else if (im <= 0.0005) {
tmp = cos(re) * -im;
} else if (im <= 1.35e+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 = 0.5d0 * (exp(-im) - exp(im))
t_1 = (cos(re) * (1.4551915228366852d-11 - (im * im))) / (im + (-3.814697265625d-6))
if (im <= (-1.32d+154)) then
tmp = t_1
else if (im <= (-11.5d0)) then
tmp = t_0
else if (im <= 0.0005d0) then
tmp = cos(re) * -im
else if (im <= 1.35d+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 = 0.5 * (Math.exp(-im) - Math.exp(im));
double t_1 = (Math.cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6);
double tmp;
if (im <= -1.32e+154) {
tmp = t_1;
} else if (im <= -11.5) {
tmp = t_0;
} else if (im <= 0.0005) {
tmp = Math.cos(re) * -im;
} else if (im <= 1.35e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * (math.exp(-im) - math.exp(im)) t_1 = (math.cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6) tmp = 0 if im <= -1.32e+154: tmp = t_1 elif im <= -11.5: tmp = t_0 elif im <= 0.0005: tmp = math.cos(re) * -im elif im <= 1.35e+154: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(exp(Float64(-im)) - exp(im))) t_1 = Float64(Float64(cos(re) * Float64(1.4551915228366852e-11 - Float64(im * im))) / Float64(im + -3.814697265625e-6)) tmp = 0.0 if (im <= -1.32e+154) tmp = t_1; elseif (im <= -11.5) tmp = t_0; elseif (im <= 0.0005) tmp = Float64(cos(re) * Float64(-im)); elseif (im <= 1.35e+154) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (exp(-im) - exp(im)); t_1 = (cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6); tmp = 0.0; if (im <= -1.32e+154) tmp = t_1; elseif (im <= -11.5) tmp = t_0; elseif (im <= 0.0005) tmp = cos(re) * -im; elseif (im <= 1.35e+154) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Cos[re], $MachinePrecision] * N[(1.4551915228366852e-11 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -3.814697265625e-6), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.32e+154], t$95$1, If[LessEqual[im, -11.5], t$95$0, If[LessEqual[im, 0.0005], N[(N[Cos[re], $MachinePrecision] * (-im)), $MachinePrecision], If[LessEqual[im, 1.35e+154], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(e^{-im} - e^{im}\right)\\
t_1 := \frac{\cos re \cdot \left(1.4551915228366852 \cdot 10^{-11} - im \cdot im\right)}{im + -3.814697265625 \cdot 10^{-6}}\\
\mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -11.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 0.0005:\\
\;\;\;\;\cos re \cdot \left(-im\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.31999999999999998e154 or 1.35000000000000003e154 < 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%
*-commutative6.9%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
if -1.31999999999999998e154 < im < -11.5 or 5.0000000000000001e-4 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 82.4%
if -11.5 < im < 5.0000000000000001e-4Initial program 8.3%
sub0-neg8.3%
Simplified8.3%
Taylor expanded in im around 0 99.2%
mul-1-neg99.2%
*-commutative99.2%
distribute-lft-neg-in99.2%
Simplified99.2%
Final simplification94.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666))
(t_1
(/
(* (cos re) (- 1.4551915228366852e-11 (* im im)))
(+ im -3.814697265625e-6))))
(if (<= im -1.32e+154)
t_1
(if (<= im -2.35e+92)
t_0
(if (<= im -1.55e+23)
(- (* (* re re) (* im 0.5)) im)
(if (<= im 0.062)
(* (cos re) (- im))
(if (<= im 1.35e+154) (- t_0 im) t_1)))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double t_1 = (cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6);
double tmp;
if (im <= -1.32e+154) {
tmp = t_1;
} else if (im <= -2.35e+92) {
tmp = t_0;
} else if (im <= -1.55e+23) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (im <= 0.062) {
tmp = cos(re) * -im;
} else if (im <= 1.35e+154) {
tmp = t_0 - im;
} 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 = (im ** 3.0d0) * (-0.16666666666666666d0)
t_1 = (cos(re) * (1.4551915228366852d-11 - (im * im))) / (im + (-3.814697265625d-6))
if (im <= (-1.32d+154)) then
tmp = t_1
else if (im <= (-2.35d+92)) then
tmp = t_0
else if (im <= (-1.55d+23)) then
tmp = ((re * re) * (im * 0.5d0)) - im
else if (im <= 0.062d0) then
tmp = cos(re) * -im
else if (im <= 1.35d+154) then
tmp = t_0 - im
else
tmp = t_1
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 = (Math.cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6);
double tmp;
if (im <= -1.32e+154) {
tmp = t_1;
} else if (im <= -2.35e+92) {
tmp = t_0;
} else if (im <= -1.55e+23) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (im <= 0.062) {
tmp = Math.cos(re) * -im;
} else if (im <= 1.35e+154) {
tmp = t_0 - im;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 t_1 = (math.cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6) tmp = 0 if im <= -1.32e+154: tmp = t_1 elif im <= -2.35e+92: tmp = t_0 elif im <= -1.55e+23: tmp = ((re * re) * (im * 0.5)) - im elif im <= 0.062: tmp = math.cos(re) * -im elif im <= 1.35e+154: tmp = t_0 - im else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) t_1 = Float64(Float64(cos(re) * Float64(1.4551915228366852e-11 - Float64(im * im))) / Float64(im + -3.814697265625e-6)) tmp = 0.0 if (im <= -1.32e+154) tmp = t_1; elseif (im <= -2.35e+92) tmp = t_0; elseif (im <= -1.55e+23) tmp = Float64(Float64(Float64(re * re) * Float64(im * 0.5)) - im); elseif (im <= 0.062) tmp = Float64(cos(re) * Float64(-im)); elseif (im <= 1.35e+154) tmp = Float64(t_0 - im); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.16666666666666666; t_1 = (cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6); tmp = 0.0; if (im <= -1.32e+154) tmp = t_1; elseif (im <= -2.35e+92) tmp = t_0; elseif (im <= -1.55e+23) tmp = ((re * re) * (im * 0.5)) - im; elseif (im <= 0.062) tmp = cos(re) * -im; elseif (im <= 1.35e+154) tmp = t_0 - im; else tmp = t_1; 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[(N[Cos[re], $MachinePrecision] * N[(1.4551915228366852e-11 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -3.814697265625e-6), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.32e+154], t$95$1, If[LessEqual[im, -2.35e+92], t$95$0, If[LessEqual[im, -1.55e+23], N[(N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 0.062], N[(N[Cos[re], $MachinePrecision] * (-im)), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(t$95$0 - im), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
t_1 := \frac{\cos re \cdot \left(1.4551915228366852 \cdot 10^{-11} - im \cdot im\right)}{im + -3.814697265625 \cdot 10^{-6}}\\
\mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -2.35 \cdot 10^{+92}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -1.55 \cdot 10^{+23}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right) - im\\
\mathbf{elif}\;im \leq 0.062:\\
\;\;\;\;\cos re \cdot \left(-im\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0 - im\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.31999999999999998e154 or 1.35000000000000003e154 < 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%
*-commutative6.9%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
if -1.31999999999999998e154 < im < -2.35e92Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 92.4%
mul-1-neg92.4%
unsub-neg92.4%
*-commutative92.4%
associate-*l*92.4%
distribute-lft-out--92.4%
Simplified92.4%
Taylor expanded in re around 0 84.0%
Taylor expanded in im around inf 84.0%
if -2.35e92 < im < -1.54999999999999985e23Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.7%
mul-1-neg3.7%
*-commutative3.7%
distribute-lft-neg-in3.7%
Simplified3.7%
Taylor expanded in re around 0 23.4%
neg-mul-123.4%
+-commutative23.4%
unsub-neg23.4%
*-commutative23.4%
associate-*l*23.4%
unpow223.4%
Simplified23.4%
if -1.54999999999999985e23 < im < 0.062Initial program 13.5%
sub0-neg13.5%
Simplified13.5%
Taylor expanded in im around 0 93.8%
mul-1-neg93.8%
*-commutative93.8%
distribute-lft-neg-in93.8%
Simplified93.8%
if 0.062 < im < 1.35000000000000003e154Initial program 99.9%
sub0-neg99.9%
Simplified99.9%
Taylor expanded in im around 0 48.7%
mul-1-neg48.7%
unsub-neg48.7%
*-commutative48.7%
associate-*l*48.7%
distribute-lft-out--48.7%
Simplified48.7%
Taylor expanded in re around 0 43.7%
Final simplification83.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666))
(t_1
(/
(* (cos re) (- 1.4551915228366852e-11 (* im im)))
(+ im -3.814697265625e-6)))
(t_2 (- t_0 im)))
(if (<= im -1.32e+154)
t_1
(if (<= im -5e+128)
t_0
(if (<= im -2.2e+23)
(* (+ (* -0.5 (* re re)) 1.0) t_2)
(if (<= im 0.0027)
(* (cos re) (- im))
(if (<= im 5e+153) t_2 t_1)))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double t_1 = (cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6);
double t_2 = t_0 - im;
double tmp;
if (im <= -1.32e+154) {
tmp = t_1;
} else if (im <= -5e+128) {
tmp = t_0;
} else if (im <= -2.2e+23) {
tmp = ((-0.5 * (re * re)) + 1.0) * t_2;
} else if (im <= 0.0027) {
tmp = cos(re) * -im;
} else if (im <= 5e+153) {
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 = (im ** 3.0d0) * (-0.16666666666666666d0)
t_1 = (cos(re) * (1.4551915228366852d-11 - (im * im))) / (im + (-3.814697265625d-6))
t_2 = t_0 - im
if (im <= (-1.32d+154)) then
tmp = t_1
else if (im <= (-5d+128)) then
tmp = t_0
else if (im <= (-2.2d+23)) then
tmp = (((-0.5d0) * (re * re)) + 1.0d0) * t_2
else if (im <= 0.0027d0) then
tmp = cos(re) * -im
else if (im <= 5d+153) 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 = Math.pow(im, 3.0) * -0.16666666666666666;
double t_1 = (Math.cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6);
double t_2 = t_0 - im;
double tmp;
if (im <= -1.32e+154) {
tmp = t_1;
} else if (im <= -5e+128) {
tmp = t_0;
} else if (im <= -2.2e+23) {
tmp = ((-0.5 * (re * re)) + 1.0) * t_2;
} else if (im <= 0.0027) {
tmp = Math.cos(re) * -im;
} else if (im <= 5e+153) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 t_1 = (math.cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6) t_2 = t_0 - im tmp = 0 if im <= -1.32e+154: tmp = t_1 elif im <= -5e+128: tmp = t_0 elif im <= -2.2e+23: tmp = ((-0.5 * (re * re)) + 1.0) * t_2 elif im <= 0.0027: tmp = math.cos(re) * -im elif im <= 5e+153: tmp = t_2 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) t_1 = Float64(Float64(cos(re) * Float64(1.4551915228366852e-11 - Float64(im * im))) / Float64(im + -3.814697265625e-6)) t_2 = Float64(t_0 - im) tmp = 0.0 if (im <= -1.32e+154) tmp = t_1; elseif (im <= -5e+128) tmp = t_0; elseif (im <= -2.2e+23) tmp = Float64(Float64(Float64(-0.5 * Float64(re * re)) + 1.0) * t_2); elseif (im <= 0.0027) tmp = Float64(cos(re) * Float64(-im)); elseif (im <= 5e+153) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.16666666666666666; t_1 = (cos(re) * (1.4551915228366852e-11 - (im * im))) / (im + -3.814697265625e-6); t_2 = t_0 - im; tmp = 0.0; if (im <= -1.32e+154) tmp = t_1; elseif (im <= -5e+128) tmp = t_0; elseif (im <= -2.2e+23) tmp = ((-0.5 * (re * re)) + 1.0) * t_2; elseif (im <= 0.0027) tmp = cos(re) * -im; elseif (im <= 5e+153) tmp = t_2; else tmp = t_1; 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[(N[Cos[re], $MachinePrecision] * N[(1.4551915228366852e-11 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im + -3.814697265625e-6), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - im), $MachinePrecision]}, If[LessEqual[im, -1.32e+154], t$95$1, If[LessEqual[im, -5e+128], t$95$0, If[LessEqual[im, -2.2e+23], N[(N[(N[(-0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[im, 0.0027], N[(N[Cos[re], $MachinePrecision] * (-im)), $MachinePrecision], If[LessEqual[im, 5e+153], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
t_1 := \frac{\cos re \cdot \left(1.4551915228366852 \cdot 10^{-11} - im \cdot im\right)}{im + -3.814697265625 \cdot 10^{-6}}\\
t_2 := t_0 - im\\
\mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -5 \cdot 10^{+128}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -2.2 \cdot 10^{+23}:\\
\;\;\;\;\left(-0.5 \cdot \left(re \cdot re\right) + 1\right) \cdot t_2\\
\mathbf{elif}\;im \leq 0.0027:\\
\;\;\;\;\cos re \cdot \left(-im\right)\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.31999999999999998e154 or 5.00000000000000018e153 < 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%
*-commutative6.9%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
if -1.31999999999999998e154 < im < -5e128Initial 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%
Taylor expanded in re around 0 100.0%
Taylor expanded in im around inf 100.0%
if -5e128 < im < -2.20000000000000008e23Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 18.7%
mul-1-neg18.7%
unsub-neg18.7%
*-commutative18.7%
associate-*l*18.7%
distribute-lft-out--18.7%
Simplified18.7%
Taylor expanded in re around 0 20.8%
associate--l+20.8%
associate-*r*20.8%
distribute-lft1-in34.6%
unpow234.6%
Simplified34.6%
if -2.20000000000000008e23 < im < 0.0027000000000000001Initial program 13.5%
sub0-neg13.5%
Simplified13.5%
Taylor expanded in im around 0 93.8%
mul-1-neg93.8%
*-commutative93.8%
distribute-lft-neg-in93.8%
Simplified93.8%
if 0.0027000000000000001 < im < 5.00000000000000018e153Initial program 99.9%
sub0-neg99.9%
Simplified99.9%
Taylor expanded in im around 0 48.7%
mul-1-neg48.7%
unsub-neg48.7%
*-commutative48.7%
associate-*l*48.7%
distribute-lft-out--48.7%
Simplified48.7%
Taylor expanded in re around 0 43.7%
Final simplification84.1%
(FPCore (re im)
:precision binary64
(let* ((t_0
(/
(* (- 1.4551915228366852e-11 (* im im)) (+ (* -0.5 (* re re)) 1.0))
(+ im -3.814697265625e-6)))
(t_1 (* (pow im 3.0) -0.16666666666666666)))
(if (<= im -1.6e+154)
t_0
(if (<= im -2.35e+92)
t_1
(if (<= im -1.55e+23)
(- (* (* re re) (* im 0.5)) im)
(if (<= im 2.15e-7) (- im) (if (<= im 4.3e+95) t_0 t_1)))))))
double code(double re, double im) {
double t_0 = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6);
double t_1 = pow(im, 3.0) * -0.16666666666666666;
double tmp;
if (im <= -1.6e+154) {
tmp = t_0;
} else if (im <= -2.35e+92) {
tmp = t_1;
} else if (im <= -1.55e+23) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (im <= 2.15e-7) {
tmp = -im;
} else if (im <= 4.3e+95) {
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 = ((1.4551915228366852d-11 - (im * im)) * (((-0.5d0) * (re * re)) + 1.0d0)) / (im + (-3.814697265625d-6))
t_1 = (im ** 3.0d0) * (-0.16666666666666666d0)
if (im <= (-1.6d+154)) then
tmp = t_0
else if (im <= (-2.35d+92)) then
tmp = t_1
else if (im <= (-1.55d+23)) then
tmp = ((re * re) * (im * 0.5d0)) - im
else if (im <= 2.15d-7) then
tmp = -im
else if (im <= 4.3d+95) 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 = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6);
double t_1 = Math.pow(im, 3.0) * -0.16666666666666666;
double tmp;
if (im <= -1.6e+154) {
tmp = t_0;
} else if (im <= -2.35e+92) {
tmp = t_1;
} else if (im <= -1.55e+23) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (im <= 2.15e-7) {
tmp = -im;
} else if (im <= 4.3e+95) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6) t_1 = math.pow(im, 3.0) * -0.16666666666666666 tmp = 0 if im <= -1.6e+154: tmp = t_0 elif im <= -2.35e+92: tmp = t_1 elif im <= -1.55e+23: tmp = ((re * re) * (im * 0.5)) - im elif im <= 2.15e-7: tmp = -im elif im <= 4.3e+95: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(Float64(Float64(1.4551915228366852e-11 - Float64(im * im)) * Float64(Float64(-0.5 * Float64(re * re)) + 1.0)) / Float64(im + -3.814697265625e-6)) t_1 = Float64((im ^ 3.0) * -0.16666666666666666) tmp = 0.0 if (im <= -1.6e+154) tmp = t_0; elseif (im <= -2.35e+92) tmp = t_1; elseif (im <= -1.55e+23) tmp = Float64(Float64(Float64(re * re) * Float64(im * 0.5)) - im); elseif (im <= 2.15e-7) tmp = Float64(-im); elseif (im <= 4.3e+95) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6); t_1 = (im ^ 3.0) * -0.16666666666666666; tmp = 0.0; if (im <= -1.6e+154) tmp = t_0; elseif (im <= -2.35e+92) tmp = t_1; elseif (im <= -1.55e+23) tmp = ((re * re) * (im * 0.5)) - im; elseif (im <= 2.15e-7) tmp = -im; elseif (im <= 4.3e+95) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[(1.4551915228366852e-11 - N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(im + -3.814697265625e-6), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]}, If[LessEqual[im, -1.6e+154], t$95$0, If[LessEqual[im, -2.35e+92], t$95$1, If[LessEqual[im, -1.55e+23], N[(N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 2.15e-7], (-im), If[LessEqual[im, 4.3e+95], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(1.4551915228366852 \cdot 10^{-11} - im \cdot im\right) \cdot \left(-0.5 \cdot \left(re \cdot re\right) + 1\right)}{im + -3.814697265625 \cdot 10^{-6}}\\
t_1 := {im}^{3} \cdot -0.16666666666666666\\
\mathbf{if}\;im \leq -1.6 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -2.35 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -1.55 \cdot 10^{+23}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right) - im\\
\mathbf{elif}\;im \leq 2.15 \cdot 10^{-7}:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 4.3 \cdot 10^{+95}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.6e154 or 2.1500000000000001e-7 < im < 4.3e95Initial program 99.3%
sub0-neg99.3%
Simplified99.3%
Taylor expanded in im around 0 74.7%
mul-1-neg74.7%
unsub-neg74.7%
*-commutative74.7%
associate-*l*74.7%
distribute-lft-out--74.7%
Simplified74.7%
Applied egg-rr7.1%
*-commutative7.1%
flip--72.0%
associate-*l/72.0%
metadata-eval72.0%
+-commutative72.0%
Applied egg-rr72.0%
Taylor expanded in re around 0 8.6%
sub-neg8.6%
+-commutative8.6%
associate-+l+8.6%
*-commutative8.6%
unpow28.6%
associate-*l*8.6%
sub-neg8.6%
unpow28.6%
*-rgt-identity8.6%
distribute-lft-out69.1%
unpow269.1%
Simplified69.1%
if -1.6e154 < im < -2.35e92 or 4.3e95 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.1%
mul-1-neg96.1%
unsub-neg96.1%
*-commutative96.1%
associate-*l*96.1%
distribute-lft-out--96.1%
Simplified96.1%
Taylor expanded in re around 0 81.2%
Taylor expanded in im around inf 81.2%
if -2.35e92 < im < -1.54999999999999985e23Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.7%
mul-1-neg3.7%
*-commutative3.7%
distribute-lft-neg-in3.7%
Simplified3.7%
Taylor expanded in re around 0 23.4%
neg-mul-123.4%
+-commutative23.4%
unsub-neg23.4%
*-commutative23.4%
associate-*l*23.4%
unpow223.4%
Simplified23.4%
if -1.54999999999999985e23 < im < 2.1500000000000001e-7Initial program 13.0%
sub0-neg13.0%
Simplified13.0%
Taylor expanded in im around 0 93.9%
mul-1-neg93.9%
unsub-neg93.9%
*-commutative93.9%
associate-*l*93.9%
distribute-lft-out--93.9%
Simplified93.9%
Taylor expanded in re around 0 56.1%
Taylor expanded in im around 0 56.0%
neg-mul-156.0%
Simplified56.0%
Final simplification59.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666)))
(if (<= im -2e+155)
(/
(* (- 1.4551915228366852e-11 (* im im)) (+ (* -0.5 (* re re)) 1.0))
(+ im -3.814697265625e-6))
(if (<= im -2.7e+91)
t_0
(if (<= im -8e+24)
(- (* (* re re) (* im 0.5)) im)
(if (<= im 7e-6) (* (cos re) (- im)) (- t_0 im)))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double tmp;
if (im <= -2e+155) {
tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6);
} else if (im <= -2.7e+91) {
tmp = t_0;
} else if (im <= -8e+24) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (im <= 7e-6) {
tmp = cos(re) * -im;
} 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) :: tmp
t_0 = (im ** 3.0d0) * (-0.16666666666666666d0)
if (im <= (-2d+155)) then
tmp = ((1.4551915228366852d-11 - (im * im)) * (((-0.5d0) * (re * re)) + 1.0d0)) / (im + (-3.814697265625d-6))
else if (im <= (-2.7d+91)) then
tmp = t_0
else if (im <= (-8d+24)) then
tmp = ((re * re) * (im * 0.5d0)) - im
else if (im <= 7d-6) then
tmp = cos(re) * -im
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 tmp;
if (im <= -2e+155) {
tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6);
} else if (im <= -2.7e+91) {
tmp = t_0;
} else if (im <= -8e+24) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (im <= 7e-6) {
tmp = Math.cos(re) * -im;
} else {
tmp = t_0 - im;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 tmp = 0 if im <= -2e+155: tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6) elif im <= -2.7e+91: tmp = t_0 elif im <= -8e+24: tmp = ((re * re) * (im * 0.5)) - im elif im <= 7e-6: tmp = math.cos(re) * -im else: tmp = t_0 - im return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) tmp = 0.0 if (im <= -2e+155) tmp = Float64(Float64(Float64(1.4551915228366852e-11 - Float64(im * im)) * Float64(Float64(-0.5 * Float64(re * re)) + 1.0)) / Float64(im + -3.814697265625e-6)); elseif (im <= -2.7e+91) tmp = t_0; elseif (im <= -8e+24) tmp = Float64(Float64(Float64(re * re) * Float64(im * 0.5)) - im); elseif (im <= 7e-6) tmp = Float64(cos(re) * Float64(-im)); else tmp = Float64(t_0 - im); end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.16666666666666666; tmp = 0.0; if (im <= -2e+155) tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6); elseif (im <= -2.7e+91) tmp = t_0; elseif (im <= -8e+24) tmp = ((re * re) * (im * 0.5)) - im; elseif (im <= 7e-6) tmp = cos(re) * -im; 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]}, If[LessEqual[im, -2e+155], N[(N[(N[(1.4551915228366852e-11 - N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(im + -3.814697265625e-6), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -2.7e+91], t$95$0, If[LessEqual[im, -8e+24], N[(N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 7e-6], N[(N[Cos[re], $MachinePrecision] * (-im)), $MachinePrecision], N[(t$95$0 - im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
\mathbf{if}\;im \leq -2 \cdot 10^{+155}:\\
\;\;\;\;\frac{\left(1.4551915228366852 \cdot 10^{-11} - im \cdot im\right) \cdot \left(-0.5 \cdot \left(re \cdot re\right) + 1\right)}{im + -3.814697265625 \cdot 10^{-6}}\\
\mathbf{elif}\;im \leq -2.7 \cdot 10^{+91}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -8 \cdot 10^{+24}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right) - im\\
\mathbf{elif}\;im \leq 7 \cdot 10^{-6}:\\
\;\;\;\;\cos re \cdot \left(-im\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - im\\
\end{array}
\end{array}
if im < -2.00000000000000001e155Initial 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%
*-commutative6.9%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0 0.0%
sub-neg0.0%
+-commutative0.0%
associate-+l+0.0%
*-commutative0.0%
unpow20.0%
associate-*l*0.0%
sub-neg0.0%
unpow20.0%
*-rgt-identity0.0%
distribute-lft-out86.7%
unpow286.7%
Simplified86.7%
if -2.00000000000000001e155 < im < -2.7e91Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 92.4%
mul-1-neg92.4%
unsub-neg92.4%
*-commutative92.4%
associate-*l*92.4%
distribute-lft-out--92.4%
Simplified92.4%
Taylor expanded in re around 0 84.0%
Taylor expanded in im around inf 84.0%
if -2.7e91 < im < -7.9999999999999999e24Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.7%
mul-1-neg3.7%
*-commutative3.7%
distribute-lft-neg-in3.7%
Simplified3.7%
Taylor expanded in re around 0 23.4%
neg-mul-123.4%
+-commutative23.4%
unsub-neg23.4%
*-commutative23.4%
associate-*l*23.4%
unpow223.4%
Simplified23.4%
if -7.9999999999999999e24 < im < 6.99999999999999989e-6Initial program 13.5%
sub0-neg13.5%
Simplified13.5%
Taylor expanded in im around 0 93.8%
mul-1-neg93.8%
*-commutative93.8%
distribute-lft-neg-in93.8%
Simplified93.8%
if 6.99999999999999989e-6 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
associate-*l*74.9%
distribute-lft-out--74.9%
Simplified74.9%
Taylor expanded in re around 0 61.8%
Final simplification80.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666)))
(if (<= im -3e+154)
(/
(* (- 1.4551915228366852e-11 (* im im)) (+ (* -0.5 (* re re)) 1.0))
(+ im -3.814697265625e-6))
(if (<= im -1.3e+92)
t_0
(if (<= im -1.55e+23)
(- (* (* re re) (* im 0.5)) im)
(if (<= im 1.05e+85) (* (cos re) (- im)) t_0))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double tmp;
if (im <= -3e+154) {
tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6);
} else if (im <= -1.3e+92) {
tmp = t_0;
} else if (im <= -1.55e+23) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (im <= 1.05e+85) {
tmp = cos(re) * -im;
} 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 = (im ** 3.0d0) * (-0.16666666666666666d0)
if (im <= (-3d+154)) then
tmp = ((1.4551915228366852d-11 - (im * im)) * (((-0.5d0) * (re * re)) + 1.0d0)) / (im + (-3.814697265625d-6))
else if (im <= (-1.3d+92)) then
tmp = t_0
else if (im <= (-1.55d+23)) then
tmp = ((re * re) * (im * 0.5d0)) - im
else if (im <= 1.05d+85) then
tmp = cos(re) * -im
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 tmp;
if (im <= -3e+154) {
tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6);
} else if (im <= -1.3e+92) {
tmp = t_0;
} else if (im <= -1.55e+23) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (im <= 1.05e+85) {
tmp = Math.cos(re) * -im;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 tmp = 0 if im <= -3e+154: tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6) elif im <= -1.3e+92: tmp = t_0 elif im <= -1.55e+23: tmp = ((re * re) * (im * 0.5)) - im elif im <= 1.05e+85: tmp = math.cos(re) * -im else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) tmp = 0.0 if (im <= -3e+154) tmp = Float64(Float64(Float64(1.4551915228366852e-11 - Float64(im * im)) * Float64(Float64(-0.5 * Float64(re * re)) + 1.0)) / Float64(im + -3.814697265625e-6)); elseif (im <= -1.3e+92) tmp = t_0; elseif (im <= -1.55e+23) tmp = Float64(Float64(Float64(re * re) * Float64(im * 0.5)) - im); elseif (im <= 1.05e+85) tmp = Float64(cos(re) * Float64(-im)); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.16666666666666666; tmp = 0.0; if (im <= -3e+154) tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6); elseif (im <= -1.3e+92) tmp = t_0; elseif (im <= -1.55e+23) tmp = ((re * re) * (im * 0.5)) - im; elseif (im <= 1.05e+85) tmp = cos(re) * -im; 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]}, If[LessEqual[im, -3e+154], N[(N[(N[(1.4551915228366852e-11 - N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(im + -3.814697265625e-6), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -1.3e+92], t$95$0, If[LessEqual[im, -1.55e+23], N[(N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 1.05e+85], N[(N[Cos[re], $MachinePrecision] * (-im)), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
\mathbf{if}\;im \leq -3 \cdot 10^{+154}:\\
\;\;\;\;\frac{\left(1.4551915228366852 \cdot 10^{-11} - im \cdot im\right) \cdot \left(-0.5 \cdot \left(re \cdot re\right) + 1\right)}{im + -3.814697265625 \cdot 10^{-6}}\\
\mathbf{elif}\;im \leq -1.3 \cdot 10^{+92}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -1.55 \cdot 10^{+23}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right) - im\\
\mathbf{elif}\;im \leq 1.05 \cdot 10^{+85}:\\
\;\;\;\;\cos re \cdot \left(-im\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -3.00000000000000026e154Initial 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%
*-commutative6.9%
flip--100.0%
associate-*l/100.0%
metadata-eval100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0 0.0%
sub-neg0.0%
+-commutative0.0%
associate-+l+0.0%
*-commutative0.0%
unpow20.0%
associate-*l*0.0%
sub-neg0.0%
unpow20.0%
*-rgt-identity0.0%
distribute-lft-out86.7%
unpow286.7%
Simplified86.7%
if -3.00000000000000026e154 < im < -1.2999999999999999e92 or 1.05000000000000005e85 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.1%
mul-1-neg96.1%
unsub-neg96.1%
*-commutative96.1%
associate-*l*96.1%
distribute-lft-out--96.1%
Simplified96.1%
Taylor expanded in re around 0 81.2%
Taylor expanded in im around inf 81.2%
if -1.2999999999999999e92 < im < -1.54999999999999985e23Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.7%
mul-1-neg3.7%
*-commutative3.7%
distribute-lft-neg-in3.7%
Simplified3.7%
Taylor expanded in re around 0 23.4%
neg-mul-123.4%
+-commutative23.4%
unsub-neg23.4%
*-commutative23.4%
associate-*l*23.4%
unpow223.4%
Simplified23.4%
if -1.54999999999999985e23 < im < 1.05000000000000005e85Initial program 20.1%
sub0-neg20.1%
Simplified20.1%
Taylor expanded in im around 0 87.1%
mul-1-neg87.1%
*-commutative87.1%
distribute-lft-neg-in87.1%
Simplified87.1%
Final simplification80.0%
(FPCore (re im)
:precision binary64
(if (or (<= im -1.55e+23) (not (<= im 2.15e-7)))
(/
(* (- 1.4551915228366852e-11 (* im im)) (+ (* -0.5 (* re re)) 1.0))
(+ im -3.814697265625e-6))
(- im)))
double code(double re, double im) {
double tmp;
if ((im <= -1.55e+23) || !(im <= 2.15e-7)) {
tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6);
} 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 <= (-1.55d+23)) .or. (.not. (im <= 2.15d-7))) then
tmp = ((1.4551915228366852d-11 - (im * im)) * (((-0.5d0) * (re * re)) + 1.0d0)) / (im + (-3.814697265625d-6))
else
tmp = -im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -1.55e+23) || !(im <= 2.15e-7)) {
tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6);
} else {
tmp = -im;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -1.55e+23) or not (im <= 2.15e-7): tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6) else: tmp = -im return tmp
function code(re, im) tmp = 0.0 if ((im <= -1.55e+23) || !(im <= 2.15e-7)) tmp = Float64(Float64(Float64(1.4551915228366852e-11 - Float64(im * im)) * Float64(Float64(-0.5 * Float64(re * re)) + 1.0)) / Float64(im + -3.814697265625e-6)); else tmp = Float64(-im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -1.55e+23) || ~((im <= 2.15e-7))) tmp = ((1.4551915228366852e-11 - (im * im)) * ((-0.5 * (re * re)) + 1.0)) / (im + -3.814697265625e-6); else tmp = -im; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -1.55e+23], N[Not[LessEqual[im, 2.15e-7]], $MachinePrecision]], N[(N[(N[(1.4551915228366852e-11 - N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(im + -3.814697265625e-6), $MachinePrecision]), $MachinePrecision], (-im)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1.55 \cdot 10^{+23} \lor \neg \left(im \leq 2.15 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{\left(1.4551915228366852 \cdot 10^{-11} - im \cdot im\right) \cdot \left(-0.5 \cdot \left(re \cdot re\right) + 1\right)}{im + -3.814697265625 \cdot 10^{-6}}\\
\mathbf{else}:\\
\;\;\;\;-im\\
\end{array}
\end{array}
if im < -1.54999999999999985e23 or 2.1500000000000001e-7 < im Initial program 99.7%
sub0-neg99.7%
Simplified99.7%
Taylor expanded in im around 0 69.0%
mul-1-neg69.0%
unsub-neg69.0%
*-commutative69.0%
associate-*l*69.0%
distribute-lft-out--69.0%
Simplified69.0%
Applied egg-rr5.8%
*-commutative5.8%
flip--49.9%
associate-*l/49.9%
metadata-eval49.9%
+-commutative49.9%
Applied egg-rr49.9%
Taylor expanded in re around 0 9.6%
sub-neg9.6%
+-commutative9.6%
associate-+l+9.6%
*-commutative9.6%
unpow29.6%
associate-*l*9.6%
sub-neg9.6%
unpow29.6%
*-rgt-identity9.6%
distribute-lft-out48.2%
unpow248.2%
Simplified48.2%
if -1.54999999999999985e23 < im < 2.1500000000000001e-7Initial program 13.0%
sub0-neg13.0%
Simplified13.0%
Taylor expanded in im around 0 93.9%
mul-1-neg93.9%
unsub-neg93.9%
*-commutative93.9%
associate-*l*93.9%
distribute-lft-out--93.9%
Simplified93.9%
Taylor expanded in re around 0 56.1%
Taylor expanded in im around 0 56.0%
neg-mul-156.0%
Simplified56.0%
Final simplification52.5%
(FPCore (re im)
:precision binary64
(let* ((t_0
(/ (- 1.4551915228366852e-11 (* im im)) (+ im -3.814697265625e-6))))
(if (<= im -6.5e+150)
t_0
(if (<= im -520.0)
(* (* re re) 0.75)
(if (<= im 2.15e-7)
(- im)
(if (<= im 2.9e+156) (- (* (* re re) (* im 0.5)) im) t_0))))))
double code(double re, double im) {
double t_0 = (1.4551915228366852e-11 - (im * im)) / (im + -3.814697265625e-6);
double tmp;
if (im <= -6.5e+150) {
tmp = t_0;
} else if (im <= -520.0) {
tmp = (re * re) * 0.75;
} else if (im <= 2.15e-7) {
tmp = -im;
} else if (im <= 2.9e+156) {
tmp = ((re * re) * (im * 0.5)) - im;
} 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 = (1.4551915228366852d-11 - (im * im)) / (im + (-3.814697265625d-6))
if (im <= (-6.5d+150)) then
tmp = t_0
else if (im <= (-520.0d0)) then
tmp = (re * re) * 0.75d0
else if (im <= 2.15d-7) then
tmp = -im
else if (im <= 2.9d+156) then
tmp = ((re * re) * (im * 0.5d0)) - im
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (1.4551915228366852e-11 - (im * im)) / (im + -3.814697265625e-6);
double tmp;
if (im <= -6.5e+150) {
tmp = t_0;
} else if (im <= -520.0) {
tmp = (re * re) * 0.75;
} else if (im <= 2.15e-7) {
tmp = -im;
} else if (im <= 2.9e+156) {
tmp = ((re * re) * (im * 0.5)) - im;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (1.4551915228366852e-11 - (im * im)) / (im + -3.814697265625e-6) tmp = 0 if im <= -6.5e+150: tmp = t_0 elif im <= -520.0: tmp = (re * re) * 0.75 elif im <= 2.15e-7: tmp = -im elif im <= 2.9e+156: tmp = ((re * re) * (im * 0.5)) - im else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(1.4551915228366852e-11 - Float64(im * im)) / Float64(im + -3.814697265625e-6)) tmp = 0.0 if (im <= -6.5e+150) tmp = t_0; elseif (im <= -520.0) tmp = Float64(Float64(re * re) * 0.75); elseif (im <= 2.15e-7) tmp = Float64(-im); elseif (im <= 2.9e+156) tmp = Float64(Float64(Float64(re * re) * Float64(im * 0.5)) - im); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (1.4551915228366852e-11 - (im * im)) / (im + -3.814697265625e-6); tmp = 0.0; if (im <= -6.5e+150) tmp = t_0; elseif (im <= -520.0) tmp = (re * re) * 0.75; elseif (im <= 2.15e-7) tmp = -im; elseif (im <= 2.9e+156) tmp = ((re * re) * (im * 0.5)) - im; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(1.4551915228366852e-11 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(im + -3.814697265625e-6), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -6.5e+150], t$95$0, If[LessEqual[im, -520.0], N[(N[(re * re), $MachinePrecision] * 0.75), $MachinePrecision], If[LessEqual[im, 2.15e-7], (-im), If[LessEqual[im, 2.9e+156], N[(N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1.4551915228366852 \cdot 10^{-11} - im \cdot im}{im + -3.814697265625 \cdot 10^{-6}}\\
\mathbf{if}\;im \leq -6.5 \cdot 10^{+150}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -520:\\
\;\;\;\;\left(re \cdot re\right) \cdot 0.75\\
\mathbf{elif}\;im \leq 2.15 \cdot 10^{-7}:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 2.9 \cdot 10^{+156}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right) - im\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -6.50000000000000033e150 or 2.9000000000000001e156 < 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%
*-commutative6.9%
flip--98.2%
associate-*l/98.2%
metadata-eval98.2%
+-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in re around 0 64.9%
unpow264.9%
Simplified64.9%
if -6.50000000000000033e150 < im < -520Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out73.8%
+-commutative73.8%
*-commutative73.8%
unpow273.8%
associate-*l*73.8%
Simplified73.8%
Applied egg-rr15.4%
Taylor expanded in re around inf 16.1%
unpow216.1%
Simplified16.1%
if -520 < im < 2.1500000000000001e-7Initial program 8.5%
sub0-neg8.5%
Simplified8.5%
Taylor expanded in im around 0 98.6%
mul-1-neg98.6%
unsub-neg98.6%
*-commutative98.6%
associate-*l*98.6%
distribute-lft-out--98.6%
Simplified98.6%
Taylor expanded in re around 0 58.8%
Taylor expanded in im around 0 58.8%
neg-mul-158.8%
Simplified58.8%
if 2.1500000000000001e-7 < im < 2.9000000000000001e156Initial program 98.8%
sub0-neg98.8%
Simplified98.8%
Taylor expanded in im around 0 9.0%
mul-1-neg9.0%
*-commutative9.0%
distribute-lft-neg-in9.0%
Simplified9.0%
Taylor expanded in re around 0 23.9%
neg-mul-123.9%
+-commutative23.9%
unsub-neg23.9%
*-commutative23.9%
associate-*l*23.9%
unpow223.9%
Simplified23.9%
Final simplification49.7%
(FPCore (re im) :precision binary64 (if (<= re 8e+166) (- (* (* re re) (* im 0.5)) im) (if (<= re 1.45e+273) (* (* re re) 0.75) (+ 13.5 (* (* re re) -6.75)))))
double code(double re, double im) {
double tmp;
if (re <= 8e+166) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (re <= 1.45e+273) {
tmp = (re * re) * 0.75;
} else {
tmp = 13.5 + ((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 <= 8d+166) then
tmp = ((re * re) * (im * 0.5d0)) - im
else if (re <= 1.45d+273) then
tmp = (re * re) * 0.75d0
else
tmp = 13.5d0 + ((re * re) * (-6.75d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 8e+166) {
tmp = ((re * re) * (im * 0.5)) - im;
} else if (re <= 1.45e+273) {
tmp = (re * re) * 0.75;
} else {
tmp = 13.5 + ((re * re) * -6.75);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 8e+166: tmp = ((re * re) * (im * 0.5)) - im elif re <= 1.45e+273: tmp = (re * re) * 0.75 else: tmp = 13.5 + ((re * re) * -6.75) return tmp
function code(re, im) tmp = 0.0 if (re <= 8e+166) tmp = Float64(Float64(Float64(re * re) * Float64(im * 0.5)) - im); elseif (re <= 1.45e+273) tmp = Float64(Float64(re * re) * 0.75); else tmp = Float64(13.5 + Float64(Float64(re * re) * -6.75)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 8e+166) tmp = ((re * re) * (im * 0.5)) - im; elseif (re <= 1.45e+273) tmp = (re * re) * 0.75; else tmp = 13.5 + ((re * re) * -6.75); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 8e+166], N[(N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[re, 1.45e+273], N[(N[(re * re), $MachinePrecision] * 0.75), $MachinePrecision], N[(13.5 + N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 8 \cdot 10^{+166}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right) - im\\
\mathbf{elif}\;re \leq 1.45 \cdot 10^{+273}:\\
\;\;\;\;\left(re \cdot re\right) \cdot 0.75\\
\mathbf{else}:\\
\;\;\;\;13.5 + \left(re \cdot re\right) \cdot -6.75\\
\end{array}
\end{array}
if re < 7.99999999999999952e166Initial program 50.8%
sub0-neg50.8%
Simplified50.8%
Taylor expanded in im around 0 55.5%
mul-1-neg55.5%
*-commutative55.5%
distribute-lft-neg-in55.5%
Simplified55.5%
Taylor expanded in re around 0 41.7%
neg-mul-141.7%
+-commutative41.7%
unsub-neg41.7%
*-commutative41.7%
associate-*l*41.7%
unpow241.7%
Simplified41.7%
if 7.99999999999999952e166 < re < 1.4499999999999999e273Initial program 57.0%
sub0-neg57.0%
Simplified57.0%
Taylor expanded in re around 0 0.1%
*-commutative0.1%
associate-*r*0.1%
distribute-rgt-out19.1%
+-commutative19.1%
*-commutative19.1%
unpow219.1%
associate-*l*19.1%
Simplified19.1%
Applied egg-rr39.1%
Taylor expanded in re around inf 39.1%
unpow239.1%
Simplified39.1%
if 1.4499999999999999e273 < re Initial program 59.0%
sub0-neg59.0%
Simplified59.0%
Applied egg-rr2.5%
Taylor expanded in re around 0 40.7%
*-commutative40.7%
unpow240.7%
Simplified40.7%
Final simplification41.4%
(FPCore (re im) :precision binary64 (if (or (<= im -600.0) (not (<= im 24000000000.0))) (* (* re re) 0.75) (- im)))
double code(double re, double im) {
double tmp;
if ((im <= -600.0) || !(im <= 24000000000.0)) {
tmp = (re * re) * 0.75;
} 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 <= (-600.0d0)) .or. (.not. (im <= 24000000000.0d0))) then
tmp = (re * re) * 0.75d0
else
tmp = -im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -600.0) || !(im <= 24000000000.0)) {
tmp = (re * re) * 0.75;
} else {
tmp = -im;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -600.0) or not (im <= 24000000000.0): tmp = (re * re) * 0.75 else: tmp = -im return tmp
function code(re, im) tmp = 0.0 if ((im <= -600.0) || !(im <= 24000000000.0)) tmp = Float64(Float64(re * re) * 0.75); else tmp = Float64(-im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -600.0) || ~((im <= 24000000000.0))) tmp = (re * re) * 0.75; else tmp = -im; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -600.0], N[Not[LessEqual[im, 24000000000.0]], $MachinePrecision]], N[(N[(re * re), $MachinePrecision] * 0.75), $MachinePrecision], (-im)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -600 \lor \neg \left(im \leq 24000000000\right):\\
\;\;\;\;\left(re \cdot re\right) \cdot 0.75\\
\mathbf{else}:\\
\;\;\;\;-im\\
\end{array}
\end{array}
if im < -600 or 2.4e10 < 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-out77.8%
+-commutative77.8%
*-commutative77.8%
unpow277.8%
associate-*l*77.8%
Simplified77.8%
Applied egg-rr13.3%
Taylor expanded in re around inf 13.4%
unpow213.4%
Simplified13.4%
if -600 < im < 2.4e10Initial program 11.0%
sub0-neg11.0%
Simplified11.0%
Taylor expanded in im around 0 96.9%
mul-1-neg96.9%
unsub-neg96.9%
*-commutative96.9%
associate-*l*96.9%
distribute-lft-out--96.9%
Simplified96.9%
Taylor expanded in re around 0 57.6%
Taylor expanded in im around 0 57.5%
neg-mul-157.5%
Simplified57.5%
Final simplification37.3%
(FPCore (re im) :precision binary64 (if (<= re -8e+160) (+ 13.5 (* (* re re) -6.75)) (if (<= re 7.8e+167) (- im) (* (* re re) 0.75))))
double code(double re, double im) {
double tmp;
if (re <= -8e+160) {
tmp = 13.5 + ((re * re) * -6.75);
} else if (re <= 7.8e+167) {
tmp = -im;
} else {
tmp = (re * re) * 0.75;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-8d+160)) then
tmp = 13.5d0 + ((re * re) * (-6.75d0))
else if (re <= 7.8d+167) then
tmp = -im
else
tmp = (re * re) * 0.75d0
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -8e+160) {
tmp = 13.5 + ((re * re) * -6.75);
} else if (re <= 7.8e+167) {
tmp = -im;
} else {
tmp = (re * re) * 0.75;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -8e+160: tmp = 13.5 + ((re * re) * -6.75) elif re <= 7.8e+167: tmp = -im else: tmp = (re * re) * 0.75 return tmp
function code(re, im) tmp = 0.0 if (re <= -8e+160) tmp = Float64(13.5 + Float64(Float64(re * re) * -6.75)); elseif (re <= 7.8e+167) tmp = Float64(-im); else tmp = Float64(Float64(re * re) * 0.75); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -8e+160) tmp = 13.5 + ((re * re) * -6.75); elseif (re <= 7.8e+167) tmp = -im; else tmp = (re * re) * 0.75; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -8e+160], N[(13.5 + N[(N[(re * re), $MachinePrecision] * -6.75), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 7.8e+167], (-im), N[(N[(re * re), $MachinePrecision] * 0.75), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -8 \cdot 10^{+160}:\\
\;\;\;\;13.5 + \left(re \cdot re\right) \cdot -6.75\\
\mathbf{elif}\;re \leq 7.8 \cdot 10^{+167}:\\
\;\;\;\;-im\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot 0.75\\
\end{array}
\end{array}
if re < -8.00000000000000005e160Initial program 54.6%
sub0-neg54.6%
Simplified54.6%
Applied egg-rr2.5%
Taylor expanded in re around 0 33.9%
*-commutative33.9%
unpow233.9%
Simplified33.9%
if -8.00000000000000005e160 < re < 7.7999999999999996e167Initial program 50.0%
sub0-neg50.0%
Simplified50.0%
Taylor expanded in im around 0 83.7%
mul-1-neg83.7%
unsub-neg83.7%
*-commutative83.7%
associate-*l*83.7%
distribute-lft-out--83.7%
Simplified83.7%
Taylor expanded in re around 0 60.0%
Taylor expanded in im around 0 39.2%
neg-mul-139.2%
Simplified39.2%
if 7.7999999999999996e167 < re Initial program 61.3%
sub0-neg61.3%
Simplified61.3%
Taylor expanded in re around 0 0.1%
*-commutative0.1%
associate-*r*0.1%
distribute-rgt-out20.8%
+-commutative20.8%
*-commutative20.8%
unpow220.8%
associate-*l*20.8%
Simplified20.8%
Applied egg-rr32.0%
Taylor expanded in re around inf 32.0%
unpow232.0%
Simplified32.0%
Final simplification38.0%
(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 51.7%
sub0-neg51.7%
Simplified51.7%
Taylor expanded in im around 0 82.8%
mul-1-neg82.8%
unsub-neg82.8%
*-commutative82.8%
associate-*l*82.8%
distribute-lft-out--82.8%
Simplified82.8%
Taylor expanded in re around 0 53.0%
Taylor expanded in im around 0 33.0%
neg-mul-133.0%
Simplified33.0%
Final simplification33.0%
(FPCore (re im) :precision binary64 -1.5)
double code(double re, double im) {
return -1.5;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -1.5d0
end function
public static double code(double re, double im) {
return -1.5;
}
def code(re, im): return -1.5
function code(re, im) return -1.5 end
function tmp = code(re, im) tmp = -1.5; end
code[re_, im_] := -1.5
\begin{array}{l}
\\
-1.5
\end{array}
Initial program 51.7%
sub0-neg51.7%
Simplified51.7%
Taylor expanded in re around 0 3.5%
*-commutative3.5%
associate-*r*3.5%
distribute-rgt-out39.5%
+-commutative39.5%
*-commutative39.5%
unpow239.5%
associate-*l*39.5%
Simplified39.5%
Applied egg-rr7.8%
Taylor expanded in re around 0 2.9%
Final simplification2.9%
(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 51.7%
sub0-neg51.7%
Simplified51.7%
Applied egg-rr3.1%
Taylor expanded in re around 0 3.0%
Final simplification3.0%
(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 2023193
(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))))