
(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 0.008333333333333333 (* x x) -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(0.008333333333333333, (x * x), -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(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), 1.0)); else tmp = Float64(t_0 * fma(fma(0.008333333333333333, Float64(x * x), -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[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(0.008333333333333333 * N[(x * x), $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, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, x \cdot x, -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
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6474.0
Simplified74.0%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6420.5
Simplified20.5%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 100.0%
Taylor expanded in y around 0
Simplified99.3%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.1
Simplified72.1%
Final simplification70.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (/ (sinh y) y)))
(t_1
(fma
y
(*
y
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
1.0)))
(if (<= t_0 (- INFINITY))
(*
t_1
(fma
(* x x)
(*
x
(fma
(* x x)
(fma x (* x -0.0001984126984126984) 0.008333333333333333)
-0.16666666666666666))
x))
(if (<= t_0 1.0)
(* (sin x) (fma y (* y 0.16666666666666666) 1.0))
(*
t_1
(fma
(* x x)
(* x (fma x (* x 0.008333333333333333) -0.16666666666666666))
x))))))
double code(double x, double y) {
double t_0 = sin(x) * (sinh(y) / y);
double t_1 = fma(y, (y * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), 1.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1 * fma((x * x), (x * fma((x * x), fma(x, (x * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666)), x);
} else if (t_0 <= 1.0) {
tmp = sin(x) * fma(y, (y * 0.16666666666666666), 1.0);
} else {
tmp = t_1 * fma((x * x), (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * Float64(sinh(y) / y)) t_1 = fma(y, Float64(y * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), 1.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(t_1 * fma(Float64(x * x), Float64(x * fma(Float64(x * x), fma(x, Float64(x * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666)), x)); elseif (t_0 <= 1.0) tmp = Float64(sin(x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); else tmp = Float64(t_1 * fma(Float64(x * x), Float64(x * fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666)), 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[(y * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(t$95$1 * N[(N[(x * x), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * -0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 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}
t_0 := \sin x \cdot \frac{\sinh y}{y}\\
t_1 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), x\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \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 (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
Simplified85.5%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Simplified62.1%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 100.0%
Taylor expanded in y around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-sin.f6499.3
Simplified99.3%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified74.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6453.3
Simplified53.3%
Final simplification77.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (/ (sinh y) y)))
(t_1
(fma
y
(*
y
(fma
y
(* y (fma y (* y 0.0001984126984126984) 0.008333333333333333))
0.16666666666666666))
1.0)))
(if (<= t_0 (- INFINITY))
(*
t_1
(fma
(* x x)
(*
x
(fma
(* x x)
(fma x (* x -0.0001984126984126984) 0.008333333333333333)
-0.16666666666666666))
x))
(if (<= t_0 1.0)
(sin x)
(*
t_1
(fma
(* x x)
(* x (fma x (* x 0.008333333333333333) -0.16666666666666666))
x))))))
double code(double x, double y) {
double t_0 = sin(x) * (sinh(y) / y);
double t_1 = fma(y, (y * fma(y, (y * fma(y, (y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), 1.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1 * fma((x * x), (x * fma((x * x), fma(x, (x * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666)), x);
} else if (t_0 <= 1.0) {
tmp = sin(x);
} else {
tmp = t_1 * fma((x * x), (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * Float64(sinh(y) / y)) t_1 = fma(y, Float64(y * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), 1.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(t_1 * fma(Float64(x * x), Float64(x * fma(Float64(x * x), fma(x, Float64(x * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666)), x)); elseif (t_0 <= 1.0) tmp = sin(x); else tmp = Float64(t_1 * fma(Float64(x * x), Float64(x * fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666)), 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[(y * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(t$95$1 * N[(N[(x * x), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * -0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[x], $MachinePrecision], N[(t$95$1 * 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}
t_0 := \sin x \cdot \frac{\sinh y}{y}\\
t_1 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(x \cdot x, x \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), x\right)\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;t\_1 \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 (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
Simplified85.5%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Simplified62.1%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6499.2
Simplified99.2%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
Simplified74.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6453.3
Simplified53.3%
Final simplification77.7%
(FPCore (x y) :precision binary64 (if (<= (* (sin x) (/ (sinh y) y)) -0.01) (* x (* -0.16666666666666666 (* x x))) (fma x (* y (* y 0.16666666666666666)) x)))
double code(double x, double y) {
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.01) {
tmp = x * (-0.16666666666666666 * (x * x));
} else {
tmp = fma(x, (y * (y * 0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.01) tmp = Float64(x * Float64(-0.16666666666666666 * Float64(x * x))); else tmp = fma(x, Float64(y * Float64(y * 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.01], N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.01:\\
\;\;\;\;x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot \left(y \cdot 0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.0100000000000000002Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6433.4
Simplified33.4%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Simplified11.3%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.0
Simplified11.0%
if -0.0100000000000000002 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in y around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-sin.f6479.9
Simplified79.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Simplified56.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.2
Simplified55.2%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 1e-64)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(/
(fma
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666)
(* y (* y y))
y)
y))
(fma
x
(*
(* y y)
(fma 0.0001984126984126984 (* (* y y) (* y y)) 0.16666666666666666))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-64) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * (fma(fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), (y * (y * y)), y) / y);
} else {
tmp = fma(x, ((y * y) * fma(0.0001984126984126984, ((y * y) * (y * y)), 0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-64) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * Float64(fma(fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), Float64(y * Float64(y * y)), y) / y)); else tmp = fma(x, Float64(Float64(y * y) * fma(0.0001984126984126984, Float64(Float64(y * y) * Float64(y * y)), 0.16666666666666666)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-64], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * y), $MachinePrecision] * N[(0.0001984126984126984 * N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-64}:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(y \cdot y\right) \cdot \mathsf{fma}\left(0.0001984126984126984, \left(y \cdot y\right) \cdot \left(y \cdot y\right), 0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 9.99999999999999965e-65Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.7
Simplified70.7%
Taylor expanded in y around 0
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
lower-fma.f64N/A
Simplified62.1%
if 9.99999999999999965e-65 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
Simplified91.2%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6491.2
Simplified91.2%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.3
Simplified32.3%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 2e-276)
(*
x
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma
(* y y)
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666)
1.0)))
(fma
x
(*
(* y y)
(fma 0.0001984126984126984 (* (* y y) (* y y)) 0.16666666666666666))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 2e-276) {
tmp = x * (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), 1.0));
} else {
tmp = fma(x, ((y * y) * fma(0.0001984126984126984, ((y * y) * (y * y)), 0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 2e-276) tmp = Float64(x * Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), 1.0))); else tmp = fma(x, Float64(Float64(y * y) * fma(0.0001984126984126984, Float64(Float64(y * y) * Float64(y * y)), 0.16666666666666666)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 2e-276], N[(x * N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * y), $MachinePrecision] * N[(0.0001984126984126984 * N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 2 \cdot 10^{-276}:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(y \cdot y\right) \cdot \mathsf{fma}\left(0.0001984126984126984, \left(y \cdot y\right) \cdot \left(y \cdot y\right), 0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 2e-276Initial program 100.0%
Taylor expanded in y around 0
Simplified91.9%
Taylor expanded in x around 0
lower-*.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
Simplified56.5%
if 2e-276 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
Simplified86.6%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6486.6
Simplified86.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.9
Simplified47.9%
(FPCore (x y)
:precision binary64
(let* ((t_0
(*
y
(*
y
(fma
(* y y)
(fma 0.0001984126984126984 (* y y) 0.008333333333333333)
0.16666666666666666)))))
(if (<= (sin x) -0.01)
(* (* x (* x x)) (fma -0.16666666666666666 t_0 -0.16666666666666666))
(fma x t_0 x))))
double code(double x, double y) {
double t_0 = y * (y * fma((y * y), fma(0.0001984126984126984, (y * y), 0.008333333333333333), 0.16666666666666666));
double tmp;
if (sin(x) <= -0.01) {
tmp = (x * (x * x)) * fma(-0.16666666666666666, t_0, -0.16666666666666666);
} else {
tmp = fma(x, t_0, x);
}
return tmp;
}
function code(x, y) t_0 = Float64(y * Float64(y * fma(Float64(y * y), fma(0.0001984126984126984, Float64(y * y), 0.008333333333333333), 0.16666666666666666))) tmp = 0.0 if (sin(x) <= -0.01) tmp = Float64(Float64(x * Float64(x * x)) * fma(-0.16666666666666666, t_0, -0.16666666666666666)); else tmp = fma(x, t_0, x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(0.0001984126984126984 * N[(y * y), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[x], $MachinePrecision], -0.01], N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 * t$95$0 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(x * t$95$0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(0.0001984126984126984, y \cdot y, 0.008333333333333333\right), 0.16666666666666666\right)\right)\\
\mathbf{if}\;\sin x \leq -0.01:\\
\;\;\;\;\left(x \cdot \left(x \cdot x\right)\right) \cdot \mathsf{fma}\left(-0.16666666666666666, t\_0, -0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, t\_0, x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.0100000000000000002Initial program 100.0%
Taylor expanded in y around 0
Simplified94.6%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6421.7
Simplified21.7%
Taylor expanded in x around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
lower-fma.f64N/A
Simplified21.7%
if -0.0100000000000000002 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
Simplified87.7%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.4
Simplified65.4%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified64.1%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.01)
(*
(fma x (* -0.16666666666666666 (* x x)) x)
(fma (* y y) (fma y (* y 0.008333333333333333) 0.16666666666666666) 1.0))
(fma
x
(*
y
(*
y
(fma
(* y y)
(fma 0.0001984126984126984 (* y y) 0.008333333333333333)
0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.01) {
tmp = fma(x, (-0.16666666666666666 * (x * x)), x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
} else {
tmp = fma(x, (y * (y * fma((y * y), fma(0.0001984126984126984, (y * y), 0.008333333333333333), 0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.01) tmp = Float64(fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); else tmp = fma(x, Float64(y * Float64(y * fma(Float64(y * y), fma(0.0001984126984126984, Float64(y * y), 0.008333333333333333), 0.16666666666666666))), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.01], N[(N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(0.0001984126984126984 * N[(y * y), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.01:\\
\;\;\;\;\mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot \left(y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(0.0001984126984126984, y \cdot y, 0.008333333333333333\right), 0.16666666666666666\right)\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.0100000000000000002Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified89.3%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6421.7
Simplified21.7%
if -0.0100000000000000002 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
Simplified87.7%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.4
Simplified65.4%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified64.1%
(FPCore (x y)
:precision binary64
(if (<= y 12.2)
(*
(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 x (* -0.16666666666666666 (* x x)) x))
(*
(sin x)
(fma y (* y (* 0.0001984126984126984 (* (* y y) (* y y)))) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 12.2) {
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(x, (-0.16666666666666666 * (x * x)), x);
} else {
tmp = sin(x) * fma(y, (y * (0.0001984126984126984 * ((y * y) * (y * y)))), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 12.2) tmp = Float64(sin(x) * fma(y, Float64(y * fma(y, Float64(y * fma(y, Float64(y * 0.0001984126984126984), 0.008333333333333333)), 0.16666666666666666)), 1.0)); elseif (y <= 1e+52) tmp = Float64(Float64(sinh(y) / y) * fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x)); else tmp = Float64(sin(x) * fma(y, Float64(y * Float64(0.0001984126984126984 * Float64(Float64(y * y) * Float64(y * y)))), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[y, 12.2], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(y * N[(y * 0.0001984126984126984), $MachinePrecision] + 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[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(0.0001984126984126984 * N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 12.2:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;y \leq 10^{+52}:\\
\;\;\;\;\frac{\sinh y}{y} \cdot \mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \left(0.0001984126984126984 \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)\right), 1\right)\\
\end{array}
\end{array}
if y < 12.199999999999999Initial program 100.0%
Taylor expanded in y around 0
Simplified94.9%
if 12.199999999999999 < y < 9.9999999999999999e51Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6488.9
Simplified88.9%
if 9.9999999999999999e51 < y Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Taylor expanded in y around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Final simplification95.5%
(FPCore (x y)
:precision binary64
(if (<= y 12.2)
(*
(sin x)
(fma
y
(* y (fma y (* y (* 0.0001984126984126984 (* y y))) 0.16666666666666666))
1.0))
(if (<= y 1e+52)
(* (/ (sinh y) y) (fma x (* -0.16666666666666666 (* x x)) x))
(*
(sin x)
(fma y (* y (* 0.0001984126984126984 (* (* y y) (* y y)))) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 12.2) {
tmp = sin(x) * fma(y, (y * fma(y, (y * (0.0001984126984126984 * (y * y))), 0.16666666666666666)), 1.0);
} else if (y <= 1e+52) {
tmp = (sinh(y) / y) * fma(x, (-0.16666666666666666 * (x * x)), x);
} else {
tmp = sin(x) * fma(y, (y * (0.0001984126984126984 * ((y * y) * (y * y)))), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 12.2) tmp = Float64(sin(x) * fma(y, Float64(y * fma(y, Float64(y * Float64(0.0001984126984126984 * Float64(y * y))), 0.16666666666666666)), 1.0)); elseif (y <= 1e+52) tmp = Float64(Float64(sinh(y) / y) * fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x)); else tmp = Float64(sin(x) * fma(y, Float64(y * Float64(0.0001984126984126984 * Float64(Float64(y * y) * Float64(y * y)))), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[y, 12.2], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * N[(0.0001984126984126984 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+52], N[(N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision] * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(0.0001984126984126984 * N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 12.2:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y, y \cdot \left(0.0001984126984126984 \cdot \left(y \cdot y\right)\right), 0.16666666666666666\right), 1\right)\\
\mathbf{elif}\;y \leq 10^{+52}:\\
\;\;\;\;\frac{\sinh y}{y} \cdot \mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \left(0.0001984126984126984 \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)\right), 1\right)\\
\end{array}
\end{array}
if y < 12.199999999999999Initial program 100.0%
Taylor expanded in y around 0
Simplified94.9%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6494.9
Simplified94.9%
if 12.199999999999999 < y < 9.9999999999999999e51Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6488.9
Simplified88.9%
if 9.9999999999999999e51 < y Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Taylor expanded in y around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Final simplification95.5%
(FPCore (x y)
:precision binary64
(if (<= y 12.2)
(*
(sin x)
(fma (* y y) (fma y (* y 0.008333333333333333) 0.16666666666666666) 1.0))
(if (<= y 1e+52)
(* (/ (sinh y) y) (fma x (* -0.16666666666666666 (* x x)) x))
(*
(sin x)
(fma y (* y (* 0.0001984126984126984 (* (* y y) (* y y)))) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 12.2) {
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(x, (-0.16666666666666666 * (x * x)), x);
} else {
tmp = sin(x) * fma(y, (y * (0.0001984126984126984 * ((y * y) * (y * y)))), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 12.2) tmp = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); elseif (y <= 1e+52) tmp = Float64(Float64(sinh(y) / y) * fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x)); else tmp = Float64(sin(x) * fma(y, Float64(y * Float64(0.0001984126984126984 * Float64(Float64(y * y) * Float64(y * y)))), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[y, 12.2], 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, 1e+52], N[(N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision] * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(0.0001984126984126984 * N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 12.2:\\
\;\;\;\;\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 10^{+52}:\\
\;\;\;\;\frac{\sinh y}{y} \cdot \mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y, y \cdot \left(0.0001984126984126984 \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)\right), 1\right)\\
\end{array}
\end{array}
if y < 12.199999999999999Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified91.9%
if 12.199999999999999 < y < 9.9999999999999999e51Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6488.9
Simplified88.9%
if 9.9999999999999999e51 < y Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Taylor expanded in y around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Final simplification93.3%
(FPCore (x y)
:precision binary64
(if (<= y 12.2)
(*
(sin x)
(fma (* y y) (fma y (* y 0.008333333333333333) 0.16666666666666666) 1.0))
(if (<= y 1e+76)
(* (/ (sinh y) y) (fma x (* -0.16666666666666666 (* x x)) x))
(* (sin x) (* y (* y (* 0.008333333333333333 (* y y))))))))
double code(double x, double y) {
double tmp;
if (y <= 12.2) {
tmp = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
} else if (y <= 1e+76) {
tmp = (sinh(y) / y) * fma(x, (-0.16666666666666666 * (x * x)), x);
} else {
tmp = sin(x) * (y * (y * (0.008333333333333333 * (y * y))));
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 12.2) tmp = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); elseif (y <= 1e+76) tmp = Float64(Float64(sinh(y) / y) * fma(x, Float64(-0.16666666666666666 * 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, 12.2], 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, 1e+76], N[(N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision] * N[(x * N[(-0.16666666666666666 * 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 12.2:\\
\;\;\;\;\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 10^{+76}:\\
\;\;\;\;\frac{\sinh y}{y} \cdot \mathsf{fma}\left(x, -0.16666666666666666 \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 < 12.199999999999999Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified91.9%
if 12.199999999999999 < y < 1e76Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6491.7
Simplified91.7%
if 1e76 < y Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified100.0%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Final simplification93.3%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.01)
(*
x
(*
(fma y (* y 0.16666666666666666) 1.0)
(fma -0.16666666666666666 (* x x) 1.0)))
(fma
x
(*
y
(*
y
(fma
(* y y)
(fma 0.0001984126984126984 (* y y) 0.008333333333333333)
0.16666666666666666)))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.01) {
tmp = x * (fma(y, (y * 0.16666666666666666), 1.0) * fma(-0.16666666666666666, (x * x), 1.0));
} else {
tmp = fma(x, (y * (y * fma((y * y), fma(0.0001984126984126984, (y * y), 0.008333333333333333), 0.16666666666666666))), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.01) tmp = Float64(x * Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * fma(-0.16666666666666666, Float64(x * x), 1.0))); else tmp = fma(x, Float64(y * Float64(y * fma(Float64(y * y), fma(0.0001984126984126984, Float64(y * y), 0.008333333333333333), 0.16666666666666666))), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.01], N[(x * N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(0.0001984126984126984 * N[(y * y), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.01:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot \left(y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(0.0001984126984126984, y \cdot y, 0.008333333333333333\right), 0.16666666666666666\right)\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.0100000000000000002Initial program 100.0%
Taylor expanded in y around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-sin.f6474.0
Simplified74.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
Simplified21.7%
if -0.0100000000000000002 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
Simplified87.7%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.4
Simplified65.4%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified64.1%
Final simplification52.7%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.01)
(*
x
(*
(fma y (* y 0.16666666666666666) 1.0)
(fma -0.16666666666666666 (* x x) 1.0)))
(fma
x
(*
(* y y)
(fma 0.0001984126984126984 (* (* y y) (* y y)) 0.16666666666666666))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.01) {
tmp = x * (fma(y, (y * 0.16666666666666666), 1.0) * fma(-0.16666666666666666, (x * x), 1.0));
} else {
tmp = fma(x, ((y * y) * fma(0.0001984126984126984, ((y * y) * (y * y)), 0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.01) tmp = Float64(x * Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * fma(-0.16666666666666666, Float64(x * x), 1.0))); else tmp = fma(x, Float64(Float64(y * y) * fma(0.0001984126984126984, Float64(Float64(y * y) * Float64(y * y)), 0.16666666666666666)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.01], N[(x * N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * y), $MachinePrecision] * N[(0.0001984126984126984 * N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.01:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(y \cdot y\right) \cdot \mathsf{fma}\left(0.0001984126984126984, \left(y \cdot y\right) \cdot \left(y \cdot y\right), 0.16666666666666666\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.0100000000000000002Initial program 100.0%
Taylor expanded in y around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-sin.f6474.0
Simplified74.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
Simplified21.7%
if -0.0100000000000000002 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
Simplified87.7%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6487.7
Simplified87.7%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.1
Simplified64.1%
Final simplification52.7%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.01)
(*
x
(*
(fma y (* y 0.16666666666666666) 1.0)
(fma -0.16666666666666666 (* x x) 1.0)))
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* x (* y y))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.01) {
tmp = x * (fma(y, (y * 0.16666666666666666), 1.0) * fma(-0.16666666666666666, (x * x), 1.0));
} else {
tmp = fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (x * (y * y)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.01) tmp = Float64(x * Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * fma(-0.16666666666666666, Float64(x * x), 1.0))); else tmp = fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(x * Float64(y * y)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.01], N[(x * N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.01:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), x \cdot \left(y \cdot y\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.0100000000000000002Initial program 100.0%
Taylor expanded in y around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-sin.f6474.0
Simplified74.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
Simplified21.7%
if -0.0100000000000000002 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified83.5%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.9
Simplified57.9%
Final simplification48.2%
(FPCore (x y)
:precision binary64
(if (<= y 1750.0)
(*
(sin x)
(fma (* y y) (fma y (* y 0.008333333333333333) 0.16666666666666666) 1.0))
(if (<= y 1e+76)
(fma
(fma y (* y 0.16666666666666666) 1.0)
(fma x (* -0.16666666666666666 (* x x)) x)
(*
x
(*
(* x x)
(*
(* (* y y) (* y y))
(+
(fma (* y y) -3.306878306878307e-5 -0.001388888888888889)
(/
(fma 0.0001984126984126984 (* y y) 0.008333333333333333)
(* x x)))))))
(* (sin x) (* y (* y (* 0.008333333333333333 (* y y))))))))
double code(double x, double y) {
double tmp;
if (y <= 1750.0) {
tmp = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
} else if (y <= 1e+76) {
tmp = fma(fma(y, (y * 0.16666666666666666), 1.0), fma(x, (-0.16666666666666666 * (x * x)), x), (x * ((x * x) * (((y * y) * (y * y)) * (fma((y * y), -3.306878306878307e-5, -0.001388888888888889) + (fma(0.0001984126984126984, (y * y), 0.008333333333333333) / (x * x)))))));
} else {
tmp = sin(x) * (y * (y * (0.008333333333333333 * (y * y))));
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 1750.0) tmp = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); elseif (y <= 1e+76) tmp = fma(fma(y, Float64(y * 0.16666666666666666), 1.0), fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x), Float64(x * Float64(Float64(x * x) * Float64(Float64(Float64(y * y) * Float64(y * y)) * Float64(fma(Float64(y * y), -3.306878306878307e-5, -0.001388888888888889) + Float64(fma(0.0001984126984126984, Float64(y * y), 0.008333333333333333) / Float64(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, 1750.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, 1e+76], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(x * N[(N[(x * x), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -3.306878306878307e-5 + -0.001388888888888889), $MachinePrecision] + N[(N[(0.0001984126984126984 * N[(y * y), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 1750:\\
\;\;\;\;\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 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right), \mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right), x \cdot \left(\left(x \cdot x\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\mathsf{fma}\left(y \cdot y, -3.306878306878307 \cdot 10^{-5}, -0.001388888888888889\right) + \frac{\mathsf{fma}\left(0.0001984126984126984, y \cdot y, 0.008333333333333333\right)}{x \cdot x}\right)\right)\right)\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 < 1750Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified91.4%
if 1750 < y < 1e76Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6491.3
Simplified91.3%
Taylor expanded in y around 0
Simplified40.9%
Taylor expanded in y around 0
Simplified40.9%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-/l*N/A
Simplified56.9%
if 1e76 < y Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified100.0%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Final simplification89.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (fma y (* y 0.16666666666666666) 1.0)))
(if (<= y 1750.0)
(* (sin x) t_0)
(if (<= y 1e+76)
(fma
t_0
(fma x (* -0.16666666666666666 (* x x)) x)
(*
x
(*
(* x x)
(*
(* (* y y) (* y y))
(+
(fma (* y y) -3.306878306878307e-5 -0.001388888888888889)
(/
(fma 0.0001984126984126984 (* y y) 0.008333333333333333)
(* x x)))))))
(* (sin x) (* y (* y (* 0.008333333333333333 (* y y)))))))))
double code(double x, double y) {
double t_0 = fma(y, (y * 0.16666666666666666), 1.0);
double tmp;
if (y <= 1750.0) {
tmp = sin(x) * t_0;
} else if (y <= 1e+76) {
tmp = fma(t_0, fma(x, (-0.16666666666666666 * (x * x)), x), (x * ((x * x) * (((y * y) * (y * y)) * (fma((y * y), -3.306878306878307e-5, -0.001388888888888889) + (fma(0.0001984126984126984, (y * y), 0.008333333333333333) / (x * x)))))));
} else {
tmp = sin(x) * (y * (y * (0.008333333333333333 * (y * y))));
}
return tmp;
}
function code(x, y) t_0 = fma(y, Float64(y * 0.16666666666666666), 1.0) tmp = 0.0 if (y <= 1750.0) tmp = Float64(sin(x) * t_0); elseif (y <= 1e+76) tmp = fma(t_0, fma(x, Float64(-0.16666666666666666 * Float64(x * x)), x), Float64(x * Float64(Float64(x * x) * Float64(Float64(Float64(y * y) * Float64(y * y)) * Float64(fma(Float64(y * y), -3.306878306878307e-5, -0.001388888888888889) + Float64(fma(0.0001984126984126984, Float64(y * y), 0.008333333333333333) / Float64(x * x))))))); else tmp = Float64(sin(x) * Float64(y * Float64(y * Float64(0.008333333333333333 * Float64(y * y))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[y, 1750.0], N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 1e+76], N[(t$95$0 * N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(x * N[(N[(x * x), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -3.306878306878307e-5 + -0.001388888888888889), $MachinePrecision] + N[(N[(0.0001984126984126984 * N[(y * y), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}
t_0 := \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{if}\;y \leq 1750:\\
\;\;\;\;\sin x \cdot t\_0\\
\mathbf{elif}\;y \leq 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, \mathsf{fma}\left(x, -0.16666666666666666 \cdot \left(x \cdot x\right), x\right), x \cdot \left(\left(x \cdot x\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\mathsf{fma}\left(y \cdot y, -3.306878306878307 \cdot 10^{-5}, -0.001388888888888889\right) + \frac{\mathsf{fma}\left(0.0001984126984126984, y \cdot y, 0.008333333333333333\right)}{x \cdot x}\right)\right)\right)\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 < 1750Initial program 100.0%
Taylor expanded in y around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-sin.f6483.2
Simplified83.2%
if 1750 < y < 1e76Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6491.3
Simplified91.3%
Taylor expanded in y around 0
Simplified40.9%
Taylor expanded in y around 0
Simplified40.9%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-/l*N/A
Simplified56.9%
if 1e76 < y Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified100.0%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Simplified100.0%
Final simplification83.8%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -0.01)
(* x (* -0.16666666666666666 (* x x)))
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* x (* y y))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= -0.01) {
tmp = x * (-0.16666666666666666 * (x * x));
} else {
tmp = fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (x * (y * y)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= -0.01) tmp = Float64(x * Float64(-0.16666666666666666 * Float64(x * x))); else tmp = fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(x * Float64(y * y)), x); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], -0.01], N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq -0.01:\\
\;\;\;\;x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), x \cdot \left(y \cdot y\right), x\right)\\
\end{array}
\end{array}
if (sin.f64 x) < -0.0100000000000000002Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6451.0
Simplified51.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6416.4
Simplified16.4%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6416.4
Simplified16.4%
if -0.0100000000000000002 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
associate-+r+N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
distribute-lft-inN/A
Simplified83.5%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.9
Simplified57.9%
(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.f6448.7
Simplified48.7%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.7
Simplified30.7%
(FPCore (x y) :precision binary64 (* x (* -0.16666666666666666 (* x x))))
double code(double x, double y) {
return x * (-0.16666666666666666 * (x * x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * ((-0.16666666666666666d0) * (x * x))
end function
public static double code(double x, double y) {
return x * (-0.16666666666666666 * (x * x));
}
def code(x, y): return x * (-0.16666666666666666 * (x * x))
function code(x, y) return Float64(x * Float64(-0.16666666666666666 * Float64(x * x))) end
function tmp = code(x, y) tmp = x * (-0.16666666666666666 * (x * x)); end
code[x_, y_] := N[(x * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6448.7
Simplified48.7%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.7
Simplified30.7%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6410.2
Simplified10.2%
herbie shell --seed 2024215
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))