
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
(FPCore (x y) :precision binary64 (* (/ (sinh y) x) (sin x)))
double code(double x, double y) {
return (sinh(y) / x) * sin(x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sinh(y) / x) * sin(x)
end function
public static double code(double x, double y) {
return (Math.sinh(y) / x) * Math.sin(x);
}
def code(x, y): return (math.sinh(y) / x) * math.sin(x)
function code(x, y) return Float64(Float64(sinh(y) / x) * sin(x)) end
function tmp = code(x, y) tmp = (sinh(y) / x) * sin(x); end
code[x_, y_] := N[(N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sinh y}{x} \cdot \sin x
\end{array}
Initial program 86.0%
lift-sin.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)))
(if (<= t_0 (- INFINITY))
(/ (* (sinh y) (* (* x x) (* x -0.16666666666666666))) x)
(if (<= t_0 0.005)
(*
(fma
(* y y)
(* y (fma (* y y) 0.008333333333333333 0.16666666666666666))
y)
(/ (sin x) x))
(/
(*
(sinh y)
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x (* x x))
x))
x)))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (sinh(y) * ((x * x) * (x * -0.16666666666666666))) / x;
} else if (t_0 <= 0.005) {
tmp = fma((y * y), (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), y) * (sin(x) / x);
} else {
tmp = (sinh(y) * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * (x * x)), x)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(sinh(y) * Float64(Float64(x * x) * Float64(x * -0.16666666666666666))) / x); elseif (t_0 <= 0.005) tmp = Float64(fma(Float64(y * y), Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), y) * Float64(sin(x) / x)); else tmp = Float64(Float64(sinh(y) * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * Float64(x * x)), x)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[Sinh[y], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 0.005], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sinh[y], $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\sinh y \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot -0.16666666666666666\right)\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 0.005:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y\right) \cdot \frac{\sin x}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sinh y \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6412.7
Applied rewrites12.7%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 0.0050000000000000001Initial program 72.1%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6471.6
Applied rewrites71.6%
lift-sin.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-/.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
if 0.0050000000000000001 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6475.3
Applied rewrites75.3%
Final simplification73.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)))
(if (<= t_0 (- INFINITY))
(/ (* (sinh y) (* (* x x) (* x -0.16666666666666666))) x)
(if (<= t_0 1e-66)
(* (/ (sin x) x) (fma (* y y) (* y 0.16666666666666666) y))
(/
(*
(fma
(fma 0.008333333333333333 (* x x) -0.16666666666666666)
(* x (* x x))
x)
(fma
(fma y (* y 0.008333333333333333) 0.16666666666666666)
(* y (* y y))
y))
x)))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (sinh(y) * ((x * x) * (x * -0.16666666666666666))) / x;
} else if (t_0 <= 1e-66) {
tmp = (sin(x) / x) * fma((y * y), (y * 0.16666666666666666), y);
} else {
tmp = (fma(fma(0.008333333333333333, (x * x), -0.16666666666666666), (x * (x * x)), x) * fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(sinh(y) * Float64(Float64(x * x) * Float64(x * -0.16666666666666666))) / x); elseif (t_0 <= 1e-66) tmp = Float64(Float64(sin(x) / x) * fma(Float64(y * y), Float64(y * 0.16666666666666666), y)); else tmp = Float64(Float64(fma(fma(0.008333333333333333, Float64(x * x), -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[Sinh[y], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 1e-66], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * 0.16666666666666666), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\sinh y \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot -0.16666666666666666\right)\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{-66}:\\
\;\;\;\;\frac{\sin x}{x} \cdot \mathsf{fma}\left(y \cdot y, y \cdot 0.16666666666666666, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6412.7
Applied rewrites12.7%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.9999999999999998e-67Initial program 70.7%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites98.9%
if 9.9999999999999998e-67 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6483.4
Applied rewrites83.4%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.0
Applied rewrites68.0%
Final simplification70.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)))
(if (<= t_0 (- INFINITY))
(/ (* (sinh y) (* (* x x) (* x -0.16666666666666666))) x)
(if (<= t_0 1e-66)
(* y (/ (sin x) x))
(/
(*
(fma
(fma 0.008333333333333333 (* x x) -0.16666666666666666)
(* x (* x x))
x)
(fma
(fma y (* y 0.008333333333333333) 0.16666666666666666)
(* y (* y y))
y))
x)))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (sinh(y) * ((x * x) * (x * -0.16666666666666666))) / x;
} else if (t_0 <= 1e-66) {
tmp = y * (sin(x) / x);
} else {
tmp = (fma(fma(0.008333333333333333, (x * x), -0.16666666666666666), (x * (x * x)), x) * fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(sinh(y) * Float64(Float64(x * x) * Float64(x * -0.16666666666666666))) / x); elseif (t_0 <= 1e-66) tmp = Float64(y * Float64(sin(x) / x)); else tmp = Float64(Float64(fma(fma(0.008333333333333333, Float64(x * x), -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[Sinh[y], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 1e-66], N[(y * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\sinh y \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot -0.16666666666666666\right)\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{-66}:\\
\;\;\;\;y \cdot \frac{\sin x}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6412.7
Applied rewrites12.7%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.9999999999999998e-67Initial program 70.7%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6498.3
Applied rewrites98.3%
if 9.9999999999999998e-67 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6483.4
Applied rewrites83.4%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.0
Applied rewrites68.0%
Final simplification70.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)) (t_1 (* x (* x x))))
(if (<= t_0 (- INFINITY))
(/
(fma
(fma
(* x x)
(fma (* x x) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666)
t_1
x)
(/
x
(fma
(* y y)
(*
y
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
y)))
(if (<= t_0 1e-66)
(* y (/ (sin x) x))
(/
(*
(fma (fma 0.008333333333333333 (* x x) -0.16666666666666666) t_1 x)
(fma
(fma y (* y 0.008333333333333333) 0.16666666666666666)
(* y (* y y))
y))
x)))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double t_1 = x * (x * x);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma(fma((x * x), fma((x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), t_1, x) / (x / fma((y * y), (y * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), y));
} else if (t_0 <= 1e-66) {
tmp = y * (sin(x) / x);
} else {
tmp = (fma(fma(0.008333333333333333, (x * x), -0.16666666666666666), t_1, x) * fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) t_1 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(fma(Float64(x * x), fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), t_1, x) / Float64(x / fma(Float64(y * y), Float64(y * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), y))); elseif (t_0 <= 1e-66) tmp = Float64(y * Float64(sin(x) / x)); else tmp = Float64(Float64(fma(fma(0.008333333333333333, Float64(x * x), -0.16666666666666666), t_1, x) * fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision] / N[(x / N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-66], N[(y * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision] * N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
t_1 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), t\_1, x\right)}{\frac{x}{\mathsf{fma}\left(y \cdot y, y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), y\right)}}\\
\mathbf{elif}\;t\_0 \leq 10^{-66}:\\
\;\;\;\;y \cdot \frac{\sin x}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), t\_1, x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial program 100.0%
lift-sin.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites87.9%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
*-commutativeN/A
Applied rewrites87.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites64.0%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.9999999999999998e-67Initial program 70.7%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6498.3
Applied rewrites98.3%
if 9.9999999999999998e-67 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6483.4
Applied rewrites83.4%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.0
Applied rewrites68.0%
Final simplification81.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)))
(if (<= t_0 -2e-162)
(* -0.16666666666666666 (* y (* x x)))
(if (<= t_0 1.0) y (* 0.16666666666666666 (* y (* y y)))))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double tmp;
if (t_0 <= -2e-162) {
tmp = -0.16666666666666666 * (y * (x * x));
} else if (t_0 <= 1.0) {
tmp = y;
} else {
tmp = 0.16666666666666666 * (y * (y * y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (sinh(y) * sin(x)) / x
if (t_0 <= (-2d-162)) then
tmp = (-0.16666666666666666d0) * (y * (x * x))
else if (t_0 <= 1.0d0) then
tmp = y
else
tmp = 0.16666666666666666d0 * (y * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (Math.sinh(y) * Math.sin(x)) / x;
double tmp;
if (t_0 <= -2e-162) {
tmp = -0.16666666666666666 * (y * (x * x));
} else if (t_0 <= 1.0) {
tmp = y;
} else {
tmp = 0.16666666666666666 * (y * (y * y));
}
return tmp;
}
def code(x, y): t_0 = (math.sinh(y) * math.sin(x)) / x tmp = 0 if t_0 <= -2e-162: tmp = -0.16666666666666666 * (y * (x * x)) elif t_0 <= 1.0: tmp = y else: tmp = 0.16666666666666666 * (y * (y * y)) return tmp
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) tmp = 0.0 if (t_0 <= -2e-162) tmp = Float64(-0.16666666666666666 * Float64(y * Float64(x * x))); elseif (t_0 <= 1.0) tmp = y; else tmp = Float64(0.16666666666666666 * Float64(y * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = (sinh(y) * sin(x)) / x; tmp = 0.0; if (t_0 <= -2e-162) tmp = -0.16666666666666666 * (y * (x * x)); elseif (t_0 <= 1.0) tmp = y; else tmp = 0.16666666666666666 * (y * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-162], N[(-0.16666666666666666 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], y, N[(0.16666666666666666 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-162}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.99999999999999991e-162Initial program 98.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6431.0
Applied rewrites31.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.1
Applied rewrites30.1%
Taylor expanded in x around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f647.1
Applied rewrites7.1%
Taylor expanded in y around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f647.1
Applied rewrites7.1%
if -1.99999999999999991e-162 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1Initial program 67.4%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6497.5
Applied rewrites97.5%
Taylor expanded in x around 0
Applied rewrites54.1%
*-rgt-identity54.1
Applied rewrites54.1%
if 1 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites66.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6453.9
Applied rewrites53.9%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
Applied rewrites53.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.5
Applied rewrites47.5%
Final simplification38.1%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sinh y) (sin x)) x) 1e-66)
(*
(sin x)
(/
(fma
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666)
(* y (* y y))
y)
x))
(/
(*
(sinh y)
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x (* x x))
x))
x)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 1e-66) {
tmp = sin(x) * (fma(fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y) / x);
} else {
tmp = (sinh(y) * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * (x * x)), x)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 1e-66) tmp = Float64(sin(x) * Float64(fma(fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y) / x)); else tmp = Float64(Float64(sinh(y) * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * Float64(x * x)), x)) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 1e-66], N[(N[Sin[x], $MachinePrecision] * N[(N[(N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sinh[y], $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 10^{-66}:\\
\;\;\;\;\sin x \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sinh y \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.9999999999999998e-67Initial program 79.8%
lift-sin.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites96.0%
if 9.9999999999999998e-67 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6477.2
Applied rewrites77.2%
Final simplification90.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= (/ (* (sinh y) (sin x)) x) 1.0)
(/
(fma -0.16666666666666666 t_0 x)
(/
x
(fma
(* y y)
(*
y
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
y)))
(/
(*
(fma (fma 0.008333333333333333 (* x x) -0.16666666666666666) t_0 x)
(fma
(fma y (* y 0.008333333333333333) 0.16666666666666666)
(* y (* y y))
y))
x))))
double code(double x, double y) {
double t_0 = x * (x * x);
double tmp;
if (((sinh(y) * sin(x)) / x) <= 1.0) {
tmp = fma(-0.16666666666666666, t_0, x) / (x / fma((y * y), (y * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), y));
} else {
tmp = (fma(fma(0.008333333333333333, (x * x), -0.16666666666666666), t_0, x) * fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 1.0) tmp = Float64(fma(-0.16666666666666666, t_0, x) / Float64(x / fma(Float64(y * y), Float64(y * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), y))); else tmp = Float64(Float64(fma(fma(0.008333333333333333, Float64(x * x), -0.16666666666666666), t_0, x) * fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 1.0], N[(N[(-0.16666666666666666 * t$95$0 + x), $MachinePrecision] / N[(x / N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$0 + x), $MachinePrecision] * N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, t\_0, x\right)}{\frac{x}{\mathsf{fma}\left(y \cdot y, y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), y\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), t\_0, x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1Initial program 80.6%
lift-sin.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites95.9%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
*-commutativeN/A
Applied rewrites95.1%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
+-commutativeN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6460.1
Applied rewrites60.1%
if 1 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.6
Applied rewrites82.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.8
Applied rewrites65.8%
Final simplification61.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y y)))
(t_1
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666)))
(if (<= (/ (* (sinh y) (sin x)) x) -1e-160)
(/ (* (fma t_1 t_0 y) (fma x (* (* x x) -0.16666666666666666) x)) x)
(fma t_0 t_1 y))))
double code(double x, double y) {
double t_0 = y * (y * y);
double t_1 = fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666);
double tmp;
if (((sinh(y) * sin(x)) / x) <= -1e-160) {
tmp = (fma(t_1, t_0, y) * fma(x, ((x * x) * -0.16666666666666666), x)) / x;
} else {
tmp = fma(t_0, t_1, y);
}
return tmp;
}
function code(x, y) t_0 = Float64(y * Float64(y * y)) t_1 = fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -1e-160) tmp = Float64(Float64(fma(t_1, t_0, y) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)) / x); else tmp = fma(t_0, t_1, y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -1e-160], N[(N[(N[(t$95$1 * t$95$0 + y), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(t$95$0 * t$95$1 + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot y\right)\\
t_1 := \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right)\\
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -1 \cdot 10^{-160}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_1, t\_0, y\right) \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_1, y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -9.9999999999999999e-161Initial program 98.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6471.7
Applied rewrites71.7%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites68.0%
if -9.9999999999999999e-161 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 80.6%
lift-sin.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites95.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
Final simplification61.2%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sinh y) (sin x)) x) -1e-160)
(*
(fma (* y y) (* y 0.16666666666666666) y)
(fma
(* x x)
(fma
(* x x)
(fma (* x x) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666)
1.0))
(fma
(* y (* y y))
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666)
y)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= -1e-160) {
tmp = fma((y * y), (y * 0.16666666666666666), y) * fma((x * x), fma((x * x), fma((x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0);
} else {
tmp = fma((y * (y * y)), fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666), y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -1e-160) tmp = Float64(fma(Float64(y * y), Float64(y * 0.16666666666666666), y) * fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0)); else tmp = fma(Float64(y * Float64(y * y)), fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666), y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -1e-160], N[(N[(N[(y * y), $MachinePrecision] * N[(y * 0.16666666666666666), $MachinePrecision] + y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -1 \cdot 10^{-160}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, y \cdot 0.16666666666666666, y\right) \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(y \cdot y\right), \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -9.9999999999999999e-161Initial program 98.9%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites74.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6459.0
Applied rewrites59.0%
if -9.9999999999999999e-161 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 80.6%
lift-sin.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites95.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
Final simplification58.6%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sinh y) (sin x)) x) -1e-160)
(*
y
(fma
(* x x)
(fma
(* x x)
(fma (* x x) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666)
1.0))
(fma
(* y (* y y))
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666)
y)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= -1e-160) {
tmp = y * fma((x * x), fma((x * x), fma((x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0);
} else {
tmp = fma((y * (y * y)), fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666), y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -1e-160) tmp = Float64(y * fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0)); else tmp = fma(Float64(y * Float64(y * y)), fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666), y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -1e-160], N[(y * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -1 \cdot 10^{-160}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(y \cdot y\right), \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -9.9999999999999999e-161Initial program 98.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6430.1
Applied rewrites30.1%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6432.9
Applied rewrites32.9%
if -9.9999999999999999e-161 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 80.6%
lift-sin.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites95.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
Final simplification50.8%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sinh y) (sin x)) x) -1e-160)
(*
y
(fma
(* x x)
(fma
(* x x)
(fma (* x x) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666)
1.0))
(fma
(* y y)
(* y (fma (* y y) 0.008333333333333333 0.16666666666666666))
y)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= -1e-160) {
tmp = y * fma((x * x), fma((x * x), fma((x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0);
} else {
tmp = fma((y * y), (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -1e-160) tmp = Float64(y * fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0)); else tmp = fma(Float64(y * y), Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -1e-160], N[(y * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * y), $MachinePrecision] * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -1 \cdot 10^{-160}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -9.9999999999999999e-161Initial program 98.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6430.1
Applied rewrites30.1%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6432.9
Applied rewrites32.9%
if -9.9999999999999999e-161 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 80.6%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.0
Applied rewrites73.0%
Taylor expanded in x around 0
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6457.8
Applied rewrites57.8%
Final simplification50.4%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sinh y) (sin x)) x) -1e-299)
(* (* y (* y y)) (fma (* x x) -0.027777777777777776 0.16666666666666666))
(fma
(* y y)
(* y (fma (* y y) 0.008333333333333333 0.16666666666666666))
y)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= -1e-299) {
tmp = (y * (y * y)) * fma((x * x), -0.027777777777777776, 0.16666666666666666);
} else {
tmp = fma((y * y), (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -1e-299) tmp = Float64(Float64(y * Float64(y * y)) * fma(Float64(x * x), -0.027777777777777776, 0.16666666666666666)); else tmp = fma(Float64(y * y), Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -1e-299], N[(N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.027777777777777776 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(N[(y * y), $MachinePrecision] * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -1 \cdot 10^{-299}:\\
\;\;\;\;\left(y \cdot \left(y \cdot y\right)\right) \cdot \mathsf{fma}\left(x \cdot x, -0.027777777777777776, 0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -9.99999999999999992e-300Initial program 98.3%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites78.5%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.5
Applied rewrites55.5%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
Applied rewrites32.2%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6432.5
Applied rewrites32.5%
if -9.99999999999999992e-300 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 79.3%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6471.0
Applied rewrites71.0%
Taylor expanded in x around 0
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6459.6
Applied rewrites59.6%
Final simplification50.0%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) -1e-299) (* (* y (* y y)) (fma (* x x) -0.027777777777777776 0.16666666666666666)) (fma y (* (* y y) 0.16666666666666666) y)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= -1e-299) {
tmp = (y * (y * y)) * fma((x * x), -0.027777777777777776, 0.16666666666666666);
} else {
tmp = fma(y, ((y * y) * 0.16666666666666666), y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -1e-299) tmp = Float64(Float64(y * Float64(y * y)) * fma(Float64(x * x), -0.027777777777777776, 0.16666666666666666)); else tmp = fma(y, Float64(Float64(y * y) * 0.16666666666666666), y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -1e-299], N[(N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.027777777777777776 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -1 \cdot 10^{-299}:\\
\;\;\;\;\left(y \cdot \left(y \cdot y\right)\right) \cdot \mathsf{fma}\left(x \cdot x, -0.027777777777777776, 0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot 0.16666666666666666, y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -9.99999999999999992e-300Initial program 98.3%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites78.5%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.5
Applied rewrites55.5%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
Applied rewrites32.2%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6432.5
Applied rewrites32.5%
if -9.99999999999999992e-300 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 79.3%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites84.3%
Taylor expanded in x around 0
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6452.6
Applied rewrites52.6%
Final simplification45.5%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) -2e-162) (* y (fma x (* x -0.16666666666666666) 1.0)) (fma y (* (* y y) 0.16666666666666666) y)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= -2e-162) {
tmp = y * fma(x, (x * -0.16666666666666666), 1.0);
} else {
tmp = fma(y, ((y * y) * 0.16666666666666666), y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -2e-162) tmp = Float64(y * fma(x, Float64(x * -0.16666666666666666), 1.0)); else tmp = fma(y, Float64(Float64(y * y) * 0.16666666666666666), y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -2e-162], N[(y * N[(x * N[(x * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -2 \cdot 10^{-162}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(x, x \cdot -0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot 0.16666666666666666, y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.99999999999999991e-162Initial program 98.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6431.0
Applied rewrites31.0%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6430.2
Applied rewrites30.2%
if -1.99999999999999991e-162 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 80.5%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites85.6%
Taylor expanded in x around 0
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6451.6
Applied rewrites51.6%
Final simplification45.2%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) 1.0) (* y (fma x (* x -0.16666666666666666) 1.0)) (* 0.16666666666666666 (* y (* y y)))))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 1.0) {
tmp = y * fma(x, (x * -0.16666666666666666), 1.0);
} else {
tmp = 0.16666666666666666 * (y * (y * y));
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 1.0) tmp = Float64(y * fma(x, Float64(x * -0.16666666666666666), 1.0)); else tmp = Float64(0.16666666666666666 * Float64(y * Float64(y * y))); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 1.0], N[(y * N[(x * N[(x * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 1:\\
\;\;\;\;y \cdot \mathsf{fma}\left(x, x \cdot -0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1Initial program 80.6%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6469.7
Applied rewrites69.7%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6443.1
Applied rewrites43.1%
if 1 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites66.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6453.9
Applied rewrites53.9%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
Applied rewrites53.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.5
Applied rewrites47.5%
Final simplification44.4%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) -2e-162) (* -0.16666666666666666 (* y (* x x))) y))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= -2e-162) {
tmp = -0.16666666666666666 * (y * (x * x));
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (((sinh(y) * sin(x)) / x) <= (-2d-162)) then
tmp = (-0.16666666666666666d0) * (y * (x * x))
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (((Math.sinh(y) * Math.sin(x)) / x) <= -2e-162) {
tmp = -0.16666666666666666 * (y * (x * x));
} else {
tmp = y;
}
return tmp;
}
def code(x, y): tmp = 0 if ((math.sinh(y) * math.sin(x)) / x) <= -2e-162: tmp = -0.16666666666666666 * (y * (x * x)) else: tmp = y return tmp
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -2e-162) tmp = Float64(-0.16666666666666666 * Float64(y * Float64(x * x))); else tmp = y; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((sinh(y) * sin(x)) / x) <= -2e-162) tmp = -0.16666666666666666 * (y * (x * x)); else tmp = y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -2e-162], N[(-0.16666666666666666 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -2 \cdot 10^{-162}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.99999999999999991e-162Initial program 98.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6431.0
Applied rewrites31.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.1
Applied rewrites30.1%
Taylor expanded in x around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f647.1
Applied rewrites7.1%
Taylor expanded in y around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f647.1
Applied rewrites7.1%
if -1.99999999999999991e-162 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 80.5%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6459.9
Applied rewrites59.9%
Taylor expanded in x around 0
Applied rewrites33.8%
*-rgt-identity33.8
Applied rewrites33.8%
Final simplification25.8%
(FPCore (x y)
:precision binary64
(let* ((t_0
(*
(fma
(* y y)
(* y (fma (* y y) 0.008333333333333333 0.16666666666666666))
y)
(/ (sin x) x))))
(if (<= y 0.49)
t_0
(if (<= y 1.2e+62)
(/ (* (sinh y) (fma x (* (* x x) -0.16666666666666666) x)) x)
t_0))))
double code(double x, double y) {
double t_0 = fma((y * y), (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), y) * (sin(x) / x);
double tmp;
if (y <= 0.49) {
tmp = t_0;
} else if (y <= 1.2e+62) {
tmp = (sinh(y) * fma(x, ((x * x) * -0.16666666666666666), x)) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(fma(Float64(y * y), Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), y) * Float64(sin(x) / x)) tmp = 0.0 if (y <= 0.49) tmp = t_0; elseif (y <= 1.2e+62) tmp = Float64(Float64(sinh(y) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)) / x); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.49], t$95$0, If[LessEqual[y, 1.2e+62], N[(N[(N[Sinh[y], $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y \cdot y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y\right) \cdot \frac{\sin x}{x}\\
\mathbf{if}\;y \leq 0.49:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+62}:\\
\;\;\;\;\frac{\sinh y \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 0.48999999999999999 or 1.2e62 < y Initial program 85.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6479.3
Applied rewrites79.3%
lift-sin.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-/.f64N/A
lower-*.f6493.8
Applied rewrites93.8%
if 0.48999999999999999 < y < 1.2e62Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.8
Applied rewrites81.8%
Final simplification93.3%
(FPCore (x y) :precision binary64 y)
double code(double x, double y) {
return y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y
end function
public static double code(double x, double y) {
return y;
}
def code(x, y): return y
function code(x, y) return y end
function tmp = code(x, y) tmp = y; end
code[x_, y_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 86.0%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6451.2
Applied rewrites51.2%
Taylor expanded in x around 0
Applied rewrites31.4%
*-rgt-identity31.4
Applied rewrites31.4%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
return sin(x) * (sinh(y) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / x)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / x); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{x}
\end{array}
herbie shell --seed 2024214
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (* (sin x) (/ (sinh y) x)))
(/ (* (sin x) (sinh y)) x))