
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
Initial program 100.0%
(FPCore (re im) :precision binary64 (if (<= (exp re) 0.9998) (exp re) (if (<= (exp re) 2.0) (* (cos im) (+ re 1.0)) (exp re))))
double code(double re, double im) {
double tmp;
if (exp(re) <= 0.9998) {
tmp = exp(re);
} else if (exp(re) <= 2.0) {
tmp = cos(im) * (re + 1.0);
} else {
tmp = exp(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (exp(re) <= 0.9998d0) then
tmp = exp(re)
else if (exp(re) <= 2.0d0) then
tmp = cos(im) * (re + 1.0d0)
else
tmp = exp(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.exp(re) <= 0.9998) {
tmp = Math.exp(re);
} else if (Math.exp(re) <= 2.0) {
tmp = Math.cos(im) * (re + 1.0);
} else {
tmp = Math.exp(re);
}
return tmp;
}
def code(re, im): tmp = 0 if math.exp(re) <= 0.9998: tmp = math.exp(re) elif math.exp(re) <= 2.0: tmp = math.cos(im) * (re + 1.0) else: tmp = math.exp(re) return tmp
function code(re, im) tmp = 0.0 if (exp(re) <= 0.9998) tmp = exp(re); elseif (exp(re) <= 2.0) tmp = Float64(cos(im) * Float64(re + 1.0)); else tmp = exp(re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (exp(re) <= 0.9998) tmp = exp(re); elseif (exp(re) <= 2.0) tmp = cos(im) * (re + 1.0); else tmp = exp(re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Exp[re], $MachinePrecision], 0.9998], N[Exp[re], $MachinePrecision], If[LessEqual[N[Exp[re], $MachinePrecision], 2.0], N[(N[Cos[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[Exp[re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0.9998:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;e^{re} \leq 2:\\
\;\;\;\;\cos im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{re}\\
\end{array}
\end{array}
if (exp.f64 re) < 0.99980000000000002 or 2 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6483.4%
Simplified83.4%
if 0.99980000000000002 < (exp.f64 re) < 2Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6499.8%
Simplified99.8%
Final simplification91.8%
(FPCore (re im) :precision binary64 (if (<= (exp re) 0.9998) (exp re) (if (<= (exp re) 2.0) (cos im) (exp re))))
double code(double re, double im) {
double tmp;
if (exp(re) <= 0.9998) {
tmp = exp(re);
} else if (exp(re) <= 2.0) {
tmp = cos(im);
} else {
tmp = exp(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (exp(re) <= 0.9998d0) then
tmp = exp(re)
else if (exp(re) <= 2.0d0) then
tmp = cos(im)
else
tmp = exp(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.exp(re) <= 0.9998) {
tmp = Math.exp(re);
} else if (Math.exp(re) <= 2.0) {
tmp = Math.cos(im);
} else {
tmp = Math.exp(re);
}
return tmp;
}
def code(re, im): tmp = 0 if math.exp(re) <= 0.9998: tmp = math.exp(re) elif math.exp(re) <= 2.0: tmp = math.cos(im) else: tmp = math.exp(re) return tmp
function code(re, im) tmp = 0.0 if (exp(re) <= 0.9998) tmp = exp(re); elseif (exp(re) <= 2.0) tmp = cos(im); else tmp = exp(re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (exp(re) <= 0.9998) tmp = exp(re); elseif (exp(re) <= 2.0) tmp = cos(im); else tmp = exp(re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Exp[re], $MachinePrecision], 0.9998], N[Exp[re], $MachinePrecision], If[LessEqual[N[Exp[re], $MachinePrecision], 2.0], N[Cos[im], $MachinePrecision], N[Exp[re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0.9998:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;e^{re} \leq 2:\\
\;\;\;\;\cos im\\
\mathbf{else}:\\
\;\;\;\;e^{re}\\
\end{array}
\end{array}
if (exp.f64 re) < 0.99980000000000002 or 2 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6483.4%
Simplified83.4%
if 0.99980000000000002 < (exp.f64 re) < 2Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f6499.1%
Simplified99.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (cos im) (+ 1.0 (* re (+ 1.0 (* re 0.5)))))))
(if (<= re -0.00039)
(exp re)
(if (<= re 57.0)
t_0
(if (<= re 5e+152) (* (exp re) (+ 1.0 (* -0.5 (* im im)))) t_0)))))
double code(double re, double im) {
double t_0 = cos(im) * (1.0 + (re * (1.0 + (re * 0.5))));
double tmp;
if (re <= -0.00039) {
tmp = exp(re);
} else if (re <= 57.0) {
tmp = t_0;
} else if (re <= 5e+152) {
tmp = exp(re) * (1.0 + (-0.5 * (im * 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 = cos(im) * (1.0d0 + (re * (1.0d0 + (re * 0.5d0))))
if (re <= (-0.00039d0)) then
tmp = exp(re)
else if (re <= 57.0d0) then
tmp = t_0
else if (re <= 5d+152) then
tmp = exp(re) * (1.0d0 + ((-0.5d0) * (im * im)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.cos(im) * (1.0 + (re * (1.0 + (re * 0.5))));
double tmp;
if (re <= -0.00039) {
tmp = Math.exp(re);
} else if (re <= 57.0) {
tmp = t_0;
} else if (re <= 5e+152) {
tmp = Math.exp(re) * (1.0 + (-0.5 * (im * im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.cos(im) * (1.0 + (re * (1.0 + (re * 0.5)))) tmp = 0 if re <= -0.00039: tmp = math.exp(re) elif re <= 57.0: tmp = t_0 elif re <= 5e+152: tmp = math.exp(re) * (1.0 + (-0.5 * (im * im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(cos(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5))))) tmp = 0.0 if (re <= -0.00039) tmp = exp(re); elseif (re <= 57.0) tmp = t_0; elseif (re <= 5e+152) tmp = Float64(exp(re) * Float64(1.0 + Float64(-0.5 * Float64(im * im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = cos(im) * (1.0 + (re * (1.0 + (re * 0.5)))); tmp = 0.0; if (re <= -0.00039) tmp = exp(re); elseif (re <= 57.0) tmp = t_0; elseif (re <= 5e+152) tmp = exp(re) * (1.0 + (-0.5 * (im * im))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Cos[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.00039], N[Exp[re], $MachinePrecision], If[LessEqual[re, 57.0], t$95$0, If[LessEqual[re, 5e+152], N[(N[Exp[re], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\
\mathbf{if}\;re \leq -0.00039:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;re \leq 57:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 5 \cdot 10^{+152}:\\
\;\;\;\;e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -3.89999999999999993e-4Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f64100.0%
Simplified100.0%
if -3.89999999999999993e-4 < re < 57 or 5e152 < re Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.9%
Simplified98.9%
if 57 < re < 5e152Initial program 100.0%
Taylor expanded in im around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.6%
Simplified78.6%
Final simplification97.0%
(FPCore (re im)
:precision binary64
(if (<= re -0.000116)
(exp re)
(if (<= re 57.0)
(* (cos im) (+ re 1.0))
(* (exp re) (+ 1.0 (* -0.5 (* im im)))))))
double code(double re, double im) {
double tmp;
if (re <= -0.000116) {
tmp = exp(re);
} else if (re <= 57.0) {
tmp = cos(im) * (re + 1.0);
} else {
tmp = exp(re) * (1.0 + (-0.5 * (im * im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.000116d0)) then
tmp = exp(re)
else if (re <= 57.0d0) then
tmp = cos(im) * (re + 1.0d0)
else
tmp = exp(re) * (1.0d0 + ((-0.5d0) * (im * im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.000116) {
tmp = Math.exp(re);
} else if (re <= 57.0) {
tmp = Math.cos(im) * (re + 1.0);
} else {
tmp = Math.exp(re) * (1.0 + (-0.5 * (im * im)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.000116: tmp = math.exp(re) elif re <= 57.0: tmp = math.cos(im) * (re + 1.0) else: tmp = math.exp(re) * (1.0 + (-0.5 * (im * im))) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.000116) tmp = exp(re); elseif (re <= 57.0) tmp = Float64(cos(im) * Float64(re + 1.0)); else tmp = Float64(exp(re) * Float64(1.0 + Float64(-0.5 * Float64(im * im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.000116) tmp = exp(re); elseif (re <= 57.0) tmp = cos(im) * (re + 1.0); else tmp = exp(re) * (1.0 + (-0.5 * (im * im))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.000116], N[Exp[re], $MachinePrecision], If[LessEqual[re, 57.0], N[(N[Cos[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Exp[re], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.000116:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;re \leq 57:\\
\;\;\;\;\cos im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if re < -1.16e-4Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f64100.0%
Simplified100.0%
if -1.16e-4 < re < 57Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6499.1%
Simplified99.1%
if 57 < re Initial program 100.0%
Taylor expanded in im around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.6%
Simplified72.6%
Final simplification92.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.5 (* im im))))
(if (<= re -550.0)
t_0
(if (<= re 240.0)
(cos im)
(*
(+ 1.0 t_0)
(+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666)))))))))))
double code(double re, double im) {
double t_0 = -0.5 * (im * im);
double tmp;
if (re <= -550.0) {
tmp = t_0;
} else if (re <= 240.0) {
tmp = cos(im);
} else {
tmp = (1.0 + t_0) * (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) :: t_0
real(8) :: tmp
t_0 = (-0.5d0) * (im * im)
if (re <= (-550.0d0)) then
tmp = t_0
else if (re <= 240.0d0) then
tmp = cos(im)
else
tmp = (1.0d0 + t_0) * (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 t_0 = -0.5 * (im * im);
double tmp;
if (re <= -550.0) {
tmp = t_0;
} else if (re <= 240.0) {
tmp = Math.cos(im);
} else {
tmp = (1.0 + t_0) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
}
return tmp;
}
def code(re, im): t_0 = -0.5 * (im * im) tmp = 0 if re <= -550.0: tmp = t_0 elif re <= 240.0: tmp = math.cos(im) else: tmp = (1.0 + t_0) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) return tmp
function code(re, im) t_0 = Float64(-0.5 * Float64(im * im)) tmp = 0.0 if (re <= -550.0) tmp = t_0; elseif (re <= 240.0) tmp = cos(im); else tmp = Float64(Float64(1.0 + t_0) * 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) t_0 = -0.5 * (im * im); tmp = 0.0; if (re <= -550.0) tmp = t_0; elseif (re <= 240.0) tmp = cos(im); else tmp = (1.0 + t_0) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -550.0], t$95$0, If[LessEqual[re, 240.0], N[Cos[im], $MachinePrecision], N[(N[(1.0 + t$95$0), $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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;re \leq -550:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 240:\\
\;\;\;\;\cos im\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t\_0\right) \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 < -550Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -550 < re < 240Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f6497.9%
Simplified97.9%
if 240 < re Initial program 100.0%
Taylor expanded in im around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.6%
Simplified72.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6460.5%
Simplified60.5%
Final simplification72.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* re (+ 0.5 (* re 0.16666666666666666)))))
(if (<= re -175.0)
(* -0.5 (* im im))
(if (<= re 2e+88)
(+
1.0
(/
(* re (+ 1.0 (* t_0 (* re (+ -0.5 (* re -0.16666666666666666))))))
(- 1.0 t_0)))
(*
(* re (* re re))
(+ 0.16666666666666666 (* (* im im) -0.08333333333333333)))))))
double code(double re, double im) {
double t_0 = re * (0.5 + (re * 0.16666666666666666));
double tmp;
if (re <= -175.0) {
tmp = -0.5 * (im * im);
} else if (re <= 2e+88) {
tmp = 1.0 + ((re * (1.0 + (t_0 * (re * (-0.5 + (re * -0.16666666666666666)))))) / (1.0 - t_0));
} else {
tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = re * (0.5d0 + (re * 0.16666666666666666d0))
if (re <= (-175.0d0)) then
tmp = (-0.5d0) * (im * im)
else if (re <= 2d+88) then
tmp = 1.0d0 + ((re * (1.0d0 + (t_0 * (re * ((-0.5d0) + (re * (-0.16666666666666666d0))))))) / (1.0d0 - t_0))
else
tmp = (re * (re * re)) * (0.16666666666666666d0 + ((im * im) * (-0.08333333333333333d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = re * (0.5 + (re * 0.16666666666666666));
double tmp;
if (re <= -175.0) {
tmp = -0.5 * (im * im);
} else if (re <= 2e+88) {
tmp = 1.0 + ((re * (1.0 + (t_0 * (re * (-0.5 + (re * -0.16666666666666666)))))) / (1.0 - t_0));
} else {
tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
}
return tmp;
}
def code(re, im): t_0 = re * (0.5 + (re * 0.16666666666666666)) tmp = 0 if re <= -175.0: tmp = -0.5 * (im * im) elif re <= 2e+88: tmp = 1.0 + ((re * (1.0 + (t_0 * (re * (-0.5 + (re * -0.16666666666666666)))))) / (1.0 - t_0)) else: tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333)) return tmp
function code(re, im) t_0 = Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) tmp = 0.0 if (re <= -175.0) tmp = Float64(-0.5 * Float64(im * im)); elseif (re <= 2e+88) tmp = Float64(1.0 + Float64(Float64(re * Float64(1.0 + Float64(t_0 * Float64(re * Float64(-0.5 + Float64(re * -0.16666666666666666)))))) / Float64(1.0 - t_0))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(0.16666666666666666 + Float64(Float64(im * im) * -0.08333333333333333))); end return tmp end
function tmp_2 = code(re, im) t_0 = re * (0.5 + (re * 0.16666666666666666)); tmp = 0.0; if (re <= -175.0) tmp = -0.5 * (im * im); elseif (re <= 2e+88) tmp = 1.0 + ((re * (1.0 + (t_0 * (re * (-0.5 + (re * -0.16666666666666666)))))) / (1.0 - t_0)); else tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -175.0], N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2e+88], N[(1.0 + N[(N[(re * N[(1.0 + N[(t$95$0 * N[(re * N[(-0.5 + N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\\
\mathbf{if}\;re \leq -175:\\
\;\;\;\;-0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 2 \cdot 10^{+88}:\\
\;\;\;\;1 + \frac{re \cdot \left(1 + t\_0 \cdot \left(re \cdot \left(-0.5 + re \cdot -0.16666666666666666\right)\right)\right)}{1 - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\
\end{array}
\end{array}
if re < -175Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -175 < re < 1.99999999999999992e88Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6454.9%
Simplified54.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-*.f6448.3%
Simplified48.3%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr51.5%
if 1.99999999999999992e88 < re Initial program 100.0%
Taylor expanded in im around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.5%
Simplified73.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-*.f6469.8%
Simplified69.8%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-eval69.8%
Simplified69.8%
Final simplification49.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.5 (* im im))))
(if (<= re -450.0)
t_0
(if (<= re 3.8e-14)
(+
1.0
(*
re
(+
1.0
(/
(* re (* re -0.25))
(- (* re (* re 0.16666666666666666)) (/ re 2.0))))))
(*
(+ 1.0 t_0)
(+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666)))))))))))
double code(double re, double im) {
double t_0 = -0.5 * (im * im);
double tmp;
if (re <= -450.0) {
tmp = t_0;
} else if (re <= 3.8e-14) {
tmp = 1.0 + (re * (1.0 + ((re * (re * -0.25)) / ((re * (re * 0.16666666666666666)) - (re / 2.0)))));
} else {
tmp = (1.0 + t_0) * (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) :: t_0
real(8) :: tmp
t_0 = (-0.5d0) * (im * im)
if (re <= (-450.0d0)) then
tmp = t_0
else if (re <= 3.8d-14) then
tmp = 1.0d0 + (re * (1.0d0 + ((re * (re * (-0.25d0))) / ((re * (re * 0.16666666666666666d0)) - (re / 2.0d0)))))
else
tmp = (1.0d0 + t_0) * (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 t_0 = -0.5 * (im * im);
double tmp;
if (re <= -450.0) {
tmp = t_0;
} else if (re <= 3.8e-14) {
tmp = 1.0 + (re * (1.0 + ((re * (re * -0.25)) / ((re * (re * 0.16666666666666666)) - (re / 2.0)))));
} else {
tmp = (1.0 + t_0) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
}
return tmp;
}
def code(re, im): t_0 = -0.5 * (im * im) tmp = 0 if re <= -450.0: tmp = t_0 elif re <= 3.8e-14: tmp = 1.0 + (re * (1.0 + ((re * (re * -0.25)) / ((re * (re * 0.16666666666666666)) - (re / 2.0))))) else: tmp = (1.0 + t_0) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) return tmp
function code(re, im) t_0 = Float64(-0.5 * Float64(im * im)) tmp = 0.0 if (re <= -450.0) tmp = t_0; elseif (re <= 3.8e-14) tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(Float64(re * Float64(re * -0.25)) / Float64(Float64(re * Float64(re * 0.16666666666666666)) - Float64(re / 2.0)))))); else tmp = Float64(Float64(1.0 + t_0) * 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) t_0 = -0.5 * (im * im); tmp = 0.0; if (re <= -450.0) tmp = t_0; elseif (re <= 3.8e-14) tmp = 1.0 + (re * (1.0 + ((re * (re * -0.25)) / ((re * (re * 0.16666666666666666)) - (re / 2.0))))); else tmp = (1.0 + t_0) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -450.0], t$95$0, If[LessEqual[re, 3.8e-14], N[(1.0 + N[(re * N[(1.0 + N[(N[(re * N[(re * -0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] - N[(re / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$0), $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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;re \leq -450:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 3.8 \cdot 10^{-14}:\\
\;\;\;\;1 + re \cdot \left(1 + \frac{re \cdot \left(re \cdot -0.25\right)}{re \cdot \left(re \cdot 0.16666666666666666\right) - \frac{re}{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t\_0\right) \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 < -450Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -450 < re < 3.8000000000000002e-14Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6453.1%
Simplified53.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-*.f6453.1%
Simplified53.1%
+-commutativeN/A
distribute-lft-inN/A
flip-+N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
div-invN/A
Applied egg-rr53.1%
Taylor expanded in re around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6453.1%
Simplified53.1%
if 3.8000000000000002e-14 < re Initial program 100.0%
Taylor expanded in im around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.8%
Simplified70.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6459.2%
Simplified59.2%
Final simplification48.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.5 (* im im)))
(t_1 (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))))
(if (<= re -590.0) t_0 (if (<= re 4.5e-14) t_1 (* (+ 1.0 t_0) t_1)))))
double code(double re, double im) {
double t_0 = -0.5 * (im * im);
double t_1 = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
double tmp;
if (re <= -590.0) {
tmp = t_0;
} else if (re <= 4.5e-14) {
tmp = t_1;
} else {
tmp = (1.0 + t_0) * t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-0.5d0) * (im * im)
t_1 = 1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))
if (re <= (-590.0d0)) then
tmp = t_0
else if (re <= 4.5d-14) then
tmp = t_1
else
tmp = (1.0d0 + t_0) * t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = -0.5 * (im * im);
double t_1 = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
double tmp;
if (re <= -590.0) {
tmp = t_0;
} else if (re <= 4.5e-14) {
tmp = t_1;
} else {
tmp = (1.0 + t_0) * t_1;
}
return tmp;
}
def code(re, im): t_0 = -0.5 * (im * im) t_1 = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))) tmp = 0 if re <= -590.0: tmp = t_0 elif re <= 4.5e-14: tmp = t_1 else: tmp = (1.0 + t_0) * t_1 return tmp
function code(re, im) t_0 = Float64(-0.5 * Float64(im * im)) t_1 = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))))) tmp = 0.0 if (re <= -590.0) tmp = t_0; elseif (re <= 4.5e-14) tmp = t_1; else tmp = Float64(Float64(1.0 + t_0) * t_1); end return tmp end
function tmp_2 = code(re, im) t_0 = -0.5 * (im * im); t_1 = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))); tmp = 0.0; if (re <= -590.0) tmp = t_0; elseif (re <= 4.5e-14) tmp = t_1; else tmp = (1.0 + t_0) * t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -590.0], t$95$0, If[LessEqual[re, 4.5e-14], t$95$1, N[(N[(1.0 + t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(im \cdot im\right)\\
t_1 := 1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\
\mathbf{if}\;re \leq -590:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 4.5 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t\_0\right) \cdot t\_1\\
\end{array}
\end{array}
if re < -590Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -590 < re < 4.4999999999999998e-14Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6453.1%
Simplified53.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-*.f6453.1%
Simplified53.1%
if 4.4999999999999998e-14 < re Initial program 100.0%
Taylor expanded in im around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.8%
Simplified70.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6459.2%
Simplified59.2%
Final simplification48.5%
(FPCore (re im)
:precision binary64
(if (<= re -420.0)
(* -0.5 (* im im))
(if (<= re 2700.0)
(+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
(*
(* re (* re re))
(+ 0.16666666666666666 (* (* im im) -0.08333333333333333))))))
double code(double re, double im) {
double tmp;
if (re <= -420.0) {
tmp = -0.5 * (im * im);
} else if (re <= 2700.0) {
tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
} else {
tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-420.0d0)) then
tmp = (-0.5d0) * (im * im)
else if (re <= 2700.0d0) then
tmp = 1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))
else
tmp = (re * (re * re)) * (0.16666666666666666d0 + ((im * im) * (-0.08333333333333333d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -420.0) {
tmp = -0.5 * (im * im);
} else if (re <= 2700.0) {
tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
} else {
tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -420.0: tmp = -0.5 * (im * im) elif re <= 2700.0: tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))) else: tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333)) return tmp
function code(re, im) tmp = 0.0 if (re <= -420.0) tmp = Float64(-0.5 * Float64(im * im)); elseif (re <= 2700.0) tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(0.16666666666666666 + Float64(Float64(im * im) * -0.08333333333333333))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -420.0) tmp = -0.5 * (im * im); elseif (re <= 2700.0) tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))); else tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -420.0], N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2700.0], N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -420:\\
\;\;\;\;-0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 2700:\\
\;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\
\end{array}
\end{array}
if re < -420Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -420 < re < 2700Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6453.4%
Simplified53.4%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6451.9%
Simplified51.9%
if 2700 < re Initial program 100.0%
Taylor expanded in im around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6471.7%
Simplified71.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-*.f6462.3%
Simplified62.3%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-eval62.3%
Simplified62.3%
(FPCore (re im)
:precision binary64
(if (<= re -480.0)
(* -0.5 (* im im))
(if (<= re 115.0)
(+ 1.0 (* re (+ 1.0 (* re 0.5))))
(*
(* re (* re re))
(+ 0.16666666666666666 (* (* im im) -0.08333333333333333))))))
double code(double re, double im) {
double tmp;
if (re <= -480.0) {
tmp = -0.5 * (im * im);
} else if (re <= 115.0) {
tmp = 1.0 + (re * (1.0 + (re * 0.5)));
} else {
tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-480.0d0)) then
tmp = (-0.5d0) * (im * im)
else if (re <= 115.0d0) then
tmp = 1.0d0 + (re * (1.0d0 + (re * 0.5d0)))
else
tmp = (re * (re * re)) * (0.16666666666666666d0 + ((im * im) * (-0.08333333333333333d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -480.0) {
tmp = -0.5 * (im * im);
} else if (re <= 115.0) {
tmp = 1.0 + (re * (1.0 + (re * 0.5)));
} else {
tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -480.0: tmp = -0.5 * (im * im) elif re <= 115.0: tmp = 1.0 + (re * (1.0 + (re * 0.5))) else: tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333)) return tmp
function code(re, im) tmp = 0.0 if (re <= -480.0) tmp = Float64(-0.5 * Float64(im * im)); elseif (re <= 115.0) tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5)))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(0.16666666666666666 + Float64(Float64(im * im) * -0.08333333333333333))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -480.0) tmp = -0.5 * (im * im); elseif (re <= 115.0) tmp = 1.0 + (re * (1.0 + (re * 0.5))); else tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -480.0], N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 115.0], N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -480:\\
\;\;\;\;-0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 115:\\
\;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\
\end{array}
\end{array}
if re < -480Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -480 < re < 115Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6452.7%
Simplified52.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6452.5%
Simplified52.5%
if 115 < re Initial program 100.0%
Taylor expanded in im around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.6%
Simplified72.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6460.5%
Simplified60.5%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-eval60.5%
Simplified60.5%
(FPCore (re im)
:precision binary64
(if (<= re -600.0)
(* -0.5 (* im im))
(if (<= re 1.7)
(+ 1.0 (* re (+ 1.0 (* re 0.5))))
(* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))))
double code(double re, double im) {
double tmp;
if (re <= -600.0) {
tmp = -0.5 * (im * im);
} else if (re <= 1.7) {
tmp = 1.0 + (re * (1.0 + (re * 0.5)));
} else {
tmp = 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 <= (-600.0d0)) then
tmp = (-0.5d0) * (im * im)
else if (re <= 1.7d0) then
tmp = 1.0d0 + (re * (1.0d0 + (re * 0.5d0)))
else
tmp = 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 <= -600.0) {
tmp = -0.5 * (im * im);
} else if (re <= 1.7) {
tmp = 1.0 + (re * (1.0 + (re * 0.5)));
} else {
tmp = re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -600.0: tmp = -0.5 * (im * im) elif re <= 1.7: tmp = 1.0 + (re * (1.0 + (re * 0.5))) else: tmp = re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))) return tmp
function code(re, im) tmp = 0.0 if (re <= -600.0) tmp = Float64(-0.5 * Float64(im * im)); elseif (re <= 1.7) tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5)))); else tmp = 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 <= -600.0) tmp = -0.5 * (im * im); elseif (re <= 1.7) tmp = 1.0 + (re * (1.0 + (re * 0.5))); else tmp = re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -600.0], N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.7], N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -600:\\
\;\;\;\;-0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 1.7:\\
\;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if re < -600Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -600 < re < 1.69999999999999996Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6453.0%
Simplified53.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6452.8%
Simplified52.8%
if 1.69999999999999996 < re Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6467.0%
Simplified67.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-*.f6448.9%
Simplified48.9%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*l*N/A
associate-+r+N/A
distribute-lft-inN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
distribute-lft-outN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
Simplified48.9%
(FPCore (re im)
:precision binary64
(if (<= re -550.0)
(* -0.5 (* im im))
(if (<= re 2.8)
(+ 1.0 (* re (+ 1.0 (* re 0.5))))
(* (+ 0.5 (* re 0.16666666666666666)) (* re re)))))
double code(double re, double im) {
double tmp;
if (re <= -550.0) {
tmp = -0.5 * (im * im);
} else if (re <= 2.8) {
tmp = 1.0 + (re * (1.0 + (re * 0.5)));
} else {
tmp = (0.5 + (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 <= (-550.0d0)) then
tmp = (-0.5d0) * (im * im)
else if (re <= 2.8d0) then
tmp = 1.0d0 + (re * (1.0d0 + (re * 0.5d0)))
else
tmp = (0.5d0 + (re * 0.16666666666666666d0)) * (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -550.0) {
tmp = -0.5 * (im * im);
} else if (re <= 2.8) {
tmp = 1.0 + (re * (1.0 + (re * 0.5)));
} else {
tmp = (0.5 + (re * 0.16666666666666666)) * (re * re);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -550.0: tmp = -0.5 * (im * im) elif re <= 2.8: tmp = 1.0 + (re * (1.0 + (re * 0.5))) else: tmp = (0.5 + (re * 0.16666666666666666)) * (re * re) return tmp
function code(re, im) tmp = 0.0 if (re <= -550.0) tmp = Float64(-0.5 * Float64(im * im)); elseif (re <= 2.8) tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5)))); else tmp = Float64(Float64(0.5 + Float64(re * 0.16666666666666666)) * Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -550.0) tmp = -0.5 * (im * im); elseif (re <= 2.8) tmp = 1.0 + (re * (1.0 + (re * 0.5))); else tmp = (0.5 + (re * 0.16666666666666666)) * (re * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -550.0], N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.8], N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -550:\\
\;\;\;\;-0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 2.8:\\
\;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\\
\end{array}
\end{array}
if re < -550Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -550 < re < 2.7999999999999998Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6453.0%
Simplified53.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6452.8%
Simplified52.8%
if 2.7999999999999998 < re Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6467.0%
Simplified67.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-*.f6448.9%
Simplified48.9%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.9%
Simplified48.9%
(FPCore (re im)
:precision binary64
(if (<= re -26.0)
(* -0.5 (* im im))
(if (<= re 1.9)
(+ re 1.0)
(* (+ 0.5 (* re 0.16666666666666666)) (* re re)))))
double code(double re, double im) {
double tmp;
if (re <= -26.0) {
tmp = -0.5 * (im * im);
} else if (re <= 1.9) {
tmp = re + 1.0;
} else {
tmp = (0.5 + (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 <= (-26.0d0)) then
tmp = (-0.5d0) * (im * im)
else if (re <= 1.9d0) then
tmp = re + 1.0d0
else
tmp = (0.5d0 + (re * 0.16666666666666666d0)) * (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -26.0) {
tmp = -0.5 * (im * im);
} else if (re <= 1.9) {
tmp = re + 1.0;
} else {
tmp = (0.5 + (re * 0.16666666666666666)) * (re * re);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -26.0: tmp = -0.5 * (im * im) elif re <= 1.9: tmp = re + 1.0 else: tmp = (0.5 + (re * 0.16666666666666666)) * (re * re) return tmp
function code(re, im) tmp = 0.0 if (re <= -26.0) tmp = Float64(-0.5 * Float64(im * im)); elseif (re <= 1.9) tmp = Float64(re + 1.0); else tmp = Float64(Float64(0.5 + Float64(re * 0.16666666666666666)) * Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -26.0) tmp = -0.5 * (im * im); elseif (re <= 1.9) tmp = re + 1.0; else tmp = (0.5 + (re * 0.16666666666666666)) * (re * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -26.0], N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9], N[(re + 1.0), $MachinePrecision], N[(N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -26:\\
\;\;\;\;-0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 1.9:\\
\;\;\;\;re + 1\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\\
\end{array}
\end{array}
if re < -26Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -26 < re < 1.8999999999999999Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6453.0%
Simplified53.0%
Taylor expanded in re around 0
+-lowering-+.f6452.6%
Simplified52.6%
if 1.8999999999999999 < re Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6467.0%
Simplified67.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-*.f6448.9%
Simplified48.9%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.9%
Simplified48.9%
Final simplification45.7%
(FPCore (re im) :precision binary64 (if (<= re -206.0) (* -0.5 (* im im)) (if (<= re 2.8) (+ re 1.0) (* re (* re (* re 0.16666666666666666))))))
double code(double re, double im) {
double tmp;
if (re <= -206.0) {
tmp = -0.5 * (im * im);
} else if (re <= 2.8) {
tmp = re + 1.0;
} else {
tmp = re * (re * (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 <= (-206.0d0)) then
tmp = (-0.5d0) * (im * im)
else if (re <= 2.8d0) then
tmp = re + 1.0d0
else
tmp = re * (re * (re * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -206.0) {
tmp = -0.5 * (im * im);
} else if (re <= 2.8) {
tmp = re + 1.0;
} else {
tmp = re * (re * (re * 0.16666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -206.0: tmp = -0.5 * (im * im) elif re <= 2.8: tmp = re + 1.0 else: tmp = re * (re * (re * 0.16666666666666666)) return tmp
function code(re, im) tmp = 0.0 if (re <= -206.0) tmp = Float64(-0.5 * Float64(im * im)); elseif (re <= 2.8) tmp = Float64(re + 1.0); else tmp = Float64(re * Float64(re * Float64(re * 0.16666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -206.0) tmp = -0.5 * (im * im); elseif (re <= 2.8) tmp = re + 1.0; else tmp = re * (re * (re * 0.16666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -206.0], N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.8], N[(re + 1.0), $MachinePrecision], N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -206:\\
\;\;\;\;-0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 2.8:\\
\;\;\;\;re + 1\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if re < -206Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.5%
Simplified2.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
if -206 < re < 2.7999999999999998Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6453.0%
Simplified53.0%
Taylor expanded in re around 0
+-lowering-+.f6452.6%
Simplified52.6%
if 2.7999999999999998 < re Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6467.0%
Simplified67.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-*.f6448.9%
Simplified48.9%
Taylor expanded in re around inf
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6448.9%
Simplified48.9%
Final simplification45.7%
(FPCore (re im) :precision binary64 (let* ((t_0 (* -0.5 (* im im)))) (if (<= re -340.0) t_0 (if (<= re 8.2e+20) (+ re 1.0) t_0))))
double code(double re, double im) {
double t_0 = -0.5 * (im * im);
double tmp;
if (re <= -340.0) {
tmp = t_0;
} else if (re <= 8.2e+20) {
tmp = 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 = (-0.5d0) * (im * im)
if (re <= (-340.0d0)) then
tmp = t_0
else if (re <= 8.2d+20) then
tmp = re + 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = -0.5 * (im * im);
double tmp;
if (re <= -340.0) {
tmp = t_0;
} else if (re <= 8.2e+20) {
tmp = re + 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = -0.5 * (im * im) tmp = 0 if re <= -340.0: tmp = t_0 elif re <= 8.2e+20: tmp = re + 1.0 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(-0.5 * Float64(im * im)) tmp = 0.0 if (re <= -340.0) tmp = t_0; elseif (re <= 8.2e+20) tmp = Float64(re + 1.0); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = -0.5 * (im * im); tmp = 0.0; if (re <= -340.0) tmp = t_0; elseif (re <= 8.2e+20) tmp = re + 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -340.0], t$95$0, If[LessEqual[re, 8.2e+20], N[(re + 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;re \leq -340:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 8.2 \cdot 10^{+20}:\\
\;\;\;\;re + 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -340 or 8.2e20 < re Initial program 100.0%
Taylor expanded in re around 0
cos-lowering-cos.f643.1%
Simplified3.1%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.9%
Simplified8.9%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6421.1%
Simplified21.1%
if -340 < re < 8.2e20Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6453.4%
Simplified53.4%
Taylor expanded in re around 0
+-lowering-+.f6451.6%
Simplified51.6%
Final simplification37.2%
(FPCore (re im) :precision binary64 (+ re 1.0))
double code(double re, double im) {
return re + 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re + 1.0d0
end function
public static double code(double re, double im) {
return re + 1.0;
}
def code(re, im): return re + 1.0
function code(re, im) return Float64(re + 1.0) end
function tmp = code(re, im) tmp = re + 1.0; end
code[re_, im_] := N[(re + 1.0), $MachinePrecision]
\begin{array}{l}
\\
re + 1
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6467.6%
Simplified67.6%
Taylor expanded in re around 0
+-lowering-+.f6428.7%
Simplified28.7%
Final simplification28.7%
(FPCore (re im) :precision binary64 1.0)
double code(double re, double im) {
return 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0
end function
public static double code(double re, double im) {
return 1.0;
}
def code(re, im): return 1.0
function code(re, im) return 1.0 end
function tmp = code(re, im) tmp = 1.0; end
code[re_, im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
exp-lowering-exp.f6467.6%
Simplified67.6%
Taylor expanded in re around 0
Simplified28.3%
herbie shell --seed 2024144
(FPCore (re im)
:name "math.exp on complex, real part"
:precision binary64
(* (exp re) (cos im)))