
(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 99.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (fma re (fma re 0.5 1.0) 1.0))
(t_1 (* (exp re) (sin im)))
(t_2 (* (exp re) im)))
(if (<= t_1 (- INFINITY))
(* im (* (fma im (* im -0.16666666666666666) 1.0) t_0))
(if (<= t_1 -0.1)
(sin im)
(if (<= t_1 1e-78) t_2 (if (<= t_1 1.0) (* (sin im) t_0) t_2))))))
double code(double re, double im) {
double t_0 = fma(re, fma(re, 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(im, (im * -0.16666666666666666), 1.0) * t_0);
} else if (t_1 <= -0.1) {
tmp = sin(im);
} else if (t_1 <= 1e-78) {
tmp = t_2;
} else if (t_1 <= 1.0) {
tmp = sin(im) * t_0;
} else {
tmp = t_2;
}
return tmp;
}
function code(re, im) t_0 = fma(re, fma(re, 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 * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * t_0)); elseif (t_1 <= -0.1) tmp = sin(im); elseif (t_1 <= 1e-78) tmp = t_2; elseif (t_1 <= 1.0) tmp = Float64(sin(im) * t_0); else tmp = t_2; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * 0.5 + 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[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.1], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$1, 1e-78], t$95$2, If[LessEqual[t$95$1, 1.0], N[(N[Sin[im], $MachinePrecision] * t$95$0), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 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 \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot t\_0\right)\\
\mathbf{elif}\;t\_1 \leq -0.1:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_1 \leq 10^{-78}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin im \cdot t\_0\\
\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
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6448.1
Applied rewrites48.1%
Taylor expanded in im around 0
lower-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
Applied rewrites52.0%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001Initial program 100.0%
Taylor expanded in re around 0
lower-sin.f6496.1
Applied rewrites96.1%
if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999999e-79 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.4%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6494.1
Applied rewrites94.1%
if 9.99999999999999999e-79 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Final simplification89.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
im
(*
(fma im (* im -0.16666666666666666) 1.0)
(fma re (fma re 0.5 1.0) 1.0)))
(if (<= t_0 -0.1)
(sin im)
(if (<= t_0 1e-78)
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 = im * (fma(im, (im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0));
} else if (t_0 <= -0.1) {
tmp = sin(im);
} else if (t_0 <= 1e-78) {
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(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0))); elseif (t_0 <= -0.1) tmp = sin(im); elseif (t_0 <= 1e-78) 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[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.1], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 1e-78], 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:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.1:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_0 \leq 10^{-78}:\\
\;\;\;\;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 re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6448.1
Applied rewrites48.1%
Taylor expanded in im around 0
lower-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
Applied rewrites52.0%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001Initial program 100.0%
Taylor expanded in re around 0
lower-sin.f6496.1
Applied rewrites96.1%
if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999999e-79 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.4%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6494.1
Applied rewrites94.1%
if 9.99999999999999999e-79 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-+.f6499.3
Applied rewrites99.3%
Final simplification89.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
(if (<= t_0 (- INFINITY))
(*
im
(*
(fma im (* im -0.16666666666666666) 1.0)
(fma re (fma re 0.5 1.0) 1.0)))
(if (<= t_0 -0.1)
(sin im)
(if (<= t_0 2e-74) t_1 (if (<= t_0 1.0) (sin im) t_1))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double t_1 = exp(re) * im;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = im * (fma(im, (im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0));
} else if (t_0 <= -0.1) {
tmp = sin(im);
} else if (t_0 <= 2e-74) {
tmp = t_1;
} else if (t_0 <= 1.0) {
tmp = sin(im);
} else {
tmp = t_1;
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) t_1 = Float64(exp(re) * im) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0))); elseif (t_0 <= -0.1) tmp = sin(im); elseif (t_0 <= 2e-74) tmp = t_1; elseif (t_0 <= 1.0) tmp = sin(im); else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.1], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 2e-74], t$95$1, If[LessEqual[t$95$0, 1.0], N[Sin[im], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.1:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6448.1
Applied rewrites48.1%
Taylor expanded in im around 0
lower-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
Applied rewrites52.0%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001 or 1.99999999999999992e-74 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
lower-sin.f6496.5
Applied rewrites96.5%
if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1.99999999999999992e-74 or 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.4%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6494.1
Applied rewrites94.1%
Final simplification88.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))))
(if (<= t_0 (- INFINITY))
(*
im
(*
(fma im (* im -0.16666666666666666) 1.0)
(fma re (fma re 0.5 1.0) 1.0)))
(if (<= t_0 -0.1)
(sin im)
(if (<= t_0 0.0)
(* im (* re (* 0.008333333333333333 (* (* im im) (* im im)))))
(if (<= t_0 1.0)
(sin im)
(fma
re
(fma
(* re im)
(/ (fma (* re (* re re)) 0.004629629629629629 0.125) 0.25)
im)
im)))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = im * (fma(im, (im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0));
} else if (t_0 <= -0.1) {
tmp = sin(im);
} else if (t_0 <= 0.0) {
tmp = im * (re * (0.008333333333333333 * ((im * im) * (im * im))));
} else if (t_0 <= 1.0) {
tmp = sin(im);
} else {
tmp = fma(re, fma((re * im), (fma((re * (re * re)), 0.004629629629629629, 0.125) / 0.25), im), im);
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0))); elseif (t_0 <= -0.1) tmp = sin(im); elseif (t_0 <= 0.0) tmp = Float64(im * Float64(re * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im))))); elseif (t_0 <= 1.0) tmp = sin(im); else tmp = fma(re, fma(Float64(re * im), Float64(fma(Float64(re * Float64(re * re)), 0.004629629629629629, 0.125) / 0.25), im), im); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.1], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im * N[(re * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[im], $MachinePrecision], N[(re * N[(N[(re * im), $MachinePrecision] * N[(N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * 0.004629629629629629 + 0.125), $MachinePrecision] / 0.25), $MachinePrecision] + im), $MachinePrecision] + im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.1:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(re, \mathsf{fma}\left(re \cdot im, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), 0.004629629629629629, 0.125\right)}{0.25}, im\right), im\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
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6448.1
Applied rewrites48.1%
Taylor expanded in im around 0
lower-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
Applied rewrites52.0%
if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001 or 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1Initial program 100.0%
Taylor expanded in re around 0
lower-sin.f6496.5
Applied rewrites96.5%
if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-+.f6439.6
Applied rewrites39.6%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites38.5%
Taylor expanded in re around inf
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f643.9
Applied rewrites3.9%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6425.4
Applied rewrites25.4%
if 1 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 96.8%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6473.5
Applied rewrites73.5%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6448.4
Applied rewrites48.4%
flip3-+N/A
lower-/.f64N/A
unpow-prod-downN/A
lower-fma.f64N/A
cube-multN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
associate-+r-N/A
lower--.f64N/A
swap-sqrN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
associate-*l*N/A
lower-*.f64N/A
metadata-eval4.0
Applied rewrites4.0%
Taylor expanded in re around 0
Applied rewrites54.2%
Final simplification58.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))))
(if (<= t_0 -0.1)
(*
im
(*
(fma im (* im -0.16666666666666666) 1.0)
(fma re (fma re 0.5 1.0) 1.0)))
(if (<= t_0 0.0)
(* im (* re (* 0.008333333333333333 (* (* im im) (* im im)))))
(fma
im
(* (fma re 0.16666666666666666 0.5) (* re re))
(fma re im im))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double tmp;
if (t_0 <= -0.1) {
tmp = im * (fma(im, (im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0));
} else if (t_0 <= 0.0) {
tmp = im * (re * (0.008333333333333333 * ((im * im) * (im * im))));
} else {
tmp = fma(im, (fma(re, 0.16666666666666666, 0.5) * (re * re)), fma(re, im, im));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_0 <= -0.1) tmp = Float64(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0))); elseif (t_0 <= 0.0) tmp = Float64(im * Float64(re * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im))))); else tmp = fma(im, Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)), fma(re, im, im)); 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.1], N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im * N[(re * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re * im + im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq -0.1:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right), \mathsf{fma}\left(re, im, im\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.3
Applied rewrites69.3%
Taylor expanded in im around 0
lower-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
Applied rewrites31.9%
if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-+.f6439.6
Applied rewrites39.6%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites38.5%
Taylor expanded in re around inf
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f643.9
Applied rewrites3.9%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6425.4
Applied rewrites25.4%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6464.3
Applied rewrites64.3%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6455.6
Applied rewrites55.6%
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
associate-+l+N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-*.f64N/A
lift-fma.f64N/A
lower-fma.f64N/A
Applied rewrites57.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) (sin im))))
(if (<= t_0 -0.1)
(fma
im
(fma im (* im (fma re -0.16666666666666666 -0.16666666666666666)) re)
im)
(if (<= t_0 0.0)
(* im (* re (* 0.008333333333333333 (* (* im im) (* im im)))))
(fma
im
(* (fma re 0.16666666666666666 0.5) (* re re))
(fma re im im))))))
double code(double re, double im) {
double t_0 = exp(re) * sin(im);
double tmp;
if (t_0 <= -0.1) {
tmp = fma(im, fma(im, (im * fma(re, -0.16666666666666666, -0.16666666666666666)), re), im);
} else if (t_0 <= 0.0) {
tmp = im * (re * (0.008333333333333333 * ((im * im) * (im * im))));
} else {
tmp = fma(im, (fma(re, 0.16666666666666666, 0.5) * (re * re)), fma(re, im, im));
}
return tmp;
}
function code(re, im) t_0 = Float64(exp(re) * sin(im)) tmp = 0.0 if (t_0 <= -0.1) tmp = fma(im, fma(im, Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)), re), im); elseif (t_0 <= 0.0) tmp = Float64(im * Float64(re * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im))))); else tmp = fma(im, Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)), fma(re, im, im)); 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.1], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision] + im), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im * N[(re * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re * im + im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq -0.1:\\
\;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right), re\right), im\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right), \mathsf{fma}\left(re, im, im\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-+.f6443.0
Applied rewrites43.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites14.5%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
lower-fma.f6415.1
Applied rewrites15.1%
if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-+.f6439.6
Applied rewrites39.6%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites38.5%
Taylor expanded in re around inf
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f643.9
Applied rewrites3.9%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6425.4
Applied rewrites25.4%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6464.3
Applied rewrites64.3%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6455.6
Applied rewrites55.6%
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
associate-+l+N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-*.f64N/A
lift-fma.f64N/A
lower-fma.f64N/A
Applied rewrites57.3%
(FPCore (re im)
:precision binary64
(if (<= (* (exp re) (sin im)) 5e-109)
(fma
im
(fma im (* im (fma re -0.16666666666666666 -0.16666666666666666)) re)
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)) <= 5e-109) {
tmp = fma(im, fma(im, (im * fma(re, -0.16666666666666666, -0.16666666666666666)), re), 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)) <= 5e-109) tmp = fma(im, fma(im, Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)), re), 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], 5e-109], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision] + im), $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 5 \cdot 10^{-109}:\\
\;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right), re\right), im\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)) < 5.0000000000000002e-109Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-+.f6447.3
Applied rewrites47.3%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites36.7%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
metadata-evalN/A
lower-fma.f6436.9
Applied rewrites36.9%
if 5.0000000000000002e-109 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 98.8%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6454.6
Applied rewrites54.6%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6447.0
Applied rewrites47.0%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* im (fma re (* -0.16666666666666666 (* im im)) re)) (* 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 * fma(re, (-0.16666666666666666 * (im * im)), re);
} else {
tmp = im * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(im * fma(re, Float64(-0.16666666666666666 * Float64(im * im)), re)); else tmp = Float64(im * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(re * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\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
lower-+.f6441.0
Applied rewrites41.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites28.9%
Taylor expanded in re around inf
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f648.3
Applied rewrites8.3%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f648.4
Applied rewrites8.4%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6464.3
Applied rewrites64.3%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6457.3
Applied rewrites57.3%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* im (fma re (* -0.16666666666666666 (* im im)) re)) (fma (* re (* re (* re 0.16666666666666666))) im im)))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = im * fma(re, (-0.16666666666666666 * (im * im)), re);
} else {
tmp = fma((re * (re * (re * 0.16666666666666666))), im, im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(im * fma(re, Float64(-0.16666666666666666 * Float64(im * im)), re)); else tmp = fma(Float64(re * Float64(re * Float64(re * 0.16666666666666666))), im, 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[(re * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * im + im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right), im, 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
+-commutativeN/A
lower-+.f6441.0
Applied rewrites41.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites28.9%
Taylor expanded in re around inf
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f648.3
Applied rewrites8.3%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f648.4
Applied rewrites8.4%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6464.3
Applied rewrites64.3%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6455.6
Applied rewrites55.6%
Taylor expanded in re around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.3
Applied rewrites57.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* im (fma re (* -0.16666666666666666 (* im im)) re)) (fma re (* im (* re (* re 0.16666666666666666))) im)))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = im * fma(re, (-0.16666666666666666 * (im * im)), re);
} else {
tmp = fma(re, (im * (re * (re * 0.16666666666666666))), im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(im * fma(re, Float64(-0.16666666666666666 * Float64(im * im)), re)); else tmp = fma(re, Float64(im * Float64(re * Float64(re * 0.16666666666666666))), 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[(re * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(re, im \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\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
+-commutativeN/A
lower-+.f6441.0
Applied rewrites41.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites28.9%
Taylor expanded in re around inf
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f648.3
Applied rewrites8.3%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f648.4
Applied rewrites8.4%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6464.3
Applied rewrites64.3%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6455.6
Applied rewrites55.6%
Taylor expanded in re around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.3
Applied rewrites57.3%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.0) (* im (fma re (* -0.16666666666666666 (* im im)) re)) (* im (fma re (fma re 0.5 1.0) 1.0))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.0) {
tmp = im * fma(re, (-0.16666666666666666 * (im * im)), re);
} else {
tmp = im * fma(re, fma(re, 0.5, 1.0), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.0) tmp = Float64(im * fma(re, Float64(-0.16666666666666666 * Float64(im * im)), re)); 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[(re * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
\;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\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
lower-+.f6441.0
Applied rewrites41.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites28.9%
Taylor expanded in re around inf
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f648.3
Applied rewrites8.3%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f648.4
Applied rewrites8.4%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6464.3
Applied rewrites64.3%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6456.4
Applied rewrites56.4%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 4e-6) (fma (* im im) (* im -0.16666666666666666) im) (* (* re re) (* re (* im 0.16666666666666666)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 4e-6) {
tmp = fma((im * im), (im * -0.16666666666666666), im);
} else {
tmp = (re * re) * (re * (im * 0.16666666666666666));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 4e-6) tmp = fma(Float64(im * im), Float64(im * -0.16666666666666666), im); else tmp = Float64(Float64(re * re) * Float64(re * Float64(im * 0.16666666666666666))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 4e-6], N[(N[(im * im), $MachinePrecision] * N[(im * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * N[(re * N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 4 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \left(im \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 3.99999999999999982e-6Initial program 100.0%
Taylor expanded in re around 0
lower-sin.f6451.8
Applied rewrites51.8%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.2
Applied rewrites42.2%
if 3.99999999999999982e-6 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 98.3%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6439.7
Applied rewrites39.7%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6426.7
Applied rewrites26.7%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.6
Applied rewrites29.6%
(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(Float64(im * im), Float64(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[(N[(im * im), $MachinePrecision] * N[(im * -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 \cdot im, im \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
lower-sin.f6440.3
Applied rewrites40.3%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.3
Applied rewrites28.3%
if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 99.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6464.3
Applied rewrites64.3%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6456.4
Applied rewrites56.4%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 4e-6) (fma (* im im) (* im -0.16666666666666666) im) (* im (* re (* re 0.5)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 4e-6) {
tmp = fma((im * im), (im * -0.16666666666666666), im);
} else {
tmp = im * (re * (re * 0.5));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 4e-6) tmp = fma(Float64(im * im), Float64(im * -0.16666666666666666), im); else tmp = Float64(im * Float64(re * Float64(re * 0.5))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 4e-6], N[(N[(im * im), $MachinePrecision] * N[(im * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision], N[(im * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 4 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 3.99999999999999982e-6Initial program 100.0%
Taylor expanded in re around 0
lower-sin.f6451.8
Applied rewrites51.8%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.2
Applied rewrites42.2%
if 3.99999999999999982e-6 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 98.3%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6439.7
Applied rewrites39.7%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6428.0
Applied rewrites28.0%
Taylor expanded in re around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.26) (fma im re im) (* im (* re (* re 0.5)))))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.26) {
tmp = fma(im, re, im);
} else {
tmp = im * (re * (re * 0.5));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.26) tmp = fma(im, re, im); else tmp = Float64(im * Float64(re * Float64(re * 0.5))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.26], N[(im * re + im), $MachinePrecision], N[(im * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.26:\\
\;\;\;\;\mathsf{fma}\left(im, re, im\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.26000000000000001Initial program 100.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6479.6
Applied rewrites79.6%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f6440.0
Applied rewrites40.0%
if 0.26000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 98.2%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6443.0
Applied rewrites43.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6430.2
Applied rewrites30.2%
Taylor expanded in re around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6430.9
Applied rewrites30.9%
(FPCore (re im) :precision binary64 (if (<= (* (exp re) (sin im)) 0.998) im (* re im)))
double code(double re, double im) {
double tmp;
if ((exp(re) * sin(im)) <= 0.998) {
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.998d0) 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.998) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if (math.exp(re) * math.sin(im)) <= 0.998: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (Float64(exp(re) * sin(im)) <= 0.998) 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.998) 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.998], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \cdot \sin im \leq 0.998:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.998Initial program 100.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6472.5
Applied rewrites72.5%
Taylor expanded in re around 0
Applied rewrites34.7%
*-rgt-identity34.7
Applied rewrites34.7%
if 0.998 < (*.f64 (exp.f64 re) (sin.f64 im)) Initial program 97.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-+.f6410.1
Applied rewrites10.1%
Taylor expanded in im around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites14.6%
Taylor expanded in re around inf
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6414.8
Applied rewrites14.8%
Taylor expanded in im around 0
*-commutativeN/A
lower-*.f6415.0
Applied rewrites15.0%
(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.0022)
(* (exp re) im)
(if (<= re 0.00028)
t_0
(if (<= re 1.45e+95)
(* (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.0022) {
tmp = exp(re) * im;
} else if (re <= 0.00028) {
tmp = t_0;
} else if (re <= 1.45e+95) {
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.0022) tmp = Float64(exp(re) * im); elseif (re <= 0.00028) tmp = t_0; elseif (re <= 1.45e+95) 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.0022], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 0.00028], t$95$0, If[LessEqual[re, 1.45e+95], 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.0022:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;re \leq 0.00028:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.45 \cdot 10^{+95}:\\
\;\;\;\;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.00220000000000000013Initial program 100.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
if -0.00220000000000000013 < re < 2.7999999999999998e-4 or 1.45000000000000007e95 < re Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.4
Applied rewrites99.4%
if 2.7999999999999998e-4 < re < 1.45000000000000007e95Initial program 95.7%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.1
Applied rewrites82.1%
Final simplification98.1%
(FPCore (re im) :precision binary64 (fma im re im))
double code(double re, double im) {
return fma(im, re, im);
}
function code(re, im) return fma(im, re, im) end
code[re_, im_] := N[(im * re + im), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(im, re, im\right)
\end{array}
Initial program 99.6%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6472.1
Applied rewrites72.1%
Taylor expanded in re around 0
+-commutativeN/A
lower-fma.f6433.8
Applied rewrites33.8%
(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 99.6%
Taylor expanded in im around 0
lower-*.f64N/A
lower-exp.f6472.1
Applied rewrites72.1%
Taylor expanded in re around 0
Applied rewrites30.6%
*-rgt-identity30.6
Applied rewrites30.6%
herbie shell --seed 2024219
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))