
(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 23 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(Float64(sinh(y) / x) * sin(x)) end
function tmp = code(x, y) tmp = (sinh(y) / x) * sin(x); end
code[x_, y_] := N[(N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sinh y}{x} \cdot \sin x
\end{array}
Initial program 87.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)))
(if (<= t_0 (- INFINITY))
(/
(*
(fma (* x x) -0.16666666666666666 1.0)
(* (fma 0.16666666666666666 (* y y) 1.0) (* y x)))
x)
(if (<= t_0 0.001)
(*
(sin x)
(/
(fma
(fma y (* y 0.008333333333333333) 0.16666666666666666)
(* y (* y y))
y)
x))
(* 0.5 (- (exp y) (exp (- y))))))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma((x * x), -0.16666666666666666, 1.0) * (fma(0.16666666666666666, (y * y), 1.0) * (y * x))) / x;
} else if (t_0 <= 0.001) {
tmp = sin(x) * (fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y) / x);
} else {
tmp = 0.5 * (exp(y) - exp(-y));
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(Float64(x * x), -0.16666666666666666, 1.0) * Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * Float64(y * x))) / x); elseif (t_0 <= 0.001) tmp = Float64(sin(x) * Float64(fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y) / x)); else tmp = Float64(0.5 * Float64(exp(y) - exp(Float64(-y)))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(N[(x * x), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 0.001], N[(N[Sin[x], $MachinePrecision] * N[(N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Exp[y], $MachinePrecision] - N[Exp[(-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot x, -0.16666666666666666, 1\right) \cdot \left(\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \left(y \cdot x\right)\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 0.001:\\
\;\;\;\;\sin x \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(e^{y} - e^{-y}\right)\\
\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
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in x around 0
Applied rewrites67.2%
Taylor expanded in x around 0
Applied rewrites60.4%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1e-3Initial program 75.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6498.4
Applied rewrites98.4%
if 1e-3 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6475.4
Applied rewrites75.4%
Final simplification83.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)))
(if (<= t_0 (- INFINITY))
(/
(*
(fma (* x x) -0.16666666666666666 1.0)
(* (fma 0.16666666666666666 (* y y) 1.0) (* y x)))
x)
(if (<= t_0 5e-8)
(*
(sin x)
(/
(fma
(fma y (* y 0.008333333333333333) 0.16666666666666666)
(* y (* y y))
y)
x))
(/
(*
(sinh y)
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x (* x x))
x))
x)))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma((x * x), -0.16666666666666666, 1.0) * (fma(0.16666666666666666, (y * y), 1.0) * (y * x))) / x;
} else if (t_0 <= 5e-8) {
tmp = sin(x) * (fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y) / x);
} else {
tmp = (sinh(y) * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * (x * x)), x)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(Float64(x * x), -0.16666666666666666, 1.0) * Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * Float64(y * x))) / x); elseif (t_0 <= 5e-8) tmp = Float64(sin(x) * Float64(fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y) / x)); else tmp = Float64(Float64(sinh(y) * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * Float64(x * x)), x)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(N[(x * x), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 5e-8], N[(N[Sin[x], $MachinePrecision] * N[(N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sinh[y], $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot x, -0.16666666666666666, 1\right) \cdot \left(\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \left(y \cdot x\right)\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\sin x \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sinh y \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right)}{x}\\
\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
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in x around 0
Applied rewrites67.2%
Taylor expanded in x around 0
Applied rewrites60.4%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 4.9999999999999998e-8Initial program 75.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6498.4
Applied rewrites98.4%
if 4.9999999999999998e-8 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6475.4
Applied rewrites75.4%
Final simplification83.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)))
(if (<= t_0 (- INFINITY))
(/
(*
(fma (* x x) -0.16666666666666666 1.0)
(* (fma 0.16666666666666666 (* y y) 1.0) (* y x)))
x)
(if (<= t_0 1e-21)
(* (/ (sin x) x) (fma (* y y) (* y 0.16666666666666666) y))
(/
(*
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x (* x x))
x)
(fma
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666)
(* y (* y y))
y))
x)))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma((x * x), -0.16666666666666666, 1.0) * (fma(0.16666666666666666, (y * y), 1.0) * (y * x))) / x;
} else if (t_0 <= 1e-21) {
tmp = (sin(x) / x) * fma((y * y), (y * 0.16666666666666666), y);
} else {
tmp = (fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * (x * x)), x) * fma(fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), (y * (y * y)), y)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(Float64(x * x), -0.16666666666666666, 1.0) * Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * Float64(y * x))) / x); elseif (t_0 <= 1e-21) tmp = Float64(Float64(sin(x) / x) * fma(Float64(y * y), Float64(y * 0.16666666666666666), y)); else tmp = Float64(Float64(fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), Float64(y * Float64(y * y)), y)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(N[(x * x), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 1e-21], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(y * 0.16666666666666666), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot x, -0.16666666666666666, 1\right) \cdot \left(\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \left(y \cdot x\right)\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{-21}:\\
\;\;\;\;\frac{\sin x}{x} \cdot \mathsf{fma}\left(y \cdot y, y \cdot 0.16666666666666666, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\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
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in x around 0
Applied rewrites67.2%
Taylor expanded in x around 0
Applied rewrites60.4%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.99999999999999908e-22Initial program 74.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/l*N/A
distribute-rgt-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
Applied rewrites98.2%
if 9.99999999999999908e-22 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.4
Applied rewrites76.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.5
Applied rewrites58.5%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.8%
Final simplification82.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sinh y) (sin x)) x)))
(if (<= t_0 (- INFINITY))
(/
(*
(fma (* x x) -0.16666666666666666 1.0)
(* (fma 0.16666666666666666 (* y y) 1.0) (* y x)))
x)
(if (<= t_0 1e-21)
(* y (/ (sin x) x))
(/
(*
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x (* x x))
x)
(fma
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666)
(* y (* y y))
y))
x)))))
double code(double x, double y) {
double t_0 = (sinh(y) * sin(x)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (fma((x * x), -0.16666666666666666, 1.0) * (fma(0.16666666666666666, (y * y), 1.0) * (y * x))) / x;
} else if (t_0 <= 1e-21) {
tmp = y * (sin(x) / x);
} else {
tmp = (fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * (x * x)), x) * fma(fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), (y * (y * y)), y)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sinh(y) * sin(x)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(fma(Float64(x * x), -0.16666666666666666, 1.0) * Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * Float64(y * x))) / x); elseif (t_0 <= 1e-21) tmp = Float64(y * Float64(sin(x) / x)); else tmp = Float64(Float64(fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), Float64(y * Float64(y * y)), y)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(N[(x * x), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 1e-21], N[(y * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y \cdot \sin x}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot x, -0.16666666666666666, 1\right) \cdot \left(\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot \left(y \cdot x\right)\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{-21}:\\
\;\;\;\;y \cdot \frac{\sin x}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\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
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in x around 0
Applied rewrites67.2%
Taylor expanded in x around 0
Applied rewrites60.4%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.99999999999999908e-22Initial program 74.4%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6496.8
Applied rewrites96.8%
if 9.99999999999999908e-22 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.4
Applied rewrites76.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.5
Applied rewrites58.5%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.8%
Final simplification81.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y y))))
(if (<= (/ (* (sinh y) (sin x)) x) 1e-21)
(*
(/ (fma (fma y (* y 0.008333333333333333) 0.16666666666666666) t_0 y) x)
(fma x (* (* x x) -0.16666666666666666) x))
(/
(*
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x (* x x))
x)
(fma
(fma
y
(* y (fma (* y y) 0.0001984126984126984 0.008333333333333333))
0.16666666666666666)
t_0
y))
x))))
double code(double x, double y) {
double t_0 = y * (y * y);
double tmp;
if (((sinh(y) * sin(x)) / x) <= 1e-21) {
tmp = (fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), t_0, y) / x) * fma(x, ((x * x) * -0.16666666666666666), x);
} else {
tmp = (fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * (x * x)), x) * fma(fma(y, (y * fma((y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), t_0, y)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(y * Float64(y * y)) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 1e-21) tmp = Float64(Float64(fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), t_0, y) / x) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(Float64(fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * Float64(x * x)), x) * fma(fma(y, Float64(y * fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333)), 0.16666666666666666), t_0, y)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 1e-21], N[(N[(N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * t$95$0 + y), $MachinePrecision] / x), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * N[(N[(y * N[(y * N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * t$95$0 + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot y\right)\\
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 10^{-21}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), t\_0, y\right)}{x} \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot \mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), 0.16666666666666666\right), t\_0, y\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.99999999999999908e-22Initial program 82.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6495.3
Applied rewrites95.3%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6456.9
Applied rewrites56.9%
if 9.99999999999999908e-22 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.4
Applied rewrites76.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.5
Applied rewrites58.5%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.8%
Final simplification60.6%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
(fma y (* y 0.008333333333333333) 0.16666666666666666)
(* y (* y y))
y)))
(if (<= (/ (* (sinh y) (sin x)) x) 1e-21)
(* (/ t_0 x) (fma x (* (* x x) -0.16666666666666666) x))
(/
(*
t_0
(fma
(fma (* x x) 0.008333333333333333 -0.16666666666666666)
(* x (* x x))
x))
x))))
double code(double x, double y) {
double t_0 = fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y);
double tmp;
if (((sinh(y) * sin(x)) / x) <= 1e-21) {
tmp = (t_0 / x) * fma(x, ((x * x) * -0.16666666666666666), x);
} else {
tmp = (t_0 * fma(fma((x * x), 0.008333333333333333, -0.16666666666666666), (x * (x * x)), x)) / x;
}
return tmp;
}
function code(x, y) t_0 = fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 1e-21) tmp = Float64(Float64(t_0 / x) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(Float64(t_0 * fma(fma(Float64(x * x), 0.008333333333333333, -0.16666666666666666), Float64(x * Float64(x * x)), x)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 1e-21], N[(N[(t$95$0 / x), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[(N[(x * x), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)\\
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 10^{-21}:\\
\;\;\;\;\frac{t\_0}{x} \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot \mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, 0.008333333333333333, -0.16666666666666666\right), x \cdot \left(x \cdot x\right), x\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.99999999999999908e-22Initial program 82.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6495.3
Applied rewrites95.3%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6456.9
Applied rewrites56.9%
if 9.99999999999999908e-22 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.4
Applied rewrites76.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.1
Applied rewrites68.1%
Final simplification59.8%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sinh y) (sin x)) x) 3e-19)
(*
y
(fma
x
(*
x
(fma
(* x x)
(fma (* x x) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666))
1.0))
(/ (fma (* x (* y (* y 0.16666666666666666))) y (* y x)) x)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 3e-19) {
tmp = y * fma(x, (x * fma((x * x), fma((x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666)), 1.0);
} else {
tmp = fma((x * (y * (y * 0.16666666666666666))), y, (y * x)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 3e-19) tmp = Float64(y * fma(x, Float64(x * fma(Float64(x * x), fma(Float64(x * x), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666)), 1.0)); else tmp = Float64(fma(Float64(x * Float64(y * Float64(y * 0.16666666666666666))), y, Float64(y * x)) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 3e-19], N[(y * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(y * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 3 \cdot 10^{-19}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right), y, y \cdot x\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.99999999999999993e-19Initial program 82.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6467.7
Applied rewrites67.7%
Taylor expanded in x around 0
Applied rewrites38.6%
Taylor expanded in x around 0
Applied rewrites43.0%
if 2.99999999999999993e-19 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6468.2
Applied rewrites68.2%
Taylor expanded in x around 0
Applied rewrites54.4%
Applied rewrites54.4%
Final simplification45.9%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) 3e-19) (* (fma x (* (* x x) -0.16666666666666666) x) (* y (/ 1.0 x))) (/ (fma (* x (* y (* y 0.16666666666666666))) y (* y x)) x)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 3e-19) {
tmp = fma(x, ((x * x) * -0.16666666666666666), x) * (y * (1.0 / x));
} else {
tmp = fma((x * (y * (y * 0.16666666666666666))), y, (y * x)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 3e-19) tmp = Float64(fma(x, Float64(Float64(x * x) * -0.16666666666666666), x) * Float64(y * Float64(1.0 / x))); else tmp = Float64(fma(Float64(x * Float64(y * Float64(y * 0.16666666666666666))), y, Float64(y * x)) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 3e-19], N[(N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(y * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 3 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right) \cdot \left(y \cdot \frac{1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right), y, y \cdot x\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.99999999999999993e-19Initial program 82.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6467.7
Applied rewrites67.7%
Applied rewrites74.9%
Taylor expanded in x around 0
Applied rewrites50.4%
if 2.99999999999999993e-19 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6468.2
Applied rewrites68.2%
Taylor expanded in x around 0
Applied rewrites54.4%
Applied rewrites54.4%
Final simplification51.4%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) 3e-19) (* (fma x (* (* x x) -0.16666666666666666) x) (* y (/ 1.0 x))) (/ (* x (fma y (* 0.16666666666666666 (* y y)) y)) x)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 3e-19) {
tmp = fma(x, ((x * x) * -0.16666666666666666), x) * (y * (1.0 / x));
} else {
tmp = (x * fma(y, (0.16666666666666666 * (y * y)), y)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 3e-19) tmp = Float64(fma(x, Float64(Float64(x * x) * -0.16666666666666666), x) * Float64(y * Float64(1.0 / x))); else tmp = Float64(Float64(x * fma(y, Float64(0.16666666666666666 * Float64(y * y)), y)) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 3e-19], N[(N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision] * N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 3 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right) \cdot \left(y \cdot \frac{1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(y, 0.16666666666666666 \cdot \left(y \cdot y\right), y\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.99999999999999993e-19Initial program 82.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6467.7
Applied rewrites67.7%
Applied rewrites74.9%
Taylor expanded in x around 0
Applied rewrites50.4%
if 2.99999999999999993e-19 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6468.2
Applied rewrites68.2%
Taylor expanded in x around 0
Applied rewrites54.4%
Final simplification51.4%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) 3e-19) (* y (/ (fma x (* (* x x) -0.16666666666666666) x) x)) (/ (* x (fma y (* 0.16666666666666666 (* y y)) y)) x)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 3e-19) {
tmp = y * (fma(x, ((x * x) * -0.16666666666666666), x) / x);
} else {
tmp = (x * fma(y, (0.16666666666666666 * (y * y)), y)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 3e-19) tmp = Float64(y * Float64(fma(x, Float64(Float64(x * x) * -0.16666666666666666), x) / x)); else tmp = Float64(Float64(x * fma(y, Float64(0.16666666666666666 * Float64(y * y)), y)) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 3e-19], N[(y * N[(N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 3 \cdot 10^{-19}:\\
\;\;\;\;y \cdot \frac{\mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(y, 0.16666666666666666 \cdot \left(y \cdot y\right), y\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.99999999999999993e-19Initial program 82.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6467.7
Applied rewrites67.7%
Taylor expanded in x around 0
Applied rewrites42.4%
if 2.99999999999999993e-19 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6468.2
Applied rewrites68.2%
Taylor expanded in x around 0
Applied rewrites54.4%
Final simplification45.5%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) 0.001) (* y (/ (fma x (* (* x x) -0.16666666666666666) x) x)) (/ (* (* y (* y y)) (* x 0.16666666666666666)) x)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 0.001) {
tmp = y * (fma(x, ((x * x) * -0.16666666666666666), x) / x);
} else {
tmp = ((y * (y * y)) * (x * 0.16666666666666666)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 0.001) tmp = Float64(y * Float64(fma(x, Float64(Float64(x * x) * -0.16666666666666666), x) / x)); else tmp = Float64(Float64(Float64(y * Float64(y * y)) * Float64(x * 0.16666666666666666)) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.001], N[(y * N[(N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 0.001:\\
\;\;\;\;y \cdot \frac{\mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1e-3Initial program 82.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6467.9
Applied rewrites67.9%
Taylor expanded in x around 0
Applied rewrites42.7%
if 1e-3 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6467.7
Applied rewrites67.7%
Taylor expanded in x around 0
Applied rewrites53.7%
Taylor expanded in y around inf
Applied rewrites53.7%
Final simplification45.5%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) 0.001) (fma (* y x) (* x -0.16666666666666666) y) (/ (* (* y (* y y)) (* x 0.16666666666666666)) x)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 0.001) {
tmp = fma((y * x), (x * -0.16666666666666666), y);
} else {
tmp = ((y * (y * y)) * (x * 0.16666666666666666)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 0.001) tmp = fma(Float64(y * x), Float64(x * -0.16666666666666666), y); else tmp = Float64(Float64(Float64(y * Float64(y * y)) * Float64(x * 0.16666666666666666)) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.001], N[(N[(y * x), $MachinePrecision] * N[(x * -0.16666666666666666), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 0.001:\\
\;\;\;\;\mathsf{fma}\left(y \cdot x, x \cdot -0.16666666666666666, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1e-3Initial program 82.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6467.9
Applied rewrites67.9%
Applied rewrites75.0%
Taylor expanded in x around 0
Applied rewrites42.8%
Applied rewrites42.8%
if 1e-3 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6467.7
Applied rewrites67.7%
Taylor expanded in x around 0
Applied rewrites53.7%
Taylor expanded in y around inf
Applied rewrites53.7%
Final simplification45.6%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sinh y) (sin x)) x) 0.0)
(fma (* y x) (* x -0.16666666666666666) y)
(*
y
(fma
(* x x)
(fma 0.008333333333333333 (* x x) -0.16666666666666666)
1.0))))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 0.0) {
tmp = fma((y * x), (x * -0.16666666666666666), y);
} else {
tmp = y * fma((x * x), fma(0.008333333333333333, (x * x), -0.16666666666666666), 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 0.0) tmp = fma(Float64(y * x), Float64(x * -0.16666666666666666), y); else tmp = Float64(y * fma(Float64(x * x), fma(0.008333333333333333, Float64(x * x), -0.16666666666666666), 1.0)); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0], N[(N[(y * x), $MachinePrecision] * N[(x * -0.16666666666666666), $MachinePrecision] + y), $MachinePrecision], N[(y * N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 0:\\
\;\;\;\;\mathsf{fma}\left(y \cdot x, x \cdot -0.16666666666666666, y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), 1\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 0.0Initial program 79.3%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6460.3
Applied rewrites60.3%
Applied rewrites69.2%
Taylor expanded in x around 0
Applied rewrites38.1%
Applied rewrites38.2%
if 0.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 98.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6439.4
Applied rewrites39.4%
Taylor expanded in x around 0
Applied rewrites34.5%
Final simplification36.7%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) 3e-19) (fma (* y x) (* x -0.16666666666666666) y) (/ (* y x) x)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= 3e-19) {
tmp = fma((y * x), (x * -0.16666666666666666), y);
} else {
tmp = (y * x) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= 3e-19) tmp = fma(Float64(y * x), Float64(x * -0.16666666666666666), y); else tmp = Float64(Float64(y * x) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 3e-19], N[(N[(y * x), $MachinePrecision] * N[(x * -0.16666666666666666), $MachinePrecision] + y), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq 3 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot x, x \cdot -0.16666666666666666, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2.99999999999999993e-19Initial program 82.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6467.7
Applied rewrites67.7%
Applied rewrites74.9%
Taylor expanded in x around 0
Applied rewrites42.5%
Applied rewrites42.5%
if 2.99999999999999993e-19 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6468.2
Applied rewrites68.2%
Taylor expanded in x around 0
Applied rewrites54.4%
Taylor expanded in y around 0
Applied rewrites14.3%
Final simplification35.3%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sinh y) (sin x)) x) -4e-199) (* y (* (* x x) -0.16666666666666666)) (* y 1.0)))
double code(double x, double y) {
double tmp;
if (((sinh(y) * sin(x)) / x) <= -4e-199) {
tmp = y * ((x * x) * -0.16666666666666666);
} else {
tmp = y * 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (((sinh(y) * sin(x)) / x) <= (-4d-199)) then
tmp = y * ((x * x) * (-0.16666666666666666d0))
else
tmp = y * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (((Math.sinh(y) * Math.sin(x)) / x) <= -4e-199) {
tmp = y * ((x * x) * -0.16666666666666666);
} else {
tmp = y * 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if ((math.sinh(y) * math.sin(x)) / x) <= -4e-199: tmp = y * ((x * x) * -0.16666666666666666) else: tmp = y * 1.0 return tmp
function code(x, y) tmp = 0.0 if (Float64(Float64(sinh(y) * sin(x)) / x) <= -4e-199) tmp = Float64(y * Float64(Float64(x * x) * -0.16666666666666666)); else tmp = Float64(y * 1.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((sinh(y) * sin(x)) / x) <= -4e-199) tmp = y * ((x * x) * -0.16666666666666666); else tmp = y * 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -4e-199], N[(y * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(y * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y \cdot \sin x}{x} \leq -4 \cdot 10^{-199}:\\
\;\;\;\;y \cdot \left(\left(x \cdot x\right) \cdot -0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 1\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -3.99999999999999993e-199Initial program 98.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6425.5
Applied rewrites25.5%
Applied rewrites42.7%
Taylor expanded in x around 0
Applied rewrites25.3%
Taylor expanded in x around inf
Applied rewrites13.9%
if -3.99999999999999993e-199 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 81.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6464.1
Applied rewrites64.1%
Taylor expanded in x around 0
Applied rewrites37.8%
Final simplification30.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (fma y (* y 0.008333333333333333) 0.16666666666666666)))
(if (<= y 0.38)
(* (sin x) (/ (fma t_0 (* y (* y y)) y) x))
(if (<= y 4.8e+53)
(/ (* (sinh y) (fma x (* (* x x) -0.16666666666666666) x)) x)
(/ (* y (* (sin x) (fma (* y y) t_0 1.0))) x)))))
double code(double x, double y) {
double t_0 = fma(y, (y * 0.008333333333333333), 0.16666666666666666);
double tmp;
if (y <= 0.38) {
tmp = sin(x) * (fma(t_0, (y * (y * y)), y) / x);
} else if (y <= 4.8e+53) {
tmp = (sinh(y) * fma(x, ((x * x) * -0.16666666666666666), x)) / x;
} else {
tmp = (y * (sin(x) * fma((y * y), t_0, 1.0))) / x;
}
return tmp;
}
function code(x, y) t_0 = fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666) tmp = 0.0 if (y <= 0.38) tmp = Float64(sin(x) * Float64(fma(t_0, Float64(y * Float64(y * y)), y) / x)); elseif (y <= 4.8e+53) tmp = Float64(Float64(sinh(y) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)) / x); else tmp = Float64(Float64(y * Float64(sin(x) * fma(Float64(y * y), t_0, 1.0))) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]}, If[LessEqual[y, 0.38], N[(N[Sin[x], $MachinePrecision] * N[(N[(t$95$0 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+53], N[(N[(N[Sinh[y], $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(y * N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right)\\
\mathbf{if}\;y \leq 0.38:\\
\;\;\;\;\sin x \cdot \frac{\mathsf{fma}\left(t\_0, y \cdot \left(y \cdot y\right), y\right)}{x}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+53}:\\
\;\;\;\;\frac{\sinh y \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(\sin x \cdot \mathsf{fma}\left(y \cdot y, t\_0, 1\right)\right)}{x}\\
\end{array}
\end{array}
if y < 0.38Initial program 83.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6494.9
Applied rewrites94.9%
if 0.38 < y < 4.8e53Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
if 4.8e53 < y Initial program 100.0%
Taylor expanded in y around 0
lower-*.f64N/A
*-rgt-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
Applied rewrites98.1%
Final simplification94.6%
(FPCore (x y)
:precision binary64
(let* ((t_0
(*
(sin x)
(/
(fma
(fma y (* y 0.008333333333333333) 0.16666666666666666)
(* y (* y y))
y)
x))))
(if (<= y 0.38)
t_0
(if (<= y 4.8e+53)
(/ (* (sinh y) (fma x (* (* x x) -0.16666666666666666) x)) x)
t_0))))
double code(double x, double y) {
double t_0 = sin(x) * (fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), (y * (y * y)), y) / x);
double tmp;
if (y <= 0.38) {
tmp = t_0;
} else if (y <= 4.8e+53) {
tmp = (sinh(y) * fma(x, ((x * x) * -0.16666666666666666), x)) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(x) * Float64(fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), Float64(y * Float64(y * y)), y) / x)) tmp = 0.0 if (y <= 0.38) tmp = t_0; elseif (y <= 4.8e+53) tmp = Float64(Float64(sinh(y) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)) / x); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.38], t$95$0, If[LessEqual[y, 4.8e+53], N[(N[(N[Sinh[y], $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), y \cdot \left(y \cdot y\right), y\right)}{x}\\
\mathbf{if}\;y \leq 0.38:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+53}:\\
\;\;\;\;\frac{\sinh y \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 0.38 or 4.8e53 < y Initial program 86.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6495.6
Applied rewrites95.6%
if 0.38 < y < 4.8e53Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
Final simplification94.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y y))))
(if (<= x 6e+14)
(*
(/ (fma (fma y (* y 0.008333333333333333) 0.16666666666666666) t_0 y) x)
(fma x (* (* x x) -0.16666666666666666) x))
(/ (/ 1.0 (/ (+ (/ 6.0 x) (/ -36.0 (* y (* y x)))) t_0)) x))))
double code(double x, double y) {
double t_0 = y * (y * y);
double tmp;
if (x <= 6e+14) {
tmp = (fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), t_0, y) / x) * fma(x, ((x * x) * -0.16666666666666666), x);
} else {
tmp = (1.0 / (((6.0 / x) + (-36.0 / (y * (y * x)))) / t_0)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(y * Float64(y * y)) tmp = 0.0 if (x <= 6e+14) tmp = Float64(Float64(fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), t_0, y) / x) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(Float64(1.0 / Float64(Float64(Float64(6.0 / x) + Float64(-36.0 / Float64(y * Float64(y * x)))) / t_0)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 6e+14], N[(N[(N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * t$95$0 + y), $MachinePrecision] / x), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(N[(6.0 / x), $MachinePrecision] + N[(-36.0 / N[(y * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot y\right)\\
\mathbf{if}\;x \leq 6 \cdot 10^{+14}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), t\_0, y\right)}{x} \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{\frac{6}{x} + \frac{-36}{y \cdot \left(y \cdot x\right)}}{t\_0}}}{x}\\
\end{array}
\end{array}
if x < 6e14Initial program 83.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6493.5
Applied rewrites93.5%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.6
Applied rewrites73.6%
if 6e14 < x Initial program 99.8%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6486.8
Applied rewrites86.8%
Taylor expanded in x around 0
Applied rewrites24.4%
Applied rewrites19.6%
Taylor expanded in y around inf
Applied rewrites47.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y y))))
(if (<= x 1.9e+62)
(*
(/ (fma (fma y (* y 0.008333333333333333) 0.16666666666666666) t_0 y) x)
(fma x (* (* x x) -0.16666666666666666) x))
(/ (* t_0 (* x 0.16666666666666666)) x))))
double code(double x, double y) {
double t_0 = y * (y * y);
double tmp;
if (x <= 1.9e+62) {
tmp = (fma(fma(y, (y * 0.008333333333333333), 0.16666666666666666), t_0, y) / x) * fma(x, ((x * x) * -0.16666666666666666), x);
} else {
tmp = (t_0 * (x * 0.16666666666666666)) / x;
}
return tmp;
}
function code(x, y) t_0 = Float64(y * Float64(y * y)) tmp = 0.0 if (x <= 1.9e+62) tmp = Float64(Float64(fma(fma(y, Float64(y * 0.008333333333333333), 0.16666666666666666), t_0, y) / x) * fma(x, Float64(Float64(x * x) * -0.16666666666666666), x)); else tmp = Float64(Float64(t_0 * Float64(x * 0.16666666666666666)) / x); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.9e+62], N[(N[(N[(N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * t$95$0 + y), $MachinePrecision] / x), $MachinePrecision] * N[(x * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot y\right)\\
\mathbf{if}\;x \leq 1.9 \cdot 10^{+62}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y, y \cdot 0.008333333333333333, 0.16666666666666666\right), t\_0, y\right)}{x} \cdot \mathsf{fma}\left(x, \left(x \cdot x\right) \cdot -0.16666666666666666, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot \left(x \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if x < 1.89999999999999992e62Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6493.9
Applied rewrites93.9%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.9
Applied rewrites70.9%
if 1.89999999999999992e62 < x Initial program 99.8%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6485.5
Applied rewrites85.5%
Taylor expanded in x around 0
Applied rewrites27.5%
Taylor expanded in y around inf
Applied rewrites48.6%
(FPCore (x y) :precision binary64 (fma (* y x) (* x -0.16666666666666666) y))
double code(double x, double y) {
return fma((y * x), (x * -0.16666666666666666), y);
}
function code(x, y) return fma(Float64(y * x), Float64(x * -0.16666666666666666), y) end
code[x_, y_] := N[(N[(y * x), $MachinePrecision] * N[(x * -0.16666666666666666), $MachinePrecision] + y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y \cdot x, x \cdot -0.16666666666666666, y\right)
\end{array}
Initial program 87.2%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
Applied rewrites64.4%
Taylor expanded in x around 0
Applied rewrites37.6%
Applied rewrites37.6%
(FPCore (x y) :precision binary64 (fma y (* (* x x) -0.16666666666666666) y))
double code(double x, double y) {
return fma(y, ((x * x) * -0.16666666666666666), y);
}
function code(x, y) return fma(y, Float64(Float64(x * x) * -0.16666666666666666), y) end
code[x_, y_] := N[(y * N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \left(x \cdot x\right) \cdot -0.16666666666666666, y\right)
\end{array}
Initial program 87.2%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
Taylor expanded in x around 0
Applied rewrites37.6%
(FPCore (x y) :precision binary64 (* y 1.0))
double code(double x, double y) {
return y * 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y * 1.0d0
end function
public static double code(double x, double y) {
return y * 1.0;
}
def code(x, y): return y * 1.0
function code(x, y) return Float64(y * 1.0) end
function tmp = code(x, y) tmp = y * 1.0; end
code[x_, y_] := N[(y * 1.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 1
\end{array}
Initial program 87.2%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
Taylor expanded in x around 0
Applied rewrites30.2%
(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 2024221
(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))