
(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 14 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
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y 1e+26)
(* (cos x) (+ 1.0 t_0))
(if (<= y 1.15e+77)
(* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))
(if (<= y 1.4e+154)
(+
1.0
(+
-1.0
(/
(- 1.0 (* (pow y 4.0) 0.027777777777777776))
(+ 1.0 (* (* y y) -0.16666666666666666)))))
(* (cos x) t_0))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 1e+26) {
tmp = cos(x) * (1.0 + t_0);
} else if (y <= 1.15e+77) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else if (y <= 1.4e+154) {
tmp = 1.0 + (-1.0 + ((1.0 - (pow(y, 4.0) * 0.027777777777777776)) / (1.0 + ((y * y) * -0.16666666666666666))));
} else {
tmp = cos(x) * 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 = 0.16666666666666666d0 * (y * y)
if (y <= 1d+26) then
tmp = cos(x) * (1.0d0 + t_0)
else if (y <= 1.15d+77) then
tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
else if (y <= 1.4d+154) then
tmp = 1.0d0 + ((-1.0d0) + ((1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0)) / (1.0d0 + ((y * y) * (-0.16666666666666666d0)))))
else
tmp = cos(x) * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 1e+26) {
tmp = Math.cos(x) * (1.0 + t_0);
} else if (y <= 1.15e+77) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else if (y <= 1.4e+154) {
tmp = 1.0 + (-1.0 + ((1.0 - (Math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + ((y * y) * -0.16666666666666666))));
} else {
tmp = Math.cos(x) * t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= 1e+26: tmp = math.cos(x) * (1.0 + t_0) elif y <= 1.15e+77: tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))) elif y <= 1.4e+154: tmp = 1.0 + (-1.0 + ((1.0 - (math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + ((y * y) * -0.16666666666666666)))) else: tmp = math.cos(x) * t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= 1e+26) tmp = Float64(cos(x) * Float64(1.0 + t_0)); elseif (y <= 1.15e+77) tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333)))); elseif (y <= 1.4e+154) tmp = Float64(1.0 + Float64(-1.0 + Float64(Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776)) / Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))))); else tmp = Float64(cos(x) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= 1e+26) tmp = cos(x) * (1.0 + t_0); elseif (y <= 1.15e+77) tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))); elseif (y <= 1.4e+154) tmp = 1.0 + (-1.0 + ((1.0 - ((y ^ 4.0) * 0.027777777777777776)) / (1.0 + ((y * y) * -0.16666666666666666)))); else tmp = cos(x) * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1e+26], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+77], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], N[(1.0 + N[(-1.0 + N[(N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 10^{+26}:\\
\;\;\;\;\cos x \cdot \left(1 + t_0\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;1 + \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos x \cdot t_0\\
\end{array}
\end{array}
if y < 1.00000000000000005e26Initial program 100.0%
Taylor expanded in y around 0 82.0%
unpow282.0%
Simplified82.0%
if 1.00000000000000005e26 < y < 1.14999999999999997e77Initial program 100.0%
Taylor expanded in y around 0 4.0%
unpow24.0%
Simplified4.0%
Taylor expanded in y around inf 4.0%
unpow24.0%
associate-*r*4.0%
*-commutative4.0%
associate-*r*4.0%
associate-*l*4.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in x around 0 64.1%
*-commutative64.1%
unpow264.1%
Simplified64.1%
if 1.14999999999999997e77 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 6.6%
unpow26.6%
Simplified6.6%
Taylor expanded in x around 0 5.5%
+-commutative5.5%
unpow25.5%
*-commutative5.5%
associate-*r*5.5%
fma-udef5.5%
Simplified5.5%
fma-udef5.5%
associate-*r*5.5%
unpow25.5%
*-commutative5.5%
unpow25.5%
Applied egg-rr5.5%
expm1-log1p-u5.5%
expm1-udef5.5%
log1p-udef5.5%
add-exp-log5.5%
flip-+84.2%
div-inv84.2%
fma-neg84.2%
metadata-eval84.2%
swap-sqr84.2%
metadata-eval84.2%
pow284.2%
pow284.2%
pow-prod-up84.2%
metadata-eval84.2%
*-commutative84.2%
associate-*l*84.2%
metadata-eval84.2%
Applied egg-rr84.2%
fma-udef84.2%
+-commutative84.2%
associate-*r/84.2%
*-rgt-identity84.2%
*-commutative84.2%
associate-*r*84.2%
*-commutative84.2%
cancel-sign-sub-inv84.2%
metadata-eval84.2%
*-commutative84.2%
Simplified84.2%
if 1.4e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
unpow2100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 100.0%
associate-*r*100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
Final simplification83.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y 8.5e+25)
(* (cos x) (+ 1.0 t_0))
(if (<= y 1.15e+77)
(* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))
(if (<= y 1.4e+154)
(+
-1.0
(/
(- 1.0 (* (pow y 4.0) 0.027777777777777776))
(+ 1.0 (* (* y y) -0.16666666666666666))))
(* (cos x) t_0))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 8.5e+25) {
tmp = cos(x) * (1.0 + t_0);
} else if (y <= 1.15e+77) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else if (y <= 1.4e+154) {
tmp = -1.0 + ((1.0 - (pow(y, 4.0) * 0.027777777777777776)) / (1.0 + ((y * y) * -0.16666666666666666)));
} else {
tmp = cos(x) * 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 = 0.16666666666666666d0 * (y * y)
if (y <= 8.5d+25) then
tmp = cos(x) * (1.0d0 + t_0)
else if (y <= 1.15d+77) then
tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
else if (y <= 1.4d+154) then
tmp = (-1.0d0) + ((1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0)) / (1.0d0 + ((y * y) * (-0.16666666666666666d0))))
else
tmp = cos(x) * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 8.5e+25) {
tmp = Math.cos(x) * (1.0 + t_0);
} else if (y <= 1.15e+77) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else if (y <= 1.4e+154) {
tmp = -1.0 + ((1.0 - (Math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + ((y * y) * -0.16666666666666666)));
} else {
tmp = Math.cos(x) * t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= 8.5e+25: tmp = math.cos(x) * (1.0 + t_0) elif y <= 1.15e+77: tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))) elif y <= 1.4e+154: tmp = -1.0 + ((1.0 - (math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + ((y * y) * -0.16666666666666666))) else: tmp = math.cos(x) * t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= 8.5e+25) tmp = Float64(cos(x) * Float64(1.0 + t_0)); elseif (y <= 1.15e+77) tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333)))); elseif (y <= 1.4e+154) tmp = Float64(-1.0 + Float64(Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776)) / Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666)))); else tmp = Float64(cos(x) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= 8.5e+25) tmp = cos(x) * (1.0 + t_0); elseif (y <= 1.15e+77) tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))); elseif (y <= 1.4e+154) tmp = -1.0 + ((1.0 - ((y ^ 4.0) * 0.027777777777777776)) / (1.0 + ((y * y) * -0.16666666666666666))); else tmp = cos(x) * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 8.5e+25], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+77], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], N[(-1.0 + N[(N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\
\;\;\;\;\cos x \cdot \left(1 + t_0\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666}\\
\mathbf{else}:\\
\;\;\;\;\cos x \cdot t_0\\
\end{array}
\end{array}
if y < 8.5000000000000007e25Initial program 100.0%
Taylor expanded in y around 0 82.0%
unpow282.0%
Simplified82.0%
if 8.5000000000000007e25 < y < 1.14999999999999997e77Initial program 100.0%
Taylor expanded in y around 0 4.0%
unpow24.0%
Simplified4.0%
Taylor expanded in y around inf 4.0%
unpow24.0%
associate-*r*4.0%
*-commutative4.0%
associate-*r*4.0%
associate-*l*4.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in x around 0 64.1%
*-commutative64.1%
unpow264.1%
Simplified64.1%
if 1.14999999999999997e77 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 6.6%
unpow26.6%
Simplified6.6%
Taylor expanded in x around 0 5.5%
+-commutative5.5%
unpow25.5%
*-commutative5.5%
associate-*r*5.5%
fma-udef5.5%
Simplified5.5%
Taylor expanded in y around inf 5.5%
unpow25.5%
Simplified5.5%
expm1-log1p-u5.5%
expm1-udef5.5%
log1p-udef5.5%
add-exp-log5.5%
flip-+84.2%
div-inv84.2%
fma-neg84.2%
metadata-eval84.2%
swap-sqr84.2%
metadata-eval84.2%
pow284.2%
pow284.2%
pow-prod-up84.2%
metadata-eval84.2%
*-commutative84.2%
associate-*l*84.2%
metadata-eval84.2%
Applied egg-rr84.2%
fma-udef84.2%
+-commutative84.2%
associate-*r/84.2%
*-rgt-identity84.2%
*-commutative84.2%
associate-*r*84.2%
*-commutative84.2%
cancel-sign-sub-inv84.2%
metadata-eval84.2%
*-commutative84.2%
Simplified84.2%
if 1.4e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
unpow2100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 100.0%
associate-*r*100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
Final simplification83.3%
(FPCore (x y) :precision binary64 (if (or (<= y 1.15e+26) (not (<= y 1.35e+147))) (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y)))) (* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))))
double code(double x, double y) {
double tmp;
if ((y <= 1.15e+26) || !(y <= 1.35e+147)) {
tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= 1.15d+26) .or. (.not. (y <= 1.35d+147))) then
tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else
tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 1.15e+26) || !(y <= 1.35e+147)) {
tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 1.15e+26) or not (y <= 1.35e+147): tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) else: tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))) return tmp
function code(x, y) tmp = 0.0 if ((y <= 1.15e+26) || !(y <= 1.35e+147)) tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); else tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 1.15e+26) || ~((y <= 1.35e+147))) tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); else tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 1.15e+26], N[Not[LessEqual[y, 1.35e+147]], $MachinePrecision]], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{+26} \lor \neg \left(y \leq 1.35 \cdot 10^{+147}\right):\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\end{array}
\end{array}
if y < 1.15e26 or 1.34999999999999999e147 < y Initial program 100.0%
Taylor expanded in y around 0 83.6%
unpow283.6%
Simplified83.6%
if 1.15e26 < y < 1.34999999999999999e147Initial program 100.0%
Taylor expanded in y around 0 5.7%
unpow25.7%
Simplified5.7%
Taylor expanded in y around inf 5.7%
unpow25.7%
associate-*r*5.7%
*-commutative5.7%
associate-*r*5.7%
associate-*l*5.7%
*-commutative5.7%
Simplified5.7%
Taylor expanded in x around 0 33.8%
*-commutative33.8%
unpow233.8%
Simplified33.8%
Final simplification78.6%
(FPCore (x y)
:precision binary64
(if (<= y 8.5e+25)
(cos x)
(if (<= y 1.35e+147)
(* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))
(* y (* y (* (cos x) 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (y <= 8.5e+25) {
tmp = cos(x);
} else if (y <= 1.35e+147) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else {
tmp = y * (y * (cos(x) * 0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 8.5d+25) then
tmp = cos(x)
else if (y <= 1.35d+147) then
tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
else
tmp = y * (y * (cos(x) * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 8.5e+25) {
tmp = Math.cos(x);
} else if (y <= 1.35e+147) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else {
tmp = y * (y * (Math.cos(x) * 0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8.5e+25: tmp = math.cos(x) elif y <= 1.35e+147: tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))) else: tmp = y * (y * (math.cos(x) * 0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (y <= 8.5e+25) tmp = cos(x); elseif (y <= 1.35e+147) tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333)))); else tmp = Float64(y * Float64(y * Float64(cos(x) * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8.5e+25) tmp = cos(x); elseif (y <= 1.35e+147) tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))); else tmp = y * (y * (cos(x) * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8.5e+25], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.35e+147], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(N[Cos[x], $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+147}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if y < 8.5000000000000007e25Initial program 100.0%
Taylor expanded in y around 0 64.4%
if 8.5000000000000007e25 < y < 1.34999999999999999e147Initial program 100.0%
Taylor expanded in y around 0 5.7%
unpow25.7%
Simplified5.7%
Taylor expanded in y around inf 5.7%
unpow25.7%
associate-*r*5.7%
*-commutative5.7%
associate-*r*5.7%
associate-*l*5.7%
*-commutative5.7%
Simplified5.7%
Taylor expanded in x around 0 33.8%
*-commutative33.8%
unpow233.8%
Simplified33.8%
if 1.34999999999999999e147 < y Initial program 100.0%
Taylor expanded in y around 0 96.5%
unpow296.5%
Simplified96.5%
Taylor expanded in y around inf 96.5%
unpow296.5%
associate-*r*96.5%
*-commutative96.5%
associate-*r*96.5%
associate-*l*93.4%
*-commutative93.4%
Simplified93.4%
Final simplification64.3%
(FPCore (x y)
:precision binary64
(if (<= y 8.5e+25)
(cos x)
(if (<= y 1.35e+147)
(* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))
(* (cos x) (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 8.5e+25) {
tmp = cos(x);
} else if (y <= 1.35e+147) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else {
tmp = cos(x) * (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 <= 8.5d+25) then
tmp = cos(x)
else if (y <= 1.35d+147) then
tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
else
tmp = cos(x) * (0.16666666666666666d0 * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 8.5e+25) {
tmp = Math.cos(x);
} else if (y <= 1.35e+147) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else {
tmp = Math.cos(x) * (0.16666666666666666 * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8.5e+25: tmp = math.cos(x) elif y <= 1.35e+147: tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))) else: tmp = math.cos(x) * (0.16666666666666666 * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 8.5e+25) tmp = cos(x); elseif (y <= 1.35e+147) tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333)))); else tmp = Float64(cos(x) * Float64(0.16666666666666666 * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8.5e+25) tmp = cos(x); elseif (y <= 1.35e+147) tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))); else tmp = cos(x) * (0.16666666666666666 * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8.5e+25], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.35e+147], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+147}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 8.5000000000000007e25Initial program 100.0%
Taylor expanded in y around 0 64.4%
if 8.5000000000000007e25 < y < 1.34999999999999999e147Initial program 100.0%
Taylor expanded in y around 0 5.7%
unpow25.7%
Simplified5.7%
Taylor expanded in y around inf 5.7%
unpow25.7%
associate-*r*5.7%
*-commutative5.7%
associate-*r*5.7%
associate-*l*5.7%
*-commutative5.7%
Simplified5.7%
Taylor expanded in x around 0 33.8%
*-commutative33.8%
unpow233.8%
Simplified33.8%
if 1.34999999999999999e147 < y Initial program 100.0%
Taylor expanded in y around 0 96.5%
unpow296.5%
Simplified96.5%
Taylor expanded in y around inf 96.5%
unpow296.5%
associate-*r*96.5%
*-commutative96.5%
associate-*r*96.5%
associate-*l*93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in y around 0 96.5%
associate-*r*96.5%
unpow296.5%
*-commutative96.5%
Simplified96.5%
Final simplification64.6%
(FPCore (x y)
:precision binary64
(if (<= y 1.45e+26)
(cos x)
(if (or (<= y 3.4e+216) (not (<= y 1.5e+268)))
(* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))
(+ 1.0 (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 1.45e+26) {
tmp = cos(x);
} else if ((y <= 3.4e+216) || !(y <= 1.5e+268)) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} 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) :: tmp
if (y <= 1.45d+26) then
tmp = cos(x)
else if ((y <= 3.4d+216) .or. (.not. (y <= 1.5d+268))) then
tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
else
tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.45e+26) {
tmp = Math.cos(x);
} else if ((y <= 3.4e+216) || !(y <= 1.5e+268)) {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
} else {
tmp = 1.0 + (0.16666666666666666 * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.45e+26: tmp = math.cos(x) elif (y <= 3.4e+216) or not (y <= 1.5e+268): tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))) else: tmp = 1.0 + (0.16666666666666666 * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.45e+26) tmp = cos(x); elseif ((y <= 3.4e+216) || !(y <= 1.5e+268)) tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333)))); else tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.45e+26) tmp = cos(x); elseif ((y <= 3.4e+216) || ~((y <= 1.5e+268))) tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))); else tmp = 1.0 + (0.16666666666666666 * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.45e+26], N[Cos[x], $MachinePrecision], If[Or[LessEqual[y, 3.4e+216], N[Not[LessEqual[y, 1.5e+268]], $MachinePrecision]], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.45 \cdot 10^{+26}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+216} \lor \neg \left(y \leq 1.5 \cdot 10^{+268}\right):\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 1.45e26Initial program 100.0%
Taylor expanded in y around 0 64.4%
if 1.45e26 < y < 3.40000000000000026e216 or 1.49999999999999996e268 < y Initial program 100.0%
Taylor expanded in y around 0 43.5%
unpow243.5%
Simplified43.5%
Taylor expanded in y around inf 43.5%
unpow243.5%
associate-*r*43.5%
*-commutative43.5%
associate-*r*43.5%
associate-*l*41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in x around 0 55.3%
*-commutative55.3%
unpow255.3%
Simplified55.3%
if 3.40000000000000026e216 < y < 1.49999999999999996e268Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x around 0 71.4%
+-commutative71.4%
unpow271.4%
*-commutative71.4%
associate-*r*71.4%
fma-udef71.4%
Simplified71.4%
fma-udef71.4%
associate-*r*71.4%
unpow271.4%
*-commutative71.4%
unpow271.4%
Applied egg-rr71.4%
Final simplification63.0%
(FPCore (x y) :precision binary64 (if (or (<= y 8.5e+25) (and (not (<= y 2e+217)) (<= y 1.25e+268))) (+ 1.0 (* 0.16666666666666666 (* y y))) (* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))))
double code(double x, double y) {
double tmp;
if ((y <= 8.5e+25) || (!(y <= 2e+217) && (y <= 1.25e+268))) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= 8.5d+25) .or. (.not. (y <= 2d+217)) .and. (y <= 1.25d+268)) then
tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
else
tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 8.5e+25) || (!(y <= 2e+217) && (y <= 1.25e+268))) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 8.5e+25) or (not (y <= 2e+217) and (y <= 1.25e+268)): tmp = 1.0 + (0.16666666666666666 * (y * y)) else: tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))) return tmp
function code(x, y) tmp = 0.0 if ((y <= 8.5e+25) || (!(y <= 2e+217) && (y <= 1.25e+268))) tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); else tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 8.5e+25) || (~((y <= 2e+217)) && (y <= 1.25e+268))) tmp = 1.0 + (0.16666666666666666 * (y * y)); else tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 8.5e+25], And[N[Not[LessEqual[y, 2e+217]], $MachinePrecision], LessEqual[y, 1.25e+268]]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25} \lor \neg \left(y \leq 2 \cdot 10^{+217}\right) \land y \leq 1.25 \cdot 10^{+268}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\
\end{array}
\end{array}
if y < 8.5000000000000007e25 or 1.99999999999999992e217 < y < 1.2500000000000001e268Initial program 100.0%
Taylor expanded in y around 0 82.6%
unpow282.6%
Simplified82.6%
Taylor expanded in x around 0 49.5%
+-commutative49.5%
unpow249.5%
*-commutative49.5%
associate-*r*49.5%
fma-udef49.5%
Simplified49.5%
fma-udef49.5%
associate-*r*49.5%
unpow249.5%
*-commutative49.5%
unpow249.5%
Applied egg-rr49.5%
if 8.5000000000000007e25 < y < 1.99999999999999992e217 or 1.2500000000000001e268 < y Initial program 100.0%
Taylor expanded in y around 0 43.5%
unpow243.5%
Simplified43.5%
Taylor expanded in y around inf 43.5%
unpow243.5%
associate-*r*43.5%
*-commutative43.5%
associate-*r*43.5%
associate-*l*41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in x around 0 55.3%
*-commutative55.3%
unpow255.3%
Simplified55.3%
Final simplification50.5%
(FPCore (x y) :precision binary64 (if (or (<= x 2.7e+77) (and (not (<= x 4.8e+246)) (<= x 1.85e+283))) (+ 1.0 (* 0.16666666666666666 (* y y))) (* y (* x (* y (* x -0.08333333333333333))))))
double code(double x, double y) {
double tmp;
if ((x <= 2.7e+77) || (!(x <= 4.8e+246) && (x <= 1.85e+283))) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = y * (x * (y * (x * -0.08333333333333333)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= 2.7d+77) .or. (.not. (x <= 4.8d+246)) .and. (x <= 1.85d+283)) then
tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
else
tmp = y * (x * (y * (x * (-0.08333333333333333d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= 2.7e+77) || (!(x <= 4.8e+246) && (x <= 1.85e+283))) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = y * (x * (y * (x * -0.08333333333333333)));
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= 2.7e+77) or (not (x <= 4.8e+246) and (x <= 1.85e+283)): tmp = 1.0 + (0.16666666666666666 * (y * y)) else: tmp = y * (x * (y * (x * -0.08333333333333333))) return tmp
function code(x, y) tmp = 0.0 if ((x <= 2.7e+77) || (!(x <= 4.8e+246) && (x <= 1.85e+283))) tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); else tmp = Float64(y * Float64(x * Float64(y * Float64(x * -0.08333333333333333)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= 2.7e+77) || (~((x <= 4.8e+246)) && (x <= 1.85e+283))) tmp = 1.0 + (0.16666666666666666 * (y * y)); else tmp = y * (x * (y * (x * -0.08333333333333333))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, 2.7e+77], And[N[Not[LessEqual[x, 4.8e+246]], $MachinePrecision], LessEqual[x, 1.85e+283]]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * N[(y * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+77} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right) \land x \leq 1.85 \cdot 10^{+283}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(y \cdot \left(x \cdot -0.08333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if x < 2.6999999999999998e77 or 4.8e246 < x < 1.85e283Initial program 100.0%
Taylor expanded in y around 0 75.4%
unpow275.4%
Simplified75.4%
Taylor expanded in x around 0 50.8%
+-commutative50.8%
unpow250.8%
*-commutative50.8%
associate-*r*50.5%
fma-udef50.5%
Simplified50.5%
fma-udef50.5%
associate-*r*50.8%
unpow250.8%
*-commutative50.8%
unpow250.8%
Applied egg-rr50.8%
if 2.6999999999999998e77 < x < 4.8e246 or 1.85e283 < x Initial program 100.0%
Taylor expanded in y around 0 78.2%
unpow278.2%
Simplified78.2%
Taylor expanded in y around inf 29.5%
unpow229.5%
associate-*r*29.5%
*-commutative29.5%
associate-*r*29.5%
associate-*l*29.5%
*-commutative29.5%
Simplified29.5%
Taylor expanded in x around 0 27.1%
*-commutative27.1%
unpow227.1%
Simplified27.1%
Taylor expanded in x around inf 27.1%
*-commutative27.1%
unpow227.1%
associate-*l*27.4%
*-commutative27.4%
associate-*l*27.4%
associate-*r*27.4%
Simplified27.4%
Final simplification48.0%
(FPCore (x y) :precision binary64 (if (or (<= x 2.7e+77) (not (<= x 4.8e+246))) (+ 1.0 (* 0.16666666666666666 (* y y))) (* x (* (* x y) (* y -0.08333333333333333)))))
double code(double x, double y) {
double tmp;
if ((x <= 2.7e+77) || !(x <= 4.8e+246)) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = x * ((x * y) * (y * -0.08333333333333333));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= 2.7d+77) .or. (.not. (x <= 4.8d+246))) then
tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
else
tmp = x * ((x * y) * (y * (-0.08333333333333333d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= 2.7e+77) || !(x <= 4.8e+246)) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = x * ((x * y) * (y * -0.08333333333333333));
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= 2.7e+77) or not (x <= 4.8e+246): tmp = 1.0 + (0.16666666666666666 * (y * y)) else: tmp = x * ((x * y) * (y * -0.08333333333333333)) return tmp
function code(x, y) tmp = 0.0 if ((x <= 2.7e+77) || !(x <= 4.8e+246)) tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); else tmp = Float64(x * Float64(Float64(x * y) * Float64(y * -0.08333333333333333))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= 2.7e+77) || ~((x <= 4.8e+246))) tmp = 1.0 + (0.16666666666666666 * (y * y)); else tmp = x * ((x * y) * (y * -0.08333333333333333)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, 2.7e+77], N[Not[LessEqual[x, 4.8e+246]], $MachinePrecision]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(x * y), $MachinePrecision] * N[(y * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+77} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right):\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(x \cdot y\right) \cdot \left(y \cdot -0.08333333333333333\right)\right)\\
\end{array}
\end{array}
if x < 2.6999999999999998e77 or 4.8e246 < x Initial program 100.0%
Taylor expanded in y around 0 75.7%
unpow275.7%
Simplified75.7%
Taylor expanded in x around 0 50.7%
+-commutative50.7%
unpow250.7%
*-commutative50.7%
associate-*r*50.3%
fma-udef50.3%
Simplified50.3%
fma-udef50.3%
associate-*r*50.7%
unpow250.7%
*-commutative50.7%
unpow250.7%
Applied egg-rr50.7%
if 2.6999999999999998e77 < x < 4.8e246Initial program 100.0%
Taylor expanded in y around 0 75.8%
unpow275.8%
Simplified75.8%
Taylor expanded in y around inf 28.7%
unpow228.7%
associate-*r*28.7%
*-commutative28.7%
associate-*r*28.7%
associate-*l*28.7%
*-commutative28.7%
Simplified28.7%
Taylor expanded in x around 0 29.9%
*-commutative29.9%
unpow229.9%
Simplified29.9%
Taylor expanded in x around inf 29.6%
*-commutative29.6%
unpow229.6%
unpow229.6%
associate-*r*29.9%
*-commutative29.9%
associate-*r*29.9%
*-commutative29.9%
associate-*r*30.2%
*-commutative30.2%
associate-*l*30.2%
*-commutative30.2%
Simplified30.2%
Final simplification48.4%
(FPCore (x y) :precision binary64 (if (or (<= x 8.8e+163) (not (<= x 4.8e+246))) (+ 1.0 (* 0.16666666666666666 (* y y))) (+ 1.0 (* (* x x) -0.5))))
double code(double x, double y) {
double tmp;
if ((x <= 8.8e+163) || !(x <= 4.8e+246)) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = 1.0 + ((x * x) * -0.5);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= 8.8d+163) .or. (.not. (x <= 4.8d+246))) then
tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
else
tmp = 1.0d0 + ((x * x) * (-0.5d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= 8.8e+163) || !(x <= 4.8e+246)) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = 1.0 + ((x * x) * -0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= 8.8e+163) or not (x <= 4.8e+246): tmp = 1.0 + (0.16666666666666666 * (y * y)) else: tmp = 1.0 + ((x * x) * -0.5) return tmp
function code(x, y) tmp = 0.0 if ((x <= 8.8e+163) || !(x <= 4.8e+246)) tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); else tmp = Float64(1.0 + Float64(Float64(x * x) * -0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= 8.8e+163) || ~((x <= 4.8e+246))) tmp = 1.0 + (0.16666666666666666 * (y * y)); else tmp = 1.0 + ((x * x) * -0.5); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, 8.8e+163], N[Not[LessEqual[x, 4.8e+246]], $MachinePrecision]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.8 \cdot 10^{+163} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right):\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\
\end{array}
\end{array}
if x < 8.79999999999999945e163 or 4.8e246 < x Initial program 100.0%
Taylor expanded in y around 0 75.7%
unpow275.7%
Simplified75.7%
Taylor expanded in x around 0 49.4%
+-commutative49.4%
unpow249.4%
*-commutative49.4%
associate-*r*49.0%
fma-udef49.0%
Simplified49.0%
fma-udef49.0%
associate-*r*49.4%
unpow249.4%
*-commutative49.4%
unpow249.4%
Applied egg-rr49.4%
if 8.79999999999999945e163 < x < 4.8e246Initial program 100.0%
log1p-expm1-u99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 43.4%
expm1-def43.8%
Simplified43.8%
Taylor expanded in x around 0 35.8%
unpow235.8%
Simplified35.8%
Final simplification48.3%
(FPCore (x y)
:precision binary64
(if (<= y 8.5e+25)
1.0
(if (<= y 1.4e+120)
(+ 1.0 (* (* x x) -0.5))
(* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 8.5e+25) {
tmp = 1.0;
} else if (y <= 1.4e+120) {
tmp = 1.0 + ((x * x) * -0.5);
} 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 <= 8.5d+25) then
tmp = 1.0d0
else if (y <= 1.4d+120) then
tmp = 1.0d0 + ((x * x) * (-0.5d0))
else
tmp = 0.16666666666666666d0 * (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 8.5e+25) {
tmp = 1.0;
} else if (y <= 1.4e+120) {
tmp = 1.0 + ((x * x) * -0.5);
} else {
tmp = 0.16666666666666666 * (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8.5e+25: tmp = 1.0 elif y <= 1.4e+120: tmp = 1.0 + ((x * x) * -0.5) else: tmp = 0.16666666666666666 * (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 8.5e+25) tmp = 1.0; elseif (y <= 1.4e+120) tmp = Float64(1.0 + Float64(Float64(x * x) * -0.5)); else tmp = Float64(0.16666666666666666 * Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8.5e+25) tmp = 1.0; elseif (y <= 1.4e+120) tmp = 1.0 + ((x * x) * -0.5); else tmp = 0.16666666666666666 * (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8.5e+25], 1.0, If[LessEqual[y, 1.4e+120], N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+120}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 8.5000000000000007e25Initial program 100.0%
log1p-expm1-u99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 64.1%
expm1-def64.3%
Simplified64.3%
Taylor expanded in x around 0 37.2%
if 8.5000000000000007e25 < y < 1.4e120Initial program 100.0%
log1p-expm1-u100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 3.1%
expm1-def3.1%
Simplified3.1%
Taylor expanded in x around 0 33.2%
unpow233.2%
Simplified33.2%
if 1.4e120 < y Initial program 100.0%
Taylor expanded in y around 0 77.7%
unpow277.7%
Simplified77.7%
Taylor expanded in x around 0 59.2%
+-commutative59.2%
unpow259.2%
*-commutative59.2%
associate-*r*56.8%
fma-udef56.8%
Simplified56.8%
Taylor expanded in y around inf 59.2%
unpow259.2%
Simplified59.2%
Final simplification39.8%
(FPCore (x y) :precision binary64 (if (<= y 13.0) 1.0 (* 0.16666666666666666 (* y y))))
double code(double x, double y) {
double tmp;
if (y <= 13.0) {
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 <= 13.0d0) 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 <= 13.0) {
tmp = 1.0;
} else {
tmp = 0.16666666666666666 * (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 13.0: tmp = 1.0 else: tmp = 0.16666666666666666 * (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 13.0) 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 <= 13.0) tmp = 1.0; else tmp = 0.16666666666666666 * (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 13.0], 1.0, N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 13:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 13Initial program 100.0%
log1p-expm1-u99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 64.7%
expm1-def64.9%
Simplified64.9%
Taylor expanded in x around 0 37.6%
if 13 < y Initial program 100.0%
Taylor expanded in y around 0 49.3%
unpow249.3%
Simplified49.3%
Taylor expanded in x around 0 37.4%
+-commutative37.4%
unpow237.4%
*-commutative37.4%
associate-*r*35.9%
fma-udef35.9%
Simplified35.9%
Taylor expanded in y around inf 37.4%
unpow237.4%
Simplified37.4%
Final simplification37.5%
(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%
log1p-expm1-u99.5%
Applied egg-rr99.5%
Taylor expanded in y around 0 51.7%
expm1-def51.9%
Simplified51.9%
Taylor expanded in x around 0 30.2%
Final simplification30.2%
herbie shell --seed 2023279
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))