
(FPCore (re im) :precision binary64 (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * cos(re)) * (exp((0.0d0 - im)) - exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
}
def code(re, im): return (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im))
function code(re, im) return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * cos(re)) * (exp((0.0d0 - im)) - exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
}
def code(re, im): return (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im))
function code(re, im) return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)
\end{array}
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 5e-14)))
(* (* 0.5 (cos re)) t_0)
(- (* (pow im 3.0) (* (cos re) -0.16666666666666666)) (* 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 <= 5e-14)) {
tmp = (0.5 * cos(re)) * t_0;
} else {
tmp = (pow(im, 3.0) * (cos(re) * -0.16666666666666666)) - (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 <= 5e-14)) {
tmp = (0.5 * Math.cos(re)) * t_0;
} else {
tmp = (Math.pow(im, 3.0) * (Math.cos(re) * -0.16666666666666666)) - (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 <= 5e-14): tmp = (0.5 * math.cos(re)) * t_0 else: tmp = (math.pow(im, 3.0) * (math.cos(re) * -0.16666666666666666)) - (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 <= 5e-14)) tmp = Float64(Float64(0.5 * cos(re)) * t_0); else tmp = Float64(Float64((im ^ 3.0) * Float64(cos(re) * -0.16666666666666666)) - Float64(im * 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 <= 5e-14))) tmp = (0.5 * cos(re)) * t_0; else tmp = ((im ^ 3.0) * (cos(re) * -0.16666666666666666)) - (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, 5e-14]], $MachinePrecision]], N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Power[im, 3.0], $MachinePrecision] * N[(N[Cos[re], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] - N[(im * N[Cos[re], $MachinePrecision]), $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 5 \cdot 10^{-14}\right):\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;{im}^{3} \cdot \left(\cos re \cdot -0.16666666666666666\right) - im \cdot \cos re\\
\end{array}
\end{array}
if (-.f64 (exp.f64 (-.f64 0 im)) (exp.f64 im)) < -inf.0 or 5.0000000000000002e-14 < (-.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)) < 5.0000000000000002e-14Initial program 7.3%
sub0-neg7.3%
Simplified7.3%
Taylor expanded in im around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 5e-14)))
(* (* 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 <= -((double) INFINITY)) || !(t_0 <= 5e-14)) {
tmp = (0.5 * cos(re)) * t_0;
} else {
tmp = cos(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
}
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 <= 5e-14)) {
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 <= -math.inf) or not (t_0 <= 5e-14): 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 <= Float64(-Inf)) || !(t_0 <= 5e-14)) 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 <= -Inf) || ~((t_0 <= 5e-14))) 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, (-Infinity)], N[Not[LessEqual[t$95$0, 5e-14]], $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 -\infty \lor \neg \left(t_0 \leq 5 \cdot 10^{-14}\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)) < -inf.0 or 5.0000000000000002e-14 < (-.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)) < 5.0000000000000002e-14Initial program 7.3%
sub0-neg7.3%
Simplified7.3%
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
(if (or (<= im -2.7e+101)
(and (not (<= im -0.07)) (or (<= im 0.039) (not (<= im 5.5e+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.7e+101) || (!(im <= -0.07) && ((im <= 0.039) || !(im <= 5.5e+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.7d+101)) .or. (.not. (im <= (-0.07d0))) .and. (im <= 0.039d0) .or. (.not. (im <= 5.5d+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.7e+101) || (!(im <= -0.07) && ((im <= 0.039) || !(im <= 5.5e+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.7e+101) or (not (im <= -0.07) and ((im <= 0.039) or not (im <= 5.5e+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.7e+101) || (!(im <= -0.07) && ((im <= 0.039) || !(im <= 5.5e+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.7e+101) || (~((im <= -0.07)) && ((im <= 0.039) || ~((im <= 5.5e+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.7e+101], And[N[Not[LessEqual[im, -0.07]], $MachinePrecision], Or[LessEqual[im, 0.039], N[Not[LessEqual[im, 5.5e+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.7 \cdot 10^{+101} \lor \neg \left(im \leq -0.07\right) \land \left(im \leq 0.039 \lor \neg \left(im \leq 5.5 \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 < -2.70000000000000006e101 or -0.070000000000000007 < im < 0.0389999999999999999 or 5.49999999999999981e102 < im Initial program 46.3%
sub0-neg46.3%
Simplified46.3%
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.70000000000000006e101 < im < -0.070000000000000007 or 0.0389999999999999999 < im < 5.49999999999999981e102Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 81.5%
Final simplification95.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (- (exp (- im)) (exp im)))))
(if (<= im -0.00035)
t_0
(if (<= im 0.00355)
(* im (- (cos re)))
(if (<= im 1e+139)
t_0
(*
(+ (* im -2.0) (* (pow im 3.0) -0.3333333333333333))
(+ 0.5 (* re (* re -0.25)))))))))
double code(double re, double im) {
double t_0 = 0.5 * (exp(-im) - exp(im));
double tmp;
if (im <= -0.00035) {
tmp = t_0;
} else if (im <= 0.00355) {
tmp = im * -cos(re);
} else if (im <= 1e+139) {
tmp = t_0;
} else {
tmp = ((im * -2.0) + (pow(im, 3.0) * -0.3333333333333333)) * (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) :: tmp
t_0 = 0.5d0 * (exp(-im) - exp(im))
if (im <= (-0.00035d0)) then
tmp = t_0
else if (im <= 0.00355d0) then
tmp = im * -cos(re)
else if (im <= 1d+139) then
tmp = t_0
else
tmp = ((im * (-2.0d0)) + ((im ** 3.0d0) * (-0.3333333333333333d0))) * (0.5d0 + (re * (re * (-0.25d0))))
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 tmp;
if (im <= -0.00035) {
tmp = t_0;
} else if (im <= 0.00355) {
tmp = im * -Math.cos(re);
} else if (im <= 1e+139) {
tmp = t_0;
} else {
tmp = ((im * -2.0) + (Math.pow(im, 3.0) * -0.3333333333333333)) * (0.5 + (re * (re * -0.25)));
}
return tmp;
}
def code(re, im): t_0 = 0.5 * (math.exp(-im) - math.exp(im)) tmp = 0 if im <= -0.00035: tmp = t_0 elif im <= 0.00355: tmp = im * -math.cos(re) elif im <= 1e+139: tmp = t_0 else: tmp = ((im * -2.0) + (math.pow(im, 3.0) * -0.3333333333333333)) * (0.5 + (re * (re * -0.25))) return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(exp(Float64(-im)) - exp(im))) tmp = 0.0 if (im <= -0.00035) tmp = t_0; elseif (im <= 0.00355) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 1e+139) tmp = t_0; else tmp = Float64(Float64(Float64(im * -2.0) + Float64((im ^ 3.0) * -0.3333333333333333)) * Float64(0.5 + Float64(re * Float64(re * -0.25)))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (exp(-im) - exp(im)); tmp = 0.0; if (im <= -0.00035) tmp = t_0; elseif (im <= 0.00355) tmp = im * -cos(re); elseif (im <= 1e+139) tmp = t_0; else tmp = ((im * -2.0) + ((im ^ 3.0) * -0.3333333333333333)) * (0.5 + (re * (re * -0.25))); 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]}, If[LessEqual[im, -0.00035], t$95$0, If[LessEqual[im, 0.00355], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 1e+139], t$95$0, N[(N[(N[(im * -2.0), $MachinePrecision] + N[(N[Power[im, 3.0], $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(e^{-im} - e^{im}\right)\\
\mathbf{if}\;im \leq -0.00035:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 0.00355:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 10^{+139}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot -2 + {im}^{3} \cdot -0.3333333333333333\right) \cdot \left(0.5 + re \cdot \left(re \cdot -0.25\right)\right)\\
\end{array}
\end{array}
if im < -3.49999999999999996e-4 or 0.0035500000000000002 < im < 1.00000000000000003e139Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 84.0%
if -3.49999999999999996e-4 < im < 0.0035500000000000002Initial program 7.3%
sub0-neg7.3%
Simplified7.3%
Taylor expanded in im around 0 99.7%
mul-1-neg99.7%
*-commutative99.7%
distribute-lft-neg-in99.7%
Simplified99.7%
if 1.00000000000000003e139 < 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-out87.2%
+-commutative87.2%
*-commutative87.2%
unpow287.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in im around 0 87.2%
Final simplification91.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.3333333333333333)))
(if (<= im -1e+166)
(* (pow im 3.0) -0.16666666666666666)
(if (<= im -21500000.0)
(* t_0 (+ 0.5 (* -0.25 (* re re))))
(if (<= im 4.2e-7)
(* im (- (cos re)))
(if (<= im 7.5e+138)
(-
(* im (+ (* re (* 0.5 re)) (* (pow re 4.0) -0.041666666666666664)))
im)
(* (+ (* im -2.0) t_0) (+ 0.5 (* re (* re -0.25))))))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.3333333333333333;
double tmp;
if (im <= -1e+166) {
tmp = pow(im, 3.0) * -0.16666666666666666;
} else if (im <= -21500000.0) {
tmp = t_0 * (0.5 + (-0.25 * (re * re)));
} else if (im <= 4.2e-7) {
tmp = im * -cos(re);
} else if (im <= 7.5e+138) {
tmp = (im * ((re * (0.5 * re)) + (pow(re, 4.0) * -0.041666666666666664))) - im;
} else {
tmp = ((im * -2.0) + 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) :: tmp
t_0 = (im ** 3.0d0) * (-0.3333333333333333d0)
if (im <= (-1d+166)) then
tmp = (im ** 3.0d0) * (-0.16666666666666666d0)
else if (im <= (-21500000.0d0)) then
tmp = t_0 * (0.5d0 + ((-0.25d0) * (re * re)))
else if (im <= 4.2d-7) then
tmp = im * -cos(re)
else if (im <= 7.5d+138) then
tmp = (im * ((re * (0.5d0 * re)) + ((re ** 4.0d0) * (-0.041666666666666664d0)))) - im
else
tmp = ((im * (-2.0d0)) + 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.pow(im, 3.0) * -0.3333333333333333;
double tmp;
if (im <= -1e+166) {
tmp = Math.pow(im, 3.0) * -0.16666666666666666;
} else if (im <= -21500000.0) {
tmp = t_0 * (0.5 + (-0.25 * (re * re)));
} else if (im <= 4.2e-7) {
tmp = im * -Math.cos(re);
} else if (im <= 7.5e+138) {
tmp = (im * ((re * (0.5 * re)) + (Math.pow(re, 4.0) * -0.041666666666666664))) - im;
} else {
tmp = ((im * -2.0) + t_0) * (0.5 + (re * (re * -0.25)));
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.3333333333333333 tmp = 0 if im <= -1e+166: tmp = math.pow(im, 3.0) * -0.16666666666666666 elif im <= -21500000.0: tmp = t_0 * (0.5 + (-0.25 * (re * re))) elif im <= 4.2e-7: tmp = im * -math.cos(re) elif im <= 7.5e+138: tmp = (im * ((re * (0.5 * re)) + (math.pow(re, 4.0) * -0.041666666666666664))) - im else: tmp = ((im * -2.0) + t_0) * (0.5 + (re * (re * -0.25))) return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.3333333333333333) tmp = 0.0 if (im <= -1e+166) tmp = Float64((im ^ 3.0) * -0.16666666666666666); elseif (im <= -21500000.0) tmp = Float64(t_0 * Float64(0.5 + Float64(-0.25 * Float64(re * re)))); elseif (im <= 4.2e-7) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 7.5e+138) tmp = Float64(Float64(im * Float64(Float64(re * Float64(0.5 * re)) + Float64((re ^ 4.0) * -0.041666666666666664))) - im); else tmp = Float64(Float64(Float64(im * -2.0) + t_0) * Float64(0.5 + Float64(re * Float64(re * -0.25)))); end return tmp end
function tmp_2 = code(re, im) t_0 = (im ^ 3.0) * -0.3333333333333333; tmp = 0.0; if (im <= -1e+166) tmp = (im ^ 3.0) * -0.16666666666666666; elseif (im <= -21500000.0) tmp = t_0 * (0.5 + (-0.25 * (re * re))); elseif (im <= 4.2e-7) tmp = im * -cos(re); elseif (im <= 7.5e+138) tmp = (im * ((re * (0.5 * re)) + ((re ^ 4.0) * -0.041666666666666664))) - im; else tmp = ((im * -2.0) + t_0) * (0.5 + (re * (re * -0.25))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Power[im, 3.0], $MachinePrecision] * -0.3333333333333333), $MachinePrecision]}, If[LessEqual[im, -1e+166], N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision], If[LessEqual[im, -21500000.0], N[(t$95$0 * N[(0.5 + N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.2e-7], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 7.5e+138], N[(N[(im * N[(N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision] + N[(N[Power[re, 4.0], $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], N[(N[(N[(im * -2.0), $MachinePrecision] + t$95$0), $MachinePrecision] * N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.3333333333333333\\
\mathbf{if}\;im \leq -1 \cdot 10^{+166}:\\
\;\;\;\;{im}^{3} \cdot -0.16666666666666666\\
\mathbf{elif}\;im \leq -21500000:\\
\;\;\;\;t_0 \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 7.5 \cdot 10^{+138}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.5 \cdot re\right) + {re}^{4} \cdot -0.041666666666666664\right) - im\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot -2 + t_0\right) \cdot \left(0.5 + re \cdot \left(re \cdot -0.25\right)\right)\\
\end{array}
\end{array}
if im < -9.9999999999999994e165Initial 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.1%
+-commutative73.1%
*-commutative73.1%
unpow273.1%
associate-*l*73.1%
Simplified73.1%
Taylor expanded in im around 0 73.1%
Taylor expanded in im around inf 73.1%
associate-*r*73.1%
unpow273.1%
Simplified73.1%
Taylor expanded in re around 0 92.3%
*-commutative92.3%
Simplified92.3%
if -9.9999999999999994e165 < im < -2.15e7Initial 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.3%
+-commutative77.3%
*-commutative77.3%
unpow277.3%
associate-*l*77.3%
Simplified77.3%
Taylor expanded in im around 0 40.9%
Taylor expanded in im around inf 40.9%
associate-*r*40.9%
unpow240.9%
Simplified40.9%
if -2.15e7 < im < 4.2e-7Initial program 8.3%
sub0-neg8.3%
Simplified8.3%
Taylor expanded in im around 0 98.2%
mul-1-neg98.2%
*-commutative98.2%
distribute-lft-neg-in98.2%
Simplified98.2%
if 4.2e-7 < im < 7.4999999999999999e138Initial program 99.0%
sub0-neg99.0%
Simplified99.0%
Taylor expanded in im around 0 6.6%
mul-1-neg6.6%
*-commutative6.6%
distribute-lft-neg-in6.6%
Simplified6.6%
Taylor expanded in re around 0 21.9%
neg-mul-121.9%
associate-+r+21.9%
+-commutative21.9%
unsub-neg21.9%
associate-+r-21.9%
associate-*r*21.9%
associate-*r*21.9%
distribute-rgt-out28.8%
*-commutative28.8%
unpow228.8%
associate-*l*28.8%
*-commutative28.8%
Simplified28.8%
if 7.4999999999999999e138 < 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-out87.2%
+-commutative87.2%
*-commutative87.2%
unpow287.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in im around 0 87.2%
Final simplification78.2%
(FPCore (re im)
:precision binary64
(let* ((t_0
(* (* (pow im 3.0) -0.3333333333333333) (+ 0.5 (* -0.25 (* re re))))))
(if (<= im -4e+163)
(* (pow im 3.0) -0.16666666666666666)
(if (<= im -54000000.0)
t_0
(if (<= im 4.2e-7)
(* im (- (cos re)))
(if (<= im 7.5e+138)
(-
(* im (+ (* re (* 0.5 re)) (* (pow re 4.0) -0.041666666666666664)))
im)
t_0))))))
double code(double re, double im) {
double t_0 = (pow(im, 3.0) * -0.3333333333333333) * (0.5 + (-0.25 * (re * re)));
double tmp;
if (im <= -4e+163) {
tmp = pow(im, 3.0) * -0.16666666666666666;
} else if (im <= -54000000.0) {
tmp = t_0;
} else if (im <= 4.2e-7) {
tmp = im * -cos(re);
} else if (im <= 7.5e+138) {
tmp = (im * ((re * (0.5 * re)) + (pow(re, 4.0) * -0.041666666666666664))) - 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.3333333333333333d0)) * (0.5d0 + ((-0.25d0) * (re * re)))
if (im <= (-4d+163)) then
tmp = (im ** 3.0d0) * (-0.16666666666666666d0)
else if (im <= (-54000000.0d0)) then
tmp = t_0
else if (im <= 4.2d-7) then
tmp = im * -cos(re)
else if (im <= 7.5d+138) then
tmp = (im * ((re * (0.5d0 * re)) + ((re ** 4.0d0) * (-0.041666666666666664d0)))) - 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.3333333333333333) * (0.5 + (-0.25 * (re * re)));
double tmp;
if (im <= -4e+163) {
tmp = Math.pow(im, 3.0) * -0.16666666666666666;
} else if (im <= -54000000.0) {
tmp = t_0;
} else if (im <= 4.2e-7) {
tmp = im * -Math.cos(re);
} else if (im <= 7.5e+138) {
tmp = (im * ((re * (0.5 * re)) + (Math.pow(re, 4.0) * -0.041666666666666664))) - im;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (math.pow(im, 3.0) * -0.3333333333333333) * (0.5 + (-0.25 * (re * re))) tmp = 0 if im <= -4e+163: tmp = math.pow(im, 3.0) * -0.16666666666666666 elif im <= -54000000.0: tmp = t_0 elif im <= 4.2e-7: tmp = im * -math.cos(re) elif im <= 7.5e+138: tmp = (im * ((re * (0.5 * re)) + (math.pow(re, 4.0) * -0.041666666666666664))) - im else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64((im ^ 3.0) * -0.3333333333333333) * Float64(0.5 + Float64(-0.25 * Float64(re * re)))) tmp = 0.0 if (im <= -4e+163) tmp = Float64((im ^ 3.0) * -0.16666666666666666); elseif (im <= -54000000.0) tmp = t_0; elseif (im <= 4.2e-7) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 7.5e+138) tmp = Float64(Float64(im * Float64(Float64(re * Float64(0.5 * re)) + Float64((re ^ 4.0) * -0.041666666666666664))) - im); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = ((im ^ 3.0) * -0.3333333333333333) * (0.5 + (-0.25 * (re * re))); tmp = 0.0; if (im <= -4e+163) tmp = (im ^ 3.0) * -0.16666666666666666; elseif (im <= -54000000.0) tmp = t_0; elseif (im <= 4.2e-7) tmp = im * -cos(re); elseif (im <= 7.5e+138) tmp = (im * ((re * (0.5 * re)) + ((re ^ 4.0) * -0.041666666666666664))) - im; 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.3333333333333333), $MachinePrecision] * N[(0.5 + N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4e+163], N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision], If[LessEqual[im, -54000000.0], t$95$0, If[LessEqual[im, 4.2e-7], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 7.5e+138], N[(N[(im * N[(N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision] + N[(N[Power[re, 4.0], $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({im}^{3} \cdot -0.3333333333333333\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)\\
\mathbf{if}\;im \leq -4 \cdot 10^{+163}:\\
\;\;\;\;{im}^{3} \cdot -0.16666666666666666\\
\mathbf{elif}\;im \leq -54000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 7.5 \cdot 10^{+138}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.5 \cdot re\right) + {re}^{4} \cdot -0.041666666666666664\right) - im\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -3.9999999999999998e163Initial 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.1%
+-commutative73.1%
*-commutative73.1%
unpow273.1%
associate-*l*73.1%
Simplified73.1%
Taylor expanded in im around 0 73.1%
Taylor expanded in im around inf 73.1%
associate-*r*73.1%
unpow273.1%
Simplified73.1%
Taylor expanded in re around 0 92.3%
*-commutative92.3%
Simplified92.3%
if -3.9999999999999998e163 < im < -5.4e7 or 7.4999999999999999e138 < 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-out81.9%
+-commutative81.9%
*-commutative81.9%
unpow281.9%
associate-*l*81.9%
Simplified81.9%
Taylor expanded in im around 0 62.6%
Taylor expanded in im around inf 62.6%
associate-*r*62.6%
unpow262.6%
Simplified62.6%
if -5.4e7 < im < 4.2e-7Initial program 8.3%
sub0-neg8.3%
Simplified8.3%
Taylor expanded in im around 0 98.2%
mul-1-neg98.2%
*-commutative98.2%
distribute-lft-neg-in98.2%
Simplified98.2%
if 4.2e-7 < im < 7.4999999999999999e138Initial program 99.0%
sub0-neg99.0%
Simplified99.0%
Taylor expanded in im around 0 6.6%
mul-1-neg6.6%
*-commutative6.6%
distribute-lft-neg-in6.6%
Simplified6.6%
Taylor expanded in re around 0 21.9%
neg-mul-121.9%
associate-+r+21.9%
+-commutative21.9%
unsub-neg21.9%
associate-+r-21.9%
associate-*r*21.9%
associate-*r*21.9%
distribute-rgt-out28.8%
*-commutative28.8%
unpow228.8%
associate-*l*28.8%
*-commutative28.8%
Simplified28.8%
Final simplification78.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666))
(t_1
(* (* (pow im 3.0) -0.3333333333333333) (+ 0.5 (* -0.25 (* re re))))))
(if (<= im -3.8e+167)
t_0
(if (<= im -21500000.0)
t_1
(if (<= im 4.2e-7)
(* im (- (cos re)))
(if (<= im 1e+139) (- t_0 im) t_1))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double t_1 = (pow(im, 3.0) * -0.3333333333333333) * (0.5 + (-0.25 * (re * re)));
double tmp;
if (im <= -3.8e+167) {
tmp = t_0;
} else if (im <= -21500000.0) {
tmp = t_1;
} else if (im <= 4.2e-7) {
tmp = im * -cos(re);
} else if (im <= 1e+139) {
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 = ((im ** 3.0d0) * (-0.3333333333333333d0)) * (0.5d0 + ((-0.25d0) * (re * re)))
if (im <= (-3.8d+167)) then
tmp = t_0
else if (im <= (-21500000.0d0)) then
tmp = t_1
else if (im <= 4.2d-7) then
tmp = im * -cos(re)
else if (im <= 1d+139) 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.pow(im, 3.0) * -0.3333333333333333) * (0.5 + (-0.25 * (re * re)));
double tmp;
if (im <= -3.8e+167) {
tmp = t_0;
} else if (im <= -21500000.0) {
tmp = t_1;
} else if (im <= 4.2e-7) {
tmp = im * -Math.cos(re);
} else if (im <= 1e+139) {
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.pow(im, 3.0) * -0.3333333333333333) * (0.5 + (-0.25 * (re * re))) tmp = 0 if im <= -3.8e+167: tmp = t_0 elif im <= -21500000.0: tmp = t_1 elif im <= 4.2e-7: tmp = im * -math.cos(re) elif im <= 1e+139: 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((im ^ 3.0) * -0.3333333333333333) * Float64(0.5 + Float64(-0.25 * Float64(re * re)))) tmp = 0.0 if (im <= -3.8e+167) tmp = t_0; elseif (im <= -21500000.0) tmp = t_1; elseif (im <= 4.2e-7) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 1e+139) 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 = ((im ^ 3.0) * -0.3333333333333333) * (0.5 + (-0.25 * (re * re))); tmp = 0.0; if (im <= -3.8e+167) tmp = t_0; elseif (im <= -21500000.0) tmp = t_1; elseif (im <= 4.2e-7) tmp = im * -cos(re); elseif (im <= 1e+139) 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[Power[im, 3.0], $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * N[(0.5 + N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -3.8e+167], t$95$0, If[LessEqual[im, -21500000.0], t$95$1, If[LessEqual[im, 4.2e-7], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 1e+139], N[(t$95$0 - im), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
t_1 := \left({im}^{3} \cdot -0.3333333333333333\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)\\
\mathbf{if}\;im \leq -3.8 \cdot 10^{+167}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -21500000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 10^{+139}:\\
\;\;\;\;t_0 - im\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -3.79999999999999994e167Initial 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.1%
+-commutative73.1%
*-commutative73.1%
unpow273.1%
associate-*l*73.1%
Simplified73.1%
Taylor expanded in im around 0 73.1%
Taylor expanded in im around inf 73.1%
associate-*r*73.1%
unpow273.1%
Simplified73.1%
Taylor expanded in re around 0 92.3%
*-commutative92.3%
Simplified92.3%
if -3.79999999999999994e167 < im < -2.15e7 or 1.00000000000000003e139 < 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-out81.9%
+-commutative81.9%
*-commutative81.9%
unpow281.9%
associate-*l*81.9%
Simplified81.9%
Taylor expanded in im around 0 62.6%
Taylor expanded in im around inf 62.6%
associate-*r*62.6%
unpow262.6%
Simplified62.6%
if -2.15e7 < im < 4.2e-7Initial program 8.3%
sub0-neg8.3%
Simplified8.3%
Taylor expanded in im around 0 98.2%
mul-1-neg98.2%
*-commutative98.2%
distribute-lft-neg-in98.2%
Simplified98.2%
if 4.2e-7 < im < 1.00000000000000003e139Initial program 99.0%
sub0-neg99.0%
Simplified99.0%
Taylor expanded in im around 0 28.0%
mul-1-neg28.0%
unsub-neg28.0%
*-commutative28.0%
*-commutative28.0%
*-commutative28.0%
associate-*l*28.0%
Simplified28.0%
Taylor expanded in re around 0 27.7%
Final simplification78.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* -0.25 (* re re))))
(t_1 (/ (- (* im im) (* 4.0 (* t_0 t_0))) (- (- im) (* -2.0 t_0)))))
(if (<= im -3e+25)
t_1
(if (<= im 1.52e+55)
(- (* re (* re (* im 0.5))) im)
(if (<= im 9.5e+139)
(* (+ 0.5 (* re (* re -0.25))) 27.0)
(if (<= im 8e+220) (* (pow im 3.0) 0.0625) t_1))))))
double code(double re, double im) {
double t_0 = im * (-0.25 * (re * re));
double t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0));
double tmp;
if (im <= -3e+25) {
tmp = t_1;
} else if (im <= 1.52e+55) {
tmp = (re * (re * (im * 0.5))) - im;
} else if (im <= 9.5e+139) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else if (im <= 8e+220) {
tmp = pow(im, 3.0) * 0.0625;
} 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 * ((-0.25d0) * (re * re))
t_1 = ((im * im) - (4.0d0 * (t_0 * t_0))) / (-im - ((-2.0d0) * t_0))
if (im <= (-3d+25)) then
tmp = t_1
else if (im <= 1.52d+55) then
tmp = (re * (re * (im * 0.5d0))) - im
else if (im <= 9.5d+139) then
tmp = (0.5d0 + (re * (re * (-0.25d0)))) * 27.0d0
else if (im <= 8d+220) then
tmp = (im ** 3.0d0) * 0.0625d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (-0.25 * (re * re));
double t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0));
double tmp;
if (im <= -3e+25) {
tmp = t_1;
} else if (im <= 1.52e+55) {
tmp = (re * (re * (im * 0.5))) - im;
} else if (im <= 9.5e+139) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else if (im <= 8e+220) {
tmp = Math.pow(im, 3.0) * 0.0625;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = im * (-0.25 * (re * re)) t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0)) tmp = 0 if im <= -3e+25: tmp = t_1 elif im <= 1.52e+55: tmp = (re * (re * (im * 0.5))) - im elif im <= 9.5e+139: tmp = (0.5 + (re * (re * -0.25))) * 27.0 elif im <= 8e+220: tmp = math.pow(im, 3.0) * 0.0625 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(im * Float64(-0.25 * Float64(re * re))) t_1 = Float64(Float64(Float64(im * im) - Float64(4.0 * Float64(t_0 * t_0))) / Float64(Float64(-im) - Float64(-2.0 * t_0))) tmp = 0.0 if (im <= -3e+25) tmp = t_1; elseif (im <= 1.52e+55) tmp = Float64(Float64(re * Float64(re * Float64(im * 0.5))) - im); elseif (im <= 9.5e+139) tmp = Float64(Float64(0.5 + Float64(re * Float64(re * -0.25))) * 27.0); elseif (im <= 8e+220) tmp = Float64((im ^ 3.0) * 0.0625); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = im * (-0.25 * (re * re)); t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0)); tmp = 0.0; if (im <= -3e+25) tmp = t_1; elseif (im <= 1.52e+55) tmp = (re * (re * (im * 0.5))) - im; elseif (im <= 9.5e+139) tmp = (0.5 + (re * (re * -0.25))) * 27.0; elseif (im <= 8e+220) tmp = (im ^ 3.0) * 0.0625; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(im * im), $MachinePrecision] - N[(4.0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[((-im) - N[(-2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -3e+25], t$95$1, If[LessEqual[im, 1.52e+55], N[(N[(re * N[(re * N[(im * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 9.5e+139], N[(N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 27.0), $MachinePrecision], If[LessEqual[im, 8e+220], N[(N[Power[im, 3.0], $MachinePrecision] * 0.0625), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(-0.25 \cdot \left(re \cdot re\right)\right)\\
t_1 := \frac{im \cdot im - 4 \cdot \left(t_0 \cdot t_0\right)}{\left(-im\right) - -2 \cdot t_0}\\
\mathbf{if}\;im \leq -3 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 1.52 \cdot 10^{+55}:\\
\;\;\;\;re \cdot \left(re \cdot \left(im \cdot 0.5\right)\right) - im\\
\mathbf{elif}\;im \leq 9.5 \cdot 10^{+139}:\\
\;\;\;\;\left(0.5 + re \cdot \left(re \cdot -0.25\right)\right) \cdot 27\\
\mathbf{elif}\;im \leq 8 \cdot 10^{+220}:\\
\;\;\;\;{im}^{3} \cdot 0.0625\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -3.00000000000000006e25 or 8e220 < 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-out82.3%
+-commutative82.3%
*-commutative82.3%
unpow282.3%
associate-*l*82.3%
Simplified82.3%
Taylor expanded in im around 0 18.0%
distribute-lft-in18.0%
flip-+39.1%
Applied egg-rr39.1%
swap-sqr39.1%
metadata-eval39.1%
swap-sqr39.1%
metadata-eval39.1%
*-commutative39.1%
mul-1-neg39.1%
Simplified39.1%
if -3.00000000000000006e25 < im < 1.5200000000000001e55Initial program 21.4%
sub0-neg21.4%
Simplified21.4%
Taylor expanded in im around 0 85.1%
mul-1-neg85.1%
*-commutative85.1%
distribute-lft-neg-in85.1%
Simplified85.1%
Taylor expanded in re around 0 52.0%
neg-mul-152.0%
+-commutative52.0%
unsub-neg52.0%
*-commutative52.0%
associate-*l*52.0%
metadata-eval52.0%
distribute-rgt-neg-in52.0%
*-commutative52.0%
unpow252.0%
associate-*l*52.1%
*-commutative52.1%
distribute-rgt-neg-in52.1%
metadata-eval52.1%
Simplified52.1%
if 1.5200000000000001e55 < im < 9.5000000000000002e139Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out41.2%
+-commutative41.2%
*-commutative41.2%
unpow241.2%
associate-*l*41.2%
Simplified41.2%
Applied egg-rr37.1%
if 9.5000000000000002e139 < im < 8e220Initial 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%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Applied egg-rr50.0%
Taylor expanded in im around inf 50.0%
Final simplification46.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* -0.25 (* re re))))
(t_1 (/ (- (* im im) (* 4.0 (* t_0 t_0))) (- (- im) (* -2.0 t_0)))))
(if (<= im -4.8e+23)
t_1
(if (<= im 2.35e+51)
(* im (- (cos re)))
(if (<= im 7.8e+138)
(* (+ 0.5 (* re (* re -0.25))) 27.0)
(if (<= im 1.35e+221) (* (pow im 3.0) 0.0625) t_1))))))
double code(double re, double im) {
double t_0 = im * (-0.25 * (re * re));
double t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0));
double tmp;
if (im <= -4.8e+23) {
tmp = t_1;
} else if (im <= 2.35e+51) {
tmp = im * -cos(re);
} else if (im <= 7.8e+138) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else if (im <= 1.35e+221) {
tmp = pow(im, 3.0) * 0.0625;
} 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 * ((-0.25d0) * (re * re))
t_1 = ((im * im) - (4.0d0 * (t_0 * t_0))) / (-im - ((-2.0d0) * t_0))
if (im <= (-4.8d+23)) then
tmp = t_1
else if (im <= 2.35d+51) then
tmp = im * -cos(re)
else if (im <= 7.8d+138) then
tmp = (0.5d0 + (re * (re * (-0.25d0)))) * 27.0d0
else if (im <= 1.35d+221) then
tmp = (im ** 3.0d0) * 0.0625d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (-0.25 * (re * re));
double t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0));
double tmp;
if (im <= -4.8e+23) {
tmp = t_1;
} else if (im <= 2.35e+51) {
tmp = im * -Math.cos(re);
} else if (im <= 7.8e+138) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else if (im <= 1.35e+221) {
tmp = Math.pow(im, 3.0) * 0.0625;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = im * (-0.25 * (re * re)) t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0)) tmp = 0 if im <= -4.8e+23: tmp = t_1 elif im <= 2.35e+51: tmp = im * -math.cos(re) elif im <= 7.8e+138: tmp = (0.5 + (re * (re * -0.25))) * 27.0 elif im <= 1.35e+221: tmp = math.pow(im, 3.0) * 0.0625 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(im * Float64(-0.25 * Float64(re * re))) t_1 = Float64(Float64(Float64(im * im) - Float64(4.0 * Float64(t_0 * t_0))) / Float64(Float64(-im) - Float64(-2.0 * t_0))) tmp = 0.0 if (im <= -4.8e+23) tmp = t_1; elseif (im <= 2.35e+51) tmp = Float64(im * Float64(-cos(re))); elseif (im <= 7.8e+138) tmp = Float64(Float64(0.5 + Float64(re * Float64(re * -0.25))) * 27.0); elseif (im <= 1.35e+221) tmp = Float64((im ^ 3.0) * 0.0625); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = im * (-0.25 * (re * re)); t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0)); tmp = 0.0; if (im <= -4.8e+23) tmp = t_1; elseif (im <= 2.35e+51) tmp = im * -cos(re); elseif (im <= 7.8e+138) tmp = (0.5 + (re * (re * -0.25))) * 27.0; elseif (im <= 1.35e+221) tmp = (im ^ 3.0) * 0.0625; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(im * im), $MachinePrecision] - N[(4.0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[((-im) - N[(-2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4.8e+23], t$95$1, If[LessEqual[im, 2.35e+51], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], If[LessEqual[im, 7.8e+138], N[(N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 27.0), $MachinePrecision], If[LessEqual[im, 1.35e+221], N[(N[Power[im, 3.0], $MachinePrecision] * 0.0625), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(-0.25 \cdot \left(re \cdot re\right)\right)\\
t_1 := \frac{im \cdot im - 4 \cdot \left(t_0 \cdot t_0\right)}{\left(-im\right) - -2 \cdot t_0}\\
\mathbf{if}\;im \leq -4.8 \cdot 10^{+23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 2.35 \cdot 10^{+51}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 7.8 \cdot 10^{+138}:\\
\;\;\;\;\left(0.5 + re \cdot \left(re \cdot -0.25\right)\right) \cdot 27\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+221}:\\
\;\;\;\;{im}^{3} \cdot 0.0625\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -4.8e23 or 1.35e221 < 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-out82.5%
+-commutative82.5%
*-commutative82.5%
unpow282.5%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in im around 0 17.8%
distribute-lft-in17.8%
flip-+38.6%
Applied egg-rr38.6%
swap-sqr38.6%
metadata-eval38.6%
swap-sqr38.6%
metadata-eval38.6%
*-commutative38.6%
mul-1-neg38.6%
Simplified38.6%
if -4.8e23 < im < 2.3500000000000001e51Initial program 20.8%
sub0-neg20.8%
Simplified20.8%
Taylor expanded in im around 0 85.7%
mul-1-neg85.7%
*-commutative85.7%
distribute-lft-neg-in85.7%
Simplified85.7%
if 2.3500000000000001e51 < im < 7.7999999999999996e138Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out41.2%
+-commutative41.2%
*-commutative41.2%
unpow241.2%
associate-*l*41.2%
Simplified41.2%
Applied egg-rr37.1%
if 7.7999999999999996e138 < im < 1.35e221Initial 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%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Applied egg-rr50.0%
Taylor expanded in im around inf 50.0%
Final simplification64.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666)))
(if (<= im -2.4e+89)
t_0
(if (<= im -1.18e+44)
(/
(- 2.25 (* (* (* re re) (* re re)) 0.5625))
(- -1.5 (* re (* re 0.75))))
(if (<= im 4.2e-7) (* im (- (cos re))) (- t_0 im))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double tmp;
if (im <= -2.4e+89) {
tmp = t_0;
} else if (im <= -1.18e+44) {
tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - (re * (re * 0.75)));
} else if (im <= 4.2e-7) {
tmp = im * -cos(re);
} 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 <= (-2.4d+89)) then
tmp = t_0
else if (im <= (-1.18d+44)) then
tmp = (2.25d0 - (((re * re) * (re * re)) * 0.5625d0)) / ((-1.5d0) - (re * (re * 0.75d0)))
else if (im <= 4.2d-7) then
tmp = im * -cos(re)
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 <= -2.4e+89) {
tmp = t_0;
} else if (im <= -1.18e+44) {
tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - (re * (re * 0.75)));
} else if (im <= 4.2e-7) {
tmp = im * -Math.cos(re);
} else {
tmp = t_0 - im;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 tmp = 0 if im <= -2.4e+89: tmp = t_0 elif im <= -1.18e+44: tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - (re * (re * 0.75))) elif im <= 4.2e-7: tmp = im * -math.cos(re) else: tmp = t_0 - im return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) tmp = 0.0 if (im <= -2.4e+89) tmp = t_0; elseif (im <= -1.18e+44) tmp = Float64(Float64(2.25 - Float64(Float64(Float64(re * re) * Float64(re * re)) * 0.5625)) / Float64(-1.5 - Float64(re * Float64(re * 0.75)))); elseif (im <= 4.2e-7) tmp = Float64(im * Float64(-cos(re))); 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 <= -2.4e+89) tmp = t_0; elseif (im <= -1.18e+44) tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - (re * (re * 0.75))); elseif (im <= 4.2e-7) tmp = im * -cos(re); 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, -2.4e+89], t$95$0, If[LessEqual[im, -1.18e+44], N[(N[(2.25 - N[(N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * 0.5625), $MachinePrecision]), $MachinePrecision] / N[(-1.5 - N[(re * N[(re * 0.75), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.2e-7], N[(im * (-N[Cos[re], $MachinePrecision])), $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.4 \cdot 10^{+89}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -1.18 \cdot 10^{+44}:\\
\;\;\;\;\frac{2.25 - \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot 0.5625}{-1.5 - re \cdot \left(re \cdot 0.75\right)}\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - im\\
\end{array}
\end{array}
if im < -2.40000000000000004e89Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out79.1%
+-commutative79.1%
*-commutative79.1%
unpow279.1%
associate-*l*79.1%
Simplified79.1%
Taylor expanded in im around 0 72.8%
Taylor expanded in im around inf 72.8%
associate-*r*72.8%
unpow272.8%
Simplified72.8%
Taylor expanded in re around 0 79.7%
*-commutative79.7%
Simplified79.7%
if -2.40000000000000004e89 < im < -1.17999999999999997e44Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out61.5%
+-commutative61.5%
*-commutative61.5%
unpow261.5%
associate-*l*61.5%
Simplified61.5%
Applied egg-rr3.2%
distribute-lft-in3.2%
flip-+38.8%
metadata-eval38.8%
metadata-eval38.8%
metadata-eval38.8%
*-commutative38.8%
associate-*r*38.8%
associate-*l*38.8%
metadata-eval38.8%
*-commutative38.8%
associate-*r*38.8%
associate-*l*38.8%
metadata-eval38.8%
metadata-eval38.8%
*-commutative38.8%
associate-*r*38.8%
associate-*l*38.8%
metadata-eval38.8%
Applied egg-rr38.8%
swap-sqr38.8%
metadata-eval38.8%
associate-*l*38.8%
Simplified38.8%
if -1.17999999999999997e44 < im < 4.2e-7Initial program 18.0%
sub0-neg18.0%
Simplified18.0%
Taylor expanded in im around 0 88.1%
mul-1-neg88.1%
*-commutative88.1%
distribute-lft-neg-in88.1%
Simplified88.1%
if 4.2e-7 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 69.3%
mul-1-neg69.3%
unsub-neg69.3%
*-commutative69.3%
*-commutative69.3%
*-commutative69.3%
associate-*l*69.3%
Simplified69.3%
Taylor expanded in re around 0 44.2%
Final simplification72.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666)))
(if (<= im -3.5e+91)
t_0
(if (<= im -720.0)
(fabs (* im (* 0.5 (* re re))))
(if (<= im 4.2e-7) (* im (- (cos re))) (- t_0 im))))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double tmp;
if (im <= -3.5e+91) {
tmp = t_0;
} else if (im <= -720.0) {
tmp = fabs((im * (0.5 * (re * re))));
} else if (im <= 4.2e-7) {
tmp = im * -cos(re);
} 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 <= (-3.5d+91)) then
tmp = t_0
else if (im <= (-720.0d0)) then
tmp = abs((im * (0.5d0 * (re * re))))
else if (im <= 4.2d-7) then
tmp = im * -cos(re)
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 <= -3.5e+91) {
tmp = t_0;
} else if (im <= -720.0) {
tmp = Math.abs((im * (0.5 * (re * re))));
} else if (im <= 4.2e-7) {
tmp = im * -Math.cos(re);
} else {
tmp = t_0 - im;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 tmp = 0 if im <= -3.5e+91: tmp = t_0 elif im <= -720.0: tmp = math.fabs((im * (0.5 * (re * re)))) elif im <= 4.2e-7: tmp = im * -math.cos(re) else: tmp = t_0 - im return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) tmp = 0.0 if (im <= -3.5e+91) tmp = t_0; elseif (im <= -720.0) tmp = abs(Float64(im * Float64(0.5 * Float64(re * re)))); elseif (im <= 4.2e-7) tmp = Float64(im * Float64(-cos(re))); 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 <= -3.5e+91) tmp = t_0; elseif (im <= -720.0) tmp = abs((im * (0.5 * (re * re)))); elseif (im <= 4.2e-7) tmp = im * -cos(re); 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, -3.5e+91], t$95$0, If[LessEqual[im, -720.0], N[Abs[N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 4.2e-7], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], N[(t$95$0 - im), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
\mathbf{if}\;im \leq -3.5 \cdot 10^{+91}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -720:\\
\;\;\;\;\left|im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\right|\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - im\\
\end{array}
\end{array}
if im < -3.50000000000000001e91Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out79.1%
+-commutative79.1%
*-commutative79.1%
unpow279.1%
associate-*l*79.1%
Simplified79.1%
Taylor expanded in im around 0 72.8%
Taylor expanded in im around inf 72.8%
associate-*r*72.8%
unpow272.8%
Simplified72.8%
Taylor expanded in re around 0 79.7%
*-commutative79.7%
Simplified79.7%
if -3.50000000000000001e91 < im < -720Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out65.5%
+-commutative65.5%
*-commutative65.5%
unpow265.5%
associate-*l*65.5%
Simplified65.5%
Taylor expanded in im around 0 12.7%
Taylor expanded in re around inf 11.8%
unpow211.8%
associate-*r*11.8%
metadata-eval11.8%
associate-*r*11.8%
*-commutative11.8%
associate-*r*11.8%
*-commutative11.8%
associate-*r*11.8%
*-commutative11.8%
associate-*l*11.8%
metadata-eval11.8%
Simplified11.8%
associate-*r*11.8%
*-commutative11.8%
associate-*r*11.8%
*-commutative11.8%
*-commutative11.8%
add-sqr-sqrt0.3%
sqrt-unprod32.0%
associate-*r*32.0%
associate-*r*32.0%
swap-sqr31.9%
pow231.9%
pow231.9%
pow-prod-up31.9%
metadata-eval31.9%
swap-sqr31.9%
metadata-eval31.9%
Applied egg-rr31.9%
metadata-eval31.9%
swap-sqr31.9%
metadata-eval31.9%
pow-plus31.9%
unpow331.9%
associate-*r*31.9%
associate-*l*32.0%
swap-sqr32.0%
associate-*l*32.0%
*-commutative32.0%
*-commutative32.0%
associate-*l*32.0%
*-commutative32.0%
*-commutative32.0%
swap-sqr32.0%
rem-sqrt-square25.6%
associate-*r*25.6%
*-commutative25.6%
associate-*r*25.6%
Simplified25.6%
if -720 < im < 4.2e-7Initial program 6.7%
sub0-neg6.7%
Simplified6.7%
Taylor expanded in im around 0 99.8%
mul-1-neg99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
Simplified99.8%
if 4.2e-7 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 69.3%
mul-1-neg69.3%
unsub-neg69.3%
*-commutative69.3%
*-commutative69.3%
*-commutative69.3%
associate-*l*69.3%
Simplified69.3%
Taylor expanded in re around 0 44.2%
Final simplification73.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 3.0) -0.16666666666666666)))
(if (<= im -1.25e+91)
t_0
(if (<= im -1.18e+44)
(/
(- 2.25 (* (* (* re re) (* re re)) 0.5625))
(- -1.5 (* re (* re 0.75))))
(if (<= im 36000000.0) (* im (- (cos re))) t_0)))))
double code(double re, double im) {
double t_0 = pow(im, 3.0) * -0.16666666666666666;
double tmp;
if (im <= -1.25e+91) {
tmp = t_0;
} else if (im <= -1.18e+44) {
tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - (re * (re * 0.75)));
} else if (im <= 36000000.0) {
tmp = im * -cos(re);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (im ** 3.0d0) * (-0.16666666666666666d0)
if (im <= (-1.25d+91)) then
tmp = t_0
else if (im <= (-1.18d+44)) then
tmp = (2.25d0 - (((re * re) * (re * re)) * 0.5625d0)) / ((-1.5d0) - (re * (re * 0.75d0)))
else if (im <= 36000000.0d0) then
tmp = im * -cos(re)
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 <= -1.25e+91) {
tmp = t_0;
} else if (im <= -1.18e+44) {
tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - (re * (re * 0.75)));
} else if (im <= 36000000.0) {
tmp = im * -Math.cos(re);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 3.0) * -0.16666666666666666 tmp = 0 if im <= -1.25e+91: tmp = t_0 elif im <= -1.18e+44: tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - (re * (re * 0.75))) elif im <= 36000000.0: tmp = im * -math.cos(re) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64((im ^ 3.0) * -0.16666666666666666) tmp = 0.0 if (im <= -1.25e+91) tmp = t_0; elseif (im <= -1.18e+44) tmp = Float64(Float64(2.25 - Float64(Float64(Float64(re * re) * Float64(re * re)) * 0.5625)) / Float64(-1.5 - Float64(re * Float64(re * 0.75)))); elseif (im <= 36000000.0) tmp = Float64(im * Float64(-cos(re))); 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 <= -1.25e+91) tmp = t_0; elseif (im <= -1.18e+44) tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - (re * (re * 0.75))); elseif (im <= 36000000.0) tmp = im * -cos(re); 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, -1.25e+91], t$95$0, If[LessEqual[im, -1.18e+44], N[(N[(2.25 - N[(N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * 0.5625), $MachinePrecision]), $MachinePrecision] / N[(-1.5 - N[(re * N[(re * 0.75), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 36000000.0], N[(im * (-N[Cos[re], $MachinePrecision])), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
\mathbf{if}\;im \leq -1.25 \cdot 10^{+91}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -1.18 \cdot 10^{+44}:\\
\;\;\;\;\frac{2.25 - \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot 0.5625}{-1.5 - re \cdot \left(re \cdot 0.75\right)}\\
\mathbf{elif}\;im \leq 36000000:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -1.2500000000000001e91 or 3.6e7 < 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-out74.5%
+-commutative74.5%
*-commutative74.5%
unpow274.5%
associate-*l*74.5%
Simplified74.5%
Taylor expanded in im around 0 60.9%
Taylor expanded in im around inf 60.9%
associate-*r*60.9%
unpow260.9%
Simplified60.9%
Taylor expanded in re around 0 57.6%
*-commutative57.6%
Simplified57.6%
if -1.2500000000000001e91 < im < -1.17999999999999997e44Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out61.5%
+-commutative61.5%
*-commutative61.5%
unpow261.5%
associate-*l*61.5%
Simplified61.5%
Applied egg-rr3.2%
distribute-lft-in3.2%
flip-+38.8%
metadata-eval38.8%
metadata-eval38.8%
metadata-eval38.8%
*-commutative38.8%
associate-*r*38.8%
associate-*l*38.8%
metadata-eval38.8%
*-commutative38.8%
associate-*r*38.8%
associate-*l*38.8%
metadata-eval38.8%
metadata-eval38.8%
*-commutative38.8%
associate-*r*38.8%
associate-*l*38.8%
metadata-eval38.8%
Applied egg-rr38.8%
swap-sqr38.8%
metadata-eval38.8%
associate-*l*38.8%
Simplified38.8%
if -1.17999999999999997e44 < im < 3.6e7Initial program 18.4%
sub0-neg18.4%
Simplified18.4%
Taylor expanded in im around 0 88.1%
mul-1-neg88.1%
*-commutative88.1%
distribute-lft-neg-in88.1%
Simplified88.1%
Final simplification72.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* -0.25 (* re re))))
(t_1 (/ (- (* im im) (* 4.0 (* t_0 t_0))) (- (- im) (* -2.0 t_0)))))
(if (<= im -5.6e+25)
t_1
(if (<= im 4.7e+53)
(- (* re (* re (* im 0.5))) im)
(if (<= im 9.5e+138)
(* (+ 0.5 (* re (* re -0.25))) 27.0)
(if (<= im 8.2e+220) (- (* im (* re (* 0.5 re))) im) t_1))))))
double code(double re, double im) {
double t_0 = im * (-0.25 * (re * re));
double t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0));
double tmp;
if (im <= -5.6e+25) {
tmp = t_1;
} else if (im <= 4.7e+53) {
tmp = (re * (re * (im * 0.5))) - im;
} else if (im <= 9.5e+138) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else if (im <= 8.2e+220) {
tmp = (im * (re * (0.5 * re))) - 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 * ((-0.25d0) * (re * re))
t_1 = ((im * im) - (4.0d0 * (t_0 * t_0))) / (-im - ((-2.0d0) * t_0))
if (im <= (-5.6d+25)) then
tmp = t_1
else if (im <= 4.7d+53) then
tmp = (re * (re * (im * 0.5d0))) - im
else if (im <= 9.5d+138) then
tmp = (0.5d0 + (re * (re * (-0.25d0)))) * 27.0d0
else if (im <= 8.2d+220) then
tmp = (im * (re * (0.5d0 * re))) - im
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (-0.25 * (re * re));
double t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0));
double tmp;
if (im <= -5.6e+25) {
tmp = t_1;
} else if (im <= 4.7e+53) {
tmp = (re * (re * (im * 0.5))) - im;
} else if (im <= 9.5e+138) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else if (im <= 8.2e+220) {
tmp = (im * (re * (0.5 * re))) - im;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = im * (-0.25 * (re * re)) t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0)) tmp = 0 if im <= -5.6e+25: tmp = t_1 elif im <= 4.7e+53: tmp = (re * (re * (im * 0.5))) - im elif im <= 9.5e+138: tmp = (0.5 + (re * (re * -0.25))) * 27.0 elif im <= 8.2e+220: tmp = (im * (re * (0.5 * re))) - im else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(im * Float64(-0.25 * Float64(re * re))) t_1 = Float64(Float64(Float64(im * im) - Float64(4.0 * Float64(t_0 * t_0))) / Float64(Float64(-im) - Float64(-2.0 * t_0))) tmp = 0.0 if (im <= -5.6e+25) tmp = t_1; elseif (im <= 4.7e+53) tmp = Float64(Float64(re * Float64(re * Float64(im * 0.5))) - im); elseif (im <= 9.5e+138) tmp = Float64(Float64(0.5 + Float64(re * Float64(re * -0.25))) * 27.0); elseif (im <= 8.2e+220) tmp = Float64(Float64(im * Float64(re * Float64(0.5 * re))) - im); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = im * (-0.25 * (re * re)); t_1 = ((im * im) - (4.0 * (t_0 * t_0))) / (-im - (-2.0 * t_0)); tmp = 0.0; if (im <= -5.6e+25) tmp = t_1; elseif (im <= 4.7e+53) tmp = (re * (re * (im * 0.5))) - im; elseif (im <= 9.5e+138) tmp = (0.5 + (re * (re * -0.25))) * 27.0; elseif (im <= 8.2e+220) tmp = (im * (re * (0.5 * re))) - im; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(-0.25 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(im * im), $MachinePrecision] - N[(4.0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[((-im) - N[(-2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -5.6e+25], t$95$1, If[LessEqual[im, 4.7e+53], N[(N[(re * N[(re * N[(im * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 9.5e+138], N[(N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 27.0), $MachinePrecision], If[LessEqual[im, 8.2e+220], N[(N[(im * N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(-0.25 \cdot \left(re \cdot re\right)\right)\\
t_1 := \frac{im \cdot im - 4 \cdot \left(t_0 \cdot t_0\right)}{\left(-im\right) - -2 \cdot t_0}\\
\mathbf{if}\;im \leq -5.6 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 4.7 \cdot 10^{+53}:\\
\;\;\;\;re \cdot \left(re \cdot \left(im \cdot 0.5\right)\right) - im\\
\mathbf{elif}\;im \leq 9.5 \cdot 10^{+138}:\\
\;\;\;\;\left(0.5 + re \cdot \left(re \cdot -0.25\right)\right) \cdot 27\\
\mathbf{elif}\;im \leq 8.2 \cdot 10^{+220}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.5 \cdot re\right)\right) - im\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -5.6000000000000003e25 or 8.19999999999999962e220 < 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-out82.3%
+-commutative82.3%
*-commutative82.3%
unpow282.3%
associate-*l*82.3%
Simplified82.3%
Taylor expanded in im around 0 18.0%
distribute-lft-in18.0%
flip-+39.1%
Applied egg-rr39.1%
swap-sqr39.1%
metadata-eval39.1%
swap-sqr39.1%
metadata-eval39.1%
*-commutative39.1%
mul-1-neg39.1%
Simplified39.1%
if -5.6000000000000003e25 < im < 4.69999999999999976e53Initial program 21.4%
sub0-neg21.4%
Simplified21.4%
Taylor expanded in im around 0 85.1%
mul-1-neg85.1%
*-commutative85.1%
distribute-lft-neg-in85.1%
Simplified85.1%
Taylor expanded in re around 0 52.0%
neg-mul-152.0%
+-commutative52.0%
unsub-neg52.0%
*-commutative52.0%
associate-*l*52.0%
metadata-eval52.0%
distribute-rgt-neg-in52.0%
*-commutative52.0%
unpow252.0%
associate-*l*52.1%
*-commutative52.1%
distribute-rgt-neg-in52.1%
metadata-eval52.1%
Simplified52.1%
if 4.69999999999999976e53 < im < 9.49999999999999998e138Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out41.2%
+-commutative41.2%
*-commutative41.2%
unpow241.2%
associate-*l*41.2%
Simplified41.2%
Applied egg-rr37.1%
if 9.49999999999999998e138 < im < 8.19999999999999962e220Initial 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.3%
+-commutative77.3%
*-commutative77.3%
unpow277.3%
associate-*l*77.3%
Simplified77.3%
Taylor expanded in im around 0 77.3%
Taylor expanded in im around 0 38.9%
distribute-lft-in38.9%
*-commutative38.9%
unpow238.9%
distribute-lft-in38.9%
associate-*r*38.9%
metadata-eval38.9%
*-commutative38.9%
associate-*l*38.9%
associate-*r*38.9%
metadata-eval38.9%
unpow238.9%
+-commutative38.9%
mul-1-neg38.9%
unsub-neg38.9%
Simplified38.9%
Final simplification45.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* re (* re 0.75))))
(if (<= re 6.6e+81)
(- (* im (* re (* 0.5 re))) im)
(if (<= re 1.55e+154)
(/ (- 2.25 (* (* (* re re) (* re re)) 0.5625)) (- -1.5 t_0))
t_0))))
double code(double re, double im) {
double t_0 = re * (re * 0.75);
double tmp;
if (re <= 6.6e+81) {
tmp = (im * (re * (0.5 * re))) - im;
} else if (re <= 1.55e+154) {
tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - t_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 * 0.75d0)
if (re <= 6.6d+81) then
tmp = (im * (re * (0.5d0 * re))) - im
else if (re <= 1.55d+154) then
tmp = (2.25d0 - (((re * re) * (re * re)) * 0.5625d0)) / ((-1.5d0) - t_0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = re * (re * 0.75);
double tmp;
if (re <= 6.6e+81) {
tmp = (im * (re * (0.5 * re))) - im;
} else if (re <= 1.55e+154) {
tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - t_0);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = re * (re * 0.75) tmp = 0 if re <= 6.6e+81: tmp = (im * (re * (0.5 * re))) - im elif re <= 1.55e+154: tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - t_0) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(re * Float64(re * 0.75)) tmp = 0.0 if (re <= 6.6e+81) tmp = Float64(Float64(im * Float64(re * Float64(0.5 * re))) - im); elseif (re <= 1.55e+154) tmp = Float64(Float64(2.25 - Float64(Float64(Float64(re * re) * Float64(re * re)) * 0.5625)) / Float64(-1.5 - t_0)); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = re * (re * 0.75); tmp = 0.0; if (re <= 6.6e+81) tmp = (im * (re * (0.5 * re))) - im; elseif (re <= 1.55e+154) tmp = (2.25 - (((re * re) * (re * re)) * 0.5625)) / (-1.5 - t_0); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * 0.75), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 6.6e+81], N[(N[(im * N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[re, 1.55e+154], N[(N[(2.25 - N[(N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * 0.5625), $MachinePrecision]), $MachinePrecision] / N[(-1.5 - t$95$0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(re \cdot 0.75\right)\\
\mathbf{if}\;re \leq 6.6 \cdot 10^{+81}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.5 \cdot re\right)\right) - im\\
\mathbf{elif}\;re \leq 1.55 \cdot 10^{+154}:\\
\;\;\;\;\frac{2.25 - \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot 0.5625}{-1.5 - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if re < 6.6e81Initial program 57.7%
sub0-neg57.7%
Simplified57.7%
Taylor expanded in re around 0 2.7%
*-commutative2.7%
associate-*r*2.7%
distribute-rgt-out45.7%
+-commutative45.7%
*-commutative45.7%
unpow245.7%
associate-*l*45.7%
Simplified45.7%
Taylor expanded in im around 0 61.2%
Taylor expanded in im around 0 39.9%
distribute-lft-in39.9%
*-commutative39.9%
unpow239.9%
distribute-lft-in39.9%
associate-*r*39.9%
metadata-eval39.9%
*-commutative39.9%
associate-*l*39.9%
associate-*r*39.9%
metadata-eval39.9%
unpow239.9%
+-commutative39.9%
mul-1-neg39.9%
unsub-neg39.9%
Simplified39.9%
if 6.6e81 < re < 1.5500000000000001e154Initial program 49.3%
sub0-neg49.3%
Simplified49.3%
Taylor expanded in re around 0 2.2%
*-commutative2.2%
associate-*r*2.2%
distribute-rgt-out14.0%
+-commutative14.0%
*-commutative14.0%
unpow214.0%
associate-*l*14.0%
Simplified14.0%
Applied egg-rr4.1%
distribute-lft-in4.1%
flip-+36.3%
metadata-eval36.3%
metadata-eval36.3%
metadata-eval36.3%
*-commutative36.3%
associate-*r*36.3%
associate-*l*36.3%
metadata-eval36.3%
*-commutative36.3%
associate-*r*36.3%
associate-*l*36.3%
metadata-eval36.3%
metadata-eval36.3%
*-commutative36.3%
associate-*r*36.3%
associate-*l*36.3%
metadata-eval36.3%
Applied egg-rr36.3%
swap-sqr36.3%
metadata-eval36.3%
associate-*l*36.3%
Simplified36.3%
if 1.5500000000000001e154 < re Initial program 62.5%
sub0-neg62.5%
Simplified62.5%
Taylor expanded in re around 0 0.2%
*-commutative0.2%
associate-*r*0.2%
distribute-rgt-out28.2%
+-commutative28.2%
*-commutative28.2%
unpow228.2%
associate-*l*28.2%
Simplified28.2%
Applied egg-rr28.8%
Taylor expanded in re around inf 28.8%
unpow228.8%
*-commutative28.8%
associate-*l*28.8%
Simplified28.8%
Final simplification38.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* re (* 0.5 re)))))
(if (<= im -126000000.0)
t_0
(if (<= im 9.8e+52)
(- im)
(if (<= im 4.3e+139) (* (+ 0.5 (* re (* re -0.25))) 27.0) t_0)))))
double code(double re, double im) {
double t_0 = im * (re * (0.5 * re));
double tmp;
if (im <= -126000000.0) {
tmp = t_0;
} else if (im <= 9.8e+52) {
tmp = -im;
} else if (im <= 4.3e+139) {
tmp = (0.5 + (re * (re * -0.25))) * 27.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 = im * (re * (0.5d0 * re))
if (im <= (-126000000.0d0)) then
tmp = t_0
else if (im <= 9.8d+52) then
tmp = -im
else if (im <= 4.3d+139) then
tmp = (0.5d0 + (re * (re * (-0.25d0)))) * 27.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (re * (0.5 * re));
double tmp;
if (im <= -126000000.0) {
tmp = t_0;
} else if (im <= 9.8e+52) {
tmp = -im;
} else if (im <= 4.3e+139) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = im * (re * (0.5 * re)) tmp = 0 if im <= -126000000.0: tmp = t_0 elif im <= 9.8e+52: tmp = -im elif im <= 4.3e+139: tmp = (0.5 + (re * (re * -0.25))) * 27.0 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(im * Float64(re * Float64(0.5 * re))) tmp = 0.0 if (im <= -126000000.0) tmp = t_0; elseif (im <= 9.8e+52) tmp = Float64(-im); elseif (im <= 4.3e+139) tmp = Float64(Float64(0.5 + Float64(re * Float64(re * -0.25))) * 27.0); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = im * (re * (0.5 * re)); tmp = 0.0; if (im <= -126000000.0) tmp = t_0; elseif (im <= 9.8e+52) tmp = -im; elseif (im <= 4.3e+139) tmp = (0.5 + (re * (re * -0.25))) * 27.0; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -126000000.0], t$95$0, If[LessEqual[im, 9.8e+52], (-im), If[LessEqual[im, 4.3e+139], N[(N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 27.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(re \cdot \left(0.5 \cdot re\right)\right)\\
\mathbf{if}\;im \leq -126000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 9.8 \cdot 10^{+52}:\\
\;\;\;\;-im\\
\mathbf{elif}\;im \leq 4.3 \cdot 10^{+139}:\\
\;\;\;\;\left(0.5 + re \cdot \left(re \cdot -0.25\right)\right) \cdot 27\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -1.26e8 or 4.2999999999999998e139 < 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-out79.8%
+-commutative79.8%
*-commutative79.8%
unpow279.8%
associate-*l*79.8%
Simplified79.8%
Taylor expanded in im around 0 23.7%
Taylor expanded in re around inf 21.3%
unpow221.3%
associate-*r*21.3%
metadata-eval21.3%
associate-*r*21.3%
*-commutative21.3%
associate-*r*21.3%
*-commutative21.3%
associate-*r*21.3%
*-commutative21.3%
associate-*l*21.3%
metadata-eval21.3%
Simplified21.3%
if -1.26e8 < im < 9.79999999999999993e52Initial program 16.6%
sub0-neg16.6%
Simplified16.6%
Taylor expanded in im around 0 90.1%
mul-1-neg90.1%
*-commutative90.1%
distribute-lft-neg-in90.1%
Simplified90.1%
Taylor expanded in re around 0 55.0%
neg-mul-155.0%
Simplified55.0%
if 9.79999999999999993e52 < im < 4.2999999999999998e139Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out41.2%
+-commutative41.2%
*-commutative41.2%
unpow241.2%
associate-*l*41.2%
Simplified41.2%
Applied egg-rr37.1%
Final simplification39.5%
(FPCore (re im)
:precision binary64
(if (<= re 1.4e+238)
(- (* im (* re (* 0.5 re))) im)
(if (<= re 1.1e+279)
(* re (* re 0.75))
(* (+ 0.5 (* re (* re -0.25))) 27.0))))
double code(double re, double im) {
double tmp;
if (re <= 1.4e+238) {
tmp = (im * (re * (0.5 * re))) - im;
} else if (re <= 1.1e+279) {
tmp = re * (re * 0.75);
} else {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.4d+238) then
tmp = (im * (re * (0.5d0 * re))) - im
else if (re <= 1.1d+279) then
tmp = re * (re * 0.75d0)
else
tmp = (0.5d0 + (re * (re * (-0.25d0)))) * 27.0d0
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.4e+238) {
tmp = (im * (re * (0.5 * re))) - im;
} else if (re <= 1.1e+279) {
tmp = re * (re * 0.75);
} else {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.4e+238: tmp = (im * (re * (0.5 * re))) - im elif re <= 1.1e+279: tmp = re * (re * 0.75) else: tmp = (0.5 + (re * (re * -0.25))) * 27.0 return tmp
function code(re, im) tmp = 0.0 if (re <= 1.4e+238) tmp = Float64(Float64(im * Float64(re * Float64(0.5 * re))) - im); elseif (re <= 1.1e+279) tmp = Float64(re * Float64(re * 0.75)); else tmp = Float64(Float64(0.5 + Float64(re * Float64(re * -0.25))) * 27.0); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.4e+238) tmp = (im * (re * (0.5 * re))) - im; elseif (re <= 1.1e+279) tmp = re * (re * 0.75); else tmp = (0.5 + (re * (re * -0.25))) * 27.0; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.4e+238], N[(N[(im * N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[re, 1.1e+279], N[(re * N[(re * 0.75), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 27.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.4 \cdot 10^{+238}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.5 \cdot re\right)\right) - im\\
\mathbf{elif}\;re \leq 1.1 \cdot 10^{+279}:\\
\;\;\;\;re \cdot \left(re \cdot 0.75\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 + re \cdot \left(re \cdot -0.25\right)\right) \cdot 27\\
\end{array}
\end{array}
if re < 1.39999999999999995e238Initial program 56.9%
sub0-neg56.9%
Simplified56.9%
Taylor expanded in re around 0 2.5%
*-commutative2.5%
associate-*r*2.5%
distribute-rgt-out42.8%
+-commutative42.8%
*-commutative42.8%
unpow242.8%
associate-*l*42.8%
Simplified42.8%
Taylor expanded in im around 0 56.2%
Taylor expanded in im around 0 37.7%
distribute-lft-in37.7%
*-commutative37.7%
unpow237.7%
distribute-lft-in37.7%
associate-*r*37.7%
metadata-eval37.7%
*-commutative37.7%
associate-*l*37.7%
associate-*r*37.7%
metadata-eval37.7%
unpow237.7%
+-commutative37.7%
mul-1-neg37.7%
unsub-neg37.7%
Simplified37.7%
if 1.39999999999999995e238 < re < 1.1e279Initial program 90.3%
sub0-neg90.3%
Simplified90.3%
Taylor expanded in re around 0 0.1%
*-commutative0.1%
associate-*r*0.1%
distribute-rgt-out28.7%
+-commutative28.7%
*-commutative28.7%
unpow228.7%
associate-*l*28.7%
Simplified28.7%
Applied egg-rr57.6%
Taylor expanded in re around inf 57.6%
unpow257.6%
*-commutative57.6%
associate-*l*57.6%
Simplified57.6%
if 1.1e279 < re Initial program 37.6%
sub0-neg37.6%
Simplified37.6%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out0.0%
+-commutative0.0%
*-commutative0.0%
unpow20.0%
associate-*l*0.0%
Simplified0.0%
Applied egg-rr34.1%
Final simplification38.2%
(FPCore (re im)
:precision binary64
(if (<= im 9e+54)
(- (* re (* re (* im 0.5))) im)
(if (<= im 1.86e+139)
(* (+ 0.5 (* re (* re -0.25))) 27.0)
(- (* im (* re (* 0.5 re))) im))))
double code(double re, double im) {
double tmp;
if (im <= 9e+54) {
tmp = (re * (re * (im * 0.5))) - im;
} else if (im <= 1.86e+139) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else {
tmp = (im * (re * (0.5 * re))) - im;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 9d+54) then
tmp = (re * (re * (im * 0.5d0))) - im
else if (im <= 1.86d+139) then
tmp = (0.5d0 + (re * (re * (-0.25d0)))) * 27.0d0
else
tmp = (im * (re * (0.5d0 * re))) - im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 9e+54) {
tmp = (re * (re * (im * 0.5))) - im;
} else if (im <= 1.86e+139) {
tmp = (0.5 + (re * (re * -0.25))) * 27.0;
} else {
tmp = (im * (re * (0.5 * re))) - im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 9e+54: tmp = (re * (re * (im * 0.5))) - im elif im <= 1.86e+139: tmp = (0.5 + (re * (re * -0.25))) * 27.0 else: tmp = (im * (re * (0.5 * re))) - im return tmp
function code(re, im) tmp = 0.0 if (im <= 9e+54) tmp = Float64(Float64(re * Float64(re * Float64(im * 0.5))) - im); elseif (im <= 1.86e+139) tmp = Float64(Float64(0.5 + Float64(re * Float64(re * -0.25))) * 27.0); else tmp = Float64(Float64(im * Float64(re * Float64(0.5 * re))) - im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 9e+54) tmp = (re * (re * (im * 0.5))) - im; elseif (im <= 1.86e+139) tmp = (0.5 + (re * (re * -0.25))) * 27.0; else tmp = (im * (re * (0.5 * re))) - im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 9e+54], N[(N[(re * N[(re * N[(im * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision], If[LessEqual[im, 1.86e+139], N[(N[(0.5 + N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 27.0), $MachinePrecision], N[(N[(im * N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9 \cdot 10^{+54}:\\
\;\;\;\;re \cdot \left(re \cdot \left(im \cdot 0.5\right)\right) - im\\
\mathbf{elif}\;im \leq 1.86 \cdot 10^{+139}:\\
\;\;\;\;\left(0.5 + re \cdot \left(re \cdot -0.25\right)\right) \cdot 27\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.5 \cdot re\right)\right) - im\\
\end{array}
\end{array}
if im < 8.99999999999999968e54Initial program 45.8%
sub0-neg45.8%
Simplified45.8%
Taylor expanded in im around 0 60.3%
mul-1-neg60.3%
*-commutative60.3%
distribute-lft-neg-in60.3%
Simplified60.3%
Taylor expanded in re around 0 39.5%
neg-mul-139.5%
+-commutative39.5%
unsub-neg39.5%
*-commutative39.5%
associate-*l*39.5%
metadata-eval39.5%
distribute-rgt-neg-in39.5%
*-commutative39.5%
unpow239.5%
associate-*l*39.6%
*-commutative39.6%
distribute-rgt-neg-in39.6%
metadata-eval39.6%
Simplified39.6%
if 8.99999999999999968e54 < im < 1.8600000000000001e139Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out41.2%
+-commutative41.2%
*-commutative41.2%
unpow241.2%
associate-*l*41.2%
Simplified41.2%
Applied egg-rr37.1%
if 1.8600000000000001e139 < 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-out87.2%
+-commutative87.2%
*-commutative87.2%
unpow287.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in im around 0 87.2%
Taylor expanded in im around 0 39.5%
distribute-lft-in39.5%
*-commutative39.5%
unpow239.5%
distribute-lft-in39.5%
associate-*r*39.5%
metadata-eval39.5%
*-commutative39.5%
associate-*l*39.5%
associate-*r*39.5%
metadata-eval39.5%
unpow239.5%
+-commutative39.5%
mul-1-neg39.5%
unsub-neg39.5%
Simplified39.5%
Final simplification39.4%
(FPCore (re im) :precision binary64 (if (or (<= im -54000000.0) (not (<= im 4.6e+41))) (* im (* re (* 0.5 re))) (- im)))
double code(double re, double im) {
double tmp;
if ((im <= -54000000.0) || !(im <= 4.6e+41)) {
tmp = im * (re * (0.5 * re));
} 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 <= (-54000000.0d0)) .or. (.not. (im <= 4.6d+41))) then
tmp = im * (re * (0.5d0 * re))
else
tmp = -im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -54000000.0) || !(im <= 4.6e+41)) {
tmp = im * (re * (0.5 * re));
} else {
tmp = -im;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -54000000.0) or not (im <= 4.6e+41): tmp = im * (re * (0.5 * re)) else: tmp = -im return tmp
function code(re, im) tmp = 0.0 if ((im <= -54000000.0) || !(im <= 4.6e+41)) tmp = Float64(im * Float64(re * Float64(0.5 * re))); else tmp = Float64(-im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -54000000.0) || ~((im <= 4.6e+41))) tmp = im * (re * (0.5 * re)); else tmp = -im; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -54000000.0], N[Not[LessEqual[im, 4.6e+41]], $MachinePrecision]], N[(im * N[(re * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-im)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -54000000 \lor \neg \left(im \leq 4.6 \cdot 10^{+41}\right):\\
\;\;\;\;im \cdot \left(re \cdot \left(0.5 \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-im\\
\end{array}
\end{array}
if im < -5.4e7 or 4.5999999999999997e41 < 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-out75.0%
+-commutative75.0%
*-commutative75.0%
unpow275.0%
associate-*l*75.0%
Simplified75.0%
Taylor expanded in im around 0 21.2%
Taylor expanded in re around inf 19.0%
unpow219.0%
associate-*r*19.0%
metadata-eval19.0%
associate-*r*19.0%
*-commutative19.0%
associate-*r*19.0%
*-commutative19.0%
associate-*r*19.0%
*-commutative19.0%
associate-*l*19.0%
metadata-eval19.0%
Simplified19.0%
if -5.4e7 < im < 4.5999999999999997e41Initial program 15.2%
sub0-neg15.2%
Simplified15.2%
Taylor expanded in im around 0 91.5%
mul-1-neg91.5%
*-commutative91.5%
distribute-lft-neg-in91.5%
Simplified91.5%
Taylor expanded in re around 0 55.9%
neg-mul-155.9%
Simplified55.9%
Final simplification37.5%
(FPCore (re im) :precision binary64 (if (<= re 4.8e+165) (- im) (* re (* re 0.75))))
double code(double re, double im) {
double tmp;
if (re <= 4.8e+165) {
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 <= 4.8d+165) 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 <= 4.8e+165) {
tmp = -im;
} else {
tmp = re * (re * 0.75);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 4.8e+165: tmp = -im else: tmp = re * (re * 0.75) return tmp
function code(re, im) tmp = 0.0 if (re <= 4.8e+165) tmp = Float64(-im); else tmp = Float64(re * Float64(re * 0.75)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 4.8e+165) tmp = -im; else tmp = re * (re * 0.75); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 4.8e+165], (-im), N[(re * N[(re * 0.75), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 4.8 \cdot 10^{+165}:\\
\;\;\;\;-im\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(re \cdot 0.75\right)\\
\end{array}
\end{array}
if re < 4.80000000000000001e165Initial program 56.8%
sub0-neg56.8%
Simplified56.8%
Taylor expanded in im around 0 48.7%
mul-1-neg48.7%
*-commutative48.7%
distribute-lft-neg-in48.7%
Simplified48.7%
Taylor expanded in re around 0 32.2%
neg-mul-132.2%
Simplified32.2%
if 4.80000000000000001e165 < re Initial program 66.0%
sub0-neg66.0%
Simplified66.0%
Taylor expanded in re around 0 0.2%
*-commutative0.2%
associate-*r*0.2%
distribute-rgt-out32.0%
+-commutative32.0%
*-commutative32.0%
unpow232.0%
associate-*l*32.0%
Simplified32.0%
Applied egg-rr32.6%
Taylor expanded in re around inf 32.6%
unpow232.6%
*-commutative32.6%
associate-*l*32.6%
Simplified32.6%
Final simplification32.3%
(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 57.6%
sub0-neg57.6%
Simplified57.6%
Taylor expanded in im around 0 48.3%
mul-1-neg48.3%
*-commutative48.3%
distribute-lft-neg-in48.3%
Simplified48.3%
Taylor expanded in re around 0 29.9%
neg-mul-129.9%
Simplified29.9%
Final simplification29.9%
(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 57.6%
sub0-neg57.6%
Simplified57.6%
Taylor expanded in re around 0 2.4%
*-commutative2.4%
associate-*r*2.4%
distribute-rgt-out41.9%
+-commutative41.9%
*-commutative41.9%
unpow241.9%
associate-*l*41.9%
Simplified41.9%
Applied egg-rr9.4%
Taylor expanded in re around 0 2.6%
Final simplification2.6%
(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 2023257
(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))))