
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
(FPCore (x y) :precision binary64 (/ (sinh y) (/ x (sin x))))
double code(double x, double y) {
return sinh(y) / (x / sin(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sinh(y) / (x / sin(x))
end function
public static double code(double x, double y) {
return Math.sinh(y) / (x / Math.sin(x));
}
def code(x, y): return math.sinh(y) / (x / math.sin(x))
function code(x, y) return Float64(sinh(y) / Float64(x / sin(x))) end
function tmp = code(x, y) tmp = sinh(y) / (x / sin(x)); end
code[x_, y_] := N[(N[Sinh[y], $MachinePrecision] / N[(x / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sinh y}{\frac{x}{\sin x}}
\end{array}
Initial program 88.6%
lift-/.f64N/A
clear-numN/A
lift-*.f64N/A
associate-/r*N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (fma (* y y) 0.16666666666666666 1.0))
(t_1 (/ (* (sin x) (sinh y)) x)))
(if (<= t_1 (- INFINITY))
(* (* (fma -0.16666666666666666 (* x x) 1.0) t_0) y)
(if (<= t_1 2e-18) (* (* t_0 (/ (sin x) x)) y) (sinh y)))))
double code(double x, double y) {
double t_0 = fma((y * y), 0.16666666666666666, 1.0);
double t_1 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * t_0) * y;
} else if (t_1 <= 2e-18) {
tmp = (t_0 * (sin(x) / x)) * y;
} else {
tmp = sinh(y);
}
return tmp;
}
function code(x, y) t_0 = fma(Float64(y * y), 0.16666666666666666, 1.0) t_1 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * t_0) * y); elseif (t_1 <= 2e-18) tmp = Float64(Float64(t_0 * Float64(sin(x) / x)) * y); else tmp = sinh(y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 2e-18], N[(N[(t$95$0 * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\\
t_1 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot t\_0\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\left(t\_0 \cdot \frac{\sin x}{x}\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.4%
Taylor expanded in y around 0
Applied rewrites62.3%
Taylor expanded in x around 0
Applied rewrites62.6%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.0000000000000001e-18Initial program 79.1%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.2%
Taylor expanded in y around 0
Applied rewrites99.2%
if 2.0000000000000001e-18 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6488.0
Applied rewrites88.0%
Applied rewrites91.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 (- INFINITY))
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (* y y) 0.16666666666666666 1.0))
y)
(if (<= t_0 2e-18) (/ y (/ x (sin x))) (sinh y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), 0.16666666666666666, 1.0)) * y;
} else if (t_0 <= 2e-18) {
tmp = y / (x / sin(x));
} else {
tmp = sinh(y);
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), 0.16666666666666666, 1.0)) * y); elseif (t_0 <= 2e-18) tmp = Float64(y / Float64(x / sin(x))); else tmp = sinh(y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 2e-18], N[(y / N[(x / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\frac{y}{\frac{x}{\sin x}}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.4%
Taylor expanded in y around 0
Applied rewrites62.3%
Taylor expanded in x around 0
Applied rewrites62.6%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.0000000000000001e-18Initial program 79.1%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6498.8
Applied rewrites98.8%
Applied rewrites98.9%
if 2.0000000000000001e-18 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6488.0
Applied rewrites88.0%
Applied rewrites91.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 (- INFINITY))
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (* y y) 0.16666666666666666 1.0))
y)
(if (<= t_0 2e-18) (* (/ (sin x) x) y) (sinh y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), 0.16666666666666666, 1.0)) * y;
} else if (t_0 <= 2e-18) {
tmp = (sin(x) / x) * y;
} else {
tmp = sinh(y);
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), 0.16666666666666666, 1.0)) * y); elseif (t_0 <= 2e-18) tmp = Float64(Float64(sin(x) / x) * y); else tmp = sinh(y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 2e-18], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.4%
Taylor expanded in y around 0
Applied rewrites62.3%
Taylor expanded in x around 0
Applied rewrites62.6%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.0000000000000001e-18Initial program 79.1%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6498.8
Applied rewrites98.8%
if 2.0000000000000001e-18 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6488.0
Applied rewrites88.0%
Applied rewrites91.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -1e-222)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (* y y) 0.16666666666666666 1.0))
y)
(if (<= t_0 1e-249) (* (- (+ 1.0 y) (- 1.0 y)) 0.5) (sinh y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -1e-222) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), 0.16666666666666666, 1.0)) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = sinh(y);
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), 0.16666666666666666, 1.0)) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = sinh(y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.0%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in x around 0
Applied rewrites61.4%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6456.0
Applied rewrites56.0%
Applied rewrites77.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x))
(t_1
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x x)
1.0)))
(if (<= t_0 -1e-222)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (* y y) 0.16666666666666666 1.0))
y)
(if (<= t_0 1e-249)
(* (- (+ 1.0 y) (- 1.0 y)) 0.5)
(fma
(*
(* t_1 (* (fma (* y y) 0.008333333333333333 0.16666666666666666) y))
y)
y
(* t_1 y))))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double t_1 = fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * x), 1.0);
double tmp;
if (t_0 <= -1e-222) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), 0.16666666666666666, 1.0)) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = fma(((t_1 * (fma((y * y), 0.008333333333333333, 0.16666666666666666) * y)) * y), y, (t_1 * y));
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) t_1 = fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * x), 1.0) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), 0.16666666666666666, 1.0)) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = fma(Float64(Float64(t_1 * Float64(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666) * y)) * y), y, Float64(t_1 * y)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(t$95$1 * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] * y + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot x, 1\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t\_1 \cdot \left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right) \cdot y\right)\right) \cdot y, y, t\_1 \cdot y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.0%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in x around 0
Applied rewrites61.4%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in x around 0
Applied rewrites77.3%
Applied rewrites77.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -1e-222)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (* y y) 0.16666666666666666 1.0))
y)
(if (<= t_0 1e-249)
(* (- (+ 1.0 y) (- 1.0 y)) 0.5)
(*
(*
(fma
(fma 0.008333333333333333 (* x x) -0.16666666666666666)
(* x x)
1.0)
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* y y)
1.0))
y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -1e-222) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), 0.16666666666666666, 1.0)) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = (fma(fma(0.008333333333333333, (x * x), -0.16666666666666666), (x * x), 1.0) * fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0)) * y;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), 0.16666666666666666, 1.0)) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = Float64(Float64(fma(fma(0.008333333333333333, Float64(x * x), -0.16666666666666666), Float64(x * x), 1.0) * fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0)) * y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x \cdot x, 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right)\right) \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.0%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in x around 0
Applied rewrites61.4%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in x around 0
Applied rewrites77.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -1e-222)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (* y y) 0.16666666666666666 1.0))
y)
(if (<= t_0 1e-249)
(* (- (+ 1.0 y) (- 1.0 y)) 0.5)
(*
(*
(fma
(fma 0.008333333333333333 (* x x) -0.16666666666666666)
(* x x)
1.0)
(fma (* (* y y) 0.008333333333333333) (* y y) 1.0))
y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -1e-222) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), 0.16666666666666666, 1.0)) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = (fma(fma(0.008333333333333333, (x * x), -0.16666666666666666), (x * x), 1.0) * fma(((y * y) * 0.008333333333333333), (y * y), 1.0)) * y;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), 0.16666666666666666, 1.0)) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = Float64(Float64(fma(fma(0.008333333333333333, Float64(x * x), -0.16666666666666666), Float64(x * x), 1.0) * fma(Float64(Float64(y * y) * 0.008333333333333333), Float64(y * y), 1.0)) * y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x \cdot x, 1\right) \cdot \mathsf{fma}\left(\left(y \cdot y\right) \cdot 0.008333333333333333, y \cdot y, 1\right)\right) \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.0%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in x around 0
Applied rewrites61.4%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in x around 0
Applied rewrites77.3%
Taylor expanded in y around inf
Applied rewrites77.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -1e-222)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (* y y) 0.16666666666666666 1.0))
y)
(if (<= t_0 1e-249)
(* (- (+ 1.0 y) (- 1.0 y)) 0.5)
(*
(*
(fma
(fma
(fma 0.0003968253968253968 (* y y) 0.016666666666666666)
(* y y)
0.3333333333333333)
(* y y)
2.0)
y)
0.5)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -1e-222) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), 0.16666666666666666, 1.0)) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = (fma(fma(fma(0.0003968253968253968, (y * y), 0.016666666666666666), (y * y), 0.3333333333333333), (y * y), 2.0) * y) * 0.5;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), 0.16666666666666666, 1.0)) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = Float64(Float64(fma(fma(fma(0.0003968253968253968, Float64(y * y), 0.016666666666666666), Float64(y * y), 0.3333333333333333), Float64(y * y), 2.0) * y) * 0.5); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(N[(0.0003968253968253968 * N[(y * y), $MachinePrecision] + 0.016666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + 2.0), $MachinePrecision] * y), $MachinePrecision] * 0.5), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0003968253968253968, y \cdot y, 0.016666666666666666\right), y \cdot y, 0.3333333333333333\right), y \cdot y, 2\right) \cdot y\right) \cdot 0.5\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.0%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in x around 0
Applied rewrites61.4%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6456.0
Applied rewrites56.0%
Taylor expanded in y around 0
Applied rewrites75.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -1e-222)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (* y y) 0.16666666666666666 1.0))
y)
(if (<= t_0 1e-249)
(* (- (+ 1.0 y) (- 1.0 y)) 0.5)
(*
(fma
(fma (* 0.008333333333333333 y) y 0.16666666666666666)
(* y y)
1.0)
y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -1e-222) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma((y * y), 0.16666666666666666, 1.0)) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = fma(fma((0.008333333333333333 * y), y, 0.16666666666666666), (y * y), 1.0) * y;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(Float64(y * y), 0.16666666666666666, 1.0)) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = Float64(fma(fma(Float64(0.008333333333333333 * y), y, 0.16666666666666666), Float64(y * y), 1.0) * y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(0.008333333333333333 * y), $MachinePrecision] * y + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333 \cdot y, y, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.0%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in x around 0
Applied rewrites61.4%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in x around 0
Applied rewrites72.4%
Applied rewrites72.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -1e-222)
(* (fma -0.16666666666666666 (* x x) 1.0) y)
(if (<= t_0 1e-249)
(* (- (+ 1.0 y) (- 1.0 y)) 0.5)
(*
(fma
(fma (* 0.008333333333333333 y) y 0.16666666666666666)
(* y y)
1.0)
y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -1e-222) {
tmp = fma(-0.16666666666666666, (x * x), 1.0) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = fma(fma((0.008333333333333333 * y), y, 0.16666666666666666), (y * y), 1.0) * y;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = Float64(fma(fma(Float64(0.008333333333333333 * y), y, 0.16666666666666666), Float64(y * y), 1.0) * y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(0.008333333333333333 * y), $MachinePrecision] * y + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333 \cdot y, y, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6428.1
Applied rewrites28.1%
Taylor expanded in x around 0
Applied rewrites35.0%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in x around 0
Applied rewrites72.4%
Applied rewrites72.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -1e-222)
(* (fma -0.16666666666666666 (* x x) 1.0) y)
(if (<= t_0 1e-249)
(* (- (+ 1.0 y) (- 1.0 y)) 0.5)
(* (fma (* (* y y) 0.008333333333333333) (* y y) 1.0) y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -1e-222) {
tmp = fma(-0.16666666666666666, (x * x), 1.0) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = fma(((y * y) * 0.008333333333333333), (y * y), 1.0) * y;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = Float64(fma(Float64(Float64(y * y) * 0.008333333333333333), Float64(y * y), 1.0) * y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot 0.008333333333333333, y \cdot y, 1\right) \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6428.1
Applied rewrites28.1%
Taylor expanded in x around 0
Applied rewrites35.0%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in x around 0
Applied rewrites72.4%
Taylor expanded in y around inf
Applied rewrites72.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -1e-222)
(* (fma -0.16666666666666666 (* x x) 1.0) y)
(if (<= t_0 1e-249)
(* (- (+ 1.0 y) (- 1.0 y)) 0.5)
(* (fma 0.16666666666666666 (* y y) 1.0) y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -1e-222) {
tmp = fma(-0.16666666666666666, (x * x), 1.0) * y;
} else if (t_0 <= 1e-249) {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
} else {
tmp = fma(0.16666666666666666, (y * y), 1.0) * y;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -1e-222) tmp = Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * y); elseif (t_0 <= 1e-249) tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); else tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-222], N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e-249], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{-249}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.00000000000000005e-222Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6428.1
Applied rewrites28.1%
Taylor expanded in x around 0
Applied rewrites35.0%
if -1.00000000000000005e-222 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.00000000000000005e-249Initial program 67.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
Taylor expanded in y around 0
Applied rewrites50.6%
if 1.00000000000000005e-249 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in x around 0
Applied rewrites72.4%
Taylor expanded in y around 0
Applied rewrites63.4%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sin x) (sinh y)) x) 2e-18)
(*
(*
(/ (sin x) x)
(fma (fma (* y y) 0.008333333333333333 0.16666666666666666) (* y y) 1.0))
y)
(sinh y)))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= 2e-18) {
tmp = ((sin(x) / x) * fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0)) * y;
} else {
tmp = sinh(y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= 2e-18) tmp = Float64(Float64(Float64(sin(x) / x) * fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0)) * y); else tmp = sinh(y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 2e-18], N[(N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\left(\frac{\sin x}{x} \cdot \mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right)\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.0000000000000001e-18Initial program 86.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.2%
if 2.0000000000000001e-18 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6488.0
Applied rewrites88.0%
Applied rewrites91.1%
(FPCore (x y) :precision binary64 (* (/ (sin x) x) (sinh y)))
double code(double x, double y) {
return (sin(x) / x) * sinh(y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) / x) * sinh(y)
end function
public static double code(double x, double y) {
return (Math.sin(x) / x) * Math.sinh(y);
}
def code(x, y): return (math.sin(x) / x) * math.sinh(y)
function code(x, y) return Float64(Float64(sin(x) / x) * sinh(y)) end
function tmp = code(x, y) tmp = (sin(x) / x) * sinh(y); end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x}{x} \cdot \sinh y
\end{array}
Initial program 88.6%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
(FPCore (x y) :precision binary64 (if (<= x 840000000000.0) (sinh y) (* (- (exp y) (- 1.0 y)) 0.5)))
double code(double x, double y) {
double tmp;
if (x <= 840000000000.0) {
tmp = sinh(y);
} else {
tmp = (exp(y) - (1.0 - y)) * 0.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 840000000000.0d0) then
tmp = sinh(y)
else
tmp = (exp(y) - (1.0d0 - y)) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 840000000000.0) {
tmp = Math.sinh(y);
} else {
tmp = (Math.exp(y) - (1.0 - y)) * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 840000000000.0: tmp = math.sinh(y) else: tmp = (math.exp(y) - (1.0 - y)) * 0.5 return tmp
function code(x, y) tmp = 0.0 if (x <= 840000000000.0) tmp = sinh(y); else tmp = Float64(Float64(exp(y) - Float64(1.0 - y)) * 0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 840000000000.0) tmp = sinh(y); else tmp = (exp(y) - (1.0 - y)) * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 840000000000.0], N[Sinh[y], $MachinePrecision], N[(N[(N[Exp[y], $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 840000000000:\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;\left(e^{y} - \left(1 - y\right)\right) \cdot 0.5\\
\end{array}
\end{array}
if x < 8.4e11Initial program 84.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6452.4
Applied rewrites52.4%
Applied rewrites73.8%
if 8.4e11 < x Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6458.5
Applied rewrites58.5%
Taylor expanded in y around 0
Applied rewrites48.0%
(FPCore (x y) :precision binary64 (if (<= x 1.7e+121) (* (fma 0.16666666666666666 (* y y) 1.0) y) (* (- (+ 1.0 y) (- 1.0 y)) 0.5)))
double code(double x, double y) {
double tmp;
if (x <= 1.7e+121) {
tmp = fma(0.16666666666666666, (y * y), 1.0) * y;
} else {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 1.7e+121) tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * y); else tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); end return tmp end
code[x_, y_] := If[LessEqual[x, 1.7e+121], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\end{array}
\end{array}
if x < 1.70000000000000005e121Initial program 86.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.4%
Taylor expanded in x around 0
Applied rewrites62.2%
Taylor expanded in y around 0
Applied rewrites57.5%
if 1.70000000000000005e121 < x Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6469.8
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites62.5%
Taylor expanded in y around 0
Applied rewrites50.3%
(FPCore (x y) :precision binary64 (if (<= x 840000000000.0) (* (* 2.0 y) 0.5) (* (- (+ 1.0 y) (- 1.0 y)) 0.5)))
double code(double x, double y) {
double tmp;
if (x <= 840000000000.0) {
tmp = (2.0 * y) * 0.5;
} else {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 840000000000.0d0) then
tmp = (2.0d0 * y) * 0.5d0
else
tmp = ((1.0d0 + y) - (1.0d0 - y)) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 840000000000.0) {
tmp = (2.0 * y) * 0.5;
} else {
tmp = ((1.0 + y) - (1.0 - y)) * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 840000000000.0: tmp = (2.0 * y) * 0.5 else: tmp = ((1.0 + y) - (1.0 - y)) * 0.5 return tmp
function code(x, y) tmp = 0.0 if (x <= 840000000000.0) tmp = Float64(Float64(2.0 * y) * 0.5); else tmp = Float64(Float64(Float64(1.0 + y) - Float64(1.0 - y)) * 0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 840000000000.0) tmp = (2.0 * y) * 0.5; else tmp = ((1.0 + y) - (1.0 - y)) * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 840000000000.0], N[(N[(2.0 * y), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(1.0 + y), $MachinePrecision] - N[(1.0 - y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 840000000000:\\
\;\;\;\;\left(2 \cdot y\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + y\right) - \left(1 - y\right)\right) \cdot 0.5\\
\end{array}
\end{array}
if x < 8.4e11Initial program 84.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6452.4
Applied rewrites52.4%
Taylor expanded in y around 0
Applied rewrites36.0%
if 8.4e11 < x Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6458.5
Applied rewrites58.5%
Taylor expanded in y around 0
Applied rewrites48.0%
Taylor expanded in y around 0
Applied rewrites39.0%
(FPCore (x y) :precision binary64 (* (* 2.0 y) 0.5))
double code(double x, double y) {
return (2.0 * y) * 0.5;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (2.0d0 * y) * 0.5d0
end function
public static double code(double x, double y) {
return (2.0 * y) * 0.5;
}
def code(x, y): return (2.0 * y) * 0.5
function code(x, y) return Float64(Float64(2.0 * y) * 0.5) end
function tmp = code(x, y) tmp = (2.0 * y) * 0.5; end
code[x_, y_] := N[(N[(2.0 * y), $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot y\right) \cdot 0.5
\end{array}
Initial program 88.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6453.9
Applied rewrites53.9%
Taylor expanded in y around 0
Applied rewrites28.3%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
return sin(x) * (sinh(y) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / x)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / x); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{x}
\end{array}
herbie shell --seed 2024313
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (* (sin x) (/ (sinh y) x)))
(/ (* (sin x) (sinh y)) x))