
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 29 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
Initial program 100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sinh y) y)) (t_1 (* (sin x) t_0)) (t_2 (* x (* x x))))
(if (<= t_1 (- INFINITY))
(* t_0 (fma -0.16666666666666666 t_2 x))
(if (<= t_1 1.0)
(*
(sin x)
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0))
(*
t_0
(fma
(fma x (* x 0.008333333333333333) -0.16666666666666666)
t_2
x))))))
double code(double x, double y) {
double t_0 = sinh(y) / y;
double t_1 = sin(x) * t_0;
double t_2 = x * (x * x);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_0 * fma(-0.16666666666666666, t_2, x);
} else if (t_1 <= 1.0) {
tmp = sin(x) * fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
} else {
tmp = t_0 * fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), t_2, x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sinh(y) / y) t_1 = Float64(sin(x) * t_0) t_2 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t_0 * fma(-0.16666666666666666, t_2, x)); elseif (t_1 <= 1.0) tmp = Float64(sin(x) * fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0)); else tmp = Float64(t_0 * fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), t_2, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t$95$0 * N[(-0.16666666666666666 * t$95$2 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$2 + x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y}{y}\\
t_1 := \sin x \cdot t\_0\\
t_2 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(-0.16666666666666666, t\_2, x\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), t\_2, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.8
Applied rewrites82.8%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites99.3%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6471.4
Applied rewrites71.4%
Final simplification87.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (/ (sinh y) y)))
(t_1 (* x (* x x)))
(t_2
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)))
(if (<= t_0 (- INFINITY))
(* t_2 (fma (* (* x x) (* (* x x) -0.0001984126984126984)) t_1 x))
(if (<= t_0 1.0)
(*
(sin x)
(fma
(* y y)
(fma y (* y 0.008333333333333333) 0.16666666666666666)
1.0))
(*
t_2
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
t_1
x))))))
double code(double x, double y) {
double t_0 = sin(x) * (sinh(y) / y);
double t_1 = x * (x * x);
double t_2 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_2 * fma(((x * x) * ((x * x) * -0.0001984126984126984)), t_1, x);
} else if (t_0 <= 1.0) {
tmp = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
} else {
tmp = t_2 * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), t_1, x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * Float64(sinh(y) / y)) t_1 = Float64(x * Float64(x * x)) t_2 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(t_2 * fma(Float64(Float64(x * x) * Float64(Float64(x * x) * -0.0001984126984126984)), t_1, x)); elseif (t_0 <= 1.0) tmp = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); else tmp = Float64(t_2 * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), t_1, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(t$95$2 * N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \frac{\sinh y}{y}\\
t_1 := x \cdot \left(x \cdot x\right)\\
t_2 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0001984126984126984\right), t\_1, x\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), t\_1, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites77.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites71.2%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6471.2
Applied rewrites71.2%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
Applied rewrites99.2%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites85.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
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-*.f6461.4
Applied rewrites61.4%
Final simplification81.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (/ (sinh y) y)))
(t_1 (* x (* x x)))
(t_2
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)))
(if (<= t_0 (- INFINITY))
(* t_2 (fma (* (* x x) (* (* x x) -0.0001984126984126984)) t_1 x))
(if (<= t_0 1.0)
(* (sin x) (fma 0.16666666666666666 (* y y) 1.0))
(*
t_2
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
t_1
x))))))
double code(double x, double y) {
double t_0 = sin(x) * (sinh(y) / y);
double t_1 = x * (x * x);
double t_2 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_2 * fma(((x * x) * ((x * x) * -0.0001984126984126984)), t_1, x);
} else if (t_0 <= 1.0) {
tmp = sin(x) * fma(0.16666666666666666, (y * y), 1.0);
} else {
tmp = t_2 * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), t_1, x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * Float64(sinh(y) / y)) t_1 = Float64(x * Float64(x * x)) t_2 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(t_2 * fma(Float64(Float64(x * x) * Float64(Float64(x * x) * -0.0001984126984126984)), t_1, x)); elseif (t_0 <= 1.0) tmp = Float64(sin(x) * fma(0.16666666666666666, Float64(y * y), 1.0)); else tmp = Float64(t_2 * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), t_1, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(t$95$2 * N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[(N[Sin[x], $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \frac{\sinh y}{y}\\
t_1 := x \cdot \left(x \cdot x\right)\\
t_2 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0001984126984126984\right), t\_1, x\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), t\_1, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites77.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites71.2%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6471.2
Applied rewrites71.2%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 100.0%
Taylor expanded in y around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites85.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
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-*.f6461.4
Applied rewrites61.4%
Final simplification81.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (/ (sinh y) y)))
(t_1 (* x (* x x)))
(t_2
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)))
(if (<= t_0 (- INFINITY))
(* t_2 (fma (* (* x x) (* (* x x) -0.0001984126984126984)) t_1 x))
(if (<= t_0 1.0)
(sin x)
(*
t_2
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
t_1
x))))))
double code(double x, double y) {
double t_0 = sin(x) * (sinh(y) / y);
double t_1 = x * (x * x);
double t_2 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_2 * fma(((x * x) * ((x * x) * -0.0001984126984126984)), t_1, x);
} else if (t_0 <= 1.0) {
tmp = sin(x);
} else {
tmp = t_2 * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), t_1, x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * Float64(sinh(y) / y)) t_1 = Float64(x * Float64(x * x)) t_2 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(t_2 * fma(Float64(Float64(x * x) * Float64(Float64(x * x) * -0.0001984126984126984)), t_1, x)); elseif (t_0 <= 1.0) tmp = sin(x); else tmp = Float64(t_2 * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), t_1, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(t$95$2 * N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[x], $MachinePrecision], N[(t$95$2 * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \frac{\sinh y}{y}\\
t_1 := x \cdot \left(x \cdot x\right)\\
t_2 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0001984126984126984\right), t\_1, x\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), t\_1, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites77.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites71.2%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6471.2
Applied rewrites71.2%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6498.6
Applied rewrites98.6%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites85.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
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-*.f6461.4
Applied rewrites61.4%
Final simplification81.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x)))
(t_1
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)))
(if (<= (* (sin x) (/ (sinh y) y)) -0.05)
(* t_1 (fma (* (* x x) (* (* x x) -0.0001984126984126984)) t_0 x))
(*
t_1
(fma (fma (* x x) 0.008333333333333333 -0.16666666666666666) t_0 x)))))
double code(double x, double y) {
double t_0 = x * (x * x);
double t_1 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = t_1 * fma(((x * x) * ((x * x) * -0.0001984126984126984)), t_0, x);
} else {
tmp = t_1 * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), t_0, x);
}
return tmp;
}
function code(x, y) t_0 = Float64(x * Float64(x * x)) t_1 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(t_1 * fma(Float64(Float64(x * x) * Float64(Float64(x * x) * -0.0001984126984126984)), t_0, x)); else tmp = Float64(t_1 * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), t_0, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -0.05], N[(t$95$1 * N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision] * t$95$0 + x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * t$95$0 + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.05:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0001984126984126984\right), t\_0, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), t\_0, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites46.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6446.0
Applied rewrites46.0%
if -0.050000000000000003 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.5%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
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-*.f6466.5
Applied rewrites66.5%
Final simplification59.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= (* (sin x) (/ (sinh y) y)) -0.05)
(*
(fma (* (* x x) (* (* x x) -0.0001984126984126984)) t_0 x)
(fma y (* y (fma (* y y) 0.008333333333333333 0.16666666666666666)) 1.0))
(*
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)
(fma (fma (* x x) 0.008333333333333333 -0.16666666666666666) t_0 x)))))
double code(double x, double y) {
double t_0 = x * (x * x);
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = fma(((x * x) * ((x * x) * -0.0001984126984126984)), t_0, x) * fma(y, (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), 1.0);
} else {
tmp = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), t_0, x);
}
return tmp;
}
function code(x, y) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(fma(Float64(Float64(x * x) * Float64(Float64(x * x) * -0.0001984126984126984)), t_0, x) * fma(y, Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), 1.0)); else tmp = Float64(fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), t_0, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision] * t$95$0 + x), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * t$95$0 + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0001984126984126984\right), t\_0, x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), t\_0, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites46.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6446.0
Applied rewrites46.0%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6442.8
Applied rewrites42.8%
if -0.050000000000000003 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.5%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
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-*.f6466.5
Applied rewrites66.5%
Final simplification58.1%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) -0.05)
(*
(fma (* (* x x) (* (* x x) -0.0001984126984126984)) (* x (* x x)) x)
(fma y (* y (fma (* y y) 0.008333333333333333 0.16666666666666666)) 1.0))
(fma
(*
(* y y)
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
x
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = fma(((x * x) * ((x * x) * -0.0001984126984126984)), (x * (x * x)), x) * fma(y, (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), 1.0);
} else {
tmp = fma(((y * y) * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(fma(Float64(Float64(x * x) * Float64(Float64(x * x) * -0.0001984126984126984)), Float64(x * Float64(x * x)), x) * fma(y, Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), 1.0)); else tmp = fma(Float64(Float64(y * y) * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0001984126984126984\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), x, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites46.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6446.0
Applied rewrites46.0%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6442.8
Applied rewrites42.8%
if -0.050000000000000003 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.5%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites64.2%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites65.9%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) -0.05)
(*
(fma (* (* x x) (* (* x x) -0.0001984126984126984)) (* x (* x x)) x)
(fma y (* y 0.16666666666666666) 1.0))
(fma
(*
(* y y)
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
x
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = fma(((x * x) * ((x * x) * -0.0001984126984126984)), (x * (x * x)), x) * fma(y, (y * 0.16666666666666666), 1.0);
} else {
tmp = fma(((y * y) * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(fma(Float64(Float64(x * x) * Float64(Float64(x * x) * -0.0001984126984126984)), Float64(x * Float64(x * x)), x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); else tmp = fma(Float64(Float64(y * y) * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0001984126984126984\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), x, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites46.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6446.0
Applied rewrites46.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6433.3
Applied rewrites33.3%
if -0.050000000000000003 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.5%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites64.2%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites65.9%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) 1e-5)
(*
x
(*
(fma y (* y (fma (* y y) 0.008333333333333333 0.16666666666666666)) 1.0)
(fma x (* x -0.16666666666666666) 1.0)))
(fma
(*
(* y y)
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
x
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= 1e-5) {
tmp = x * (fma(y, (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), 1.0) * fma(x, (x * -0.16666666666666666), 1.0));
} else {
tmp = fma(((y * y) * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= 1e-5) tmp = Float64(x * Float64(fma(y, Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), 1.0) * fma(x, Float64(x * -0.16666666666666666), 1.0))); else tmp = fma(Float64(Float64(y * y) * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1e-5], N[(x * N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(x * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 10^{-5}:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x, x \cdot -0.16666666666666666, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), x, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
Applied rewrites87.6%
Taylor expanded in x around 0
lower-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
Applied rewrites64.4%
if 1.00000000000000008e-5 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites88.7%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites43.2%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites46.0%
Final simplification57.1%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) -0.05)
(*
(* x x)
(*
x
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* -0.16666666666666666 (* y y))
-0.16666666666666666)))
(fma
(*
(* y y)
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
x
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = (x * x) * (x * fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (-0.16666666666666666 * (y * y)), -0.16666666666666666));
} else {
tmp = fma(((y * y) * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(Float64(x * x) * Float64(x * fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(-0.16666666666666666 * Float64(y * y)), -0.16666666666666666))); else tmp = fma(Float64(Float64(y * y) * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(x * x), $MachinePrecision] * N[(x * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.05:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot \mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), -0.16666666666666666 \cdot \left(y \cdot y\right), -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), x, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites85.3%
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-*.f6445.0
Applied rewrites45.0%
Taylor expanded in y around 0
Applied rewrites40.8%
Taylor expanded in x around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
Applied rewrites19.7%
if -0.050000000000000003 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.5%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites64.2%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites65.9%
Final simplification49.5%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) 1e-5)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* y 0.16666666666666666) 1.0))
(fma
(*
(* y y)
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
x
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= 1e-5) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * 0.16666666666666666), 1.0);
} else {
tmp = fma(((y * y) * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= 1e-5) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); else tmp = fma(Float64(Float64(y * y) * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1e-5], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), x, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.8%
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-*.f6466.9
Applied rewrites66.9%
Taylor expanded in y around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
if 1.00000000000000008e-5 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites88.7%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites43.2%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites46.0%
Final simplification53.6%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) 1e-5)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* y 0.16666666666666666) 1.0))
(fma
(*
x
(*
y
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666)))
y
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= 1e-5) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * 0.16666666666666666), 1.0);
} else {
tmp = fma((x * (y * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666))), y, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= 1e-5) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); else tmp = fma(Float64(x * Float64(y * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666))), y, x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1e-5], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot \left(y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right)\right), y, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.8%
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-*.f6466.9
Applied rewrites66.9%
Taylor expanded in y around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
if 1.00000000000000008e-5 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites88.7%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites43.2%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites45.1%
Final simplification53.3%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) 1e-5)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* y 0.16666666666666666) 1.0))
(fma
(fma y (* y (* (* y y) 0.0001984126984126984)) 0.16666666666666666)
(* x (* y y))
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= 1e-5) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * 0.16666666666666666), 1.0);
} else {
tmp = fma(fma(y, (y * ((y * y) * 0.0001984126984126984)), 0.16666666666666666), (x * (y * y)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= 1e-5) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); else tmp = fma(fma(y, Float64(y * Float64(Float64(y * y) * 0.0001984126984126984)), 0.16666666666666666), Float64(x * Float64(y * y)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1e-5], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right), 0.16666666666666666\right), x \cdot \left(y \cdot y\right), x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.8%
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-*.f6466.9
Applied rewrites66.9%
Taylor expanded in y around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
if 1.00000000000000008e-5 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites88.7%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites43.2%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6443.2
Applied rewrites43.2%
Final simplification52.5%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) 1e-5)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* y 0.16666666666666666) 1.0))
(fma (* y (* y (* (* y y) 0.0001984126984126984))) (* x (* y y)) x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= 1e-5) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * 0.16666666666666666), 1.0);
} else {
tmp = fma((y * (y * ((y * y) * 0.0001984126984126984))), (x * (y * y)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= 1e-5) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); else tmp = fma(Float64(y * Float64(y * Float64(Float64(y * y) * 0.0001984126984126984))), Float64(x * Float64(y * y)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1e-5], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right)\right), x \cdot \left(y \cdot y\right), x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.8%
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-*.f6466.9
Applied rewrites66.9%
Taylor expanded in y around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
if 1.00000000000000008e-5 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites88.7%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites43.2%
Taylor expanded in y around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6443.2
Applied rewrites43.2%
Final simplification52.5%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) 1e-5)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* y 0.16666666666666666) 1.0))
(fma
y
(* y (* x (fma (* y y) 0.008333333333333333 0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= 1e-5) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * 0.16666666666666666), 1.0);
} else {
tmp = fma(y, (y * (x * fma((y * y), 0.008333333333333333, 0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= 1e-5) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); else tmp = fma(y, Float64(y * Float64(x * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666))), x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1e-5], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(x * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \left(x \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right)\right), x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.8%
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-*.f6466.9
Applied rewrites66.9%
Taylor expanded in y around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
if 1.00000000000000008e-5 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites88.7%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites43.2%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6437.6
Applied rewrites37.6%
Final simplification50.3%
(FPCore (x y) :precision binary64 (if (<= (* (sin x) (/ (sinh y) y)) -0.05) (* x (* -0.16666666666666666 (* x x))) (fma 0.16666666666666666 (* x (* y y)) x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = x * (-0.16666666666666666 * (x * x));
} else {
tmp = fma(0.16666666666666666, (x * (y * y)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(x * Float64(-0.16666666666666666 * Float64(x * x))); else tmp = fma(0.16666666666666666, Float64(x * Float64(y * y)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -0.05], N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.05:\\
\;\;\;\;x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot \left(y \cdot y\right), x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6438.0
Applied rewrites38.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-*.f6415.0
Applied rewrites15.0%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6414.8
Applied rewrites14.8%
if -0.050000000000000003 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.5%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites64.2%
Taylor expanded in y around 0
Applied rewrites55.4%
Final simplification41.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (fma (* y y) 0.0001984126984126984 0.008333333333333333))
(t_1 (fma y (* y t_0) 0.16666666666666666)))
(if (<= (sin x) 1e-5)
(*
(fma y (* y (fma (* y y) t_0 0.16666666666666666)) 1.0)
(fma
(fma
(* x x)
(fma (* x x) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666)
(* x (* x x))
x))
(fma
x
(fma
y
(* y t_1)
(*
(fma t_1 (* (* y y) 0.008333333333333333) 0.008333333333333333)
(* (* x x) (* x x))))
x))))
double code(double x, double y) {
double t_0 = fma((y * y), 0.0001984126984126984, 0.008333333333333333);
double t_1 = fma(y, (y * t_0), 0.16666666666666666);
double tmp;
if (sin(x) <= 1e-5) {
tmp = fma(y, (y * fma((y * y), t_0, 0.16666666666666666)), 1.0) * fma(fma((x * x), fma((x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), (x * (x * x)), x);
} else {
tmp = fma(x, fma(y, (y * t_1), (fma(t_1, ((y * y) * 0.008333333333333333), 0.008333333333333333) * ((x * x) * (x * x)))), x);
}
return tmp;
}
function code(x, y) t_0 = fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333) t_1 = fma(y, Float64(y * t_0), 0.16666666666666666) tmp = 0.0 if (sin(x) <= 1e-5) tmp = Float64(fma(y, Float64(y * fma(Float64(y * y), t_0, 0.16666666666666666)), 1.0) * fma(fma(Float64(x * x), fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), Float64(x * Float64(x * x)), x)); else tmp = fma(x, fma(y, Float64(y * t_1), Float64(fma(t_1, Float64(Float64(y * y) * 0.008333333333333333), 0.008333333333333333) * Float64(Float64(x * x) * Float64(x * x)))), x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * t$95$0), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]}, If[LessEqual[N[Sin[x], $MachinePrecision], 1e-5], N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * t$95$0 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(y * t$95$1), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right)\\
t_1 := \mathsf{fma}\left(y, y \cdot t\_0, 0.16666666666666666\right)\\
\mathbf{if}\;\sin x \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, t\_0, 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, y \cdot t\_1, \mathsf{fma}\left(t\_1, \left(y \cdot y\right) \cdot 0.008333333333333333, 0.008333333333333333\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites89.1%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.6%
if 1.00000000000000008e-5 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.4%
Taylor expanded in x around 0
Applied rewrites21.4%
Taylor expanded in x around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites24.5%
Final simplification59.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (fma (* y y) 0.0001984126984126984 0.008333333333333333)))
(if (<= (sin x) 1e-5)
(*
(fma y (* y (fma (* y y) t_0 0.16666666666666666)) 1.0)
(fma
(fma
(* x x)
(fma (* x x) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666)
(* x (* x x))
x))
(fma
x
(*
(fma
(fma y (* y t_0) 0.16666666666666666)
(* (* y y) 0.008333333333333333)
0.008333333333333333)
(* (* x x) (* x x)))
x))))
double code(double x, double y) {
double t_0 = fma((y * y), 0.0001984126984126984, 0.008333333333333333);
double tmp;
if (sin(x) <= 1e-5) {
tmp = fma(y, (y * fma((y * y), t_0, 0.16666666666666666)), 1.0) * fma(fma((x * x), fma((x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), (x * (x * x)), x);
} else {
tmp = fma(x, (fma(fma(y, (y * t_0), 0.16666666666666666), ((y * y) * 0.008333333333333333), 0.008333333333333333) * ((x * x) * (x * x))), x);
}
return tmp;
}
function code(x, y) t_0 = fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333) tmp = 0.0 if (sin(x) <= 1e-5) tmp = Float64(fma(y, Float64(y * fma(Float64(y * y), t_0, 0.16666666666666666)), 1.0) * fma(fma(Float64(x * x), fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), Float64(x * Float64(x * x)), x)); else tmp = fma(x, Float64(fma(fma(y, Float64(y * t_0), 0.16666666666666666), Float64(Float64(y * y) * 0.008333333333333333), 0.008333333333333333) * Float64(Float64(x * x) * Float64(x * x))), x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]}, If[LessEqual[N[Sin[x], $MachinePrecision], 1e-5], N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * t$95$0 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(N[(y * N[(y * t$95$0), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right)\\
\mathbf{if}\;\sin x \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, t\_0, 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot t\_0, 0.16666666666666666\right), \left(y \cdot y\right) \cdot 0.008333333333333333, 0.008333333333333333\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites89.1%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.6%
if 1.00000000000000008e-5 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.4%
Taylor expanded in x around 0
Applied rewrites21.4%
Taylor expanded in x around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites24.5%
Final simplification59.2%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 1e-5)
(*
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)
(fma x (* -0.16666666666666666 (* x x)) x))
(fma
(*
x
(*
y
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666)))
y
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-5) {
tmp = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(x, (-0.16666666666666666 * (x * x)), x);
} else {
tmp = fma((x * (y * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666))), y, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-5) tmp = Float64(fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x)); else tmp = fma(Float64(x * Float64(y * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666))), y, x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-5], N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot \left(y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right)\right), y, x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites89.1%
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-*.f6470.1
Applied rewrites70.1%
if 1.00000000000000008e-5 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.4%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites23.3%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites23.3%
Final simplification58.6%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 1e-5)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma
y
(* y (fma (* y y) (* (* y y) 0.0001984126984126984) 0.16666666666666666))
1.0))
(fma
(*
x
(*
y
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666)))
y
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-5) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * fma((y * y), ((y * y) * 0.0001984126984126984), 0.16666666666666666)), 1.0);
} else {
tmp = fma((x * (y * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666))), y, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-5) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * fma(Float64(y * y), Float64(Float64(y * y) * 0.0001984126984126984), 0.16666666666666666)), 1.0)); else tmp = fma(Float64(x * Float64(y * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666))), y, x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-5], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \left(y \cdot y\right) \cdot 0.0001984126984126984, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot \left(y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right)\right), y, x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites89.1%
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-*.f6470.1
Applied rewrites70.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
if 1.00000000000000008e-5 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites92.4%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites23.3%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites23.3%
Final simplification58.5%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.05)
(*
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)
(* x (* -0.16666666666666666 (* x x))))
(fma
(*
(* y y)
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
x
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.05) {
tmp = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * (x * (-0.16666666666666666 * (x * x)));
} else {
tmp = fma(((y * y) * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.05) tmp = Float64(fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * Float64(x * Float64(-0.16666666666666666 * Float64(x * x)))); else tmp = fma(Float64(Float64(y * y) * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.05], N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right) \cdot \left(x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), x, x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites89.4%
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-*.f6430.2
Applied rewrites30.2%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.2
Applied rewrites30.2%
if -0.050000000000000003 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.1%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.1%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites67.6%
Final simplification58.5%
(FPCore (x y)
:precision binary64
(if (<= y 1.7e-5)
(sin x)
(if (<= y 1e+52)
(/ (* (sinh y) (fma x (* -0.16666666666666666 (* x x)) x)) y)
(*
(sin x)
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 1.7e-5) {
tmp = sin(x);
} else if (y <= 1e+52) {
tmp = (sinh(y) * fma(x, (-0.16666666666666666 * (x * x)), x)) / y;
} else {
tmp = sin(x) * fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 1.7e-5) tmp = sin(x); elseif (y <= 1e+52) tmp = Float64(Float64(sinh(y) * fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x)) / y); else tmp = Float64(sin(x) * fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[y, 1.7e-5], N[Sin[x], $MachinePrecision], If[LessEqual[y, 1e+52], N[(N[(N[Sinh[y], $MachinePrecision] * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 10^{+52}:\\
\;\;\;\;\frac{\sinh y \cdot \mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if y < 1.7e-5Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6464.8
Applied rewrites64.8%
if 1.7e-5 < y < 9.9999999999999999e51Initial program 99.8%
lift-sin.f64N/A
lift-sinh.f64N/A
clear-numN/A
clear-numN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6499.9
Applied rewrites99.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-*.f6492.7
Applied rewrites92.7%
if 9.9999999999999999e51 < y Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites100.0%
Final simplification74.2%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.05)
(*
(* (* y y) (* y y))
(fma x 0.008333333333333333 (* (* x (* x x)) -0.001388888888888889)))
(fma
(*
(* y y)
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
x
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.05) {
tmp = ((y * y) * (y * y)) * fma(x, 0.008333333333333333, ((x * (x * x)) * -0.001388888888888889));
} else {
tmp = fma(((y * y) * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.05) tmp = Float64(Float64(Float64(y * y) * Float64(y * y)) * fma(x, 0.008333333333333333, Float64(Float64(x * Float64(x * x)) * -0.001388888888888889))); else tmp = fma(Float64(Float64(y * y) * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), x, x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.05], N[(N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(x * 0.008333333333333333 + N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.05:\\
\;\;\;\;\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \mathsf{fma}\left(x, 0.008333333333333333, \left(x \cdot \left(x \cdot x\right)\right) \cdot -0.001388888888888889\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), x, x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites89.4%
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-*.f6430.2
Applied rewrites30.2%
Taylor expanded in y around 0
Applied rewrites28.7%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-eval28.3
Applied rewrites28.3%
if -0.050000000000000003 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.1%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.1%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites67.6%
(FPCore (x y)
:precision binary64
(if (<= y 1.7e-5)
(sin x)
(if (<= y 3.85e+77)
(/ (* (sinh y) (fma x (* -0.16666666666666666 (* x x)) x)) y)
(*
(sin x)
(fma
(* y y)
(fma y (* y 0.008333333333333333) 0.16666666666666666)
1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 1.7e-5) {
tmp = sin(x);
} else if (y <= 3.85e+77) {
tmp = (sinh(y) * fma(x, (-0.16666666666666666 * (x * x)), x)) / y;
} else {
tmp = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 1.7e-5) tmp = sin(x); elseif (y <= 3.85e+77) tmp = Float64(Float64(sinh(y) * fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x)) / y); else tmp = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[y, 1.7e-5], N[Sin[x], $MachinePrecision], If[LessEqual[y, 3.85e+77], N[(N[(N[Sinh[y], $MachinePrecision] * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 3.85 \cdot 10^{+77}:\\
\;\;\;\;\frac{\sinh y \cdot \mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if y < 1.7e-5Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6464.8
Applied rewrites64.8%
if 1.7e-5 < y < 3.8499999999999999e77Initial program 99.8%
lift-sin.f64N/A
lift-sinh.f64N/A
clear-numN/A
clear-numN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6499.9
Applied rewrites99.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-*.f6483.2
Applied rewrites83.2%
if 3.8499999999999999e77 < y Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
Applied rewrites100.0%
Final simplification73.4%
(FPCore (x y)
:precision binary64
(if (<= y 0.0022)
(* (sin x) (fma 0.16666666666666666 (* y y) 1.0))
(if (<= y 3.85e+77)
(* (/ (sinh y) y) (fma -0.16666666666666666 (* x (* x x)) x))
(*
(sin x)
(fma
(* y y)
(fma y (* y 0.008333333333333333) 0.16666666666666666)
1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 0.0022) {
tmp = sin(x) * fma(0.16666666666666666, (y * y), 1.0);
} else if (y <= 3.85e+77) {
tmp = (sinh(y) / y) * fma(-0.16666666666666666, (x * (x * x)), x);
} else {
tmp = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 0.0022) tmp = Float64(sin(x) * fma(0.16666666666666666, Float64(y * y), 1.0)); elseif (y <= 3.85e+77) tmp = Float64(Float64(sinh(y) / y) * fma(-0.16666666666666666, Float64(x * Float64(x * x)), x)); else tmp = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[y, 0.0022], N[(N[Sin[x], $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.85e+77], N[(N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision] * N[(-0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0022:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{elif}\;y \leq 3.85 \cdot 10^{+77}:\\
\;\;\;\;\frac{\sinh y}{y} \cdot \mathsf{fma}\left(-0.16666666666666666, x \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if y < 0.00220000000000000013Initial program 100.0%
Taylor expanded in y around 0
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6480.0
Applied rewrites80.0%
if 0.00220000000000000013 < y < 3.8499999999999999e77Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.3
Applied rewrites82.3%
if 3.8499999999999999e77 < y Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
Applied rewrites100.0%
Final simplification84.3%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.05)
(* (* x x) (* x (fma (* y y) -0.027777777777777776 -0.16666666666666666)))
(fma
y
(* y (* x (fma (* y y) 0.008333333333333333 0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.05) {
tmp = (x * x) * (x * fma((y * y), -0.027777777777777776, -0.16666666666666666));
} else {
tmp = fma(y, (y * (x * fma((y * y), 0.008333333333333333, 0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.05) tmp = Float64(Float64(x * x) * Float64(x * fma(Float64(y * y), -0.027777777777777776, -0.16666666666666666))); else tmp = fma(y, Float64(y * Float64(x * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666))), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.05], N[(N[(x * x), $MachinePrecision] * N[(x * N[(N[(y * y), $MachinePrecision] * -0.027777777777777776 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(x * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.05:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot \mathsf{fma}\left(y \cdot y, -0.027777777777777776, -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \left(x \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right)\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites89.4%
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-*.f6430.2
Applied rewrites30.2%
Taylor expanded in y around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.1
Applied rewrites27.1%
Taylor expanded in x around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-eval27.1
Applied rewrites27.1%
if -0.050000000000000003 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.1%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.1%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6460.2
Applied rewrites60.2%
(FPCore (x y) :precision binary64 (if (<= (sin x) -0.05) (* (* x x) (* x (fma (* y y) -0.027777777777777776 -0.16666666666666666))) (fma 0.16666666666666666 (* x (* y y)) x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.05) {
tmp = (x * x) * (x * fma((y * y), -0.027777777777777776, -0.16666666666666666));
} else {
tmp = fma(0.16666666666666666, (x * (y * y)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.05) tmp = Float64(Float64(x * x) * Float64(x * fma(Float64(y * y), -0.027777777777777776, -0.16666666666666666))); else tmp = fma(0.16666666666666666, Float64(x * Float64(y * y)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.05], N[(N[(x * x), $MachinePrecision] * N[(x * N[(N[(y * y), $MachinePrecision] * -0.027777777777777776 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.05:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot \mathsf{fma}\left(y \cdot y, -0.027777777777777776, -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot \left(y \cdot y\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites89.4%
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-*.f6430.2
Applied rewrites30.2%
Taylor expanded in y around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.1
Applied rewrites27.1%
Taylor expanded in x around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-eval27.1
Applied rewrites27.1%
if -0.050000000000000003 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
Applied rewrites90.1%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.1%
Taylor expanded in y around 0
Applied rewrites53.1%
Final simplification46.8%
(FPCore (x y) :precision binary64 (* x (* -0.16666666666666666 (* x x))))
double code(double x, double y) {
return x * (-0.16666666666666666 * (x * x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * ((-0.16666666666666666d0) * (x * x))
end function
public static double code(double x, double y) {
return x * (-0.16666666666666666 * (x * x));
}
def code(x, y): return x * (-0.16666666666666666 * (x * x))
function code(x, y) return Float64(x * Float64(-0.16666666666666666 * Float64(x * x))) end
function tmp = code(x, y) tmp = x * (-0.16666666666666666 * (x * x)); end
code[x_, y_] := N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6448.0
Applied rewrites48.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-*.f6435.9
Applied rewrites35.9%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6413.1
Applied rewrites13.1%
herbie shell --seed 2024219
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))