
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = cos(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = cos(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = cos(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (<= (cos x) 0.9999995) (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y)))) (/ (sinh y) (+ y (* 0.5 (* y (* x x)))))))
double code(double x, double y) {
double tmp;
if (cos(x) <= 0.9999995) {
tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = sinh(y) / (y + (0.5 * (y * (x * x))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (cos(x) <= 0.9999995d0) then
tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else
tmp = sinh(y) / (y + (0.5d0 * (y * (x * x))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.cos(x) <= 0.9999995) {
tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = Math.sinh(y) / (y + (0.5 * (y * (x * x))));
}
return tmp;
}
def code(x, y): tmp = 0 if math.cos(x) <= 0.9999995: tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) else: tmp = math.sinh(y) / (y + (0.5 * (y * (x * x)))) return tmp
function code(x, y) tmp = 0.0 if (cos(x) <= 0.9999995) tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); else tmp = Float64(sinh(y) / Float64(y + Float64(0.5 * Float64(y * Float64(x * x))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (cos(x) <= 0.9999995) tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); else tmp = sinh(y) / (y + (0.5 * (y * (x * x)))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Cos[x], $MachinePrecision], 0.9999995], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sinh[y], $MachinePrecision] / N[(y + N[(0.5 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos x \leq 0.9999995:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sinh y}{y + 0.5 \cdot \left(y \cdot \left(x \cdot x\right)\right)}\\
\end{array}
\end{array}
if (cos.f64 x) < 0.999999500000000041Initial program 100.0%
*-commutative100.0%
associate-/r/99.9%
Simplified99.9%
sinh-def55.9%
clear-num55.9%
sinh-undef99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 79.5%
*-lft-identity79.5%
unpow279.5%
associate-*r*79.5%
distribute-rgt-out79.5%
Simplified79.5%
if 0.999999500000000041 < (cos.f64 x) Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification88.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 2.0 (* x x))))
(if (<= y 4500.0)
(cos x)
(if (<= y 4.5e+70)
t_0
(if (<= y 1e+111)
(* (* y y) (+ 0.16666666666666666 (* (* x x) -0.08333333333333333)))
(if (<= y 1.8e+146)
t_0
(* 0.16666666666666666 (* (cos x) (* y y)))))))))
double code(double x, double y) {
double t_0 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = cos(x);
} else if (y <= 4.5e+70) {
tmp = t_0;
} else if (y <= 1e+111) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else if (y <= 1.8e+146) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (cos(x) * (y * y));
}
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 = 2.0d0 / (x * x)
if (y <= 4500.0d0) then
tmp = cos(x)
else if (y <= 4.5d+70) then
tmp = t_0
else if (y <= 1d+111) then
tmp = (y * y) * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0)))
else if (y <= 1.8d+146) then
tmp = t_0
else
tmp = 0.16666666666666666d0 * (cos(x) * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = Math.cos(x);
} else if (y <= 4.5e+70) {
tmp = t_0;
} else if (y <= 1e+111) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else if (y <= 1.8e+146) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (Math.cos(x) * (y * y));
}
return tmp;
}
def code(x, y): t_0 = 2.0 / (x * x) tmp = 0 if y <= 4500.0: tmp = math.cos(x) elif y <= 4.5e+70: tmp = t_0 elif y <= 1e+111: tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)) elif y <= 1.8e+146: tmp = t_0 else: tmp = 0.16666666666666666 * (math.cos(x) * (y * y)) return tmp
function code(x, y) t_0 = Float64(2.0 / Float64(x * x)) tmp = 0.0 if (y <= 4500.0) tmp = cos(x); elseif (y <= 4.5e+70) tmp = t_0; elseif (y <= 1e+111) tmp = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))); elseif (y <= 1.8e+146) tmp = t_0; else tmp = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = 2.0 / (x * x); tmp = 0.0; if (y <= 4500.0) tmp = cos(x); elseif (y <= 4.5e+70) tmp = t_0; elseif (y <= 1e+111) tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)); elseif (y <= 1.8e+146) tmp = t_0; else tmp = 0.16666666666666666 * (cos(x) * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4500.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 4.5e+70], t$95$0, If[LessEqual[y, 1e+111], N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+146], t$95$0, N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{x \cdot x}\\
\mathbf{if}\;y \leq 4500:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+70}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 10^{+111}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 4500Initial program 100.0%
Taylor expanded in y around 0 67.4%
if 4500 < y < 4.4999999999999999e70 or 9.99999999999999957e110 < y < 1.7999999999999999e146Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around 0 77.8%
*-commutative77.8%
unpow277.8%
Simplified77.8%
Taylor expanded in y around 0 2.6%
*-commutative2.6%
unpow22.6%
Simplified2.6%
Taylor expanded in x around inf 24.7%
unpow224.7%
Simplified24.7%
if 4.4999999999999999e70 < y < 9.99999999999999957e110Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 4.9%
*-lft-identity4.9%
unpow24.9%
associate-*r*4.9%
distribute-rgt-out4.9%
Simplified4.9%
Taylor expanded in y around inf 4.9%
unpow24.9%
Simplified4.9%
Taylor expanded in x around 0 47.0%
associate-*r*47.0%
distribute-rgt-out47.0%
unpow247.0%
*-commutative47.0%
unpow247.0%
Simplified47.0%
if 1.7999999999999999e146 < y Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 97.3%
*-lft-identity97.3%
unpow297.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in y around inf 97.3%
unpow297.3%
Simplified97.3%
Final simplification67.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 2.0 (* x x))))
(if (<= y 4500.0)
(* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 3.1e+70)
t_0
(if (<= y 2.75e+111)
(* (* y y) (+ 0.16666666666666666 (* (* x x) -0.08333333333333333)))
(if (<= y 2.4e+147)
t_0
(* 0.16666666666666666 (* (cos x) (* y y)))))))))
double code(double x, double y) {
double t_0 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 3.1e+70) {
tmp = t_0;
} else if (y <= 2.75e+111) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else if (y <= 2.4e+147) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (cos(x) * (y * y));
}
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 = 2.0d0 / (x * x)
if (y <= 4500.0d0) then
tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 3.1d+70) then
tmp = t_0
else if (y <= 2.75d+111) then
tmp = (y * y) * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0)))
else if (y <= 2.4d+147) then
tmp = t_0
else
tmp = 0.16666666666666666d0 * (cos(x) * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 3.1e+70) {
tmp = t_0;
} else if (y <= 2.75e+111) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else if (y <= 2.4e+147) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (Math.cos(x) * (y * y));
}
return tmp;
}
def code(x, y): t_0 = 2.0 / (x * x) tmp = 0 if y <= 4500.0: tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 3.1e+70: tmp = t_0 elif y <= 2.75e+111: tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)) elif y <= 2.4e+147: tmp = t_0 else: tmp = 0.16666666666666666 * (math.cos(x) * (y * y)) return tmp
function code(x, y) t_0 = Float64(2.0 / Float64(x * x)) tmp = 0.0 if (y <= 4500.0) tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 3.1e+70) tmp = t_0; elseif (y <= 2.75e+111) tmp = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))); elseif (y <= 2.4e+147) tmp = t_0; else tmp = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = 2.0 / (x * x); tmp = 0.0; if (y <= 4500.0) tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 3.1e+70) tmp = t_0; elseif (y <= 2.75e+111) tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)); elseif (y <= 2.4e+147) tmp = t_0; else tmp = 0.16666666666666666 * (cos(x) * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4500.0], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e+70], t$95$0, If[LessEqual[y, 2.75e+111], N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+147], t$95$0, N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{x \cdot x}\\
\mathbf{if}\;y \leq 4500:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+70}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{+111}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+147}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 4500Initial program 100.0%
*-commutative100.0%
associate-/r/99.9%
Simplified99.9%
sinh-def37.6%
clear-num37.6%
sinh-undef99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 85.3%
*-lft-identity85.3%
unpow285.3%
associate-*r*85.3%
distribute-rgt-out85.3%
Simplified85.3%
if 4500 < y < 3.1000000000000003e70 or 2.7499999999999999e111 < y < 2.40000000000000002e147Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around 0 77.8%
*-commutative77.8%
unpow277.8%
Simplified77.8%
Taylor expanded in y around 0 2.6%
*-commutative2.6%
unpow22.6%
Simplified2.6%
Taylor expanded in x around inf 24.7%
unpow224.7%
Simplified24.7%
if 3.1000000000000003e70 < y < 2.7499999999999999e111Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 4.9%
*-lft-identity4.9%
unpow24.9%
associate-*r*4.9%
distribute-rgt-out4.9%
Simplified4.9%
Taylor expanded in y around inf 4.9%
unpow24.9%
Simplified4.9%
Taylor expanded in x around 0 47.0%
associate-*r*47.0%
distribute-rgt-out47.0%
unpow247.0%
*-commutative47.0%
unpow247.0%
Simplified47.0%
if 2.40000000000000002e147 < y Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 97.3%
*-lft-identity97.3%
unpow297.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in y around inf 97.3%
unpow297.3%
Simplified97.3%
Final simplification81.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 2.0 (* x x))))
(if (<= y 4500.0)
(cos x)
(if (<= y 1.32e+69)
t_0
(if (<= y 5.8e+110)
(* (* y y) (+ 0.16666666666666666 (* (* x x) -0.08333333333333333)))
(if (<= y 2.45e+147) t_0 (+ 1.0 (* 0.16666666666666666 (* y y)))))))))
double code(double x, double y) {
double t_0 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = cos(x);
} else if (y <= 1.32e+69) {
tmp = t_0;
} else if (y <= 5.8e+110) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else if (y <= 2.45e+147) {
tmp = t_0;
} else {
tmp = 1.0 + (0.16666666666666666 * (y * y));
}
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 = 2.0d0 / (x * x)
if (y <= 4500.0d0) then
tmp = cos(x)
else if (y <= 1.32d+69) then
tmp = t_0
else if (y <= 5.8d+110) then
tmp = (y * y) * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0)))
else if (y <= 2.45d+147) then
tmp = t_0
else
tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = Math.cos(x);
} else if (y <= 1.32e+69) {
tmp = t_0;
} else if (y <= 5.8e+110) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else if (y <= 2.45e+147) {
tmp = t_0;
} else {
tmp = 1.0 + (0.16666666666666666 * (y * y));
}
return tmp;
}
def code(x, y): t_0 = 2.0 / (x * x) tmp = 0 if y <= 4500.0: tmp = math.cos(x) elif y <= 1.32e+69: tmp = t_0 elif y <= 5.8e+110: tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)) elif y <= 2.45e+147: tmp = t_0 else: tmp = 1.0 + (0.16666666666666666 * (y * y)) return tmp
function code(x, y) t_0 = Float64(2.0 / Float64(x * x)) tmp = 0.0 if (y <= 4500.0) tmp = cos(x); elseif (y <= 1.32e+69) tmp = t_0; elseif (y <= 5.8e+110) tmp = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))); elseif (y <= 2.45e+147) tmp = t_0; else tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = 2.0 / (x * x); tmp = 0.0; if (y <= 4500.0) tmp = cos(x); elseif (y <= 1.32e+69) tmp = t_0; elseif (y <= 5.8e+110) tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)); elseif (y <= 2.45e+147) tmp = t_0; else tmp = 1.0 + (0.16666666666666666 * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4500.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.32e+69], t$95$0, If[LessEqual[y, 5.8e+110], N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+147], t$95$0, N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{x \cdot x}\\
\mathbf{if}\;y \leq 4500:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{+69}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+110}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+147}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 4500Initial program 100.0%
Taylor expanded in y around 0 67.4%
if 4500 < y < 1.32e69 or 5.7999999999999999e110 < y < 2.4499999999999999e147Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around 0 77.8%
*-commutative77.8%
unpow277.8%
Simplified77.8%
Taylor expanded in y around 0 2.6%
*-commutative2.6%
unpow22.6%
Simplified2.6%
Taylor expanded in x around inf 24.7%
unpow224.7%
Simplified24.7%
if 1.32e69 < y < 5.7999999999999999e110Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 4.9%
*-lft-identity4.9%
unpow24.9%
associate-*r*4.9%
distribute-rgt-out4.9%
Simplified4.9%
Taylor expanded in y around inf 4.9%
unpow24.9%
Simplified4.9%
Taylor expanded in x around 0 47.0%
associate-*r*47.0%
distribute-rgt-out47.0%
unpow247.0%
*-commutative47.0%
unpow247.0%
Simplified47.0%
if 2.4499999999999999e147 < y Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 97.3%
*-lft-identity97.3%
unpow297.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in x around 0 73.1%
+-commutative73.1%
unpow273.1%
Simplified73.1%
Final simplification64.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y)))) (t_1 (/ 2.0 (* x x))))
(if (<= y 4500.0)
t_0
(if (<= y 4.1e+70)
t_1
(if (<= y 1.65e+110)
(* (* y y) (+ 0.16666666666666666 (* (* x x) -0.08333333333333333)))
(if (<= y 2.45e+147) t_1 t_0))))))
double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double t_1 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = t_0;
} else if (y <= 4.1e+70) {
tmp = t_1;
} else if (y <= 1.65e+110) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else if (y <= 2.45e+147) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + (0.16666666666666666d0 * (y * y))
t_1 = 2.0d0 / (x * x)
if (y <= 4500.0d0) then
tmp = t_0
else if (y <= 4.1d+70) then
tmp = t_1
else if (y <= 1.65d+110) then
tmp = (y * y) * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0)))
else if (y <= 2.45d+147) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double t_1 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = t_0;
} else if (y <= 4.1e+70) {
tmp = t_1;
} else if (y <= 1.65e+110) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else if (y <= 2.45e+147) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (0.16666666666666666 * (y * y)) t_1 = 2.0 / (x * x) tmp = 0 if y <= 4500.0: tmp = t_0 elif y <= 4.1e+70: tmp = t_1 elif y <= 1.65e+110: tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)) elif y <= 2.45e+147: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) t_1 = Float64(2.0 / Float64(x * x)) tmp = 0.0 if (y <= 4500.0) tmp = t_0; elseif (y <= 4.1e+70) tmp = t_1; elseif (y <= 1.65e+110) tmp = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))); elseif (y <= 2.45e+147) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (0.16666666666666666 * (y * y)); t_1 = 2.0 / (x * x); tmp = 0.0; if (y <= 4500.0) tmp = t_0; elseif (y <= 4.1e+70) tmp = t_1; elseif (y <= 1.65e+110) tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)); elseif (y <= 2.45e+147) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4500.0], t$95$0, If[LessEqual[y, 4.1e+70], t$95$1, If[LessEqual[y, 1.65e+110], N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+147], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \frac{2}{x \cdot x}\\
\mathbf{if}\;y \leq 4500:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+110}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+147}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 4500 or 2.4499999999999999e147 < y Initial program 100.0%
*-commutative100.0%
associate-/r/99.9%
Simplified99.9%
sinh-def46.7%
clear-num46.7%
sinh-undef99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 87.1%
*-lft-identity87.1%
unpow287.1%
associate-*r*87.1%
distribute-rgt-out87.1%
Simplified87.1%
Taylor expanded in x around 0 53.0%
+-commutative53.0%
unpow253.0%
Simplified53.0%
if 4500 < y < 4.1000000000000002e70 or 1.64999999999999986e110 < y < 2.4499999999999999e147Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around 0 77.8%
*-commutative77.8%
unpow277.8%
Simplified77.8%
Taylor expanded in y around 0 2.6%
*-commutative2.6%
unpow22.6%
Simplified2.6%
Taylor expanded in x around inf 24.7%
unpow224.7%
Simplified24.7%
if 4.1000000000000002e70 < y < 1.64999999999999986e110Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 4.9%
*-lft-identity4.9%
unpow24.9%
associate-*r*4.9%
distribute-rgt-out4.9%
Simplified4.9%
Taylor expanded in y around inf 4.9%
unpow24.9%
Simplified4.9%
Taylor expanded in x around 0 47.0%
associate-*r*47.0%
distribute-rgt-out47.0%
unpow247.0%
*-commutative47.0%
unpow247.0%
Simplified47.0%
Final simplification50.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y)))) (t_1 (/ 2.0 (* x x))))
(if (<= y 4500.0)
t_0
(if (<= y 2.05e+69)
t_1
(if (<= y 5.8e+94)
(+ 1.0 (* (* x x) -0.5))
(if (<= y 2.45e+147) t_1 t_0))))))
double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double t_1 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = t_0;
} else if (y <= 2.05e+69) {
tmp = t_1;
} else if (y <= 5.8e+94) {
tmp = 1.0 + ((x * x) * -0.5);
} else if (y <= 2.45e+147) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + (0.16666666666666666d0 * (y * y))
t_1 = 2.0d0 / (x * x)
if (y <= 4500.0d0) then
tmp = t_0
else if (y <= 2.05d+69) then
tmp = t_1
else if (y <= 5.8d+94) then
tmp = 1.0d0 + ((x * x) * (-0.5d0))
else if (y <= 2.45d+147) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double t_1 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = t_0;
} else if (y <= 2.05e+69) {
tmp = t_1;
} else if (y <= 5.8e+94) {
tmp = 1.0 + ((x * x) * -0.5);
} else if (y <= 2.45e+147) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (0.16666666666666666 * (y * y)) t_1 = 2.0 / (x * x) tmp = 0 if y <= 4500.0: tmp = t_0 elif y <= 2.05e+69: tmp = t_1 elif y <= 5.8e+94: tmp = 1.0 + ((x * x) * -0.5) elif y <= 2.45e+147: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) t_1 = Float64(2.0 / Float64(x * x)) tmp = 0.0 if (y <= 4500.0) tmp = t_0; elseif (y <= 2.05e+69) tmp = t_1; elseif (y <= 5.8e+94) tmp = Float64(1.0 + Float64(Float64(x * x) * -0.5)); elseif (y <= 2.45e+147) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (0.16666666666666666 * (y * y)); t_1 = 2.0 / (x * x); tmp = 0.0; if (y <= 4500.0) tmp = t_0; elseif (y <= 2.05e+69) tmp = t_1; elseif (y <= 5.8e+94) tmp = 1.0 + ((x * x) * -0.5); elseif (y <= 2.45e+147) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4500.0], t$95$0, If[LessEqual[y, 2.05e+69], t$95$1, If[LessEqual[y, 5.8e+94], N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+147], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \frac{2}{x \cdot x}\\
\mathbf{if}\;y \leq 4500:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+94}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+147}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 4500 or 2.4499999999999999e147 < y Initial program 100.0%
*-commutative100.0%
associate-/r/99.9%
Simplified99.9%
sinh-def46.7%
clear-num46.7%
sinh-undef99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 87.1%
*-lft-identity87.1%
unpow287.1%
associate-*r*87.1%
distribute-rgt-out87.1%
Simplified87.1%
Taylor expanded in x around 0 53.0%
+-commutative53.0%
unpow253.0%
Simplified53.0%
if 4500 < y < 2.05e69 or 5.7999999999999997e94 < y < 2.4499999999999999e147Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around 0 78.9%
*-commutative78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in y around 0 2.6%
*-commutative2.6%
unpow22.6%
Simplified2.6%
Taylor expanded in x around inf 23.6%
unpow223.6%
Simplified23.6%
if 2.05e69 < y < 5.7999999999999997e94Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 51.0%
unpow251.0%
Simplified51.0%
Final simplification50.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 2.0 (* x x))))
(if (<= y 4500.0)
1.0
(if (<= y 4.7e+70)
t_0
(if (<= y 4e+92)
(+ 1.0 (* (* x x) -0.5))
(if (<= y 2.45e+147) t_0 (* 0.16666666666666666 (* y y))))))))
double code(double x, double y) {
double t_0 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = 1.0;
} else if (y <= 4.7e+70) {
tmp = t_0;
} else if (y <= 4e+92) {
tmp = 1.0 + ((x * x) * -0.5);
} else if (y <= 2.45e+147) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (y * y);
}
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 = 2.0d0 / (x * x)
if (y <= 4500.0d0) then
tmp = 1.0d0
else if (y <= 4.7d+70) then
tmp = t_0
else if (y <= 4d+92) then
tmp = 1.0d0 + ((x * x) * (-0.5d0))
else if (y <= 2.45d+147) then
tmp = t_0
else
tmp = 0.16666666666666666d0 * (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 2.0 / (x * x);
double tmp;
if (y <= 4500.0) {
tmp = 1.0;
} else if (y <= 4.7e+70) {
tmp = t_0;
} else if (y <= 4e+92) {
tmp = 1.0 + ((x * x) * -0.5);
} else if (y <= 2.45e+147) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (y * y);
}
return tmp;
}
def code(x, y): t_0 = 2.0 / (x * x) tmp = 0 if y <= 4500.0: tmp = 1.0 elif y <= 4.7e+70: tmp = t_0 elif y <= 4e+92: tmp = 1.0 + ((x * x) * -0.5) elif y <= 2.45e+147: tmp = t_0 else: tmp = 0.16666666666666666 * (y * y) return tmp
function code(x, y) t_0 = Float64(2.0 / Float64(x * x)) tmp = 0.0 if (y <= 4500.0) tmp = 1.0; elseif (y <= 4.7e+70) tmp = t_0; elseif (y <= 4e+92) tmp = Float64(1.0 + Float64(Float64(x * x) * -0.5)); elseif (y <= 2.45e+147) tmp = t_0; else tmp = Float64(0.16666666666666666 * Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) t_0 = 2.0 / (x * x); tmp = 0.0; if (y <= 4500.0) tmp = 1.0; elseif (y <= 4.7e+70) tmp = t_0; elseif (y <= 4e+92) tmp = 1.0 + ((x * x) * -0.5); elseif (y <= 2.45e+147) tmp = t_0; else tmp = 0.16666666666666666 * (y * y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4500.0], 1.0, If[LessEqual[y, 4.7e+70], t$95$0, If[LessEqual[y, 4e+92], N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+147], t$95$0, N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{x \cdot x}\\
\mathbf{if}\;y \leq 4500:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+70}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+92}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+147}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 4500Initial program 100.0%
*-commutative100.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 67.3%
Taylor expanded in x around 0 38.3%
if 4500 < y < 4.6999999999999998e70 or 4.0000000000000002e92 < y < 2.4499999999999999e147Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around 0 78.9%
*-commutative78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in y around 0 2.6%
*-commutative2.6%
unpow22.6%
Simplified2.6%
Taylor expanded in x around inf 23.6%
unpow223.6%
Simplified23.6%
if 4.6999999999999998e70 < y < 4.0000000000000002e92Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 51.0%
unpow251.0%
Simplified51.0%
if 2.4499999999999999e147 < y Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 97.3%
*-lft-identity97.3%
unpow297.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in x around 0 73.1%
+-commutative73.1%
unpow273.1%
associate-*r*73.1%
*-commutative73.1%
fma-def73.1%
Simplified73.1%
Taylor expanded in y around inf 73.1%
unpow273.1%
Simplified73.1%
Final simplification42.2%
(FPCore (x y) :precision binary64 (if (<= y 4500.0) 1.0 (if (<= y 2.45e+147) (/ 2.0 (* x x)) (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 4500.0) {
tmp = 1.0;
} else if (y <= 2.45e+147) {
tmp = 2.0 / (x * x);
} else {
tmp = 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 <= 4500.0d0) then
tmp = 1.0d0
else if (y <= 2.45d+147) then
tmp = 2.0d0 / (x * x)
else
tmp = 0.16666666666666666d0 * (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4500.0) {
tmp = 1.0;
} else if (y <= 2.45e+147) {
tmp = 2.0 / (x * x);
} else {
tmp = 0.16666666666666666 * (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4500.0: tmp = 1.0 elif y <= 2.45e+147: tmp = 2.0 / (x * x) else: tmp = 0.16666666666666666 * (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 4500.0) tmp = 1.0; elseif (y <= 2.45e+147) tmp = Float64(2.0 / Float64(x * x)); else tmp = Float64(0.16666666666666666 * Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4500.0) tmp = 1.0; elseif (y <= 2.45e+147) tmp = 2.0 / (x * x); else tmp = 0.16666666666666666 * (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4500.0], 1.0, If[LessEqual[y, 2.45e+147], N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4500:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+147}:\\
\;\;\;\;\frac{2}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 4500Initial program 100.0%
*-commutative100.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 67.3%
Taylor expanded in x around 0 38.3%
if 4500 < y < 2.4499999999999999e147Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around 0 58.6%
*-commutative58.6%
unpow258.6%
Simplified58.6%
Taylor expanded in y around 0 2.3%
*-commutative2.3%
unpow22.3%
Simplified2.3%
Taylor expanded in x around inf 16.2%
unpow216.2%
Simplified16.2%
if 2.4499999999999999e147 < y Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 97.3%
*-lft-identity97.3%
unpow297.3%
associate-*r*97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in x around 0 73.1%
+-commutative73.1%
unpow273.1%
associate-*r*73.1%
*-commutative73.1%
fma-def73.1%
Simplified73.1%
Taylor expanded in y around inf 73.1%
unpow273.1%
Simplified73.1%
Final simplification40.3%
(FPCore (x y) :precision binary64 (if (<= y 2.4) 1.0 (* 0.16666666666666666 (* y y))))
double code(double x, double y) {
double tmp;
if (y <= 2.4) {
tmp = 1.0;
} else {
tmp = 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 <= 2.4d0) then
tmp = 1.0d0
else
tmp = 0.16666666666666666d0 * (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.4) {
tmp = 1.0;
} else {
tmp = 0.16666666666666666 * (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.4: tmp = 1.0 else: tmp = 0.16666666666666666 * (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.4) tmp = 1.0; else tmp = Float64(0.16666666666666666 * Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.4) tmp = 1.0; else tmp = 0.16666666666666666 * (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.4], 1.0, N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 2.39999999999999991Initial program 100.0%
*-commutative100.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 67.9%
Taylor expanded in x around 0 38.6%
if 2.39999999999999991 < y Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
sinh-def100.0%
clear-num100.0%
sinh-undef100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 52.9%
*-lft-identity52.9%
unpow252.9%
associate-*r*52.9%
distribute-rgt-out52.9%
Simplified52.9%
Taylor expanded in x around 0 39.8%
+-commutative39.8%
unpow239.8%
associate-*r*39.8%
*-commutative39.8%
fma-def39.8%
Simplified39.8%
Taylor expanded in y around inf 39.8%
unpow239.8%
Simplified39.8%
Final simplification38.9%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 51.8%
Taylor expanded in x around 0 29.6%
Final simplification29.6%
herbie shell --seed 2023297
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))