
(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 18 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 87.6%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.9%
Applied egg-rr99.9%
(FPCore (x y) :precision binary64 (if (<= (sinh y) 1e-7) (* (sin x) (/ y x)) (sinh y)))
double code(double x, double y) {
double tmp;
if (sinh(y) <= 1e-7) {
tmp = sin(x) * (y / x);
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= 1d-7) then
tmp = sin(x) * (y / x)
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= 1e-7) {
tmp = Math.sin(x) * (y / x);
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= 1e-7: tmp = math.sin(x) * (y / x) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= 1e-7) tmp = Float64(sin(x) * Float64(y / x)); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= 1e-7) tmp = sin(x) * (y / x); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], 1e-7], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq 10^{-7}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < 9.9999999999999995e-8Initial program 83.5%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in y around 0
/-lowering-/.f6477.5%
Simplified77.5%
if 9.9999999999999995e-8 < (sinh.f64 y) Initial program 100.0%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
Simplified79.4%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
sinh-lowering-sinh.f6479.4%
Applied egg-rr79.4%
(FPCore (x y) :precision binary64 (if (<= (sinh y) 1e-7) (/ y (+ 1.0 (* x (* x 0.16666666666666666)))) (sinh y)))
double code(double x, double y) {
double tmp;
if (sinh(y) <= 1e-7) {
tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= 1d-7) then
tmp = y / (1.0d0 + (x * (x * 0.16666666666666666d0)))
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= 1e-7) {
tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= 1e-7: tmp = y / (1.0 + (x * (x * 0.16666666666666666))) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= 1e-7) tmp = Float64(y / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666)))); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= 1e-7) tmp = y / (1.0 + (x * (x * 0.16666666666666666))); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], 1e-7], N[(y / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq 10^{-7}:\\
\;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < 9.9999999999999995e-8Initial program 83.5%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
Simplified69.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6453.5%
Simplified53.5%
if 9.9999999999999995e-8 < (sinh.f64 y) Initial program 100.0%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
Simplified79.4%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
sinh-lowering-sinh.f6479.4%
Applied egg-rr79.4%
(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}
Initial program 87.6%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
(FPCore (x y)
:precision binary64
(if (<= y 9.2e-7)
(* y (* (+ 1.0 (* 0.16666666666666666 (* y y))) (/ (sin x) x)))
(if (<= y 1.15e+62)
(sinh y)
(/
(*
y
(*
(sin x)
(+
1.0
(*
y
(* y (+ 0.16666666666666666 (* (* y y) 0.008333333333333333)))))))
x))))
double code(double x, double y) {
double tmp;
if (y <= 9.2e-7) {
tmp = y * ((1.0 + (0.16666666666666666 * (y * y))) * (sin(x) / x));
} else if (y <= 1.15e+62) {
tmp = sinh(y);
} else {
tmp = (y * (sin(x) * (1.0 + (y * (y * (0.16666666666666666 + ((y * y) * 0.008333333333333333))))))) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 9.2d-7) then
tmp = y * ((1.0d0 + (0.16666666666666666d0 * (y * y))) * (sin(x) / x))
else if (y <= 1.15d+62) then
tmp = sinh(y)
else
tmp = (y * (sin(x) * (1.0d0 + (y * (y * (0.16666666666666666d0 + ((y * y) * 0.008333333333333333d0))))))) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 9.2e-7) {
tmp = y * ((1.0 + (0.16666666666666666 * (y * y))) * (Math.sin(x) / x));
} else if (y <= 1.15e+62) {
tmp = Math.sinh(y);
} else {
tmp = (y * (Math.sin(x) * (1.0 + (y * (y * (0.16666666666666666 + ((y * y) * 0.008333333333333333))))))) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 9.2e-7: tmp = y * ((1.0 + (0.16666666666666666 * (y * y))) * (math.sin(x) / x)) elif y <= 1.15e+62: tmp = math.sinh(y) else: tmp = (y * (math.sin(x) * (1.0 + (y * (y * (0.16666666666666666 + ((y * y) * 0.008333333333333333))))))) / x return tmp
function code(x, y) tmp = 0.0 if (y <= 9.2e-7) tmp = Float64(y * Float64(Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) * Float64(sin(x) / x))); elseif (y <= 1.15e+62) tmp = sinh(y); else tmp = Float64(Float64(y * Float64(sin(x) * Float64(1.0 + Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(y * y) * 0.008333333333333333))))))) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 9.2e-7) tmp = y * ((1.0 + (0.16666666666666666 * (y * y))) * (sin(x) / x)); elseif (y <= 1.15e+62) tmp = sinh(y); else tmp = (y * (sin(x) * (1.0 + (y * (y * (0.16666666666666666 + ((y * y) * 0.008333333333333333))))))) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 9.2e-7], N[(y * N[(N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+62], N[Sinh[y], $MachinePrecision], N[(N[(y * N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(y * N[(y * N[(0.16666666666666666 + N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;y \cdot \left(\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \frac{\sin x}{x}\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+62}:\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(\sin x \cdot \left(1 + y \cdot \left(y \cdot \left(0.16666666666666666 + \left(y \cdot y\right) \cdot 0.008333333333333333\right)\right)\right)\right)}{x}\\
\end{array}
\end{array}
if y < 9.1999999999999998e-7Initial program 83.5%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in y around 0
distribute-lft-inN/A
fma-defineN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified87.0%
if 9.1999999999999998e-7 < y < 1.14999999999999992e62Initial program 99.9%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
Simplified87.5%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
sinh-lowering-sinh.f6487.5%
Applied egg-rr87.5%
if 1.14999999999999992e62 < y Initial program 100.0%
Taylor expanded in y around 0
*-lowering-*.f64N/A
*-rgt-identityN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
distribute-lft-inN/A
Simplified100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y)))))
(if (<= y 0.0064)
(* y (* t_0 (/ (sin x) x)))
(if (<= y 1.15e+103) (/ (* (sinh y) x) x) (/ (* y (* (sin x) t_0)) x)))))
double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (y <= 0.0064) {
tmp = y * (t_0 * (sin(x) / x));
} else if (y <= 1.15e+103) {
tmp = (sinh(y) * x) / x;
} else {
tmp = (y * (sin(x) * t_0)) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (0.16666666666666666d0 * (y * y))
if (y <= 0.0064d0) then
tmp = y * (t_0 * (sin(x) / x))
else if (y <= 1.15d+103) then
tmp = (sinh(y) * x) / x
else
tmp = (y * (sin(x) * t_0)) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (y <= 0.0064) {
tmp = y * (t_0 * (Math.sin(x) / x));
} else if (y <= 1.15e+103) {
tmp = (Math.sinh(y) * x) / x;
} else {
tmp = (y * (Math.sin(x) * t_0)) / x;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (0.16666666666666666 * (y * y)) tmp = 0 if y <= 0.0064: tmp = y * (t_0 * (math.sin(x) / x)) elif y <= 1.15e+103: tmp = (math.sinh(y) * x) / x else: tmp = (y * (math.sin(x) * t_0)) / x return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) tmp = 0.0 if (y <= 0.0064) tmp = Float64(y * Float64(t_0 * Float64(sin(x) / x))); elseif (y <= 1.15e+103) tmp = Float64(Float64(sinh(y) * x) / x); else tmp = Float64(Float64(y * Float64(sin(x) * t_0)) / x); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (0.16666666666666666 * (y * y)); tmp = 0.0; if (y <= 0.0064) tmp = y * (t_0 * (sin(x) / x)); elseif (y <= 1.15e+103) tmp = (sinh(y) * x) / x; else tmp = (y * (sin(x) * t_0)) / x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.0064], N[(y * N[(t$95$0 * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+103], N[(N[(N[Sinh[y], $MachinePrecision] * x), $MachinePrecision] / x), $MachinePrecision], N[(N[(y * N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 0.0064:\\
\;\;\;\;y \cdot \left(t\_0 \cdot \frac{\sin x}{x}\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+103}:\\
\;\;\;\;\frac{\sinh y \cdot x}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(\sin x \cdot t\_0\right)}{x}\\
\end{array}
\end{array}
if y < 0.00640000000000000031Initial program 83.7%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in y around 0
distribute-lft-inN/A
fma-defineN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified87.1%
if 0.00640000000000000031 < y < 1.15000000000000004e103Initial program 100.0%
Taylor expanded in x around 0
Simplified81.8%
if 1.15000000000000004e103 < y Initial program 100.0%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
distribute-lft-inN/A
fma-defineN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified87.9%
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
Final simplification88.6%
(FPCore (x y) :precision binary64 (let* ((t_0 (* y (* (+ 1.0 (* 0.16666666666666666 (* y y))) (/ (sin x) x))))) (if (<= y 9.2e-7) t_0 (if (<= y 2e+121) (sinh y) t_0))))
double code(double x, double y) {
double t_0 = y * ((1.0 + (0.16666666666666666 * (y * y))) * (sin(x) / x));
double tmp;
if (y <= 9.2e-7) {
tmp = t_0;
} else if (y <= 2e+121) {
tmp = sinh(y);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y * ((1.0d0 + (0.16666666666666666d0 * (y * y))) * (sin(x) / x))
if (y <= 9.2d-7) then
tmp = t_0
else if (y <= 2d+121) then
tmp = sinh(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * ((1.0 + (0.16666666666666666 * (y * y))) * (Math.sin(x) / x));
double tmp;
if (y <= 9.2e-7) {
tmp = t_0;
} else if (y <= 2e+121) {
tmp = Math.sinh(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * ((1.0 + (0.16666666666666666 * (y * y))) * (math.sin(x) / x)) tmp = 0 if y <= 9.2e-7: tmp = t_0 elif y <= 2e+121: tmp = math.sinh(y) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(y * Float64(Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) * Float64(sin(x) / x))) tmp = 0.0 if (y <= 9.2e-7) tmp = t_0; elseif (y <= 2e+121) tmp = sinh(y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = y * ((1.0 + (0.16666666666666666 * (y * y))) * (sin(x) / x)); tmp = 0.0; if (y <= 9.2e-7) tmp = t_0; elseif (y <= 2e+121) tmp = sinh(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9.2e-7], t$95$0, If[LessEqual[y, 2e+121], N[Sinh[y], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \frac{\sin x}{x}\right)\\
\mathbf{if}\;y \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+121}:\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 9.1999999999999998e-7 or 2.00000000000000007e121 < y Initial program 86.1%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in y around 0
distribute-lft-inN/A
fma-defineN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified88.2%
if 9.1999999999999998e-7 < y < 2.00000000000000007e121Initial program 99.9%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
Simplified78.6%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
sinh-lowering-sinh.f6478.6%
Applied egg-rr78.6%
(FPCore (x y) :precision binary64 (if (<= y 9.2e-7) (/ y (/ x (sin x))) (sinh y)))
double code(double x, double y) {
double tmp;
if (y <= 9.2e-7) {
tmp = y / (x / sin(x));
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 9.2d-7) then
tmp = y / (x / sin(x))
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 9.2e-7) {
tmp = y / (x / Math.sin(x));
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 9.2e-7: tmp = y / (x / math.sin(x)) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (y <= 9.2e-7) tmp = Float64(y / Float64(x / sin(x))); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 9.2e-7) tmp = y / (x / sin(x)); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 9.2e-7], N[(y / N[(x / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;\frac{y}{\frac{x}{\sin x}}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if y < 9.1999999999999998e-7Initial program 83.5%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
Simplified69.8%
if 9.1999999999999998e-7 < y Initial program 100.0%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
Simplified79.4%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
sinh-lowering-sinh.f6479.4%
Applied egg-rr79.4%
(FPCore (x y) :precision binary64 (* x (/ (sinh y) x)))
double code(double x, double y) {
return x * (sinh(y) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (sinh(y) / x)
end function
public static double code(double x, double y) {
return x * (Math.sinh(y) / x);
}
def code(x, y): return x * (math.sinh(y) / x)
function code(x, y) return Float64(x * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = x * (sinh(y) / x); end
code[x_, y_] := N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\sinh y}{x}
\end{array}
Initial program 87.6%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified75.6%
(FPCore (x y) :precision binary64 (if (<= y 4.8) (/ y (+ 1.0 (* x (* x 0.16666666666666666)))) (* x (/ (* y (* y (* y (* y (* y 0.008333333333333333))))) x))))
double code(double x, double y) {
double tmp;
if (y <= 4.8) {
tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
} else {
tmp = x * ((y * (y * (y * (y * (y * 0.008333333333333333))))) / x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.8d0) then
tmp = y / (1.0d0 + (x * (x * 0.16666666666666666d0)))
else
tmp = x * ((y * (y * (y * (y * (y * 0.008333333333333333d0))))) / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.8) {
tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
} else {
tmp = x * ((y * (y * (y * (y * (y * 0.008333333333333333))))) / x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.8: tmp = y / (1.0 + (x * (x * 0.16666666666666666))) else: tmp = x * ((y * (y * (y * (y * (y * 0.008333333333333333))))) / x) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.8) tmp = Float64(y / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666)))); else tmp = Float64(x * Float64(Float64(y * Float64(y * Float64(y * Float64(y * Float64(y * 0.008333333333333333))))) / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.8) tmp = y / (1.0 + (x * (x * 0.16666666666666666))); else tmp = x * ((y * (y * (y * (y * (y * 0.008333333333333333))))) / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.8], N[(y / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * N[(y * N[(y * N[(y * N[(y * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8:\\
\;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y \cdot \left(y \cdot \left(y \cdot \left(y \cdot \left(y \cdot 0.008333333333333333\right)\right)\right)\right)}{x}\\
\end{array}
\end{array}
if y < 4.79999999999999982Initial program 83.8%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
Simplified69.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6453.7%
Simplified53.7%
if 4.79999999999999982 < y Initial program 100.0%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
Simplified78.3%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.5%
Simplified70.5%
Taylor expanded in y around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6470.5%
Simplified70.5%
(FPCore (x y)
:precision binary64
(*
x
(/
(*
y
(+
1.0
(* y (* y (+ 0.16666666666666666 (* (* y y) 0.008333333333333333))))))
x)))
double code(double x, double y) {
return x * ((y * (1.0 + (y * (y * (0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * ((y * (1.0d0 + (y * (y * (0.16666666666666666d0 + ((y * y) * 0.008333333333333333d0)))))) / x)
end function
public static double code(double x, double y) {
return x * ((y * (1.0 + (y * (y * (0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) / x);
}
def code(x, y): return x * ((y * (1.0 + (y * (y * (0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) / x)
function code(x, y) return Float64(x * Float64(Float64(y * Float64(1.0 + Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(y * y) * 0.008333333333333333)))))) / x)) end
function tmp = code(x, y) tmp = x * ((y * (1.0 + (y * (y * (0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) / x); end
code[x_, y_] := N[(x * N[(N[(y * N[(1.0 + N[(y * N[(y * N[(0.16666666666666666 + N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y \cdot \left(1 + y \cdot \left(y \cdot \left(0.16666666666666666 + \left(y \cdot y\right) \cdot 0.008333333333333333\right)\right)\right)}{x}
\end{array}
Initial program 87.6%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified75.6%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.3%
Simplified72.3%
(FPCore (x y) :precision binary64 (if (<= x 6500000.0) (* x (/ (* y (+ 1.0 (* y (* y 0.16666666666666666)))) x)) (/ (* x (* (* y y) (* y 0.16666666666666666))) x)))
double code(double x, double y) {
double tmp;
if (x <= 6500000.0) {
tmp = x * ((y * (1.0 + (y * (y * 0.16666666666666666)))) / x);
} else {
tmp = (x * ((y * y) * (y * 0.16666666666666666))) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 6500000.0d0) then
tmp = x * ((y * (1.0d0 + (y * (y * 0.16666666666666666d0)))) / x)
else
tmp = (x * ((y * y) * (y * 0.16666666666666666d0))) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 6500000.0) {
tmp = x * ((y * (1.0 + (y * (y * 0.16666666666666666)))) / x);
} else {
tmp = (x * ((y * y) * (y * 0.16666666666666666))) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6500000.0: tmp = x * ((y * (1.0 + (y * (y * 0.16666666666666666)))) / x) else: tmp = (x * ((y * y) * (y * 0.16666666666666666))) / x return tmp
function code(x, y) tmp = 0.0 if (x <= 6500000.0) tmp = Float64(x * Float64(Float64(y * Float64(1.0 + Float64(y * Float64(y * 0.16666666666666666)))) / x)); else tmp = Float64(Float64(x * Float64(Float64(y * y) * Float64(y * 0.16666666666666666))) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 6500000.0) tmp = x * ((y * (1.0 + (y * (y * 0.16666666666666666)))) / x); else tmp = (x * ((y * y) * (y * 0.16666666666666666))) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6500000.0], N[(x * N[(N[(y * N[(1.0 + N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(y * y), $MachinePrecision] * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6500000:\\
\;\;\;\;x \cdot \frac{y \cdot \left(1 + y \cdot \left(y \cdot 0.16666666666666666\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot 0.16666666666666666\right)\right)}{x}\\
\end{array}
\end{array}
if x < 6.5e6Initial program 83.7%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified82.4%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6477.3%
Simplified77.3%
if 6.5e6 < x Initial program 99.9%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified53.9%
Taylor expanded in y around 0
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6440.0%
Simplified40.0%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6442.6%
Simplified42.6%
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6449.9%
Applied egg-rr49.9%
Final simplification70.8%
(FPCore (x y) :precision binary64 (if (<= x 6500000.0) (* x (* (+ 1.0 (* 0.16666666666666666 (* y y))) (/ y x))) (/ (* x (* (* y y) (* y 0.16666666666666666))) x)))
double code(double x, double y) {
double tmp;
if (x <= 6500000.0) {
tmp = x * ((1.0 + (0.16666666666666666 * (y * y))) * (y / x));
} else {
tmp = (x * ((y * y) * (y * 0.16666666666666666))) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 6500000.0d0) then
tmp = x * ((1.0d0 + (0.16666666666666666d0 * (y * y))) * (y / x))
else
tmp = (x * ((y * y) * (y * 0.16666666666666666d0))) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 6500000.0) {
tmp = x * ((1.0 + (0.16666666666666666 * (y * y))) * (y / x));
} else {
tmp = (x * ((y * y) * (y * 0.16666666666666666))) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6500000.0: tmp = x * ((1.0 + (0.16666666666666666 * (y * y))) * (y / x)) else: tmp = (x * ((y * y) * (y * 0.16666666666666666))) / x return tmp
function code(x, y) tmp = 0.0 if (x <= 6500000.0) tmp = Float64(x * Float64(Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) * Float64(y / x))); else tmp = Float64(Float64(x * Float64(Float64(y * y) * Float64(y * 0.16666666666666666))) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 6500000.0) tmp = x * ((1.0 + (0.16666666666666666 * (y * y))) * (y / x)); else tmp = (x * ((y * y) * (y * 0.16666666666666666))) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6500000.0], N[(x * N[(N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(y * y), $MachinePrecision] * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6500000:\\
\;\;\;\;x \cdot \left(\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot 0.16666666666666666\right)\right)}{x}\\
\end{array}
\end{array}
if x < 6.5e6Initial program 83.7%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified82.4%
Taylor expanded in y around 0
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6477.2%
Simplified77.2%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6477.3%
Simplified77.3%
if 6.5e6 < x Initial program 99.9%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified53.9%
Taylor expanded in y around 0
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6440.0%
Simplified40.0%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6442.6%
Simplified42.6%
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6449.9%
Applied egg-rr49.9%
Final simplification70.8%
(FPCore (x y) :precision binary64 (if (<= y 3.8) (/ y (+ 1.0 (* x (* x 0.16666666666666666)))) (* x (* y (/ (* 0.16666666666666666 (* y y)) x)))))
double code(double x, double y) {
double tmp;
if (y <= 3.8) {
tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
} else {
tmp = x * (y * ((0.16666666666666666 * (y * y)) / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.8d0) then
tmp = y / (1.0d0 + (x * (x * 0.16666666666666666d0)))
else
tmp = x * (y * ((0.16666666666666666d0 * (y * y)) / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.8) {
tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
} else {
tmp = x * (y * ((0.16666666666666666 * (y * y)) / x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.8: tmp = y / (1.0 + (x * (x * 0.16666666666666666))) else: tmp = x * (y * ((0.16666666666666666 * (y * y)) / x)) return tmp
function code(x, y) tmp = 0.0 if (y <= 3.8) tmp = Float64(y / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666)))); else tmp = Float64(x * Float64(y * Float64(Float64(0.16666666666666666 * Float64(y * y)) / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.8) tmp = y / (1.0 + (x * (x * 0.16666666666666666))); else tmp = x * (y * ((0.16666666666666666 * (y * y)) / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.8], N[(y / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.8:\\
\;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.16666666666666666 \cdot \left(y \cdot y\right)}{x}\right)\\
\end{array}
\end{array}
if y < 3.7999999999999998Initial program 83.8%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
Simplified69.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6453.7%
Simplified53.7%
if 3.7999999999999998 < y Initial program 100.0%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
Simplified78.3%
Taylor expanded in y around 0
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6464.2%
Simplified64.2%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.2%
Simplified64.2%
(FPCore (x y) :precision binary64 (if (<= y 4.6e+107) (* x (/ 1.0 (/ x y))) (* y (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 4.6e+107) {
tmp = x * (1.0 / (x / y));
} else {
tmp = y * (0.16666666666666666 * (y * y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.6d+107) then
tmp = x * (1.0d0 / (x / y))
else
tmp = y * (0.16666666666666666d0 * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.6e+107) {
tmp = x * (1.0 / (x / y));
} else {
tmp = y * (0.16666666666666666 * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.6e+107: tmp = x * (1.0 / (x / y)) else: tmp = y * (0.16666666666666666 * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.6e+107) tmp = Float64(x * Float64(1.0 / Float64(x / y))); else tmp = Float64(y * Float64(0.16666666666666666 * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.6e+107) tmp = x * (1.0 / (x / y)); else tmp = y * (0.16666666666666666 * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.6e+107], N[(x * N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{+107}:\\
\;\;\;\;x \cdot \frac{1}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 4.6000000000000001e107Initial program 85.4%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified75.1%
Taylor expanded in y around 0
Simplified54.2%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6455.4%
Applied egg-rr55.4%
if 4.6000000000000001e107 < y Initial program 100.0%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
Simplified78.9%
Taylor expanded in y around 0
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6478.9%
Simplified78.9%
Taylor expanded in y around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.9%
Simplified78.9%
(FPCore (x y) :precision binary64 (* x (/ 1.0 (/ x y))))
double code(double x, double y) {
return x * (1.0 / (x / y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (1.0d0 / (x / y))
end function
public static double code(double x, double y) {
return x * (1.0 / (x / y));
}
def code(x, y): return x * (1.0 / (x / y))
function code(x, y) return Float64(x * Float64(1.0 / Float64(x / y))) end
function tmp = code(x, y) tmp = x * (1.0 / (x / y)); end
code[x_, y_] := N[(x * N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{1}{\frac{x}{y}}
\end{array}
Initial program 87.6%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified75.6%
Taylor expanded in y around 0
Simplified53.9%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6454.8%
Applied egg-rr54.8%
(FPCore (x y) :precision binary64 (* x (/ y x)))
double code(double x, double y) {
return x * (y / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (y / x)
end function
public static double code(double x, double y) {
return x * (y / x);
}
def code(x, y): return x * (y / x)
function code(x, y) return Float64(x * Float64(y / x)) end
function tmp = code(x, y) tmp = x * (y / x); end
code[x_, y_] := N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y}{x}
\end{array}
Initial program 87.6%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified75.6%
Taylor expanded in y around 0
Simplified53.9%
(FPCore (x y) :precision binary64 y)
double code(double x, double y) {
return y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y
end function
public static double code(double x, double y) {
return y;
}
def code(x, y): return y
function code(x, y) return y end
function tmp = code(x, y) tmp = y; end
code[x_, y_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 87.6%
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified75.6%
Taylor expanded in y around 0
Simplified29.6%
(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 2024158
(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))