
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
(FPCore (x y) :precision binary64 (/ (sin y) (/ y (cosh x))))
double code(double x, double y) {
return sin(y) / (y / cosh(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(y) / (y / cosh(x))
end function
public static double code(double x, double y) {
return Math.sin(y) / (y / Math.cosh(x));
}
def code(x, y): return math.sin(y) / (y / math.cosh(x))
function code(x, y) return Float64(sin(y) / Float64(y / cosh(x))) end
function tmp = code(x, y) tmp = sin(y) / (y / cosh(x)); end
code[x_, y_] := N[(N[Sin[y], $MachinePrecision] / N[(y / N[Cosh[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin y}{\frac{y}{\cosh x}}
\end{array}
Initial program 99.9%
add-log-exp73.6%
*-un-lft-identity73.6%
log-prod73.6%
metadata-eval73.6%
add-log-exp99.9%
*-commutative99.9%
associate-*l/99.9%
Applied egg-rr99.9%
+-lft-identity99.9%
associate-/l*99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (* (/ (sin y) y) (cosh x)))
double code(double x, double y) {
return (sin(y) / y) * cosh(x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(y) / y) * cosh(x)
end function
public static double code(double x, double y) {
return (Math.sin(y) / y) * Math.cosh(x);
}
def code(x, y): return (math.sin(y) / y) * math.cosh(x)
function code(x, y) return Float64(Float64(sin(y) / y) * cosh(x)) end
function tmp = code(x, y) tmp = (sin(y) / y) * cosh(x); end
code[x_, y_] := N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin y}{y} \cdot \cosh x
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= x 65.0)
(/ (* (sin y) (+ 1.0 (* 0.5 (* x x)))) y)
(if (<= x 6.5e+100)
(cosh x)
(if (<= x 1.75e+152)
(* (cosh x) (+ 1.0 (* -0.16666666666666666 (* y y))))
(* (sin y) (+ (/ 1.0 y) (* 0.5 (/ (* x x) y))))))))
double code(double x, double y) {
double tmp;
if (x <= 65.0) {
tmp = (sin(y) * (1.0 + (0.5 * (x * x)))) / y;
} else if (x <= 6.5e+100) {
tmp = cosh(x);
} else if (x <= 1.75e+152) {
tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = sin(y) * ((1.0 / y) + (0.5 * ((x * x) / y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 65.0d0) then
tmp = (sin(y) * (1.0d0 + (0.5d0 * (x * x)))) / y
else if (x <= 6.5d+100) then
tmp = cosh(x)
else if (x <= 1.75d+152) then
tmp = cosh(x) * (1.0d0 + ((-0.16666666666666666d0) * (y * y)))
else
tmp = sin(y) * ((1.0d0 / y) + (0.5d0 * ((x * x) / y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 65.0) {
tmp = (Math.sin(y) * (1.0 + (0.5 * (x * x)))) / y;
} else if (x <= 6.5e+100) {
tmp = Math.cosh(x);
} else if (x <= 1.75e+152) {
tmp = Math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = Math.sin(y) * ((1.0 / y) + (0.5 * ((x * x) / y)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 65.0: tmp = (math.sin(y) * (1.0 + (0.5 * (x * x)))) / y elif x <= 6.5e+100: tmp = math.cosh(x) elif x <= 1.75e+152: tmp = math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))) else: tmp = math.sin(y) * ((1.0 / y) + (0.5 * ((x * x) / y))) return tmp
function code(x, y) tmp = 0.0 if (x <= 65.0) tmp = Float64(Float64(sin(y) * Float64(1.0 + Float64(0.5 * Float64(x * x)))) / y); elseif (x <= 6.5e+100) tmp = cosh(x); elseif (x <= 1.75e+152) tmp = Float64(cosh(x) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y)))); else tmp = Float64(sin(y) * Float64(Float64(1.0 / y) + Float64(0.5 * Float64(Float64(x * x) / y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 65.0) tmp = (sin(y) * (1.0 + (0.5 * (x * x)))) / y; elseif (x <= 6.5e+100) tmp = cosh(x); elseif (x <= 1.75e+152) tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))); else tmp = sin(y) * ((1.0 / y) + (0.5 * ((x * x) / y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 65.0], N[(N[(N[Sin[y], $MachinePrecision] * N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 6.5e+100], N[Cosh[x], $MachinePrecision], If[LessEqual[x, 1.75e+152], N[(N[Cosh[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] + N[(0.5 * N[(N[(x * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 65:\\
\;\;\;\;\frac{\sin y \cdot \left(1 + 0.5 \cdot \left(x \cdot x\right)\right)}{y}\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+100}:\\
\;\;\;\;\cosh x\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+152}:\\
\;\;\;\;\cosh x \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \frac{x \cdot x}{y}\right)\\
\end{array}
\end{array}
if x < 65Initial program 99.9%
add-log-exp66.8%
*-un-lft-identity66.8%
log-prod66.8%
metadata-eval66.8%
add-log-exp99.9%
*-commutative99.9%
associate-*l/99.9%
Applied egg-rr99.9%
+-lft-identity99.9%
associate-/l*99.9%
Simplified99.9%
associate-/l*99.9%
*-commutative99.9%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 88.9%
unpow288.9%
Simplified88.9%
Taylor expanded in y around inf 86.3%
*-commutative86.3%
unpow286.3%
Simplified86.3%
if 65 < x < 6.50000000000000001e100Initial program 100.0%
Taylor expanded in y around 0 100.0%
if 6.50000000000000001e100 < x < 1.74999999999999991e152Initial program 100.0%
Taylor expanded in y around 0 88.9%
unpow288.9%
Simplified88.9%
if 1.74999999999999991e152 < x Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-/l*100.0%
Simplified100.0%
associate-/l*100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
Final simplification88.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin y) (+ 1.0 (* 0.5 (* x x)))) y)))
(if (<= x 65.0)
t_0
(if (<= x 3e+98)
(cosh x)
(if (<= x 1.35e+154)
(* (cosh x) (+ 1.0 (* -0.16666666666666666 (* y y))))
t_0)))))
double code(double x, double y) {
double t_0 = (sin(y) * (1.0 + (0.5 * (x * x)))) / y;
double tmp;
if (x <= 65.0) {
tmp = t_0;
} else if (x <= 3e+98) {
tmp = cosh(x);
} else if (x <= 1.35e+154) {
tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (sin(y) * (1.0d0 + (0.5d0 * (x * x)))) / y
if (x <= 65.0d0) then
tmp = t_0
else if (x <= 3d+98) then
tmp = cosh(x)
else if (x <= 1.35d+154) then
tmp = cosh(x) * (1.0d0 + ((-0.16666666666666666d0) * (y * y)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (Math.sin(y) * (1.0 + (0.5 * (x * x)))) / y;
double tmp;
if (x <= 65.0) {
tmp = t_0;
} else if (x <= 3e+98) {
tmp = Math.cosh(x);
} else if (x <= 1.35e+154) {
tmp = Math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (math.sin(y) * (1.0 + (0.5 * (x * x)))) / y tmp = 0 if x <= 65.0: tmp = t_0 elif x <= 3e+98: tmp = math.cosh(x) elif x <= 1.35e+154: tmp = math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(sin(y) * Float64(1.0 + Float64(0.5 * Float64(x * x)))) / y) tmp = 0.0 if (x <= 65.0) tmp = t_0; elseif (x <= 3e+98) tmp = cosh(x); elseif (x <= 1.35e+154) tmp = Float64(cosh(x) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (sin(y) * (1.0 + (0.5 * (x * x)))) / y; tmp = 0.0; if (x <= 65.0) tmp = t_0; elseif (x <= 3e+98) tmp = cosh(x); elseif (x <= 1.35e+154) tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[y], $MachinePrecision] * N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[x, 65.0], t$95$0, If[LessEqual[x, 3e+98], N[Cosh[x], $MachinePrecision], If[LessEqual[x, 1.35e+154], N[(N[Cosh[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin y \cdot \left(1 + 0.5 \cdot \left(x \cdot x\right)\right)}{y}\\
\mathbf{if}\;x \leq 65:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+98}:\\
\;\;\;\;\cosh x\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\cosh x \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < 65 or 1.35000000000000003e154 < x Initial program 99.9%
add-log-exp70.8%
*-un-lft-identity70.8%
log-prod70.8%
metadata-eval70.8%
add-log-exp99.9%
*-commutative99.9%
associate-*l/99.9%
Applied egg-rr99.9%
+-lft-identity99.9%
associate-/l*99.9%
Simplified99.9%
associate-/l*99.9%
*-commutative99.9%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 90.2%
unpow290.2%
Simplified90.2%
Taylor expanded in y around inf 88.0%
*-commutative88.0%
unpow288.0%
Simplified88.0%
if 65 < x < 3.0000000000000001e98Initial program 100.0%
Taylor expanded in y around 0 100.0%
if 3.0000000000000001e98 < x < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in y around 0 88.9%
unpow288.9%
Simplified88.9%
Final simplification88.7%
(FPCore (x y)
:precision binary64
(if (<= x 8.5e-5)
(/ (sin y) y)
(if (<= x 2.3e+101)
(cosh x)
(if (<= x 1e+260)
(* (cosh x) (+ 1.0 (* -0.16666666666666666 (* y y))))
(+ 1.0 (* 0.5 (* x x)))))))
double code(double x, double y) {
double tmp;
if (x <= 8.5e-5) {
tmp = sin(y) / y;
} else if (x <= 2.3e+101) {
tmp = cosh(x);
} else if (x <= 1e+260) {
tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = 1.0 + (0.5 * (x * x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 8.5d-5) then
tmp = sin(y) / y
else if (x <= 2.3d+101) then
tmp = cosh(x)
else if (x <= 1d+260) then
tmp = cosh(x) * (1.0d0 + ((-0.16666666666666666d0) * (y * y)))
else
tmp = 1.0d0 + (0.5d0 * (x * x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 8.5e-5) {
tmp = Math.sin(y) / y;
} else if (x <= 2.3e+101) {
tmp = Math.cosh(x);
} else if (x <= 1e+260) {
tmp = Math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = 1.0 + (0.5 * (x * x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 8.5e-5: tmp = math.sin(y) / y elif x <= 2.3e+101: tmp = math.cosh(x) elif x <= 1e+260: tmp = math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))) else: tmp = 1.0 + (0.5 * (x * x)) return tmp
function code(x, y) tmp = 0.0 if (x <= 8.5e-5) tmp = Float64(sin(y) / y); elseif (x <= 2.3e+101) tmp = cosh(x); elseif (x <= 1e+260) tmp = Float64(cosh(x) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y)))); else tmp = Float64(1.0 + Float64(0.5 * Float64(x * x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 8.5e-5) tmp = sin(y) / y; elseif (x <= 2.3e+101) tmp = cosh(x); elseif (x <= 1e+260) tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))); else tmp = 1.0 + (0.5 * (x * x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 8.5e-5], N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 2.3e+101], N[Cosh[x], $MachinePrecision], If[LessEqual[x, 1e+260], N[(N[Cosh[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin y}{y}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+101}:\\
\;\;\;\;\cosh x\\
\mathbf{elif}\;x \leq 10^{+260}:\\
\;\;\;\;\cosh x \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + 0.5 \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if x < 8.500000000000001e-5Initial program 99.9%
Taylor expanded in x around 0 70.7%
if 8.500000000000001e-5 < x < 2.3000000000000001e101Initial program 99.9%
Taylor expanded in y around 0 89.0%
if 2.3000000000000001e101 < x < 1.00000000000000007e260Initial program 100.0%
Taylor expanded in y around 0 83.9%
unpow283.9%
Simplified83.9%
if 1.00000000000000007e260 < x Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-/l*100.0%
Simplified100.0%
associate-/l*100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Final simplification74.2%
(FPCore (x y) :precision binary64 (if (<= x 8.5e-5) (/ (sin y) y) (cosh x)))
double code(double x, double y) {
double tmp;
if (x <= 8.5e-5) {
tmp = sin(y) / y;
} else {
tmp = cosh(x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 8.5d-5) then
tmp = sin(y) / y
else
tmp = cosh(x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 8.5e-5) {
tmp = Math.sin(y) / y;
} else {
tmp = Math.cosh(x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 8.5e-5: tmp = math.sin(y) / y else: tmp = math.cosh(x) return tmp
function code(x, y) tmp = 0.0 if (x <= 8.5e-5) tmp = Float64(sin(y) / y); else tmp = cosh(x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 8.5e-5) tmp = sin(y) / y; else tmp = cosh(x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 8.5e-5], N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], N[Cosh[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin y}{y}\\
\mathbf{else}:\\
\;\;\;\;\cosh x\\
\end{array}
\end{array}
if x < 8.500000000000001e-5Initial program 99.9%
Taylor expanded in x around 0 70.7%
if 8.500000000000001e-5 < x Initial program 100.0%
Taylor expanded in y around 0 78.0%
Final simplification72.3%
(FPCore (x y) :precision binary64 (cosh x))
double code(double x, double y) {
return cosh(x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x)
end function
public static double code(double x, double y) {
return Math.cosh(x);
}
def code(x, y): return math.cosh(x)
function code(x, y) return cosh(x) end
function tmp = code(x, y) tmp = cosh(x); end
code[x_, y_] := N[Cosh[x], $MachinePrecision]
\begin{array}{l}
\\
\cosh x
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 62.4%
Final simplification62.4%
(FPCore (x y) :precision binary64 (+ 1.0 (* 0.5 (* x x))))
double code(double x, double y) {
return 1.0 + (0.5 * (x * x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + (0.5d0 * (x * x))
end function
public static double code(double x, double y) {
return 1.0 + (0.5 * (x * x));
}
def code(x, y): return 1.0 + (0.5 * (x * x))
function code(x, y) return Float64(1.0 + Float64(0.5 * Float64(x * x))) end
function tmp = code(x, y) tmp = 1.0 + (0.5 * (x * x)); end
code[x_, y_] := N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + 0.5 \cdot \left(x \cdot x\right)
\end{array}
Initial program 99.9%
add-log-exp73.6%
*-un-lft-identity73.6%
log-prod73.6%
metadata-eval73.6%
add-log-exp99.9%
*-commutative99.9%
associate-*l/99.9%
Applied egg-rr99.9%
+-lft-identity99.9%
associate-/l*99.9%
Simplified99.9%
associate-/l*99.9%
*-commutative99.9%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 84.4%
unpow284.4%
Simplified84.4%
Taylor expanded in y around 0 47.2%
unpow247.2%
Simplified47.2%
Final simplification47.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 99.9%
add-sqr-sqrt74.5%
pow274.5%
*-commutative74.5%
associate-*l/74.5%
Applied egg-rr74.5%
Taylor expanded in x around 0 40.1%
Taylor expanded in y around 0 28.4%
Final simplification28.4%
(FPCore (x y) :precision binary64 (/ (* (cosh x) (sin y)) y))
double code(double x, double y) {
return (cosh(x) * sin(y)) / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (cosh(x) * sin(y)) / y
end function
public static double code(double x, double y) {
return (Math.cosh(x) * Math.sin(y)) / y;
}
def code(x, y): return (math.cosh(x) * math.sin(y)) / y
function code(x, y) return Float64(Float64(cosh(x) * sin(y)) / y) end
function tmp = code(x, y) tmp = (cosh(x) * sin(y)) / y; end
code[x_, y_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \sin y}{y}
\end{array}
herbie shell --seed 2023238
(FPCore (x y)
:name "Linear.Quaternion:$csinh from linear-1.19.1.3"
:precision binary64
:herbie-target
(/ (* (cosh x) (sin y)) y)
(* (cosh x) (/ (sin y) y)))