
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (* (sin re) (cosh im)))
double code(double re, double im) {
return sin(re) * cosh(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sin(re) * cosh(im)
end function
public static double code(double re, double im) {
return Math.sin(re) * Math.cosh(im);
}
def code(re, im): return math.sin(re) * math.cosh(im)
function code(re, im) return Float64(sin(re) * cosh(im)) end
function tmp = code(re, im) tmp = sin(re) * cosh(im); end
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[Cosh[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin re \cdot \cosh im
\end{array}
Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))))
(t_1 (fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0)))
(if (<= t_0 (- INFINITY))
(* (fma re (* (* re re) -0.16666666666666666) re) t_1)
(if (<= t_0 1.0) (* (sin re) t_1) (* re (cosh im))))))
double code(double re, double im) {
double t_0 = (sin(re) * 0.5) * (exp(-im) + exp(im));
double t_1 = fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma(re, ((re * re) * -0.16666666666666666), re) * t_1;
} else if (t_0 <= 1.0) {
tmp = sin(re) * t_1;
} else {
tmp = re * cosh(im);
}
return tmp;
}
function code(re, im) t_0 = Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) t_1 = fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * t_1); elseif (t_0 <= 1.0) tmp = Float64(sin(re) * t_1); else tmp = Float64(re * cosh(im)); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[(N[Sin[re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right)\\
t_1 := \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot t\_1\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin re \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -inf.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified78.8%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.8
Simplified63.8%
if -inf.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified99.3%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified81.7%
Final simplification85.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (sin re) 0.5)) (t_1 (* t_0 (+ (exp (- im)) (exp im)))))
(if (<= t_1 (- INFINITY))
(*
(fma re (* (* re re) -0.16666666666666666) re)
(fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0))
(if (<= t_1 1.0) (* t_0 (fma im im 2.0)) (* re (cosh im))))))
double code(double re, double im) {
double t_0 = sin(re) * 0.5;
double t_1 = t_0 * (exp(-im) + exp(im));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
} else if (t_1 <= 1.0) {
tmp = t_0 * fma(im, im, 2.0);
} else {
tmp = re * cosh(im);
}
return tmp;
}
function code(re, im) t_0 = Float64(sin(re) * 0.5) t_1 = Float64(t_0 * Float64(exp(Float64(-im)) + exp(im))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0)); elseif (t_1 <= 1.0) tmp = Float64(t_0 * fma(im, im, 2.0)); else tmp = Float64(re * cosh(im)); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(t$95$0 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin re \cdot 0.5\\
t_1 := t\_0 \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(im, im, 2\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -inf.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified78.8%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.8
Simplified63.8%
if -inf.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f6499.3
Simplified99.3%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified81.7%
Final simplification85.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* (sin re) 0.5) (+ (exp (- im)) (exp im)))))
(if (<= t_0 (- INFINITY))
(*
(fma re (* (* re re) -0.16666666666666666) re)
(fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0))
(if (<= t_0 1.0) (sin re) (* re (cosh im))))))
double code(double re, double im) {
double t_0 = (sin(re) * 0.5) * (exp(-im) + exp(im));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
} else if (t_0 <= 1.0) {
tmp = sin(re);
} else {
tmp = re * cosh(im);
}
return tmp;
}
function code(re, im) t_0 = Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0)); elseif (t_0 <= 1.0) tmp = sin(re); else tmp = Float64(re * cosh(im)); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[re], $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -inf.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified78.8%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.8
Simplified63.8%
if -inf.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6498.7
Simplified98.7%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified81.7%
Final simplification85.4%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* (sin re) 0.5) (+ (exp (- im)) (exp im)))))
(if (<= t_0 (- INFINITY))
(*
(fma re (* (* re re) -0.16666666666666666) re)
(fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0))
(if (<= t_0 1.0)
(sin re)
(*
(fma
(* im im)
(* im (* im (fma (* im im) 0.002777777777777778 0.08333333333333333)))
2.0)
(* re 0.5))))))
double code(double re, double im) {
double t_0 = (sin(re) * 0.5) * (exp(-im) + exp(im));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
} else if (t_0 <= 1.0) {
tmp = sin(re);
} else {
tmp = fma((im * im), (im * (im * fma((im * im), 0.002777777777777778, 0.08333333333333333))), 2.0) * (re * 0.5);
}
return tmp;
}
function code(re, im) t_0 = Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0)); elseif (t_0 <= 1.0) tmp = sin(re); else tmp = Float64(fma(Float64(im * im), Float64(im * Float64(im * fma(Float64(im * im), 0.002777777777777778, 0.08333333333333333))), 2.0) * Float64(re * 0.5)); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[re], $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.002777777777777778 + 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, 0.002777777777777778, 0.08333333333333333\right)\right), 2\right) \cdot \left(re \cdot 0.5\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -inf.0Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified78.8%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.8
Simplified63.8%
if -inf.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6498.7
Simplified98.7%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified82.4%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified66.7%
Taylor expanded in im around inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
pow-sqrN/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-commutativeN/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
distribute-rgt-inN/A
Simplified66.7%
Final simplification81.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* (sin re) 0.5) (+ (exp (- im)) (exp im)))))
(if (<= t_0 -0.05)
(* re (* (* im im) (fma -0.08333333333333333 (* re re) 0.5)))
(if (<= t_0 1.0)
(fma (* im im) (* re 0.5) re)
(* re (* im (* im (* (* im im) 0.041666666666666664))))))))
double code(double re, double im) {
double t_0 = (sin(re) * 0.5) * (exp(-im) + exp(im));
double tmp;
if (t_0 <= -0.05) {
tmp = re * ((im * im) * fma(-0.08333333333333333, (re * re), 0.5));
} else if (t_0 <= 1.0) {
tmp = fma((im * im), (re * 0.5), re);
} else {
tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
}
return tmp;
}
function code(re, im) t_0 = Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) tmp = 0.0 if (t_0 <= -0.05) tmp = Float64(re * Float64(Float64(im * im) * fma(-0.08333333333333333, Float64(re * re), 0.5))); elseif (t_0 <= 1.0) tmp = fma(Float64(im * im), Float64(re * 0.5), re); else tmp = Float64(re * Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664)))); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.05], N[(re * N[(N[(im * im), $MachinePrecision] * N[(-0.08333333333333333 * N[(re * re), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[(N[(im * im), $MachinePrecision] * N[(re * 0.5), $MachinePrecision] + re), $MachinePrecision], N[(re * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{if}\;t\_0 \leq -0.05:\\
\;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \mathsf{fma}\left(-0.08333333333333333, re \cdot re, 0.5\right)\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\mathsf{fma}\left(im \cdot im, re \cdot 0.5, re\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -0.050000000000000003Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6469.3
Simplified69.3%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.4
Simplified35.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6431.7
Simplified31.7%
if -0.050000000000000003 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified100.0%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified61.9%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f6461.9
Simplified61.9%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified77.0%
Taylor expanded in re around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6453.4
Simplified53.4%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.1
Simplified64.1%
Final simplification50.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* (sin re) 0.5) (+ (exp (- im)) (exp im)))))
(if (<= t_0 -0.05)
(* re (* (* re re) -0.16666666666666666))
(if (<= t_0 1.0) re (* re (* 0.5 (* im im)))))))
double code(double re, double im) {
double t_0 = (sin(re) * 0.5) * (exp(-im) + exp(im));
double tmp;
if (t_0 <= -0.05) {
tmp = re * ((re * re) * -0.16666666666666666);
} else if (t_0 <= 1.0) {
tmp = re;
} else {
tmp = re * (0.5 * (im * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (sin(re) * 0.5d0) * (exp(-im) + exp(im))
if (t_0 <= (-0.05d0)) then
tmp = re * ((re * re) * (-0.16666666666666666d0))
else if (t_0 <= 1.0d0) then
tmp = re
else
tmp = re * (0.5d0 * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (Math.sin(re) * 0.5) * (Math.exp(-im) + Math.exp(im));
double tmp;
if (t_0 <= -0.05) {
tmp = re * ((re * re) * -0.16666666666666666);
} else if (t_0 <= 1.0) {
tmp = re;
} else {
tmp = re * (0.5 * (im * im));
}
return tmp;
}
def code(re, im): t_0 = (math.sin(re) * 0.5) * (math.exp(-im) + math.exp(im)) tmp = 0 if t_0 <= -0.05: tmp = re * ((re * re) * -0.16666666666666666) elif t_0 <= 1.0: tmp = re else: tmp = re * (0.5 * (im * im)) return tmp
function code(re, im) t_0 = Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) tmp = 0.0 if (t_0 <= -0.05) tmp = Float64(re * Float64(Float64(re * re) * -0.16666666666666666)); elseif (t_0 <= 1.0) tmp = re; else tmp = Float64(re * Float64(0.5 * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) t_0 = (sin(re) * 0.5) * (exp(-im) + exp(im)); tmp = 0.0; if (t_0 <= -0.05) tmp = re * ((re * re) * -0.16666666666666666); elseif (t_0 <= 1.0) tmp = re; else tmp = re * (0.5 * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.05], N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], re, N[(re * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{if}\;t\_0 \leq -0.05:\\
\;\;\;\;re \cdot \left(\left(re \cdot re\right) \cdot -0.16666666666666666\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -0.050000000000000003Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6436.8
Simplified36.8%
Taylor expanded in re around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6416.7
Simplified16.7%
Taylor expanded in re around 0
Simplified12.9%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.6
Simplified12.6%
if -0.050000000000000003 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6499.6
Simplified99.6%
Taylor expanded in re around 0
Simplified61.5%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6452.5
Simplified52.5%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.5
Simplified52.5%
Taylor expanded in re around 0
Simplified43.6%
Final simplification37.6%
(FPCore (re im)
:precision binary64
(if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 1.0)
(*
(sin re)
(fma
(* im im)
(fma
(* im im)
(fma (* im im) 0.001388888888888889 0.041666666666666664)
0.5)
1.0))
(* re (cosh im))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 1.0) {
tmp = sin(re) * fma((im * im), fma((im * im), fma((im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0);
} else {
tmp = re * cosh(im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 1.0) tmp = Float64(sin(re) * fma(Float64(im * im), fma(Float64(im * im), fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0)); else tmp = Float64(re * cosh(im)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 1:\\
\;\;\;\;\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6494.4
Simplified94.4%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified81.7%
Final simplification90.9%
(FPCore (re im)
:precision binary64
(if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 1.0)
(*
(sin re)
(fma (* im im) (fma (* im im) (* (* im im) 0.001388888888888889) 0.5) 1.0))
(* re (cosh im))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 1.0) {
tmp = sin(re) * fma((im * im), fma((im * im), ((im * im) * 0.001388888888888889), 0.5), 1.0);
} else {
tmp = re * cosh(im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 1.0) tmp = Float64(sin(re) * fma(Float64(im * im), fma(Float64(im * im), Float64(Float64(im * im) * 0.001388888888888889), 0.5), 1.0)); else tmp = Float64(re * cosh(im)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 1:\\
\;\;\;\;\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \left(im \cdot im\right) \cdot 0.001388888888888889, 0.5\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6494.4
Simplified94.4%
Taylor expanded in im around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.4
Simplified94.4%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified81.7%
Final simplification90.9%
(FPCore (re im)
:precision binary64
(if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 1.0)
(*
(sin re)
(fma (* im im) (* im (* im (* (* im im) 0.001388888888888889))) 1.0))
(* re (cosh im))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 1.0) {
tmp = sin(re) * fma((im * im), (im * (im * ((im * im) * 0.001388888888888889))), 1.0);
} else {
tmp = re * cosh(im);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 1.0) tmp = Float64(sin(re) * fma(Float64(im * im), Float64(im * Float64(im * Float64(Float64(im * im) * 0.001388888888888889))), 1.0)); else tmp = Float64(re * cosh(im)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 1:\\
\;\;\;\;\sin re \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6494.4
Simplified94.4%
Taylor expanded in im around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.0
Simplified94.0%
if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified81.7%
Final simplification90.6%
(FPCore (re im)
:precision binary64
(if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 5e-7)
(*
(fma re (* (* re re) -0.16666666666666666) re)
(fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0))
(*
(fma
(* im im)
(* im (* im (fma (* im im) 0.002777777777777778 0.08333333333333333)))
2.0)
(* re 0.5))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 5e-7) {
tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
} else {
tmp = fma((im * im), (im * (im * fma((im * im), 0.002777777777777778, 0.08333333333333333))), 2.0) * (re * 0.5);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 5e-7) tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0)); else tmp = Float64(fma(Float64(im * im), Float64(im * Float64(im * fma(Float64(im * im), 0.002777777777777778, 0.08333333333333333))), 2.0) * Float64(re * 0.5)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-7], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.002777777777777778 + 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, 0.002777777777777778, 0.08333333333333333\right)\right), 2\right) \cdot \left(re \cdot 0.5\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 4.99999999999999977e-7Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified90.6%
Taylor expanded in re around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.6
Simplified61.6%
if 4.99999999999999977e-7 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified88.1%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified46.4%
Taylor expanded in im around inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
pow-sqrN/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-commutativeN/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
distribute-rgt-inN/A
Simplified46.4%
Final simplification55.3%
(FPCore (re im)
:precision binary64
(if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 5e-7)
(* re (* (fma re (* re -0.16666666666666666) 1.0) (fma 0.5 (* im im) 1.0)))
(*
(fma
(* im im)
(* im (* im (fma (* im im) 0.002777777777777778 0.08333333333333333)))
2.0)
(* re 0.5))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 5e-7) {
tmp = re * (fma(re, (re * -0.16666666666666666), 1.0) * fma(0.5, (im * im), 1.0));
} else {
tmp = fma((im * im), (im * (im * fma((im * im), 0.002777777777777778, 0.08333333333333333))), 2.0) * (re * 0.5);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 5e-7) tmp = Float64(re * Float64(fma(re, Float64(re * -0.16666666666666666), 1.0) * fma(0.5, Float64(im * im), 1.0))); else tmp = Float64(fma(Float64(im * im), Float64(im * Float64(im * fma(Float64(im * im), 0.002777777777777778, 0.08333333333333333))), 2.0) * Float64(re * 0.5)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-7], N[(re * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.002777777777777778 + 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 5 \cdot 10^{-7}:\\
\;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, 0.002777777777777778, 0.08333333333333333\right)\right), 2\right) \cdot \left(re \cdot 0.5\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 4.99999999999999977e-7Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6479.8
Simplified79.8%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6455.2
Simplified55.2%
if 4.99999999999999977e-7 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified88.1%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified46.4%
Taylor expanded in im around inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
pow-sqrN/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-commutativeN/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
distribute-rgt-inN/A
Simplified46.4%
Final simplification51.6%
(FPCore (re im)
:precision binary64
(if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 5e-7)
(* re (* (fma re (* re -0.16666666666666666) 1.0) (fma 0.5 (* im im) 1.0)))
(*
re
(fma
(* im im)
(fma
(* im im)
(fma (* im im) 0.001388888888888889 0.041666666666666664)
0.5)
1.0))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 5e-7) {
tmp = re * (fma(re, (re * -0.16666666666666666), 1.0) * fma(0.5, (im * im), 1.0));
} else {
tmp = re * fma((im * im), fma((im * im), fma((im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 5e-7) tmp = Float64(re * Float64(fma(re, Float64(re * -0.16666666666666666), 1.0) * fma(0.5, Float64(im * im), 1.0))); else tmp = Float64(re * fma(Float64(im * im), fma(Float64(im * im), fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-7], N[(re * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 5 \cdot 10^{-7}:\\
\;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 4.99999999999999977e-7Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6479.8
Simplified79.8%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6455.2
Simplified55.2%
if 4.99999999999999977e-7 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6488.1
Simplified88.1%
Taylor expanded in re around 0
Simplified46.4%
Final simplification51.6%
(FPCore (re im) :precision binary64 (if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 5e-7) (* re (* (fma re (* re -0.16666666666666666) 1.0) (fma 0.5 (* im im) 1.0))) (* re (fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 5e-7) {
tmp = re * (fma(re, (re * -0.16666666666666666), 1.0) * fma(0.5, (im * im), 1.0));
} else {
tmp = re * fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 5e-7) tmp = Float64(re * Float64(fma(re, Float64(re * -0.16666666666666666), 1.0) * fma(0.5, Float64(im * im), 1.0))); else tmp = Float64(re * fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-7], N[(re * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 5 \cdot 10^{-7}:\\
\;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 4.99999999999999977e-7Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6479.8
Simplified79.8%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6455.2
Simplified55.2%
if 4.99999999999999977e-7 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified84.5%
Taylor expanded in re around 0
Simplified44.6%
Final simplification50.9%
(FPCore (re im) :precision binary64 (if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) -0.05) (* re (* (* im im) (fma -0.08333333333333333 (* re re) 0.5))) (* re (fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= -0.05) {
tmp = re * ((im * im) * fma(-0.08333333333333333, (re * re), 0.5));
} else {
tmp = re * fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= -0.05) tmp = Float64(re * Float64(Float64(im * im) * fma(-0.08333333333333333, Float64(re * re), 0.5))); else tmp = Float64(re * fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0)); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.05], N[(re * N[(N[(im * im), $MachinePrecision] * N[(-0.08333333333333333 * N[(re * re), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq -0.05:\\
\;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \mathsf{fma}\left(-0.08333333333333333, re \cdot re, 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -0.050000000000000003Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6469.3
Simplified69.3%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.4
Simplified35.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6431.7
Simplified31.7%
if -0.050000000000000003 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified89.6%
Taylor expanded in re around 0
Simplified62.9%
Final simplification50.8%
(FPCore (re im) :precision binary64 (if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 0.54) (fma -0.16666666666666666 (* re (* re re)) re) (* re (* im (* im (* (* im im) 0.041666666666666664))))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 0.54) {
tmp = fma(-0.16666666666666666, (re * (re * re)), re);
} else {
tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 0.54) tmp = fma(-0.16666666666666666, Float64(re * Float64(re * re)), re); else tmp = Float64(re * Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664)))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.54], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision], N[(re * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 0.54:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, re \cdot \left(re \cdot re\right), re\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 0.54000000000000004Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6462.3
Simplified62.3%
Taylor expanded in re around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6441.3
Simplified41.3%
Taylor expanded in re around 0
Simplified39.0%
if 0.54000000000000004 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
Simplified81.7%
Taylor expanded in re around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6443.3
Simplified43.3%
Taylor expanded in im around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.8
Simplified51.8%
Final simplification43.5%
(FPCore (re im) :precision binary64 (if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) 5e-7) (fma -0.16666666666666666 (* re (* re re)) re) (* re (* 0.5 (* im im)))))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= 5e-7) {
tmp = fma(-0.16666666666666666, (re * (re * re)), re);
} else {
tmp = re * (0.5 * (im * im));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= 5e-7) tmp = fma(-0.16666666666666666, Float64(re * Float64(re * re)), re); else tmp = Float64(re * Float64(0.5 * Float64(im * im))); end return tmp end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-7], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision], N[(re * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, re \cdot \left(re \cdot re\right), re\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 4.99999999999999977e-7Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6458.3
Simplified58.3%
Taylor expanded in re around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6445.2
Simplified45.2%
Taylor expanded in re around 0
Simplified42.7%
if 4.99999999999999977e-7 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6467.9
Simplified67.9%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.7
Simplified36.7%
Taylor expanded in re around 0
Simplified30.7%
Final simplification37.8%
(FPCore (re im) :precision binary64 (if (<= (* (* (sin re) 0.5) (+ (exp (- im)) (exp im))) -0.05) (* re (* (* re re) -0.16666666666666666)) re))
double code(double re, double im) {
double tmp;
if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= -0.05) {
tmp = re * ((re * re) * -0.16666666666666666);
} else {
tmp = re;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (((sin(re) * 0.5d0) * (exp(-im) + exp(im))) <= (-0.05d0)) then
tmp = re * ((re * re) * (-0.16666666666666666d0))
else
tmp = re
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (((Math.sin(re) * 0.5) * (Math.exp(-im) + Math.exp(im))) <= -0.05) {
tmp = re * ((re * re) * -0.16666666666666666);
} else {
tmp = re;
}
return tmp;
}
def code(re, im): tmp = 0 if ((math.sin(re) * 0.5) * (math.exp(-im) + math.exp(im))) <= -0.05: tmp = re * ((re * re) * -0.16666666666666666) else: tmp = re return tmp
function code(re, im) tmp = 0.0 if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(-im)) + exp(im))) <= -0.05) tmp = Float64(re * Float64(Float64(re * re) * -0.16666666666666666)); else tmp = re; end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (((sin(re) * 0.5) * (exp(-im) + exp(im))) <= -0.05) tmp = re * ((re * re) * -0.16666666666666666); else tmp = re; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.05], N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision], re]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{-im} + e^{im}\right) \leq -0.05:\\
\;\;\;\;re \cdot \left(\left(re \cdot re\right) \cdot -0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;re\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -0.050000000000000003Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6436.8
Simplified36.8%
Taylor expanded in re around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6416.7
Simplified16.7%
Taylor expanded in re around 0
Simplified12.9%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.6
Simplified12.6%
if -0.050000000000000003 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6455.7
Simplified55.7%
Taylor expanded in re around 0
Simplified34.7%
Final simplification26.1%
(FPCore (re im)
:precision binary64
(if (<= (sin re) 5e-7)
(*
(fma
(* im im)
(fma
(* im im)
(fma (* im im) 0.002777777777777778 0.08333333333333333)
1.0)
2.0)
(* re (fma re (* re -0.08333333333333333) 0.5)))
(*
re
(fma
(* im im)
(fma
(* im im)
(fma (* im im) 0.001388888888888889 0.041666666666666664)
0.5)
1.0))))
double code(double re, double im) {
double tmp;
if (sin(re) <= 5e-7) {
tmp = fma((im * im), fma((im * im), fma((im * im), 0.002777777777777778, 0.08333333333333333), 1.0), 2.0) * (re * fma(re, (re * -0.08333333333333333), 0.5));
} else {
tmp = re * fma((im * im), fma((im * im), fma((im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (sin(re) <= 5e-7) tmp = Float64(fma(Float64(im * im), fma(Float64(im * im), fma(Float64(im * im), 0.002777777777777778, 0.08333333333333333), 1.0), 2.0) * Float64(re * fma(re, Float64(re * -0.08333333333333333), 0.5))); else tmp = Float64(re * fma(Float64(im * im), fma(Float64(im * im), fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0)); end return tmp end
code[re_, im_] := If[LessEqual[N[Sin[re], $MachinePrecision], 5e-7], N[(N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.002777777777777778 + 0.08333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] + 2.0), $MachinePrecision] * N[(re * N[(re * N[(re * -0.08333333333333333), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin re \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.002777777777777778, 0.08333333333333333\right), 1\right), 2\right) \cdot \left(re \cdot \mathsf{fma}\left(re, re \cdot -0.08333333333333333, 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
\end{array}
\end{array}
if (sin.f64 re) < 4.99999999999999977e-7Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified89.9%
Taylor expanded in re around 0
Simplified66.5%
if 4.99999999999999977e-7 < (sin.f64 re) Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in im around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6495.0
Simplified95.0%
Taylor expanded in re around 0
Simplified18.2%
(FPCore (re im) :precision binary64 (if (<= (sin re) -0.05) (* re (* (* re re) -0.16666666666666666)) (fma (* im im) (* re 0.5) re)))
double code(double re, double im) {
double tmp;
if (sin(re) <= -0.05) {
tmp = re * ((re * re) * -0.16666666666666666);
} else {
tmp = fma((im * im), (re * 0.5), re);
}
return tmp;
}
function code(re, im) tmp = 0.0 if (sin(re) <= -0.05) tmp = Float64(re * Float64(Float64(re * re) * -0.16666666666666666)); else tmp = fma(Float64(im * im), Float64(re * 0.5), re); end return tmp end
code[re_, im_] := If[LessEqual[N[Sin[re], $MachinePrecision], -0.05], N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(re * 0.5), $MachinePrecision] + re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin re \leq -0.05:\\
\;\;\;\;re \cdot \left(\left(re \cdot re\right) \cdot -0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(im \cdot im, re \cdot 0.5, re\right)\\
\end{array}
\end{array}
if (sin.f64 re) < -0.050000000000000003Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6451.1
Simplified51.1%
Taylor expanded in re around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6422.7
Simplified22.7%
Taylor expanded in re around 0
Simplified17.3%
Taylor expanded in re around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.3
Simplified17.3%
if -0.050000000000000003 < (sin.f64 re) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified91.2%
Taylor expanded in re around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified67.6%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f6453.6
Simplified53.6%
Final simplification43.7%
(FPCore (re im) :precision binary64 re)
double code(double re, double im) {
return re;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re
end function
public static double code(double re, double im) {
return re;
}
def code(re, im): return re
function code(re, im) return re end
function tmp = code(re, im) tmp = re; end
code[re_, im_] := re
\begin{array}{l}
\\
re
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6448.4
Simplified48.4%
Taylor expanded in re around 0
Simplified22.4%
herbie shell --seed 2024205
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))