
(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 21 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)))
(if (<= t_1 (- INFINITY))
(* t_0 (* x (* -0.16666666666666666 (* x 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)
(* x (* x x))
x))))))
double code(double x, double y) {
double t_0 = sinh(y) / y;
double t_1 = sin(x) * t_0;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_0 * (x * (-0.16666666666666666 * (x * 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), (x * (x * x)), x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sinh(y) / y) t_1 = Float64(sin(x) * t_0) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t_0 * Float64(x * Float64(-0.16666666666666666 * Float64(x * 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), Float64(x * Float64(x * x)), 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(t$95$0 * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $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] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y}{y}\\
t_1 := \sin x \cdot t\_0\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_0 \cdot \left(x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)\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), x \cdot \left(x \cdot x\right), 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-*.f6474.6
Applied rewrites74.6%
Taylor expanded in x around inf
Applied rewrites23.8%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
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-*.f6475.4
Applied rewrites75.4%
Final simplification75.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (/ (sinh y) y))) (t_1 (* x (* x x))))
(if (<= t_0 (- INFINITY))
(*
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)
(fma
(fma
x
(* x (fma x (* x -0.0001984126984126984) 0.008333333333333333))
-0.16666666666666666)
t_1
x))
(if (<= t_0 1.0)
(sin x)
(*
(fma (fma x (* x 0.008333333333333333) -0.16666666666666666) t_1 x)
(fma 0.16666666666666666 (* y y) 1.0))))))
double code(double x, double y) {
double t_0 = sin(x) * (sinh(y) / y);
double t_1 = x * (x * x);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(fma(x, (x * fma(x, (x * -0.0001984126984126984), 0.008333333333333333)), -0.16666666666666666), t_1, x);
} else if (t_0 <= 1.0) {
tmp = sin(x);
} else {
tmp = fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), t_1, x) * fma(0.16666666666666666, (y * y), 1.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * Float64(sinh(y) / y)) t_1 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(fma(x, Float64(x * fma(x, Float64(x * -0.0001984126984126984), 0.008333333333333333)), -0.16666666666666666), t_1, x)); elseif (t_0 <= 1.0) tmp = sin(x); else tmp = Float64(fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), t_1, x) * fma(0.16666666666666666, Float64(y * y), 1.0)); 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]}, If[LessEqual[t$95$0, (-Infinity)], 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[(x * N[(x * N[(x * N[(x * -0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[x], $MachinePrecision], N[(N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $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)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\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, x \cdot \mathsf{fma}\left(x, x \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), t\_1, x\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), t\_1, x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\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
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6480.2
Applied rewrites80.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
lower-fma.f64N/A
Applied rewrites63.8%
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.3
Applied rewrites98.3%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6454.7
Applied rewrites54.7%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6453.5
Applied rewrites53.5%
Final simplification79.8%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) -0.05)
(*
(fma 0.16666666666666666 (* y y) 1.0)
(* x (* -0.16666666666666666 (* x x))))
(fma
x
(* x (* x (fma x (* x 0.008333333333333333) -0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = fma(0.16666666666666666, (y * y), 1.0) * (x * (-0.16666666666666666 * (x * x)));
} else {
tmp = fma(x, (x * (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * Float64(x * Float64(-0.16666666666666666 * Float64(x * x)))); else tmp = fma(x, Float64(x * Float64(x * fma(x, Float64(x * 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], -0.05], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \left(x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \left(x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right)\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
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6467.0
Applied rewrites67.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-*.f6428.8
Applied rewrites28.8%
Taylor expanded in x around inf
Applied rewrites15.2%
if -0.050000000000000003 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6463.5
Applied rewrites63.5%
Taylor expanded in x around 0
Applied rewrites45.8%
Taylor expanded in x around 0
Applied rewrites50.7%
Final simplification37.0%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) -0.05)
(* x (* x (* x -0.16666666666666666)))
(fma
x
(* x (* x (fma x (* x 0.008333333333333333) -0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = x * (x * (x * -0.16666666666666666));
} else {
tmp = fma(x, (x * (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(x * Float64(x * Float64(x * -0.16666666666666666))); else tmp = fma(x, Float64(x * Float64(x * fma(x, Float64(x * 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], -0.05], N[(x * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $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(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \left(x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right)\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.f6437.6
Applied rewrites37.6%
Taylor expanded in x around 0
Applied rewrites10.9%
Taylor expanded in x around inf
Applied rewrites10.6%
Applied rewrites10.6%
if -0.050000000000000003 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6463.5
Applied rewrites63.5%
Taylor expanded in x around 0
Applied rewrites45.8%
Taylor expanded in x around 0
Applied rewrites50.7%
Final simplification35.2%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 5e-17)
(*
(fma
(* y y)
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666)
1.0)
(fma x (* x (* x -0.16666666666666666)) x))
(*
(fma
(fma x (* x 0.008333333333333333) -0.16666666666666666)
(* x (* x x))
x)
(fma 0.16666666666666666 (* y y) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 5e-17) {
tmp = fma((y * y), fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), 1.0) * fma(x, (x * (x * -0.16666666666666666)), x);
} else {
tmp = fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), (x * (x * x)), x) * fma(0.16666666666666666, (y * y), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 5e-17) tmp = Float64(fma(Float64(y * y), fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), 1.0) * fma(x, Float64(x * Float64(x * -0.16666666666666666)), x)); else tmp = Float64(fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(0.16666666666666666, Float64(y * y), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 5e-17], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 5 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x, x \cdot \left(x \cdot -0.16666666666666666\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 4.9999999999999999e-17Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.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-*.f6468.0
Applied rewrites68.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.0
Applied rewrites68.0%
if 4.9999999999999999e-17 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6479.6
Applied rewrites79.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.3
Applied rewrites27.3%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 5e-17)
(*
(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
(fma x (* x 0.008333333333333333) -0.16666666666666666)
(* x (* x x))
x)
(fma 0.16666666666666666 (* y y) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 5e-17) {
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(fma(x, (x * 0.008333333333333333), -0.16666666666666666), (x * (x * x)), x) * fma(0.16666666666666666, (y * y), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 5e-17) 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 = Float64(fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(0.16666666666666666, Float64(y * y), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 5e-17], 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[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 5 \cdot 10^{-17}:\\
\;\;\;\;\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(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 4.9999999999999999e-17Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.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-*.f6468.0
Applied rewrites68.0%
if 4.9999999999999999e-17 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6479.6
Applied rewrites79.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.3
Applied rewrites27.3%
Final simplification57.6%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 5e-17)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma
y
(* y (* y (* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))))
1.0))
(*
(fma
(fma x (* x 0.008333333333333333) -0.16666666666666666)
(* x (* x x))
x)
(fma 0.16666666666666666 (* y y) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 5e-17) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * (y * (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)))), 1.0);
} else {
tmp = fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), (x * (x * x)), x) * fma(0.16666666666666666, (y * y), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 5e-17) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * Float64(y * Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)))), 1.0)); else tmp = Float64(fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(0.16666666666666666, Float64(y * y), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 5e-17], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 5 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot \left(y \cdot \left(y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right)\right)\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 4.9999999999999999e-17Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.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-*.f6468.0
Applied rewrites68.0%
Taylor expanded in y around inf
Applied rewrites48.5%
Taylor expanded in y around 0
Applied rewrites67.6%
if 4.9999999999999999e-17 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6479.6
Applied rewrites79.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.3
Applied rewrites27.3%
Final simplification57.4%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 5e-17)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* y (* y (* 0.0001984126984126984 (* y (* y y))))) 1.0))
(*
(fma
(fma x (* x 0.008333333333333333) -0.16666666666666666)
(* x (* x x))
x)
(fma 0.16666666666666666 (* y y) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 5e-17) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * (y * (0.0001984126984126984 * (y * (y * y))))), 1.0);
} else {
tmp = fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), (x * (x * x)), x) * fma(0.16666666666666666, (y * y), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 5e-17) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * Float64(y * Float64(0.0001984126984126984 * Float64(y * Float64(y * y))))), 1.0)); else tmp = Float64(fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(0.16666666666666666, Float64(y * y), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 5e-17], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(0.0001984126984126984 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 5 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot \left(y \cdot \left(0.0001984126984126984 \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 4.9999999999999999e-17Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.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-*.f6468.0
Applied rewrites68.0%
Taylor expanded in y around 0
Applied rewrites65.4%
Taylor expanded in y around inf
Applied rewrites67.6%
if 4.9999999999999999e-17 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6479.6
Applied rewrites79.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.3
Applied rewrites27.3%
Final simplification57.4%
(FPCore (x y)
:precision binary64
(if (<= y 0.185)
(*
(sin x)
(fma (* y y) (fma y (* y 0.008333333333333333) 0.16666666666666666) 1.0))
(if (<= y 9.8e+51)
(* (/ (sinh y) y) (fma -0.16666666666666666 (* x (* x x)) x))
(*
(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 <= 0.185) {
tmp = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
} else if (y <= 9.8e+51) {
tmp = (sinh(y) / y) * fma(-0.16666666666666666, (x * (x * x)), x);
} 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 <= 0.185) tmp = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); elseif (y <= 9.8e+51) tmp = Float64(Float64(sinh(y) / y) * fma(-0.16666666666666666, Float64(x * Float64(x * x)), x)); 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, 0.185], N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e+51], 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[(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 0.185:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+51}:\\
\;\;\;\;\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, 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 < 0.185Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6492.6
Applied rewrites92.6%
if 0.185 < y < 9.79999999999999967e51Initial 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-*.f6475.0
Applied rewrites75.0%
if 9.79999999999999967e51 < y Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
Final simplification93.2%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 5e-17)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0))
(*
(fma
(fma x (* x 0.008333333333333333) -0.16666666666666666)
(* x (* x x))
x)
(fma 0.16666666666666666 (* y y) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 5e-17) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0);
} else {
tmp = fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), (x * (x * x)), x) * fma(0.16666666666666666, (y * y), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 5e-17) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); else tmp = Float64(fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(0.16666666666666666, Float64(y * y), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 5e-17], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 5 \cdot 10^{-17}:\\
\;\;\;\;\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, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 4.9999999999999999e-17Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.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-*.f6468.0
Applied rewrites68.0%
Taylor expanded in y around 0
Applied rewrites65.4%
if 4.9999999999999999e-17 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6479.6
Applied rewrites79.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.3
Applied rewrites27.3%
Final simplification55.7%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 1e-8)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0))
(fma
x
(* x (* x (fma x (* x 0.008333333333333333) -0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-8) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0);
} else {
tmp = fma(x, (x * (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-8) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); else tmp = fma(x, Float64(x * Float64(x * fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666))), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-8], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-8}:\\
\;\;\;\;\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, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \left(x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right)\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1e-8Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.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-*.f6468.0
Applied rewrites68.0%
Taylor expanded in y around 0
Applied rewrites65.4%
if 1e-8 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6453.8
Applied rewrites53.8%
Taylor expanded in x around 0
Applied rewrites12.5%
Taylor expanded in x around 0
Applied rewrites24.5%
Final simplification55.0%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 1e-8)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma y (* 0.008333333333333333 (* y (* y y))) 1.0))
(fma
x
(* x (* x (fma x (* x 0.008333333333333333) -0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-8) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, (0.008333333333333333 * (y * (y * y))), 1.0);
} else {
tmp = fma(x, (x * (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-8) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(0.008333333333333333 * Float64(y * Float64(y * y))), 1.0)); else tmp = fma(x, Float64(x * Float64(x * fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666))), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-8], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(0.008333333333333333 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, 0.008333333333333333 \cdot \left(y \cdot \left(y \cdot y\right)\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \left(x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right)\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1e-8Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.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-*.f6468.0
Applied rewrites68.0%
Taylor expanded in y around inf
Applied rewrites48.5%
Taylor expanded in y around 0
Applied rewrites65.1%
if 1e-8 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6453.8
Applied rewrites53.8%
Taylor expanded in x around 0
Applied rewrites12.5%
Taylor expanded in x around 0
Applied rewrites24.5%
Final simplification54.8%
(FPCore (x y)
:precision binary64
(let* ((t_0
(*
(sin x)
(fma
(* y y)
(fma y (* y 0.008333333333333333) 0.16666666666666666)
1.0))))
(if (<= y 0.185)
t_0
(if (<= y 1.7e+75)
(* (/ (sinh y) y) (fma -0.16666666666666666 (* x (* x x)) x))
t_0))))
double code(double x, double y) {
double t_0 = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
double tmp;
if (y <= 0.185) {
tmp = t_0;
} else if (y <= 1.7e+75) {
tmp = (sinh(y) / y) * fma(-0.16666666666666666, (x * (x * x)), x);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)) tmp = 0.0 if (y <= 0.185) tmp = t_0; elseif (y <= 1.7e+75) tmp = Float64(Float64(sinh(y) / y) * fma(-0.16666666666666666, Float64(x * Float64(x * x)), x)); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$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]}, If[LessEqual[y, 0.185], t$95$0, If[LessEqual[y, 1.7e+75], N[(N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision] * N[(-0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;y \leq 0.185:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+75}:\\
\;\;\;\;\frac{\sinh y}{y} \cdot \mathsf{fma}\left(-0.16666666666666666, x \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 0.185 or 1.70000000000000006e75 < y Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6494.1
Applied rewrites94.1%
if 0.185 < y < 1.70000000000000006e75Initial 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-*.f6473.3
Applied rewrites73.3%
Final simplification92.9%
(FPCore (x y)
:precision binary64
(let* ((t_0
(*
(sin x)
(fma
(* y y)
(fma y (* y 0.008333333333333333) 0.16666666666666666)
1.0)))
(t_1 (* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))))
(if (<= y 1.35)
t_0
(if (<= y 1.7e+75)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma
y
(/
(* y (fma (* y y) (* t_1 t_1) -0.027777777777777776))
(fma y t_1 -0.16666666666666666))
1.0))
t_0))))
double code(double x, double y) {
double t_0 = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
double t_1 = y * fma((y * y), 0.0001984126984126984, 0.008333333333333333);
double tmp;
if (y <= 1.35) {
tmp = t_0;
} else if (y <= 1.7e+75) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(y, ((y * fma((y * y), (t_1 * t_1), -0.027777777777777776)) / fma(y, t_1, -0.16666666666666666)), 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)) t_1 = Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)) tmp = 0.0 if (y <= 1.35) tmp = t_0; elseif (y <= 1.7e+75) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(y, Float64(Float64(y * fma(Float64(y * y), Float64(t_1 * t_1), -0.027777777777777776)) / fma(y, t_1, -0.16666666666666666)), 1.0)); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$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]}, Block[{t$95$1 = N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.35], t$95$0, If[LessEqual[y, 1.7e+75], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(N[(y * N[(N[(y * y), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision] + -0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(y * t$95$1 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
t_1 := y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right)\\
\mathbf{if}\;y \leq 1.35:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, \frac{y \cdot \mathsf{fma}\left(y \cdot y, t\_1 \cdot t\_1, -0.027777777777777776\right)}{\mathsf{fma}\left(y, t\_1, -0.16666666666666666\right)}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 1.3500000000000001 or 1.70000000000000006e75 < y Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6494.1
Applied rewrites94.1%
if 1.3500000000000001 < y < 1.70000000000000006e75Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6428.3
Applied rewrites28.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-*.f6427.0
Applied rewrites27.0%
Applied rewrites33.4%
Final simplification90.5%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 1e-8)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma 0.16666666666666666 (* y y) 1.0))
(fma
x
(* x (* x (fma x (* x 0.008333333333333333) -0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-8) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma(0.16666666666666666, (y * y), 1.0);
} else {
tmp = fma(x, (x * (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-8) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(0.16666666666666666, Float64(y * y), 1.0)); else tmp = fma(x, Float64(x * Float64(x * fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666))), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-8], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \left(x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right)\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1e-8Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6475.6
Applied rewrites75.6%
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-*.f6455.2
Applied rewrites55.2%
if 1e-8 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6453.8
Applied rewrites53.8%
Taylor expanded in x around 0
Applied rewrites12.5%
Taylor expanded in x around 0
Applied rewrites24.5%
Final simplification47.4%
(FPCore (x y) :precision binary64 (if (<= (sin x) 1e-8) (fma x (* -0.16666666666666666 (* x x)) x) (* 0.008333333333333333 (* x (* x (* x (* x x)))))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-8) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x);
} else {
tmp = 0.008333333333333333 * (x * (x * (x * (x * x))));
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-8) tmp = fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x); else tmp = Float64(0.008333333333333333 * Float64(x * Float64(x * Float64(x * Float64(x * x))))); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-8], N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(0.008333333333333333 * N[(x * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;0.008333333333333333 \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1e-8Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6453.4
Applied rewrites53.4%
Taylor expanded in x around 0
Applied rewrites39.0%
if 1e-8 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6453.8
Applied rewrites53.8%
Taylor expanded in x around 0
Applied rewrites24.5%
Taylor expanded in x around inf
Applied rewrites24.5%
Final simplification35.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (fma 0.16666666666666666 (* y y) 1.0))))
(if (<= y 0.029)
t_0
(if (<= y 1.35e+154)
(*
(fma
(* y y)
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666)
1.0)
(fma
(fma
(* x x)
(fma (* x x) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666)
(* x (* x x))
x))
t_0))))
double code(double x, double y) {
double t_0 = sin(x) * fma(0.16666666666666666, (y * y), 1.0);
double tmp;
if (y <= 0.029) {
tmp = t_0;
} else if (y <= 1.35e+154) {
tmp = fma((y * y), fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), 1.0) * fma(fma((x * x), fma((x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), (x * (x * x)), x);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * fma(0.16666666666666666, Float64(y * y), 1.0)) tmp = 0.0 if (y <= 0.029) tmp = t_0; elseif (y <= 1.35e+154) tmp = Float64(fma(Float64(y * y), fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 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 = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.029], t$95$0, If[LessEqual[y, 1.35e+154], N[(N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * 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], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{if}\;y \leq 0.029:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right) \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}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 0.0290000000000000015 or 1.35000000000000003e154 < y Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.0
Applied rewrites89.0%
if 0.0290000000000000015 < y < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6471.7
Applied rewrites71.7%
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-*.f6455.4
Applied rewrites55.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6455.4
Applied rewrites55.4%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites55.5%
(FPCore (x y)
:precision binary64
(if (<= y 1.65e+146)
(fma
x
(* x (* x (fma x (* x 0.008333333333333333) -0.16666666666666666)))
x)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(* (* y y) 0.16666666666666666))))
double code(double x, double y) {
double tmp;
if (y <= 1.65e+146) {
tmp = fma(x, (x * (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666))), x);
} else {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * ((y * y) * 0.16666666666666666);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 1.65e+146) tmp = fma(x, Float64(x * Float64(x * fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666))), x); else tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * Float64(Float64(y * y) * 0.16666666666666666)); end return tmp end
code[x_, y_] := If[LessEqual[y, 1.65e+146], N[(x * N[(x * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot \left(x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right)\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\\
\end{array}
\end{array}
if y < 1.65000000000000008e146Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6460.2
Applied rewrites60.2%
Taylor expanded in x around 0
Applied rewrites34.5%
Taylor expanded in x around 0
Applied rewrites40.3%
if 1.65000000000000008e146 < y Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6487.5
Applied rewrites87.5%
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-*.f6473.8
Applied rewrites73.8%
Taylor expanded in y around inf
Applied rewrites73.8%
Final simplification44.2%
(FPCore (x y) :precision binary64 (fma x (* -0.16666666666666666 (* x x)) x))
double code(double x, double y) {
return fma(x, (-0.16666666666666666 * (x * x)), x);
}
function code(x, y) return fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) end
code[x_, y_] := N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6453.5
Applied rewrites53.5%
Taylor expanded in x around 0
Applied rewrites32.3%
Final simplification32.3%
(FPCore (x y) :precision binary64 (* x (* x (* x -0.16666666666666666))))
double code(double x, double y) {
return x * (x * (x * -0.16666666666666666));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (x * (x * (-0.16666666666666666d0)))
end function
public static double code(double x, double y) {
return x * (x * (x * -0.16666666666666666));
}
def code(x, y): return x * (x * (x * -0.16666666666666666))
function code(x, y) return Float64(x * Float64(x * Float64(x * -0.16666666666666666))) end
function tmp = code(x, y) tmp = x * (x * (x * -0.16666666666666666)); end
code[x_, y_] := N[(x * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6453.5
Applied rewrites53.5%
Taylor expanded in x around 0
Applied rewrites32.3%
Taylor expanded in x around inf
Applied rewrites8.6%
Applied rewrites8.6%
Final simplification8.6%
herbie shell --seed 2024221
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))