
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
return sin(x) * (sinh(y) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / x)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / x); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{x}
\end{array}
Initial program 91.0%
*-commutative91.0%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= y 12.5) (* (sin x) (/ y x)) (log1p (expm1 y))))
double code(double x, double y) {
double tmp;
if (y <= 12.5) {
tmp = sin(x) * (y / x);
} else {
tmp = log1p(expm1(y));
}
return tmp;
}
public static double code(double x, double y) {
double tmp;
if (y <= 12.5) {
tmp = Math.sin(x) * (y / x);
} else {
tmp = Math.log1p(Math.expm1(y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 12.5: tmp = math.sin(x) * (y / x) else: tmp = math.log1p(math.expm1(y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 12.5) tmp = Float64(sin(x) * Float64(y / x)); else tmp = log1p(expm1(y)); end return tmp end
code[x_, y_] := If[LessEqual[y, 12.5], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[y] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 12.5:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\
\end{array}
\end{array}
if y < 12.5Initial program 87.4%
*-commutative87.4%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 50.7%
associate-/l*63.2%
associate-/r/70.9%
Simplified70.9%
if 12.5 < y Initial program 100.0%
Taylor expanded in y around 0 4.4%
Taylor expanded in x around 0 19.4%
*-commutative19.4%
Simplified19.4%
div-inv19.4%
associate-*l*4.2%
div-inv4.2%
*-inverses4.2%
*-commutative4.2%
*-un-lft-identity4.2%
log1p-expm1-u71.4%
Applied egg-rr71.4%
Final simplification71.1%
(FPCore (x y)
:precision binary64
(if (<= y 1600000000.0)
(* (sin x) (/ y x))
(if (<= y 6e+88)
(/ (* y (+ x (* -0.16666666666666666 (pow x 3.0)))) x)
(if (<= y 2.2e+202)
(/ (/ y x) (/ 1.0 (sin x)))
(/ 1.0 (* x (/ 1.0 (* x y))))))))
double code(double x, double y) {
double tmp;
if (y <= 1600000000.0) {
tmp = sin(x) * (y / x);
} else if (y <= 6e+88) {
tmp = (y * (x + (-0.16666666666666666 * pow(x, 3.0)))) / x;
} else if (y <= 2.2e+202) {
tmp = (y / x) / (1.0 / sin(x));
} else {
tmp = 1.0 / (x * (1.0 / (x * y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1600000000.0d0) then
tmp = sin(x) * (y / x)
else if (y <= 6d+88) then
tmp = (y * (x + ((-0.16666666666666666d0) * (x ** 3.0d0)))) / x
else if (y <= 2.2d+202) then
tmp = (y / x) / (1.0d0 / sin(x))
else
tmp = 1.0d0 / (x * (1.0d0 / (x * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1600000000.0) {
tmp = Math.sin(x) * (y / x);
} else if (y <= 6e+88) {
tmp = (y * (x + (-0.16666666666666666 * Math.pow(x, 3.0)))) / x;
} else if (y <= 2.2e+202) {
tmp = (y / x) / (1.0 / Math.sin(x));
} else {
tmp = 1.0 / (x * (1.0 / (x * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1600000000.0: tmp = math.sin(x) * (y / x) elif y <= 6e+88: tmp = (y * (x + (-0.16666666666666666 * math.pow(x, 3.0)))) / x elif y <= 2.2e+202: tmp = (y / x) / (1.0 / math.sin(x)) else: tmp = 1.0 / (x * (1.0 / (x * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 1600000000.0) tmp = Float64(sin(x) * Float64(y / x)); elseif (y <= 6e+88) tmp = Float64(Float64(y * Float64(x + Float64(-0.16666666666666666 * (x ^ 3.0)))) / x); elseif (y <= 2.2e+202) tmp = Float64(Float64(y / x) / Float64(1.0 / sin(x))); else tmp = Float64(1.0 / Float64(x * Float64(1.0 / Float64(x * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1600000000.0) tmp = sin(x) * (y / x); elseif (y <= 6e+88) tmp = (y * (x + (-0.16666666666666666 * (x ^ 3.0)))) / x; elseif (y <= 2.2e+202) tmp = (y / x) / (1.0 / sin(x)); else tmp = 1.0 / (x * (1.0 / (x * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1600000000.0], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+88], N[(N[(y * N[(x + N[(-0.16666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.2e+202], N[(N[(y / x), $MachinePrecision] / N[(1.0 / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1600000000:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+88}:\\
\;\;\;\;\frac{y \cdot \left(x + -0.16666666666666666 \cdot {x}^{3}\right)}{x}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+202}:\\
\;\;\;\;\frac{\frac{y}{x}}{\frac{1}{\sin x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\
\end{array}
\end{array}
if y < 1.6e9Initial program 87.6%
*-commutative87.6%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 50.0%
associate-/l*62.2%
associate-/r/70.4%
Simplified70.4%
if 1.6e9 < y < 6.00000000000000011e88Initial program 100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 30.2%
+-commutative30.2%
associate-*r*30.2%
distribute-rgt-out30.2%
Simplified30.2%
if 6.00000000000000011e88 < y < 2.19999999999999978e202Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 4.0%
associate-/l*4.0%
associate-/r/45.4%
Simplified45.4%
associate-/r/4.0%
div-inv4.0%
associate-/r*45.4%
Applied egg-rr45.4%
if 2.19999999999999978e202 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 5.6%
associate-/l*5.6%
associate-/r/30.5%
Simplified30.5%
*-commutative30.5%
associate-*r/5.6%
clear-num5.6%
*-commutative5.6%
Applied egg-rr5.6%
div-inv5.6%
*-commutative5.6%
associate-/r*5.6%
Applied egg-rr5.6%
Taylor expanded in x around 0 43.3%
*-commutative43.3%
Simplified43.3%
Final simplification62.3%
(FPCore (x y) :precision binary64 (if (<= y 1.7e+202) (* (sin x) (/ y x)) (/ 1.0 (* x (/ 1.0 (* x y))))))
double code(double x, double y) {
double tmp;
if (y <= 1.7e+202) {
tmp = sin(x) * (y / x);
} else {
tmp = 1.0 / (x * (1.0 / (x * y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.7d+202) then
tmp = sin(x) * (y / x)
else
tmp = 1.0d0 / (x * (1.0d0 / (x * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.7e+202) {
tmp = Math.sin(x) * (y / x);
} else {
tmp = 1.0 / (x * (1.0 / (x * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.7e+202: tmp = math.sin(x) * (y / x) else: tmp = 1.0 / (x * (1.0 / (x * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.7e+202) tmp = Float64(sin(x) * Float64(y / x)); else tmp = Float64(1.0 / Float64(x * Float64(1.0 / Float64(x * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.7e+202) tmp = sin(x) * (y / x); else tmp = 1.0 / (x * (1.0 / (x * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.7e+202], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{+202}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\
\end{array}
\end{array}
if y < 1.7e202Initial program 90.2%
*-commutative90.2%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 40.5%
associate-/l*50.2%
associate-/r/62.4%
Simplified62.4%
if 1.7e202 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 5.6%
associate-/l*5.6%
associate-/r/30.5%
Simplified30.5%
*-commutative30.5%
associate-*r/5.6%
clear-num5.6%
*-commutative5.6%
Applied egg-rr5.6%
div-inv5.6%
*-commutative5.6%
associate-/r*5.6%
Applied egg-rr5.6%
Taylor expanded in x around 0 43.3%
*-commutative43.3%
Simplified43.3%
Final simplification60.8%
(FPCore (x y) :precision binary64 (if (<= y 4.2e+191) (/ (/ y x) (+ (* x 0.16666666666666666) (/ 1.0 x))) (/ 1.0 (* x (/ 1.0 (* x y))))))
double code(double x, double y) {
double tmp;
if (y <= 4.2e+191) {
tmp = (y / x) / ((x * 0.16666666666666666) + (1.0 / x));
} else {
tmp = 1.0 / (x * (1.0 / (x * y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.2d+191) then
tmp = (y / x) / ((x * 0.16666666666666666d0) + (1.0d0 / x))
else
tmp = 1.0d0 / (x * (1.0d0 / (x * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.2e+191) {
tmp = (y / x) / ((x * 0.16666666666666666) + (1.0 / x));
} else {
tmp = 1.0 / (x * (1.0 / (x * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.2e+191: tmp = (y / x) / ((x * 0.16666666666666666) + (1.0 / x)) else: tmp = 1.0 / (x * (1.0 / (x * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.2e+191) tmp = Float64(Float64(y / x) / Float64(Float64(x * 0.16666666666666666) + Float64(1.0 / x))); else tmp = Float64(1.0 / Float64(x * Float64(1.0 / Float64(x * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.2e+191) tmp = (y / x) / ((x * 0.16666666666666666) + (1.0 / x)); else tmp = 1.0 / (x * (1.0 / (x * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.2e+191], N[(N[(y / x), $MachinePrecision] / N[(N[(x * 0.16666666666666666), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{+191}:\\
\;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666 + \frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\
\end{array}
\end{array}
if y < 4.2000000000000001e191Initial program 90.0%
*-commutative90.0%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 41.1%
associate-/l*51.0%
associate-/r/63.0%
Simplified63.0%
associate-/r/51.0%
div-inv51.0%
associate-/r*62.9%
Applied egg-rr62.9%
Taylor expanded in x around 0 48.8%
if 4.2000000000000001e191 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 5.4%
associate-/l*5.4%
associate-/r/30.0%
Simplified30.0%
*-commutative30.0%
associate-*r/5.4%
clear-num5.4%
*-commutative5.4%
Applied egg-rr5.4%
div-inv5.4%
*-commutative5.4%
associate-/r*5.4%
Applied egg-rr5.4%
Taylor expanded in x around 0 40.7%
*-commutative40.7%
Simplified40.7%
Final simplification48.0%
(FPCore (x y) :precision binary64 (if (<= y 6.6e+222) (* x (/ y x)) (/ 1.0 (* x (/ 1.0 (* x y))))))
double code(double x, double y) {
double tmp;
if (y <= 6.6e+222) {
tmp = x * (y / x);
} else {
tmp = 1.0 / (x * (1.0 / (x * y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6.6d+222) then
tmp = x * (y / x)
else
tmp = 1.0d0 / (x * (1.0d0 / (x * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6.6e+222) {
tmp = x * (y / x);
} else {
tmp = 1.0 / (x * (1.0 / (x * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.6e+222: tmp = x * (y / x) else: tmp = 1.0 / (x * (1.0 / (x * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 6.6e+222) tmp = Float64(x * Float64(y / x)); else tmp = Float64(1.0 / Float64(x * Float64(1.0 / Float64(x * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6.6e+222) tmp = x * (y / x); else tmp = 1.0 / (x * (1.0 / (x * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.6e+222], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{+222}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\
\end{array}
\end{array}
if y < 6.59999999999999967e222Initial program 90.3%
Taylor expanded in y around 0 39.9%
Taylor expanded in x around 0 22.5%
*-commutative22.5%
Simplified22.5%
associate-/l*25.8%
associate-/r/48.0%
Applied egg-rr48.0%
if 6.59999999999999967e222 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 5.9%
associate-/l*5.9%
associate-/r/25.8%
Simplified25.8%
*-commutative25.8%
associate-*r/5.9%
clear-num5.9%
*-commutative5.9%
Applied egg-rr5.9%
div-inv5.9%
*-commutative5.9%
associate-/r*5.9%
Applied egg-rr5.9%
Taylor expanded in x around 0 46.7%
*-commutative46.7%
Simplified46.7%
Final simplification47.9%
(FPCore (x y) :precision binary64 (if (<= y 1.25e+222) (* x (/ y x)) (/ (* x y) x)))
double code(double x, double y) {
double tmp;
if (y <= 1.25e+222) {
tmp = x * (y / x);
} else {
tmp = (x * y) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.25d+222) then
tmp = x * (y / x)
else
tmp = (x * y) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.25e+222) {
tmp = x * (y / x);
} else {
tmp = (x * y) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.25e+222: tmp = x * (y / x) else: tmp = (x * y) / x return tmp
function code(x, y) tmp = 0.0 if (y <= 1.25e+222) tmp = Float64(x * Float64(y / x)); else tmp = Float64(Float64(x * y) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.25e+222) tmp = x * (y / x); else tmp = (x * y) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.25e+222], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{+222}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\end{array}
\end{array}
if y < 1.25000000000000006e222Initial program 90.3%
Taylor expanded in y around 0 39.9%
Taylor expanded in x around 0 22.5%
*-commutative22.5%
Simplified22.5%
associate-/l*25.8%
associate-/r/48.0%
Applied egg-rr48.0%
if 1.25000000000000006e222 < y Initial program 100.0%
Taylor expanded in y around 0 5.9%
Taylor expanded in x around 0 46.7%
*-commutative46.7%
Simplified46.7%
Final simplification47.9%
(FPCore (x y) :precision binary64 (* x (/ y x)))
double code(double x, double y) {
return x * (y / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (y / x)
end function
public static double code(double x, double y) {
return x * (y / x);
}
def code(x, y): return x * (y / x)
function code(x, y) return Float64(x * Float64(y / x)) end
function tmp = code(x, y) tmp = x * (y / x); end
code[x_, y_] := N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y}{x}
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 37.5%
Taylor expanded in x around 0 24.2%
*-commutative24.2%
Simplified24.2%
associate-/l*24.4%
associate-/r/46.5%
Applied egg-rr46.5%
Final simplification46.5%
(FPCore (x y) :precision binary64 y)
double code(double x, double y) {
return y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y
end function
public static double code(double x, double y) {
return y;
}
def code(x, y): return y
function code(x, y) return y end
function tmp = code(x, y) tmp = y; end
code[x_, y_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 91.0%
*-commutative91.0%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 37.5%
associate-/l*46.4%
associate-/r/59.7%
Simplified59.7%
Taylor expanded in x around 0 24.4%
Final simplification24.4%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
return sin(x) * (sinh(y) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / x)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / x); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{x}
\end{array}
herbie shell --seed 2023332
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
:herbie-target
(* (sin x) (/ (sinh y) x))
(/ (* (sin x) (sinh y)) x))