
(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 13 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 (* (cos x) (* y y))))
(t_1 (cbrt (* (pow y 6.0) 0.004629629629629629))))
(if (<= y -2.8e+197)
t_0
(if (<= y -2.4e+51)
t_1
(if (<= y 7e-8)
(* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 6.8e+51)
(* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* -0.5 (* x x))))
(if (<= y 1.4e+154) t_1 t_0)))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
double t_1 = cbrt((pow(y, 6.0) * 0.004629629629629629));
double tmp;
if (y <= -2.8e+197) {
tmp = t_0;
} else if (y <= -2.4e+51) {
tmp = t_1;
} else if (y <= 7e-8) {
tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 6.8e+51) {
tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + (-0.5 * (x * x)));
} else if (y <= 1.4e+154) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y))) t_1 = cbrt(Float64((y ^ 6.0) * 0.004629629629629629)) tmp = 0.0 if (y <= -2.8e+197) tmp = t_0; elseif (y <= -2.4e+51) tmp = t_1; elseif (y <= 7e-8) tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 6.8e+51) tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(-0.5 * Float64(x * x)))); elseif (y <= 1.4e+154) tmp = t_1; else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[Power[y, 6.0], $MachinePrecision] * 0.004629629629629629), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[y, -2.8e+197], t$95$0, If[LessEqual[y, -2.4e+51], t$95$1, If[LessEqual[y, 7e-8], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+51], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := \sqrt[3]{{y}^{6} \cdot 0.004629629629629629}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+197}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -2.7999999999999999e197 or 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%
Simplified100.0%
if -2.7999999999999999e197 < y < -2.3999999999999999e51 or 6.79999999999999969e51 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 16.2%
unpow216.2%
Simplified16.2%
Taylor expanded in y around inf 16.2%
unpow216.2%
Simplified16.2%
Taylor expanded in x around 0 15.0%
unpow215.0%
Simplified15.0%
add-cbrt-cube78.6%
pow378.6%
*-commutative78.6%
unpow-prod-down78.6%
pow-prod-down78.6%
pow-prod-up78.6%
metadata-eval78.6%
metadata-eval78.6%
Applied egg-rr78.6%
if -2.3999999999999999e51 < y < 7.00000000000000048e-8Initial program 100.0%
Taylor expanded in y around 0 90.1%
unpow290.1%
Simplified90.1%
if 7.00000000000000048e-8 < y < 6.79999999999999969e51Initial program 100.0%
Taylor expanded in y around 0 14.3%
unpow214.3%
Simplified14.3%
Taylor expanded in x around 0 67.1%
+-commutative67.1%
associate-+l+67.1%
*-commutative67.1%
associate-*l*67.1%
+-commutative67.1%
unpow267.1%
associate-*r*67.1%
*-commutative67.1%
fma-udef67.1%
unpow267.1%
associate-*r*67.1%
*-commutative67.1%
fma-udef67.1%
*-rgt-identity67.1%
distribute-lft-out67.1%
*-commutative67.1%
unpow267.1%
Simplified67.1%
Final simplification88.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
(t_1 (* 0.16666666666666666 (* y y)))
(t_2
(*
(- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
(/ 1.0 (- 1.0 t_1)))))
(if (<= y -1.4e+154)
t_0
(if (<= y -1.8e+67)
t_2
(if (<= y -90000000.0)
(* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333))))
(if (<= y 7e-8)
(* (cos x) (+ 1.0 t_1))
(if (<= y 5.2e+52)
(* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* -0.5 (* x x))))
(if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
double t_1 = 0.16666666666666666 * (y * y);
double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -1.8e+67) {
tmp = t_2;
} else if (y <= -90000000.0) {
tmp = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
} else if (y <= 7e-8) {
tmp = cos(x) * (1.0 + t_1);
} else if (y <= 5.2e+52) {
tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + (-0.5 * (x * x)));
} else if (y <= 1.4e+154) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y))) t_1 = Float64(0.16666666666666666 * Float64(y * y)) t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_1))) tmp = 0.0 if (y <= -1.4e+154) tmp = t_0; elseif (y <= -1.8e+67) tmp = t_2; elseif (y <= -90000000.0) tmp = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333)))); elseif (y <= 7e-8) tmp = Float64(cos(x) * Float64(1.0 + t_1)); elseif (y <= 5.2e+52) tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(-0.5 * Float64(x * x)))); elseif (y <= 1.4e+154) tmp = t_2; else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -1.8e+67], t$95$2, If[LessEqual[y, -90000000.0], N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-8], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+52], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -90000000:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.4e154 or 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%
Simplified100.0%
if -1.4e154 < y < -1.7999999999999999e67 or 5.2e52 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 6.4%
unpow26.4%
Simplified6.4%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
unpow25.1%
associate-*r*5.1%
*-commutative5.1%
fma-udef5.1%
Simplified5.1%
fma-udef5.1%
+-commutative5.1%
flip-+60.8%
div-inv60.8%
metadata-eval60.8%
pow260.8%
*-commutative60.8%
associate-*l*60.8%
*-commutative60.8%
associate-*l*60.8%
Applied egg-rr60.8%
unpow260.8%
associate-*r*60.8%
associate-*r*60.8%
swap-sqr60.8%
*-commutative60.8%
*-commutative60.8%
swap-sqr60.8%
metadata-eval60.8%
Applied egg-rr60.8%
if -1.7999999999999999e67 < y < -9e7Initial program 100.0%
Taylor expanded in y around 0 3.7%
unpow23.7%
Simplified3.7%
Taylor expanded in y around inf 3.7%
unpow23.7%
Simplified3.7%
Taylor expanded in x around 0 30.5%
fma-def30.5%
unpow230.5%
unpow230.5%
*-commutative30.5%
unpow230.5%
Simplified30.5%
fma-udef30.5%
associate-*r*30.5%
distribute-rgt-out30.5%
associate-*r*30.5%
Applied egg-rr30.5%
if -9e7 < y < 7.00000000000000048e-8Initial program 100.0%
Taylor expanded in y around 0 99.2%
unpow299.2%
Simplified99.2%
if 7.00000000000000048e-8 < y < 5.2e52Initial program 100.0%
Taylor expanded in y around 0 14.3%
unpow214.3%
Simplified14.3%
Taylor expanded in x around 0 67.1%
+-commutative67.1%
associate-+l+67.1%
*-commutative67.1%
associate-*l*67.1%
+-commutative67.1%
unpow267.1%
associate-*r*67.1%
*-commutative67.1%
fma-udef67.1%
unpow267.1%
associate-*r*67.1%
*-commutative67.1%
fma-udef67.1%
*-rgt-identity67.1%
distribute-lft-out67.1%
*-commutative67.1%
unpow267.1%
Simplified67.1%
Final simplification86.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
(t_1 (* 0.16666666666666666 (* y y)))
(t_2
(*
(- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
(/ 1.0 (- 1.0 t_1)))))
(if (<= y -1.4e+154)
t_0
(if (<= y -7.2e+70)
t_2
(if (<= y -90000000.0)
(fma
0.16666666666666666
(* y y)
(* -0.08333333333333333 (* y (* y (* x x)))))
(if (<= y 7e-8)
(* (cos x) (+ 1.0 t_1))
(if (<= y 5.2e+52)
(* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* -0.5 (* x x))))
(if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
double t_1 = 0.16666666666666666 * (y * y);
double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -7.2e+70) {
tmp = t_2;
} else if (y <= -90000000.0) {
tmp = fma(0.16666666666666666, (y * y), (-0.08333333333333333 * (y * (y * (x * x)))));
} else if (y <= 7e-8) {
tmp = cos(x) * (1.0 + t_1);
} else if (y <= 5.2e+52) {
tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + (-0.5 * (x * x)));
} else if (y <= 1.4e+154) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y))) t_1 = Float64(0.16666666666666666 * Float64(y * y)) t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_1))) tmp = 0.0 if (y <= -1.4e+154) tmp = t_0; elseif (y <= -7.2e+70) tmp = t_2; elseif (y <= -90000000.0) tmp = fma(0.16666666666666666, Float64(y * y), Float64(-0.08333333333333333 * Float64(y * Float64(y * Float64(x * x))))); elseif (y <= 7e-8) tmp = Float64(cos(x) * Float64(1.0 + t_1)); elseif (y <= 5.2e+52) tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(-0.5 * Float64(x * x)))); elseif (y <= 1.4e+154) tmp = t_2; else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -7.2e+70], t$95$2, If[LessEqual[y, -90000000.0], N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + N[(-0.08333333333333333 * N[(y * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-8], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+52], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{+70}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -90000000:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(y \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.4e154 or 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%
Simplified100.0%
if -1.4e154 < y < -7.1999999999999999e70 or 5.2e52 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 6.5%
unpow26.5%
Simplified6.5%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
unpow25.1%
associate-*r*5.1%
*-commutative5.1%
fma-udef5.1%
Simplified5.1%
fma-udef5.1%
+-commutative5.1%
flip-+63.4%
div-inv63.4%
metadata-eval63.4%
pow263.4%
*-commutative63.4%
associate-*l*63.4%
*-commutative63.4%
associate-*l*63.4%
Applied egg-rr63.4%
unpow263.4%
associate-*r*63.4%
associate-*r*63.4%
swap-sqr63.4%
*-commutative63.4%
*-commutative63.4%
swap-sqr63.4%
metadata-eval63.4%
Applied egg-rr63.4%
if -7.1999999999999999e70 < y < -9e7Initial program 100.0%
Taylor expanded in y around 0 3.8%
unpow23.8%
Simplified3.8%
Taylor expanded in y around inf 3.8%
unpow23.8%
Simplified3.8%
Taylor expanded in x around 0 27.9%
fma-def27.9%
unpow227.9%
unpow227.9%
associate-*l*27.9%
unpow227.9%
Simplified27.9%
if -9e7 < y < 7.00000000000000048e-8Initial program 100.0%
Taylor expanded in y around 0 99.2%
unpow299.2%
Simplified99.2%
if 7.00000000000000048e-8 < y < 5.2e52Initial program 100.0%
Taylor expanded in y around 0 14.3%
unpow214.3%
Simplified14.3%
Taylor expanded in x around 0 67.1%
+-commutative67.1%
associate-+l+67.1%
*-commutative67.1%
associate-*l*67.1%
+-commutative67.1%
unpow267.1%
associate-*r*67.1%
*-commutative67.1%
fma-udef67.1%
unpow267.1%
associate-*r*67.1%
*-commutative67.1%
fma-udef67.1%
*-rgt-identity67.1%
distribute-lft-out67.1%
*-commutative67.1%
unpow267.1%
Simplified67.1%
Final simplification86.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
(t_1
(* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333)))))
(t_2
(*
(- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
(/ 1.0 (- 1.0 (* 0.16666666666666666 (* y y)))))))
(if (<= y -1.4e+154)
t_0
(if (<= y -2.5e+67)
t_2
(if (<= y -165000000.0)
t_1
(if (<= y 25000.0)
(cos x)
(if (<= y 5.2e+52) t_1 (if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - (0.16666666666666666 * (y * y))));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -2.5e+67) {
tmp = t_2;
} else if (y <= -165000000.0) {
tmp = t_1;
} else if (y <= 25000.0) {
tmp = cos(x);
} else if (y <= 5.2e+52) {
tmp = t_1;
} else if (y <= 1.4e+154) {
tmp = t_2;
} 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 = 0.16666666666666666d0 * (cos(x) * (y * y))
t_1 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
t_2 = (1.0d0 - ((y * y) * ((y * y) * 0.027777777777777776d0))) * (1.0d0 / (1.0d0 - (0.16666666666666666d0 * (y * y))))
if (y <= (-1.4d+154)) then
tmp = t_0
else if (y <= (-2.5d+67)) then
tmp = t_2
else if (y <= (-165000000.0d0)) then
tmp = t_1
else if (y <= 25000.0d0) then
tmp = cos(x)
else if (y <= 5.2d+52) then
tmp = t_1
else if (y <= 1.4d+154) then
tmp = t_2
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (Math.cos(x) * (y * y));
double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - (0.16666666666666666 * (y * y))));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -2.5e+67) {
tmp = t_2;
} else if (y <= -165000000.0) {
tmp = t_1;
} else if (y <= 25000.0) {
tmp = Math.cos(x);
} else if (y <= 5.2e+52) {
tmp = t_1;
} else if (y <= 1.4e+154) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (math.cos(x) * (y * y)) t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))) t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - (0.16666666666666666 * (y * y)))) tmp = 0 if y <= -1.4e+154: tmp = t_0 elif y <= -2.5e+67: tmp = t_2 elif y <= -165000000.0: tmp = t_1 elif y <= 25000.0: tmp = math.cos(x) elif y <= 5.2e+52: tmp = t_1 elif y <= 1.4e+154: tmp = t_2 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y))) t_1 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333)))) t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - Float64(0.16666666666666666 * Float64(y * y))))) tmp = 0.0 if (y <= -1.4e+154) tmp = t_0; elseif (y <= -2.5e+67) tmp = t_2; elseif (y <= -165000000.0) tmp = t_1; elseif (y <= 25000.0) tmp = cos(x); elseif (y <= 5.2e+52) tmp = t_1; elseif (y <= 1.4e+154) tmp = t_2; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (cos(x) * (y * y)); t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))); t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - (0.16666666666666666 * (y * y)))); tmp = 0.0; if (y <= -1.4e+154) tmp = t_0; elseif (y <= -2.5e+67) tmp = t_2; elseif (y <= -165000000.0) tmp = t_1; elseif (y <= 25000.0) tmp = cos(x); elseif (y <= 5.2e+52) tmp = t_1; elseif (y <= 1.4e+154) tmp = t_2; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -2.5e+67], t$95$2, If[LessEqual[y, -165000000.0], t$95$1, If[LessEqual[y, 25000.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 5.2e+52], t$95$1, If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -165000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 25000:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.4e154 or 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%
Simplified100.0%
if -1.4e154 < y < -2.49999999999999988e67 or 5.2e52 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 6.4%
unpow26.4%
Simplified6.4%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
unpow25.1%
associate-*r*5.1%
*-commutative5.1%
fma-udef5.1%
Simplified5.1%
fma-udef5.1%
+-commutative5.1%
flip-+60.8%
div-inv60.8%
metadata-eval60.8%
pow260.8%
*-commutative60.8%
associate-*l*60.8%
*-commutative60.8%
associate-*l*60.8%
Applied egg-rr60.8%
unpow260.8%
associate-*r*60.8%
associate-*r*60.8%
swap-sqr60.8%
*-commutative60.8%
*-commutative60.8%
swap-sqr60.8%
metadata-eval60.8%
Applied egg-rr60.8%
if -2.49999999999999988e67 < y < -1.65e8 or 25000 < y < 5.2e52Initial program 100.0%
Taylor expanded in y around 0 3.7%
unpow23.7%
Simplified3.7%
Taylor expanded in y around inf 3.7%
unpow23.7%
Simplified3.7%
Taylor expanded in x around 0 40.5%
fma-def40.5%
unpow240.5%
unpow240.5%
*-commutative40.5%
unpow240.5%
Simplified40.5%
fma-udef40.5%
associate-*r*40.5%
distribute-rgt-out40.5%
associate-*r*40.5%
Applied egg-rr40.5%
if -1.65e8 < y < 25000Initial program 100.0%
Taylor expanded in y around 0 99.2%
unpow299.2%
Simplified99.2%
Taylor expanded in y around 0 99.1%
Final simplification86.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
(t_1 (* 0.16666666666666666 (* y y)))
(t_2
(* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333)))))
(t_3
(*
(- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
(/ 1.0 (- 1.0 t_1)))))
(if (<= y -1.4e+154)
t_0
(if (<= y -2.5e+67)
t_3
(if (<= y -100000000.0)
t_2
(if (<= y 620.0)
(* (cos x) (+ 1.0 t_1))
(if (<= y 5.2e+52) t_2 (if (<= y 1.4e+154) t_3 t_0))))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
double t_1 = 0.16666666666666666 * (y * y);
double t_2 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double t_3 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -2.5e+67) {
tmp = t_3;
} else if (y <= -100000000.0) {
tmp = t_2;
} else if (y <= 620.0) {
tmp = cos(x) * (1.0 + t_1);
} else if (y <= 5.2e+52) {
tmp = t_2;
} else if (y <= 1.4e+154) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (cos(x) * (y * y))
t_1 = 0.16666666666666666d0 * (y * y)
t_2 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
t_3 = (1.0d0 - ((y * y) * ((y * y) * 0.027777777777777776d0))) * (1.0d0 / (1.0d0 - t_1))
if (y <= (-1.4d+154)) then
tmp = t_0
else if (y <= (-2.5d+67)) then
tmp = t_3
else if (y <= (-100000000.0d0)) then
tmp = t_2
else if (y <= 620.0d0) then
tmp = cos(x) * (1.0d0 + t_1)
else if (y <= 5.2d+52) then
tmp = t_2
else if (y <= 1.4d+154) then
tmp = t_3
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (Math.cos(x) * (y * y));
double t_1 = 0.16666666666666666 * (y * y);
double t_2 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double t_3 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -2.5e+67) {
tmp = t_3;
} else if (y <= -100000000.0) {
tmp = t_2;
} else if (y <= 620.0) {
tmp = Math.cos(x) * (1.0 + t_1);
} else if (y <= 5.2e+52) {
tmp = t_2;
} else if (y <= 1.4e+154) {
tmp = t_3;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (math.cos(x) * (y * y)) t_1 = 0.16666666666666666 * (y * y) t_2 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))) t_3 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1)) tmp = 0 if y <= -1.4e+154: tmp = t_0 elif y <= -2.5e+67: tmp = t_3 elif y <= -100000000.0: tmp = t_2 elif y <= 620.0: tmp = math.cos(x) * (1.0 + t_1) elif y <= 5.2e+52: tmp = t_2 elif y <= 1.4e+154: tmp = t_3 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y))) t_1 = Float64(0.16666666666666666 * Float64(y * y)) t_2 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333)))) t_3 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_1))) tmp = 0.0 if (y <= -1.4e+154) tmp = t_0; elseif (y <= -2.5e+67) tmp = t_3; elseif (y <= -100000000.0) tmp = t_2; elseif (y <= 620.0) tmp = Float64(cos(x) * Float64(1.0 + t_1)); elseif (y <= 5.2e+52) tmp = t_2; elseif (y <= 1.4e+154) tmp = t_3; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (cos(x) * (y * y)); t_1 = 0.16666666666666666 * (y * y); t_2 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))); t_3 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1)); tmp = 0.0; if (y <= -1.4e+154) tmp = t_0; elseif (y <= -2.5e+67) tmp = t_3; elseif (y <= -100000000.0) tmp = t_2; elseif (y <= 620.0) tmp = cos(x) * (1.0 + t_1); elseif (y <= 5.2e+52) tmp = t_2; elseif (y <= 1.4e+154) tmp = t_3; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -2.5e+67], t$95$3, If[LessEqual[y, -100000000.0], t$95$2, If[LessEqual[y, 620.0], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+52], t$95$2, If[LessEqual[y, 1.4e+154], t$95$3, t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_2 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
t_3 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -100000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 620:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.4e154 or 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%
Simplified100.0%
if -1.4e154 < y < -2.49999999999999988e67 or 5.2e52 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 6.4%
unpow26.4%
Simplified6.4%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
unpow25.1%
associate-*r*5.1%
*-commutative5.1%
fma-udef5.1%
Simplified5.1%
fma-udef5.1%
+-commutative5.1%
flip-+60.8%
div-inv60.8%
metadata-eval60.8%
pow260.8%
*-commutative60.8%
associate-*l*60.8%
*-commutative60.8%
associate-*l*60.8%
Applied egg-rr60.8%
unpow260.8%
associate-*r*60.8%
associate-*r*60.8%
swap-sqr60.8%
*-commutative60.8%
*-commutative60.8%
swap-sqr60.8%
metadata-eval60.8%
Applied egg-rr60.8%
if -2.49999999999999988e67 < y < -1e8 or 620 < y < 5.2e52Initial program 100.0%
Taylor expanded in y around 0 3.7%
unpow23.7%
Simplified3.7%
Taylor expanded in y around inf 3.7%
unpow23.7%
Simplified3.7%
Taylor expanded in x around 0 40.5%
fma-def40.5%
unpow240.5%
unpow240.5%
*-commutative40.5%
unpow240.5%
Simplified40.5%
fma-udef40.5%
associate-*r*40.5%
distribute-rgt-out40.5%
associate-*r*40.5%
Applied egg-rr40.5%
if -1e8 < y < 620Initial program 100.0%
Taylor expanded in y around 0 99.2%
unpow299.2%
Simplified99.2%
Final simplification86.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y)))
(t_1
(* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333)))))
(t_2
(*
(- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
(/ 1.0 (- 1.0 t_0)))))
(if (<= y -1.4e+154)
t_0
(if (<= y -2.5e+67)
t_2
(if (<= y -90000000.0)
t_1
(if (<= y 440.0)
(cos x)
(if (<= y 5.2e+52) t_1 (if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -2.5e+67) {
tmp = t_2;
} else if (y <= -90000000.0) {
tmp = t_1;
} else if (y <= 440.0) {
tmp = cos(x);
} else if (y <= 5.2e+52) {
tmp = t_1;
} else if (y <= 1.4e+154) {
tmp = t_2;
} 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 = 0.16666666666666666d0 * (y * y)
t_1 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
t_2 = (1.0d0 - ((y * y) * ((y * y) * 0.027777777777777776d0))) * (1.0d0 / (1.0d0 - t_0))
if (y <= (-1.4d+154)) then
tmp = t_0
else if (y <= (-2.5d+67)) then
tmp = t_2
else if (y <= (-90000000.0d0)) then
tmp = t_1
else if (y <= 440.0d0) then
tmp = cos(x)
else if (y <= 5.2d+52) then
tmp = t_1
else if (y <= 1.4d+154) then
tmp = t_2
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 t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -2.5e+67) {
tmp = t_2;
} else if (y <= -90000000.0) {
tmp = t_1;
} else if (y <= 440.0) {
tmp = Math.cos(x);
} else if (y <= 5.2e+52) {
tmp = t_1;
} else if (y <= 1.4e+154) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))) t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0)) tmp = 0 if y <= -1.4e+154: tmp = t_0 elif y <= -2.5e+67: tmp = t_2 elif y <= -90000000.0: tmp = t_1 elif y <= 440.0: tmp = math.cos(x) elif y <= 5.2e+52: tmp = t_1 elif y <= 1.4e+154: tmp = t_2 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) t_1 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333)))) t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_0))) tmp = 0.0 if (y <= -1.4e+154) tmp = t_0; elseif (y <= -2.5e+67) tmp = t_2; elseif (y <= -90000000.0) tmp = t_1; elseif (y <= 440.0) tmp = cos(x); elseif (y <= 5.2e+52) tmp = t_1; elseif (y <= 1.4e+154) tmp = t_2; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))); t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0)); tmp = 0.0; if (y <= -1.4e+154) tmp = t_0; elseif (y <= -2.5e+67) tmp = t_2; elseif (y <= -90000000.0) tmp = t_1; elseif (y <= 440.0) tmp = cos(x); elseif (y <= 5.2e+52) tmp = t_1; elseif (y <= 1.4e+154) tmp = t_2; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -2.5e+67], t$95$2, If[LessEqual[y, -90000000.0], t$95$1, If[LessEqual[y, 440.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 5.2e+52], t$95$1, If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -90000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 440:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.4e154 or 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%
Simplified100.0%
Taylor expanded in x around 0 73.3%
unpow273.3%
Simplified73.3%
if -1.4e154 < y < -2.49999999999999988e67 or 5.2e52 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 6.4%
unpow26.4%
Simplified6.4%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
unpow25.1%
associate-*r*5.1%
*-commutative5.1%
fma-udef5.1%
Simplified5.1%
fma-udef5.1%
+-commutative5.1%
flip-+60.8%
div-inv60.8%
metadata-eval60.8%
pow260.8%
*-commutative60.8%
associate-*l*60.8%
*-commutative60.8%
associate-*l*60.8%
Applied egg-rr60.8%
unpow260.8%
associate-*r*60.8%
associate-*r*60.8%
swap-sqr60.8%
*-commutative60.8%
*-commutative60.8%
swap-sqr60.8%
metadata-eval60.8%
Applied egg-rr60.8%
if -2.49999999999999988e67 < y < -9e7 or 440 < y < 5.2e52Initial program 100.0%
Taylor expanded in y around 0 3.7%
unpow23.7%
Simplified3.7%
Taylor expanded in y around inf 3.7%
unpow23.7%
Simplified3.7%
Taylor expanded in x around 0 40.5%
fma-def40.5%
unpow240.5%
unpow240.5%
*-commutative40.5%
unpow240.5%
Simplified40.5%
fma-udef40.5%
associate-*r*40.5%
distribute-rgt-out40.5%
associate-*r*40.5%
Applied egg-rr40.5%
if -9e7 < y < 440Initial program 100.0%
Taylor expanded in y around 0 99.2%
unpow299.2%
Simplified99.2%
Taylor expanded in y around 0 99.1%
Final simplification80.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y)))
(t_1
(* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333)))))
(t_2
(*
(- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
(/ 1.0 (- 1.0 t_0)))))
(if (<= y -1.4e+154)
t_0
(if (<= y -2.5e+67)
t_2
(if (<= y -6.8e-24)
t_1
(if (<= y 215.0)
t_2
(if (<= y 5.2e+52) t_1 (if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -2.5e+67) {
tmp = t_2;
} else if (y <= -6.8e-24) {
tmp = t_1;
} else if (y <= 215.0) {
tmp = t_2;
} else if (y <= 5.2e+52) {
tmp = t_1;
} else if (y <= 1.4e+154) {
tmp = t_2;
} 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 = 0.16666666666666666d0 * (y * y)
t_1 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
t_2 = (1.0d0 - ((y * y) * ((y * y) * 0.027777777777777776d0))) * (1.0d0 / (1.0d0 - t_0))
if (y <= (-1.4d+154)) then
tmp = t_0
else if (y <= (-2.5d+67)) then
tmp = t_2
else if (y <= (-6.8d-24)) then
tmp = t_1
else if (y <= 215.0d0) then
tmp = t_2
else if (y <= 5.2d+52) then
tmp = t_1
else if (y <= 1.4d+154) then
tmp = t_2
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 t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
double tmp;
if (y <= -1.4e+154) {
tmp = t_0;
} else if (y <= -2.5e+67) {
tmp = t_2;
} else if (y <= -6.8e-24) {
tmp = t_1;
} else if (y <= 215.0) {
tmp = t_2;
} else if (y <= 5.2e+52) {
tmp = t_1;
} else if (y <= 1.4e+154) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))) t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0)) tmp = 0 if y <= -1.4e+154: tmp = t_0 elif y <= -2.5e+67: tmp = t_2 elif y <= -6.8e-24: tmp = t_1 elif y <= 215.0: tmp = t_2 elif y <= 5.2e+52: tmp = t_1 elif y <= 1.4e+154: tmp = t_2 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) t_1 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333)))) t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_0))) tmp = 0.0 if (y <= -1.4e+154) tmp = t_0; elseif (y <= -2.5e+67) tmp = t_2; elseif (y <= -6.8e-24) tmp = t_1; elseif (y <= 215.0) tmp = t_2; elseif (y <= 5.2e+52) tmp = t_1; elseif (y <= 1.4e+154) tmp = t_2; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))); t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0)); tmp = 0.0; if (y <= -1.4e+154) tmp = t_0; elseif (y <= -2.5e+67) tmp = t_2; elseif (y <= -6.8e-24) tmp = t_1; elseif (y <= 215.0) tmp = t_2; elseif (y <= 5.2e+52) tmp = t_1; elseif (y <= 1.4e+154) tmp = t_2; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -2.5e+67], t$95$2, If[LessEqual[y, -6.8e-24], t$95$1, If[LessEqual[y, 215.0], t$95$2, If[LessEqual[y, 5.2e+52], t$95$1, If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 215:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.4e154 or 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%
Simplified100.0%
Taylor expanded in x around 0 73.3%
unpow273.3%
Simplified73.3%
if -1.4e154 < y < -2.49999999999999988e67 or -6.79999999999999985e-24 < y < 215 or 5.2e52 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 74.5%
unpow274.5%
Simplified74.5%
Taylor expanded in x around 0 40.0%
+-commutative40.0%
unpow240.0%
associate-*r*40.0%
*-commutative40.0%
fma-udef40.0%
Simplified40.0%
fma-udef40.0%
+-commutative40.0%
flip-+55.2%
div-inv55.2%
metadata-eval55.2%
pow255.2%
*-commutative55.2%
associate-*l*55.2%
*-commutative55.2%
associate-*l*55.2%
Applied egg-rr55.2%
unpow255.2%
associate-*r*55.2%
associate-*r*55.2%
swap-sqr55.2%
*-commutative55.2%
*-commutative55.2%
swap-sqr55.2%
metadata-eval55.2%
Applied egg-rr55.2%
if -2.49999999999999988e67 < y < -6.79999999999999985e-24 or 215 < y < 5.2e52Initial program 99.9%
Taylor expanded in y around 0 16.1%
unpow216.1%
Simplified16.1%
Taylor expanded in y around inf 4.3%
unpow24.3%
Simplified4.3%
Taylor expanded in x around 0 34.7%
fma-def34.7%
unpow234.7%
unpow234.7%
*-commutative34.7%
unpow234.7%
Simplified34.7%
fma-udef34.7%
associate-*r*34.7%
distribute-rgt-out34.7%
associate-*r*34.7%
Applied egg-rr34.7%
Final simplification57.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y)))
(t_1
(* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333))))))
(if (<= y -6.8e-24)
t_1
(if (<= y 230.0)
(+ 1.0 t_0)
(if (or (<= y 1.5e+168) (not (<= y 2e+261))) t_1 t_0)))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double tmp;
if (y <= -6.8e-24) {
tmp = t_1;
} else if (y <= 230.0) {
tmp = 1.0 + t_0;
} else if ((y <= 1.5e+168) || !(y <= 2e+261)) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (y * y)
t_1 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
if (y <= (-6.8d-24)) then
tmp = t_1
else if (y <= 230.0d0) then
tmp = 1.0d0 + t_0
else if ((y <= 1.5d+168) .or. (.not. (y <= 2d+261))) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
double tmp;
if (y <= -6.8e-24) {
tmp = t_1;
} else if (y <= 230.0) {
tmp = 1.0 + t_0;
} else if ((y <= 1.5e+168) || !(y <= 2e+261)) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))) tmp = 0 if y <= -6.8e-24: tmp = t_1 elif y <= 230.0: tmp = 1.0 + t_0 elif (y <= 1.5e+168) or not (y <= 2e+261): tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) t_1 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333)))) tmp = 0.0 if (y <= -6.8e-24) tmp = t_1; elseif (y <= 230.0) tmp = Float64(1.0 + t_0); elseif ((y <= 1.5e+168) || !(y <= 2e+261)) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333))); tmp = 0.0; if (y <= -6.8e-24) tmp = t_1; elseif (y <= 230.0) tmp = 1.0 + t_0; elseif ((y <= 1.5e+168) || ~((y <= 2e+261))) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.8e-24], t$95$1, If[LessEqual[y, 230.0], N[(1.0 + t$95$0), $MachinePrecision], If[Or[LessEqual[y, 1.5e+168], N[Not[LessEqual[y, 2e+261]], $MachinePrecision]], t$95$1, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 230:\\
\;\;\;\;1 + t_0\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+168} \lor \neg \left(y \leq 2 \cdot 10^{+261}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -6.79999999999999985e-24 or 230 < y < 1.4999999999999999e168 or 1.9999999999999999e261 < y Initial program 100.0%
Taylor expanded in y around 0 38.6%
unpow238.6%
Simplified38.6%
Taylor expanded in y around inf 35.3%
unpow235.3%
Simplified35.3%
Taylor expanded in x around 0 17.4%
fma-def17.4%
unpow217.4%
unpow217.4%
*-commutative17.4%
unpow217.4%
Simplified17.4%
fma-udef17.4%
associate-*r*17.4%
distribute-rgt-out38.1%
associate-*r*38.1%
Applied egg-rr38.1%
if -6.79999999999999985e-24 < y < 230Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x around 0 53.1%
+-commutative53.1%
unpow253.1%
Simplified53.1%
if 1.4999999999999999e168 < y < 1.9999999999999999e261Initial 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%
Simplified100.0%
Taylor expanded in x around 0 88.0%
unpow288.0%
Simplified88.0%
Final simplification50.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y)))
(t_1 (* -0.08333333333333333 (* (* y y) (* x x)))))
(if (<= y -2e+131)
t_0
(if (<= y -6.8e-24)
t_1
(if (<= y 650.0) (+ 1.0 t_0) (if (<= y 1.3e+168) t_1 t_0))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double t_1 = -0.08333333333333333 * ((y * y) * (x * x));
double tmp;
if (y <= -2e+131) {
tmp = t_0;
} else if (y <= -6.8e-24) {
tmp = t_1;
} else if (y <= 650.0) {
tmp = 1.0 + t_0;
} else if (y <= 1.3e+168) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (y * y)
t_1 = (-0.08333333333333333d0) * ((y * y) * (x * x))
if (y <= (-2d+131)) then
tmp = t_0
else if (y <= (-6.8d-24)) then
tmp = t_1
else if (y <= 650.0d0) then
tmp = 1.0d0 + t_0
else if (y <= 1.3d+168) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double t_1 = -0.08333333333333333 * ((y * y) * (x * x));
double tmp;
if (y <= -2e+131) {
tmp = t_0;
} else if (y <= -6.8e-24) {
tmp = t_1;
} else if (y <= 650.0) {
tmp = 1.0 + t_0;
} else if (y <= 1.3e+168) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) t_1 = -0.08333333333333333 * ((y * y) * (x * x)) tmp = 0 if y <= -2e+131: tmp = t_0 elif y <= -6.8e-24: tmp = t_1 elif y <= 650.0: tmp = 1.0 + t_0 elif y <= 1.3e+168: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) t_1 = Float64(-0.08333333333333333 * Float64(Float64(y * y) * Float64(x * x))) tmp = 0.0 if (y <= -2e+131) tmp = t_0; elseif (y <= -6.8e-24) tmp = t_1; elseif (y <= 650.0) tmp = Float64(1.0 + t_0); elseif (y <= 1.3e+168) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); t_1 = -0.08333333333333333 * ((y * y) * (x * x)); tmp = 0.0; if (y <= -2e+131) tmp = t_0; elseif (y <= -6.8e-24) tmp = t_1; elseif (y <= 650.0) tmp = 1.0 + t_0; elseif (y <= 1.3e+168) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.08333333333333333 * N[(N[(y * y), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+131], t$95$0, If[LessEqual[y, -6.8e-24], t$95$1, If[LessEqual[y, 650.0], N[(1.0 + t$95$0), $MachinePrecision], If[LessEqual[y, 1.3e+168], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := -0.08333333333333333 \cdot \left(\left(y \cdot y\right) \cdot \left(x \cdot x\right)\right)\\
\mathbf{if}\;y \leq -2 \cdot 10^{+131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 650:\\
\;\;\;\;1 + t_0\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+168}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.9999999999999998e131 or 1.3e168 < y Initial program 100.0%
Taylor expanded in y around 0 90.4%
unpow290.4%
Simplified90.4%
Taylor expanded in y around inf 90.4%
unpow290.4%
Simplified90.4%
Taylor expanded in x around 0 67.6%
unpow267.6%
Simplified67.6%
if -1.9999999999999998e131 < y < -6.79999999999999985e-24 or 650 < y < 1.3e168Initial program 100.0%
Taylor expanded in y around 0 11.8%
unpow211.8%
Simplified11.8%
Taylor expanded in y around inf 6.5%
unpow26.5%
Simplified6.5%
Taylor expanded in x around 0 27.0%
fma-def27.0%
unpow227.0%
unpow227.0%
*-commutative27.0%
unpow227.0%
Simplified27.0%
Taylor expanded in x around inf 26.9%
unpow226.9%
*-commutative26.9%
unpow226.9%
Simplified26.9%
if -6.79999999999999985e-24 < y < 650Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x around 0 53.1%
+-commutative53.1%
unpow253.1%
Simplified53.1%
Final simplification49.7%
(FPCore (x y) :precision binary64 (if (or (<= y -6.8e-24) (not (<= y 62000000000000.0))) (* 0.16666666666666666 (* y y)) 1.0))
double code(double x, double y) {
double tmp;
if ((y <= -6.8e-24) || !(y <= 62000000000000.0)) {
tmp = 0.16666666666666666 * (y * y);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-6.8d-24)) .or. (.not. (y <= 62000000000000.0d0))) then
tmp = 0.16666666666666666d0 * (y * y)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -6.8e-24) || !(y <= 62000000000000.0)) {
tmp = 0.16666666666666666 * (y * y);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -6.8e-24) or not (y <= 62000000000000.0): tmp = 0.16666666666666666 * (y * y) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= -6.8e-24) || !(y <= 62000000000000.0)) tmp = Float64(0.16666666666666666 * Float64(y * y)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -6.8e-24) || ~((y <= 62000000000000.0))) tmp = 0.16666666666666666 * (y * y); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -6.8e-24], N[Not[LessEqual[y, 62000000000000.0]], $MachinePrecision]], N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-24} \lor \neg \left(y \leq 62000000000000\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6.79999999999999985e-24 or 6.2e13 < y Initial program 100.0%
Taylor expanded in y around 0 50.6%
unpow250.6%
Simplified50.6%
Taylor expanded in y around inf 47.9%
unpow247.9%
Simplified47.9%
Taylor expanded in x around 0 35.0%
unpow235.0%
Simplified35.0%
if -6.79999999999999985e-24 < y < 6.2e13Initial program 100.0%
Taylor expanded in y around 0 98.4%
unpow298.4%
Simplified98.4%
Taylor expanded in x around 0 52.2%
+-commutative52.2%
unpow252.2%
associate-*r*52.2%
*-commutative52.2%
fma-udef52.2%
Simplified52.2%
Taylor expanded in y around 0 52.2%
Final simplification43.2%
(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 73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in x around 0 43.2%
+-commutative43.2%
unpow243.2%
Simplified43.2%
Final simplification43.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 73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in x around 0 43.2%
+-commutative43.2%
unpow243.2%
associate-*r*43.2%
*-commutative43.2%
fma-udef43.2%
Simplified43.2%
Taylor expanded in y around 0 26.1%
Final simplification26.1%
herbie shell --seed 2023195
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))