
(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 20 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))
(* (exp re) (* im (* -0.16666666666666666 (* im im))))
(if (<= t_0 -0.02)
(* (sin im) (fma re (fma re 0.5 1.0) 1.0))
(if (<= t_0 5e-68)
t_1
(if (<= t_0 1.0) (* (sin im) (+ 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 = exp(re) * (im * (-0.16666666666666666 * (im * im)));
} else if (t_0 <= -0.02) {
tmp = sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0);
} else if (t_0 <= 5e-68) {
tmp = t_1;
} else if (t_0 <= 1.0) {
tmp = sin(im) * (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(exp(re) * Float64(im * Float64(-0.16666666666666666 * Float64(im * im)))); elseif (t_0 <= -0.02) tmp = Float64(sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0)); elseif (t_0 <= 5e-68) tmp = t_1; elseif (t_0 <= 1.0) tmp = Float64(sin(im) * 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[Exp[re], $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-68], t$95$1, If[LessEqual[t$95$0, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $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:\\
\;\;\;\;e^{re} \cdot \left(im \cdot \left(-0.16666666666666666 \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, 0.5, 1\right), 1\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im \cdot \left(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 im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.0
Simplified72.0%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6428.0
Simplified28.0%
if -inf.0 < (*.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.f6499.9
Simplified99.9%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.7%
if 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6498.6
Simplified98.6%
Final simplification90.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (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 (- INFINITY))
(*
im
(fma
(fma -0.16666666666666666 (* im im) 1.0)
t_0
(*
(* im im)
(*
t_0
(*
im
(*
im
(fma (* im im) -0.0001984126984126984 0.008333333333333333)))))))
(if (<= t_1 -0.02)
(* (sin im) (fma re (fma re 0.5 1.0) 1.0))
(if (<= t_1 5e-68)
t_2
(if (<= t_1 1.0) (* (sin im) (+ re 1.0)) t_2))))))
double code(double re, double im) {
double t_0 = 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 <= -((double) INFINITY)) {
tmp = im * fma(fma(-0.16666666666666666, (im * im), 1.0), t_0, ((im * im) * (t_0 * (im * (im * fma((im * im), -0.0001984126984126984, 0.008333333333333333))))));
} else if (t_1 <= -0.02) {
tmp = sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0);
} else if (t_1 <= 5e-68) {
tmp = t_2;
} else if (t_1 <= 1.0) {
tmp = sin(im) * (re + 1.0);
} else {
tmp = t_2;
}
return tmp;
}
function code(re, im) t_0 = 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 <= Float64(-Inf)) tmp = Float64(im * fma(fma(-0.16666666666666666, Float64(im * im), 1.0), t_0, Float64(Float64(im * im) * Float64(t_0 * Float64(im * Float64(im * fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333))))))); elseif (t_1 <= -0.02) tmp = Float64(sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0)); elseif (t_1 <= 5e-68) tmp = t_2; elseif (t_1 <= 1.0) tmp = Float64(sin(im) * Float64(re + 1.0)); else tmp = t_2; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $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, (-Infinity)], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0 + N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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, 5e-68], t$95$2, If[LessEqual[t$95$1, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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 -\infty:\\
\;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_0, \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\
\mathbf{elif}\;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 5 \cdot 10^{-68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\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.f6469.3
Simplified69.3%
Taylor expanded in im around 0
Simplified44.5%
if -inf.0 < (*.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.f6499.9
Simplified99.9%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.7%
if 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6498.6
Simplified98.6%
Final simplification91.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (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 (- INFINITY))
(*
im
(fma
(fma -0.16666666666666666 (* im im) 1.0)
t_0
(*
(* im im)
(*
t_0
(*
im
(*
im
(fma (* im im) -0.0001984126984126984 0.008333333333333333)))))))
(if (<= t_1 -0.02)
(/ (sin im) (- (- re) -1.0))
(if (<= t_1 5e-68)
t_2
(if (<= t_1 1.0) (* (sin im) (+ re 1.0)) t_2))))))
double code(double re, double im) {
double t_0 = 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 <= -((double) INFINITY)) {
tmp = im * fma(fma(-0.16666666666666666, (im * im), 1.0), t_0, ((im * im) * (t_0 * (im * (im * fma((im * im), -0.0001984126984126984, 0.008333333333333333))))));
} else if (t_1 <= -0.02) {
tmp = sin(im) / (-re - -1.0);
} else if (t_1 <= 5e-68) {
tmp = t_2;
} else if (t_1 <= 1.0) {
tmp = sin(im) * (re + 1.0);
} else {
tmp = t_2;
}
return tmp;
}
function code(re, im) t_0 = 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 <= Float64(-Inf)) tmp = Float64(im * fma(fma(-0.16666666666666666, Float64(im * im), 1.0), t_0, Float64(Float64(im * im) * Float64(t_0 * Float64(im * Float64(im * fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333))))))); elseif (t_1 <= -0.02) tmp = Float64(sin(im) / Float64(Float64(-re) - -1.0)); elseif (t_1 <= 5e-68) tmp = t_2; elseif (t_1 <= 1.0) tmp = Float64(sin(im) * Float64(re + 1.0)); else tmp = t_2; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $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, (-Infinity)], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0 + N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.02], N[(N[Sin[im], $MachinePrecision] / N[((-re) - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-68], t$95$2, If[LessEqual[t$95$1, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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 -\infty:\\
\;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_0, \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq -0.02:\\
\;\;\;\;\frac{\sin im}{\left(-re\right) - -1}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\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.f6469.3
Simplified69.3%
Taylor expanded in im around 0
Simplified44.5%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004Initial program 99.9%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6499.9
Simplified99.9%
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
metadata-evalN/A
sub-negN/A
accelerator-lowering-fma.f64N/A
metadata-evalN/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval99.9
Applied egg-rr99.9%
Taylor expanded in re around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sin-lowering-sin.f6499.9
Simplified99.9%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.7%
if 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6498.6
Simplified98.6%
Final simplification91.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (sin im) (+ re 1.0)))
(t_1 (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
(t_2 (* (exp re) (sin im)))
(t_3 (* (exp re) im)))
(if (<= t_2 (- INFINITY))
(*
im
(fma
(fma -0.16666666666666666 (* im im) 1.0)
t_1
(*
(* im im)
(*
t_1
(*
im
(*
im
(fma (* im im) -0.0001984126984126984 0.008333333333333333)))))))
(if (<= t_2 -0.02)
t_0
(if (<= t_2 5e-68) t_3 (if (<= t_2 1.0) t_0 t_3))))))
double code(double re, double im) {
double t_0 = sin(im) * (re + 1.0);
double t_1 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
double t_2 = exp(re) * sin(im);
double t_3 = exp(re) * im;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = im * fma(fma(-0.16666666666666666, (im * im), 1.0), t_1, ((im * im) * (t_1 * (im * (im * fma((im * im), -0.0001984126984126984, 0.008333333333333333))))));
} else if (t_2 <= -0.02) {
tmp = t_0;
} else if (t_2 <= 5e-68) {
tmp = t_3;
} else if (t_2 <= 1.0) {
tmp = t_0;
} else {
tmp = t_3;
}
return tmp;
}
function code(re, im) t_0 = Float64(sin(im) * Float64(re + 1.0)) t_1 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) t_2 = Float64(exp(re) * sin(im)) t_3 = Float64(exp(re) * im) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(im * fma(fma(-0.16666666666666666, Float64(im * im), 1.0), t_1, Float64(Float64(im * im) * Float64(t_1 * Float64(im * Float64(im * fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333))))))); elseif (t_2 <= -0.02) tmp = t_0; elseif (t_2 <= 5e-68) tmp = t_3; elseif (t_2 <= 1.0) tmp = t_0; else tmp = t_3; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1 + N[(N[(im * im), $MachinePrecision] * N[(t$95$1 * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.02], t$95$0, If[LessEqual[t$95$2, 5e-68], t$95$3, If[LessEqual[t$95$2, 1.0], t$95$0, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin im \cdot \left(re + 1\right)\\
t_1 := \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 \sin im\\
t_3 := e^{re} \cdot im\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_1, \left(im \cdot im\right) \cdot \left(t\_1 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq -0.02:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-68}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 1:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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.f6469.3
Simplified69.3%
Taylor expanded in im around 0
Simplified44.5%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6499.2
Simplified99.2%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.7%
Final simplification91.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
(t_1 (* (exp re) im))
(t_2 (* (exp re) (sin im))))
(if (<= t_2 (- INFINITY))
(*
im
(fma
(fma -0.16666666666666666 (* im im) 1.0)
t_0
(*
(* im im)
(*
t_0
(*
im
(*
im
(fma (* im im) -0.0001984126984126984 0.008333333333333333)))))))
(if (<= t_2 -0.02)
(sin im)
(if (<= t_2 5e-68) t_1 (if (<= t_2 1.0) (sin im) t_1))))))
double code(double re, double im) {
double t_0 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
double t_1 = exp(re) * im;
double t_2 = exp(re) * sin(im);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = im * fma(fma(-0.16666666666666666, (im * im), 1.0), t_0, ((im * im) * (t_0 * (im * (im * fma((im * im), -0.0001984126984126984, 0.008333333333333333))))));
} else if (t_2 <= -0.02) {
tmp = sin(im);
} else if (t_2 <= 5e-68) {
tmp = t_1;
} else if (t_2 <= 1.0) {
tmp = sin(im);
} else {
tmp = t_1;
}
return tmp;
}
function code(re, im) t_0 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) t_1 = Float64(exp(re) * im) t_2 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(im * fma(fma(-0.16666666666666666, Float64(im * im), 1.0), t_0, Float64(Float64(im * im) * Float64(t_0 * Float64(im * Float64(im * fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333))))))); elseif (t_2 <= -0.02) tmp = sin(im); elseif (t_2 <= 5e-68) tmp = t_1; elseif (t_2 <= 1.0) tmp = sin(im); else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0 + N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.02], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$2, 5e-68], t$95$1, If[LessEqual[t$95$2, 1.0], N[Sin[im], $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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 im\\
t_2 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_0, \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq -0.02:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \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.f6469.3
Simplified69.3%
Taylor expanded in im around 0
Simplified44.5%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6498.1
Simplified98.1%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified95.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
(t_1 (* (exp re) (sin im))))
(if (<= t_1 (- INFINITY))
(*
im
(fma
(fma -0.16666666666666666 (* im im) 1.0)
t_0
(*
(* im im)
(*
t_0
(*
im
(*
im
(fma (* im im) -0.0001984126984126984 0.008333333333333333)))))))
(if (<= t_1 -0.02)
(sin im)
(if (<= t_1 0.0)
(* (* im (* -0.16666666666666666 (* im im))) (+ re 1.0))
(if (<= t_1 1.0) (sin im) (* im t_0)))))))
double code(double re, double im) {
double t_0 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
double t_1 = exp(re) * sin(im);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = im * fma(fma(-0.16666666666666666, (im * im), 1.0), t_0, ((im * im) * (t_0 * (im * (im * fma((im * im), -0.0001984126984126984, 0.008333333333333333))))));
} else if (t_1 <= -0.02) {
tmp = sin(im);
} else if (t_1 <= 0.0) {
tmp = (im * (-0.16666666666666666 * (im * im))) * (re + 1.0);
} else if (t_1 <= 1.0) {
tmp = sin(im);
} else {
tmp = im * t_0;
}
return tmp;
}
function code(re, im) t_0 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) t_1 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(im * fma(fma(-0.16666666666666666, Float64(im * im), 1.0), t_0, Float64(Float64(im * im) * Float64(t_0 * Float64(im * Float64(im * fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333))))))); elseif (t_1 <= -0.02) tmp = sin(im); elseif (t_1 <= 0.0) tmp = Float64(Float64(im * Float64(-0.16666666666666666 * Float64(im * im))) * Float64(re + 1.0)); elseif (t_1 <= 1.0) tmp = sin(im); else tmp = Float64(im * t_0); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0 + N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.02], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[Sin[im], $MachinePrecision], N[(im * t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_0, \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq -0.02:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 1\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;im \cdot t\_0\\
\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.f6469.3
Simplified69.3%
Taylor expanded in im around 0
Simplified44.5%
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.7
Simplified96.7%
if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.6
Simplified72.6%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6431.2
Simplified31.2%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6419.9
Simplified19.9%
if 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified75.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.f6456.0
Simplified56.0%
Final simplification55.2%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* (* im (* -0.16666666666666666 (* im im))) (+ re 1.0)) (fma im (fma (* re re) (fma re 0.16666666666666666 0.5) re) im)))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = (im * (-0.16666666666666666 * (im * im))) * (re + 1.0);
} else {
tmp = fma(im, fma((re * re), fma(re, 0.16666666666666666, 0.5), re), im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(Float64(im * Float64(-0.16666666666666666 * Float64(im * im))) * Float64(re + 1.0)); else tmp = fma(im, fma(Float64(re * re), fma(re, 0.16666666666666666, 0.5), re), im); 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[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(re * re), $MachinePrecision] * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + re), $MachinePrecision] + im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), re\right), im\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.4
Simplified59.4%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6425.0
Simplified25.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.4
Simplified17.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.f6486.8
Simplified86.8%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
unpow2N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6455.1
Simplified55.1%
Final simplification31.4%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* (* im (* -0.16666666666666666 (* im im))) (+ re 1.0)) (* 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 * (-0.16666666666666666 * (im * im))) * (re + 1.0);
} 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(im * Float64(-0.16666666666666666 * Float64(im * im))) * Float64(re + 1.0)); 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[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re + 1.0), $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(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 1\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 im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.4
Simplified59.4%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6425.0
Simplified25.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.4
Simplified17.4%
if -0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified62.1%
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.f6455.1
Simplified55.1%
Final simplification31.4%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* (* im (* -0.16666666666666666 (* im im))) (+ re 1.0)) (fma (* re (* re 0.5)) im (fma re im im))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = (im * (-0.16666666666666666 * (im * im))) * (re + 1.0);
} else {
tmp = fma((re * (re * 0.5)), im, fma(re, im, im));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(Float64(im * Float64(-0.16666666666666666 * Float64(im * im))) * Float64(re + 1.0)); else tmp = fma(Float64(re * Float64(re * 0.5)), im, fma(re, im, im)); 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[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision] * im + N[(re * im + im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \mathsf{fma}\left(re, im, im\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.4
Simplified59.4%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6425.0
Simplified25.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.4
Simplified17.4%
if -0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified62.1%
Taylor expanded in re around 0
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-inN/A
associate-*r*N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6450.1
Simplified50.1%
distribute-rgt-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f6450.1
Applied egg-rr50.1%
Final simplification29.5%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* -0.16666666666666666 (* im (* im (fma im re im)))) (fma (* re (* re 0.5)) im (fma re im im))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = -0.16666666666666666 * (im * (im * fma(im, re, im)));
} else {
tmp = fma((re * (re * 0.5)), im, fma(re, im, im));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(-0.16666666666666666 * Float64(im * Float64(im * fma(im, re, im)))); else tmp = fma(Float64(re * Float64(re * 0.5)), im, fma(re, im, im)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(-0.16666666666666666 * N[(im * N[(im * N[(im * re + im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision] * im + N[(re * im + im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im, re, im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \mathsf{fma}\left(re, im, im\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.4
Simplified59.4%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6425.0
Simplified25.0%
Taylor expanded in im around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f6415.2
Simplified15.2%
if -0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified62.1%
Taylor expanded in re around 0
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-inN/A
associate-*r*N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6450.1
Simplified50.1%
distribute-rgt-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f6450.1
Applied egg-rr50.1%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* -0.16666666666666666 (* im (* im (fma im re im)))) (fma im (fma 0.5 (* re re) re) im)))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = -0.16666666666666666 * (im * (im * fma(im, re, im)));
} else {
tmp = fma(im, fma(0.5, (re * re), re), im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(-0.16666666666666666 * Float64(im * Float64(im * fma(im, re, im)))); else tmp = fma(im, fma(0.5, Float64(re * re), re), im); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(-0.16666666666666666 * N[(im * N[(im * N[(im * re + im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(0.5 * N[(re * re), $MachinePrecision] + re), $MachinePrecision] + im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im, re, im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(0.5, re \cdot re, re\right), im\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.4
Simplified59.4%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6425.0
Simplified25.0%
Taylor expanded in im around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f6415.2
Simplified15.2%
if -0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified62.1%
Taylor expanded in re around 0
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-inN/A
associate-*r*N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6450.1
Simplified50.1%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (fma im (* -0.16666666666666666 (* im im)) im) (fma im (fma 0.5 (* re re) re) im)))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = fma(im, (-0.16666666666666666 * (im * im)), im);
} else {
tmp = fma(im, fma(0.5, (re * re), re), im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = fma(im, Float64(-0.16666666666666666 * Float64(im * im)), im); else tmp = fma(im, fma(0.5, Float64(re * re), 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[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision], N[(im * N[(0.5 * N[(re * re), $MachinePrecision] + re), $MachinePrecision] + im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;\mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(0.5, re \cdot re, re\right), 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.f6440.0
Simplified40.0%
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-*.f6424.3
Simplified24.3%
if -0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified62.1%
Taylor expanded in re around 0
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-inN/A
associate-*r*N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6450.1
Simplified50.1%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 1e-7) (fma im (* -0.16666666666666666 (* im im)) im) (* 0.5 (* im (* re re)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 1e-7) {
tmp = fma(im, (-0.16666666666666666 * (im * im)), im);
} else {
tmp = 0.5 * (im * (re * re));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 1e-7) tmp = fma(im, Float64(-0.16666666666666666 * Float64(im * im)), im); else tmp = Float64(0.5 * Float64(im * Float64(re * re))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 1e-7], N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision], N[(0.5 * N[(im * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 9.9999999999999995e-8Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6450.0
Simplified50.0%
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-*.f6437.2
Simplified37.2%
if 9.9999999999999995e-8 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified39.1%
Taylor expanded in re around 0
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-inN/A
associate-*r*N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6421.1
Simplified21.1%
distribute-rgt-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f6421.1
Applied egg-rr21.1%
Taylor expanded in re around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6421.3
Simplified21.3%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 1.0) (fma im re im) (* 0.5 (* im (* re re)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 1.0) {
tmp = fma(im, re, im);
} else {
tmp = 0.5 * (im * (re * re));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 1.0) tmp = fma(im, re, im); else tmp = Float64(0.5 * Float64(im * Float64(re * re))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 1.0], N[(im * re + im), $MachinePrecision], N[(0.5 * N[(im * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 1:\\
\;\;\;\;\mathsf{fma}\left(im, re, im\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in im around 0
Simplified71.4%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f6433.8
Simplified33.8%
if 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified75.9%
Taylor expanded in re around 0
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-inN/A
associate-*r*N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6439.3
Simplified39.3%
distribute-rgt-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f6439.3
Applied egg-rr39.3%
Taylor expanded in re around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6439.3
Simplified39.3%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.999) im (* re im)))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.999) {
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 ((exp(re) * sin(im)) <= 0.999d0) then
tmp = im
else
tmp = 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.999) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if (math.exp(re) * math.sin(im)) <= 0.999: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.999) tmp = im; else tmp = Float64(re * im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((exp(re) * sin(im)) <= 0.999) tmp = im; else tmp = re * im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.999], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.999:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.998999999999999999Initial program 100.0%
Taylor expanded in im around 0
Simplified71.7%
Taylor expanded in re around 0
Simplified31.1%
if 0.998999999999999999 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 100.0%
Taylor expanded in im around 0
Simplified73.4%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f6412.4
Simplified12.4%
Taylor expanded in re around inf
*-lowering-*.f6412.6
Simplified12.6%
Final simplification28.9%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
(sin im)
(fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))))
(if (<= re -0.078)
(* (exp re) im)
(if (<= re 9.6e-15)
t_0
(if (<= re 1e+103)
(* (exp re) (fma im (* -0.16666666666666666 (* im im)) im))
t_0)))))
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 tmp;
if (re <= -0.078) {
tmp = exp(re) * im;
} else if (re <= 9.6e-15) {
tmp = t_0;
} else if (re <= 1e+103) {
tmp = exp(re) * fma(im, (-0.16666666666666666 * (im * im)), im);
} else {
tmp = t_0;
}
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)) tmp = 0.0 if (re <= -0.078) tmp = Float64(exp(re) * im); elseif (re <= 9.6e-15) tmp = t_0; elseif (re <= 1e+103) tmp = Float64(exp(re) * fma(im, Float64(-0.16666666666666666 * Float64(im * im)), im)); else tmp = t_0; 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]}, If[LessEqual[re, -0.078], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 9.6e-15], t$95$0, If[LessEqual[re, 1e+103], N[(N[Exp[re], $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\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)\\
\mathbf{if}\;re \leq -0.078:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 9.6 \cdot 10^{-15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 10^{+103}:\\
\;\;\;\;e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.0779999999999999999Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
if -0.0779999999999999999 < re < 9.5999999999999998e-15 or 1e103 < 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.f6499.9
Simplified99.9%
if 9.5999999999999998e-15 < re < 1e103Initial program 99.8%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.4
Simplified92.4%
Final simplification99.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (sin im) (fma re (fma re 0.5 1.0) 1.0))))
(if (<= re -0.016)
(* (exp re) im)
(if (<= re 9.6e-15)
t_0
(if (<= re 1.9e+154)
(* (exp re) (fma im (* -0.16666666666666666 (* im im)) im))
t_0)))))
double code(double re, double im) {
double t_0 = sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0);
double tmp;
if (re <= -0.016) {
tmp = exp(re) * im;
} else if (re <= 9.6e-15) {
tmp = t_0;
} else if (re <= 1.9e+154) {
tmp = exp(re) * fma(im, (-0.16666666666666666 * (im * im)), im);
} else {
tmp = t_0;
}
return tmp;
}
function code(re, im) t_0 = Float64(sin(im) * fma(re, fma(re, 0.5, 1.0), 1.0)) tmp = 0.0 if (re <= -0.016) tmp = Float64(exp(re) * im); elseif (re <= 9.6e-15) tmp = t_0; elseif (re <= 1.9e+154) tmp = Float64(exp(re) * fma(im, Float64(-0.16666666666666666 * Float64(im * im)), im)); else tmp = t_0; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.016], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 9.6e-15], t$95$0, If[LessEqual[re, 1.9e+154], N[(N[Exp[re], $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
\mathbf{if}\;re \leq -0.016:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 9.6 \cdot 10^{-15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+154}:\\
\;\;\;\;e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.016Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
if -0.016 < re < 9.5999999999999998e-15 or 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.f6499.8
Simplified99.8%
if 9.5999999999999998e-15 < re < 1.8999999999999999e154Initial program 99.9%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.1
Simplified89.1%
Final simplification98.3%
(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
Simplified71.9%
Taylor expanded in re around 0
+-commutativeN/A
accelerator-lowering-fma.f6431.5
Simplified31.5%
(FPCore (re im) :precision binary64 im)
double code(double re, double im) {
return im;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = im
end function
public static double code(double re, double im) {
return im;
}
def code(re, im): return im
function code(re, im) return im end
function tmp = code(re, im) tmp = im; end
code[re_, im_] := im
\begin{array}{l}
\\
im
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
Simplified71.9%
Taylor expanded in re around 0
Simplified27.7%
herbie shell --seed 2024199
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))