
(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 92.5%
associate-*l/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (or (<= (sinh y) (- INFINITY)) (not (<= (sinh y) 1e-10))) (* (+ 1.0 (* (* x x) -0.16666666666666666)) (sinh y)) (* (/ (sin x) x) y)))
double code(double x, double y) {
double tmp;
if ((sinh(y) <= -((double) INFINITY)) || !(sinh(y) <= 1e-10)) {
tmp = (1.0 + ((x * x) * -0.16666666666666666)) * sinh(y);
} else {
tmp = (sin(x) / x) * y;
}
return tmp;
}
public static double code(double x, double y) {
double tmp;
if ((Math.sinh(y) <= -Double.POSITIVE_INFINITY) || !(Math.sinh(y) <= 1e-10)) {
tmp = (1.0 + ((x * x) * -0.16666666666666666)) * Math.sinh(y);
} else {
tmp = (Math.sin(x) / x) * y;
}
return tmp;
}
def code(x, y): tmp = 0 if (math.sinh(y) <= -math.inf) or not (math.sinh(y) <= 1e-10): tmp = (1.0 + ((x * x) * -0.16666666666666666)) * math.sinh(y) else: tmp = (math.sin(x) / x) * y return tmp
function code(x, y) tmp = 0.0 if ((sinh(y) <= Float64(-Inf)) || !(sinh(y) <= 1e-10)) tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * -0.16666666666666666)) * sinh(y)); else tmp = Float64(Float64(sin(x) / x) * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((sinh(y) <= -Inf) || ~((sinh(y) <= 1e-10))) tmp = (1.0 + ((x * x) * -0.16666666666666666)) * sinh(y); else tmp = (sin(x) / x) * y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[N[Sinh[y], $MachinePrecision], (-Infinity)], N[Not[LessEqual[N[Sinh[y], $MachinePrecision], 1e-10]], $MachinePrecision]], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -\infty \lor \neg \left(\sinh y \leq 10^{-10}\right):\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot -0.16666666666666666\right) \cdot \sinh y\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\end{array}
\end{array}
if (sinh.f64 y) < -inf.0 or 1.00000000000000004e-10 < (sinh.f64 y) Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 81.0%
*-commutative81.0%
unpow281.0%
Simplified81.0%
if -inf.0 < (sinh.f64 y) < 1.00000000000000004e-10Initial program 85.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 85.1%
associate-/l*99.8%
Simplified99.8%
clear-num98.8%
associate-/r/99.8%
clear-num99.8%
Applied egg-rr99.8%
Final simplification90.5%
(FPCore (x y) :precision binary64 (if (<= (sinh y) (- INFINITY)) (sinh y) (if (<= (sinh y) 1e-10) (* (sin x) (/ y x)) (sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -((double) INFINITY)) {
tmp = sinh(y);
} else if (sinh(y) <= 1e-10) {
tmp = sin(x) * (y / x);
} else {
tmp = sinh(y);
}
return tmp;
}
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -Double.POSITIVE_INFINITY) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 1e-10) {
tmp = Math.sin(x) * (y / x);
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -math.inf: tmp = math.sinh(y) elif math.sinh(y) <= 1e-10: tmp = math.sin(x) * (y / x) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= Float64(-Inf)) tmp = sinh(y); elseif (sinh(y) <= 1e-10) tmp = Float64(sin(x) * Float64(y / x)); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -Inf) tmp = sinh(y); elseif (sinh(y) <= 1e-10) tmp = sin(x) * (y / x); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], (-Infinity)], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 1e-10], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -\infty:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 10^{-10}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -inf.0 or 1.00000000000000004e-10 < (sinh.f64 y) Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 75.4%
if -inf.0 < (sinh.f64 y) < 1.00000000000000004e-10Initial program 85.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 85.1%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Final simplification87.8%
(FPCore (x y) :precision binary64 (if (<= (sinh y) (- INFINITY)) (sinh y) (if (<= (sinh y) 1e-10) (* (/ (sin x) x) y) (sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -((double) INFINITY)) {
tmp = sinh(y);
} else if (sinh(y) <= 1e-10) {
tmp = (sin(x) / x) * y;
} else {
tmp = sinh(y);
}
return tmp;
}
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -Double.POSITIVE_INFINITY) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 1e-10) {
tmp = (Math.sin(x) / x) * y;
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -math.inf: tmp = math.sinh(y) elif math.sinh(y) <= 1e-10: tmp = (math.sin(x) / x) * y else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= Float64(-Inf)) tmp = sinh(y); elseif (sinh(y) <= 1e-10) tmp = Float64(Float64(sin(x) / x) * y); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -Inf) tmp = sinh(y); elseif (sinh(y) <= 1e-10) tmp = (sin(x) / x) * y; else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], (-Infinity)], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 1e-10], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -\infty:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 10^{-10}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -inf.0 or 1.00000000000000004e-10 < (sinh.f64 y) Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 75.4%
if -inf.0 < (sinh.f64 y) < 1.00000000000000004e-10Initial program 85.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 85.1%
associate-/l*99.8%
Simplified99.8%
clear-num98.8%
associate-/r/99.8%
clear-num99.8%
Applied egg-rr99.8%
Final simplification87.8%
(FPCore (x y)
:precision binary64
(if (<= (sinh y) (- INFINITY))
(sinh y)
(if (<= (sinh y) 1e-10)
(/ y (* x (+ (* x 0.16666666666666666) (/ 1.0 x))))
(sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -((double) INFINITY)) {
tmp = sinh(y);
} else if (sinh(y) <= 1e-10) {
tmp = y / (x * ((x * 0.16666666666666666) + (1.0 / x)));
} else {
tmp = sinh(y);
}
return tmp;
}
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -Double.POSITIVE_INFINITY) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 1e-10) {
tmp = y / (x * ((x * 0.16666666666666666) + (1.0 / x)));
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -math.inf: tmp = math.sinh(y) elif math.sinh(y) <= 1e-10: tmp = y / (x * ((x * 0.16666666666666666) + (1.0 / x))) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= Float64(-Inf)) tmp = sinh(y); elseif (sinh(y) <= 1e-10) tmp = Float64(y / Float64(x * Float64(Float64(x * 0.16666666666666666) + Float64(1.0 / x)))); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -Inf) tmp = sinh(y); elseif (sinh(y) <= 1e-10) tmp = y / (x * ((x * 0.16666666666666666) + (1.0 / x))); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], (-Infinity)], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 1e-10], N[(y / N[(x * N[(N[(x * 0.16666666666666666), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -\infty:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 10^{-10}:\\
\;\;\;\;\frac{y}{x \cdot \left(x \cdot 0.16666666666666666 + \frac{1}{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -inf.0 or 1.00000000000000004e-10 < (sinh.f64 y) Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 75.4%
if -inf.0 < (sinh.f64 y) < 1.00000000000000004e-10Initial program 85.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 85.1%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 70.2%
Final simplification72.7%
(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 92.5%
associate-*r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= y -4.2e+199)
(* x (/ y x))
(if (<= y -3e-121)
(+ y (* -0.16666666666666666 (* y (* x x))))
(if (<= y 1.32e+154) (/ x (/ x y)) (sqrt (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= -4.2e+199) {
tmp = x * (y / x);
} else if (y <= -3e-121) {
tmp = y + (-0.16666666666666666 * (y * (x * x)));
} else if (y <= 1.32e+154) {
tmp = x / (x / y);
} else {
tmp = sqrt((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 <= (-4.2d+199)) then
tmp = x * (y / x)
else if (y <= (-3d-121)) then
tmp = y + ((-0.16666666666666666d0) * (y * (x * x)))
else if (y <= 1.32d+154) then
tmp = x / (x / y)
else
tmp = sqrt((y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -4.2e+199) {
tmp = x * (y / x);
} else if (y <= -3e-121) {
tmp = y + (-0.16666666666666666 * (y * (x * x)));
} else if (y <= 1.32e+154) {
tmp = x / (x / y);
} else {
tmp = Math.sqrt((y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -4.2e+199: tmp = x * (y / x) elif y <= -3e-121: tmp = y + (-0.16666666666666666 * (y * (x * x))) elif y <= 1.32e+154: tmp = x / (x / y) else: tmp = math.sqrt((y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= -4.2e+199) tmp = Float64(x * Float64(y / x)); elseif (y <= -3e-121) tmp = Float64(y + Float64(-0.16666666666666666 * Float64(y * Float64(x * x)))); elseif (y <= 1.32e+154) tmp = Float64(x / Float64(x / y)); else tmp = sqrt(Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -4.2e+199) tmp = x * (y / x); elseif (y <= -3e-121) tmp = y + (-0.16666666666666666 * (y * (x * x))); elseif (y <= 1.32e+154) tmp = x / (x / y); else tmp = sqrt((y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -4.2e+199], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3e-121], N[(y + N[(-0.16666666666666666 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.32e+154], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(y * y), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+199}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-121}:\\
\;\;\;\;y + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot y}\\
\end{array}
\end{array}
if y < -4.1999999999999999e199Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 6.0%
associate-/l*6.0%
associate-/r/59.2%
Simplified59.2%
Taylor expanded in x around 0 59.1%
if -4.1999999999999999e199 < y < -2.9999999999999999e-121Initial program 98.3%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 38.5%
associate-/l*40.1%
associate-/r/44.4%
Simplified44.4%
Taylor expanded in x around 0 37.0%
associate-*r*37.0%
unpow237.0%
Simplified37.0%
Taylor expanded in y around 0 37.0%
unpow237.0%
Simplified37.0%
if -2.9999999999999999e-121 < y < 1.31999999999999998e154Initial program 87.0%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 62.8%
associate-/l*75.7%
associate-/r/80.5%
Simplified80.5%
Taylor expanded in x around 0 60.1%
*-commutative60.1%
clear-num61.1%
un-div-inv60.5%
Applied egg-rr60.5%
if 1.31999999999999998e154 < y Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 5.0%
associate-/l*5.0%
associate-/r/35.1%
Simplified35.1%
Taylor expanded in x around 0 35.0%
associate-/r/4.9%
*-inverses4.9%
div-inv4.9%
metadata-eval4.9%
*-commutative4.9%
*-un-lft-identity4.9%
add-sqr-sqrt4.9%
sqrt-unprod78.6%
Applied egg-rr78.6%
Final simplification56.1%
(FPCore (x y)
:precision binary64
(if (<= y -2.9e+195)
(* x (/ y x))
(if (<= y -2.7e-121)
(+ y (* -0.16666666666666666 (* y (* x x))))
(/ x (/ x y)))))
double code(double x, double y) {
double tmp;
if (y <= -2.9e+195) {
tmp = x * (y / x);
} else if (y <= -2.7e-121) {
tmp = y + (-0.16666666666666666 * (y * (x * x)));
} 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 <= (-2.9d+195)) then
tmp = x * (y / x)
else if (y <= (-2.7d-121)) then
tmp = y + ((-0.16666666666666666d0) * (y * (x * x)))
else
tmp = x / (x / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.9e+195) {
tmp = x * (y / x);
} else if (y <= -2.7e-121) {
tmp = y + (-0.16666666666666666 * (y * (x * x)));
} else {
tmp = x / (x / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.9e+195: tmp = x * (y / x) elif y <= -2.7e-121: tmp = y + (-0.16666666666666666 * (y * (x * x))) else: tmp = x / (x / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.9e+195) tmp = Float64(x * Float64(y / x)); elseif (y <= -2.7e-121) tmp = Float64(y + Float64(-0.16666666666666666 * Float64(y * Float64(x * x)))); else tmp = Float64(x / Float64(x / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.9e+195) tmp = x * (y / x); elseif (y <= -2.7e-121) tmp = y + (-0.16666666666666666 * (y * (x * x))); else tmp = x / (x / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.9e+195], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.7e-121], N[(y + N[(-0.16666666666666666 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+195}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-121}:\\
\;\;\;\;y + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\end{array}
\end{array}
if y < -2.89999999999999992e195Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 6.0%
associate-/l*6.0%
associate-/r/59.2%
Simplified59.2%
Taylor expanded in x around 0 59.1%
if -2.89999999999999992e195 < y < -2.7000000000000002e-121Initial program 98.3%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 38.5%
associate-/l*40.1%
associate-/r/44.4%
Simplified44.4%
Taylor expanded in x around 0 37.0%
associate-*r*37.0%
unpow237.0%
Simplified37.0%
Taylor expanded in y around 0 37.0%
unpow237.0%
Simplified37.0%
if -2.7000000000000002e-121 < y Initial program 89.1%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 53.1%
associate-/l*63.9%
associate-/r/72.9%
Simplified72.9%
Taylor expanded in x around 0 55.9%
*-commutative55.9%
clear-num56.8%
un-div-inv56.2%
Applied egg-rr56.2%
Final simplification51.4%
(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 92.5%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 45.4%
associate-/l*52.8%
associate-/r/64.2%
Simplified64.2%
Taylor expanded in x around 0 47.8%
Final simplification47.8%
(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 92.5%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 45.4%
associate-/l*52.8%
associate-/r/64.2%
Simplified64.2%
Taylor expanded in x around 0 24.0%
Final simplification24.0%
(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 2023199
(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))