
(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 (/ (sinh y) y)) (t_1 (* t_0 (+ 1.0 (* (* x x) -0.5)))))
(if (<= y 90.0)
(* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 1.8e+31)
t_1
(if (<= y 1e+136)
t_0
(if (<= y 5e+154)
t_1
(* y (* (cos x) (* y 0.16666666666666666)))))))))
double code(double x, double y) {
double t_0 = sinh(y) / y;
double t_1 = t_0 * (1.0 + ((x * x) * -0.5));
double tmp;
if (y <= 90.0) {
tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 1.8e+31) {
tmp = t_1;
} else if (y <= 1e+136) {
tmp = t_0;
} else if (y <= 5e+154) {
tmp = t_1;
} else {
tmp = y * (cos(x) * (y * 0.16666666666666666));
}
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 = sinh(y) / y
t_1 = t_0 * (1.0d0 + ((x * x) * (-0.5d0)))
if (y <= 90.0d0) then
tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 1.8d+31) then
tmp = t_1
else if (y <= 1d+136) then
tmp = t_0
else if (y <= 5d+154) then
tmp = t_1
else
tmp = y * (cos(x) * (y * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sinh(y) / y;
double t_1 = t_0 * (1.0 + ((x * x) * -0.5));
double tmp;
if (y <= 90.0) {
tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 1.8e+31) {
tmp = t_1;
} else if (y <= 1e+136) {
tmp = t_0;
} else if (y <= 5e+154) {
tmp = t_1;
} else {
tmp = y * (Math.cos(x) * (y * 0.16666666666666666));
}
return tmp;
}
def code(x, y): t_0 = math.sinh(y) / y t_1 = t_0 * (1.0 + ((x * x) * -0.5)) tmp = 0 if y <= 90.0: tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 1.8e+31: tmp = t_1 elif y <= 1e+136: tmp = t_0 elif y <= 5e+154: tmp = t_1 else: tmp = y * (math.cos(x) * (y * 0.16666666666666666)) return tmp
function code(x, y) t_0 = Float64(sinh(y) / y) t_1 = Float64(t_0 * Float64(1.0 + Float64(Float64(x * x) * -0.5))) tmp = 0.0 if (y <= 90.0) tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 1.8e+31) tmp = t_1; elseif (y <= 1e+136) tmp = t_0; elseif (y <= 5e+154) tmp = t_1; else tmp = Float64(y * Float64(cos(x) * Float64(y * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) t_0 = sinh(y) / y; t_1 = t_0 * (1.0 + ((x * x) * -0.5)); tmp = 0.0; if (y <= 90.0) tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 1.8e+31) tmp = t_1; elseif (y <= 1e+136) tmp = t_0; elseif (y <= 5e+154) tmp = t_1; else tmp = y * (cos(x) * (y * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 90.0], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+31], t$95$1, If[LessEqual[y, 1e+136], t$95$0, If[LessEqual[y, 5e+154], t$95$1, N[(y * N[(N[Cos[x], $MachinePrecision] * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y}{y}\\
t_1 := t_0 \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\
\mathbf{if}\;y \leq 90:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 10^{+136}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\cos x \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if y < 90Initial program 100.0%
Taylor expanded in y around 0 84.5%
unpow251.1%
Simplified84.5%
if 90 < y < 1.79999999999999998e31 or 1.00000000000000006e136 < y < 5.00000000000000004e154Initial program 99.9%
Taylor expanded in x around 0 92.2%
*-commutative18.6%
unpow218.6%
Simplified92.2%
if 1.79999999999999998e31 < y < 1.00000000000000006e136Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 82.6%
expm1-log1p-u82.6%
expm1-udef82.6%
un-div-inv82.6%
Applied egg-rr82.6%
expm1-def82.6%
expm1-log1p82.6%
Simplified82.6%
if 5.00000000000000004e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow264.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification86.3%
(FPCore (x y)
:precision binary64
(if (<= y 90.0)
(cos x)
(if (<= y 3.8e+154)
(* (sinh y) (/ 1.0 y))
(* y (* (cos x) (* y 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (y <= 90.0) {
tmp = cos(x);
} else if (y <= 3.8e+154) {
tmp = sinh(y) * (1.0 / y);
} else {
tmp = y * (cos(x) * (y * 0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 90.0d0) then
tmp = cos(x)
else if (y <= 3.8d+154) then
tmp = sinh(y) * (1.0d0 / y)
else
tmp = y * (cos(x) * (y * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 90.0) {
tmp = Math.cos(x);
} else if (y <= 3.8e+154) {
tmp = Math.sinh(y) * (1.0 / y);
} else {
tmp = y * (Math.cos(x) * (y * 0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 90.0: tmp = math.cos(x) elif y <= 3.8e+154: tmp = math.sinh(y) * (1.0 / y) else: tmp = y * (math.cos(x) * (y * 0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (y <= 90.0) tmp = cos(x); elseif (y <= 3.8e+154) tmp = Float64(sinh(y) * Float64(1.0 / y)); else tmp = Float64(y * Float64(cos(x) * Float64(y * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 90.0) tmp = cos(x); elseif (y <= 3.8e+154) tmp = sinh(y) * (1.0 / y); else tmp = y * (cos(x) * (y * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 90.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 3.8e+154], N[(N[Sinh[y], $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[Cos[x], $MachinePrecision] * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 90:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+154}:\\
\;\;\;\;\sinh y \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\cos x \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if y < 90Initial program 100.0%
Taylor expanded in y around 0 59.3%
if 90 < y < 3.7999999999999998e154Initial program 100.0%
add-log-exp97.3%
*-un-lft-identity97.3%
log-prod97.3%
metadata-eval97.3%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 72.2%
if 3.7999999999999998e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow264.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification65.1%
(FPCore (x y)
:precision binary64
(if (<= y 90.0)
(* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 3.3e+154)
(* (sinh y) (/ 1.0 y))
(* y (* (cos x) (* y 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (y <= 90.0) {
tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 3.3e+154) {
tmp = sinh(y) * (1.0 / y);
} else {
tmp = y * (cos(x) * (y * 0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 90.0d0) then
tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 3.3d+154) then
tmp = sinh(y) * (1.0d0 / y)
else
tmp = y * (cos(x) * (y * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 90.0) {
tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 3.3e+154) {
tmp = Math.sinh(y) * (1.0 / y);
} else {
tmp = y * (Math.cos(x) * (y * 0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 90.0: tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 3.3e+154: tmp = math.sinh(y) * (1.0 / y) else: tmp = y * (math.cos(x) * (y * 0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (y <= 90.0) tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 3.3e+154) tmp = Float64(sinh(y) * Float64(1.0 / y)); else tmp = Float64(y * Float64(cos(x) * Float64(y * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 90.0) tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 3.3e+154) tmp = sinh(y) * (1.0 / y); else tmp = y * (cos(x) * (y * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 90.0], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+154], N[(N[Sinh[y], $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[Cos[x], $MachinePrecision] * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 90:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+154}:\\
\;\;\;\;\sinh y \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\cos x \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if y < 90Initial program 100.0%
Taylor expanded in y around 0 84.5%
unpow251.1%
Simplified84.5%
if 90 < y < 3.3e154Initial program 100.0%
add-log-exp97.3%
*-un-lft-identity97.3%
log-prod97.3%
metadata-eval97.3%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 72.2%
if 3.3e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow264.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification84.3%
(FPCore (x y)
:precision binary64
(if (<= y 90.0)
(cos x)
(if (or (<= y 4.3e+166) (not (<= y 2.25e+275)))
(/ (sinh y) y)
(* (+ 1.0 (* 0.16666666666666666 (* y y))) (+ 1.0 (* (* x x) -0.5))))))
double code(double x, double y) {
double tmp;
if (y <= 90.0) {
tmp = cos(x);
} else if ((y <= 4.3e+166) || !(y <= 2.25e+275)) {
tmp = sinh(y) / y;
} else {
tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 90.0d0) then
tmp = cos(x)
else if ((y <= 4.3d+166) .or. (.not. (y <= 2.25d+275))) then
tmp = sinh(y) / y
else
tmp = (1.0d0 + (0.16666666666666666d0 * (y * y))) * (1.0d0 + ((x * x) * (-0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 90.0) {
tmp = Math.cos(x);
} else if ((y <= 4.3e+166) || !(y <= 2.25e+275)) {
tmp = Math.sinh(y) / y;
} else {
tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 90.0: tmp = math.cos(x) elif (y <= 4.3e+166) or not (y <= 2.25e+275): tmp = math.sinh(y) / y else: tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5)) return tmp
function code(x, y) tmp = 0.0 if (y <= 90.0) tmp = cos(x); elseif ((y <= 4.3e+166) || !(y <= 2.25e+275)) tmp = Float64(sinh(y) / y); else tmp = Float64(Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) * Float64(1.0 + Float64(Float64(x * x) * -0.5))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 90.0) tmp = cos(x); elseif ((y <= 4.3e+166) || ~((y <= 2.25e+275))) tmp = sinh(y) / y; else tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 90.0], N[Cos[x], $MachinePrecision], If[Or[LessEqual[y, 4.3e+166], N[Not[LessEqual[y, 2.25e+275]], $MachinePrecision]], N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision], N[(N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 90:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{+166} \lor \neg \left(y \leq 2.25 \cdot 10^{+275}\right):\\
\;\;\;\;\frac{\sinh y}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\
\end{array}
\end{array}
if y < 90Initial program 100.0%
Taylor expanded in y around 0 59.3%
if 90 < y < 4.3e166 or 2.24999999999999987e275 < y Initial program 100.0%
add-log-exp97.8%
*-un-lft-identity97.8%
log-prod97.8%
metadata-eval97.8%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 74.4%
expm1-log1p-u74.2%
expm1-udef74.2%
un-div-inv74.2%
Applied egg-rr74.2%
expm1-def74.2%
expm1-log1p74.4%
Simplified74.4%
if 4.3e166 < y < 2.24999999999999987e275Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow255.6%
Simplified100.0%
Taylor expanded in x around 0 72.2%
*-commutative19.0%
unpow219.0%
Simplified72.2%
Final simplification62.7%
(FPCore (x y)
:precision binary64
(if (<= y 90.0)
(cos x)
(if (<= y 1e+165)
(* (sinh y) (/ 1.0 y))
(if (<= y 2.45e+275)
(* (+ 1.0 (* 0.16666666666666666 (* y y))) (+ 1.0 (* (* x x) -0.5)))
(/ (sinh y) y)))))
double code(double x, double y) {
double tmp;
if (y <= 90.0) {
tmp = cos(x);
} else if (y <= 1e+165) {
tmp = sinh(y) * (1.0 / y);
} else if (y <= 2.45e+275) {
tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5));
} else {
tmp = sinh(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 <= 90.0d0) then
tmp = cos(x)
else if (y <= 1d+165) then
tmp = sinh(y) * (1.0d0 / y)
else if (y <= 2.45d+275) then
tmp = (1.0d0 + (0.16666666666666666d0 * (y * y))) * (1.0d0 + ((x * x) * (-0.5d0)))
else
tmp = sinh(y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 90.0) {
tmp = Math.cos(x);
} else if (y <= 1e+165) {
tmp = Math.sinh(y) * (1.0 / y);
} else if (y <= 2.45e+275) {
tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5));
} else {
tmp = Math.sinh(y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 90.0: tmp = math.cos(x) elif y <= 1e+165: tmp = math.sinh(y) * (1.0 / y) elif y <= 2.45e+275: tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5)) else: tmp = math.sinh(y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 90.0) tmp = cos(x); elseif (y <= 1e+165) tmp = Float64(sinh(y) * Float64(1.0 / y)); elseif (y <= 2.45e+275) tmp = Float64(Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) * Float64(1.0 + Float64(Float64(x * x) * -0.5))); else tmp = Float64(sinh(y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 90.0) tmp = cos(x); elseif (y <= 1e+165) tmp = sinh(y) * (1.0 / y); elseif (y <= 2.45e+275) tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5)); else tmp = sinh(y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 90.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1e+165], N[(N[Sinh[y], $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+275], N[(N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 90:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 10^{+165}:\\
\;\;\;\;\sinh y \cdot \frac{1}{y}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+275}:\\
\;\;\;\;\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sinh y}{y}\\
\end{array}
\end{array}
if y < 90Initial program 100.0%
Taylor expanded in y around 0 59.3%
if 90 < y < 9.99999999999999899e164Initial program 100.0%
add-log-exp97.5%
*-un-lft-identity97.5%
log-prod97.5%
metadata-eval97.5%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 73.7%
if 9.99999999999999899e164 < y < 2.4499999999999999e275Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow255.6%
Simplified100.0%
Taylor expanded in x around 0 72.2%
*-commutative19.0%
unpow219.0%
Simplified72.2%
if 2.4499999999999999e275 < y Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 80.0%
expm1-log1p-u80.0%
expm1-udef80.0%
un-div-inv80.0%
Applied egg-rr80.0%
expm1-def80.0%
expm1-log1p80.0%
Simplified80.0%
Final simplification62.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y)))))
(if (<= y 115.0)
(cos x)
(if (<= y 1e+275) (* t_0 (+ 1.0 (* (* x x) -0.5))) t_0))))
double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (y <= 115.0) {
tmp = cos(x);
} else if (y <= 1e+275) {
tmp = t_0 * (1.0 + ((x * x) * -0.5));
} 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 = 1.0d0 + (0.16666666666666666d0 * (y * y))
if (y <= 115.0d0) then
tmp = cos(x)
else if (y <= 1d+275) then
tmp = t_0 * (1.0d0 + ((x * x) * (-0.5d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (y <= 115.0) {
tmp = Math.cos(x);
} else if (y <= 1e+275) {
tmp = t_0 * (1.0 + ((x * x) * -0.5));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (0.16666666666666666 * (y * y)) tmp = 0 if y <= 115.0: tmp = math.cos(x) elif y <= 1e+275: tmp = t_0 * (1.0 + ((x * x) * -0.5)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) tmp = 0.0 if (y <= 115.0) tmp = cos(x); elseif (y <= 1e+275) tmp = Float64(t_0 * Float64(1.0 + Float64(Float64(x * x) * -0.5))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (0.16666666666666666 * (y * y)); tmp = 0.0; if (y <= 115.0) tmp = cos(x); elseif (y <= 1e+275) tmp = t_0 * (1.0 + ((x * x) * -0.5)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 115.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1e+275], N[(t$95$0 * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 115:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 10^{+275}:\\
\;\;\;\;t_0 \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 115Initial program 100.0%
Taylor expanded in y around 0 59.3%
if 115 < y < 9.9999999999999996e274Initial program 100.0%
Taylor expanded in y around 0 39.2%
unpow224.1%
Simplified39.2%
Taylor expanded in x around 0 38.1%
*-commutative14.9%
unpow214.9%
Simplified38.1%
if 9.9999999999999996e274 < y Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 80.0%
expm1-log1p-u80.0%
expm1-udef80.0%
un-div-inv80.0%
Applied egg-rr80.0%
expm1-def80.0%
expm1-log1p80.0%
Simplified80.0%
Taylor expanded in y around 0 80.0%
unpow280.0%
Simplified80.0%
Final simplification55.0%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y))))) (if (<= y 1.25e+275) (* t_0 (+ (+ 2.0 (* x (* x -0.5))) -1.0)) t_0)))
double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (y <= 1.25e+275) {
tmp = t_0 * ((2.0 + (x * (x * -0.5))) + -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) :: tmp
t_0 = 1.0d0 + (0.16666666666666666d0 * (y * y))
if (y <= 1.25d+275) then
tmp = t_0 * ((2.0d0 + (x * (x * (-0.5d0)))) + (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (y <= 1.25e+275) {
tmp = t_0 * ((2.0 + (x * (x * -0.5))) + -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (0.16666666666666666 * (y * y)) tmp = 0 if y <= 1.25e+275: tmp = t_0 * ((2.0 + (x * (x * -0.5))) + -1.0) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) tmp = 0.0 if (y <= 1.25e+275) tmp = Float64(t_0 * Float64(Float64(2.0 + Float64(x * Float64(x * -0.5))) + -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (0.16666666666666666 * (y * y)); tmp = 0.0; if (y <= 1.25e+275) tmp = t_0 * ((2.0 + (x * (x * -0.5))) + -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.25e+275], N[(t$95$0 * N[(N[(2.0 + N[(x * N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 1.25 \cdot 10^{+275}:\\
\;\;\;\;t_0 \cdot \left(\left(2 + x \cdot \left(x \cdot -0.5\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 1.2500000000000001e275Initial program 100.0%
Taylor expanded in y around 0 74.4%
unpow245.1%
Simplified74.4%
expm1-log1p-u74.4%
expm1-udef74.3%
log1p-udef74.3%
rem-exp-log74.3%
Applied egg-rr74.3%
Taylor expanded in x around 0 47.0%
*-commutative47.0%
unpow247.0%
associate-*r*47.0%
*-commutative47.0%
Simplified47.0%
if 1.2500000000000001e275 < y Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 80.0%
expm1-log1p-u80.0%
expm1-udef80.0%
un-div-inv80.0%
Applied egg-rr80.0%
expm1-def80.0%
expm1-log1p80.0%
Simplified80.0%
Taylor expanded in y around 0 80.0%
unpow280.0%
Simplified80.0%
Final simplification47.6%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y))))) (if (<= y 1.1e+275) (* t_0 (+ 1.0 (* (* x x) -0.5))) t_0)))
double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (y <= 1.1e+275) {
tmp = t_0 * (1.0 + ((x * x) * -0.5));
} 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 = 1.0d0 + (0.16666666666666666d0 * (y * y))
if (y <= 1.1d+275) then
tmp = t_0 * (1.0d0 + ((x * x) * (-0.5d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (y <= 1.1e+275) {
tmp = t_0 * (1.0 + ((x * x) * -0.5));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (0.16666666666666666 * (y * y)) tmp = 0 if y <= 1.1e+275: tmp = t_0 * (1.0 + ((x * x) * -0.5)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) tmp = 0.0 if (y <= 1.1e+275) tmp = Float64(t_0 * Float64(1.0 + Float64(Float64(x * x) * -0.5))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (0.16666666666666666 * (y * y)); tmp = 0.0; if (y <= 1.1e+275) tmp = t_0 * (1.0 + ((x * x) * -0.5)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.1e+275], N[(t$95$0 * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 1.1 \cdot 10^{+275}:\\
\;\;\;\;t_0 \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 1.1e275Initial program 100.0%
Taylor expanded in y around 0 74.4%
unpow245.1%
Simplified74.4%
Taylor expanded in x around 0 47.0%
*-commutative31.6%
unpow231.6%
Simplified47.0%
if 1.1e275 < y Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 80.0%
expm1-log1p-u80.0%
expm1-udef80.0%
un-div-inv80.0%
Applied egg-rr80.0%
expm1-def80.0%
expm1-log1p80.0%
Simplified80.0%
Taylor expanded in y around 0 80.0%
unpow280.0%
Simplified80.0%
Final simplification47.6%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y))))) (if (<= x 1.4e+81) t_0 (* t_0 (* (* x x) -0.5)))))
double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (x <= 1.4e+81) {
tmp = t_0;
} else {
tmp = t_0 * ((x * x) * -0.5);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (0.16666666666666666d0 * (y * y))
if (x <= 1.4d+81) then
tmp = t_0
else
tmp = t_0 * ((x * x) * (-0.5d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if (x <= 1.4e+81) {
tmp = t_0;
} else {
tmp = t_0 * ((x * x) * -0.5);
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (0.16666666666666666 * (y * y)) tmp = 0 if x <= 1.4e+81: tmp = t_0 else: tmp = t_0 * ((x * x) * -0.5) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) tmp = 0.0 if (x <= 1.4e+81) tmp = t_0; else tmp = Float64(t_0 * Float64(Float64(x * x) * -0.5)); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (0.16666666666666666 * (y * y)); tmp = 0.0; if (x <= 1.4e+81) tmp = t_0; else tmp = t_0 * ((x * x) * -0.5); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.4e+81], t$95$0, N[(t$95$0 * N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;x \leq 1.4 \cdot 10^{+81}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\left(x \cdot x\right) \cdot -0.5\right)\\
\end{array}
\end{array}
if x < 1.39999999999999997e81Initial program 100.0%
add-log-exp98.5%
*-un-lft-identity98.5%
log-prod98.5%
metadata-eval98.5%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 72.3%
expm1-log1p-u72.3%
expm1-udef72.3%
un-div-inv72.3%
Applied egg-rr72.3%
expm1-def72.3%
expm1-log1p72.3%
Simplified72.3%
Taylor expanded in y around 0 51.6%
unpow251.6%
Simplified51.6%
if 1.39999999999999997e81 < x Initial program 100.0%
Taylor expanded in y around 0 79.4%
unpow219.0%
Simplified79.4%
expm1-log1p-u79.2%
expm1-udef79.1%
log1p-udef79.1%
rem-exp-log79.1%
Applied egg-rr79.1%
Taylor expanded in x around 0 29.5%
*-commutative29.5%
unpow229.5%
associate-*r*29.5%
*-commutative29.5%
Simplified29.5%
Taylor expanded in x around inf 29.5%
unpow229.5%
Simplified29.5%
Final simplification47.6%
(FPCore (x y) :precision binary64 (if (or (<= x 3.7e+149) (not (<= x 8.6e+202))) (+ 1.0 (* 0.16666666666666666 (* y y))) (+ 1.0 (* (* x x) -0.5))))
double code(double x, double y) {
double tmp;
if ((x <= 3.7e+149) || !(x <= 8.6e+202)) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = 1.0 + ((x * x) * -0.5);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= 3.7d+149) .or. (.not. (x <= 8.6d+202))) then
tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
else
tmp = 1.0d0 + ((x * x) * (-0.5d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= 3.7e+149) || !(x <= 8.6e+202)) {
tmp = 1.0 + (0.16666666666666666 * (y * y));
} else {
tmp = 1.0 + ((x * x) * -0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= 3.7e+149) or not (x <= 8.6e+202): tmp = 1.0 + (0.16666666666666666 * (y * y)) else: tmp = 1.0 + ((x * x) * -0.5) return tmp
function code(x, y) tmp = 0.0 if ((x <= 3.7e+149) || !(x <= 8.6e+202)) tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))); else tmp = Float64(1.0 + Float64(Float64(x * x) * -0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= 3.7e+149) || ~((x <= 8.6e+202))) tmp = 1.0 + (0.16666666666666666 * (y * y)); else tmp = 1.0 + ((x * x) * -0.5); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, 3.7e+149], N[Not[LessEqual[x, 8.6e+202]], $MachinePrecision]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.7 \cdot 10^{+149} \lor \neg \left(x \leq 8.6 \cdot 10^{+202}\right):\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\
\end{array}
\end{array}
if x < 3.69999999999999978e149 or 8.6000000000000005e202 < x Initial program 100.0%
add-log-exp98.6%
*-un-lft-identity98.6%
log-prod98.6%
metadata-eval98.6%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 67.0%
expm1-log1p-u67.0%
expm1-udef67.0%
un-div-inv67.0%
Applied egg-rr67.0%
expm1-def67.0%
expm1-log1p67.1%
Simplified67.1%
Taylor expanded in y around 0 47.5%
unpow247.5%
Simplified47.5%
if 3.69999999999999978e149 < x < 8.6000000000000005e202Initial program 100.0%
Taylor expanded in y around 0 47.1%
Taylor expanded in x around 0 35.0%
*-commutative35.0%
unpow235.0%
Simplified35.0%
Final simplification46.7%
(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%
add-log-exp98.7%
*-un-lft-identity98.7%
log-prod98.7%
metadata-eval98.7%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 64.2%
expm1-log1p-u64.2%
expm1-udef64.2%
un-div-inv64.2%
Applied egg-rr64.2%
expm1-def64.2%
expm1-log1p64.2%
Simplified64.2%
Taylor expanded in y around 0 45.8%
unpow245.8%
Simplified45.8%
Final simplification45.8%
(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 45.9%
Taylor expanded in x around 0 26.0%
Final simplification26.0%
herbie shell --seed 2023207
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))