
(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 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = cos(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = cos(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (or (<= y 27500.0) (not (<= y 3.6e+148))) (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y)))) (* (/ (sinh y) y) (+ 1.0 (* (* x x) -0.5)))))
double code(double x, double y) {
double tmp;
if ((y <= 27500.0) || !(y <= 3.6e+148)) {
tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = (sinh(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 <= 27500.0d0) .or. (.not. (y <= 3.6d+148))) then
tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else
tmp = (sinh(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 <= 27500.0) || !(y <= 3.6e+148)) {
tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = (Math.sinh(y) / y) * (1.0 + ((x * x) * -0.5));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 27500.0) or not (y <= 3.6e+148): tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) else: tmp = (math.sinh(y) / y) * (1.0 + ((x * x) * -0.5)) return tmp
function code(x, y) tmp = 0.0 if ((y <= 27500.0) || !(y <= 3.6e+148)) tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); else tmp = Float64(Float64(sinh(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 <= 27500.0) || ~((y <= 3.6e+148))) tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); else tmp = (sinh(y) / y) * (1.0 + ((x * x) * -0.5)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 27500.0], N[Not[LessEqual[y, 3.6e+148]], $MachinePrecision]], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 27500 \lor \neg \left(y \leq 3.6 \cdot 10^{+148}\right):\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sinh y}{y} \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\
\end{array}
\end{array}
if y < 27500 or 3.60000000000000006e148 < y Initial program 100.0%
Taylor expanded in y around 0 86.9%
unpow286.9%
Simplified86.9%
if 27500 < y < 3.60000000000000006e148Initial program 100.0%
Taylor expanded in x around 0 66.7%
*-commutative11.9%
unpow211.9%
Simplified66.7%
Final simplification84.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y)))))
(if (or (<= y 27500.0) (not (<= y 3.6e+148)))
(* (cos x) t_0)
(* t_0 (+ 1.0 (* (* x x) -0.5))))))
double code(double x, double y) {
double t_0 = 1.0 + (0.16666666666666666 * (y * y));
double tmp;
if ((y <= 27500.0) || !(y <= 3.6e+148)) {
tmp = cos(x) * t_0;
} else {
tmp = t_0 * (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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (0.16666666666666666d0 * (y * y))
if ((y <= 27500.0d0) .or. (.not. (y <= 3.6d+148))) then
tmp = cos(x) * t_0
else
tmp = t_0 * (1.0d0 + ((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 ((y <= 27500.0) || !(y <= 3.6e+148)) {
tmp = Math.cos(x) * t_0;
} else {
tmp = t_0 * (1.0 + ((x * x) * -0.5));
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (0.16666666666666666 * (y * y)) tmp = 0 if (y <= 27500.0) or not (y <= 3.6e+148): tmp = math.cos(x) * t_0 else: tmp = t_0 * (1.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 ((y <= 27500.0) || !(y <= 3.6e+148)) tmp = Float64(cos(x) * t_0); else tmp = Float64(t_0 * Float64(1.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 ((y <= 27500.0) || ~((y <= 3.6e+148))) tmp = cos(x) * t_0; else tmp = t_0 * (1.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[Or[LessEqual[y, 27500.0], N[Not[LessEqual[y, 3.6e+148]], $MachinePrecision]], N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 27500 \lor \neg \left(y \leq 3.6 \cdot 10^{+148}\right):\\
\;\;\;\;\cos x \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\
\end{array}
\end{array}
if y < 27500 or 3.60000000000000006e148 < y Initial program 100.0%
Taylor expanded in y around 0 86.9%
unpow286.9%
Simplified86.9%
if 27500 < y < 3.60000000000000006e148Initial program 100.0%
Taylor expanded in y around 0 5.0%
unpow25.0%
Simplified5.0%
Taylor expanded in x around 0 19.3%
*-commutative11.9%
unpow211.9%
Simplified19.3%
Final simplification79.0%
(FPCore (x y)
:precision binary64
(if (<= y 14800000000.0)
(cos x)
(if (or (<= y 3e+196) (not (<= y 1.4e+226)))
(* (+ 1.0 (* 0.16666666666666666 (* y y))) (+ 1.0 (* (* x x) -0.5)))
(+ 1.0 (* y (* y 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (y <= 14800000000.0) {
tmp = cos(x);
} else if ((y <= 3e+196) || !(y <= 1.4e+226)) {
tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5));
} else {
tmp = 1.0 + (y * (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 <= 14800000000.0d0) then
tmp = cos(x)
else if ((y <= 3d+196) .or. (.not. (y <= 1.4d+226))) then
tmp = (1.0d0 + (0.16666666666666666d0 * (y * y))) * (1.0d0 + ((x * x) * (-0.5d0)))
else
tmp = 1.0d0 + (y * (y * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 14800000000.0) {
tmp = Math.cos(x);
} else if ((y <= 3e+196) || !(y <= 1.4e+226)) {
tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5));
} else {
tmp = 1.0 + (y * (y * 0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 14800000000.0: tmp = math.cos(x) elif (y <= 3e+196) or not (y <= 1.4e+226): tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5)) else: tmp = 1.0 + (y * (y * 0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (y <= 14800000000.0) tmp = cos(x); elseif ((y <= 3e+196) || !(y <= 1.4e+226)) tmp = Float64(Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))) * Float64(1.0 + Float64(Float64(x * x) * -0.5))); else tmp = Float64(1.0 + Float64(y * Float64(y * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 14800000000.0) tmp = cos(x); elseif ((y <= 3e+196) || ~((y <= 1.4e+226))) tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5)); else tmp = 1.0 + (y * (y * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 14800000000.0], N[Cos[x], $MachinePrecision], If[Or[LessEqual[y, 3e+196], N[Not[LessEqual[y, 1.4e+226]], $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], N[(1.0 + N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 14800000000:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+196} \lor \neg \left(y \leq 1.4 \cdot 10^{+226}\right):\\
\;\;\;\;\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}:\\
\;\;\;\;1 + y \cdot \left(y \cdot 0.16666666666666666\right)\\
\end{array}
\end{array}
if y < 1.48e10Initial program 100.0%
Taylor expanded in y around 0 68.6%
if 1.48e10 < y < 2.9999999999999999e196 or 1.4000000000000001e226 < y Initial program 100.0%
Taylor expanded in y around 0 52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in x around 0 56.1%
*-commutative18.2%
unpow218.2%
Simplified56.1%
if 2.9999999999999999e196 < y < 1.4000000000000001e226Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x around 0 0.0%
*-commutative0.1%
unpow20.1%
Simplified0.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
unpow2100.0%
fma-udef100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification65.9%
(FPCore (x y) :precision binary64 (if (or (<= y 0.0037) (and (not (<= y 4e+197)) (<= y 1.8e+226))) (+ 1.0 (* y (* y 0.16666666666666666))) (* (+ 1.0 (* 0.16666666666666666 (* y y))) (+ 1.0 (* (* x x) -0.5)))))
double code(double x, double y) {
double tmp;
if ((y <= 0.0037) || (!(y <= 4e+197) && (y <= 1.8e+226))) {
tmp = 1.0 + (y * (y * 0.16666666666666666));
} 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 <= 0.0037d0) .or. (.not. (y <= 4d+197)) .and. (y <= 1.8d+226)) then
tmp = 1.0d0 + (y * (y * 0.16666666666666666d0))
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 <= 0.0037) || (!(y <= 4e+197) && (y <= 1.8e+226))) {
tmp = 1.0 + (y * (y * 0.16666666666666666));
} else {
tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 0.0037) or (not (y <= 4e+197) and (y <= 1.8e+226)): tmp = 1.0 + (y * (y * 0.16666666666666666)) 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 <= 0.0037) || (!(y <= 4e+197) && (y <= 1.8e+226))) tmp = Float64(1.0 + Float64(y * Float64(y * 0.16666666666666666))); 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 <= 0.0037) || (~((y <= 4e+197)) && (y <= 1.8e+226))) tmp = 1.0 + (y * (y * 0.16666666666666666)); else tmp = (1.0 + (0.16666666666666666 * (y * y))) * (1.0 + ((x * x) * -0.5)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 0.0037], And[N[Not[LessEqual[y, 4e+197]], $MachinePrecision], LessEqual[y, 1.8e+226]]], N[(1.0 + N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $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 0.0037 \lor \neg \left(y \leq 4 \cdot 10^{+197}\right) \land y \leq 1.8 \cdot 10^{+226}:\\
\;\;\;\;1 + y \cdot \left(y \cdot 0.16666666666666666\right)\\
\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 < 0.0037000000000000002 or 3.9999999999999998e197 < y < 1.7999999999999999e226Initial program 100.0%
Taylor expanded in y around 0 85.9%
unpow285.9%
Simplified85.9%
Taylor expanded in x around 0 41.8%
*-commutative31.3%
unpow231.3%
Simplified41.8%
Taylor expanded in x around 0 46.4%
+-commutative46.4%
unpow246.4%
fma-udef46.4%
Simplified46.4%
fma-udef46.4%
*-commutative46.4%
associate-*r*46.4%
*-commutative46.4%
Applied egg-rr46.4%
if 0.0037000000000000002 < y < 3.9999999999999998e197 or 1.7999999999999999e226 < y Initial program 100.0%
Taylor expanded in y around 0 52.1%
unpow252.1%
Simplified52.1%
Taylor expanded in x around 0 54.8%
*-commutative18.2%
unpow218.2%
Simplified54.8%
Final simplification48.5%
(FPCore (x y) :precision binary64 (if (<= y 0.0026) 1.0 (+ 1.0 (* (* x x) -0.5))))
double code(double x, double y) {
double tmp;
if (y <= 0.0026) {
tmp = 1.0;
} 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 (y <= 0.0026d0) then
tmp = 1.0d0
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 (y <= 0.0026) {
tmp = 1.0;
} else {
tmp = 1.0 + ((x * x) * -0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.0026: tmp = 1.0 else: tmp = 1.0 + ((x * x) * -0.5) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.0026) tmp = 1.0; 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 (y <= 0.0026) tmp = 1.0; else tmp = 1.0 + ((x * x) * -0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.0026], 1.0, N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0026:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\
\end{array}
\end{array}
if y < 0.0025999999999999999Initial program 100.0%
Taylor expanded in y around 0 69.2%
expm1-log1p-u69.1%
expm1-udef68.9%
log1p-udef68.9%
rem-exp-log68.9%
Applied egg-rr68.9%
associate--l+68.9%
+-commutative68.9%
sub-neg68.9%
metadata-eval68.9%
Applied egg-rr68.9%
Taylor expanded in x around 0 32.3%
if 0.0025999999999999999 < y Initial program 100.0%
Taylor expanded in y around 0 4.2%
Taylor expanded in x around 0 17.4%
*-commutative17.4%
unpow217.4%
Simplified17.4%
Final simplification28.3%
(FPCore (x y) :precision binary64 (if (<= x 6.8e+235) (+ 1.0 (* y (* y 0.16666666666666666))) (+ 1.0 (* (* x x) -0.5))))
double code(double x, double y) {
double tmp;
if (x <= 6.8e+235) {
tmp = 1.0 + (y * (y * 0.16666666666666666));
} 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 <= 6.8d+235) then
tmp = 1.0d0 + (y * (y * 0.16666666666666666d0))
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 <= 6.8e+235) {
tmp = 1.0 + (y * (y * 0.16666666666666666));
} else {
tmp = 1.0 + ((x * x) * -0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6.8e+235: tmp = 1.0 + (y * (y * 0.16666666666666666)) else: tmp = 1.0 + ((x * x) * -0.5) return tmp
function code(x, y) tmp = 0.0 if (x <= 6.8e+235) tmp = Float64(1.0 + Float64(y * Float64(y * 0.16666666666666666))); 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 <= 6.8e+235) tmp = 1.0 + (y * (y * 0.16666666666666666)); else tmp = 1.0 + ((x * x) * -0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6.8e+235], N[(1.0 + N[(y * N[(y * 0.16666666666666666), $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 6.8 \cdot 10^{+235}:\\
\;\;\;\;1 + y \cdot \left(y \cdot 0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\
\end{array}
\end{array}
if x < 6.79999999999999991e235Initial program 100.0%
Taylor expanded in y around 0 76.7%
unpow276.7%
Simplified76.7%
Taylor expanded in x around 0 45.8%
*-commutative27.6%
unpow227.6%
Simplified45.8%
Taylor expanded in x around 0 45.4%
+-commutative45.4%
unpow245.4%
fma-udef45.4%
Simplified45.4%
fma-udef45.4%
*-commutative45.4%
associate-*r*45.4%
*-commutative45.4%
Applied egg-rr45.4%
if 6.79999999999999991e235 < x Initial program 100.0%
Taylor expanded in y around 0 61.2%
Taylor expanded in x around 0 34.4%
*-commutative34.4%
unpow234.4%
Simplified34.4%
Final simplification44.7%
(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 52.0%
expm1-log1p-u51.9%
expm1-udef51.7%
log1p-udef51.7%
rem-exp-log51.7%
Applied egg-rr51.7%
associate--l+51.7%
+-commutative51.7%
sub-neg51.7%
metadata-eval51.7%
Applied egg-rr51.7%
Taylor expanded in x around 0 24.5%
Final simplification24.5%
herbie shell --seed 2023224
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))