
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
Initial program 100.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666)))))))
(if (<= re -0.36)
(* (exp re) im)
(if (<= re 5.8e-21)
(*
(* (sin im) (+ 1.0 (* t_0 (* t_0 t_0))))
(/ 1.0 (+ 1.0 (* t_0 (+ t_0 -1.0)))))
(if (<= re 1.02e+103)
(* (exp re) (* im (+ 1.0 (* -0.16666666666666666 (* im im)))))
(* (sin im) (+ 1.0 t_0)))))))
double code(double re, double im) {
double t_0 = re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))));
double tmp;
if (re <= -0.36) {
tmp = exp(re) * im;
} else if (re <= 5.8e-21) {
tmp = (sin(im) * (1.0 + (t_0 * (t_0 * t_0)))) * (1.0 / (1.0 + (t_0 * (t_0 + -1.0))));
} else if (re <= 1.02e+103) {
tmp = exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im))));
} else {
tmp = sin(im) * (1.0 + t_0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0))))
if (re <= (-0.36d0)) then
tmp = exp(re) * im
else if (re <= 5.8d-21) then
tmp = (sin(im) * (1.0d0 + (t_0 * (t_0 * t_0)))) * (1.0d0 / (1.0d0 + (t_0 * (t_0 + (-1.0d0)))))
else if (re <= 1.02d+103) then
tmp = exp(re) * (im * (1.0d0 + ((-0.16666666666666666d0) * (im * im))))
else
tmp = sin(im) * (1.0d0 + t_0)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))));
double tmp;
if (re <= -0.36) {
tmp = Math.exp(re) * im;
} else if (re <= 5.8e-21) {
tmp = (Math.sin(im) * (1.0 + (t_0 * (t_0 * t_0)))) * (1.0 / (1.0 + (t_0 * (t_0 + -1.0))));
} else if (re <= 1.02e+103) {
tmp = Math.exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im))));
} else {
tmp = Math.sin(im) * (1.0 + t_0);
}
return tmp;
}
def code(re, im): t_0 = re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))) tmp = 0 if re <= -0.36: tmp = math.exp(re) * im elif re <= 5.8e-21: tmp = (math.sin(im) * (1.0 + (t_0 * (t_0 * t_0)))) * (1.0 / (1.0 + (t_0 * (t_0 + -1.0)))) elif re <= 1.02e+103: tmp = math.exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im)))) else: tmp = math.sin(im) * (1.0 + t_0) return tmp
function code(re, im) t_0 = Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))))) tmp = 0.0 if (re <= -0.36) tmp = Float64(exp(re) * im); elseif (re <= 5.8e-21) tmp = Float64(Float64(sin(im) * Float64(1.0 + Float64(t_0 * Float64(t_0 * t_0)))) * Float64(1.0 / Float64(1.0 + Float64(t_0 * Float64(t_0 + -1.0))))); elseif (re <= 1.02e+103) tmp = Float64(exp(re) * Float64(im * Float64(1.0 + Float64(-0.16666666666666666 * Float64(im * im))))); else tmp = Float64(sin(im) * Float64(1.0 + t_0)); end return tmp end
function tmp_2 = code(re, im) t_0 = re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))); tmp = 0.0; if (re <= -0.36) tmp = exp(re) * im; elseif (re <= 5.8e-21) tmp = (sin(im) * (1.0 + (t_0 * (t_0 * t_0)))) * (1.0 / (1.0 + (t_0 * (t_0 + -1.0)))); elseif (re <= 1.02e+103) tmp = exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im)))); else tmp = sin(im) * (1.0 + t_0); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.36], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 5.8e-21], N[(N[(N[Sin[im], $MachinePrecision] * N[(1.0 + N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + N[(t$95$0 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.02e+103], N[(N[Exp[re], $MachinePrecision] * N[(im * N[(1.0 + N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[im], $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\
\mathbf{if}\;re \leq -0.36:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 5.8 \cdot 10^{-21}:\\
\;\;\;\;\left(\sin im \cdot \left(1 + t\_0 \cdot \left(t\_0 \cdot t\_0\right)\right)\right) \cdot \frac{1}{1 + t\_0 \cdot \left(t\_0 + -1\right)}\\
\mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
\;\;\;\;e^{re} \cdot \left(im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin im \cdot \left(1 + t\_0\right)\\
\end{array}
\end{array}
if re < -0.35999999999999999Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
if -0.35999999999999999 < re < 5.8e-21Initial 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.5%
Simplified99.5%
flip3-+N/A
associate-*l/N/A
div-invN/A
*-lowering-*.f64N/A
Applied egg-rr99.5%
if 5.8e-21 < re < 1.01999999999999991e103Initial program 99.9%
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-*.f6488.8%
Simplified88.8%
if 1.01999999999999991e103 < 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-*.f64100.0%
Simplified100.0%
Final simplification98.9%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
(sin im)
(+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666)))))))))
(if (<= re -0.36)
(* (exp re) im)
(if (<= re 5.8e-21)
t_0
(if (<= re 1.02e+103)
(* (exp re) (* im (+ 1.0 (* -0.16666666666666666 (* im im)))))
t_0)))))
double code(double re, double im) {
double t_0 = sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
double tmp;
if (re <= -0.36) {
tmp = exp(re) * im;
} else if (re <= 5.8e-21) {
tmp = t_0;
} else if (re <= 1.02e+103) {
tmp = exp(re) * (im * (1.0 + (-0.16666666666666666 * (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 = sin(im) * (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0))))))
if (re <= (-0.36d0)) then
tmp = exp(re) * im
else if (re <= 5.8d-21) then
tmp = t_0
else if (re <= 1.02d+103) then
tmp = exp(re) * (im * (1.0d0 + ((-0.16666666666666666d0) * (im * im))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
double tmp;
if (re <= -0.36) {
tmp = Math.exp(re) * im;
} else if (re <= 5.8e-21) {
tmp = t_0;
} else if (re <= 1.02e+103) {
tmp = Math.exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im))));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) tmp = 0 if re <= -0.36: tmp = math.exp(re) * im elif re <= 5.8e-21: tmp = t_0 elif re <= 1.02e+103: tmp = math.exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im)))) else: tmp = t_0 return tmp
function code(re, im) t_0 = 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.36) tmp = Float64(exp(re) * im); elseif (re <= 5.8e-21) tmp = t_0; elseif (re <= 1.02e+103) tmp = Float64(exp(re) * Float64(im * Float64(1.0 + Float64(-0.16666666666666666 * Float64(im * im))))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))); tmp = 0.0; if (re <= -0.36) tmp = exp(re) * im; elseif (re <= 5.8e-21) tmp = t_0; elseif (re <= 1.02e+103) tmp = exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im)))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = 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.36], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 5.8e-21], t$95$0, If[LessEqual[re, 1.02e+103], N[(N[Exp[re], $MachinePrecision] * N[(im * N[(1.0 + N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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.36:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 5.8 \cdot 10^{-21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
\;\;\;\;e^{re} \cdot \left(im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.35999999999999999Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
if -0.35999999999999999 < re < 5.8e-21 or 1.01999999999999991e103 < 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.6%
Simplified99.6%
if 5.8e-21 < re < 1.01999999999999991e103Initial program 99.9%
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-*.f6488.8%
Simplified88.8%
Final simplification98.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (sin im) (+ 1.0 (* re (+ 1.0 (* re 0.5)))))))
(if (<= re -0.36)
(* (exp re) im)
(if (<= re 5.8e-21)
t_0
(if (<= re 1.9e+154)
(* (exp re) (* im (+ 1.0 (* -0.16666666666666666 (* im im)))))
t_0)))))
double code(double re, double im) {
double t_0 = sin(im) * (1.0 + (re * (1.0 + (re * 0.5))));
double tmp;
if (re <= -0.36) {
tmp = exp(re) * im;
} else if (re <= 5.8e-21) {
tmp = t_0;
} else if (re <= 1.9e+154) {
tmp = exp(re) * (im * (1.0 + (-0.16666666666666666 * (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 = sin(im) * (1.0d0 + (re * (1.0d0 + (re * 0.5d0))))
if (re <= (-0.36d0)) then
tmp = exp(re) * im
else if (re <= 5.8d-21) then
tmp = t_0
else if (re <= 1.9d+154) then
tmp = exp(re) * (im * (1.0d0 + ((-0.16666666666666666d0) * (im * im))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.sin(im) * (1.0 + (re * (1.0 + (re * 0.5))));
double tmp;
if (re <= -0.36) {
tmp = Math.exp(re) * im;
} else if (re <= 5.8e-21) {
tmp = t_0;
} else if (re <= 1.9e+154) {
tmp = Math.exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im))));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.sin(im) * (1.0 + (re * (1.0 + (re * 0.5)))) tmp = 0 if re <= -0.36: tmp = math.exp(re) * im elif re <= 5.8e-21: tmp = t_0 elif re <= 1.9e+154: tmp = math.exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im)))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(sin(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5))))) tmp = 0.0 if (re <= -0.36) tmp = Float64(exp(re) * im); elseif (re <= 5.8e-21) tmp = t_0; elseif (re <= 1.9e+154) tmp = Float64(exp(re) * Float64(im * Float64(1.0 + Float64(-0.16666666666666666 * Float64(im * im))))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = sin(im) * (1.0 + (re * (1.0 + (re * 0.5)))); tmp = 0.0; if (re <= -0.36) tmp = exp(re) * im; elseif (re <= 5.8e-21) tmp = t_0; elseif (re <= 1.9e+154) tmp = exp(re) * (im * (1.0 + (-0.16666666666666666 * (im * im)))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Sin[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.36], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 5.8e-21], t$95$0, If[LessEqual[re, 1.9e+154], N[(N[Exp[re], $MachinePrecision] * N[(im * N[(1.0 + N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\
\mathbf{if}\;re \leq -0.36:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 5.8 \cdot 10^{-21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+154}:\\
\;\;\;\;e^{re} \cdot \left(im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.35999999999999999Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
if -0.35999999999999999 < re < 5.8e-21 or 1.8999999999999999e154 < re Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.6%
Simplified99.6%
if 5.8e-21 < re < 1.8999999999999999e154Initial program 99.9%
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-*.f6479.9%
Simplified79.9%
Final simplification97.4%
(FPCore (re im) :precision binary64 (let* ((t_0 (* (exp re) im))) (if (<= re -0.36) t_0 (if (<= re 9e+27) (* (sin im) (+ re 1.0)) t_0))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.36) {
tmp = t_0;
} else if (re <= 9e+27) {
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.36d0)) then
tmp = t_0
else if (re <= 9d+27) 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.36) {
tmp = t_0;
} else if (re <= 9e+27) {
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.36: tmp = t_0 elif re <= 9e+27: 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.36) tmp = t_0; elseif (re <= 9e+27) 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.36) tmp = t_0; elseif (re <= 9e+27) 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.36], t$95$0, If[LessEqual[re, 9e+27], 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.36:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 9 \cdot 10^{+27}:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.35999999999999999 or 8.9999999999999998e27 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified91.0%
if -0.35999999999999999 < re < 8.9999999999999998e27Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6497.5%
Simplified97.5%
Final simplification94.7%
(FPCore (re im) :precision binary64 (let* ((t_0 (* (exp re) im))) (if (<= re -0.36) t_0 (if (<= re 5.8e-21) (sin im) t_0))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.36) {
tmp = t_0;
} else if (re <= 5.8e-21) {
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 <= (-0.36d0)) then
tmp = t_0
else if (re <= 5.8d-21) 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 <= -0.36) {
tmp = t_0;
} else if (re <= 5.8e-21) {
tmp = Math.sin(im);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.36: tmp = t_0 elif re <= 5.8e-21: 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 <= -0.36) tmp = t_0; elseif (re <= 5.8e-21) 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 <= -0.36) tmp = t_0; elseif (re <= 5.8e-21) 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, -0.36], t$95$0, If[LessEqual[re, 5.8e-21], N[Sin[im], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.36:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 5.8 \cdot 10^{-21}:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.35999999999999999 or 5.8e-21 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified88.8%
if -0.35999999999999999 < re < 5.8e-21Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6499.1%
Simplified99.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (* re re))))
(if (<= re -70.0)
(* im (* 0.008333333333333333 (* (* im im) (* im im))))
(if (<= re 5.8e-21)
(sin im)
(if (<= re 1.5e+139)
(* im (+ 1.0 (/ (- (* re re) (* t_0 t_0)) (- re t_0))))
(*
(+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
(* im (+ 1.0 (* im (* im -0.16666666666666666))))))))))
double code(double re, double im) {
double t_0 = 0.5 * (re * re);
double tmp;
if (re <= -70.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 5.8e-21) {
tmp = sin(im);
} else if (re <= 1.5e+139) {
tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0)));
} else {
tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = 0.5d0 * (re * re)
if (re <= (-70.0d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else if (re <= 5.8d-21) then
tmp = sin(im)
else if (re <= 1.5d+139) then
tmp = im * (1.0d0 + (((re * re) - (t_0 * t_0)) / (re - t_0)))
else
tmp = (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))) * (im * (1.0d0 + (im * (im * (-0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * (re * re);
double tmp;
if (re <= -70.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 5.8e-21) {
tmp = Math.sin(im);
} else if (re <= 1.5e+139) {
tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0)));
} else {
tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666))));
}
return tmp;
}
def code(re, im): t_0 = 0.5 * (re * re) tmp = 0 if re <= -70.0: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) elif re <= 5.8e-21: tmp = math.sin(im) elif re <= 1.5e+139: tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0))) else: tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666)))) return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(re * re)) tmp = 0.0 if (re <= -70.0) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); elseif (re <= 5.8e-21) tmp = sin(im); elseif (re <= 1.5e+139) tmp = Float64(im * Float64(1.0 + Float64(Float64(Float64(re * re) - Float64(t_0 * t_0)) / Float64(re - t_0)))); else tmp = Float64(Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))))) * Float64(im * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666))))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (re * re); tmp = 0.0; if (re <= -70.0) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); elseif (re <= 5.8e-21) tmp = sin(im); elseif (re <= 1.5e+139) tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0))); else tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666)))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -70.0], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 5.8e-21], N[Sin[im], $MachinePrecision], If[LessEqual[re, 1.5e+139], N[(im * N[(1.0 + N[(N[(N[(re * re), $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(re - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(re \cdot re\right)\\
\mathbf{if}\;re \leq -70:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;re \leq 5.8 \cdot 10^{-21}:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;re \leq 1.5 \cdot 10^{+139}:\\
\;\;\;\;im \cdot \left(1 + \frac{re \cdot re - t\_0 \cdot t\_0}{re - t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if re < -70Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.6%
Simplified4.6%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f644.0%
Simplified4.0%
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-*.f6445.4%
Simplified45.4%
if -70 < re < 5.8e-21Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6499.1%
Simplified99.1%
if 5.8e-21 < re < 1.5e139Initial program 99.9%
Taylor expanded in im around 0
Simplified80.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6425.4%
Simplified25.4%
distribute-lft-inN/A
*-rgt-identityN/A
flip-+N/A
*-rgt-identityN/A
fmm-defN/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr62.1%
if 1.5e139 < 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-*.f64100.0%
Simplified100.0%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.8%
Simplified78.8%
Final simplification80.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (* re re))))
(if (<= re -31.5)
(* im (* 0.008333333333333333 (* (* im im) (* im im))))
(if (<= re 2e+138)
(* im (+ 1.0 (/ (- (* re re) (* t_0 t_0)) (- re t_0))))
(*
(+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
(* im (+ 1.0 (* im (* im -0.16666666666666666)))))))))
double code(double re, double im) {
double t_0 = 0.5 * (re * re);
double tmp;
if (re <= -31.5) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 2e+138) {
tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0)));
} else {
tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = 0.5d0 * (re * re)
if (re <= (-31.5d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else if (re <= 2d+138) then
tmp = im * (1.0d0 + (((re * re) - (t_0 * t_0)) / (re - t_0)))
else
tmp = (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))) * (im * (1.0d0 + (im * (im * (-0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * (re * re);
double tmp;
if (re <= -31.5) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 2e+138) {
tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0)));
} else {
tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666))));
}
return tmp;
}
def code(re, im): t_0 = 0.5 * (re * re) tmp = 0 if re <= -31.5: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) elif re <= 2e+138: tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0))) else: tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666)))) return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(re * re)) tmp = 0.0 if (re <= -31.5) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); elseif (re <= 2e+138) tmp = Float64(im * Float64(1.0 + Float64(Float64(Float64(re * re) - Float64(t_0 * t_0)) / Float64(re - t_0)))); else tmp = Float64(Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))))) * Float64(im * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666))))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (re * re); tmp = 0.0; if (re <= -31.5) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); elseif (re <= 2e+138) tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0))); else tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666)))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -31.5], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2e+138], N[(im * N[(1.0 + N[(N[(N[(re * re), $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(re - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(re \cdot re\right)\\
\mathbf{if}\;re \leq -31.5:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;re \leq 2 \cdot 10^{+138}:\\
\;\;\;\;im \cdot \left(1 + \frac{re \cdot re - t\_0 \cdot t\_0}{re - t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if re < -31.5Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.6%
Simplified4.6%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f644.0%
Simplified4.0%
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-*.f6445.4%
Simplified45.4%
if -31.5 < re < 2.0000000000000001e138Initial program 100.0%
Taylor expanded in im around 0
Simplified57.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6448.9%
Simplified48.9%
distribute-lft-inN/A
*-rgt-identityN/A
flip-+N/A
*-rgt-identityN/A
fmm-defN/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr54.6%
if 2.0000000000000001e138 < 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-*.f64100.0%
Simplified100.0%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.8%
Simplified78.8%
Final simplification55.7%
(FPCore (re im)
:precision binary64
(if (<= re -0.35)
(* im (* 0.008333333333333333 (* (* im im) (* im im))))
(*
(+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
(* im (+ 1.0 (* im (* im -0.16666666666666666)))))))
double code(double re, double im) {
double tmp;
if (re <= -0.35) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else {
tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.35d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else
tmp = (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))) * (im * (1.0d0 + (im * (im * (-0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.35) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else {
tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.35: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) else: tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666)))) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.35) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); else tmp = Float64(Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))))) * Float64(im * Float64(1.0 + Float64(im * Float64(im * -0.16666666666666666))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.35) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); else tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (im * (1.0 + (im * (im * -0.16666666666666666)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.35], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(1.0 + N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.35:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if re < -0.34999999999999998Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.9%
Simplified4.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f644.2%
Simplified4.2%
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-*.f6444.8%
Simplified44.8%
if -0.34999999999999998 < 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-*.f6492.2%
Simplified92.2%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6456.2%
Simplified56.2%
(FPCore (re im) :precision binary64 (if (<= re -10.2) (* 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 <= -10.2) {
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 <= (-10.2d0)) 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 <= -10.2) {
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 <= -10.2: 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 <= -10.2) 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 <= -10.2) 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, -10.2], 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 -10.2:\\
\;\;\;\;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 < -10.199999999999999Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.6%
Simplified4.6%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f644.0%
Simplified4.0%
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-*.f6445.4%
Simplified45.4%
if -10.199999999999999 < 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-*.f6492.0%
Simplified92.0%
Taylor expanded in im around 0
Simplified55.8%
Final simplification53.4%
(FPCore (re im)
:precision binary64
(if (<= re -0.35)
(* im (* 0.008333333333333333 (* (* im im) (* im im))))
(if (<= re 4.5e+30)
(* im (+ 1.0 (* -0.16666666666666666 (* im im))))
(* im (* 0.5 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= -0.35) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 4.5e+30) {
tmp = im * (1.0 + (-0.16666666666666666 * (im * im)));
} else {
tmp = im * (0.5 * (re * re));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.35d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else if (re <= 4.5d+30) then
tmp = im * (1.0d0 + ((-0.16666666666666666d0) * (im * im)))
else
tmp = im * (0.5d0 * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.35) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else if (re <= 4.5e+30) {
tmp = im * (1.0 + (-0.16666666666666666 * (im * im)));
} else {
tmp = im * (0.5 * (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.35: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) elif re <= 4.5e+30: tmp = im * (1.0 + (-0.16666666666666666 * (im * im))) else: tmp = im * (0.5 * (re * re)) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.35) tmp = Float64(im * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))); elseif (re <= 4.5e+30) tmp = Float64(im * Float64(1.0 + Float64(-0.16666666666666666 * Float64(im * im)))); else tmp = Float64(im * Float64(0.5 * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.35) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); elseif (re <= 4.5e+30) tmp = im * (1.0 + (-0.16666666666666666 * (im * im))); else tmp = im * (0.5 * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.35], N[(im * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 4.5e+30], N[(im * N[(1.0 + N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.35:\\
\;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;re \leq 4.5 \cdot 10^{+30}:\\
\;\;\;\;im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < -0.34999999999999998Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.9%
Simplified4.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f644.2%
Simplified4.2%
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-*.f6444.8%
Simplified44.8%
if -0.34999999999999998 < re < 4.49999999999999995e30Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6497.5%
Simplified97.5%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6452.8%
Simplified52.8%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.7%
Simplified54.7%
if 4.49999999999999995e30 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified81.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6453.1%
Simplified53.1%
Taylor expanded in re around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
Final simplification52.1%
(FPCore (re im) :precision binary64 (if (<= re -33.0) (* im (* 0.008333333333333333 (* (* im im) (* im im)))) (* im (+ 1.0 (* re (+ 1.0 (* re 0.5)))))))
double code(double re, double im) {
double tmp;
if (re <= -33.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else {
tmp = im * (1.0 + (re * (1.0 + (re * 0.5))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-33.0d0)) then
tmp = im * (0.008333333333333333d0 * ((im * im) * (im * im)))
else
tmp = im * (1.0d0 + (re * (1.0d0 + (re * 0.5d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -33.0) {
tmp = im * (0.008333333333333333 * ((im * im) * (im * im)));
} else {
tmp = im * (1.0 + (re * (1.0 + (re * 0.5))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -33.0: tmp = im * (0.008333333333333333 * ((im * im) * (im * im))) else: tmp = im * (1.0 + (re * (1.0 + (re * 0.5)))) return tmp
function code(re, im) tmp = 0.0 if (re <= -33.0) 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 * 0.5))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -33.0) tmp = im * (0.008333333333333333 * ((im * im) * (im * im))); else tmp = im * (1.0 + (re * (1.0 + (re * 0.5)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -33.0], 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 * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -33:\\
\;\;\;\;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 0.5\right)\right)\\
\end{array}
\end{array}
if re < -33Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f644.6%
Simplified4.6%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f644.0%
Simplified4.0%
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-*.f6445.4%
Simplified45.4%
if -33 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified60.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6452.9%
Simplified52.9%
Final simplification51.2%
(FPCore (re im) :precision binary64 (if (<= re 5.2e+29) (* im (+ 1.0 (* -0.16666666666666666 (* im im)))) (* im (* 0.5 (* re re)))))
double code(double re, double im) {
double tmp;
if (re <= 5.2e+29) {
tmp = im * (1.0 + (-0.16666666666666666 * (im * im)));
} else {
tmp = im * (0.5 * (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.2d+29) then
tmp = im * (1.0d0 + ((-0.16666666666666666d0) * (im * im)))
else
tmp = im * (0.5d0 * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 5.2e+29) {
tmp = im * (1.0 + (-0.16666666666666666 * (im * im)));
} else {
tmp = im * (0.5 * (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 5.2e+29: tmp = im * (1.0 + (-0.16666666666666666 * (im * im))) else: tmp = im * (0.5 * (re * re)) return tmp
function code(re, im) tmp = 0.0 if (re <= 5.2e+29) tmp = Float64(im * Float64(1.0 + Float64(-0.16666666666666666 * Float64(im * im)))); else tmp = Float64(im * Float64(0.5 * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 5.2e+29) tmp = im * (1.0 + (-0.16666666666666666 * (im * im))); else tmp = im * (0.5 * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 5.2e+29], N[(im * N[(1.0 + N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 5.2 \cdot 10^{+29}:\\
\;\;\;\;im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 5.2e29Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6470.9%
Simplified70.9%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6438.8%
Simplified38.8%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6440.2%
Simplified40.2%
if 5.2e29 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified81.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6453.1%
Simplified53.1%
Taylor expanded in re around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
Final simplification42.9%
(FPCore (re im) :precision binary64 (if (<= re 9e+27) im (* im (* 0.5 (* re re)))))
double code(double re, double im) {
double tmp;
if (re <= 9e+27) {
tmp = im;
} else {
tmp = im * (0.5 * (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 <= 9d+27) then
tmp = im
else
tmp = im * (0.5d0 * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 9e+27) {
tmp = im;
} else {
tmp = im * (0.5 * (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 9e+27: tmp = im else: tmp = im * (0.5 * (re * re)) return tmp
function code(re, im) tmp = 0.0 if (re <= 9e+27) tmp = im; else tmp = Float64(im * Float64(0.5 * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 9e+27) tmp = im; else tmp = im * (0.5 * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 9e+27], im, N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 9 \cdot 10^{+27}:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 8.9999999999999998e27Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6470.9%
Simplified70.9%
Taylor expanded in im around 0
Simplified39.0%
if 8.9999999999999998e27 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified81.5%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6453.1%
Simplified53.1%
Taylor expanded in re around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
Final simplification42.0%
(FPCore (re im) :precision binary64 (if (<= im 6.8e+40) im (* re im)))
double code(double re, double im) {
double tmp;
if (im <= 6.8e+40) {
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 <= 6.8d+40) 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 <= 6.8e+40) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 6.8e+40: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (im <= 6.8e+40) tmp = im; else tmp = Float64(re * im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 6.8e+40) tmp = im; else tmp = re * im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 6.8e+40], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 6.8 \cdot 10^{+40}:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if im < 6.79999999999999977e40Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6455.9%
Simplified55.9%
Taylor expanded in im around 0
Simplified38.3%
if 6.79999999999999977e40 < im Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6459.6%
Simplified59.6%
Taylor expanded in im around 0
Simplified10.2%
Taylor expanded in re around inf
Simplified11.3%
(FPCore (re im) :precision binary64 (+ im (* re im)))
double code(double re, double im) {
return im + (re * im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = im + (re * im)
end function
public static double code(double re, double im) {
return im + (re * im);
}
def code(re, im): return im + (re * im)
function code(re, im) return Float64(im + Float64(re * im)) end
function tmp = code(re, im) tmp = im + (re * im); end
code[re_, im_] := N[(im + N[(re * im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
im + re \cdot im
\end{array}
Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6456.8%
Simplified56.8%
Taylor expanded in im around 0
Simplified33.9%
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-lowering-*.f6433.9%
Applied egg-rr33.9%
Final simplification33.9%
(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 re around 0
+-commutativeN/A
+-lowering-+.f6456.8%
Simplified56.8%
Taylor expanded in im around 0
Simplified33.9%
Final simplification33.9%
(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 re around 0
sin-lowering-sin.f6456.5%
Simplified56.5%
Taylor expanded in im around 0
Simplified31.3%
herbie shell --seed 2024160
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))