
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
Initial program 99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sin y) y)) (t_1 (* (cosh x) t_0)))
(if (<= t_1 (- INFINITY))
(* (cosh x) (* -0.16666666666666666 (* y y)))
(if (<= t_1 0.9999999994777551) (* t_0 (fma 0.5 (* x x) 1.0)) (cosh x)))))
double code(double x, double y) {
double t_0 = sin(y) / y;
double t_1 = cosh(x) * t_0;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = cosh(x) * (-0.16666666666666666 * (y * y));
} else if (t_1 <= 0.9999999994777551) {
tmp = t_0 * fma(0.5, (x * x), 1.0);
} else {
tmp = cosh(x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(y) / y) t_1 = Float64(cosh(x) * t_0) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(cosh(x) * Float64(-0.16666666666666666 * Float64(y * y))); elseif (t_1 <= 0.9999999994777551) tmp = Float64(t_0 * fma(0.5, Float64(x * x), 1.0)); else tmp = cosh(x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cosh[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[Cosh[x], $MachinePrecision] * N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.9999999994777551], N[(t$95$0 * N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[Cosh[x], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
t_1 := \cosh x \cdot t\_0\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\cosh x \cdot \left(-0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;t\_1 \leq 0.9999999994777551:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\cosh x\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64100.0
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
if -inf.0 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < 0.99999999947775509Initial program 99.7%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.7
Simplified99.7%
if 0.99999999947775509 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
*-rgt-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sin y) y)) (t_1 (* (cosh x) t_0)))
(if (<= t_1 (- INFINITY))
(* (cosh x) (* -0.16666666666666666 (* y y)))
(if (<= t_1 0.9999999994777551) t_0 (cosh x)))))
double code(double x, double y) {
double t_0 = sin(y) / y;
double t_1 = cosh(x) * t_0;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = cosh(x) * (-0.16666666666666666 * (y * y));
} else if (t_1 <= 0.9999999994777551) {
tmp = t_0;
} else {
tmp = cosh(x);
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = Math.sin(y) / y;
double t_1 = Math.cosh(x) * t_0;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = Math.cosh(x) * (-0.16666666666666666 * (y * y));
} else if (t_1 <= 0.9999999994777551) {
tmp = t_0;
} else {
tmp = Math.cosh(x);
}
return tmp;
}
def code(x, y): t_0 = math.sin(y) / y t_1 = math.cosh(x) * t_0 tmp = 0 if t_1 <= -math.inf: tmp = math.cosh(x) * (-0.16666666666666666 * (y * y)) elif t_1 <= 0.9999999994777551: tmp = t_0 else: tmp = math.cosh(x) return tmp
function code(x, y) t_0 = Float64(sin(y) / y) t_1 = Float64(cosh(x) * t_0) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(cosh(x) * Float64(-0.16666666666666666 * Float64(y * y))); elseif (t_1 <= 0.9999999994777551) tmp = t_0; else tmp = cosh(x); end return tmp end
function tmp_2 = code(x, y) t_0 = sin(y) / y; t_1 = cosh(x) * t_0; tmp = 0.0; if (t_1 <= -Inf) tmp = cosh(x) * (-0.16666666666666666 * (y * y)); elseif (t_1 <= 0.9999999994777551) tmp = t_0; else tmp = cosh(x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cosh[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[Cosh[x], $MachinePrecision] * N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.9999999994777551], t$95$0, N[Cosh[x], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
t_1 := \cosh x \cdot t\_0\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\cosh x \cdot \left(-0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;t\_1 \leq 0.9999999994777551:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\cosh x\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64100.0
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
if -inf.0 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < 0.99999999947775509Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
if 0.99999999947775509 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
*-rgt-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sin y) y)) (t_1 (* (cosh x) t_0)))
(if (<= t_1 (- INFINITY))
(*
(fma 0.5 (* x x) 1.0)
(fma
(* y y)
(fma
y
(* y (fma (* y y) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
1.0))
(if (<= t_1 0.9999999994777551) t_0 (cosh x)))))
double code(double x, double y) {
double t_0 = sin(y) / y;
double t_1 = cosh(x) * t_0;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(0.5, (x * x), 1.0) * fma((y * y), fma(y, (y * fma((y * y), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), 1.0);
} else if (t_1 <= 0.9999999994777551) {
tmp = t_0;
} else {
tmp = cosh(x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(y) / y) t_1 = Float64(cosh(x) * t_0) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(0.5, Float64(x * x), 1.0) * fma(Float64(y * y), fma(y, Float64(y * fma(Float64(y * y), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), 1.0)); elseif (t_1 <= 0.9999999994777551) tmp = t_0; else tmp = cosh(x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cosh[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.9999999994777551], t$95$0, N[Cosh[x], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
t_1 := \cosh x \cdot t\_0\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;t\_1 \leq 0.9999999994777551:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\cosh x\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6453.2
Simplified53.2%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6493.7
Simplified93.7%
if -inf.0 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < 0.99999999947775509Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
if 0.99999999947775509 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
*-rgt-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
(FPCore (x y)
:precision binary64
(if (<= (* (cosh x) (/ (sin y) y)) 0.9999999994777551)
(*
(fma 0.5 (* x x) 1.0)
(fma
(* y y)
(fma
y
(* y (fma (* y y) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
1.0))
(cosh x)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= 0.9999999994777551) {
tmp = fma(0.5, (x * x), 1.0) * fma((y * y), fma(y, (y * fma((y * y), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), 1.0);
} else {
tmp = cosh(x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= 0.9999999994777551) tmp = Float64(fma(0.5, Float64(x * x), 1.0) * fma(Float64(y * y), fma(y, Float64(y * fma(Float64(y * y), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), 1.0)); else tmp = cosh(x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 0.9999999994777551], N[(N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[Cosh[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq 0.9999999994777551:\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\cosh x\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < 0.99999999947775509Initial program 99.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6486.2
Simplified86.2%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6433.4
Simplified33.4%
if 0.99999999947775509 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
*-rgt-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
(FPCore (x y)
:precision binary64
(if (<= (* (cosh x) (/ (sin y) y)) 0.9999999994777551)
(*
(fma 0.5 (* x x) 1.0)
(fma
(* y y)
(fma
y
(* y (fma (* y y) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
1.0))
(fma
x
(*
x
(fma x (* x (fma x (* x 0.001388888888888889) 0.041666666666666664)) 0.5))
1.0)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= 0.9999999994777551) {
tmp = fma(0.5, (x * x), 1.0) * fma((y * y), fma(y, (y * fma((y * y), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), 1.0);
} else {
tmp = fma(x, (x * fma(x, (x * fma(x, (x * 0.001388888888888889), 0.041666666666666664)), 0.5)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= 0.9999999994777551) tmp = Float64(fma(0.5, Float64(x * x), 1.0) * fma(Float64(y * y), fma(y, Float64(y * fma(Float64(y * y), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), 1.0)); else tmp = fma(x, Float64(x * fma(x, Float64(x * fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664)), 0.5)), 1.0); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 0.9999999994777551], N[(N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq 0.9999999994777551:\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < 0.99999999947775509Initial program 99.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6486.2
Simplified86.2%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6433.4
Simplified33.4%
if 0.99999999947775509 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
*-rgt-identityN/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified91.4%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
x
(*
x
(fma
x
(* x (fma x (* x 0.001388888888888889) 0.041666666666666664))
0.5))
1.0)))
(if (<= (* (cosh x) (/ (sin y) y)) -1e-147)
(* t_0 (fma -0.16666666666666666 (* y y) 1.0))
t_0)))
double code(double x, double y) {
double t_0 = fma(x, (x * fma(x, (x * fma(x, (x * 0.001388888888888889), 0.041666666666666664)), 0.5)), 1.0);
double tmp;
if ((cosh(x) * (sin(y) / y)) <= -1e-147) {
tmp = t_0 * fma(-0.16666666666666666, (y * y), 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = fma(x, Float64(x * fma(x, Float64(x * fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664)), 0.5)), 1.0) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= -1e-147) tmp = Float64(t_0 * fma(-0.16666666666666666, Float64(y * y), 1.0)); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * N[(x * N[(x * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -1e-147], N[(t$95$0 * N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq -1 \cdot 10^{-147}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -9.9999999999999997e-148Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6462.1
Simplified62.1%
Taylor expanded in x around 0
Simplified58.1%
if -9.9999999999999997e-148 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 99.9%
Taylor expanded in y around 0
Simplified77.4%
*-rgt-identityN/A
cosh-lowering-cosh.f6477.4
Applied egg-rr77.4%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified70.9%
Final simplification68.5%
(FPCore (x y)
:precision binary64
(if (<= (* (cosh x) (/ (sin y) y)) -1e-147)
(*
(fma -0.16666666666666666 (* y y) 1.0)
(fma (* x x) (fma (* x x) 0.041666666666666664 0.5) 1.0))
(fma
x
(*
x
(fma x (* x (fma x (* x 0.001388888888888889) 0.041666666666666664)) 0.5))
1.0)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= -1e-147) {
tmp = fma(-0.16666666666666666, (y * y), 1.0) * fma((x * x), fma((x * x), 0.041666666666666664, 0.5), 1.0);
} else {
tmp = fma(x, (x * fma(x, (x * fma(x, (x * 0.001388888888888889), 0.041666666666666664)), 0.5)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= -1e-147) tmp = Float64(fma(-0.16666666666666666, Float64(y * y), 1.0) * fma(Float64(x * x), fma(Float64(x * x), 0.041666666666666664, 0.5), 1.0)); else tmp = fma(x, Float64(x * fma(x, Float64(x * fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664)), 0.5)), 1.0); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -1e-147], N[(N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq -1 \cdot 10^{-147}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, 0.041666666666666664, 0.5\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -9.9999999999999997e-148Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6462.1
Simplified62.1%
Taylor expanded in x around 0
associate-+r+N/A
*-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
Simplified56.2%
if -9.9999999999999997e-148 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 99.9%
Taylor expanded in y around 0
Simplified77.4%
*-rgt-identityN/A
cosh-lowering-cosh.f6477.4
Applied egg-rr77.4%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified70.9%
(FPCore (x y)
:precision binary64
(if (<= (* (cosh x) (/ (sin y) y)) -1e-147)
(* (fma 0.5 (* x x) 1.0) (fma -0.16666666666666666 (* y y) 1.0))
(fma
x
(*
x
(fma x (* x (fma x (* x 0.001388888888888889) 0.041666666666666664)) 0.5))
1.0)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= -1e-147) {
tmp = fma(0.5, (x * x), 1.0) * fma(-0.16666666666666666, (y * y), 1.0);
} else {
tmp = fma(x, (x * fma(x, (x * fma(x, (x * 0.001388888888888889), 0.041666666666666664)), 0.5)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= -1e-147) tmp = Float64(fma(0.5, Float64(x * x), 1.0) * fma(-0.16666666666666666, Float64(y * y), 1.0)); else tmp = fma(x, Float64(x * fma(x, Float64(x * fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664)), 0.5)), 1.0); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -1e-147], N[(N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq -1 \cdot 10^{-147}:\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot x, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -9.9999999999999997e-148Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6462.1
Simplified62.1%
Taylor expanded in x around 0
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
distribute-rgt-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6454.2
Simplified54.2%
if -9.9999999999999997e-148 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 99.9%
Taylor expanded in y around 0
Simplified77.4%
*-rgt-identityN/A
cosh-lowering-cosh.f6477.4
Applied egg-rr77.4%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified70.9%
Final simplification67.8%
(FPCore (x y)
:precision binary64
(if (<= (* (cosh x) (/ (sin y) y)) 2.0)
(* (fma 0.5 (* x x) 1.0) (fma -0.16666666666666666 (* y y) 1.0))
(fma
(* x x)
(* x (* x (fma x (* x 0.001388888888888889) 0.041666666666666664)))
1.0)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= 2.0) {
tmp = fma(0.5, (x * x), 1.0) * fma(-0.16666666666666666, (y * y), 1.0);
} else {
tmp = fma((x * x), (x * (x * fma(x, (x * 0.001388888888888889), 0.041666666666666664))), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= 2.0) tmp = Float64(fma(0.5, Float64(x * x), 1.0) * fma(-0.16666666666666666, Float64(y * y), 1.0)); else tmp = fma(Float64(x * x), Float64(x * Float64(x * fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664))), 1.0); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 2.0], N[(N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq 2:\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot x, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, x \cdot \left(x \cdot \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right)\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < 2Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6462.0
Simplified62.0%
Taylor expanded in x around 0
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
distribute-rgt-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6459.5
Simplified59.5%
if 2 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6484.2
Simplified84.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
pow-sqrN/A
*-rgt-identityN/A
times-fracN/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
/-rgt-identityN/A
*-lft-identityN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
distribute-rgt-inN/A
Simplified84.2%
Final simplification67.6%
(FPCore (x y) :precision binary64 (if (<= (* (cosh x) (/ (sin y) y)) 2.0) (* (fma 0.5 (* x x) 1.0) (fma -0.16666666666666666 (* y y) 1.0)) (fma (* x x) (* x (* 0.001388888888888889 (* x (* x x)))) 1.0)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= 2.0) {
tmp = fma(0.5, (x * x), 1.0) * fma(-0.16666666666666666, (y * y), 1.0);
} else {
tmp = fma((x * x), (x * (0.001388888888888889 * (x * (x * x)))), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= 2.0) tmp = Float64(fma(0.5, Float64(x * x), 1.0) * fma(-0.16666666666666666, Float64(y * y), 1.0)); else tmp = fma(Float64(x * x), Float64(x * Float64(0.001388888888888889 * Float64(x * Float64(x * x)))), 1.0); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 2.0], N[(N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * N[(0.001388888888888889 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq 2:\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot x, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, x \cdot \left(0.001388888888888889 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < 2Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6462.0
Simplified62.0%
Taylor expanded in x around 0
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
distribute-rgt-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6459.5
Simplified59.5%
if 2 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6484.2
Simplified84.2%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.2
Simplified84.2%
Taylor expanded in x around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
unpow3N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.2
Simplified84.2%
Final simplification67.6%
(FPCore (x y) :precision binary64 (if (<= (* (cosh x) (/ (sin y) y)) -1e-147) (* (fma 0.5 (* x x) 1.0) (fma -0.16666666666666666 (* y y) 1.0)) (fma x (* x (fma x (* x 0.041666666666666664) 0.5)) 1.0)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= -1e-147) {
tmp = fma(0.5, (x * x), 1.0) * fma(-0.16666666666666666, (y * y), 1.0);
} else {
tmp = fma(x, (x * fma(x, (x * 0.041666666666666664), 0.5)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= -1e-147) tmp = Float64(fma(0.5, Float64(x * x), 1.0) * fma(-0.16666666666666666, Float64(y * y), 1.0)); else tmp = fma(x, Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), 1.0); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -1e-147], N[(N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq -1 \cdot 10^{-147}:\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot x, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -9.9999999999999997e-148Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6462.1
Simplified62.1%
Taylor expanded in x around 0
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
distribute-rgt-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6454.2
Simplified54.2%
if -9.9999999999999997e-148 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 99.9%
Taylor expanded in y around 0
Simplified77.4%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6470.9
Simplified70.9%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6469.0
Simplified69.0%
Final simplification66.2%
(FPCore (x y) :precision binary64 (if (<= (* (cosh x) (/ (sin y) y)) -1e-147) (* -0.16666666666666666 (* y y)) (fma x (* x (fma x (* x 0.041666666666666664) 0.5)) 1.0)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= -1e-147) {
tmp = -0.16666666666666666 * (y * y);
} else {
tmp = fma(x, (x * fma(x, (x * 0.041666666666666664), 0.5)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= -1e-147) tmp = Float64(-0.16666666666666666 * Float64(y * y)); else tmp = fma(x, Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), 1.0); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -1e-147], N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq -1 \cdot 10^{-147}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -9.9999999999999997e-148Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6440.8
Simplified40.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6436.4
Simplified36.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.4
Simplified36.4%
if -9.9999999999999997e-148 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 99.9%
Taylor expanded in y around 0
Simplified77.4%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6470.9
Simplified70.9%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6469.0
Simplified69.0%
(FPCore (x y) :precision binary64 (if (<= (* (cosh x) (/ (sin y) y)) -1e-147) (* -0.16666666666666666 (* y y)) (fma 0.5 (* x x) 1.0)))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= -1e-147) {
tmp = -0.16666666666666666 * (y * y);
} else {
tmp = fma(0.5, (x * x), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= -1e-147) tmp = Float64(-0.16666666666666666 * Float64(y * y)); else tmp = fma(0.5, Float64(x * x), 1.0); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -1e-147], N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq -1 \cdot 10^{-147}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot x, 1\right)\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -9.9999999999999997e-148Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6440.8
Simplified40.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6436.4
Simplified36.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.4
Simplified36.4%
if -9.9999999999999997e-148 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 99.9%
Taylor expanded in y around 0
Simplified77.4%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6459.0
Simplified59.0%
(FPCore (x y) :precision binary64 (if (<= (* (cosh x) (/ (sin y) y)) -1e-147) (* -0.16666666666666666 (* y y)) 1.0))
double code(double x, double y) {
double tmp;
if ((cosh(x) * (sin(y) / y)) <= -1e-147) {
tmp = -0.16666666666666666 * (y * y);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((cosh(x) * (sin(y) / y)) <= (-1d-147)) then
tmp = (-0.16666666666666666d0) * (y * y)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((Math.cosh(x) * (Math.sin(y) / y)) <= -1e-147) {
tmp = -0.16666666666666666 * (y * y);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (math.cosh(x) * (math.sin(y) / y)) <= -1e-147: tmp = -0.16666666666666666 * (y * y) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (Float64(cosh(x) * Float64(sin(y) / y)) <= -1e-147) tmp = Float64(-0.16666666666666666 * Float64(y * y)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((cosh(x) * (sin(y) / y)) <= -1e-147) tmp = -0.16666666666666666 * (y * y); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -1e-147], N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{\sin y}{y} \leq -1 \cdot 10^{-147}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) < -9.9999999999999997e-148Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6440.8
Simplified40.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6436.4
Simplified36.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.4
Simplified36.4%
if -9.9999999999999997e-148 < (*.f64 (cosh.f64 x) (/.f64 (sin.f64 y) y)) Initial program 99.9%
Taylor expanded in y around 0
Simplified77.4%
Taylor expanded in x around 0
Simplified37.7%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
Simplified63.0%
Taylor expanded in x around 0
Simplified30.8%
(FPCore (x y) :precision binary64 (/ (* (cosh x) (sin y)) y))
double code(double x, double y) {
return (cosh(x) * sin(y)) / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (cosh(x) * sin(y)) / y
end function
public static double code(double x, double y) {
return (Math.cosh(x) * Math.sin(y)) / y;
}
def code(x, y): return (math.cosh(x) * math.sin(y)) / y
function code(x, y) return Float64(Float64(cosh(x) * sin(y)) / y) end
function tmp = code(x, y) tmp = (cosh(x) * sin(y)) / y; end
code[x_, y_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \sin y}{y}
\end{array}
herbie shell --seed 2024198
(FPCore (x y)
:name "Linear.Quaternion:$csinh from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (/ (* (cosh x) (sin y)) y))
(* (cosh x) (/ (sin y) y)))