
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
Initial program 100.0%
(FPCore (re im)
:precision binary64
(if (<= re -0.033)
(* (exp re) im)
(if (<= re 350.0)
(*
(sin im)
(+ (+ re 1.0) (* (+ 0.5 (* re 0.16666666666666666)) (* re re))))
(if (<= re 2.1e+90)
(* im (* (exp re) (+ 1.0 (* im (* im -0.16666666666666666)))))
(* 0.16666666666666666 (* (sin im) (* re (* re re))))))))
double code(double re, double im) {
double tmp;
if (re <= -0.033) {
tmp = exp(re) * im;
} else if (re <= 350.0) {
tmp = sin(im) * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re)));
} else if (re <= 2.1e+90) {
tmp = im * (exp(re) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = 0.16666666666666666 * (sin(im) * (re * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.033d0)) then
tmp = exp(re) * im
else if (re <= 350.0d0) then
tmp = sin(im) * ((re + 1.0d0) + ((0.5d0 + (re * 0.16666666666666666d0)) * (re * re)))
else if (re <= 2.1d+90) then
tmp = im * (exp(re) * (1.0d0 + (im * (im * (-0.16666666666666666d0)))))
else
tmp = 0.16666666666666666d0 * (sin(im) * (re * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.033) {
tmp = Math.exp(re) * im;
} else if (re <= 350.0) {
tmp = Math.sin(im) * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re)));
} else if (re <= 2.1e+90) {
tmp = im * (Math.exp(re) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = 0.16666666666666666 * (Math.sin(im) * (re * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.033: tmp = math.exp(re) * im elif re <= 350.0: tmp = math.sin(im) * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re))) elif re <= 2.1e+90: tmp = im * (math.exp(re) * (1.0 + (im * (im * -0.16666666666666666)))) else: tmp = 0.16666666666666666 * (math.sin(im) * (re * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.033) tmp = Float64(exp(re) * im); elseif (re <= 350.0) tmp = Float64(sin(im) * Float64(Float64(re + 1.0) + Float64(Float64(0.5 + Float64(re * 0.16666666666666666)) * Float64(re * re)))); elseif (re <= 2.1e+90) tmp = Float64(im * Float64(exp(re) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666))))); else tmp = Float64(0.16666666666666666 * Float64(sin(im) * Float64(re * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.033) tmp = exp(re) * im; elseif (re <= 350.0) tmp = sin(im) * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re))); elseif (re <= 2.1e+90) tmp = im * (exp(re) * (1.0 + (im * (im * -0.16666666666666666)))); else tmp = 0.16666666666666666 * (sin(im) * (re * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.033], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 350.0], N[(N[Sin[im], $MachinePrecision] * N[(N[(re + 1.0), $MachinePrecision] + N[(N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.1e+90], N[(im * N[(N[Exp[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.033:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 350:\\
\;\;\;\;\sin im \cdot \left(\left(re + 1\right) + \left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\right)\\
\mathbf{elif}\;re \leq 2.1 \cdot 10^{+90}:\\
\;\;\;\;im \cdot \left(e^{re} \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin im \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -0.033000000000000002Initial program 100.0%
Taylor expanded in im around 0 100.0%
if -0.033000000000000002 < re < 350Initial program 100.0%
Taylor expanded in re around 0 98.5%
distribute-rgt-in98.5%
*-commutative98.5%
associate-+r+98.5%
distribute-rgt1-in98.5%
*-commutative98.5%
*-commutative98.5%
associate-*l*98.5%
+-commutative98.5%
associate-*r*98.5%
distribute-rgt-out98.5%
associate-*l*98.5%
distribute-lft-out98.5%
Simplified98.5%
if 350 < re < 2.09999999999999981e90Initial program 100.0%
Taylor expanded in im around 0 0.0%
associate-*r*0.0%
*-lft-identity0.0%
distribute-rgt-out82.6%
*-commutative82.6%
unpow282.6%
associate-*l*82.6%
Simplified82.6%
if 2.09999999999999981e90 < re Initial program 100.0%
Taylor expanded in re around 0 89.5%
distribute-rgt-in89.5%
*-commutative89.5%
associate-+r+89.5%
distribute-rgt1-in89.5%
*-commutative89.5%
*-commutative89.5%
associate-*l*89.5%
+-commutative89.5%
associate-*r*89.5%
distribute-rgt-out89.5%
associate-*l*98.0%
distribute-lft-out98.0%
Simplified98.0%
Taylor expanded in re around inf 98.0%
*-commutative98.0%
cube-mult98.0%
Simplified98.0%
Final simplification97.4%
(FPCore (re im)
:precision binary64
(if (<= re -0.0205)
(* (exp re) im)
(if (<= re 350.0)
(* (sin im) (+ 1.0 (* re (+ 1.0 (* re 0.5)))))
(if (<= re 2.1e+90)
(* im (* (exp re) (+ 1.0 (* im (* im -0.16666666666666666)))))
(* 0.16666666666666666 (* (sin im) (* re (* re re))))))))
double code(double re, double im) {
double tmp;
if (re <= -0.0205) {
tmp = exp(re) * im;
} else if (re <= 350.0) {
tmp = sin(im) * (1.0 + (re * (1.0 + (re * 0.5))));
} else if (re <= 2.1e+90) {
tmp = im * (exp(re) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = 0.16666666666666666 * (sin(im) * (re * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.0205d0)) then
tmp = exp(re) * im
else if (re <= 350.0d0) then
tmp = sin(im) * (1.0d0 + (re * (1.0d0 + (re * 0.5d0))))
else if (re <= 2.1d+90) then
tmp = im * (exp(re) * (1.0d0 + (im * (im * (-0.16666666666666666d0)))))
else
tmp = 0.16666666666666666d0 * (sin(im) * (re * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.0205) {
tmp = Math.exp(re) * im;
} else if (re <= 350.0) {
tmp = Math.sin(im) * (1.0 + (re * (1.0 + (re * 0.5))));
} else if (re <= 2.1e+90) {
tmp = im * (Math.exp(re) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = 0.16666666666666666 * (Math.sin(im) * (re * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.0205: tmp = math.exp(re) * im elif re <= 350.0: tmp = math.sin(im) * (1.0 + (re * (1.0 + (re * 0.5)))) elif re <= 2.1e+90: tmp = im * (math.exp(re) * (1.0 + (im * (im * -0.16666666666666666)))) else: tmp = 0.16666666666666666 * (math.sin(im) * (re * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.0205) tmp = Float64(exp(re) * im); elseif (re <= 350.0) tmp = Float64(sin(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5))))); elseif (re <= 2.1e+90) tmp = Float64(im * Float64(exp(re) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666))))); else tmp = Float64(0.16666666666666666 * Float64(sin(im) * Float64(re * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.0205) tmp = exp(re) * im; elseif (re <= 350.0) tmp = sin(im) * (1.0 + (re * (1.0 + (re * 0.5)))); elseif (re <= 2.1e+90) tmp = im * (exp(re) * (1.0 + (im * (im * -0.16666666666666666)))); else tmp = 0.16666666666666666 * (sin(im) * (re * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.0205], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 350.0], N[(N[Sin[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.1e+90], N[(im * N[(N[Exp[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.0205:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 350:\\
\;\;\;\;\sin im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\
\mathbf{elif}\;re \leq 2.1 \cdot 10^{+90}:\\
\;\;\;\;im \cdot \left(e^{re} \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin im \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -0.0205000000000000009Initial program 100.0%
Taylor expanded in im around 0 100.0%
if -0.0205000000000000009 < re < 350Initial program 100.0%
Taylor expanded in re around 0 98.3%
*-lft-identity98.3%
associate-*r*98.3%
distribute-rgt1-in98.3%
associate-*r*98.3%
distribute-rgt-out98.3%
+-commutative98.3%
*-commutative98.3%
Simplified98.3%
if 350 < re < 2.09999999999999981e90Initial program 100.0%
Taylor expanded in im around 0 0.0%
associate-*r*0.0%
*-lft-identity0.0%
distribute-rgt-out82.6%
*-commutative82.6%
unpow282.6%
associate-*l*82.6%
Simplified82.6%
if 2.09999999999999981e90 < re Initial program 100.0%
Taylor expanded in re around 0 89.5%
distribute-rgt-in89.5%
*-commutative89.5%
associate-+r+89.5%
distribute-rgt1-in89.5%
*-commutative89.5%
*-commutative89.5%
associate-*l*89.5%
+-commutative89.5%
associate-*r*89.5%
distribute-rgt-out89.5%
associate-*l*98.0%
distribute-lft-out98.0%
Simplified98.0%
Taylor expanded in re around inf 98.0%
*-commutative98.0%
cube-mult98.0%
Simplified98.0%
Final simplification97.3%
(FPCore (re im)
:precision binary64
(if (<= re -0.0046)
(* (exp re) im)
(if (<= re 350.0)
(* (sin im) (+ re 1.0))
(if (<= re 2.1e+90)
(* im (* (exp re) (+ 1.0 (* im (* im -0.16666666666666666)))))
(* 0.16666666666666666 (* (sin im) (* re (* re re))))))))
double code(double re, double im) {
double tmp;
if (re <= -0.0046) {
tmp = exp(re) * im;
} else if (re <= 350.0) {
tmp = sin(im) * (re + 1.0);
} else if (re <= 2.1e+90) {
tmp = im * (exp(re) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = 0.16666666666666666 * (sin(im) * (re * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.0046d0)) then
tmp = exp(re) * im
else if (re <= 350.0d0) then
tmp = sin(im) * (re + 1.0d0)
else if (re <= 2.1d+90) then
tmp = im * (exp(re) * (1.0d0 + (im * (im * (-0.16666666666666666d0)))))
else
tmp = 0.16666666666666666d0 * (sin(im) * (re * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.0046) {
tmp = Math.exp(re) * im;
} else if (re <= 350.0) {
tmp = Math.sin(im) * (re + 1.0);
} else if (re <= 2.1e+90) {
tmp = im * (Math.exp(re) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = 0.16666666666666666 * (Math.sin(im) * (re * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.0046: tmp = math.exp(re) * im elif re <= 350.0: tmp = math.sin(im) * (re + 1.0) elif re <= 2.1e+90: tmp = im * (math.exp(re) * (1.0 + (im * (im * -0.16666666666666666)))) else: tmp = 0.16666666666666666 * (math.sin(im) * (re * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.0046) tmp = Float64(exp(re) * im); elseif (re <= 350.0) tmp = Float64(sin(im) * Float64(re + 1.0)); elseif (re <= 2.1e+90) tmp = Float64(im * Float64(exp(re) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666))))); else tmp = Float64(0.16666666666666666 * Float64(sin(im) * Float64(re * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.0046) tmp = exp(re) * im; elseif (re <= 350.0) tmp = sin(im) * (re + 1.0); elseif (re <= 2.1e+90) tmp = im * (exp(re) * (1.0 + (im * (im * -0.16666666666666666)))); else tmp = 0.16666666666666666 * (sin(im) * (re * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.0046], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 350.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.1e+90], N[(im * N[(N[Exp[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.0046:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 350:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{elif}\;re \leq 2.1 \cdot 10^{+90}:\\
\;\;\;\;im \cdot \left(e^{re} \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin im \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -0.0045999999999999999Initial program 100.0%
Taylor expanded in im around 0 100.0%
if -0.0045999999999999999 < re < 350Initial program 100.0%
Taylor expanded in re around 0 98.1%
distribute-rgt1-in98.1%
*-commutative98.1%
Simplified98.1%
if 350 < re < 2.09999999999999981e90Initial program 100.0%
Taylor expanded in im around 0 0.0%
associate-*r*0.0%
*-lft-identity0.0%
distribute-rgt-out82.6%
*-commutative82.6%
unpow282.6%
associate-*l*82.6%
Simplified82.6%
if 2.09999999999999981e90 < re Initial program 100.0%
Taylor expanded in re around 0 89.5%
distribute-rgt-in89.5%
*-commutative89.5%
associate-+r+89.5%
distribute-rgt1-in89.5%
*-commutative89.5%
*-commutative89.5%
associate-*l*89.5%
+-commutative89.5%
associate-*r*89.5%
distribute-rgt-out89.5%
associate-*l*98.0%
distribute-lft-out98.0%
Simplified98.0%
Taylor expanded in re around inf 98.0%
*-commutative98.0%
cube-mult98.0%
Simplified98.0%
Final simplification97.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -0.0058)
t_0
(if (<= re 350.0)
(* (sin im) (+ re 1.0))
(if (<= re 5.6e+102)
t_0
(* 0.16666666666666666 (* (sin im) (* re (* re re)))))))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.0058) {
tmp = t_0;
} else if (re <= 350.0) {
tmp = sin(im) * (re + 1.0);
} else if (re <= 5.6e+102) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (sin(im) * (re * (re * re)));
}
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(re) * im
if (re <= (-0.0058d0)) then
tmp = t_0
else if (re <= 350.0d0) then
tmp = sin(im) * (re + 1.0d0)
else if (re <= 5.6d+102) then
tmp = t_0
else
tmp = 0.16666666666666666d0 * (sin(im) * (re * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double tmp;
if (re <= -0.0058) {
tmp = t_0;
} else if (re <= 350.0) {
tmp = Math.sin(im) * (re + 1.0);
} else if (re <= 5.6e+102) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (Math.sin(im) * (re * (re * re)));
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.0058: tmp = t_0 elif re <= 350.0: tmp = math.sin(im) * (re + 1.0) elif re <= 5.6e+102: tmp = t_0 else: tmp = 0.16666666666666666 * (math.sin(im) * (re * (re * re))) return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -0.0058) tmp = t_0; elseif (re <= 350.0) tmp = Float64(sin(im) * Float64(re + 1.0)); elseif (re <= 5.6e+102) tmp = t_0; else tmp = Float64(0.16666666666666666 * Float64(sin(im) * Float64(re * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -0.0058) tmp = t_0; elseif (re <= 350.0) tmp = sin(im) * (re + 1.0); elseif (re <= 5.6e+102) tmp = t_0; else tmp = 0.16666666666666666 * (sin(im) * (re * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.0058], t$95$0, If[LessEqual[re, 350.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 5.6e+102], t$95$0, N[(0.16666666666666666 * N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.0058:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 350:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{elif}\;re \leq 5.6 \cdot 10^{+102}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin im \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -0.0058 or 350 < re < 5.60000000000000037e102Initial program 100.0%
Taylor expanded in im around 0 94.6%
if -0.0058 < re < 350Initial program 100.0%
Taylor expanded in re around 0 98.1%
distribute-rgt1-in98.1%
*-commutative98.1%
Simplified98.1%
if 5.60000000000000037e102 < re Initial program 100.0%
Taylor expanded in re around 0 91.4%
distribute-rgt-in91.4%
*-commutative91.4%
associate-+r+91.4%
distribute-rgt1-in91.4%
*-commutative91.4%
*-commutative91.4%
associate-*l*91.4%
+-commutative91.4%
associate-*r*91.4%
distribute-rgt-out91.4%
associate-*l*100.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in re around inf 100.0%
*-commutative100.0%
cube-mult100.0%
Simplified100.0%
Final simplification97.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -0.0029)
t_0
(if (<= re 350.0)
(* (sin im) (+ re 1.0))
(if (<= re 1.25e+150) t_0 (* 0.5 (* (sin im) (* re re))))))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.0029) {
tmp = t_0;
} else if (re <= 350.0) {
tmp = sin(im) * (re + 1.0);
} else if (re <= 1.25e+150) {
tmp = t_0;
} else {
tmp = 0.5 * (sin(im) * (re * re));
}
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(re) * im
if (re <= (-0.0029d0)) then
tmp = t_0
else if (re <= 350.0d0) then
tmp = sin(im) * (re + 1.0d0)
else if (re <= 1.25d+150) then
tmp = t_0
else
tmp = 0.5d0 * (sin(im) * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double tmp;
if (re <= -0.0029) {
tmp = t_0;
} else if (re <= 350.0) {
tmp = Math.sin(im) * (re + 1.0);
} else if (re <= 1.25e+150) {
tmp = t_0;
} else {
tmp = 0.5 * (Math.sin(im) * (re * re));
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.0029: tmp = t_0 elif re <= 350.0: tmp = math.sin(im) * (re + 1.0) elif re <= 1.25e+150: tmp = t_0 else: tmp = 0.5 * (math.sin(im) * (re * re)) return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -0.0029) tmp = t_0; elseif (re <= 350.0) tmp = Float64(sin(im) * Float64(re + 1.0)); elseif (re <= 1.25e+150) tmp = t_0; else tmp = Float64(0.5 * Float64(sin(im) * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -0.0029) tmp = t_0; elseif (re <= 350.0) tmp = sin(im) * (re + 1.0); elseif (re <= 1.25e+150) tmp = t_0; else tmp = 0.5 * (sin(im) * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.0029], t$95$0, If[LessEqual[re, 350.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.25e+150], t$95$0, N[(0.5 * N[(N[Sin[im], $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.0029:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 350:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{elif}\;re \leq 1.25 \cdot 10^{+150}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sin im \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < -0.0029 or 350 < re < 1.25000000000000002e150Initial program 100.0%
Taylor expanded in im around 0 94.1%
if -0.0029 < re < 350Initial program 100.0%
Taylor expanded in re around 0 98.1%
distribute-rgt1-in98.1%
*-commutative98.1%
Simplified98.1%
if 1.25000000000000002e150 < re Initial program 100.0%
Taylor expanded in re around 0 81.4%
*-lft-identity81.4%
associate-*r*81.4%
distribute-rgt1-in81.4%
associate-*r*97.5%
distribute-rgt-out97.5%
+-commutative97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in re around inf 97.5%
unpow297.5%
*-commutative97.5%
Simplified97.5%
Final simplification96.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -0.0031)
t_0
(if (<= re 350.0)
(* (sin im) (+ re 1.0))
(if (<= re 4e+214)
t_0
(*
0.5
(* im (* (* re re) (+ 1.0 (* im (* im -0.16666666666666666)))))))))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.0031) {
tmp = t_0;
} else if (re <= 350.0) {
tmp = sin(im) * (re + 1.0);
} else if (re <= 4e+214) {
tmp = t_0;
} else {
tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666)))));
}
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(re) * im
if (re <= (-0.0031d0)) then
tmp = t_0
else if (re <= 350.0d0) then
tmp = sin(im) * (re + 1.0d0)
else if (re <= 4d+214) then
tmp = t_0
else
tmp = 0.5d0 * (im * ((re * re) * (1.0d0 + (im * (im * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double tmp;
if (re <= -0.0031) {
tmp = t_0;
} else if (re <= 350.0) {
tmp = Math.sin(im) * (re + 1.0);
} else if (re <= 4e+214) {
tmp = t_0;
} else {
tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666)))));
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.0031: tmp = t_0 elif re <= 350.0: tmp = math.sin(im) * (re + 1.0) elif re <= 4e+214: tmp = t_0 else: tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666))))) return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -0.0031) tmp = t_0; elseif (re <= 350.0) tmp = Float64(sin(im) * Float64(re + 1.0)); elseif (re <= 4e+214) tmp = t_0; else tmp = Float64(0.5 * Float64(im * Float64(Float64(re * re) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -0.0031) tmp = t_0; elseif (re <= 350.0) tmp = sin(im) * (re + 1.0); elseif (re <= 4e+214) tmp = t_0; else tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666))))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.0031], t$95$0, If[LessEqual[re, 350.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 4e+214], t$95$0, N[(0.5 * N[(im * N[(N[(re * re), $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.0031:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 350:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{elif}\;re \leq 4 \cdot 10^{+214}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(\left(re \cdot re\right) \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if re < -0.00309999999999999989 or 350 < re < 3.9999999999999998e214Initial program 100.0%
Taylor expanded in im around 0 90.7%
if -0.00309999999999999989 < re < 350Initial program 100.0%
Taylor expanded in re around 0 98.1%
distribute-rgt1-in98.1%
*-commutative98.1%
Simplified98.1%
if 3.9999999999999998e214 < re Initial program 100.0%
Taylor expanded in im around 0 0.0%
associate-*r*0.0%
*-lft-identity0.0%
distribute-rgt-out88.9%
*-commutative88.9%
unpow288.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in re around 0 88.9%
*-commutative88.9%
unpow288.9%
associate-*r*88.9%
associate-+r+88.9%
+-commutative88.9%
Simplified88.9%
Taylor expanded in re around inf 88.9%
unpow288.9%
*-commutative88.9%
unpow288.9%
associate-*l*88.9%
Simplified88.9%
Final simplification94.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -0.000245)
t_0
(if (<= re 350.0)
(sin im)
(if (<= re 5e+211)
t_0
(*
0.5
(* im (* (* re re) (+ 1.0 (* im (* im -0.16666666666666666)))))))))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.000245) {
tmp = t_0;
} else if (re <= 350.0) {
tmp = sin(im);
} else if (re <= 5e+211) {
tmp = t_0;
} else {
tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666)))));
}
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(re) * im
if (re <= (-0.000245d0)) then
tmp = t_0
else if (re <= 350.0d0) then
tmp = sin(im)
else if (re <= 5d+211) then
tmp = t_0
else
tmp = 0.5d0 * (im * ((re * re) * (1.0d0 + (im * (im * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double tmp;
if (re <= -0.000245) {
tmp = t_0;
} else if (re <= 350.0) {
tmp = Math.sin(im);
} else if (re <= 5e+211) {
tmp = t_0;
} else {
tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666)))));
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.000245: tmp = t_0 elif re <= 350.0: tmp = math.sin(im) elif re <= 5e+211: tmp = t_0 else: tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666))))) return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -0.000245) tmp = t_0; elseif (re <= 350.0) tmp = sin(im); elseif (re <= 5e+211) tmp = t_0; else tmp = Float64(0.5 * Float64(im * Float64(Float64(re * re) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -0.000245) tmp = t_0; elseif (re <= 350.0) tmp = sin(im); elseif (re <= 5e+211) tmp = t_0; else tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666))))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.000245], t$95$0, If[LessEqual[re, 350.0], N[Sin[im], $MachinePrecision], If[LessEqual[re, 5e+211], t$95$0, N[(0.5 * N[(im * N[(N[(re * re), $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.000245:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 350:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;re \leq 5 \cdot 10^{+211}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(\left(re \cdot re\right) \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if re < -2.4499999999999999e-4 or 350 < re < 4.9999999999999995e211Initial program 100.0%
Taylor expanded in im around 0 90.7%
if -2.4499999999999999e-4 < re < 350Initial program 100.0%
Taylor expanded in re around 0 97.1%
if 4.9999999999999995e211 < re Initial program 100.0%
Taylor expanded in im around 0 0.0%
associate-*r*0.0%
*-lft-identity0.0%
distribute-rgt-out88.9%
*-commutative88.9%
unpow288.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in re around 0 88.9%
*-commutative88.9%
unpow288.9%
associate-*r*88.9%
associate-+r+88.9%
+-commutative88.9%
Simplified88.9%
Taylor expanded in re around inf 88.9%
unpow288.9%
*-commutative88.9%
unpow288.9%
associate-*l*88.9%
Simplified88.9%
Final simplification93.6%
(FPCore (re im)
:precision binary64
(if (<= re -2100000.0)
(+ (+ 1.0 (* im (+ re 1.0))) -1.0)
(if (<= re 3.5e+52)
(sin im)
(if (<= re 1e+212)
(* (* re (* re re)) (* im 0.16666666666666666))
(*
0.5
(* im (* (* re re) (+ 1.0 (* im (* im -0.16666666666666666))))))))))
double code(double re, double im) {
double tmp;
if (re <= -2100000.0) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if (re <= 3.5e+52) {
tmp = sin(im);
} else if (re <= 1e+212) {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
} else {
tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-2100000.0d0)) then
tmp = (1.0d0 + (im * (re + 1.0d0))) + (-1.0d0)
else if (re <= 3.5d+52) then
tmp = sin(im)
else if (re <= 1d+212) then
tmp = (re * (re * re)) * (im * 0.16666666666666666d0)
else
tmp = 0.5d0 * (im * ((re * re) * (1.0d0 + (im * (im * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -2100000.0) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if (re <= 3.5e+52) {
tmp = Math.sin(im);
} else if (re <= 1e+212) {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
} else {
tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -2100000.0: tmp = (1.0 + (im * (re + 1.0))) + -1.0 elif re <= 3.5e+52: tmp = math.sin(im) elif re <= 1e+212: tmp = (re * (re * re)) * (im * 0.16666666666666666) else: tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666))))) return tmp
function code(re, im) tmp = 0.0 if (re <= -2100000.0) tmp = Float64(Float64(1.0 + Float64(im * Float64(re + 1.0))) + -1.0); elseif (re <= 3.5e+52) tmp = sin(im); elseif (re <= 1e+212) tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * 0.16666666666666666)); else tmp = Float64(0.5 * Float64(im * Float64(Float64(re * re) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -2100000.0) tmp = (1.0 + (im * (re + 1.0))) + -1.0; elseif (re <= 3.5e+52) tmp = sin(im); elseif (re <= 1e+212) tmp = (re * (re * re)) * (im * 0.16666666666666666); else tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -2100000.0], N[(N[(1.0 + N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 3.5e+52], N[Sin[im], $MachinePrecision], If[LessEqual[re, 1e+212], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(im * N[(N[(re * re), $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -2100000:\\
\;\;\;\;\left(1 + im \cdot \left(re + 1\right)\right) + -1\\
\mathbf{elif}\;re \leq 3.5 \cdot 10^{+52}:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;re \leq 10^{+212}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot 0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(\left(re \cdot re\right) \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if re < -2.1e6Initial program 100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 1.9%
*-commutative1.9%
Simplified1.9%
Taylor expanded in re around 0 2.4%
expm1-log1p-u1.6%
expm1-undefine18.8%
distribute-rgt1-in18.8%
Applied egg-rr18.8%
sub-neg18.8%
log1p-undefine18.8%
rem-exp-log19.6%
*-commutative19.6%
+-commutative19.6%
metadata-eval19.6%
Simplified19.6%
if -2.1e6 < re < 3.5e52Initial program 100.0%
Taylor expanded in re around 0 87.3%
if 3.5e52 < re < 9.9999999999999991e211Initial program 100.0%
Taylor expanded in re around 0 61.5%
distribute-rgt-in61.5%
*-commutative61.5%
associate-+r+61.5%
distribute-rgt1-in61.5%
*-commutative61.5%
*-commutative61.5%
associate-*l*61.5%
+-commutative61.5%
associate-*r*61.5%
distribute-rgt-out61.5%
associate-*l*71.7%
distribute-lft-out71.7%
Simplified71.7%
Taylor expanded in im around 0 65.7%
distribute-rgt-in65.7%
*-rgt-identity65.7%
distribute-lft-in65.7%
*-commutative65.7%
distribute-lft-in65.7%
unpow265.7%
associate-*l*65.7%
*-commutative65.7%
distribute-lft-in65.7%
distribute-rgt-in65.7%
*-commutative65.7%
Simplified65.7%
Taylor expanded in re around inf 65.7%
associate-*r*65.7%
*-commutative65.7%
cube-unmult65.7%
Simplified65.7%
if 9.9999999999999991e211 < re Initial program 100.0%
Taylor expanded in im around 0 0.0%
associate-*r*0.0%
*-lft-identity0.0%
distribute-rgt-out88.9%
*-commutative88.9%
unpow288.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in re around 0 88.9%
*-commutative88.9%
unpow288.9%
associate-*r*88.9%
associate-+r+88.9%
+-commutative88.9%
Simplified88.9%
Taylor expanded in re around inf 88.9%
unpow288.9%
*-commutative88.9%
unpow288.9%
associate-*l*88.9%
Simplified88.9%
Final simplification66.5%
(FPCore (re im)
:precision binary64
(if (<= re -7e-16)
(+ (+ 1.0 (* im (+ re 1.0))) -1.0)
(if (or (<= re 1.5e+54) (and (not (<= re 3.1e+231)) (<= re 2.4e+293)))
(* im (* (+ re 1.0) (+ 1.0 (* im (* im -0.16666666666666666)))))
(* (* re (* re re)) (* im 0.16666666666666666)))))
double code(double re, double im) {
double tmp;
if (re <= -7e-16) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if ((re <= 1.5e+54) || (!(re <= 3.1e+231) && (re <= 2.4e+293))) {
tmp = im * ((re + 1.0) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-7d-16)) then
tmp = (1.0d0 + (im * (re + 1.0d0))) + (-1.0d0)
else if ((re <= 1.5d+54) .or. (.not. (re <= 3.1d+231)) .and. (re <= 2.4d+293)) then
tmp = im * ((re + 1.0d0) * (1.0d0 + (im * (im * (-0.16666666666666666d0)))))
else
tmp = (re * (re * re)) * (im * 0.16666666666666666d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -7e-16) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if ((re <= 1.5e+54) || (!(re <= 3.1e+231) && (re <= 2.4e+293))) {
tmp = im * ((re + 1.0) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -7e-16: tmp = (1.0 + (im * (re + 1.0))) + -1.0 elif (re <= 1.5e+54) or (not (re <= 3.1e+231) and (re <= 2.4e+293)): tmp = im * ((re + 1.0) * (1.0 + (im * (im * -0.16666666666666666)))) else: tmp = (re * (re * re)) * (im * 0.16666666666666666) return tmp
function code(re, im) tmp = 0.0 if (re <= -7e-16) tmp = Float64(Float64(1.0 + Float64(im * Float64(re + 1.0))) + -1.0); elseif ((re <= 1.5e+54) || (!(re <= 3.1e+231) && (re <= 2.4e+293))) tmp = Float64(im * Float64(Float64(re + 1.0) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666))))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * 0.16666666666666666)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -7e-16) tmp = (1.0 + (im * (re + 1.0))) + -1.0; elseif ((re <= 1.5e+54) || (~((re <= 3.1e+231)) && (re <= 2.4e+293))) tmp = im * ((re + 1.0) * (1.0 + (im * (im * -0.16666666666666666)))); else tmp = (re * (re * re)) * (im * 0.16666666666666666); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -7e-16], N[(N[(1.0 + N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[Or[LessEqual[re, 1.5e+54], And[N[Not[LessEqual[re, 3.1e+231]], $MachinePrecision], LessEqual[re, 2.4e+293]]], N[(im * N[(N[(re + 1.0), $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -7 \cdot 10^{-16}:\\
\;\;\;\;\left(1 + im \cdot \left(re + 1\right)\right) + -1\\
\mathbf{elif}\;re \leq 1.5 \cdot 10^{+54} \lor \neg \left(re \leq 3.1 \cdot 10^{+231}\right) \land re \leq 2.4 \cdot 10^{+293}:\\
\;\;\;\;im \cdot \left(\left(re + 1\right) \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot 0.16666666666666666\right)\\
\end{array}
\end{array}
if re < -7.00000000000000035e-16Initial program 100.0%
Taylor expanded in im around 0 94.6%
Taylor expanded in re around 0 2.1%
*-commutative2.1%
Simplified2.1%
Taylor expanded in re around 0 2.5%
expm1-log1p-u1.7%
expm1-undefine17.6%
distribute-rgt1-in17.6%
Applied egg-rr17.6%
sub-neg17.6%
log1p-undefine17.6%
rem-exp-log18.4%
*-commutative18.4%
+-commutative18.4%
metadata-eval18.4%
Simplified18.4%
if -7.00000000000000035e-16 < re < 1.4999999999999999e54 or 3.0999999999999999e231 < re < 2.40000000000000003e293Initial program 100.0%
Taylor expanded in im around 0 40.5%
associate-*r*40.5%
*-lft-identity40.5%
distribute-rgt-out55.6%
*-commutative55.6%
unpow255.6%
associate-*l*55.6%
Simplified55.6%
Taylor expanded in re around 0 47.8%
*-commutative47.8%
unpow247.8%
associate-*r*47.8%
associate-+r+47.8%
*-commutative47.8%
unpow247.8%
associate-*r*47.8%
distribute-rgt1-in47.9%
Simplified47.9%
if 1.4999999999999999e54 < re < 3.0999999999999999e231 or 2.40000000000000003e293 < re Initial program 100.0%
Taylor expanded in re around 0 68.3%
distribute-rgt-in68.3%
*-commutative68.3%
associate-+r+68.3%
distribute-rgt1-in68.3%
*-commutative68.3%
*-commutative68.3%
associate-*l*68.3%
+-commutative68.3%
associate-*r*68.3%
distribute-rgt-out68.3%
associate-*l*76.8%
distribute-lft-out76.8%
Simplified76.8%
Taylor expanded in im around 0 69.6%
distribute-rgt-in69.6%
*-rgt-identity69.6%
distribute-lft-in69.6%
*-commutative69.6%
distribute-lft-in69.6%
unpow269.6%
associate-*l*69.6%
*-commutative69.6%
distribute-lft-in69.6%
distribute-rgt-in69.6%
*-commutative69.6%
Simplified69.6%
Taylor expanded in re around inf 69.6%
associate-*r*69.6%
*-commutative69.6%
cube-unmult69.6%
Simplified69.6%
Final simplification43.4%
(FPCore (re im)
:precision binary64
(if (<= re -0.88)
(+ (+ 1.0 (* im (+ re 1.0))) -1.0)
(if (<= re 3.1e+231)
(* im (+ 1.0 (* re (+ 1.0 (* 0.16666666666666666 (* re re))))))
(if (<= re 2.4e+293)
(* im (* (+ re 1.0) (+ 1.0 (* im (* im -0.16666666666666666)))))
(* (* re (* re re)) (* im 0.16666666666666666))))))
double code(double re, double im) {
double tmp;
if (re <= -0.88) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if (re <= 3.1e+231) {
tmp = im * (1.0 + (re * (1.0 + (0.16666666666666666 * (re * re)))));
} else if (re <= 2.4e+293) {
tmp = im * ((re + 1.0) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.88d0)) then
tmp = (1.0d0 + (im * (re + 1.0d0))) + (-1.0d0)
else if (re <= 3.1d+231) then
tmp = im * (1.0d0 + (re * (1.0d0 + (0.16666666666666666d0 * (re * re)))))
else if (re <= 2.4d+293) then
tmp = im * ((re + 1.0d0) * (1.0d0 + (im * (im * (-0.16666666666666666d0)))))
else
tmp = (re * (re * re)) * (im * 0.16666666666666666d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.88) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if (re <= 3.1e+231) {
tmp = im * (1.0 + (re * (1.0 + (0.16666666666666666 * (re * re)))));
} else if (re <= 2.4e+293) {
tmp = im * ((re + 1.0) * (1.0 + (im * (im * -0.16666666666666666))));
} else {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.88: tmp = (1.0 + (im * (re + 1.0))) + -1.0 elif re <= 3.1e+231: tmp = im * (1.0 + (re * (1.0 + (0.16666666666666666 * (re * re))))) elif re <= 2.4e+293: tmp = im * ((re + 1.0) * (1.0 + (im * (im * -0.16666666666666666)))) else: tmp = (re * (re * re)) * (im * 0.16666666666666666) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.88) tmp = Float64(Float64(1.0 + Float64(im * Float64(re + 1.0))) + -1.0); elseif (re <= 3.1e+231) tmp = Float64(im * Float64(1.0 + Float64(re * Float64(1.0 + Float64(0.16666666666666666 * Float64(re * re)))))); elseif (re <= 2.4e+293) tmp = Float64(im * Float64(Float64(re + 1.0) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666))))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * 0.16666666666666666)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.88) tmp = (1.0 + (im * (re + 1.0))) + -1.0; elseif (re <= 3.1e+231) tmp = im * (1.0 + (re * (1.0 + (0.16666666666666666 * (re * re))))); elseif (re <= 2.4e+293) tmp = im * ((re + 1.0) * (1.0 + (im * (im * -0.16666666666666666)))); else tmp = (re * (re * re)) * (im * 0.16666666666666666); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.88], N[(N[(1.0 + N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 3.1e+231], N[(im * N[(1.0 + N[(re * N[(1.0 + N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.4e+293], N[(im * N[(N[(re + 1.0), $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.88:\\
\;\;\;\;\left(1 + im \cdot \left(re + 1\right)\right) + -1\\
\mathbf{elif}\;re \leq 3.1 \cdot 10^{+231}:\\
\;\;\;\;im \cdot \left(1 + re \cdot \left(1 + 0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{elif}\;re \leq 2.4 \cdot 10^{+293}:\\
\;\;\;\;im \cdot \left(\left(re + 1\right) \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot 0.16666666666666666\right)\\
\end{array}
\end{array}
if re < -0.880000000000000004Initial program 100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 2.0%
*-commutative2.0%
Simplified2.0%
Taylor expanded in re around 0 2.4%
expm1-log1p-u1.6%
expm1-undefine18.6%
distribute-rgt1-in18.6%
Applied egg-rr18.6%
sub-neg18.6%
log1p-undefine18.6%
rem-exp-log19.3%
*-commutative19.3%
+-commutative19.3%
metadata-eval19.3%
Simplified19.3%
if -0.880000000000000004 < re < 3.0999999999999999e231Initial program 100.0%
Taylor expanded in re around 0 83.5%
distribute-rgt-in83.5%
*-commutative83.5%
associate-+r+83.5%
distribute-rgt1-in83.5%
*-commutative83.5%
*-commutative83.5%
associate-*l*83.5%
+-commutative83.5%
associate-*r*83.5%
distribute-rgt-out83.5%
associate-*l*85.7%
distribute-lft-out85.7%
Simplified85.7%
Taylor expanded in re around inf 85.5%
cube-mult85.5%
Simplified85.5%
Taylor expanded in im around 0 48.3%
*-rgt-identity48.3%
*-commutative48.3%
cube-unmult48.3%
unpow248.3%
associate-*l*48.3%
*-commutative48.3%
distribute-lft-in48.3%
unpow248.3%
Simplified48.3%
if 3.0999999999999999e231 < re < 2.40000000000000003e293Initial program 100.0%
Taylor expanded in im around 0 0.0%
associate-*r*0.0%
*-lft-identity0.0%
distribute-rgt-out90.0%
*-commutative90.0%
unpow290.0%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in re around 0 71.0%
*-commutative71.0%
unpow271.0%
associate-*r*71.0%
associate-+r+71.0%
*-commutative71.0%
unpow271.0%
associate-*r*71.0%
distribute-rgt1-in71.0%
Simplified71.0%
if 2.40000000000000003e293 < re Initial program 100.0%
Taylor expanded in re around 0 100.0%
distribute-rgt-in100.0%
*-commutative100.0%
associate-+r+100.0%
distribute-rgt1-in100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
+-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
associate-*l*100.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
distribute-rgt-in100.0%
*-rgt-identity100.0%
distribute-lft-in100.0%
*-commutative100.0%
distribute-lft-in100.0%
unpow2100.0%
associate-*l*100.0%
*-commutative100.0%
distribute-lft-in100.0%
distribute-rgt-in100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in re around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
cube-unmult100.0%
Simplified100.0%
Final simplification42.3%
(FPCore (re im)
:precision binary64
(if (<= re -0.88)
(+ (+ 1.0 (* im (+ re 1.0))) -1.0)
(if (<= re 2e+214)
(* im (+ 1.0 (* re (+ 1.0 (* 0.16666666666666666 (* re re))))))
(* 0.5 (* im (* (* re re) (+ 1.0 (* im (* im -0.16666666666666666)))))))))
double code(double re, double im) {
double tmp;
if (re <= -0.88) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if (re <= 2e+214) {
tmp = im * (1.0 + (re * (1.0 + (0.16666666666666666 * (re * re)))));
} else {
tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.88d0)) then
tmp = (1.0d0 + (im * (re + 1.0d0))) + (-1.0d0)
else if (re <= 2d+214) then
tmp = im * (1.0d0 + (re * (1.0d0 + (0.16666666666666666d0 * (re * re)))))
else
tmp = 0.5d0 * (im * ((re * re) * (1.0d0 + (im * (im * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.88) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if (re <= 2e+214) {
tmp = im * (1.0 + (re * (1.0 + (0.16666666666666666 * (re * re)))));
} else {
tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.88: tmp = (1.0 + (im * (re + 1.0))) + -1.0 elif re <= 2e+214: tmp = im * (1.0 + (re * (1.0 + (0.16666666666666666 * (re * re))))) else: tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666))))) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.88) tmp = Float64(Float64(1.0 + Float64(im * Float64(re + 1.0))) + -1.0); elseif (re <= 2e+214) tmp = Float64(im * Float64(1.0 + Float64(re * Float64(1.0 + Float64(0.16666666666666666 * Float64(re * re)))))); else tmp = Float64(0.5 * Float64(im * Float64(Float64(re * re) * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.88) tmp = (1.0 + (im * (re + 1.0))) + -1.0; elseif (re <= 2e+214) tmp = im * (1.0 + (re * (1.0 + (0.16666666666666666 * (re * re))))); else tmp = 0.5 * (im * ((re * re) * (1.0 + (im * (im * -0.16666666666666666))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.88], N[(N[(1.0 + N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 2e+214], N[(im * N[(1.0 + N[(re * N[(1.0 + N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(im * N[(N[(re * re), $MachinePrecision] * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.88:\\
\;\;\;\;\left(1 + im \cdot \left(re + 1\right)\right) + -1\\
\mathbf{elif}\;re \leq 2 \cdot 10^{+214}:\\
\;\;\;\;im \cdot \left(1 + re \cdot \left(1 + 0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(\left(re \cdot re\right) \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if re < -0.880000000000000004Initial program 100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 2.0%
*-commutative2.0%
Simplified2.0%
Taylor expanded in re around 0 2.4%
expm1-log1p-u1.6%
expm1-undefine18.6%
distribute-rgt1-in18.6%
Applied egg-rr18.6%
sub-neg18.6%
log1p-undefine18.6%
rem-exp-log19.3%
*-commutative19.3%
+-commutative19.3%
metadata-eval19.3%
Simplified19.3%
if -0.880000000000000004 < re < 1.9999999999999999e214Initial program 100.0%
Taylor expanded in re around 0 83.1%
distribute-rgt-in83.1%
*-commutative83.1%
associate-+r+83.1%
distribute-rgt1-in83.1%
*-commutative83.1%
*-commutative83.1%
associate-*l*83.1%
+-commutative83.1%
associate-*r*83.1%
distribute-rgt-out83.1%
associate-*l*85.4%
distribute-lft-out85.4%
Simplified85.4%
Taylor expanded in re around inf 85.1%
cube-mult85.1%
Simplified85.1%
Taylor expanded in im around 0 47.6%
*-rgt-identity47.6%
*-commutative47.6%
cube-unmult47.6%
unpow247.6%
associate-*l*47.6%
*-commutative47.6%
distribute-lft-in47.6%
unpow247.6%
Simplified47.6%
if 1.9999999999999999e214 < re Initial program 100.0%
Taylor expanded in im around 0 0.0%
associate-*r*0.0%
*-lft-identity0.0%
distribute-rgt-out88.9%
*-commutative88.9%
unpow288.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in re around 0 88.9%
*-commutative88.9%
unpow288.9%
associate-*r*88.9%
associate-+r+88.9%
+-commutative88.9%
Simplified88.9%
Taylor expanded in re around inf 88.9%
unpow288.9%
*-commutative88.9%
unpow288.9%
associate-*l*88.9%
Simplified88.9%
Final simplification43.0%
(FPCore (re im)
:precision binary64
(if (<= re -7e-16)
(+ (+ 1.0 (* im (+ re 1.0))) -1.0)
(if (<= re 3e+55)
(* im (+ 1.0 (* -0.16666666666666666 (* im im))))
(* (* re (* re re)) (* im 0.16666666666666666)))))
double code(double re, double im) {
double tmp;
if (re <= -7e-16) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if (re <= 3e+55) {
tmp = im * (1.0 + (-0.16666666666666666 * (im * im)));
} else {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-7d-16)) then
tmp = (1.0d0 + (im * (re + 1.0d0))) + (-1.0d0)
else if (re <= 3d+55) then
tmp = im * (1.0d0 + ((-0.16666666666666666d0) * (im * im)))
else
tmp = (re * (re * re)) * (im * 0.16666666666666666d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -7e-16) {
tmp = (1.0 + (im * (re + 1.0))) + -1.0;
} else if (re <= 3e+55) {
tmp = im * (1.0 + (-0.16666666666666666 * (im * im)));
} else {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -7e-16: tmp = (1.0 + (im * (re + 1.0))) + -1.0 elif re <= 3e+55: tmp = im * (1.0 + (-0.16666666666666666 * (im * im))) else: tmp = (re * (re * re)) * (im * 0.16666666666666666) return tmp
function code(re, im) tmp = 0.0 if (re <= -7e-16) tmp = Float64(Float64(1.0 + Float64(im * Float64(re + 1.0))) + -1.0); elseif (re <= 3e+55) tmp = Float64(im * Float64(1.0 + Float64(-0.16666666666666666 * Float64(im * im)))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * 0.16666666666666666)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -7e-16) tmp = (1.0 + (im * (re + 1.0))) + -1.0; elseif (re <= 3e+55) tmp = im * (1.0 + (-0.16666666666666666 * (im * im))); else tmp = (re * (re * re)) * (im * 0.16666666666666666); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -7e-16], N[(N[(1.0 + N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 3e+55], N[(im * N[(1.0 + N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -7 \cdot 10^{-16}:\\
\;\;\;\;\left(1 + im \cdot \left(re + 1\right)\right) + -1\\
\mathbf{elif}\;re \leq 3 \cdot 10^{+55}:\\
\;\;\;\;im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot 0.16666666666666666\right)\\
\end{array}
\end{array}
if re < -7.00000000000000035e-16Initial program 100.0%
Taylor expanded in im around 0 94.6%
Taylor expanded in re around 0 2.1%
*-commutative2.1%
Simplified2.1%
Taylor expanded in re around 0 2.5%
expm1-log1p-u1.7%
expm1-undefine17.6%
distribute-rgt1-in17.6%
Applied egg-rr17.6%
sub-neg17.6%
log1p-undefine17.6%
rem-exp-log18.4%
*-commutative18.4%
+-commutative18.4%
metadata-eval18.4%
Simplified18.4%
if -7.00000000000000035e-16 < re < 3.00000000000000017e55Initial program 100.0%
Taylor expanded in im around 0 43.6%
associate-*r*43.6%
*-lft-identity43.6%
distribute-rgt-out52.9%
*-commutative52.9%
unpow252.9%
associate-*l*52.9%
Simplified52.9%
Taylor expanded in re around 0 45.9%
*-commutative45.9%
*-commutative45.9%
unpow245.9%
associate-*r*45.9%
*-commutative45.9%
distribute-lft-in45.9%
*-commutative45.9%
unpow245.9%
associate-*r*45.9%
distribute-lft-in45.9%
Simplified45.9%
Taylor expanded in im around inf 26.4%
cube-mult26.4%
sub-neg26.4%
+-commutative26.4%
associate-+l+26.4%
unpow226.4%
associate-*r/26.4%
metadata-eval26.4%
unpow226.4%
*-commutative26.4%
metadata-eval26.4%
Simplified26.4%
Taylor expanded in re around 0 46.1%
unpow246.1%
Simplified46.1%
if 3.00000000000000017e55 < re Initial program 100.0%
Taylor expanded in re around 0 74.1%
distribute-rgt-in74.1%
*-commutative74.1%
associate-+r+74.1%
distribute-rgt1-in74.1%
*-commutative74.1%
*-commutative74.1%
associate-*l*74.1%
+-commutative74.1%
associate-*r*74.1%
distribute-rgt-out74.1%
associate-*l*81.0%
distribute-lft-out81.0%
Simplified81.0%
Taylor expanded in im around 0 62.4%
distribute-rgt-in62.4%
*-rgt-identity62.4%
distribute-lft-in62.4%
*-commutative62.4%
distribute-lft-in62.4%
unpow262.4%
associate-*l*62.4%
*-commutative62.4%
distribute-lft-in62.4%
distribute-rgt-in62.4%
*-commutative62.4%
Simplified62.4%
Taylor expanded in re around inf 62.4%
associate-*r*62.4%
*-commutative62.4%
cube-unmult62.4%
Simplified62.4%
Final simplification41.8%
(FPCore (re im) :precision binary64 (if (<= re 1.1e+55) (* im (+ 1.0 (* -0.16666666666666666 (* im im)))) (* (* re (* re re)) (* im 0.16666666666666666))))
double code(double re, double im) {
double tmp;
if (re <= 1.1e+55) {
tmp = im * (1.0 + (-0.16666666666666666 * (im * im)));
} else {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 1.1d+55) then
tmp = im * (1.0d0 + ((-0.16666666666666666d0) * (im * im)))
else
tmp = (re * (re * re)) * (im * 0.16666666666666666d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.1e+55) {
tmp = im * (1.0 + (-0.16666666666666666 * (im * im)));
} else {
tmp = (re * (re * re)) * (im * 0.16666666666666666);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.1e+55: tmp = im * (1.0 + (-0.16666666666666666 * (im * im))) else: tmp = (re * (re * re)) * (im * 0.16666666666666666) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.1e+55) tmp = Float64(im * Float64(1.0 + Float64(-0.16666666666666666 * Float64(im * im)))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * 0.16666666666666666)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.1e+55) tmp = im * (1.0 + (-0.16666666666666666 * (im * im))); else tmp = (re * (re * re)) * (im * 0.16666666666666666); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.1e+55], N[(im * N[(1.0 + N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.1 \cdot 10^{+55}:\\
\;\;\;\;im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot 0.16666666666666666\right)\\
\end{array}
\end{array}
if re < 1.10000000000000005e55Initial program 100.0%
Taylor expanded in im around 0 48.9%
associate-*r*48.9%
*-lft-identity48.9%
distribute-rgt-out54.9%
*-commutative54.9%
unpow254.9%
associate-*l*55.4%
Simplified55.4%
Taylor expanded in re around 0 29.8%
*-commutative29.8%
*-commutative29.8%
unpow229.8%
associate-*r*29.8%
*-commutative29.8%
distribute-lft-in29.8%
*-commutative29.8%
unpow229.8%
associate-*r*29.8%
distribute-lft-in29.8%
Simplified29.8%
Taylor expanded in im around inf 17.1%
cube-mult17.1%
sub-neg17.1%
+-commutative17.1%
associate-+l+17.1%
unpow217.1%
associate-*r/17.1%
metadata-eval17.1%
unpow217.1%
*-commutative17.1%
metadata-eval17.1%
Simplified17.1%
Taylor expanded in re around 0 30.8%
unpow230.8%
Simplified30.8%
if 1.10000000000000005e55 < re Initial program 100.0%
Taylor expanded in re around 0 74.1%
distribute-rgt-in74.1%
*-commutative74.1%
associate-+r+74.1%
distribute-rgt1-in74.1%
*-commutative74.1%
*-commutative74.1%
associate-*l*74.1%
+-commutative74.1%
associate-*r*74.1%
distribute-rgt-out74.1%
associate-*l*81.0%
distribute-lft-out81.0%
Simplified81.0%
Taylor expanded in im around 0 62.4%
distribute-rgt-in62.4%
*-rgt-identity62.4%
distribute-lft-in62.4%
*-commutative62.4%
distribute-lft-in62.4%
unpow262.4%
associate-*l*62.4%
*-commutative62.4%
distribute-lft-in62.4%
distribute-rgt-in62.4%
*-commutative62.4%
Simplified62.4%
Taylor expanded in re around inf 62.4%
associate-*r*62.4%
*-commutative62.4%
cube-unmult62.4%
Simplified62.4%
Final simplification37.5%
(FPCore (re im) :precision binary64 (* im (+ 1.0 (* -0.16666666666666666 (* im im)))))
double code(double re, double im) {
return im * (1.0 + (-0.16666666666666666 * (im * im)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = im * (1.0d0 + ((-0.16666666666666666d0) * (im * im)))
end function
public static double code(double re, double im) {
return im * (1.0 + (-0.16666666666666666 * (im * im)));
}
def code(re, im): return im * (1.0 + (-0.16666666666666666 * (im * im)))
function code(re, im) return Float64(im * Float64(1.0 + Float64(-0.16666666666666666 * Float64(im * im)))) end
function tmp = code(re, im) tmp = im * (1.0 + (-0.16666666666666666 * (im * im))); end
code[re_, im_] := N[(im * N[(1.0 + N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0 38.4%
associate-*r*38.4%
*-lft-identity38.4%
distribute-rgt-out58.7%
*-commutative58.7%
unpow258.7%
associate-*l*59.1%
Simplified59.1%
Taylor expanded in re around 0 34.9%
*-commutative34.9%
*-commutative34.9%
unpow234.9%
associate-*r*34.9%
*-commutative34.9%
distribute-lft-in34.9%
*-commutative34.9%
unpow234.9%
associate-*r*34.9%
distribute-lft-in34.9%
Simplified34.9%
Taylor expanded in im around inf 21.0%
cube-mult21.0%
sub-neg21.0%
+-commutative21.0%
associate-+l+21.0%
unpow221.0%
associate-*r/21.0%
metadata-eval21.0%
unpow221.0%
*-commutative21.0%
metadata-eval21.0%
Simplified21.0%
Taylor expanded in re around 0 28.8%
unpow228.8%
Simplified28.8%
(FPCore (re im) :precision binary64 (if (<= im 1.76e+68) im (* re im)))
double code(double re, double im) {
double tmp;
if (im <= 1.76e+68) {
tmp = im;
} else {
tmp = 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 <= 1.76d+68) then
tmp = im
else
tmp = re * im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.76e+68) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.76e+68: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (im <= 1.76e+68) tmp = im; else tmp = Float64(re * im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.76e+68) tmp = im; else tmp = re * im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.76e+68], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.76 \cdot 10^{+68}:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if im < 1.76e68Initial program 100.0%
Taylor expanded in im around 0 74.2%
Taylor expanded in re around 0 28.8%
if 1.76e68 < im Initial program 100.0%
Taylor expanded in im around 0 41.0%
Taylor expanded in re around 0 13.5%
*-commutative13.5%
Simplified13.5%
Taylor expanded in re around 0 9.8%
Taylor expanded in re around inf 11.1%
Final simplification25.4%
(FPCore (re im) :precision binary64 (+ im (* re im)))
double code(double re, double im) {
return im + (re * im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = im + (re * im)
end function
public static double code(double re, double im) {
return im + (re * im);
}
def code(re, im): return im + (re * im)
function code(re, im) return Float64(im + Float64(re * im)) end
function tmp = code(re, im) tmp = im + (re * im); end
code[re_, im_] := N[(im + N[(re * im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
im + re \cdot im
\end{array}
Initial program 100.0%
Taylor expanded in im around 0 67.7%
Taylor expanded in re around 0 26.5%
Final simplification26.5%
(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 im end
function tmp = code(re, im) tmp = im; end
code[re_, im_] := im
\begin{array}{l}
\\
im
\end{array}
Initial program 100.0%
Taylor expanded in im around 0 67.7%
Taylor expanded in re around 0 23.6%
herbie shell --seed 2024107
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))