
(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 26 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 (* (sin im) (+ re 1.0)))
(t_2 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
(* im (* re (* re re)))
(fma (* im im) -0.027777777777777776 0.16666666666666666))
(if (<= t_0 -0.02)
t_1
(if (<= t_0 1e-55) t_2 (if (<= t_0 50000.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 = (im * (re * (re * re))) * fma((im * im), -0.027777777777777776, 0.16666666666666666);
} else if (t_0 <= -0.02) {
tmp = t_1;
} else if (t_0 <= 1e-55) {
tmp = t_2;
} else if (t_0 <= 50000.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(im * Float64(re * Float64(re * re))) * fma(Float64(im * im), -0.027777777777777776, 0.16666666666666666)); elseif (t_0 <= -0.02) tmp = t_1; elseif (t_0 <= 1e-55) tmp = t_2; elseif (t_0 <= 50000.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[(im * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * -0.027777777777777776 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], t$95$1, If[LessEqual[t$95$0, 1e-55], t$95$2, If[LessEqual[t$95$0, 50000.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(im \cdot \left(re \cdot \left(re \cdot re\right)\right)\right) \cdot \mathsf{fma}\left(im \cdot im, -0.027777777777777776, 0.16666666666666666\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{-55}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq 50000:\\
\;\;\;\;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.f6478.1
Simplified78.1%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.1
Simplified78.1%
Taylor expanded in im around 0
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
Simplified58.1%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 9.99999999999999995e-56 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5e4Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6497.2
Simplified97.2%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999995e-56 or 5e4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified93.3%
Final simplification89.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
(* im (* re (* re re)))
(fma (* im im) -0.027777777777777776 0.16666666666666666))
(if (<= t_0 -0.02)
(sin im)
(if (<= t_0 1e-55) t_1 (if (<= t_0 50000.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 = (im * (re * (re * re))) * fma((im * im), -0.027777777777777776, 0.16666666666666666);
} else if (t_0 <= -0.02) {
tmp = sin(im);
} else if (t_0 <= 1e-55) {
tmp = t_1;
} else if (t_0 <= 50000.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(im * Float64(re * Float64(re * re))) * fma(Float64(im * im), -0.027777777777777776, 0.16666666666666666)); elseif (t_0 <= -0.02) tmp = sin(im); elseif (t_0 <= 1e-55) tmp = t_1; elseif (t_0 <= 50000.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[(im * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * -0.027777777777777776 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 1e-55], t$95$1, If[LessEqual[t$95$0, 50000.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(im \cdot \left(re \cdot \left(re \cdot re\right)\right)\right) \cdot \mathsf{fma}\left(im \cdot im, -0.027777777777777776, 0.16666666666666666\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_0 \leq 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 50000:\\
\;\;\;\;\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.f6478.1
Simplified78.1%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.1
Simplified78.1%
Taylor expanded in im around 0
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
Simplified58.1%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 9.99999999999999995e-56 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5e4Initial program 99.9%
Taylor expanded in re around 0
sin-lowering-sin.f6496.0
Simplified96.0%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999995e-56 or 5e4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified93.3%
Final simplification89.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im)))
(t_1 (fma re (fma re 0.16666666666666666 0.5) 1.0)))
(if (<= t_0 (- INFINITY))
(*
(* im (* re (* re re)))
(fma (* im im) -0.027777777777777776 0.16666666666666666))
(if (<= t_0 -0.02)
(sin im)
(if (<= t_0 1e-55)
(/ -1.0 (/ (fma re t_1 -1.0) im))
(if (<= t_0 50000.0)
(sin im)
(/
1.0
(/
(+ re -1.0)
(*
im
(fma
re
(* t_1 (fma (fma re 0.16666666666666666 0.5) (* re re) re))
-1.0))))))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = fma(re, fma(re, 0.16666666666666666, 0.5), 1.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (im * (re * (re * re))) * fma((im * im), -0.027777777777777776, 0.16666666666666666);
} else if (t_0 <= -0.02) {
tmp = sin(im);
} else if (t_0 <= 1e-55) {
tmp = -1.0 / (fma(re, t_1, -1.0) / im);
} else if (t_0 <= 50000.0) {
tmp = sin(im);
} else {
tmp = 1.0 / ((re + -1.0) / (im * fma(re, (t_1 * fma(fma(re, 0.16666666666666666, 0.5), (re * re), re)), -1.0)));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = fma(re, fma(re, 0.16666666666666666, 0.5), 1.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(im * Float64(re * Float64(re * re))) * fma(Float64(im * im), -0.027777777777777776, 0.16666666666666666)); elseif (t_0 <= -0.02) tmp = sin(im); elseif (t_0 <= 1e-55) tmp = Float64(-1.0 / Float64(fma(re, t_1, -1.0) / im)); elseif (t_0 <= 50000.0) tmp = sin(im); else tmp = Float64(1.0 / Float64(Float64(re + -1.0) / Float64(im * fma(re, Float64(t_1 * fma(fma(re, 0.16666666666666666, 0.5), Float64(re * re), re)), -1.0)))); 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[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(im * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * -0.027777777777777776 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 1e-55], N[(-1.0 / N[(N[(re * t$95$1 + -1.0), $MachinePrecision] / im), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 50000.0], N[Sin[im], $MachinePrecision], N[(1.0 / N[(N[(re + -1.0), $MachinePrecision] / N[(im * N[(re * N[(t$95$1 * N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(im \cdot \left(re \cdot \left(re \cdot re\right)\right)\right) \cdot \mathsf{fma}\left(im \cdot im, -0.027777777777777776, 0.16666666666666666\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_0 \leq 10^{-55}:\\
\;\;\;\;\frac{-1}{\frac{\mathsf{fma}\left(re, t\_1, -1\right)}{im}}\\
\mathbf{elif}\;t\_0 \leq 50000:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{re + -1}{im \cdot \mathsf{fma}\left(re, t\_1 \cdot \mathsf{fma}\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), re \cdot re, re\right), -1\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.f6478.1
Simplified78.1%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.1
Simplified78.1%
Taylor expanded in im around 0
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
Simplified58.1%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 9.99999999999999995e-56 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5e4Initial program 99.9%
Taylor expanded in re around 0
sin-lowering-sin.f6496.0
Simplified96.0%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999995e-56Initial 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.f6448.7
Simplified48.7%
Taylor expanded in im around 0
Simplified48.7%
flip-+N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr48.0%
Taylor expanded in re around 0
mul-1-negN/A
neg-lowering-neg.f6484.6
Simplified84.6%
if 5e4 < (*.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.f6465.6
Simplified65.6%
Taylor expanded in im around 0
Simplified41.0%
flip-+N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr12.6%
Taylor expanded in re around 0
sub-negN/A
metadata-evalN/A
+-lowering-+.f6448.8
Simplified48.8%
Final simplification81.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
(if (<= t_0 -0.02)
(/
(sin im)
(/ 1.0 (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))
(if (<= t_0 2e-130)
t_1
(if (<= t_0 50000.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 <= -0.02) {
tmp = sin(im) / (1.0 / fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
} else if (t_0 <= 2e-130) {
tmp = t_1;
} else if (t_0 <= 50000.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 <= -0.02) tmp = Float64(sin(im) / Float64(1.0 / fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0))); elseif (t_0 <= 2e-130) tmp = t_1; elseif (t_0 <= 50000.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, -0.02], N[(N[Sin[im], $MachinePrecision] / N[(1.0 / N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-130], t$95$1, If[LessEqual[t$95$0, 50000.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 -0.02:\\
\;\;\;\;\frac{\sin im}{\frac{1}{\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 2 \cdot 10^{-130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 50000:\\
\;\;\;\;\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)) < -0.0200000000000000004Initial 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.f6486.6
Simplified86.6%
*-commutativeN/A
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
Applied egg-rr86.6%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 2.0000000000000002e-130 or 5e4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified93.1%
if 2.0000000000000002e-130 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5e4Initial 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%
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-+.f64100.0
Applied egg-rr100.0%
Final simplification92.7%
(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 (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
(if (<= t_0 2e-130)
t_1
(if (<= t_0 50000.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 <= -0.02) {
tmp = sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
} else if (t_0 <= 2e-130) {
tmp = t_1;
} else if (t_0 <= 50000.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 <= -0.02) tmp = Float64(sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)); elseif (t_0 <= 2e-130) tmp = t_1; elseif (t_0 <= 50000.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, -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, 2e-130], t$95$1, If[LessEqual[t$95$0, 50000.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 -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 2 \cdot 10^{-130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 50000:\\
\;\;\;\;\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)) < -0.0200000000000000004Initial 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.f6486.6
Simplified86.6%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 2.0000000000000002e-130 or 5e4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified93.1%
if 2.0000000000000002e-130 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5e4Initial 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%
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-+.f64100.0
Applied egg-rr100.0%
Final simplification92.7%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
(sin im)
(fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))
(t_1 (* (exp re) (sin im)))
(t_2 (* (exp re) im)))
(if (<= t_1 -0.02)
t_0
(if (<= t_1 2e-130) t_2 (if (<= t_1 50000.0) t_0 t_2)))))
double code(double re, double im) {
double t_0 = sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
double t_1 = exp(re) * sin(im);
double t_2 = exp(re) * im;
double tmp;
if (t_1 <= -0.02) {
tmp = t_0;
} else if (t_1 <= 2e-130) {
tmp = t_2;
} else if (t_1 <= 50000.0) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
function code(re, im) t_0 = Float64(sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)) t_1 = Float64(exp(re) * sin(im)) t_2 = Float64(exp(re) * im) tmp = 0.0 if (t_1 <= -0.02) tmp = t_0; elseif (t_1 <= 2e-130) tmp = t_2; elseif (t_1 <= 50000.0) tmp = t_0; else tmp = t_2; end return tmp end
code[re_, im_] := Block[{t$95$0 = 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$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], t$95$0, If[LessEqual[t$95$1, 2e-130], t$95$2, If[LessEqual[t$95$1, 50000.0], t$95$0, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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_1 := e^{re} \cdot \sin im\\
t_2 := e^{re} \cdot im\\
\mathbf{if}\;t\_1 \leq -0.02:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-130}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 50000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 2.0000000000000002e-130 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5e4Initial 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.f6492.2
Simplified92.2%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 2.0000000000000002e-130 or 5e4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified93.1%
Final simplification92.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)) (t_1 (* (exp re) (sin im))))
(if (<= t_1 -0.02)
(* (sin im) (fma re (fma re 0.5 1.0) 1.0))
(if (<= t_1 1e-55)
t_0
(if (<= t_1 50000.0)
(* (sin im) (fma (* re re) 0.5 (+ re 1.0)))
t_0)))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double t_1 = exp(re) * sin(im);
double tmp;
if (t_1 <= -0.02) {
tmp = sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0);
} else if (t_1 <= 1e-55) {
tmp = t_0;
} else if (t_1 <= 50000.0) {
tmp = sin(im) * fma((re * re), 0.5, (re + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * im) t_1 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_1 <= -0.02) tmp = Float64(sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0)); elseif (t_1 <= 1e-55) tmp = t_0; elseif (t_1 <= 50000.0) tmp = Float64(sin(im) * fma(Float64(re * re), 0.5, Float64(re + 1.0))); else tmp = t_0; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -0.02], N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-55], t$95$0, If[LessEqual[t$95$1, 50000.0], N[(N[Sin[im], $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * 0.5 + N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
t_1 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_1 \leq -0.02:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-55}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 50000:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(re \cdot re, 0.5, re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6479.3
Simplified79.3%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999995e-56 or 5e4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified93.3%
if 9.99999999999999995e-56 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5e4Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64100.0
Simplified100.0%
distribute-lft-inN/A
*-rgt-identityN/A
associate-+l+N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64100.0
Applied egg-rr100.0%
Final simplification90.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im))
(t_1 (* (exp re) (sin im)))
(t_2 (* (sin im) (fma re (fma re 0.5 1.0) 1.0))))
(if (<= t_1 -0.02)
t_2
(if (<= t_1 1e-55) t_0 (if (<= t_1 50000.0) t_2 t_0)))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double t_1 = exp(re) * sin(im);
double t_2 = sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0);
double tmp;
if (t_1 <= -0.02) {
tmp = t_2;
} else if (t_1 <= 1e-55) {
tmp = t_0;
} else if (t_1 <= 50000.0) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * im) t_1 = Float64(exp(re) * sin(im)) t_2 = Float64(sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0)) tmp = 0.0 if (t_1 <= -0.02) tmp = t_2; elseif (t_1 <= 1e-55) tmp = t_0; elseif (t_1 <= 50000.0) tmp = t_2; else tmp = t_0; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -0.02], t$95$2, If[LessEqual[t$95$1, 1e-55], t$95$0, If[LessEqual[t$95$1, 50000.0], t$95$2, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
t_1 := e^{re} \cdot \sin im\\
t_2 := \sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
\mathbf{if}\;t\_1 \leq -0.02:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-55}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 50000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 9.99999999999999995e-56 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5e4Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6487.7
Simplified87.7%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999995e-56 or 5e4 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified93.3%
Final simplification90.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im)))
(t_1 (fma re (fma re 0.16666666666666666 0.5) 1.0)))
(if (<= t_0 -0.02)
(* im (* re (* re (fma (* im im) -0.08333333333333333 0.5))))
(if (<= t_0 2e-130)
(/ -1.0 (/ (fma re t_1 -1.0) im))
(/
1.0
(/
(+ re -1.0)
(*
im
(fma
re
(* t_1 (fma (fma re 0.16666666666666666 0.5) (* re re) re))
-1.0))))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = fma(re, fma(re, 0.16666666666666666, 0.5), 1.0);
double tmp;
if (t_0 <= -0.02) {
tmp = im * (re * (re * fma((im * im), -0.08333333333333333, 0.5)));
} else if (t_0 <= 2e-130) {
tmp = -1.0 / (fma(re, t_1, -1.0) / im);
} else {
tmp = 1.0 / ((re + -1.0) / (im * fma(re, (t_1 * fma(fma(re, 0.16666666666666666, 0.5), (re * re), re)), -1.0)));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = fma(re, fma(re, 0.16666666666666666, 0.5), 1.0) tmp = 0.0 if (t_0 <= -0.02) tmp = Float64(im * Float64(re * Float64(re * fma(Float64(im * im), -0.08333333333333333, 0.5)))); elseif (t_0 <= 2e-130) tmp = Float64(-1.0 / Float64(fma(re, t_1, -1.0) / im)); else tmp = Float64(1.0 / Float64(Float64(re + -1.0) / Float64(im * fma(re, Float64(t_1 * fma(fma(re, 0.16666666666666666, 0.5), Float64(re * re), re)), -1.0)))); 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[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, -0.02], N[(im * N[(re * N[(re * N[(N[(im * im), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-130], N[(-1.0 / N[(N[(re * t$95$1 + -1.0), $MachinePrecision] / im), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(re + -1.0), $MachinePrecision] / N[(im * N[(re * N[(t$95$1 * N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -0.02:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, 0.5\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-130}:\\
\;\;\;\;\frac{-1}{\frac{\mathsf{fma}\left(re, t\_1, -1\right)}{im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{re + -1}{im \cdot \mathsf{fma}\left(re, t\_1 \cdot \mathsf{fma}\left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), re \cdot re, re\right), -1\right)}}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6479.3
Simplified79.3%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified25.0%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
Simplified25.3%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 2.0000000000000002e-130Initial 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.f6447.3
Simplified47.3%
Taylor expanded in im around 0
Simplified47.3%
flip-+N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr46.6%
Taylor expanded in re around 0
mul-1-negN/A
neg-lowering-neg.f6484.2
Simplified84.2%
if 2.0000000000000002e-130 < (*.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.f6488.5
Simplified88.5%
Taylor expanded in im around 0
Simplified24.0%
flip-+N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr14.5%
Taylor expanded in re around 0
sub-negN/A
metadata-evalN/A
+-lowering-+.f6426.5
Simplified26.5%
Final simplification51.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))))
(if (<= t_0 -0.02)
(* im (* re (* re (fma (* im im) -0.08333333333333333 0.5))))
(if (<= t_0 0.0)
(/
-1.0
(/ (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) -1.0) im))
(*
im
(fma
(* (* re re) (fma (* re re) 0.027777777777777776 -0.25))
(/ 1.0 (fma re 0.16666666666666666 -0.5))
(+ re 1.0)))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double tmp;
if (t_0 <= -0.02) {
tmp = im * (re * (re * fma((im * im), -0.08333333333333333, 0.5)));
} else if (t_0 <= 0.0) {
tmp = -1.0 / (fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), -1.0) / im);
} else {
tmp = im * fma(((re * re) * fma((re * re), 0.027777777777777776, -0.25)), (1.0 / fma(re, 0.16666666666666666, -0.5)), (re + 1.0));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_0 <= -0.02) tmp = Float64(im * Float64(re * Float64(re * fma(Float64(im * im), -0.08333333333333333, 0.5)))); elseif (t_0 <= 0.0) tmp = Float64(-1.0 / Float64(fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), -1.0) / im)); else tmp = Float64(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))); 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.02], N[(im * N[(re * N[(re * N[(N[(im * im), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(-1.0 / N[(N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + -1.0), $MachinePrecision] / im), $MachinePrecision]), $MachinePrecision], N[(im * 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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq -0.02:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, 0.5\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{-1}{\frac{\mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), -1\right)}{im}}\\
\mathbf{else}:\\
\;\;\;\;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)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6479.3
Simplified79.3%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified25.0%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
Simplified25.3%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.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.f6437.0
Simplified37.0%
Taylor expanded in im around 0
Simplified37.0%
flip-+N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr36.2%
Taylor expanded in re around 0
mul-1-negN/A
neg-lowering-neg.f6482.9
Simplified82.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.f6489.8
Simplified89.8%
Taylor expanded in im around 0
Simplified38.8%
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
associate-*r*N/A
flip-+N/A
associate-*r/N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr38.8%
Final simplification51.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im)))
(t_1 (fma re (fma re 0.16666666666666666 0.5) 1.0)))
(if (<= t_0 -0.02)
(* im (* re (* re (fma (* im im) -0.08333333333333333 0.5))))
(if (<= t_0 0.0)
(/ -1.0 (/ (fma re t_1 -1.0) im))
(* im (fma re t_1 1.0))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = fma(re, fma(re, 0.16666666666666666, 0.5), 1.0);
double tmp;
if (t_0 <= -0.02) {
tmp = im * (re * (re * fma((im * im), -0.08333333333333333, 0.5)));
} else if (t_0 <= 0.0) {
tmp = -1.0 / (fma(re, t_1, -1.0) / im);
} else {
tmp = im * fma(re, t_1, 1.0);
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = fma(re, fma(re, 0.16666666666666666, 0.5), 1.0) tmp = 0.0 if (t_0 <= -0.02) tmp = Float64(im * Float64(re * Float64(re * fma(Float64(im * im), -0.08333333333333333, 0.5)))); elseif (t_0 <= 0.0) tmp = Float64(-1.0 / Float64(fma(re, t_1, -1.0) / im)); else tmp = Float64(im * fma(re, t_1, 1.0)); 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[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, -0.02], N[(im * N[(re * N[(re * N[(N[(im * im), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(-1.0 / N[(N[(re * t$95$1 + -1.0), $MachinePrecision] / im), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -0.02:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, 0.5\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{-1}{\frac{\mathsf{fma}\left(re, t\_1, -1\right)}{im}}\\
\mathbf{else}:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, t\_1, 1\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6479.3
Simplified79.3%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified25.0%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
Simplified25.3%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.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.f6437.0
Simplified37.0%
Taylor expanded in im around 0
Simplified37.0%
flip-+N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr36.2%
Taylor expanded in re around 0
mul-1-negN/A
neg-lowering-neg.f6482.9
Simplified82.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.f6489.8
Simplified89.8%
Taylor expanded in im around 0
Simplified38.8%
Final simplification51.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))))
(if (<= t_0 0.0)
(* (* im (* im -0.16666666666666666)) (fma re im im))
(if (<= t_0 0.9)
(fma re (fma im (* re 0.5) im) im)
(* im (* (fma re 0.16666666666666666 0.5) (* re re)))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double tmp;
if (t_0 <= 0.0) {
tmp = (im * (im * -0.16666666666666666)) * fma(re, im, im);
} else if (t_0 <= 0.9) {
tmp = fma(re, fma(im, (re * 0.5), im), im);
} else {
tmp = im * (fma(re, 0.16666666666666666, 0.5) * (re * re));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(im * Float64(im * -0.16666666666666666)) * fma(re, im, im)); elseif (t_0 <= 0.9) tmp = fma(re, fma(im, Float64(re * 0.5), im), im); else tmp = Float64(im * Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re))); 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[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * im + im), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.9], N[(re * N[(im * N[(re * 0.5), $MachinePrecision] + im), $MachinePrecision] + im), $MachinePrecision], N[(im * N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right) \cdot \mathsf{fma}\left(re, im, im\right)\\
\mathbf{elif}\;t\_0 \leq 0.9:\\
\;\;\;\;\mathsf{fma}\left(re, \mathsf{fma}\left(im, re \cdot 0.5, im\right), im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\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
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6455.2
Simplified55.2%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified31.9%
Taylor expanded in re around 0
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
accelerator-lowering-fma.f6424.0
Simplified24.0%
Taylor expanded in im around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6411.9
Simplified11.9%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.900000000000000022Initial program 100.0%
Taylor expanded in im around 0
Simplified46.5%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6444.2
Simplified44.2%
if 0.900000000000000022 < (*.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.1
Simplified76.1%
Taylor expanded in im around 0
Simplified29.3%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6430.0
Simplified30.0%
Final simplification21.9%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* (- -1.0 re) (* 0.16666666666666666 (* im (* im im)))) (* 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 = (-1.0 - re) * (0.16666666666666666 * (im * (im * im)));
} 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(Float64(-1.0 - re) * Float64(0.16666666666666666 * Float64(im * Float64(im * im)))); 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[(N[(-1.0 - re), $MachinePrecision] * N[(0.16666666666666666 * N[(im * N[(im * im), $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:\\
\;\;\;\;\left(-1 - re\right) \cdot \left(0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\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
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6455.2
Simplified55.2%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified31.9%
Taylor expanded in re around 0
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
accelerator-lowering-fma.f6424.0
Simplified24.0%
Taylor expanded in im around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.4
Simplified15.4%
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.f6489.8
Simplified89.8%
Taylor expanded in im around 0
Simplified38.8%
Final simplification24.1%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* (- -1.0 re) (* 0.16666666666666666 (* im (* im im)))) (* im (fma re (* re (* re 0.16666666666666666)) 1.0))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = (-1.0 - re) * (0.16666666666666666 * (im * (im * im)));
} else {
tmp = im * fma(re, (re * (re * 0.16666666666666666)), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(Float64(-1.0 - re) * Float64(0.16666666666666666 * Float64(im * Float64(im * im)))); else tmp = Float64(im * fma(re, Float64(re * Float64(re * 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[(N[(-1.0 - re), $MachinePrecision] * N[(0.16666666666666666 * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;\left(-1 - re\right) \cdot \left(0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, re \cdot \left(re \cdot 0.16666666666666666\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
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6455.2
Simplified55.2%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified31.9%
Taylor expanded in re around 0
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
accelerator-lowering-fma.f6424.0
Simplified24.0%
Taylor expanded in im around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.4
Simplified15.4%
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.f6489.8
Simplified89.8%
Taylor expanded in im around 0
Simplified38.8%
Taylor expanded in re around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6437.1
Simplified37.1%
Final simplification23.5%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* (* im (* im -0.16666666666666666)) (fma re im im)) (* im (fma re (* re (* re 0.16666666666666666)) 1.0))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = (im * (im * -0.16666666666666666)) * fma(re, im, im);
} else {
tmp = im * fma(re, (re * (re * 0.16666666666666666)), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(Float64(im * Float64(im * -0.16666666666666666)) * fma(re, im, im)); else tmp = Float64(im * fma(re, Float64(re * Float64(re * 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[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * im + im), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right) \cdot \mathsf{fma}\left(re, im, im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, re \cdot \left(re \cdot 0.16666666666666666\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
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6455.2
Simplified55.2%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified31.9%
Taylor expanded in re around 0
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
accelerator-lowering-fma.f6424.0
Simplified24.0%
Taylor expanded in im around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6411.9
Simplified11.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.f6489.8
Simplified89.8%
Taylor expanded in im around 0
Simplified38.8%
Taylor expanded in re around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6437.1
Simplified37.1%
Final simplification21.2%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* (* im (* im -0.16666666666666666)) (fma re im im)) (* 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 * (im * -0.16666666666666666)) * fma(re, im, im);
} 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(Float64(im * Float64(im * -0.16666666666666666)) * fma(re, im, im)); 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[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * im + im), $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:\\
\;\;\;\;\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right) \cdot \mathsf{fma}\left(re, im, im\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
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6455.2
Simplified55.2%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified31.9%
Taylor expanded in re around 0
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
accelerator-lowering-fma.f6424.0
Simplified24.0%
Taylor expanded in im around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6411.9
Simplified11.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
*-commutativeN/A
accelerator-lowering-fma.f6487.5
Simplified87.5%
Taylor expanded in im around 0
Simplified38.5%
Final simplification21.8%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* im (* -0.16666666666666666 (* im (fma re im im)))) (* 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 * (-0.16666666666666666 * (im * fma(re, im, im)));
} 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 * Float64(-0.16666666666666666 * Float64(im * fma(re, im, im)))); 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[(-0.16666666666666666 * N[(im * N[(re * im + im), $MachinePrecision]), $MachinePrecision]), $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 \left(-0.16666666666666666 \cdot \left(im \cdot \mathsf{fma}\left(re, im, im\right)\right)\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
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6455.2
Simplified55.2%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified31.9%
Taylor expanded in re around 0
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
accelerator-lowering-fma.f6424.0
Simplified24.0%
Taylor expanded in im around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
distribute-lft-inN/A
*-rgt-identityN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6411.3
Simplified11.3%
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.f6487.5
Simplified87.5%
Taylor expanded in im around 0
Simplified38.5%
Final simplification21.4%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.001) (fma im (* (* im im) -0.16666666666666666) im) (* im (* 0.16666666666666666 (* re (* re re))))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.001) {
tmp = fma(im, ((im * im) * -0.16666666666666666), im);
} else {
tmp = im * (0.16666666666666666 * (re * (re * re)));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.001) tmp = fma(im, Float64(Float64(im * im) * -0.16666666666666666), im); else tmp = Float64(im * Float64(0.16666666666666666 * Float64(re * Float64(re * re)))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.001], N[(im * N[(N[(im * im), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision], N[(im * N[(0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.001:\\
\;\;\;\;\mathsf{fma}\left(im, \left(im \cdot im\right) \cdot -0.16666666666666666, im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 1e-3Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6448.6
Simplified48.6%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6433.0
Simplified33.0%
if 1e-3 < (*.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.f6487.3
Simplified87.3%
Taylor expanded in im around 0
Simplified16.8%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.3
Simplified17.3%
Final simplification28.8%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.001) (fma im (* (* im im) -0.16666666666666666) im) (* 0.16666666666666666 (* im (* re (* re re))))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.001) {
tmp = fma(im, ((im * im) * -0.16666666666666666), im);
} else {
tmp = 0.16666666666666666 * (im * (re * (re * re)));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.001) tmp = fma(im, Float64(Float64(im * im) * -0.16666666666666666), im); else tmp = Float64(0.16666666666666666 * Float64(im * Float64(re * Float64(re * re)))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.001], N[(im * N[(N[(im * im), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision], N[(0.16666666666666666 * N[(im * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.001:\\
\;\;\;\;\mathsf{fma}\left(im, \left(im \cdot im\right) \cdot -0.16666666666666666, im\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(im \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 1e-3Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6448.6
Simplified48.6%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6433.0
Simplified33.0%
if 1e-3 < (*.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.f6487.3
Simplified87.3%
Taylor expanded in im around 0
Simplified16.8%
Taylor expanded in re around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.3
Simplified17.3%
Final simplification28.8%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (fma im (* (* im im) -0.16666666666666666) im) (* 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 = fma(im, ((im * im) * -0.16666666666666666), im);
} 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 = fma(im, Float64(Float64(im * im) * -0.16666666666666666), im); 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[(N[(im * im), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + im), $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:\\
\;\;\;\;\mathsf{fma}\left(im, \left(im \cdot im\right) \cdot -0.16666666666666666, im\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.f6441.6
Simplified41.6%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6423.4
Simplified23.4%
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.f6487.5
Simplified87.5%
Taylor expanded in im around 0
Simplified38.5%
Final simplification29.0%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (fma im (* (* im im) -0.16666666666666666) im) (fma im re im)))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = fma(im, ((im * im) * -0.16666666666666666), im);
} else {
tmp = fma(im, re, im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = fma(im, Float64(Float64(im * im) * -0.16666666666666666), im); else tmp = fma(im, re, im); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(N[(im * im), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision], N[(im * re + im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;\mathsf{fma}\left(im, \left(im \cdot im\right) \cdot -0.16666666666666666, im\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im, re, im\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.f6441.6
Simplified41.6%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6423.4
Simplified23.4%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified46.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f6432.8
Simplified32.8%
Final simplification26.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -0.00076)
t_0
(if (<= re 9.5e-6)
(* (sin im) (+ re 1.0))
(if (<= re 1.9e+154) t_0 (* (sin im) (* re (* re 0.5))))))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.00076) {
tmp = t_0;
} else if (re <= 9.5e-6) {
tmp = sin(im) * (re + 1.0);
} else if (re <= 1.9e+154) {
tmp = t_0;
} else {
tmp = sin(im) * (re * (re * 0.5));
}
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.00076d0)) then
tmp = t_0
else if (re <= 9.5d-6) then
tmp = sin(im) * (re + 1.0d0)
else if (re <= 1.9d+154) then
tmp = t_0
else
tmp = sin(im) * (re * (re * 0.5d0))
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.00076) {
tmp = t_0;
} else if (re <= 9.5e-6) {
tmp = Math.sin(im) * (re + 1.0);
} else if (re <= 1.9e+154) {
tmp = t_0;
} else {
tmp = Math.sin(im) * (re * (re * 0.5));
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.00076: tmp = t_0 elif re <= 9.5e-6: tmp = math.sin(im) * (re + 1.0) elif re <= 1.9e+154: tmp = t_0 else: tmp = math.sin(im) * (re * (re * 0.5)) return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -0.00076) tmp = t_0; elseif (re <= 9.5e-6) tmp = Float64(sin(im) * Float64(re + 1.0)); elseif (re <= 1.9e+154) tmp = t_0; else tmp = Float64(sin(im) * Float64(re * Float64(re * 0.5))); end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -0.00076) tmp = t_0; elseif (re <= 9.5e-6) tmp = sin(im) * (re + 1.0); elseif (re <= 1.9e+154) tmp = t_0; else tmp = sin(im) * (re * (re * 0.5)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.00076], t$95$0, If[LessEqual[re, 9.5e-6], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9e+154], t$95$0, N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.00076:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 9.5 \cdot 10^{-6}:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin im \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if re < -7.6000000000000004e-4 or 9.5000000000000005e-6 < re < 1.8999999999999999e154Initial program 99.9%
Taylor expanded in im around 0
Simplified92.0%
if -7.6000000000000004e-4 < re < 9.5000000000000005e-6Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6499.7
Simplified99.7%
if 1.8999999999999999e154 < re Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64100.0
Simplified100.0%
Taylor expanded in re around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0
Simplified100.0%
Final simplification97.0%
(FPCore (re im) :precision binary64 (if (<= im 7.6e+46) im (* re im)))
double code(double re, double im) {
double tmp;
if (im <= 7.6e+46) {
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 <= 7.6d+46) 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 <= 7.6e+46) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 7.6e+46: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (im <= 7.6e+46) tmp = im; else tmp = Float64(re * im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 7.6e+46) tmp = im; else tmp = re * im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 7.6e+46], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 7.6 \cdot 10^{+46}:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if im < 7.5999999999999998e46Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6451.0
Simplified51.0%
Taylor expanded in im around 0
Simplified30.6%
if 7.5999999999999998e46 < 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.f6469.8
Simplified69.8%
Taylor expanded in im around 0
Simplified12.5%
Taylor expanded in re around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6410.9
Simplified10.9%
Taylor expanded in re around inf
*-commutativeN/A
*-lowering-*.f6411.6
Simplified11.6%
(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
Simplified65.0%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f6428.2
Simplified28.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.f6452.5
Simplified52.5%
Taylor expanded in im around 0
Simplified24.3%
herbie shell --seed 2024204
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))