
(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 15 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
(let* ((t_0 (* (exp re) im))
(t_1
(*
(sin im)
(+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666)))))))))
(if (<= re -0.0275)
t_0
(if (<= re 550000000.0) t_1 (if (<= re 1.05e+103) t_0 t_1)))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double t_1 = sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
double tmp;
if (re <= -0.0275) {
tmp = t_0;
} else if (re <= 550000000.0) {
tmp = t_1;
} else if (re <= 1.05e+103) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(re) * im
t_1 = sin(im) * (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0))))))
if (re <= (-0.0275d0)) then
tmp = t_0
else if (re <= 550000000.0d0) then
tmp = t_1
else if (re <= 1.05d+103) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double t_1 = Math.sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
double tmp;
if (re <= -0.0275) {
tmp = t_0;
} else if (re <= 550000000.0) {
tmp = t_1;
} else if (re <= 1.05e+103) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im t_1 = math.sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) tmp = 0 if re <= -0.0275: tmp = t_0 elif re <= 550000000.0: tmp = t_1 elif re <= 1.05e+103: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(exp(re) * im) t_1 = Float64(sin(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))))))) tmp = 0.0 if (re <= -0.0275) tmp = t_0; elseif (re <= 550000000.0) tmp = t_1; elseif (re <= 1.05e+103) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; t_1 = sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))); tmp = 0.0; if (re <= -0.0275) tmp = t_0; elseif (re <= 550000000.0) tmp = t_1; elseif (re <= 1.05e+103) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.0275], t$95$0, If[LessEqual[re, 550000000.0], t$95$1, If[LessEqual[re, 1.05e+103], t$95$0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
t_1 := \sin im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)\\
\mathbf{if}\;re \leq -0.0275:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 550000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;re \leq 1.05 \cdot 10^{+103}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if re < -0.0275000000000000001 or 5.5e8 < re < 1.0500000000000001e103Initial program 100.0%
Taylor expanded in im around 0
Simplified96.1%
if -0.0275000000000000001 < re < 5.5e8 or 1.0500000000000001e103 < re Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Simplified99.4%
Final simplification98.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -0.0275)
t_0
(if (<= re 550000000.0)
(* (sin im) (+ 1.0 (* re (+ 1.0 (* re 0.5)))))
t_0))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.0275) {
tmp = t_0;
} else if (re <= 550000000.0) {
tmp = sin(im) * (1.0 + (re * (1.0 + (re * 0.5))));
} 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 = exp(re) * im
if (re <= (-0.0275d0)) then
tmp = t_0
else if (re <= 550000000.0d0) then
tmp = sin(im) * (1.0d0 + (re * (1.0d0 + (re * 0.5d0))))
else
tmp = t_0
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.0275) {
tmp = t_0;
} else if (re <= 550000000.0) {
tmp = Math.sin(im) * (1.0 + (re * (1.0 + (re * 0.5))));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.0275: tmp = t_0 elif re <= 550000000.0: tmp = math.sin(im) * (1.0 + (re * (1.0 + (re * 0.5)))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -0.0275) tmp = t_0; elseif (re <= 550000000.0) tmp = Float64(sin(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5))))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -0.0275) tmp = t_0; elseif (re <= 550000000.0) tmp = sin(im) * (1.0 + (re * (1.0 + (re * 0.5)))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.0275], t$95$0, If[LessEqual[re, 550000000.0], N[(N[Sin[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.0275:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 550000000:\\
\;\;\;\;\sin im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.0275000000000000001 or 5.5e8 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified93.0%
if -0.0275000000000000001 < re < 5.5e8Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.1%
Simplified99.1%
Final simplification96.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -0.00105)
t_0
(if (<= re 550000000.0) (* (sin im) (+ re 1.0)) t_0))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.00105) {
tmp = t_0;
} else if (re <= 550000000.0) {
tmp = sin(im) * (re + 1.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 = exp(re) * im
if (re <= (-0.00105d0)) then
tmp = t_0
else if (re <= 550000000.0d0) then
tmp = sin(im) * (re + 1.0d0)
else
tmp = t_0
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.00105) {
tmp = t_0;
} else if (re <= 550000000.0) {
tmp = Math.sin(im) * (re + 1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.00105: tmp = t_0 elif re <= 550000000.0: tmp = math.sin(im) * (re + 1.0) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -0.00105) tmp = t_0; elseif (re <= 550000000.0) tmp = Float64(sin(im) * Float64(re + 1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -0.00105) tmp = t_0; elseif (re <= 550000000.0) tmp = sin(im) * (re + 1.0); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.00105], t$95$0, If[LessEqual[re, 550000000.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.00105:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 550000000:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.00104999999999999994 or 5.5e8 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified93.0%
if -0.00104999999999999994 < re < 5.5e8Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6498.9%
Simplified98.9%
Final simplification96.3%
(FPCore (re im) :precision binary64 (let* ((t_0 (* (exp re) im))) (if (<= re -2.25e-9) t_0 (if (<= re 550000000.0) (sin im) t_0))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -2.25e-9) {
tmp = t_0;
} else if (re <= 550000000.0) {
tmp = sin(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 = exp(re) * im
if (re <= (-2.25d-9)) then
tmp = t_0
else if (re <= 550000000.0d0) then
tmp = sin(im)
else
tmp = t_0
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 <= -2.25e-9) {
tmp = t_0;
} else if (re <= 550000000.0) {
tmp = Math.sin(im);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -2.25e-9: tmp = t_0 elif re <= 550000000.0: tmp = math.sin(im) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -2.25e-9) tmp = t_0; elseif (re <= 550000000.0) tmp = sin(im); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -2.25e-9) tmp = t_0; elseif (re <= 550000000.0) tmp = sin(im); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -2.25e-9], t$95$0, If[LessEqual[re, 550000000.0], N[Sin[im], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -2.25 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 550000000:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -2.24999999999999988e-9 or 5.5e8 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified93.0%
if -2.24999999999999988e-9 < re < 5.5e8Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6498.4%
Simplified98.4%
(FPCore (re im)
:precision binary64
(if (<= re -105.0)
(* im (* 0.008333333333333333 (* (* im im) (* im im))))
(if (<= re 62000000000.0)
(sin im)
(* im (* re (* 0.16666666666666666 (* re re)))))))
double code(double re, double im) {
double tmp;
if (re <= -105.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 62000000000.0) {
tmp = sin(im);
} else {
tmp = im * (re * (0.16666666666666666 * (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 <= (-105.0d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else if (re <= 62000000000.0d0) then
tmp = sin(im)
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -105.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 62000000000.0) {
tmp = Math.sin(im);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -105.0: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) elif re <= 62000000000.0: tmp = math.sin(im) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= -105.0) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); elseif (re <= 62000000000.0) tmp = sin(im); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -105.0) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); elseif (re <= 62000000000.0) tmp = sin(im); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -105.0], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 62000000000.0], N[Sin[im], $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -105:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;re \leq 62000000000:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -105Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.5%
Simplified4.5%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.9%
Simplified3.9%
Taylor expanded in im around inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.7%
Simplified48.7%
if -105 < re < 6.2e10Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6498.4%
Simplified98.4%
if 6.2e10 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified84.9%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6470.7%
Simplified70.7%
Taylor expanded in re around inf
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.7%
Simplified70.7%
Final simplification80.6%
(FPCore (re im)
:precision binary64
(if (<= re -98.0)
(* im (* 0.008333333333333333 (* (* im im) (* im im))))
(if (<= re 9e+41)
(*
im
(+
1.0
(*
im
(* im (+ -0.16666666666666666 (* 0.008333333333333333 (* im im)))))))
(* im (* re (* 0.16666666666666666 (* re re)))))))
double code(double re, double im) {
double tmp;
if (re <= -98.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 9e+41) {
tmp = im * (1.0 + (im * (im * (-0.16666666666666666 + (0.008333333333333333 * (im * im))))));
} else {
tmp = im * (re * (0.16666666666666666 * (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 <= (-98.0d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else if (re <= 9d+41) then
tmp = im * (1.0d0 + (im * (im * ((-0.16666666666666666d0) + (0.008333333333333333d0 * (im * im))))))
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -98.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 9e+41) {
tmp = im * (1.0 + (im * (im * (-0.16666666666666666 + (0.008333333333333333 * (im * im))))));
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -98.0: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) elif re <= 9e+41: tmp = im * (1.0 + (im * (im * (-0.16666666666666666 + (0.008333333333333333 * (im * im)))))) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= -98.0) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); elseif (re <= 9e+41) tmp = Float64(im * Float64(1.0 + Float64(im * Float64(im * Float64(-0.16666666666666666 + Float64(0.008333333333333333 * Float64(im * im))))))); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -98.0) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); elseif (re <= 9e+41) tmp = im * (1.0 + (im * (im * (-0.16666666666666666 + (0.008333333333333333 * (im * im)))))); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -98.0], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 9e+41], N[(im * N[(1.0 + N[(im * N[(im * N[(-0.16666666666666666 + N[(0.008333333333333333 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -98:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;re \leq 9 \cdot 10^{+41}:\\
\;\;\;\;im \cdot \left(1 + im \cdot \left(im \cdot \left(-0.16666666666666666 + 0.008333333333333333 \cdot \left(im \cdot im\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -98Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.5%
Simplified4.5%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.9%
Simplified3.9%
Taylor expanded in im around inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.7%
Simplified48.7%
if -98 < re < 9.0000000000000002e41Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6494.5%
Simplified94.5%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.6%
Simplified52.6%
if 9.0000000000000002e41 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified85.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6479.0%
Simplified79.0%
Taylor expanded in re around inf
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.0%
Simplified79.0%
Final simplification56.5%
(FPCore (re im)
:precision binary64
(if (<= re -53.0)
(* im (* 0.008333333333333333 (* (* im im) (* im im))))
(if (<= re 3.7e-9)
(* im (+ 1.0 (* re (+ 1.0 (* re 0.5)))))
(* im (* re (* 0.16666666666666666 (* re re)))))))
double code(double re, double im) {
double tmp;
if (re <= -53.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 3.7e-9) {
tmp = im * (1.0 + (re * (1.0 + (re * 0.5))));
} else {
tmp = im * (re * (0.16666666666666666 * (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 <= (-53.0d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else if (re <= 3.7d-9) then
tmp = im * (1.0d0 + (re * (1.0d0 + (re * 0.5d0))))
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -53.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 3.7e-9) {
tmp = im * (1.0 + (re * (1.0 + (re * 0.5))));
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -53.0: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) elif re <= 3.7e-9: tmp = im * (1.0 + (re * (1.0 + (re * 0.5)))) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= -53.0) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); elseif (re <= 3.7e-9) tmp = Float64(im * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5))))); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -53.0) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); elseif (re <= 3.7e-9) tmp = im * (1.0 + (re * (1.0 + (re * 0.5)))); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -53.0], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 3.7e-9], N[(im * N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -53:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;re \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -53Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.5%
Simplified4.5%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.9%
Simplified3.9%
Taylor expanded in im around inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.7%
Simplified48.7%
if -53 < re < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
Simplified54.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6454.0%
Simplified54.0%
if 3.7e-9 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified80.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6467.0%
Simplified67.0%
Taylor expanded in re around inf
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
Final simplification55.6%
(FPCore (re im) :precision binary64 (if (<= re -1.65) (* im (* 0.008333333333333333 (* (* im im) (* im im)))) (* im (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666)))))))))
double code(double re, double im) {
double tmp;
if (re <= -1.65) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else {
tmp = im * (1.0 + (re * (1.0 + (re * (0.5 + (re * 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.65d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else
tmp = im * (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -1.65) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else {
tmp = im * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -1.65: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) else: tmp = im * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) return tmp
function code(re, im) tmp = 0.0 if (re <= -1.65) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); else tmp = Float64(im * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -1.65) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); else tmp = im * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -1.65], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -1.65:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if re < -1.6499999999999999Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.5%
Simplified4.5%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.9%
Simplified3.9%
Taylor expanded in im around inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.7%
Simplified48.7%
if -1.6499999999999999 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified61.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6457.8%
Simplified57.8%
Final simplification55.6%
(FPCore (re im)
:precision binary64
(if (<= re -1.18)
(* im (* 0.008333333333333333 (* (* im im) (* im im))))
(if (<= re 3.7e-9)
(* im (+ re 1.0))
(* im (* re (* 0.16666666666666666 (* re re)))))))
double code(double re, double im) {
double tmp;
if (re <= -1.18) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 3.7e-9) {
tmp = im * (re + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (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 <= (-1.18d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else if (re <= 3.7d-9) then
tmp = im * (re + 1.0d0)
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -1.18) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 3.7e-9) {
tmp = im * (re + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -1.18: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) elif re <= 3.7e-9: tmp = im * (re + 1.0) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= -1.18) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); elseif (re <= 3.7e-9) tmp = Float64(im * Float64(re + 1.0)); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -1.18) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); elseif (re <= 3.7e-9) tmp = im * (re + 1.0); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -1.18], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 3.7e-9], N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -1.18:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;re \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -1.17999999999999994Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.5%
Simplified4.5%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.9%
Simplified3.9%
Taylor expanded in im around inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.7%
Simplified48.7%
if -1.17999999999999994 < re < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
Simplified54.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6454.0%
Simplified54.0%
if 3.7e-9 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified80.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6467.0%
Simplified67.0%
Taylor expanded in re around inf
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
Final simplification55.6%
(FPCore (re im)
:precision binary64
(if (<= re -5.2)
(* im (* im (* im -0.16666666666666666)))
(if (<= re 3.7e-9)
(* im (+ re 1.0))
(* im (* re (* 0.16666666666666666 (* re re)))))))
double code(double re, double im) {
double tmp;
if (re <= -5.2) {
tmp = im * (im * (im * -0.16666666666666666));
} else if (re <= 3.7e-9) {
tmp = im * (re + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (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 <= (-5.2d0)) then
tmp = im * (im * (im * (-0.16666666666666666d0)))
else if (re <= 3.7d-9) then
tmp = im * (re + 1.0d0)
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -5.2) {
tmp = im * (im * (im * -0.16666666666666666));
} else if (re <= 3.7e-9) {
tmp = im * (re + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -5.2: tmp = im * (im * (im * -0.16666666666666666)) elif re <= 3.7e-9: tmp = im * (re + 1.0) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= -5.2) tmp = Float64(im * Float64(im * Float64(im * -0.16666666666666666))); elseif (re <= 3.7e-9) tmp = Float64(im * Float64(re + 1.0)); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -5.2) tmp = im * (im * (im * -0.16666666666666666)); elseif (re <= 3.7e-9) tmp = im * (re + 1.0); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -5.2], N[(im * N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 3.7e-9], N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -5.2:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\\
\mathbf{elif}\;re \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -5.20000000000000018Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Taylor expanded in re around 0
Simplified4.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6436.2%
Simplified36.2%
if -5.20000000000000018 < re < 3.7e-9Initial program 100.0%
Taylor expanded in im around 0
Simplified54.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6454.0%
Simplified54.0%
if 3.7e-9 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified80.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6467.0%
Simplified67.0%
Taylor expanded in re around inf
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
Final simplification52.6%
(FPCore (re im) :precision binary64 (if (<= re -31.0) (* im (* im (* im -0.16666666666666666))) (* im (+ re 1.0))))
double code(double re, double im) {
double tmp;
if (re <= -31.0) {
tmp = im * (im * (im * -0.16666666666666666));
} else {
tmp = im * (re + 1.0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-31.0d0)) then
tmp = im * (im * (im * (-0.16666666666666666d0)))
else
tmp = im * (re + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -31.0) {
tmp = im * (im * (im * -0.16666666666666666));
} else {
tmp = im * (re + 1.0);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -31.0: tmp = im * (im * (im * -0.16666666666666666)) else: tmp = im * (re + 1.0) return tmp
function code(re, im) tmp = 0.0 if (re <= -31.0) tmp = Float64(im * Float64(im * Float64(im * -0.16666666666666666))); else tmp = Float64(im * Float64(re + 1.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -31.0) tmp = im * (im * (im * -0.16666666666666666)); else tmp = im * (re + 1.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -31.0], N[(im * N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -31:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re + 1\right)\\
\end{array}
\end{array}
if re < -31Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Taylor expanded in re around 0
Simplified4.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6436.2%
Simplified36.2%
if -31 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified61.7%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6443.4%
Simplified43.4%
Final simplification41.7%
(FPCore (re im) :precision binary64 (if (<= im 480000.0) im (* re im)))
double code(double re, double im) {
double tmp;
if (im <= 480000.0) {
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 <= 480000.0d0) 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 <= 480000.0) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 480000.0: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (im <= 480000.0) tmp = im; else tmp = Float64(re * im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 480000.0) tmp = im; else tmp = re * im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 480000.0], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 480000:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if im < 4.8e5Initial program 100.0%
Taylor expanded in im around 0
Simplified77.0%
Taylor expanded in re around 0
Simplified38.2%
if 4.8e5 < im Initial program 100.0%
Taylor expanded in im around 0
Simplified48.8%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6415.4%
Simplified15.4%
Taylor expanded in re around inf
Simplified16.1%
(FPCore (re im) :precision binary64 (* im (+ re 1.0)))
double code(double re, double im) {
return im * (re + 1.0);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = im * (re + 1.0d0)
end function
public static double code(double re, double im) {
return im * (re + 1.0);
}
def code(re, im): return im * (re + 1.0)
function code(re, im) return Float64(im * Float64(re + 1.0)) end
function tmp = code(re, im) tmp = im * (re + 1.0); end
code[re_, im_] := N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
im \cdot \left(re + 1\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
Simplified70.9%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6433.6%
Simplified33.6%
Final simplification33.6%
(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
Simplified70.9%
Taylor expanded in re around 0
Simplified30.7%
herbie shell --seed 2024186
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))