
(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 23 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 (* x (* x x))) (t_1 (/ (sinh y) y)) (t_2 (* (sin x) t_1)))
(if (<= t_2 (- INFINITY))
(*
(fma
(fma
x
(* x (fma (* x x) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
t_0
x)
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0))
(if (<= t_2 1e+46)
(*
(sin x)
(fma
y
(*
y
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666))
1.0))
(*
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 = sinh(y) / y;
double t_2 = sin(x) * t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(fma(x, (x * fma((x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_0, x) * fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0);
} else if (t_2 <= 1e+46) {
tmp = sin(x) * fma(y, (y * fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666)), 1.0);
} 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 = Float64(sinh(y) / y) t_2 = Float64(sin(x) * t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(fma(fma(x, Float64(x * fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_0, x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); elseif (t_2 <= 1e+46) tmp = Float64(sin(x) * fma(y, Float64(y * fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666)), 1.0)); else tmp = Float64(t_1 * fma(fma(x, Float64(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[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[x], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$0 + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+46], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -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 := \frac{\sinh y}{y}\\
t_2 := \sin x \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), t\_0, x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+46}:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), t\_0, 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
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6473.4
Applied rewrites73.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 rewrites54.4%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 9.9999999999999999e45Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.8%
if 9.9999999999999999e45 < (*.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-*.f6477.6
Applied rewrites77.6%
Final simplification82.0%
(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 0.008333333333333333) 0.16666666666666666))
1.0)))
(if (<= t_0 (- INFINITY))
(*
(fma
(fma
x
(* x (fma (* x x) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
t_1
x)
t_2)
(if (<= t_0 1e+46)
(* (sin x) t_2)
(*
(fma
y
(*
y
(fma y (* y (* (* y y) 0.0001984126984126984)) 0.16666666666666666))
1.0)
(fma (* x x) (* 0.008333333333333333 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 * 0.008333333333333333), 0.16666666666666666)), 1.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma(fma(x, (x * fma((x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_1, x) * t_2;
} else if (t_0 <= 1e+46) {
tmp = sin(x) * t_2;
} else {
tmp = fma(y, (y * fma(y, (y * ((y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma((x * x), (0.008333333333333333 * 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(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(fma(x, Float64(x * fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_1, x) * t_2); elseif (t_0 <= 1e+46) tmp = Float64(sin(x) * t_2); else tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * Float64(Float64(y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma(Float64(x * x), Float64(0.008333333333333333 * 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[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$0, 1e+46], N[(N[Sin[x], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * t$95$1), $MachinePrecision] + 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, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), t\_1, x\right) \cdot t\_2\\
\mathbf{elif}\;t\_0 \leq 10^{+46}:\\
\;\;\;\;\sin x \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x \cdot x, 0.008333333333333333 \cdot 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
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6473.4
Applied rewrites73.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 rewrites54.4%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 9.9999999999999999e45Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6498.7
Applied rewrites98.7%
if 9.9999999999999999e45 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) 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
Applied rewrites82.9%
Taylor expanded in y around inf
Applied rewrites82.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.5%
Taylor expanded in x around inf
Applied rewrites70.5%
Final simplification80.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (/ (sinh y) y))) (t_1 (* x (* x x))))
(if (<= t_0 (- INFINITY))
(*
(fma
(fma
x
(* x (fma (* x x) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
t_1
x)
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0))
(if (<= t_0 1e+46)
(* (sin x) (fma 0.16666666666666666 (* y y) 1.0))
(*
(fma
y
(*
y
(fma y (* y (* (* y y) 0.0001984126984126984)) 0.16666666666666666))
1.0)
(fma (* x x) (* 0.008333333333333333 t_1) x))))))
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(fma(x, (x * fma((x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_1, x) * fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0);
} else if (t_0 <= 1e+46) {
tmp = sin(x) * fma(0.16666666666666666, (y * y), 1.0);
} else {
tmp = fma(y, (y * fma(y, (y * ((y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma((x * x), (0.008333333333333333 * 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)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(fma(x, Float64(x * fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_1, x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); elseif (t_0 <= 1e+46) tmp = Float64(sin(x) * fma(0.16666666666666666, Float64(y * y), 1.0)); else tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * Float64(Float64(y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma(Float64(x * x), Float64(0.008333333333333333 * 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]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+46], N[(N[Sin[x], $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * t$95$1), $MachinePrecision] + 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)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), t\_1, x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+46}:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x \cdot x, 0.008333333333333333 \cdot 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
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6473.4
Applied rewrites73.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 rewrites54.4%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 9.9999999999999999e45Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6498.6
Applied rewrites98.6%
if 9.9999999999999999e45 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) 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
Applied rewrites82.9%
Taylor expanded in y around inf
Applied rewrites82.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.5%
Taylor expanded in x around inf
Applied rewrites70.5%
Final simplification80.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (/ (sinh y) y))) (t_1 (* x (* x x))))
(if (<= t_0 (- INFINITY))
(*
(fma
(fma
x
(* x (fma (* x x) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
t_1
x)
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0))
(if (<= t_0 1e+46)
(sin x)
(*
(fma
y
(*
y
(fma y (* y (* (* y y) 0.0001984126984126984)) 0.16666666666666666))
1.0)
(fma (* x x) (* 0.008333333333333333 t_1) x))))))
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(fma(x, (x * fma((x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_1, x) * fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0);
} else if (t_0 <= 1e+46) {
tmp = sin(x);
} else {
tmp = fma(y, (y * fma(y, (y * ((y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma((x * x), (0.008333333333333333 * 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)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(fma(x, Float64(x * fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_1, x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); elseif (t_0 <= 1e+46) tmp = sin(x); else tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * Float64(Float64(y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma(Float64(x * x), Float64(0.008333333333333333 * 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]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+46], N[Sin[x], $MachinePrecision], N[(N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * t$95$1), $MachinePrecision] + 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)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), t\_1, x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+46}:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x \cdot x, 0.008333333333333333 \cdot 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
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6473.4
Applied rewrites73.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 rewrites54.4%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 9.9999999999999999e45Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6498.3
Applied rewrites98.3%
if 9.9999999999999999e45 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) 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
Applied rewrites82.9%
Taylor expanded in y around inf
Applied rewrites82.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.5%
Taylor expanded in x around inf
Applied rewrites70.5%
Final simplification79.9%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) 2e-125)
(*
(fma
(fma
x
(* x (fma (* x x) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
(* x (* 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)
(fma
y
(* y (fma y (* y (* y (* y 0.0001984126984126984))) 0.16666666666666666))
1.0))))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= 2e-125) {
tmp = fma(fma(x, (x * fma((x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), (x * (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) * fma(y, (y * fma(y, (y * (y * (y * 0.0001984126984126984))), 0.16666666666666666)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= 2e-125) tmp = Float64(fma(fma(x, Float64(x * fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); else tmp = Float64(fma(Float64(x * x), Float64(x * fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666)), x) * fma(y, Float64(y * fma(y, Float64(y * Float64(y * Float64(y * 0.0001984126984126984))), 0.16666666666666666)), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 2e-125], N[(N[(N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * 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 * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 2 \cdot 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), x \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 \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \left(y \cdot \left(y \cdot 0.0001984126984126984\right)\right), 0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 2.00000000000000002e-125Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6488.1
Applied rewrites88.1%
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 rewrites59.7%
if 2.00000000000000002e-125 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) 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
Applied rewrites88.3%
Taylor expanded in y around inf
Applied rewrites88.2%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites57.0%
Applied rewrites57.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= (* (sin x) (/ (sinh y) y)) 0.0004)
(*
(fma
(fma
x
(* x (fma (* x x) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
t_0
x)
(fma 0.16666666666666666 (* y y) 1.0))
(*
(fma
y
(*
y
(fma y (* y (* (* y y) 0.0001984126984126984)) 0.16666666666666666))
1.0)
(fma (* x x) (* 0.008333333333333333 t_0) x)))))
double code(double x, double y) {
double t_0 = x * (x * x);
double tmp;
if ((sin(x) * (sinh(y) / y)) <= 0.0004) {
tmp = fma(fma(x, (x * fma((x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_0, x) * fma(0.16666666666666666, (y * y), 1.0);
} else {
tmp = fma(y, (y * fma(y, (y * ((y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma((x * x), (0.008333333333333333 * 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.0004) tmp = Float64(fma(fma(x, Float64(x * fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_0, x) * fma(0.16666666666666666, Float64(y * y), 1.0)); else tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * Float64(Float64(y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma(Float64(x * x), Float64(0.008333333333333333 * 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.0004], N[(N[(N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$0 + x), $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * t$95$0), $MachinePrecision] + 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.0004:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), t\_0, x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x \cdot x, 0.008333333333333333 \cdot t\_0, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 4.00000000000000019e-4Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6480.7
Applied rewrites80.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
Applied rewrites57.7%
if 4.00000000000000019e-4 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) 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
Applied rewrites86.9%
Taylor expanded in y around inf
Applied rewrites86.8%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites51.8%
Taylor expanded in x around inf
Applied rewrites51.8%
Final simplification55.6%
(FPCore (x y)
:precision binary64
(if (<= (* (sin x) (/ (sinh y) y)) -0.02)
(* 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.02) {
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.02) tmp = Float64(x * Float64(x * Float64(x * -0.16666666666666666))); else tmp = fma(Float64(x * 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.02], N[(x * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.02:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.0200000000000000004Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6434.5
Applied rewrites34.5%
Taylor expanded in x around 0
Applied rewrites8.2%
Taylor expanded in x around inf
Applied rewrites7.7%
Applied rewrites7.7%
if -0.0200000000000000004 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6457.9
Applied rewrites57.9%
Taylor expanded in x around 0
Applied rewrites48.5%
Taylor expanded in x around 0
Applied rewrites46.9%
Final simplification31.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= (sin x) -0.02)
(*
(fma
(fma
x
(* x (fma (* x x) -0.0001984126984126984 0.008333333333333333))
-0.16666666666666666)
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) <= -0.02) {
tmp = fma(fma(x, (x * fma((x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), 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 (sin(x) <= -0.02) tmp = Float64(fma(fma(x, Float64(x * fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666), t_0, x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); else tmp = Float64(fma(y, Float64(y * fma(y, Float64(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[Sin[x], $MachinePrecision], -0.02], N[(N[(N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$0 + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $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 \leq -0.02:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), t\_0, 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(y, y \cdot \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, 0.008333333333333333, -0.16666666666666666\right), t\_0, x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.0200000000000000004Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6486.7
Applied rewrites86.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
Applied rewrites18.7%
if -0.0200000000000000004 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites89.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
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.9
Applied rewrites72.9%
Final simplification59.3%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.02)
(*
(fma 0.16666666666666666 (* y y) 1.0)
(fma (* x (* x (* (* x x) -0.0001984126984126984))) (* x (* x x)) x))
(*
(fma
(* x x)
(* x (fma x (* x 0.008333333333333333) -0.16666666666666666))
x)
(fma
y
(* y (fma y (* y (* y (* y 0.0001984126984126984))) 0.16666666666666666))
1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.02) {
tmp = fma(0.16666666666666666, (y * y), 1.0) * fma((x * (x * ((x * x) * -0.0001984126984126984))), (x * (x * x)), x);
} else {
tmp = fma((x * x), (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666)), x) * fma(y, (y * fma(y, (y * (y * (y * 0.0001984126984126984))), 0.16666666666666666)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.02) tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * fma(Float64(x * Float64(x * Float64(Float64(x * x) * -0.0001984126984126984))), Float64(x * Float64(x * x)), x)); else tmp = Float64(fma(Float64(x * x), Float64(x * fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666)), x) * fma(y, Float64(y * fma(y, Float64(y * Float64(y * Float64(y * 0.0001984126984126984))), 0.16666666666666666)), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.02], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.02:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \mathsf{fma}\left(x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot -0.0001984126984126984\right)\right), x \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \left(y \cdot \left(y \cdot 0.0001984126984126984\right)\right), 0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.0200000000000000004Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.7
Applied rewrites77.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
Applied rewrites18.7%
Taylor expanded in x around inf
Applied rewrites18.5%
if -0.0200000000000000004 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites89.7%
Taylor expanded in y around inf
Applied rewrites89.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites72.9%
Applied rewrites72.9%
Final simplification59.3%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 6e-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 y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0)
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x (* x x))
x))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 6e-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(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * (x * x)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 6e-17) tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666)), 1.0) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * Float64(x * x)), x)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 6e-17], N[(N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 6 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \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, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 6.00000000000000012e-17Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites91.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-*.f6468.4
Applied rewrites68.4%
if 6.00000000000000012e-17 < (sin.f64 x) 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6483.1
Applied rewrites83.1%
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
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6424.6
Applied rewrites24.6%
Final simplification59.0%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 0.04)
(*
(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 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) <= 0.04) {
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(0.16666666666666666, (y * y), 1.0) * fma((x * x), (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 0.04) tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666)), 1.0) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * fma(Float64(x * 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], 0.04], N[(N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 0.04:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \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, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.0400000000000000008Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites91.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-*.f6468.5
Applied rewrites68.5%
if 0.0400000000000000008 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
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 rewrites29.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites18.8%
Final simplification58.6%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 0.04)
(*
(fma
y
(* y (fma y (* y (* (* y y) 0.0001984126984126984)) 0.16666666666666666))
1.0)
(fma x (* (* x x) -0.16666666666666666) 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) <= 0.04) {
tmp = fma(y, (y * fma(y, (y * ((y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma(x, ((x * x) * -0.16666666666666666), x);
} else {
tmp = fma(0.16666666666666666, (y * y), 1.0) * fma((x * x), (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 0.04) tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * Float64(Float64(y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * fma(Float64(x * 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], 0.04], N[(N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 0.04:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.0400000000000000008Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites91.1%
Taylor expanded in y around inf
Applied rewrites91.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-*.f6468.5
Applied rewrites68.5%
if 0.0400000000000000008 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
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 rewrites29.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites18.8%
Final simplification58.6%
(FPCore (x y)
:precision binary64
(if (<= y 112.0)
(*
(sin x)
(fma
y
(*
y
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666))
1.0))
(if (<= y 1e+52)
(* (/ (sinh y) y) (fma -0.16666666666666666 (* x (* x x)) x))
(*
(sin x)
(fma
y
(*
y
(fma y (* y (* (* y y) 0.0001984126984126984)) 0.16666666666666666))
1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 112.0) {
tmp = sin(x) * fma(y, (y * fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666)), 1.0);
} else if (y <= 1e+52) {
tmp = (sinh(y) / y) * fma(-0.16666666666666666, (x * (x * x)), x);
} else {
tmp = sin(x) * fma(y, (y * fma(y, (y * ((y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 112.0) tmp = Float64(sin(x) * fma(y, Float64(y * fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666)), 1.0)); elseif (y <= 1e+52) 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(y, Float64(y * Float64(Float64(y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[y, 112.0], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+52], 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[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 112:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;y \leq 10^{+52}:\\
\;\;\;\;\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, y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right), 0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if y < 112Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites91.8%
if 112 < y < 9.9999999999999999e51Initial 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.9999999999999999e51 < 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
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites100.0%
Final simplification93.0%
(FPCore (x y)
:precision binary64
(if (<= y 112.0)
(*
(sin x)
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0))
(if (<= y 1e+52)
(* (/ (sinh y) y) (fma -0.16666666666666666 (* x (* x x)) x))
(*
(sin x)
(fma
y
(*
y
(fma y (* y (* (* y y) 0.0001984126984126984)) 0.16666666666666666))
1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 112.0) {
tmp = sin(x) * fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0);
} else if (y <= 1e+52) {
tmp = (sinh(y) / y) * fma(-0.16666666666666666, (x * (x * x)), x);
} else {
tmp = sin(x) * fma(y, (y * fma(y, (y * ((y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 112.0) tmp = Float64(sin(x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); elseif (y <= 1e+52) 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(y, Float64(y * Float64(Float64(y * y) * 0.0001984126984126984)), 0.16666666666666666)), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[y, 112.0], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+52], 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[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 112:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;y \leq 10^{+52}:\\
\;\;\;\;\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, y \cdot \left(\left(y \cdot y\right) \cdot 0.0001984126984126984\right), 0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if y < 112Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
if 112 < y < 9.9999999999999999e51Initial 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.9999999999999999e51 < 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
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites100.0%
Final simplification91.4%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 0.04)
(*
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0)
(fma x (* (* x x) -0.16666666666666666) 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) <= 0.04) {
tmp = fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(x, ((x * x) * -0.16666666666666666), x);
} else {
tmp = fma(0.16666666666666666, (y * y), 1.0) * fma((x * x), (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 0.04) tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * fma(Float64(x * 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], 0.04], N[(N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 0.04:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.0400000000000000008Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6484.6
Applied rewrites84.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-*.f6462.9
Applied rewrites62.9%
if 0.0400000000000000008 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
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 rewrites29.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites18.8%
Final simplification54.1%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 0.04)
(*
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0)
(fma x (* (* x x) -0.16666666666666666) x))
(*
(fma (* x x) (* 0.008333333333333333 (* x (* x x))) x)
(fma 0.16666666666666666 (* y y) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 0.04) {
tmp = fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(x, ((x * x) * -0.16666666666666666), x);
} else {
tmp = fma((x * x), (0.008333333333333333 * (x * (x * x))), x) * fma(0.16666666666666666, (y * y), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 0.04) tmp = Float64(fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(fma(Float64(x * x), Float64(0.008333333333333333 * 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], 0.04], N[(N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * N[(x * N[(x * x), $MachinePrecision]), $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 0.04:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, 0.008333333333333333 \cdot \left(x \cdot \left(x \cdot x\right)\right), x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.0400000000000000008Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6484.6
Applied rewrites84.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-*.f6462.9
Applied rewrites62.9%
if 0.0400000000000000008 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
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 rewrites29.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites18.8%
Taylor expanded in x around inf
Applied rewrites18.8%
Final simplification54.1%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 0.04)
(*
(fma x (* (* x x) -0.16666666666666666) x)
(fma y (* y (* y (* y 0.008333333333333333))) 1.0))
(*
(fma (* x x) (* 0.008333333333333333 (* x (* x x))) x)
(fma 0.16666666666666666 (* y y) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 0.04) {
tmp = fma(x, ((x * x) * -0.16666666666666666), x) * fma(y, (y * (y * (y * 0.008333333333333333))), 1.0);
} else {
tmp = fma((x * x), (0.008333333333333333 * (x * (x * x))), x) * fma(0.16666666666666666, (y * y), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 0.04) tmp = Float64(fma(x, Float64(Float64(x * x) * -0.16666666666666666), x) * fma(y, Float64(y * Float64(y * Float64(y * 0.008333333333333333))), 1.0)); else tmp = Float64(fma(Float64(x * x), Float64(0.008333333333333333 * 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], 0.04], N[(N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * N[(x * N[(x * x), $MachinePrecision]), $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 0.04:\\
\;\;\;\;\mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right) \cdot \mathsf{fma}\left(y, y \cdot \left(y \cdot \left(y \cdot 0.008333333333333333\right)\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, 0.008333333333333333 \cdot \left(x \cdot \left(x \cdot x\right)\right), x\right) \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.0400000000000000008Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6484.6
Applied rewrites84.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-*.f6462.9
Applied rewrites62.9%
Taylor expanded in y around inf
Applied rewrites62.6%
if 0.0400000000000000008 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
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 rewrites29.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites18.8%
Taylor expanded in x around inf
Applied rewrites18.8%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 0.04)
(*
(fma x (* (* x x) -0.16666666666666666) x)
(fma y (* y (* y (* y 0.008333333333333333))) 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) <= 0.04) {
tmp = fma(x, ((x * x) * -0.16666666666666666), x) * fma(y, (y * (y * (y * 0.008333333333333333))), 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) <= 0.04) tmp = Float64(fma(x, Float64(Float64(x * x) * -0.16666666666666666), x) * fma(y, Float64(y * Float64(y * Float64(y * 0.008333333333333333))), 1.0)); else tmp = fma(Float64(x * 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], 0.04], N[(N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 0.04:\\
\;\;\;\;\mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right) \cdot \mathsf{fma}\left(y, y \cdot \left(y \cdot \left(y \cdot 0.008333333333333333\right)\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.0400000000000000008Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6484.6
Applied rewrites84.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-*.f6462.9
Applied rewrites62.9%
Taylor expanded in y around inf
Applied rewrites62.6%
if 0.0400000000000000008 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6449.1
Applied rewrites49.1%
Taylor expanded in x around 0
Applied rewrites20.0%
Taylor expanded in x around 0
Applied rewrites15.0%
(FPCore (x y)
:precision binary64
(if (<= y 112.0)
(*
(sin x)
(fma y (* y (fma y (* y 0.008333333333333333) 0.16666666666666666)) 1.0))
(if (<= y 3.8e+77)
(* (/ (sinh y) y) (fma -0.16666666666666666 (* x (* x x)) x))
(* (sin x) (* y (* y (* 0.008333333333333333 (* y y))))))))
double code(double x, double y) {
double tmp;
if (y <= 112.0) {
tmp = sin(x) * fma(y, (y * fma(y, (y * 0.008333333333333333), 0.16666666666666666)), 1.0);
} else if (y <= 3.8e+77) {
tmp = (sinh(y) / y) * fma(-0.16666666666666666, (x * (x * x)), x);
} else {
tmp = sin(x) * (y * (y * (0.008333333333333333 * (y * y))));
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 112.0) tmp = Float64(sin(x) * fma(y, Float64(y * fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666)), 1.0)); elseif (y <= 3.8e+77) tmp = Float64(Float64(sinh(y) / y) * fma(-0.16666666666666666, Float64(x * Float64(x * x)), x)); else tmp = Float64(sin(x) * Float64(y * Float64(y * Float64(0.008333333333333333 * Float64(y * y))))); end return tmp end
code[x_, y_] := If[LessEqual[y, 112.0], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+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[(y * N[(y * N[(0.008333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 112:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;y \leq 3.8 \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 \left(y \cdot \left(y \cdot \left(0.008333333333333333 \cdot \left(y \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if y < 112Initial 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
if 112 < y < 3.8000000000000001e77Initial 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-*.f6481.8
Applied rewrites81.8%
if 3.8000000000000001e77 < 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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites100.0%
Final simplification91.0%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 0.04)
(*
(fma 0.16666666666666666 (* y y) 1.0)
(fma x (* (* x x) -0.16666666666666666) x))
(fma
(* x x)
(* x (fma x (* x 0.008333333333333333) -0.16666666666666666))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 0.04) {
tmp = fma(0.16666666666666666, (y * y), 1.0) * fma(x, ((x * x) * -0.16666666666666666), 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 (sin(x) <= 0.04) tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = fma(Float64(x * 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], 0.04], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 0.04:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.0400000000000000008Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6473.8
Applied rewrites73.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-*.f6454.9
Applied rewrites54.9%
if 0.0400000000000000008 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6449.1
Applied rewrites49.1%
Taylor expanded in x around 0
Applied rewrites20.0%
Taylor expanded in x around 0
Applied rewrites15.0%
Final simplification46.9%
(FPCore (x y) :precision binary64 (fma x (* (* x x) -0.16666666666666666) x))
double code(double x, double y) {
return fma(x, ((x * x) * -0.16666666666666666), x);
}
function code(x, y) return fma(x, Float64(Float64(x * x) * -0.16666666666666666), x) end
code[x_, y_] := N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6449.0
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites33.1%
(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.f6449.0
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites33.1%
Taylor expanded in x around inf
Applied rewrites8.4%
Applied rewrites8.4%
Final simplification8.4%
herbie shell --seed 2024233
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))