
(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 10 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) x) (sinh y)))
double code(double x, double y) {
return (sin(x) / x) * sinh(y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) / x) * sinh(y)
end function
public static double code(double x, double y) {
return (Math.sin(x) / x) * Math.sinh(y);
}
def code(x, y): return (math.sin(x) / x) * math.sinh(y)
function code(x, y) return Float64(Float64(sin(x) / x) * sinh(y)) end
function tmp = code(x, y) tmp = (sin(x) / x) * sinh(y); end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x}{x} \cdot \sinh y
\end{array}
Initial program 90.0%
associate-*l/99.9%
Simplified99.9%
Final simplification99.9%
(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 90.0%
associate-*r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (or (<= y -2.4e+16) (not (<= y 0.00066))) (sinh y) (* (sin x) (/ y x))))
double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 0.00066)) {
tmp = sinh(y);
} else {
tmp = sin(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 <= (-2.4d+16)) .or. (.not. (y <= 0.00066d0))) then
tmp = sinh(y)
else
tmp = sin(x) * (y / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 0.00066)) {
tmp = Math.sinh(y);
} else {
tmp = Math.sin(x) * (y / x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.4e+16) or not (y <= 0.00066): tmp = math.sinh(y) else: tmp = math.sin(x) * (y / x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.4e+16) || !(y <= 0.00066)) tmp = sinh(y); else tmp = Float64(sin(x) * Float64(y / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -2.4e+16) || ~((y <= 0.00066))) tmp = sinh(y); else tmp = sin(x) * (y / x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.4e+16], N[Not[LessEqual[y, 0.00066]], $MachinePrecision]], N[Sinh[y], $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+16} \lor \neg \left(y \leq 0.00066\right):\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\end{array}
\end{array}
if y < -2.4e16 or 6.6e-4 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 72.3%
if -2.4e16 < y < 6.6e-4Initial program 77.8%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 76.7%
associate-/l*98.7%
associate-/r/98.6%
Simplified98.6%
Final simplification84.1%
(FPCore (x y) :precision binary64 (if (or (<= y -2.4e+16) (not (<= y 0.017))) (sinh y) (* (/ (sin x) x) y)))
double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 0.017)) {
tmp = sinh(y);
} else {
tmp = (sin(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 ((y <= (-2.4d+16)) .or. (.not. (y <= 0.017d0))) then
tmp = sinh(y)
else
tmp = (sin(x) / x) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 0.017)) {
tmp = Math.sinh(y);
} else {
tmp = (Math.sin(x) / x) * y;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.4e+16) or not (y <= 0.017): tmp = math.sinh(y) else: tmp = (math.sin(x) / x) * y return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.4e+16) || !(y <= 0.017)) tmp = sinh(y); else tmp = Float64(Float64(sin(x) / x) * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -2.4e+16) || ~((y <= 0.017))) tmp = sinh(y); else tmp = (sin(x) / x) * y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.4e+16], N[Not[LessEqual[y, 0.017]], $MachinePrecision]], N[Sinh[y], $MachinePrecision], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+16} \lor \neg \left(y \leq 0.017\right):\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\end{array}
\end{array}
if y < -2.4e16 or 0.017000000000000001 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 72.3%
if -2.4e16 < y < 0.017000000000000001Initial program 77.8%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 76.7%
associate-/l*98.7%
Simplified98.7%
div-inv98.6%
*-commutative98.6%
clear-num98.7%
Applied egg-rr98.7%
Final simplification84.2%
(FPCore (x y) :precision binary64 (if (or (<= y -2.4e+16) (not (<= y 3.2e-8))) (sinh y) (* y (/ 1.0 (+ 1.0 (* x (* x 0.16666666666666666)))))))
double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 3.2e-8)) {
tmp = sinh(y);
} else {
tmp = y * (1.0 / (1.0 + (x * (x * 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 <= (-2.4d+16)) .or. (.not. (y <= 3.2d-8))) then
tmp = sinh(y)
else
tmp = y * (1.0d0 / (1.0d0 + (x * (x * 0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 3.2e-8)) {
tmp = Math.sinh(y);
} else {
tmp = y * (1.0 / (1.0 + (x * (x * 0.16666666666666666))));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.4e+16) or not (y <= 3.2e-8): tmp = math.sinh(y) else: tmp = y * (1.0 / (1.0 + (x * (x * 0.16666666666666666)))) return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.4e+16) || !(y <= 3.2e-8)) tmp = sinh(y); else tmp = Float64(y * Float64(1.0 / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -2.4e+16) || ~((y <= 3.2e-8))) tmp = sinh(y); else tmp = y * (1.0 / (1.0 + (x * (x * 0.16666666666666666)))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.4e+16], N[Not[LessEqual[y, 3.2e-8]], $MachinePrecision]], N[Sinh[y], $MachinePrecision], N[(y * N[(1.0 / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+16} \lor \neg \left(y \leq 3.2 \cdot 10^{-8}\right):\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\
\end{array}
\end{array}
if y < -2.4e16 or 3.2000000000000002e-8 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 72.3%
if -2.4e16 < y < 3.2000000000000002e-8Initial program 77.8%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 76.7%
associate-/l*98.7%
associate-/r/98.6%
Simplified98.6%
associate-/r/98.7%
div-inv97.7%
associate-/r*97.6%
Applied egg-rr97.6%
Taylor expanded in x around 0 68.8%
associate-/l/69.0%
div-inv69.0%
*-commutative69.0%
+-commutative69.0%
distribute-rgt-in69.0%
lft-mult-inverse69.9%
*-commutative69.9%
Applied egg-rr69.9%
Final simplification71.3%
(FPCore (x y) :precision binary64 (if (or (<= y -2.4e+16) (not (<= y 190.0))) (/ (/ y x) (* x 0.16666666666666666)) (* y (/ 1.0 (+ 1.0 (* x (* x 0.16666666666666666)))))))
double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 190.0)) {
tmp = (y / x) / (x * 0.16666666666666666);
} else {
tmp = y * (1.0 / (1.0 + (x * (x * 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 <= (-2.4d+16)) .or. (.not. (y <= 190.0d0))) then
tmp = (y / x) / (x * 0.16666666666666666d0)
else
tmp = y * (1.0d0 / (1.0d0 + (x * (x * 0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 190.0)) {
tmp = (y / x) / (x * 0.16666666666666666);
} else {
tmp = y * (1.0 / (1.0 + (x * (x * 0.16666666666666666))));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.4e+16) or not (y <= 190.0): tmp = (y / x) / (x * 0.16666666666666666) else: tmp = y * (1.0 / (1.0 + (x * (x * 0.16666666666666666)))) return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.4e+16) || !(y <= 190.0)) tmp = Float64(Float64(y / x) / Float64(x * 0.16666666666666666)); else tmp = Float64(y * Float64(1.0 / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -2.4e+16) || ~((y <= 190.0))) tmp = (y / x) / (x * 0.16666666666666666); else tmp = y * (1.0 / (1.0 + (x * (x * 0.16666666666666666)))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.4e+16], N[Not[LessEqual[y, 190.0]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] / N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(y * N[(1.0 / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+16} \lor \neg \left(y \leq 190\right):\\
\;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\
\end{array}
\end{array}
if y < -2.4e16 or 190 < y Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 4.6%
associate-/l*4.6%
associate-/r/30.6%
Simplified30.6%
associate-/r/4.6%
div-inv4.6%
associate-/r*30.6%
Applied egg-rr30.6%
Taylor expanded in x around 0 29.8%
Taylor expanded in x around inf 45.1%
*-commutative45.1%
Simplified45.1%
if -2.4e16 < y < 190Initial program 78.0%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 76.1%
associate-/l*97.9%
associate-/r/97.8%
Simplified97.8%
associate-/r/97.9%
div-inv96.9%
associate-/r*96.8%
Applied egg-rr96.8%
Taylor expanded in x around 0 68.3%
associate-/l/68.5%
div-inv68.5%
*-commutative68.5%
+-commutative68.5%
distribute-rgt-in68.5%
lft-mult-inverse69.4%
*-commutative69.4%
Applied egg-rr69.4%
Final simplification56.1%
(FPCore (x y) :precision binary64 (if (or (<= y -2.4e+16) (not (<= y 300.0))) (/ (/ y x) (* x 0.16666666666666666)) (/ y (+ 1.0 (* x (* x 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 300.0)) {
tmp = (y / x) / (x * 0.16666666666666666);
} else {
tmp = y / (1.0 + (x * (x * 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 <= (-2.4d+16)) .or. (.not. (y <= 300.0d0))) then
tmp = (y / x) / (x * 0.16666666666666666d0)
else
tmp = y / (1.0d0 + (x * (x * 0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -2.4e+16) || !(y <= 300.0)) {
tmp = (y / x) / (x * 0.16666666666666666);
} else {
tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.4e+16) or not (y <= 300.0): tmp = (y / x) / (x * 0.16666666666666666) else: tmp = y / (1.0 + (x * (x * 0.16666666666666666))) return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.4e+16) || !(y <= 300.0)) tmp = Float64(Float64(y / x) / Float64(x * 0.16666666666666666)); else tmp = Float64(y / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -2.4e+16) || ~((y <= 300.0))) tmp = (y / x) / (x * 0.16666666666666666); else tmp = y / (1.0 + (x * (x * 0.16666666666666666))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.4e+16], N[Not[LessEqual[y, 300.0]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] / N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(y / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+16} \lor \neg \left(y \leq 300\right):\\
\;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\
\end{array}
\end{array}
if y < -2.4e16 or 300 < y Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 4.6%
associate-/l*4.6%
associate-/r/30.6%
Simplified30.6%
associate-/r/4.6%
div-inv4.6%
associate-/r*30.6%
Applied egg-rr30.6%
Taylor expanded in x around 0 29.8%
Taylor expanded in x around inf 45.1%
*-commutative45.1%
Simplified45.1%
if -2.4e16 < y < 300Initial program 78.0%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 76.1%
associate-/l*97.9%
associate-/r/97.8%
Simplified97.8%
associate-/r/97.9%
div-inv96.9%
associate-/r*96.8%
Applied egg-rr96.8%
Taylor expanded in x around 0 68.3%
expm1-log1p-u68.3%
expm1-udef26.3%
associate-/l/26.3%
*-commutative26.3%
+-commutative26.3%
distribute-rgt-in26.3%
lft-mult-inverse26.3%
*-commutative26.3%
Applied egg-rr26.3%
expm1-def69.4%
expm1-log1p69.4%
*-commutative69.4%
Simplified69.4%
Final simplification56.1%
(FPCore (x y) :precision binary64 (if (or (<= y -3.1e-9) (not (<= y 270.0))) (/ (/ y x) (* x 0.16666666666666666)) (/ x (/ x y))))
double code(double x, double y) {
double tmp;
if ((y <= -3.1e-9) || !(y <= 270.0)) {
tmp = (y / x) / (x * 0.16666666666666666);
} else {
tmp = 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 ((y <= (-3.1d-9)) .or. (.not. (y <= 270.0d0))) then
tmp = (y / x) / (x * 0.16666666666666666d0)
else
tmp = x / (x / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -3.1e-9) || !(y <= 270.0)) {
tmp = (y / x) / (x * 0.16666666666666666);
} else {
tmp = x / (x / y);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -3.1e-9) or not (y <= 270.0): tmp = (y / x) / (x * 0.16666666666666666) else: tmp = x / (x / y) return tmp
function code(x, y) tmp = 0.0 if ((y <= -3.1e-9) || !(y <= 270.0)) tmp = Float64(Float64(y / x) / Float64(x * 0.16666666666666666)); else tmp = Float64(x / Float64(x / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -3.1e-9) || ~((y <= 270.0))) tmp = (y / x) / (x * 0.16666666666666666); else tmp = x / (x / y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -3.1e-9], N[Not[LessEqual[y, 270.0]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] / N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-9} \lor \neg \left(y \leq 270\right):\\
\;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\end{array}
\end{array}
if y < -3.10000000000000005e-9 or 270 < y Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 5.7%
associate-/l*5.7%
associate-/r/31.1%
Simplified31.1%
associate-/r/5.7%
div-inv5.7%
associate-/r*31.1%
Applied egg-rr31.1%
Taylor expanded in x around 0 29.3%
Taylor expanded in x around inf 44.3%
*-commutative44.3%
Simplified44.3%
if -3.10000000000000005e-9 < y < 270Initial program 77.4%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 76.6%
associate-/l*99.0%
associate-/r/98.9%
Simplified98.9%
Taylor expanded in x around 0 70.1%
*-commutative70.1%
clear-num70.2%
un-div-inv70.4%
Applied egg-rr70.4%
Final simplification55.8%
(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 90.0%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 37.0%
associate-/l*46.9%
associate-/r/61.1%
Simplified61.1%
Taylor expanded in x around 0 47.5%
Final simplification47.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 90.0%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 37.0%
associate-/l*46.9%
associate-/r/61.1%
Simplified61.1%
Taylor expanded in x around 0 24.2%
Final simplification24.2%
(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 2023301
(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))