
(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 20 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) (/ y (sinh y))))
double code(double x, double y) {
return sin(x) / (y / sinh(y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) / (y / sinh(y))
end function
public static double code(double x, double y) {
return Math.sin(x) / (y / Math.sinh(y));
}
def code(x, y): return math.sin(x) / (y / math.sinh(y))
function code(x, y) return Float64(sin(x) / Float64(y / sinh(y))) end
function tmp = code(x, y) tmp = sin(x) / (y / sinh(y)); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] / N[(y / N[Sinh[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x}{\frac{y}{\sinh y}}
\end{array}
Initial program 100.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0))
(t_1 (/ (sinh y) y))
(t_2 (* (sin x) t_1))
(t_3 (* x (* x x))))
(if (<= t_2 (- INFINITY))
(* (fma -0.16666666666666666 t_3 x) t_0)
(if (<= t_2 1.0)
(* (sin x) t_0)
(*
t_1
(fma
(fma x (* x 0.008333333333333333) -0.16666666666666666)
t_3
x))))))
double code(double x, double y) {
double t_0 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double t_1 = sinh(y) / y;
double t_2 = sin(x) * t_1;
double t_3 = x * (x * x);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(-0.16666666666666666, t_3, x) * t_0;
} else if (t_2 <= 1.0) {
tmp = sin(x) * t_0;
} else {
tmp = t_1 * fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), t_3, x);
}
return tmp;
}
function code(x, y) t_0 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) t_1 = Float64(sinh(y) / y) t_2 = Float64(sin(x) * t_1) t_3 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(fma(-0.16666666666666666, t_3, x) * t_0); elseif (t_2 <= 1.0) tmp = Float64(sin(x) * t_0); else tmp = Float64(t_1 * fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), t_3, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[x], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(-0.16666666666666666 * t$95$3 + x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$2, 1.0], N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$1 * N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$3 + x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
t_1 := \frac{\sinh y}{y}\\
t_2 := \sin x \cdot t\_1\\
t_3 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_3, x\right) \cdot t\_0\\
\mathbf{elif}\;t\_2 \leq 1:\\
\;\;\;\;\sin x \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), t\_3, 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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.5
Applied rewrites86.5%
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-*.f6460.9
Applied rewrites60.9%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6474.6
Applied rewrites74.6%
Final simplification82.6%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0))
(t_1 (* (sin x) (/ (sinh y) y)))
(t_2 (* x (* x x))))
(if (<= t_1 (- INFINITY))
(* (fma -0.16666666666666666 t_2 x) t_0)
(if (<= t_1 1.0)
(*
(sin x)
(fma
(* y y)
(fma y (* y 0.008333333333333333) 0.16666666666666666)
1.0))
(* t_0 (fma (* (* x x) 0.008333333333333333) t_2 x))))))
double code(double x, double y) {
double t_0 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double t_1 = sin(x) * (sinh(y) / y);
double t_2 = x * (x * x);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(-0.16666666666666666, t_2, x) * t_0;
} else if (t_1 <= 1.0) {
tmp = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
} else {
tmp = t_0 * fma(((x * x) * 0.008333333333333333), t_2, x);
}
return tmp;
}
function code(x, y) t_0 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) t_1 = Float64(sin(x) * Float64(sinh(y) / y)) t_2 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(-0.16666666666666666, t_2, x) * t_0); elseif (t_1 <= 1.0) tmp = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); else tmp = Float64(t_0 * fma(Float64(Float64(x * x) * 0.008333333333333333), t_2, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(-0.16666666666666666 * t$95$2 + x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * t$95$2 + x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
t_1 := \sin x \cdot \frac{\sinh y}{y}\\
t_2 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_2, x\right) \cdot t\_0\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.008333333333333333, t\_2, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.5
Applied rewrites86.5%
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-*.f6460.9
Applied rewrites60.9%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6499.3
Applied rewrites99.3%
if 1 < (*.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
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.9
Applied rewrites84.9%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
Taylor expanded in x around inf
Applied rewrites70.0%
Final simplification81.4%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0))
(t_1 (* (sin x) (/ (sinh y) y)))
(t_2 (* x (* x x))))
(if (<= t_1 (- INFINITY))
(* (fma -0.16666666666666666 t_2 x) t_0)
(if (<= t_1 1.0)
(* (sin x) (fma 0.16666666666666666 (* y y) 1.0))
(* t_0 (fma (* (* x x) 0.008333333333333333) t_2 x))))))
double code(double x, double y) {
double t_0 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double t_1 = sin(x) * (sinh(y) / y);
double t_2 = x * (x * x);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(-0.16666666666666666, t_2, x) * t_0;
} else if (t_1 <= 1.0) {
tmp = sin(x) * fma(0.16666666666666666, (y * y), 1.0);
} else {
tmp = t_0 * fma(((x * x) * 0.008333333333333333), t_2, x);
}
return tmp;
}
function code(x, y) t_0 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) t_1 = Float64(sin(x) * Float64(sinh(y) / y)) t_2 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(-0.16666666666666666, t_2, x) * t_0); elseif (t_1 <= 1.0) tmp = Float64(sin(x) * fma(0.16666666666666666, Float64(y * y), 1.0)); else tmp = Float64(t_0 * fma(Float64(Float64(x * x) * 0.008333333333333333), t_2, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(-0.16666666666666666 * t$95$2 + x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(N[Sin[x], $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * t$95$2 + x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
t_1 := \sin x \cdot \frac{\sinh y}{y}\\
t_2 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_2, x\right) \cdot t\_0\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin x \cdot \mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.008333333333333333, t\_2, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.5
Applied rewrites86.5%
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-*.f6460.9
Applied rewrites60.9%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6498.9
Applied rewrites98.9%
if 1 < (*.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
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.9
Applied rewrites84.9%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
Taylor expanded in x around inf
Applied rewrites70.0%
Final simplification81.2%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0))
(t_1 (* (sin x) (/ (sinh y) y)))
(t_2 (* x (* x x))))
(if (<= t_1 (- INFINITY))
(* (fma -0.16666666666666666 t_2 x) t_0)
(if (<= t_1 1.0)
(sin x)
(* t_0 (fma (* (* x x) 0.008333333333333333) t_2 x))))))
double code(double x, double y) {
double t_0 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double t_1 = sin(x) * (sinh(y) / y);
double t_2 = x * (x * x);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(-0.16666666666666666, t_2, x) * t_0;
} else if (t_1 <= 1.0) {
tmp = sin(x);
} else {
tmp = t_0 * fma(((x * x) * 0.008333333333333333), t_2, x);
}
return tmp;
}
function code(x, y) t_0 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) t_1 = Float64(sin(x) * Float64(sinh(y) / y)) t_2 = Float64(x * Float64(x * x)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(-0.16666666666666666, t_2, x) * t_0); elseif (t_1 <= 1.0) tmp = sin(x); else tmp = Float64(t_0 * fma(Float64(Float64(x * x) * 0.008333333333333333), t_2, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(-0.16666666666666666 * t$95$2 + x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[Sin[x], $MachinePrecision], N[(t$95$0 * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * t$95$2 + x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
t_1 := \sin x \cdot \frac{\sinh y}{y}\\
t_2 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_2, x\right) \cdot t\_0\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.008333333333333333, t\_2, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.5
Applied rewrites86.5%
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-*.f6460.9
Applied rewrites60.9%
if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1Initial program 99.9%
Taylor expanded in y around 0
lower-sin.f6498.4
Applied rewrites98.4%
if 1 < (*.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
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.9
Applied rewrites84.9%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
Taylor expanded in x around inf
Applied rewrites70.0%
Final simplification81.0%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0))
(t_1 (* x (* x x))))
(if (<= (* (sin x) (/ (sinh y) y)) -0.05)
(* (fma -0.16666666666666666 t_1 x) t_0)
(*
t_0
(fma (fma x (* x 0.008333333333333333) -0.16666666666666666) t_1 x)))))
double code(double x, double y) {
double t_0 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double t_1 = x * (x * x);
double tmp;
if ((sin(x) * (sinh(y) / y)) <= -0.05) {
tmp = fma(-0.16666666666666666, t_1, x) * t_0;
} else {
tmp = t_0 * fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), t_1, x);
}
return tmp;
}
function code(x, y) t_0 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) t_1 = Float64(x * Float64(x * x)) tmp = 0.0 if (Float64(sin(x) * Float64(sinh(y) / y)) <= -0.05) tmp = Float64(fma(-0.16666666666666666, t_1, x) * t_0); else tmp = Float64(t_0 * fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), t_1, x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(-0.16666666666666666 * t$95$1 + x), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
t_1 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_1, x\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), t\_1, x\right)\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6490.9
Applied rewrites90.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6442.5
Applied rewrites42.5%
if -0.050000000000000003 < (*.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
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.3
Applied rewrites93.3%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.9
Applied rewrites68.9%
Final simplification58.1%
(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
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)))
(if (<= (sin x) 0.06)
(* (fma -0.16666666666666666 t_0 x) t_1)
(* t_1 (* 0.008333333333333333 (* x (* x t_0)))))))
double code(double x, double y) {
double t_0 = x * (x * x);
double t_1 = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double tmp;
if (sin(x) <= 0.06) {
tmp = fma(-0.16666666666666666, t_0, x) * t_1;
} else {
tmp = t_1 * (0.008333333333333333 * (x * (x * t_0)));
}
return tmp;
}
function code(x, y) t_0 = Float64(x * Float64(x * x)) t_1 = fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) tmp = 0.0 if (sin(x) <= 0.06) tmp = Float64(fma(-0.16666666666666666, t_0, x) * t_1); else tmp = Float64(t_1 * Float64(0.008333333333333333 * Float64(x * Float64(x * t_0)))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[N[Sin[x], $MachinePrecision], 0.06], N[(N[(-0.16666666666666666 * t$95$0 + x), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(0.008333333333333333 * N[(x * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;\sin x \leq 0.06:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_0, x\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(0.008333333333333333 \cdot \left(x \cdot \left(x \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.059999999999999998Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.0
Applied rewrites93.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-*.f6468.0
Applied rewrites68.0%
if 0.059999999999999998 < (sin.f64 x) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.8
Applied rewrites89.8%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.8
Applied rewrites27.8%
Applied rewrites18.5%
Taylor expanded in x around inf
Applied rewrites27.8%
Final simplification59.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= (sin x) 2e-17)
(*
(fma -0.16666666666666666 t_0 x)
(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)
(fma
(* y y)
(fma y (* y 0.008333333333333333) 0.16666666666666666)
1.0)))))
double code(double x, double y) {
double t_0 = x * (x * x);
double tmp;
if (sin(x) <= 2e-17) {
tmp = fma(-0.16666666666666666, t_0, x) * fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
} else {
tmp = fma(fma(x, (x * 0.008333333333333333), -0.16666666666666666), t_0, x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (sin(x) <= 2e-17) tmp = Float64(fma(-0.16666666666666666, t_0, x) * fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0)); else tmp = Float64(fma(fma(x, Float64(x * 0.008333333333333333), -0.16666666666666666), t_0, x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[x], $MachinePrecision], 2e-17], N[(N[(-0.16666666666666666 * t$95$0 + x), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(x * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * t$95$0 + x), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;\sin x \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_0, x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x \cdot 0.008333333333333333, -0.16666666666666666\right), t\_0, x\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 2.00000000000000014e-17Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.2
Applied rewrites93.2%
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-*.f6466.7
Applied rewrites66.7%
if 2.00000000000000014e-17 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6482.1
Applied rewrites82.1%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.2
Applied rewrites29.2%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 1e-9)
(*
(fma -0.16666666666666666 (* x (* x x)) x)
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0))
(*
(fma
(* (* x x) (fma 0.008333333333333333 (* x x) -0.16666666666666666))
x
x)
(fma y (* y 0.16666666666666666) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-9) {
tmp = fma(-0.16666666666666666, (x * (x * x)), x) * fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
} else {
tmp = fma(((x * x) * fma(0.008333333333333333, (x * x), -0.16666666666666666)), x, x) * fma(y, (y * 0.16666666666666666), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-9) tmp = Float64(fma(-0.16666666666666666, Float64(x * Float64(x * x)), x) * fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0)); else tmp = Float64(fma(Float64(Float64(x * x) * fma(0.008333333333333333, Float64(x * x), -0.16666666666666666)), x, x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-9], N[(N[(-0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x, x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1.00000000000000006e-9Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.3
Applied rewrites93.3%
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-*.f6467.2
Applied rewrites67.2%
if 1.00000000000000006e-9 < (sin.f64 x) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.1
Applied rewrites89.1%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6428.8
Applied rewrites28.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6425.7
Applied rewrites25.7%
Applied rewrites25.7%
Final simplification57.3%
(FPCore (x y)
:precision binary64
(let* ((t_0
(*
(sin x)
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0))))
(if (<= y 1.0)
t_0
(if (<= y 1e+52)
(* (/ (sinh y) y) (fma -0.16666666666666666 (* x (* x x)) x))
t_0))))
double code(double x, double y) {
double t_0 = sin(x) * fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0);
double tmp;
if (y <= 1.0) {
tmp = t_0;
} else if (y <= 1e+52) {
tmp = (sinh(y) / y) * fma(-0.16666666666666666, (x * (x * x)), x);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0)) tmp = 0.0 if (y <= 1.0) tmp = t_0; elseif (y <= 1e+52) tmp = Float64(Float64(sinh(y) / y) * fma(-0.16666666666666666, Float64(x * Float64(x * x)), x)); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.0], t$95$0, 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], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right)\\
\mathbf{if}\;y \leq 1:\\
\;\;\;\;t\_0\\
\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}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 1 or 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
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6495.0
Applied rewrites95.0%
if 1 < y < 9.9999999999999999e51Initial program 99.8%
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-*.f6487.3
Applied rewrites87.3%
Final simplification94.8%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 1e-9)
(*
(fma -0.16666666666666666 (* x (* x x)) x)
(fma y (* y (fma (* y y) 0.008333333333333333 0.16666666666666666)) 1.0))
(*
(fma
(* (* x x) (fma 0.008333333333333333 (* x x) -0.16666666666666666))
x
x)
(fma y (* y 0.16666666666666666) 1.0))))
double code(double x, double y) {
double tmp;
if (sin(x) <= 1e-9) {
tmp = fma(-0.16666666666666666, (x * (x * x)), x) * fma(y, (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), 1.0);
} else {
tmp = fma(((x * x) * fma(0.008333333333333333, (x * x), -0.16666666666666666)), x, x) * fma(y, (y * 0.16666666666666666), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 1e-9) tmp = Float64(fma(-0.16666666666666666, Float64(x * Float64(x * x)), x) * fma(y, Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), 1.0)); else tmp = Float64(fma(Float64(Float64(x * x) * fma(0.008333333333333333, Float64(x * x), -0.16666666666666666)), x, x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[Sin[x], $MachinePrecision], 1e-9], N[(N[(-0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin x \leq 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x, x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 1.00000000000000006e-9Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.3
Applied rewrites93.3%
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-*.f6467.2
Applied rewrites67.2%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.7
Applied rewrites65.7%
if 1.00000000000000006e-9 < (sin.f64 x) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.1
Applied rewrites89.1%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6428.8
Applied rewrites28.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6425.7
Applied rewrites25.7%
Applied rewrites25.7%
Final simplification56.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))))
(if (<= (sin x) 0.06)
(*
(fma -0.16666666666666666 t_0 x)
(fma y (* y (fma (* y y) 0.008333333333333333 0.16666666666666666)) 1.0))
(*
(fma (* (* x x) 0.008333333333333333) t_0 x)
(fma y (* y 0.16666666666666666) 1.0)))))
double code(double x, double y) {
double t_0 = x * (x * x);
double tmp;
if (sin(x) <= 0.06) {
tmp = fma(-0.16666666666666666, t_0, x) * fma(y, (y * fma((y * y), 0.008333333333333333, 0.16666666666666666)), 1.0);
} else {
tmp = fma(((x * x) * 0.008333333333333333), t_0, x) * fma(y, (y * 0.16666666666666666), 1.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(x * Float64(x * x)) tmp = 0.0 if (sin(x) <= 0.06) tmp = Float64(fma(-0.16666666666666666, t_0, x) * fma(y, Float64(y * fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666)), 1.0)); else tmp = Float64(fma(Float64(Float64(x * x) * 0.008333333333333333), t_0, x) * fma(y, Float64(y * 0.16666666666666666), 1.0)); 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.06], N[(N[(-0.16666666666666666 * t$95$0 + x), $MachinePrecision] * N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * t$95$0 + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;\sin x \leq 0.06:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_0, x\right) \cdot \mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.008333333333333333, t\_0, x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.059999999999999998Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.0
Applied rewrites93.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-*.f6468.0
Applied rewrites68.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6466.6
Applied rewrites66.6%
if 0.059999999999999998 < (sin.f64 x) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.8
Applied rewrites89.8%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.8
Applied rewrites27.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
Taylor expanded in x around inf
Applied rewrites24.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))) (t_1 (fma y (* y 0.16666666666666666) 1.0)))
(if (<= (sin x) 0.06)
(* (fma -0.16666666666666666 t_0 x) t_1)
(* (fma (* (* x x) 0.008333333333333333) t_0 x) t_1))))
double code(double x, double y) {
double t_0 = x * (x * x);
double t_1 = fma(y, (y * 0.16666666666666666), 1.0);
double tmp;
if (sin(x) <= 0.06) {
tmp = fma(-0.16666666666666666, t_0, x) * t_1;
} else {
tmp = fma(((x * x) * 0.008333333333333333), t_0, x) * t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(x * Float64(x * x)) t_1 = fma(y, Float64(y * 0.16666666666666666), 1.0) tmp = 0.0 if (sin(x) <= 0.06) tmp = Float64(fma(-0.16666666666666666, t_0, x) * t_1); else tmp = Float64(fma(Float64(Float64(x * x) * 0.008333333333333333), t_0, x) * t_1); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[N[Sin[x], $MachinePrecision], 0.06], N[(N[(-0.16666666666666666 * t$95$0 + x), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * t$95$0 + x), $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{if}\;\sin x \leq 0.06:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_0, x\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.008333333333333333, t\_0, x\right) \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 x) < 0.059999999999999998Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.0
Applied rewrites93.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-*.f6468.0
Applied rewrites68.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6457.3
Applied rewrites57.3%
if 0.059999999999999998 < (sin.f64 x) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.8
Applied rewrites89.8%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.8
Applied rewrites27.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
Taylor expanded in x around inf
Applied rewrites24.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))) (t_1 (fma y (* y 0.16666666666666666) 1.0)))
(if (<= (sin x) 0.06)
(* (fma -0.16666666666666666 t_0 x) t_1)
(* t_1 (* 0.008333333333333333 (* x (* x t_0)))))))
double code(double x, double y) {
double t_0 = x * (x * x);
double t_1 = fma(y, (y * 0.16666666666666666), 1.0);
double tmp;
if (sin(x) <= 0.06) {
tmp = fma(-0.16666666666666666, t_0, x) * t_1;
} else {
tmp = t_1 * (0.008333333333333333 * (x * (x * t_0)));
}
return tmp;
}
function code(x, y) t_0 = Float64(x * Float64(x * x)) t_1 = fma(y, Float64(y * 0.16666666666666666), 1.0) tmp = 0.0 if (sin(x) <= 0.06) tmp = Float64(fma(-0.16666666666666666, t_0, x) * t_1); else tmp = Float64(t_1 * Float64(0.008333333333333333 * Float64(x * Float64(x * t_0)))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[N[Sin[x], $MachinePrecision], 0.06], N[(N[(-0.16666666666666666 * t$95$0 + x), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(0.008333333333333333 * N[(x * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{if}\;\sin x \leq 0.06:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, t\_0, x\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(0.008333333333333333 \cdot \left(x \cdot \left(x \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if (sin.f64 x) < 0.059999999999999998Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.0
Applied rewrites93.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-*.f6468.0
Applied rewrites68.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6457.3
Applied rewrites57.3%
if 0.059999999999999998 < (sin.f64 x) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.8
Applied rewrites89.8%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.8
Applied rewrites27.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
Taylor expanded in x around inf
Applied rewrites24.4%
Final simplification50.1%
(FPCore (x y)
:precision binary64
(let* ((t_0
(*
(sin x)
(fma
(* y y)
(fma y (* y 0.008333333333333333) 0.16666666666666666)
1.0)))
(t_1 (* x (* x x))))
(if (<= y 0.45)
t_0
(if (<= y 1.05e+52)
(* (/ (sinh y) y) (fma -0.16666666666666666 t_1 x))
(if (<= y 3.8e+77)
(*
(fma
y
(*
y
(fma
(* y y)
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
0.16666666666666666))
1.0)
(fma (* (* x x) 0.008333333333333333) t_1 x))
t_0)))))
double code(double x, double y) {
double t_0 = sin(x) * fma((y * y), fma(y, (y * 0.008333333333333333), 0.16666666666666666), 1.0);
double t_1 = x * (x * x);
double tmp;
if (y <= 0.45) {
tmp = t_0;
} else if (y <= 1.05e+52) {
tmp = (sinh(y) / y) * fma(-0.16666666666666666, t_1, x);
} else if (y <= 3.8e+77) {
tmp = fma(y, (y * fma((y * y), fma((y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(((x * x) * 0.008333333333333333), t_1, x);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * fma(Float64(y * y), fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), 1.0)) t_1 = Float64(x * Float64(x * x)) tmp = 0.0 if (y <= 0.45) tmp = t_0; elseif (y <= 1.05e+52) tmp = Float64(Float64(sinh(y) / y) * fma(-0.16666666666666666, t_1, x)); elseif (y <= 3.8e+77) tmp = Float64(fma(y, Float64(y * fma(Float64(y * y), fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), 0.16666666666666666)), 1.0) * fma(Float64(Float64(x * x) * 0.008333333333333333), t_1, x)); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.45], t$95$0, If[LessEqual[y, 1.05e+52], N[(N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision] * N[(-0.16666666666666666 * t$95$1 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+77], N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), 1\right)\\
t_1 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;y \leq 0.45:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+52}:\\
\;\;\;\;\frac{\sinh y}{y} \cdot \mathsf{fma}\left(-0.16666666666666666, t\_1, x\right)\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), 1\right) \cdot \mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.008333333333333333, t\_1, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 0.450000000000000011 or 3.8000000000000001e77 < y Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6492.9
Applied rewrites92.9%
if 0.450000000000000011 < y < 1.05e52Initial program 99.8%
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-*.f6487.3
Applied rewrites87.3%
if 1.05e52 < y < 3.8000000000000001e77Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites100.0%
Final simplification92.8%
(FPCore (x y)
:precision binary64
(if (<= (sin x) 0.1)
(*
(fma -0.16666666666666666 (* x (* x x)) x)
(fma y (* y 0.16666666666666666) 1.0))
(fma
(* x x)
(* x (fma x (* x 0.008333333333333333) -0.16666666666666666))
x)))
double code(double x, double y) {
double tmp;
if (sin(x) <= 0.1) {
tmp = fma(-0.16666666666666666, (x * (x * x)), x) * fma(y, (y * 0.16666666666666666), 1.0);
} else {
tmp = fma((x * x), (x * fma(x, (x * 0.008333333333333333), -0.16666666666666666)), x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (sin(x) <= 0.1) tmp = Float64(fma(-0.16666666666666666, Float64(x * Float64(x * x)), x) * fma(y, Float64(y * 0.16666666666666666), 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.1], N[(N[(-0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $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.1:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(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.10000000000000001Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.0
Applied rewrites93.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-*.f6467.9
Applied rewrites67.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6457.2
Applied rewrites57.2%
if 0.10000000000000001 < (sin.f64 x) Initial program 99.9%
Taylor expanded in y around 0
lower-sin.f6450.4
Applied rewrites50.4%
Taylor expanded in x around 0
Applied rewrites18.5%
Taylor expanded in x around 0
Applied rewrites23.4%
Final simplification50.1%
(FPCore (x y)
:precision binary64
(if (<= (sin x) -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) <= -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 (sin(x) <= -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[Sin[x], $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 \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 (sin.f64 x) < -0.0200000000000000004Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6447.6
Applied rewrites47.6%
Taylor expanded in x around 0
Applied rewrites23.7%
Taylor expanded in x around inf
Applied rewrites23.0%
Taylor expanded in x around inf
Applied rewrites23.0%
if -0.0200000000000000004 < (sin.f64 x) Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6448.6
Applied rewrites48.6%
Taylor expanded in x around 0
Applied rewrites40.2%
Taylor expanded in x around 0
Applied rewrites40.0%
Final simplification35.1%
(FPCore (x y) :precision binary64 (fma -0.16666666666666666 (* x (* x x)) x))
double code(double x, double y) {
return fma(-0.16666666666666666, (x * (x * x)), x);
}
function code(x, y) return fma(-0.16666666666666666, Float64(x * Float64(x * x)), x) end
code[x_, y_] := N[(-0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.16666666666666666, x \cdot \left(x \cdot x\right), x\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
lower-sin.f6448.3
Applied rewrites48.3%
Taylor expanded in x around 0
Applied rewrites35.4%
(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.f6448.3
Applied rewrites48.3%
Taylor expanded in x around 0
Applied rewrites35.4%
Taylor expanded in x around inf
Applied rewrites13.3%
Taylor expanded in x around inf
Applied rewrites13.3%
herbie shell --seed 2024220
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))