
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
Initial program 100.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
(* (fma re 0.16666666666666666 0.5) (* re re))
(* -0.16666666666666666 (* im (* im im))))
(if (<= t_0 -0.02)
(* (sin im) (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
(if (<= t_0 4e-96)
t_1
(if (<= t_0 1.0)
(*
(sin im)
(fma
(* (* re re) -0.25)
(/ 1.0 (fma re 0.16666666666666666 -0.5))
(+ re 1.0)))
t_1))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = exp(re) * im;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(re, 0.16666666666666666, 0.5) * (re * re)) * (-0.16666666666666666 * (im * (im * im)));
} else if (t_0 <= -0.02) {
tmp = sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
} else if (t_0 <= 4e-96) {
tmp = t_1;
} else if (t_0 <= 1.0) {
tmp = sin(im) * fma(((re * re) * -0.25), (1.0 / fma(re, 0.16666666666666666, -0.5)), (re + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = Float64(exp(re) * im) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)) * Float64(-0.16666666666666666 * Float64(im * Float64(im * im)))); elseif (t_0 <= -0.02) tmp = Float64(sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)); elseif (t_0 <= 4e-96) tmp = t_1; elseif (t_0 <= 1.0) tmp = Float64(sin(im) * fma(Float64(Float64(re * re) * -0.25), Float64(1.0 / fma(re, 0.16666666666666666, -0.5)), Float64(re + 1.0))); else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e-96], t$95$1, If[LessEqual[t$95$0, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(N[(N[(re * re), $MachinePrecision] * -0.25), $MachinePrecision] * N[(1.0 / N[(re * 0.16666666666666666 + -0.5), $MachinePrecision]), $MachinePrecision] + N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right)\right) \cdot \left(-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(\left(re \cdot re\right) \cdot -0.25, \frac{1}{\mathsf{fma}\left(re, 0.16666666666666666, -0.5\right)}, re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified53.9%
Taylor expanded in im around inf
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.8
Simplified15.8%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6497.4
Simplified97.4%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 3.9999999999999996e-96 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.9%
if 3.9999999999999996e-96 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.8
Simplified99.8%
distribute-rgt-inN/A
*-lft-identityN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
flip-+N/A
div-invN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.8%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.9
Simplified99.9%
Final simplification86.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
(* (fma re 0.16666666666666666 0.5) (* re re))
(* -0.16666666666666666 (* im (* im im))))
(if (<= t_0 -0.02)
(* (sin im) (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
(if (<= t_0 4e-96)
t_1
(if (<= t_0 1.0)
(*
(sin im)
(fma (fma re 0.16666666666666666 0.5) (* re re) (+ re 1.0)))
t_1))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = exp(re) * im;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(re, 0.16666666666666666, 0.5) * (re * re)) * (-0.16666666666666666 * (im * (im * im)));
} else if (t_0 <= -0.02) {
tmp = sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
} else if (t_0 <= 4e-96) {
tmp = t_1;
} else if (t_0 <= 1.0) {
tmp = sin(im) * fma(fma(re, 0.16666666666666666, 0.5), (re * re), (re + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = Float64(exp(re) * im) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)) * Float64(-0.16666666666666666 * Float64(im * Float64(im * im)))); elseif (t_0 <= -0.02) tmp = Float64(sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)); elseif (t_0 <= 4e-96) tmp = t_1; elseif (t_0 <= 1.0) tmp = Float64(sin(im) * fma(fma(re, 0.16666666666666666, 0.5), Float64(re * re), Float64(re + 1.0))); else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e-96], t$95$1, If[LessEqual[t$95$0, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision] + N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right)\right) \cdot \left(-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), re \cdot re, re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified53.9%
Taylor expanded in im around inf
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.8
Simplified15.8%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6497.4
Simplified97.4%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 3.9999999999999996e-96 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.9%
if 3.9999999999999996e-96 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.8
Simplified99.8%
distribute-rgt-inN/A
*-lft-identityN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6499.8
Applied egg-rr99.8%
Final simplification86.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im)))
(t_1
(*
(sin im)
(fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))
(t_2 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
(* (fma re 0.16666666666666666 0.5) (* re re))
(* -0.16666666666666666 (* im (* im im))))
(if (<= t_0 -0.02)
t_1
(if (<= t_0 4e-96) t_2 (if (<= t_0 1.0) t_1 t_2))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
double t_2 = exp(re) * im;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(re, 0.16666666666666666, 0.5) * (re * re)) * (-0.16666666666666666 * (im * (im * im)));
} else if (t_0 <= -0.02) {
tmp = t_1;
} else if (t_0 <= 4e-96) {
tmp = t_2;
} else if (t_0 <= 1.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = Float64(sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)) t_2 = Float64(exp(re) * im) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)) * Float64(-0.16666666666666666 * Float64(im * Float64(im * im)))); elseif (t_0 <= -0.02) tmp = t_1; elseif (t_0 <= 4e-96) tmp = t_2; elseif (t_0 <= 1.0) tmp = t_1; else tmp = t_2; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], t$95$1, If[LessEqual[t$95$0, 4e-96], t$95$2, If[LessEqual[t$95$0, 1.0], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := \sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
t_2 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right)\right) \cdot \left(-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified53.9%
Taylor expanded in im around inf
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.8
Simplified15.8%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 3.9999999999999996e-96 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6498.7
Simplified98.7%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 3.9999999999999996e-96 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.9%
Final simplification86.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im)))
(t_1 (* (sin im) (fma re (fma re 0.5 1.0) 1.0)))
(t_2 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
(* (fma re 0.16666666666666666 0.5) (* re re))
(* -0.16666666666666666 (* im (* im im))))
(if (<= t_0 -0.02)
t_1
(if (<= t_0 4e-96) t_2 (if (<= t_0 1.0) t_1 t_2))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0);
double t_2 = exp(re) * im;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(re, 0.16666666666666666, 0.5) * (re * re)) * (-0.16666666666666666 * (im * (im * im)));
} else if (t_0 <= -0.02) {
tmp = t_1;
} else if (t_0 <= 4e-96) {
tmp = t_2;
} else if (t_0 <= 1.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = Float64(sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0)) t_2 = Float64(exp(re) * im) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)) * Float64(-0.16666666666666666 * Float64(im * Float64(im * im)))); elseif (t_0 <= -0.02) tmp = t_1; elseif (t_0 <= 4e-96) tmp = t_2; elseif (t_0 <= 1.0) tmp = t_1; else tmp = t_2; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], t$95$1, If[LessEqual[t$95$0, 4e-96], t$95$2, If[LessEqual[t$95$0, 1.0], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := \sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
t_2 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right)\right) \cdot \left(-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified53.9%
Taylor expanded in im around inf
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.8
Simplified15.8%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 3.9999999999999996e-96 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6498.4
Simplified98.4%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 3.9999999999999996e-96 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.9%
Final simplification86.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im)))
(t_1 (* (sin im) (+ re 1.0)))
(t_2 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
(* (fma re 0.16666666666666666 0.5) (* re re))
(* -0.16666666666666666 (* im (* im im))))
(if (<= t_0 -0.02)
t_1
(if (<= t_0 4e-96) t_2 (if (<= t_0 1.0) t_1 t_2))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = sin(im) * (re + 1.0);
double t_2 = exp(re) * im;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(re, 0.16666666666666666, 0.5) * (re * re)) * (-0.16666666666666666 * (im * (im * im)));
} else if (t_0 <= -0.02) {
tmp = t_1;
} else if (t_0 <= 4e-96) {
tmp = t_2;
} else if (t_0 <= 1.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = Float64(sin(im) * Float64(re + 1.0)) t_2 = Float64(exp(re) * im) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)) * Float64(-0.16666666666666666 * Float64(im * Float64(im * im)))); elseif (t_0 <= -0.02) tmp = t_1; elseif (t_0 <= 4e-96) tmp = t_2; elseif (t_0 <= 1.0) tmp = t_1; else tmp = t_2; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], t$95$1, If[LessEqual[t$95$0, 4e-96], t$95$2, If[LessEqual[t$95$0, 1.0], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := \sin im \cdot \left(re + 1\right)\\
t_2 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right)\right) \cdot \left(-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified53.9%
Taylor expanded in im around inf
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.8
Simplified15.8%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 3.9999999999999996e-96 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6497.9
Simplified97.9%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 3.9999999999999996e-96 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.9%
Final simplification86.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
(* (fma re 0.16666666666666666 0.5) (* re re))
(* -0.16666666666666666 (* im (* im im))))
(if (<= t_0 -0.02)
(sin im)
(if (<= t_0 2e-34) t_1 (if (<= t_0 1.0) (sin im) t_1))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = exp(re) * im;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(re, 0.16666666666666666, 0.5) * (re * re)) * (-0.16666666666666666 * (im * (im * im)));
} else if (t_0 <= -0.02) {
tmp = sin(im);
} else if (t_0 <= 2e-34) {
tmp = t_1;
} else if (t_0 <= 1.0) {
tmp = sin(im);
} else {
tmp = t_1;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = Float64(exp(re) * im) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)) * Float64(-0.16666666666666666 * Float64(im * Float64(im * im)))); elseif (t_0 <= -0.02) tmp = sin(im); elseif (t_0 <= 2e-34) tmp = t_1; elseif (t_0 <= 1.0) tmp = sin(im); else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 2e-34], t$95$1, If[LessEqual[t$95$0, 1.0], N[Sin[im], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right)\right) \cdot \left(-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified53.9%
Taylor expanded in im around inf
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.8
Simplified15.8%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 1.99999999999999986e-34 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6496.9
Simplified96.9%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1.99999999999999986e-34 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified96.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))))
(if (<= t_0 (- INFINITY))
(*
(* (fma re 0.16666666666666666 0.5) (* re re))
(* -0.16666666666666666 (* im (* im im))))
(if (<= t_0 -0.02)
(sin im)
(if (<= t_0 0.0)
(*
im
(* im (* im (fma re -0.16666666666666666 -0.16666666666666666))))
(if (<= t_0 1.0)
(sin im)
(*
im
(/
(* (* re re) (fma (* re re) 0.027777777777777776 -0.25))
(fma re 0.16666666666666666 -0.5)))))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(re, 0.16666666666666666, 0.5) * (re * re)) * (-0.16666666666666666 * (im * (im * im)));
} else if (t_0 <= -0.02) {
tmp = sin(im);
} else if (t_0 <= 0.0) {
tmp = im * (im * (im * fma(re, -0.16666666666666666, -0.16666666666666666)));
} else if (t_0 <= 1.0) {
tmp = sin(im);
} else {
tmp = im * (((re * re) * fma((re * re), 0.027777777777777776, -0.25)) / fma(re, 0.16666666666666666, -0.5));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)) * Float64(-0.16666666666666666 * Float64(im * Float64(im * im)))); elseif (t_0 <= -0.02) tmp = sin(im); elseif (t_0 <= 0.0) tmp = Float64(im * Float64(im * Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)))); elseif (t_0 <= 1.0) tmp = sin(im); else tmp = Float64(im * Float64(Float64(Float64(re * re) * fma(Float64(re * re), 0.027777777777777776, -0.25)) / fma(re, 0.16666666666666666, -0.5))); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[im], $MachinePrecision], N[(im * N[(N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * 0.027777777777777776 + -0.25), $MachinePrecision]), $MachinePrecision] / N[(re * 0.16666666666666666 + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right)\right) \cdot \left(-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;im \cdot \frac{\left(re \cdot re\right) \cdot \mathsf{fma}\left(re \cdot re, 0.027777777777777776, -0.25\right)}{\mathsf{fma}\left(re, 0.16666666666666666, -0.5\right)}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6467.2
Simplified67.2%
Taylor expanded in im around 0
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified53.9%
Taylor expanded in im around inf
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.8
Simplified15.8%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6496.8
Simplified96.8%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6438.0
Simplified38.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
accelerator-lowering-fma.f6437.8
Simplified37.8%
Taylor expanded in im around inf
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6420.3
Simplified20.3%
if 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6476.2
Simplified76.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6476.2
Simplified76.2%
Taylor expanded in im around 0
Simplified68.7%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sub-negN/A
swap-sqrN/A
metadata-evalN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6472.1
Applied egg-rr72.1%
Final simplification56.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
(if (<= t_0 -0.02)
(*
(sin im)
(fma
(* (* re re) (fma (* re re) 0.027777777777777776 -0.25))
(/ 1.0 (fma re 0.16666666666666666 -0.5))
(+ re 1.0)))
(if (<= t_0 4e-96)
t_1
(if (<= t_0 1.0)
(*
(sin im)
(fma
(fma re (* re re) 1.0)
(/ 1.0 (- (fma re re 1.0) re))
(* re (* re (fma re 0.16666666666666666 0.5)))))
t_1)))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = exp(re) * im;
double tmp;
if (t_0 <= -0.02) {
tmp = sin(im) * fma(((re * re) * fma((re * re), 0.027777777777777776, -0.25)), (1.0 / fma(re, 0.16666666666666666, -0.5)), (re + 1.0));
} else if (t_0 <= 4e-96) {
tmp = t_1;
} else if (t_0 <= 1.0) {
tmp = sin(im) * fma(fma(re, (re * re), 1.0), (1.0 / (fma(re, re, 1.0) - re)), (re * (re * fma(re, 0.16666666666666666, 0.5))));
} else {
tmp = t_1;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = Float64(exp(re) * im) tmp = 0.0 if (t_0 <= -0.02) tmp = Float64(sin(im) * fma(Float64(Float64(re * re) * fma(Float64(re * re), 0.027777777777777776, -0.25)), Float64(1.0 / fma(re, 0.16666666666666666, -0.5)), Float64(re + 1.0))); elseif (t_0 <= 4e-96) tmp = t_1; elseif (t_0 <= 1.0) tmp = Float64(sin(im) * fma(fma(re, Float64(re * re), 1.0), Float64(1.0 / Float64(fma(re, re, 1.0) - re)), Float64(re * Float64(re * fma(re, 0.16666666666666666, 0.5))))); else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, -0.02], N[(N[Sin[im], $MachinePrecision] * N[(N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * 0.027777777777777776 + -0.25), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(re * 0.16666666666666666 + -0.5), $MachinePrecision]), $MachinePrecision] + N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e-96], t$95$1, If[LessEqual[t$95$0, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(N[(re * N[(re * re), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 / N[(N[(re * re + 1.0), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision] + N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -0.02:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(\left(re \cdot re\right) \cdot \mathsf{fma}\left(re \cdot re, 0.027777777777777776, -0.25\right), \frac{1}{\mathsf{fma}\left(re, 0.16666666666666666, -0.5\right)}, re + 1\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(\mathsf{fma}\left(re, re \cdot re, 1\right), \frac{1}{\mathsf{fma}\left(re, re, 1\right) - re}, re \cdot \left(re \cdot \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6483.2
Simplified83.2%
distribute-rgt-inN/A
*-lft-identityN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
flip-+N/A
div-invN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr85.8%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 3.9999999999999996e-96 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.9%
if 3.9999999999999996e-96 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.8
Simplified99.8%
+-commutativeN/A
*-commutativeN/A
distribute-rgt1-inN/A
associate-+r+N/A
+-commutativeN/A
flip3-+N/A
div-invN/A
accelerator-lowering-fma.f64N/A
cube-multN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
*-rgt-identityN/A
associate-+r-N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
Applied egg-rr99.9%
Final simplification93.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (/ 1.0 (fma re 0.16666666666666666 -0.5)))
(t_1 (* (exp re) (sin im)))
(t_2 (* (exp re) im)))
(if (<= t_1 -0.02)
(*
(sin im)
(fma
(* (* re re) (fma (* re re) 0.027777777777777776 -0.25))
t_0
(+ re 1.0)))
(if (<= t_1 4e-96)
t_2
(if (<= t_1 1.0)
(* (sin im) (fma (* (* re re) -0.25) t_0 (+ re 1.0)))
t_2)))))
double code(double re, double im) {
double t_0 = 1.0 / fma(re, 0.16666666666666666, -0.5);
double t_1 = exp(re) * sin(im);
double t_2 = exp(re) * im;
double tmp;
if (t_1 <= -0.02) {
tmp = sin(im) * fma(((re * re) * fma((re * re), 0.027777777777777776, -0.25)), t_0, (re + 1.0));
} else if (t_1 <= 4e-96) {
tmp = t_2;
} else if (t_1 <= 1.0) {
tmp = sin(im) * fma(((re * re) * -0.25), t_0, (re + 1.0));
} else {
tmp = t_2;
}
return tmp;
}
function code(re, im) t_0 = Float64(1.0 / fma(re, 0.16666666666666666, -0.5)) t_1 = Float64(exp(re) * sin(im)) t_2 = Float64(exp(re) * im) tmp = 0.0 if (t_1 <= -0.02) tmp = Float64(sin(im) * fma(Float64(Float64(re * re) * fma(Float64(re * re), 0.027777777777777776, -0.25)), t_0, Float64(re + 1.0))); elseif (t_1 <= 4e-96) tmp = t_2; elseif (t_1 <= 1.0) tmp = Float64(sin(im) * fma(Float64(Float64(re * re) * -0.25), t_0, Float64(re + 1.0))); else tmp = t_2; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(1.0 / N[(re * 0.16666666666666666 + -0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$1, -0.02], N[(N[Sin[im], $MachinePrecision] * N[(N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * 0.027777777777777776 + -0.25), $MachinePrecision]), $MachinePrecision] * t$95$0 + N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-96], t$95$2, If[LessEqual[t$95$1, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(N[(N[(re * re), $MachinePrecision] * -0.25), $MachinePrecision] * t$95$0 + N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\mathsf{fma}\left(re, 0.16666666666666666, -0.5\right)}\\
t_1 := e^{re} \cdot \sin im\\
t_2 := e^{re} \cdot im\\
\mathbf{if}\;t\_1 \leq -0.02:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(\left(re \cdot re\right) \cdot \mathsf{fma}\left(re \cdot re, 0.027777777777777776, -0.25\right), t\_0, re + 1\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(\left(re \cdot re\right) \cdot -0.25, t\_0, re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6483.2
Simplified83.2%
distribute-rgt-inN/A
*-lft-identityN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
flip-+N/A
div-invN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr85.8%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 3.9999999999999996e-96 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.9%
if 3.9999999999999996e-96 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.8
Simplified99.8%
distribute-rgt-inN/A
*-lft-identityN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
flip-+N/A
div-invN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.8%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.9
Simplified99.9%
Final simplification93.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))))
(if (<= t_0 0.0)
(* im (* im (* im (fma re -0.16666666666666666 -0.16666666666666666))))
(if (<= t_0 0.0002)
(fma im (fma (* im im) -0.16666666666666666 re) im)
(* im (* re (* re (fma re 0.16666666666666666 0.5))))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double tmp;
if (t_0 <= 0.0) {
tmp = im * (im * (im * fma(re, -0.16666666666666666, -0.16666666666666666)));
} else if (t_0 <= 0.0002) {
tmp = fma(im, fma((im * im), -0.16666666666666666, re), im);
} else {
tmp = im * (re * (re * fma(re, 0.16666666666666666, 0.5)));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(im * Float64(im * Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)))); elseif (t_0 <= 0.0002) tmp = fma(im, fma(Float64(im * im), -0.16666666666666666, re), im); else tmp = Float64(im * Float64(re * Float64(re * fma(re, 0.16666666666666666, 0.5)))); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0002], N[(im * N[(N[(im * im), $MachinePrecision] * -0.16666666666666666 + re), $MachinePrecision] + im), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0.0002:\\
\;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot im, -0.16666666666666666, re\right), im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6444.4
Simplified44.4%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
accelerator-lowering-fma.f6425.2
Simplified25.2%
Taylor expanded in im around inf
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6414.9
Simplified14.9%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < 2.0000000000000001e-4Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6498.3
Simplified98.3%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
accelerator-lowering-fma.f6498.4
Simplified98.4%
Taylor expanded in re around 0
Simplified98.4%
if 2.0000000000000001e-4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6489.2
Simplified89.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6436.8
Simplified36.8%
Taylor expanded in im around 0
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6433.0
Simplified33.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))))
(if (<= t_0 0.0)
(* im (* im (* im (fma re -0.16666666666666666 -0.16666666666666666))))
(if (<= t_0 0.98)
(* im (fma re (fma re 0.5 1.0) 1.0))
(* im (* re (* re (* re 0.16666666666666666))))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double tmp;
if (t_0 <= 0.0) {
tmp = im * (im * (im * fma(re, -0.16666666666666666, -0.16666666666666666)));
} else if (t_0 <= 0.98) {
tmp = im * fma(re, fma(re, 0.5, 1.0), 1.0);
} else {
tmp = im * (re * (re * (re * 0.16666666666666666)));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(im * Float64(im * Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)))); elseif (t_0 <= 0.98) tmp = Float64(im * fma(re, fma(re, 0.5, 1.0), 1.0)); else tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666)))); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.98], N[(im * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0.98:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6444.4
Simplified44.4%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
accelerator-lowering-fma.f6425.2
Simplified25.2%
Taylor expanded in im around inf
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6414.9
Simplified14.9%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.97999999999999998Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6498.9
Simplified98.9%
Taylor expanded in im around 0
Simplified54.7%
if 0.97999999999999998 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6480.4
Simplified80.4%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6463.4
Simplified63.4%
Taylor expanded in im around 0
Simplified57.4%
Taylor expanded in re around inf
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6457.3
Simplified57.3%
Final simplification30.2%
(FPCore (re im)
:precision binary64
(if (<= (* (exp re) (sin im)) 0.0)
(* im (* im (* im (fma re -0.16666666666666666 -0.16666666666666666))))
(*
(fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)
(*
im
(fma
im
(* im (fma (* im im) 0.008333333333333333 -0.16666666666666666))
1.0)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = im * (im * (im * fma(re, -0.16666666666666666, -0.16666666666666666)));
} else {
tmp = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) * (im * fma(im, (im * fma((im * im), 0.008333333333333333, -0.16666666666666666)), 1.0));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(im * Float64(im * Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)))); else tmp = Float64(fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) * Float64(im * fma(im, Float64(im * fma(Float64(im * im), 0.008333333333333333, -0.16666666666666666)), 1.0))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right) \cdot \left(im \cdot \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6444.4
Simplified44.4%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
accelerator-lowering-fma.f6425.2
Simplified25.2%
Taylor expanded in im around inf
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6414.9
Simplified14.9%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6492.7
Simplified92.7%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6457.8
Simplified57.8%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* im (* im (* im (fma re -0.16666666666666666 -0.16666666666666666)))) (* im (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = im * (im * (im * fma(re, -0.16666666666666666, -0.16666666666666666)));
} else {
tmp = im * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(im * Float64(im * Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)))); else tmp = Float64(im * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6444.4
Simplified44.4%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
accelerator-lowering-fma.f6425.2
Simplified25.2%
Taylor expanded in im around inf
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6414.9
Simplified14.9%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6492.7
Simplified92.7%
Taylor expanded in im around 0
Simplified55.7%
Final simplification30.2%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0002) (* im (fma im (* im -0.16666666666666666) 1.0)) (* im (* re (* re (* re 0.16666666666666666))))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0002) {
tmp = im * fma(im, (im * -0.16666666666666666), 1.0);
} else {
tmp = im * (re * (re * (re * 0.16666666666666666)));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0002) tmp = Float64(im * fma(im, Float64(im * -0.16666666666666666), 1.0)); else tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666)))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0002], N[(im * N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.0002:\\
\;\;\;\;im \cdot \mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 2.0000000000000001e-4Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6453.6
Simplified53.6%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6438.0
Simplified38.0%
if 2.0000000000000001e-4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6489.2
Simplified89.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6436.8
Simplified36.8%
Taylor expanded in im around 0
Simplified33.0%
Taylor expanded in re around inf
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6432.9
Simplified32.9%
Final simplification36.8%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* im (fma im (* im -0.16666666666666666) 1.0)) (* im (fma re (fma re 0.5 1.0) 1.0))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = im * fma(im, (im * -0.16666666666666666), 1.0);
} else {
tmp = im * fma(re, fma(re, 0.5, 1.0), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(im * fma(im, Float64(im * -0.16666666666666666), 1.0)); else tmp = Float64(im * fma(re, fma(re, 0.5, 1.0), 1.0)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;im \cdot \mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6444.4
Simplified44.4%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6425.6
Simplified25.6%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6488.4
Simplified88.4%
Taylor expanded in im around 0
Simplified53.5%
Final simplification36.0%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0002) (* im (fma im (* im -0.16666666666666666) 1.0)) (* im (* 0.5 (* re re)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0002) {
tmp = im * fma(im, (im * -0.16666666666666666), 1.0);
} else {
tmp = im * (0.5 * (re * re));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0002) tmp = Float64(im * fma(im, Float64(im * -0.16666666666666666), 1.0)); else tmp = Float64(im * Float64(0.5 * Float64(re * re))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0002], N[(im * N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.0002:\\
\;\;\;\;im \cdot \mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 2.0000000000000001e-4Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6453.6
Simplified53.6%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6438.0
Simplified38.0%
if 2.0000000000000001e-4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6489.2
Simplified89.2%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6436.8
Simplified36.8%
Taylor expanded in im around 0
Simplified33.0%
Taylor expanded in re around 0
Simplified29.9%
Final simplification36.1%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.98) im (* im (* 0.5 (* re re)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.98) {
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 ((exp(re) * sin(im)) <= 0.98d0) 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 ((Math.exp(re) * Math.sin(im)) <= 0.98) {
tmp = im;
} else {
tmp = im * (0.5 * (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if (math.exp(re) * math.sin(im)) <= 0.98: tmp = im else: tmp = im * (0.5 * (re * re)) return tmp
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.98) 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 ((exp(re) * sin(im)) <= 0.98) tmp = im; else tmp = im * (0.5 * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.98], im, N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.98:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.97999999999999998Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6459.2
Simplified59.2%
Taylor expanded in im around 0
Simplified31.9%
if 0.97999999999999998 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6480.4
Simplified80.4%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6463.4
Simplified63.4%
Taylor expanded in im around 0
Simplified57.4%
Taylor expanded in re around 0
Simplified51.6%
Final simplification34.5%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.98) im (* 0.5 (* re (* re im)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.98) {
tmp = im;
} else {
tmp = 0.5 * (re * (re * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((exp(re) * sin(im)) <= 0.98d0) then
tmp = im
else
tmp = 0.5d0 * (re * (re * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((Math.exp(re) * Math.sin(im)) <= 0.98) {
tmp = im;
} else {
tmp = 0.5 * (re * (re * im));
}
return tmp;
}
def code(re, im): tmp = 0 if (math.exp(re) * math.sin(im)) <= 0.98: tmp = im else: tmp = 0.5 * (re * (re * im)) return tmp
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.98) tmp = im; else tmp = Float64(0.5 * Float64(re * Float64(re * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((exp(re) * sin(im)) <= 0.98) tmp = im; else tmp = 0.5 * (re * (re * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.98], im, N[(0.5 * N[(re * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.98:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(re \cdot im\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.97999999999999998Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6459.2
Simplified59.2%
Taylor expanded in im around 0
Simplified31.9%
if 0.97999999999999998 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6480.4
Simplified80.4%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6463.4
Simplified63.4%
Taylor expanded in im around 0
Simplified57.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6440.8
Simplified40.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ (* (fma re 0.16666666666666666 0.5) (* re re)) (- -1.0 re))))
(if (<= re -0.0042)
(* (exp re) im)
(if (<= re 2.05e+102)
(/
(*
(sin im)
(* (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0) t_0))
t_0)
(* (sin im) (* 0.16666666666666666 (* re (* re re))))))))
double code(double re, double im) {
double t_0 = (fma(re, 0.16666666666666666, 0.5) * (re * re)) + (-1.0 - re);
double tmp;
if (re <= -0.0042) {
tmp = exp(re) * im;
} else if (re <= 2.05e+102) {
tmp = (sin(im) * (fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) * t_0)) / t_0;
} else {
tmp = sin(im) * (0.16666666666666666 * (re * (re * re)));
}
return tmp;
}
function code(re, im) t_0 = Float64(Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)) + Float64(-1.0 - re)) tmp = 0.0 if (re <= -0.0042) tmp = Float64(exp(re) * im); elseif (re <= 2.05e+102) tmp = Float64(Float64(sin(im) * Float64(fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) * t_0)) / t_0); else tmp = Float64(sin(im) * Float64(0.16666666666666666 * Float64(re * Float64(re * re)))); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.0042], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 2.05e+102], N[(N[(N[Sin[im], $MachinePrecision] * N[(N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sin[im], $MachinePrecision] * N[(0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right) + \left(-1 - re\right)\\
\mathbf{if}\;re \leq -0.0042:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 2.05 \cdot 10^{+102}:\\
\;\;\;\;\frac{\sin im \cdot \left(\mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right) \cdot t\_0\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin im \cdot \left(0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -0.00419999999999999974Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
if -0.00419999999999999974 < re < 2.05e102Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6487.9
Simplified87.9%
distribute-rgt-inN/A
*-lft-identityN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
flip-+N/A
div-invN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr90.3%
Applied egg-rr94.6%
if 2.05e102 < re Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64100.0
Simplified100.0%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
Final simplification96.7%
(FPCore (re im) :precision binary64 (if (<= im 2.85e+23) im (* re im)))
double code(double re, double im) {
double tmp;
if (im <= 2.85e+23) {
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 <= 2.85d+23) 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 <= 2.85e+23) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.85e+23: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (im <= 2.85e+23) tmp = im; else tmp = Float64(re * im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.85e+23) tmp = im; else tmp = re * im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.85e+23], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.85 \cdot 10^{+23}:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if im < 2.85e23Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6454.0
Simplified54.0%
Taylor expanded in im around 0
Simplified35.3%
if 2.85e23 < im Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6455.1
Simplified55.1%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
accelerator-lowering-fma.f648.7
Simplified8.7%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
accelerator-lowering-fma.f6412.8
Simplified12.8%
Taylor expanded in re around inf
*-commutativeN/A
*-lowering-*.f6414.1
Simplified14.1%
(FPCore (re im) :precision binary64 (fma im re im))
double code(double re, double im) {
return fma(im, re, im);
}
function code(re, im) return fma(im, re, im) end
code[re_, im_] := N[(im * re + im), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(im, re, im\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
Simplified68.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f6432.2
Simplified32.2%
(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.f6454.0
Simplified54.0%
Taylor expanded in im around 0
Simplified28.0%
herbie shell --seed 2024194
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))