
(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 18 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 (<= y 15.0)
(cos x)
(if (<= y 3.2e+154)
(/ (sinh y) y)
(* (cos x) (* y (* y 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (y <= 15.0) {
tmp = cos(x);
} else if (y <= 3.2e+154) {
tmp = sinh(y) / y;
} else {
tmp = cos(x) * (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 <= 15.0d0) then
tmp = cos(x)
else if (y <= 3.2d+154) then
tmp = sinh(y) / y
else
tmp = cos(x) * (y * (y * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 15.0) {
tmp = Math.cos(x);
} else if (y <= 3.2e+154) {
tmp = Math.sinh(y) / y;
} else {
tmp = Math.cos(x) * (y * (y * 0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 15.0: tmp = math.cos(x) elif y <= 3.2e+154: tmp = math.sinh(y) / y else: tmp = math.cos(x) * (y * (y * 0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (y <= 15.0) tmp = cos(x); elseif (y <= 3.2e+154) tmp = Float64(sinh(y) / y); else tmp = Float64(cos(x) * Float64(y * Float64(y * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 15.0) tmp = cos(x); elseif (y <= 3.2e+154) tmp = sinh(y) / y; else tmp = cos(x) * (y * (y * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 15.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 3.2e+154], N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 15:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{\sinh y}{y}\\
\mathbf{else}:\\
\;\;\;\;\cos x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if y < 15Initial program 100.0%
Taylor expanded in y around 0 66.2%
if 15 < y < 3.2e154Initial program 100.0%
Taylor expanded in x around 0 86.7%
if 3.2e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
*-lft-identity100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
associate-*r*100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification72.8%
(FPCore (x y)
:precision binary64
(if (<= y 15.0)
(* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 3.2e+154)
(/ (sinh y) y)
(* (cos x) (* y (* y 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (y <= 15.0) {
tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 3.2e+154) {
tmp = sinh(y) / y;
} else {
tmp = cos(x) * (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 <= 15.0d0) then
tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 3.2d+154) then
tmp = sinh(y) / y
else
tmp = cos(x) * (y * (y * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 15.0) {
tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 3.2e+154) {
tmp = Math.sinh(y) / y;
} else {
tmp = Math.cos(x) * (y * (y * 0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 15.0: tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 3.2e+154: tmp = math.sinh(y) / y else: tmp = math.cos(x) * (y * (y * 0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (y <= 15.0) tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 3.2e+154) tmp = Float64(sinh(y) / y); else tmp = Float64(cos(x) * Float64(y * Float64(y * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 15.0) tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 3.2e+154) tmp = sinh(y) / y; else tmp = cos(x) * (y * (y * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 15.0], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+154], N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 15:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{\sinh y}{y}\\
\mathbf{else}:\\
\;\;\;\;\cos x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if y < 15Initial program 100.0%
Taylor expanded in y around 0 85.3%
+-commutative85.3%
*-lft-identity85.3%
*-commutative85.3%
associate-*r*85.3%
distribute-rgt-out85.3%
unpow285.3%
Simplified85.3%
if 15 < y < 3.2e154Initial program 100.0%
Taylor expanded in x around 0 86.7%
if 3.2e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
*-lft-identity100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
associate-*r*100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification87.3%
(FPCore (x y) :precision binary64 (if (<= y 15.0) (cos x) (/ (sinh y) y)))
double code(double x, double y) {
double tmp;
if (y <= 15.0) {
tmp = cos(x);
} 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 <= 15.0d0) then
tmp = cos(x)
else
tmp = sinh(y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 15.0) {
tmp = Math.cos(x);
} else {
tmp = Math.sinh(y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 15.0: tmp = math.cos(x) else: tmp = math.sinh(y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 15.0) tmp = cos(x); else tmp = Float64(sinh(y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 15.0) tmp = cos(x); else tmp = sinh(y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 15.0], N[Cos[x], $MachinePrecision], N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 15:\\
\;\;\;\;\cos x\\
\mathbf{else}:\\
\;\;\;\;\frac{\sinh y}{y}\\
\end{array}
\end{array}
if y < 15Initial program 100.0%
Taylor expanded in y around 0 66.2%
if 15 < y Initial program 100.0%
Taylor expanded in x around 0 82.3%
Final simplification70.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y)))))
(if (<= y 2.8e+43)
(cos x)
(if (<= y 8.4e+142) (* 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 <= 2.8e+43) {
tmp = cos(x);
} else if (y <= 8.4e+142) {
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 <= 2.8d+43) then
tmp = cos(x)
else if (y <= 8.4d+142) 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 <= 2.8e+43) {
tmp = Math.cos(x);
} else if (y <= 8.4e+142) {
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 <= 2.8e+43: tmp = math.cos(x) elif y <= 8.4e+142: 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 <= 2.8e+43) tmp = cos(x); elseif (y <= 8.4e+142) 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 <= 2.8e+43) tmp = cos(x); elseif (y <= 8.4e+142) 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, 2.8e+43], N[Cos[x], $MachinePrecision], If[LessEqual[y, 8.4e+142], 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 2.8 \cdot 10^{+43}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{+142}:\\
\;\;\;\;t_0 \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 2.80000000000000019e43Initial program 100.0%
Taylor expanded in y around 0 63.4%
if 2.80000000000000019e43 < y < 8.3999999999999999e142Initial program 100.0%
Taylor expanded in y around 0 5.3%
+-commutative5.3%
*-lft-identity5.3%
*-commutative5.3%
associate-*r*5.3%
distribute-rgt-out5.3%
unpow25.3%
Simplified5.3%
Taylor expanded in x around 0 23.7%
*-commutative68.4%
unpow268.4%
Simplified23.7%
if 8.3999999999999999e142 < y Initial program 100.0%
Taylor expanded in y around 0 94.7%
+-commutative94.7%
*-lft-identity94.7%
*-commutative94.7%
associate-*r*94.7%
distribute-rgt-out94.7%
unpow294.7%
Simplified94.7%
Taylor expanded in x around 0 74.1%
unpow274.1%
Simplified74.1%
Final simplification61.9%
(FPCore (x y) :precision binary64 (if (<= y 4.7e+60) 1.0 (* (* x x) -0.5)))
double code(double x, double y) {
double tmp;
if (y <= 4.7e+60) {
tmp = 1.0;
} else {
tmp = (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 <= 4.7d+60) then
tmp = 1.0d0
else
tmp = (x * x) * (-0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.7e+60) {
tmp = 1.0;
} else {
tmp = (x * x) * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.7e+60: tmp = 1.0 else: tmp = (x * x) * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= 4.7e+60) tmp = 1.0; else tmp = Float64(Float64(x * x) * -0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.7e+60) tmp = 1.0; else tmp = (x * x) * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.7e+60], 1.0, N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.7 \cdot 10^{+60}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot -0.5\\
\end{array}
\end{array}
if y < 4.6999999999999998e60Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr29.0%
if 4.6999999999999998e60 < y Initial program 100.0%
associate-*r/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 62.0%
*-commutative62.0%
unpow262.0%
Simplified62.0%
Taylor expanded in y around 0 21.4%
Taylor expanded in x around inf 11.3%
*-commutative11.3%
unpow211.3%
Simplified11.3%
Final simplification25.6%
(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 77.7%
+-commutative77.7%
*-lft-identity77.7%
*-commutative77.7%
associate-*r*77.7%
distribute-rgt-out77.7%
unpow277.7%
Simplified77.7%
Taylor expanded in x around 0 44.6%
unpow244.6%
Simplified44.6%
Final simplification44.6%
(FPCore (x y) :precision binary64 -3.0)
double code(double x, double y) {
return -3.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -3.0d0
end function
public static double code(double x, double y) {
return -3.0;
}
def code(x, y): return -3.0
function code(x, y) return -3.0 end
function tmp = code(x, y) tmp = -3.0; end
code[x_, y_] := -3.0
\begin{array}{l}
\\
-3
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr3.6%
Final simplification3.6%
(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%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr4.2%
Final simplification4.2%
(FPCore (x y) :precision binary64 0.015625)
double code(double x, double y) {
return 0.015625;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.015625d0
end function
public static double code(double x, double y) {
return 0.015625;
}
def code(x, y): return 0.015625
function code(x, y) return 0.015625 end
function tmp = code(x, y) tmp = 0.015625; end
code[x_, y_] := 0.015625
\begin{array}{l}
\\
0.015625
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr6.8%
Final simplification6.8%
(FPCore (x y) :precision binary64 0.027777777777777776)
double code(double x, double y) {
return 0.027777777777777776;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.027777777777777776d0
end function
public static double code(double x, double y) {
return 0.027777777777777776;
}
def code(x, y): return 0.027777777777777776
function code(x, y) return 0.027777777777777776 end
function tmp = code(x, y) tmp = 0.027777777777777776; end
code[x_, y_] := 0.027777777777777776
\begin{array}{l}
\\
0.027777777777777776
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr7.0%
Final simplification7.0%
(FPCore (x y) :precision binary64 0.0625)
double code(double x, double y) {
return 0.0625;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.0625d0
end function
public static double code(double x, double y) {
return 0.0625;
}
def code(x, y): return 0.0625
function code(x, y) return 0.0625 end
function tmp = code(x, y) tmp = 0.0625; end
code[x_, y_] := 0.0625
\begin{array}{l}
\\
0.0625
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr7.2%
Final simplification7.2%
(FPCore (x y) :precision binary64 0.125)
double code(double x, double y) {
return 0.125;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.125d0
end function
public static double code(double x, double y) {
return 0.125;
}
def code(x, y): return 0.125
function code(x, y) return 0.125 end
function tmp = code(x, y) tmp = 0.125; end
code[x_, y_] := 0.125
\begin{array}{l}
\\
0.125
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr7.5%
Final simplification7.5%
(FPCore (x y) :precision binary64 0.16666666666666666)
double code(double x, double y) {
return 0.16666666666666666;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.16666666666666666d0
end function
public static double code(double x, double y) {
return 0.16666666666666666;
}
def code(x, y): return 0.16666666666666666
function code(x, y) return 0.16666666666666666 end
function tmp = code(x, y) tmp = 0.16666666666666666; end
code[x_, y_] := 0.16666666666666666
\begin{array}{l}
\\
0.16666666666666666
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr7.6%
Final simplification7.6%
(FPCore (x y) :precision binary64 0.25)
double code(double x, double y) {
return 0.25;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.25d0
end function
public static double code(double x, double y) {
return 0.25;
}
def code(x, y): return 0.25
function code(x, y) return 0.25 end
function tmp = code(x, y) tmp = 0.25; end
code[x_, y_] := 0.25
\begin{array}{l}
\\
0.25
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr7.8%
Final simplification7.8%
(FPCore (x y) :precision binary64 0.3333333333333333)
double code(double x, double y) {
return 0.3333333333333333;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.3333333333333333d0
end function
public static double code(double x, double y) {
return 0.3333333333333333;
}
def code(x, y): return 0.3333333333333333
function code(x, y) return 0.3333333333333333 end
function tmp = code(x, y) tmp = 0.3333333333333333; end
code[x_, y_] := 0.3333333333333333
\begin{array}{l}
\\
0.3333333333333333
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr8.0%
Final simplification8.0%
(FPCore (x y) :precision binary64 0.5)
double code(double x, double y) {
return 0.5;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.5d0
end function
public static double code(double x, double y) {
return 0.5;
}
def code(x, y): return 0.5
function code(x, y) return 0.5 end
function tmp = code(x, y) tmp = 0.5; end
code[x_, y_] := 0.5
\begin{array}{l}
\\
0.5
\end{array}
Initial program 100.0%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr8.3%
Final simplification8.3%
(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%
associate-*r/99.9%
Applied egg-rr99.9%
Applied egg-rr23.8%
Final simplification23.8%
herbie shell --seed 2023221
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))