
(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 15 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 (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))))
(if (<= y 820.0)
t_0
(if (<= y 2.15e+50)
(*
0.16666666666666666
(+ (* y y) (* y (* (pow x 4.0) (* y 0.041666666666666664)))))
(if (<= y 7e+153) (cbrt (* 0.004629629629629629 (pow y 6.0))) t_0)))))
double code(double x, double y) {
double t_0 = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
double tmp;
if (y <= 820.0) {
tmp = t_0;
} else if (y <= 2.15e+50) {
tmp = 0.16666666666666666 * ((y * y) + (y * (pow(x, 4.0) * (y * 0.041666666666666664))));
} else if (y <= 7e+153) {
tmp = cbrt((0.004629629629629629 * pow(y, 6.0)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
double tmp;
if (y <= 820.0) {
tmp = t_0;
} else if (y <= 2.15e+50) {
tmp = 0.16666666666666666 * ((y * y) + (y * (Math.pow(x, 4.0) * (y * 0.041666666666666664))));
} else if (y <= 7e+153) {
tmp = Math.cbrt((0.004629629629629629 * Math.pow(y, 6.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) tmp = 0.0 if (y <= 820.0) tmp = t_0; elseif (y <= 2.15e+50) tmp = Float64(0.16666666666666666 * Float64(Float64(y * y) + Float64(y * Float64((x ^ 4.0) * Float64(y * 0.041666666666666664))))); elseif (y <= 7e+153) tmp = cbrt(Float64(0.004629629629629629 * (y ^ 6.0))); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 820.0], t$95$0, If[LessEqual[y, 2.15e+50], N[(0.16666666666666666 * N[(N[(y * y), $MachinePrecision] + N[(y * N[(N[Power[x, 4.0], $MachinePrecision] * N[(y * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+153], N[Power[N[(0.004629629629629629 * N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{if}\;y \leq 820:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+50}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y + y \cdot \left({x}^{4} \cdot \left(y \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;\sqrt[3]{0.004629629629629629 \cdot {y}^{6}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 820 or 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 90.0%
Taylor expanded in y around 0 85.7%
unpow285.7%
Simplified85.7%
if 820 < y < 2.1499999999999999e50Initial program 100.0%
Taylor expanded in y around 0 3.7%
Taylor expanded in y around inf 3.7%
*-commutative3.7%
unpow23.7%
associate-*l*3.7%
Simplified3.7%
Taylor expanded in x around 0 2.7%
unpow22.7%
associate-+r+2.7%
+-commutative2.7%
*-commutative2.7%
unpow22.7%
associate-*l*2.7%
*-commutative2.7%
unpow22.7%
associate-*l*2.7%
distribute-lft-out2.7%
unpow22.7%
Simplified2.7%
Taylor expanded in x around inf 25.8%
*-commutative25.8%
unpow225.8%
associate-*r*25.8%
associate-*r*25.8%
*-commutative25.8%
associate-*l*25.8%
Simplified25.8%
if 2.1499999999999999e50 < y < 6.9999999999999998e153Initial program 100.0%
Taylor expanded in y around 0 49.5%
Taylor expanded in y around inf 6.0%
*-commutative6.0%
unpow26.0%
associate-*l*6.0%
Simplified6.0%
Taylor expanded in x around 0 5.2%
add-cbrt-cube81.4%
pow1/381.4%
pow381.4%
unpow-prod-down84.4%
metadata-eval84.4%
Applied egg-rr84.4%
unpow1/384.4%
cube-prod84.4%
pow-sqr84.4%
metadata-eval84.4%
Simplified84.4%
Final simplification82.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y)))))
(t_1 (* y (* y 0.16666666666666666)))
(t_2 (* t_1 t_1)))
(if (<= y 650.0)
t_0
(if (<= y 5.8e+51)
(*
0.16666666666666666
(+ (* y y) (* y (* (pow x 4.0) (* y 0.041666666666666664)))))
(if (<= y 2.8e+77)
(/ (+ 1.0 (pow t_1 3.0)) (+ t_2 (- 1.0 t_1)))
(if (<= y 7e+153) (/ (+ t_2 -1.0) (+ t_1 -1.0)) t_0))))))
double code(double x, double y) {
double t_0 = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
double t_1 = y * (y * 0.16666666666666666);
double t_2 = t_1 * t_1;
double tmp;
if (y <= 650.0) {
tmp = t_0;
} else if (y <= 5.8e+51) {
tmp = 0.16666666666666666 * ((y * y) + (y * (pow(x, 4.0) * (y * 0.041666666666666664))));
} else if (y <= 2.8e+77) {
tmp = (1.0 + pow(t_1, 3.0)) / (t_2 + (1.0 - t_1));
} else if (y <= 7e+153) {
tmp = (t_2 + -1.0) / (t_1 + -1.0);
} 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) :: t_2
real(8) :: tmp
t_0 = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
t_1 = y * (y * 0.16666666666666666d0)
t_2 = t_1 * t_1
if (y <= 650.0d0) then
tmp = t_0
else if (y <= 5.8d+51) then
tmp = 0.16666666666666666d0 * ((y * y) + (y * ((x ** 4.0d0) * (y * 0.041666666666666664d0))))
else if (y <= 2.8d+77) then
tmp = (1.0d0 + (t_1 ** 3.0d0)) / (t_2 + (1.0d0 - t_1))
else if (y <= 7d+153) then
tmp = (t_2 + (-1.0d0)) / (t_1 + (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
double t_1 = y * (y * 0.16666666666666666);
double t_2 = t_1 * t_1;
double tmp;
if (y <= 650.0) {
tmp = t_0;
} else if (y <= 5.8e+51) {
tmp = 0.16666666666666666 * ((y * y) + (y * (Math.pow(x, 4.0) * (y * 0.041666666666666664))));
} else if (y <= 2.8e+77) {
tmp = (1.0 + Math.pow(t_1, 3.0)) / (t_2 + (1.0 - t_1));
} else if (y <= 7e+153) {
tmp = (t_2 + -1.0) / (t_1 + -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) t_1 = y * (y * 0.16666666666666666) t_2 = t_1 * t_1 tmp = 0 if y <= 650.0: tmp = t_0 elif y <= 5.8e+51: tmp = 0.16666666666666666 * ((y * y) + (y * (math.pow(x, 4.0) * (y * 0.041666666666666664)))) elif y <= 2.8e+77: tmp = (1.0 + math.pow(t_1, 3.0)) / (t_2 + (1.0 - t_1)) elif y <= 7e+153: tmp = (t_2 + -1.0) / (t_1 + -1.0) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) t_1 = Float64(y * Float64(y * 0.16666666666666666)) t_2 = Float64(t_1 * t_1) tmp = 0.0 if (y <= 650.0) tmp = t_0; elseif (y <= 5.8e+51) tmp = Float64(0.16666666666666666 * Float64(Float64(y * y) + Float64(y * Float64((x ^ 4.0) * Float64(y * 0.041666666666666664))))); elseif (y <= 2.8e+77) tmp = Float64(Float64(1.0 + (t_1 ^ 3.0)) / Float64(t_2 + Float64(1.0 - t_1))); elseif (y <= 7e+153) tmp = Float64(Float64(t_2 + -1.0) / Float64(t_1 + -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); t_1 = y * (y * 0.16666666666666666); t_2 = t_1 * t_1; tmp = 0.0; if (y <= 650.0) tmp = t_0; elseif (y <= 5.8e+51) tmp = 0.16666666666666666 * ((y * y) + (y * ((x ^ 4.0) * (y * 0.041666666666666664)))); elseif (y <= 2.8e+77) tmp = (1.0 + (t_1 ^ 3.0)) / (t_2 + (1.0 - t_1)); elseif (y <= 7e+153) tmp = (t_2 + -1.0) / (t_1 + -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, If[LessEqual[y, 650.0], t$95$0, If[LessEqual[y, 5.8e+51], N[(0.16666666666666666 * N[(N[(y * y), $MachinePrecision] + N[(y * N[(N[Power[x, 4.0], $MachinePrecision] * N[(y * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+77], N[(N[(1.0 + N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$2 + N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+153], N[(N[(t$95$2 + -1.0), $MachinePrecision] / N[(t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
t_1 := y \cdot \left(y \cdot 0.16666666666666666\right)\\
t_2 := t_1 \cdot t_1\\
\mathbf{if}\;y \leq 650:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+51}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y + y \cdot \left({x}^{4} \cdot \left(y \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+77}:\\
\;\;\;\;\frac{1 + {t_1}^{3}}{t_2 + \left(1 - t_1\right)}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;\frac{t_2 + -1}{t_1 + -1}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 650 or 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 90.0%
Taylor expanded in y around 0 85.7%
unpow285.7%
Simplified85.7%
if 650 < y < 5.7999999999999997e51Initial program 100.0%
Taylor expanded in y around 0 3.7%
Taylor expanded in y around inf 3.7%
*-commutative3.7%
unpow23.7%
associate-*l*3.7%
Simplified3.7%
Taylor expanded in x around 0 3.0%
unpow23.0%
associate-+r+3.0%
+-commutative3.0%
*-commutative3.0%
unpow23.0%
associate-*l*3.0%
*-commutative3.0%
unpow23.0%
associate-*l*3.0%
distribute-lft-out3.0%
unpow23.0%
Simplified3.0%
Taylor expanded in x around inf 24.4%
*-commutative24.4%
unpow224.4%
associate-*r*24.4%
associate-*r*24.4%
*-commutative24.4%
associate-*l*24.4%
Simplified24.4%
if 5.7999999999999997e51 < y < 2.8e77Initial program 100.0%
Taylor expanded in y around 0 4.3%
Taylor expanded in y around 0 4.3%
unpow24.3%
Simplified4.3%
Taylor expanded in x around 0 4.3%
+-commutative4.3%
unpow24.3%
associate-*r*4.3%
fma-def4.3%
Simplified4.3%
fma-udef4.3%
flip3-+100.0%
*-commutative100.0%
*-commutative100.0%
metadata-eval100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
metadata-eval100.0%
*-commutative100.0%
*-commutative100.0%
Applied egg-rr100.0%
if 2.8e77 < y < 6.9999999999999998e153Initial program 100.0%
Taylor expanded in y around 0 59.9%
Taylor expanded in y around 0 6.4%
unpow26.4%
Simplified6.4%
Taylor expanded in x around 0 5.4%
+-commutative5.4%
unpow25.4%
associate-*r*5.4%
fma-def5.4%
Simplified5.4%
fma-udef5.4%
flip-+80.8%
*-commutative80.8%
*-commutative80.8%
*-commutative80.8%
*-commutative80.8%
metadata-eval80.8%
*-commutative80.8%
*-commutative80.8%
Applied egg-rr80.8%
Final simplification82.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y)))))
(t_1 (* y (* y 0.16666666666666666))))
(if (<= y 600.0)
t_0
(if (<= y 2.2e+66)
(*
0.16666666666666666
(+ (* y y) (* y (* (pow x 4.0) (* y 0.041666666666666664)))))
(if (<= y 7e+153) (/ (+ (* t_1 t_1) -1.0) (+ t_1 -1.0)) t_0)))))
double code(double x, double y) {
double t_0 = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
double t_1 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 600.0) {
tmp = t_0;
} else if (y <= 2.2e+66) {
tmp = 0.16666666666666666 * ((y * y) + (y * (pow(x, 4.0) * (y * 0.041666666666666664))));
} else if (y <= 7e+153) {
tmp = ((t_1 * t_1) + -1.0) / (t_1 + -1.0);
} 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 = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
t_1 = y * (y * 0.16666666666666666d0)
if (y <= 600.0d0) then
tmp = t_0
else if (y <= 2.2d+66) then
tmp = 0.16666666666666666d0 * ((y * y) + (y * ((x ** 4.0d0) * (y * 0.041666666666666664d0))))
else if (y <= 7d+153) then
tmp = ((t_1 * t_1) + (-1.0d0)) / (t_1 + (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
double t_1 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 600.0) {
tmp = t_0;
} else if (y <= 2.2e+66) {
tmp = 0.16666666666666666 * ((y * y) + (y * (Math.pow(x, 4.0) * (y * 0.041666666666666664))));
} else if (y <= 7e+153) {
tmp = ((t_1 * t_1) + -1.0) / (t_1 + -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) t_1 = y * (y * 0.16666666666666666) tmp = 0 if y <= 600.0: tmp = t_0 elif y <= 2.2e+66: tmp = 0.16666666666666666 * ((y * y) + (y * (math.pow(x, 4.0) * (y * 0.041666666666666664)))) elif y <= 7e+153: tmp = ((t_1 * t_1) + -1.0) / (t_1 + -1.0) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) t_1 = Float64(y * Float64(y * 0.16666666666666666)) tmp = 0.0 if (y <= 600.0) tmp = t_0; elseif (y <= 2.2e+66) tmp = Float64(0.16666666666666666 * Float64(Float64(y * y) + Float64(y * Float64((x ^ 4.0) * Float64(y * 0.041666666666666664))))); elseif (y <= 7e+153) tmp = Float64(Float64(Float64(t_1 * t_1) + -1.0) / Float64(t_1 + -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); t_1 = y * (y * 0.16666666666666666); tmp = 0.0; if (y <= 600.0) tmp = t_0; elseif (y <= 2.2e+66) tmp = 0.16666666666666666 * ((y * y) + (y * ((x ^ 4.0) * (y * 0.041666666666666664)))); elseif (y <= 7e+153) tmp = ((t_1 * t_1) + -1.0) / (t_1 + -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 600.0], t$95$0, If[LessEqual[y, 2.2e+66], N[(0.16666666666666666 * N[(N[(y * y), $MachinePrecision] + N[(y * N[(N[Power[x, 4.0], $MachinePrecision] * N[(y * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+153], N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
t_1 := y \cdot \left(y \cdot 0.16666666666666666\right)\\
\mathbf{if}\;y \leq 600:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+66}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y + y \cdot \left({x}^{4} \cdot \left(y \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;\frac{t_1 \cdot t_1 + -1}{t_1 + -1}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 600 or 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 90.0%
Taylor expanded in y around 0 85.7%
unpow285.7%
Simplified85.7%
if 600 < y < 2.1999999999999998e66Initial program 100.0%
Taylor expanded in y around 0 3.8%
Taylor expanded in y around inf 3.8%
*-commutative3.8%
unpow23.8%
associate-*l*3.8%
Simplified3.8%
Taylor expanded in x around 0 8.6%
unpow28.6%
associate-+r+8.6%
+-commutative8.6%
*-commutative8.6%
unpow28.6%
associate-*l*8.6%
*-commutative8.6%
unpow28.6%
associate-*l*8.6%
distribute-lft-out14.5%
unpow214.5%
Simplified14.5%
Taylor expanded in x around inf 32.1%
*-commutative32.1%
unpow232.1%
associate-*r*32.1%
associate-*r*32.1%
*-commutative32.1%
associate-*l*32.1%
Simplified32.1%
if 2.1999999999999998e66 < y < 6.9999999999999998e153Initial program 100.0%
Taylor expanded in y around 0 56.0%
Taylor expanded in y around 0 6.3%
unpow26.3%
Simplified6.3%
Taylor expanded in x around 0 5.3%
+-commutative5.3%
unpow25.3%
associate-*r*5.3%
fma-def5.3%
Simplified5.3%
fma-udef5.3%
flip-+75.3%
*-commutative75.3%
*-commutative75.3%
*-commutative75.3%
*-commutative75.3%
metadata-eval75.3%
*-commutative75.3%
*-commutative75.3%
Applied egg-rr75.3%
Final simplification81.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y)))))
(t_1 (* y (* y 0.16666666666666666))))
(if (<= y 550.0)
t_0
(if (<= y 1.2e+65)
(* (pow x 4.0) (* y (* y 0.006944444444444444)))
(if (<= y 7e+153) (/ (+ (* t_1 t_1) -1.0) (+ t_1 -1.0)) t_0)))))
double code(double x, double y) {
double t_0 = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
double t_1 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 550.0) {
tmp = t_0;
} else if (y <= 1.2e+65) {
tmp = pow(x, 4.0) * (y * (y * 0.006944444444444444));
} else if (y <= 7e+153) {
tmp = ((t_1 * t_1) + -1.0) / (t_1 + -1.0);
} 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 = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
t_1 = y * (y * 0.16666666666666666d0)
if (y <= 550.0d0) then
tmp = t_0
else if (y <= 1.2d+65) then
tmp = (x ** 4.0d0) * (y * (y * 0.006944444444444444d0))
else if (y <= 7d+153) then
tmp = ((t_1 * t_1) + (-1.0d0)) / (t_1 + (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
double t_1 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 550.0) {
tmp = t_0;
} else if (y <= 1.2e+65) {
tmp = Math.pow(x, 4.0) * (y * (y * 0.006944444444444444));
} else if (y <= 7e+153) {
tmp = ((t_1 * t_1) + -1.0) / (t_1 + -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) t_1 = y * (y * 0.16666666666666666) tmp = 0 if y <= 550.0: tmp = t_0 elif y <= 1.2e+65: tmp = math.pow(x, 4.0) * (y * (y * 0.006944444444444444)) elif y <= 7e+153: tmp = ((t_1 * t_1) + -1.0) / (t_1 + -1.0) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) t_1 = Float64(y * Float64(y * 0.16666666666666666)) tmp = 0.0 if (y <= 550.0) tmp = t_0; elseif (y <= 1.2e+65) tmp = Float64((x ^ 4.0) * Float64(y * Float64(y * 0.006944444444444444))); elseif (y <= 7e+153) tmp = Float64(Float64(Float64(t_1 * t_1) + -1.0) / Float64(t_1 + -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); t_1 = y * (y * 0.16666666666666666); tmp = 0.0; if (y <= 550.0) tmp = t_0; elseif (y <= 1.2e+65) tmp = (x ^ 4.0) * (y * (y * 0.006944444444444444)); elseif (y <= 7e+153) tmp = ((t_1 * t_1) + -1.0) / (t_1 + -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 550.0], t$95$0, If[LessEqual[y, 1.2e+65], N[(N[Power[x, 4.0], $MachinePrecision] * N[(y * N[(y * 0.006944444444444444), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+153], N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
t_1 := y \cdot \left(y \cdot 0.16666666666666666\right)\\
\mathbf{if}\;y \leq 550:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+65}:\\
\;\;\;\;{x}^{4} \cdot \left(y \cdot \left(y \cdot 0.006944444444444444\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;\frac{t_1 \cdot t_1 + -1}{t_1 + -1}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 550 or 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 90.0%
Taylor expanded in y around 0 85.7%
unpow285.7%
Simplified85.7%
if 550 < y < 1.2000000000000001e65Initial program 100.0%
Taylor expanded in y around 0 3.8%
Taylor expanded in y around inf 3.8%
*-commutative3.8%
unpow23.8%
associate-*l*3.8%
Simplified3.8%
Taylor expanded in x around 0 8.9%
unpow28.9%
associate-+r+8.9%
+-commutative8.9%
*-commutative8.9%
unpow28.9%
associate-*l*8.9%
*-commutative8.9%
unpow28.9%
associate-*l*8.9%
distribute-lft-out15.1%
unpow215.1%
Simplified15.1%
Taylor expanded in x around inf 32.9%
unpow232.9%
associate-*r*32.9%
*-commutative32.9%
associate-*r*32.9%
Simplified32.9%
if 1.2000000000000001e65 < y < 6.9999999999999998e153Initial program 100.0%
Taylor expanded in y around 0 54.2%
Taylor expanded in y around 0 6.2%
unpow26.2%
Simplified6.2%
Taylor expanded in x around 0 5.3%
+-commutative5.3%
unpow25.3%
associate-*r*5.3%
fma-def5.3%
Simplified5.3%
fma-udef5.3%
flip-+72.9%
*-commutative72.9%
*-commutative72.9%
*-commutative72.9%
*-commutative72.9%
metadata-eval72.9%
*-commutative72.9%
*-commutative72.9%
Applied egg-rr72.9%
Final simplification80.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 0.16666666666666666))))
(if (<= y 550.0)
(cos x)
(if (<= y 1.2e+65)
(* (pow x 4.0) (* y (* y 0.006944444444444444)))
(if (<= y 7e+153)
(/ (+ (* t_0 t_0) -1.0) (+ t_0 -1.0))
(* 0.16666666666666666 (* y (* (cos x) y))))))))
double code(double x, double y) {
double t_0 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 550.0) {
tmp = cos(x);
} else if (y <= 1.2e+65) {
tmp = pow(x, 4.0) * (y * (y * 0.006944444444444444));
} else if (y <= 7e+153) {
tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0);
} else {
tmp = 0.16666666666666666 * (y * (cos(x) * 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 = y * (y * 0.16666666666666666d0)
if (y <= 550.0d0) then
tmp = cos(x)
else if (y <= 1.2d+65) then
tmp = (x ** 4.0d0) * (y * (y * 0.006944444444444444d0))
else if (y <= 7d+153) then
tmp = ((t_0 * t_0) + (-1.0d0)) / (t_0 + (-1.0d0))
else
tmp = 0.16666666666666666d0 * (y * (cos(x) * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 550.0) {
tmp = Math.cos(x);
} else if (y <= 1.2e+65) {
tmp = Math.pow(x, 4.0) * (y * (y * 0.006944444444444444));
} else if (y <= 7e+153) {
tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0);
} else {
tmp = 0.16666666666666666 * (y * (Math.cos(x) * y));
}
return tmp;
}
def code(x, y): t_0 = y * (y * 0.16666666666666666) tmp = 0 if y <= 550.0: tmp = math.cos(x) elif y <= 1.2e+65: tmp = math.pow(x, 4.0) * (y * (y * 0.006944444444444444)) elif y <= 7e+153: tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0) else: tmp = 0.16666666666666666 * (y * (math.cos(x) * y)) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 0.16666666666666666)) tmp = 0.0 if (y <= 550.0) tmp = cos(x); elseif (y <= 1.2e+65) tmp = Float64((x ^ 4.0) * Float64(y * Float64(y * 0.006944444444444444))); elseif (y <= 7e+153) tmp = Float64(Float64(Float64(t_0 * t_0) + -1.0) / Float64(t_0 + -1.0)); else tmp = Float64(0.16666666666666666 * Float64(y * Float64(cos(x) * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 0.16666666666666666); tmp = 0.0; if (y <= 550.0) tmp = cos(x); elseif (y <= 1.2e+65) tmp = (x ^ 4.0) * (y * (y * 0.006944444444444444)); elseif (y <= 7e+153) tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0); else tmp = 0.16666666666666666 * (y * (cos(x) * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 550.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.2e+65], N[(N[Power[x, 4.0], $MachinePrecision] * N[(y * N[(y * 0.006944444444444444), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+153], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(y * N[(N[Cos[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 0.16666666666666666\right)\\
\mathbf{if}\;y \leq 550:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+65}:\\
\;\;\;\;{x}^{4} \cdot \left(y \cdot \left(y \cdot 0.006944444444444444\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;\frac{t_0 \cdot t_0 + -1}{t_0 + -1}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\cos x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 550Initial program 100.0%
Taylor expanded in y around 0 88.2%
Taylor expanded in y around 0 65.9%
if 550 < y < 1.2000000000000001e65Initial program 100.0%
Taylor expanded in y around 0 3.8%
Taylor expanded in y around inf 3.8%
*-commutative3.8%
unpow23.8%
associate-*l*3.8%
Simplified3.8%
Taylor expanded in x around 0 8.9%
unpow28.9%
associate-+r+8.9%
+-commutative8.9%
*-commutative8.9%
unpow28.9%
associate-*l*8.9%
*-commutative8.9%
unpow28.9%
associate-*l*8.9%
distribute-lft-out15.1%
unpow215.1%
Simplified15.1%
Taylor expanded in x around inf 32.9%
unpow232.9%
associate-*r*32.9%
*-commutative32.9%
associate-*r*32.9%
Simplified32.9%
if 1.2000000000000001e65 < y < 6.9999999999999998e153Initial program 100.0%
Taylor expanded in y around 0 54.2%
Taylor expanded in y around 0 6.2%
unpow26.2%
Simplified6.2%
Taylor expanded in x around 0 5.3%
+-commutative5.3%
unpow25.3%
associate-*r*5.3%
fma-def5.3%
Simplified5.3%
fma-udef5.3%
flip-+72.9%
*-commutative72.9%
*-commutative72.9%
*-commutative72.9%
*-commutative72.9%
metadata-eval72.9%
*-commutative72.9%
*-commutative72.9%
Applied egg-rr72.9%
if 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around inf 97.3%
*-commutative97.3%
unpow297.3%
associate-*l*97.3%
Simplified97.3%
Final simplification68.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 0.16666666666666666))))
(if (<= y 8e-9)
(cos x)
(if (<= y 7e+153)
(/ (+ (* t_0 t_0) -1.0) (+ t_0 -1.0))
(* 0.16666666666666666 (* y (* (cos x) y)))))))
double code(double x, double y) {
double t_0 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 8e-9) {
tmp = cos(x);
} else if (y <= 7e+153) {
tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0);
} else {
tmp = 0.16666666666666666 * (y * (cos(x) * 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 = y * (y * 0.16666666666666666d0)
if (y <= 8d-9) then
tmp = cos(x)
else if (y <= 7d+153) then
tmp = ((t_0 * t_0) + (-1.0d0)) / (t_0 + (-1.0d0))
else
tmp = 0.16666666666666666d0 * (y * (cos(x) * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 8e-9) {
tmp = Math.cos(x);
} else if (y <= 7e+153) {
tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0);
} else {
tmp = 0.16666666666666666 * (y * (Math.cos(x) * y));
}
return tmp;
}
def code(x, y): t_0 = y * (y * 0.16666666666666666) tmp = 0 if y <= 8e-9: tmp = math.cos(x) elif y <= 7e+153: tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0) else: tmp = 0.16666666666666666 * (y * (math.cos(x) * y)) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 0.16666666666666666)) tmp = 0.0 if (y <= 8e-9) tmp = cos(x); elseif (y <= 7e+153) tmp = Float64(Float64(Float64(t_0 * t_0) + -1.0) / Float64(t_0 + -1.0)); else tmp = Float64(0.16666666666666666 * Float64(y * Float64(cos(x) * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 0.16666666666666666); tmp = 0.0; if (y <= 8e-9) tmp = cos(x); elseif (y <= 7e+153) tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0); else tmp = 0.16666666666666666 * (y * (cos(x) * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 8e-9], N[Cos[x], $MachinePrecision], If[LessEqual[y, 7e+153], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(y * N[(N[Cos[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 0.16666666666666666\right)\\
\mathbf{if}\;y \leq 8 \cdot 10^{-9}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;\frac{t_0 \cdot t_0 + -1}{t_0 + -1}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\cos x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 8.0000000000000005e-9Initial program 100.0%
Taylor expanded in y around 0 88.2%
Taylor expanded in y around 0 65.8%
if 8.0000000000000005e-9 < y < 6.9999999999999998e153Initial program 100.0%
Taylor expanded in y around 0 37.6%
Taylor expanded in y around 0 7.4%
unpow27.4%
Simplified7.4%
Taylor expanded in x around 0 6.8%
+-commutative6.8%
unpow26.8%
associate-*r*6.8%
fma-def6.8%
Simplified6.8%
fma-udef6.8%
flip-+49.4%
*-commutative49.4%
*-commutative49.4%
*-commutative49.4%
*-commutative49.4%
metadata-eval49.4%
*-commutative49.4%
*-commutative49.4%
Applied egg-rr49.4%
if 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around inf 97.3%
*-commutative97.3%
unpow297.3%
associate-*l*97.3%
Simplified97.3%
Final simplification66.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 0.16666666666666666))))
(if (<= y 8e-9)
(cos x)
(if (<= y 7e+153)
(/ (+ (* t_0 t_0) -1.0) (+ t_0 -1.0))
(+ 1.0 (* 0.16666666666666666 (* y y)))))))
double code(double x, double y) {
double t_0 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 8e-9) {
tmp = cos(x);
} else if (y <= 7e+153) {
tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.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 = y * (y * 0.16666666666666666d0)
if (y <= 8d-9) then
tmp = cos(x)
else if (y <= 7d+153) then
tmp = ((t_0 * t_0) + (-1.0d0)) / (t_0 + (-1.0d0))
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 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 8e-9) {
tmp = Math.cos(x);
} else if (y <= 7e+153) {
tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0);
} else {
tmp = 1.0 + (0.16666666666666666 * (y * y));
}
return tmp;
}
def code(x, y): t_0 = y * (y * 0.16666666666666666) tmp = 0 if y <= 8e-9: tmp = math.cos(x) elif y <= 7e+153: tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0) else: tmp = 1.0 + (0.16666666666666666 * (y * y)) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 0.16666666666666666)) tmp = 0.0 if (y <= 8e-9) tmp = cos(x); elseif (y <= 7e+153) tmp = Float64(Float64(Float64(t_0 * t_0) + -1.0) / Float64(t_0 + -1.0)); else tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 0.16666666666666666); tmp = 0.0; if (y <= 8e-9) tmp = cos(x); elseif (y <= 7e+153) tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0); else tmp = 1.0 + (0.16666666666666666 * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 8e-9], N[Cos[x], $MachinePrecision], If[LessEqual[y, 7e+153], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 0.16666666666666666\right)\\
\mathbf{if}\;y \leq 8 \cdot 10^{-9}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;\frac{t_0 \cdot t_0 + -1}{t_0 + -1}\\
\mathbf{else}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 8.0000000000000005e-9Initial program 100.0%
Taylor expanded in y around 0 88.2%
Taylor expanded in y around 0 65.8%
if 8.0000000000000005e-9 < y < 6.9999999999999998e153Initial program 100.0%
Taylor expanded in y around 0 37.6%
Taylor expanded in y around 0 7.4%
unpow27.4%
Simplified7.4%
Taylor expanded in x around 0 6.8%
+-commutative6.8%
unpow26.8%
associate-*r*6.8%
fma-def6.8%
Simplified6.8%
fma-udef6.8%
flip-+49.4%
*-commutative49.4%
*-commutative49.4%
*-commutative49.4%
*-commutative49.4%
metadata-eval49.4%
*-commutative49.4%
*-commutative49.4%
Applied egg-rr49.4%
if 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 84.4%
Taylor expanded in y around 0 84.4%
unpow297.3%
Simplified84.4%
Final simplification65.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 0.16666666666666666))))
(if (<= y 7e+153)
(/ (+ (* t_0 t_0) -1.0) (+ t_0 -1.0))
(+ 1.0 (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
double t_0 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 7e+153) {
tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.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 = y * (y * 0.16666666666666666d0)
if (y <= 7d+153) then
tmp = ((t_0 * t_0) + (-1.0d0)) / (t_0 + (-1.0d0))
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 = y * (y * 0.16666666666666666);
double tmp;
if (y <= 7e+153) {
tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0);
} else {
tmp = 1.0 + (0.16666666666666666 * (y * y));
}
return tmp;
}
def code(x, y): t_0 = y * (y * 0.16666666666666666) tmp = 0 if y <= 7e+153: tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0) else: tmp = 1.0 + (0.16666666666666666 * (y * y)) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 0.16666666666666666)) tmp = 0.0 if (y <= 7e+153) tmp = Float64(Float64(Float64(t_0 * t_0) + -1.0) / Float64(t_0 + -1.0)); else tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 0.16666666666666666); tmp = 0.0; if (y <= 7e+153) tmp = ((t_0 * t_0) + -1.0) / (t_0 + -1.0); else tmp = 1.0 + (0.16666666666666666 * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7e+153], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 0.16666666666666666\right)\\
\mathbf{if}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;\frac{t_0 \cdot t_0 + -1}{t_0 + -1}\\
\mathbf{else}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if y < 6.9999999999999998e153Initial program 100.0%
Taylor expanded in y around 0 77.8%
Taylor expanded in y around 0 67.9%
unpow267.9%
Simplified67.9%
Taylor expanded in x around 0 40.7%
+-commutative40.7%
unpow240.7%
associate-*r*40.7%
fma-def40.7%
Simplified40.7%
fma-udef40.7%
flip-+42.0%
*-commutative42.0%
*-commutative42.0%
*-commutative42.0%
*-commutative42.0%
metadata-eval42.0%
*-commutative42.0%
*-commutative42.0%
Applied egg-rr42.0%
if 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 84.4%
Taylor expanded in y around 0 84.4%
unpow297.3%
Simplified84.4%
Final simplification47.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y 5.1e+14)
(+ 1.0 t_0)
(if (<= y 3.7e+160)
(* (* y y) (+ 0.16666666666666666 (* (* x x) -0.08333333333333333)))
t_0))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 5.1e+14) {
tmp = 1.0 + t_0;
} else if (y <= 3.7e+160) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} 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 = 0.16666666666666666d0 * (y * y)
if (y <= 5.1d+14) then
tmp = 1.0d0 + t_0
else if (y <= 3.7d+160) then
tmp = (y * y) * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0)))
else
tmp = 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 <= 5.1e+14) {
tmp = 1.0 + t_0;
} else if (y <= 3.7e+160) {
tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= 5.1e+14: tmp = 1.0 + t_0 elif y <= 3.7e+160: tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= 5.1e+14) tmp = Float64(1.0 + t_0); elseif (y <= 3.7e+160) tmp = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= 5.1e+14) tmp = 1.0 + t_0; elseif (y <= 3.7e+160) tmp = (y * y) * (0.16666666666666666 + ((x * x) * -0.08333333333333333)); else tmp = 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, 5.1e+14], N[(1.0 + t$95$0), $MachinePrecision], If[LessEqual[y, 3.7e+160], N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 5.1 \cdot 10^{+14}:\\
\;\;\;\;1 + t_0\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+160}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 5.1e14Initial program 100.0%
Taylor expanded in y around 0 88.2%
Taylor expanded in x around 0 53.3%
Taylor expanded in y around 0 49.7%
unpow283.6%
Simplified49.7%
if 5.1e14 < y < 3.70000000000000016e160Initial program 100.0%
Taylor expanded in y around 0 41.5%
Taylor expanded in y around inf 11.3%
*-commutative11.3%
unpow211.3%
associate-*l*11.3%
Simplified11.3%
Taylor expanded in x around 0 16.9%
+-commutative16.9%
*-commutative16.9%
unpow216.9%
associate-*l*16.9%
unpow216.9%
*-commutative16.9%
distribute-lft-out23.0%
unpow223.0%
Simplified23.0%
if 3.70000000000000016e160 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around 0 92.9%
Final simplification49.3%
(FPCore (x y) :precision binary64 (if (or (<= y 4.7e+14) (not (<= y 1.32e+154))) (+ 1.0 (* 0.16666666666666666 (* y y))) (* -0.08333333333333333 (* (* y y) (* x x)))))
double code(double x, double y) {
double tmp;
if ((y <= 4.7e+14) || !(y <= 1.32e+154)) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = -0.08333333333333333 * ((y * 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 ((y <= 4.7d+14) .or. (.not. (y <= 1.32d+154))) then
tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
else
tmp = (-0.08333333333333333d0) * ((y * y) * (x * x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 4.7e+14) || !(y <= 1.32e+154)) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = -0.08333333333333333 * ((y * y) * (x * x));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 4.7e+14) or not (y <= 1.32e+154): tmp = 1.0 + (0.16666666666666666 * (y * y)) else: tmp = -0.08333333333333333 * ((y * y) * (x * x)) return tmp
function code(x, y) tmp = 0.0 if ((y <= 4.7e+14) || !(y <= 1.32e+154)) tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); else tmp = Float64(-0.08333333333333333 * Float64(Float64(y * y) * Float64(x * x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 4.7e+14) || ~((y <= 1.32e+154))) tmp = 1.0 + (0.16666666666666666 * (y * y)); else tmp = -0.08333333333333333 * ((y * y) * (x * x)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 4.7e+14], N[Not[LessEqual[y, 1.32e+154]], $MachinePrecision]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.08333333333333333 * N[(N[(y * y), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.7 \cdot 10^{+14} \lor \neg \left(y \leq 1.32 \cdot 10^{+154}\right):\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;-0.08333333333333333 \cdot \left(\left(y \cdot y\right) \cdot \left(x \cdot x\right)\right)\\
\end{array}
\end{array}
if y < 4.7e14 or 1.31999999999999998e154 < y Initial program 100.0%
Taylor expanded in y around 0 90.0%
Taylor expanded in x around 0 58.3%
Taylor expanded in y around 0 55.3%
unpow286.0%
Simplified55.3%
if 4.7e14 < y < 1.31999999999999998e154Initial program 100.0%
Taylor expanded in y around 0 37.6%
Taylor expanded in y around inf 5.6%
*-commutative5.6%
unpow25.6%
associate-*l*5.6%
Simplified5.6%
Taylor expanded in x around 0 18.0%
unpow218.0%
*-commutative18.0%
associate-*r*18.0%
unpow218.0%
distribute-lft1-in18.0%
unpow218.0%
Simplified18.0%
Taylor expanded in x around inf 15.8%
*-commutative15.8%
unpow215.8%
unpow215.8%
Simplified15.8%
Final simplification48.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y 2.05e+15)
(+ 1.0 t_0)
(if (<= y 2.65e+160) (* -0.08333333333333333 (* (* x y) (* x y))) t_0))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 2.05e+15) {
tmp = 1.0 + t_0;
} else if (y <= 2.65e+160) {
tmp = -0.08333333333333333 * ((x * y) * (x * 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 = 0.16666666666666666d0 * (y * y)
if (y <= 2.05d+15) then
tmp = 1.0d0 + t_0
else if (y <= 2.65d+160) then
tmp = (-0.08333333333333333d0) * ((x * y) * (x * y))
else
tmp = 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 <= 2.05e+15) {
tmp = 1.0 + t_0;
} else if (y <= 2.65e+160) {
tmp = -0.08333333333333333 * ((x * y) * (x * y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= 2.05e+15: tmp = 1.0 + t_0 elif y <= 2.65e+160: tmp = -0.08333333333333333 * ((x * y) * (x * y)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= 2.05e+15) tmp = Float64(1.0 + t_0); elseif (y <= 2.65e+160) tmp = Float64(-0.08333333333333333 * Float64(Float64(x * y) * Float64(x * y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= 2.05e+15) tmp = 1.0 + t_0; elseif (y <= 2.65e+160) tmp = -0.08333333333333333 * ((x * y) * (x * y)); else tmp = 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, 2.05e+15], N[(1.0 + t$95$0), $MachinePrecision], If[LessEqual[y, 2.65e+160], N[(-0.08333333333333333 * N[(N[(x * y), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 2.05 \cdot 10^{+15}:\\
\;\;\;\;1 + t_0\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{+160}:\\
\;\;\;\;-0.08333333333333333 \cdot \left(\left(x \cdot y\right) \cdot \left(x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 2.05e15Initial program 100.0%
Taylor expanded in y around 0 88.2%
Taylor expanded in x around 0 53.3%
Taylor expanded in y around 0 49.7%
unpow283.6%
Simplified49.7%
if 2.05e15 < y < 2.65e160Initial program 100.0%
Taylor expanded in y around 0 41.5%
Taylor expanded in y around inf 11.3%
*-commutative11.3%
unpow211.3%
associate-*l*11.3%
Simplified11.3%
Taylor expanded in x around 0 16.9%
unpow216.9%
*-commutative16.9%
associate-*r*16.9%
unpow216.9%
distribute-lft1-in23.0%
unpow223.0%
Simplified23.0%
Taylor expanded in x around inf 19.0%
*-commutative19.0%
unpow219.0%
unpow219.0%
unswap-sqr18.9%
Simplified18.9%
if 2.65e160 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around 0 92.9%
Final simplification48.6%
(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%
Taylor expanded in y around 0 88.2%
Taylor expanded in y around 0 83.6%
unpow283.6%
Simplified83.6%
Taylor expanded in x around 0 49.7%
+-commutative49.7%
unpow249.7%
associate-*r*49.7%
fma-def49.7%
Simplified49.7%
Taylor expanded in y around 0 35.4%
if 2.39999999999999991 < y Initial program 100.0%
Taylor expanded in y around 0 62.7%
Taylor expanded in y around inf 43.6%
*-commutative43.6%
unpow243.6%
associate-*l*43.6%
Simplified43.6%
Taylor expanded in x around 0 37.8%
Final simplification36.1%
(FPCore (x y) :precision binary64 (+ 1.0 (* 0.16666666666666666 (* y y))))
double code(double x, double y) {
return 1.0 + (0.16666666666666666 * (y * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + (0.16666666666666666d0 * (y * y))
end function
public static double code(double x, double y) {
return 1.0 + (0.16666666666666666 * (y * y));
}
def code(x, y): return 1.0 + (0.16666666666666666 * (y * y))
function code(x, y) return Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) end
function tmp = code(x, y) tmp = 1.0 + (0.16666666666666666 * (y * y)); end
code[x_, y_] := N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + 0.16666666666666666 \cdot \left(y \cdot y\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 80.6%
Taylor expanded in x around 0 53.4%
Taylor expanded in y around 0 46.2%
unpow271.6%
Simplified46.2%
Final simplification46.2%
(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%
Taylor expanded in y around 0 80.6%
Taylor expanded in y around 0 71.6%
unpow271.6%
Simplified71.6%
Taylor expanded in x around 0 46.2%
+-commutative46.2%
unpow246.2%
associate-*r*46.2%
fma-def46.2%
Simplified46.2%
Taylor expanded in y around 0 25.6%
Final simplification25.6%
herbie shell --seed 2023274
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))