
(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 11 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 89.8%
associate-*l/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= (sinh y) (- INFINITY)) (sinh y) (if (<= (sinh y) 2e-17) (* (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) <= 2e-17) {
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) <= 2e-17) {
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) <= 2e-17: 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) <= 2e-17) 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) <= 2e-17) 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], 2e-17], 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 2 \cdot 10^{-17}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -inf.0 or 2.00000000000000014e-17 < (sinh.f64 y) Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 74.3%
if -inf.0 < (sinh.f64 y) < 2.00000000000000014e-17Initial program 78.2%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 77.8%
associate-/l*99.4%
associate-/r/99.4%
Simplified99.4%
Final simplification86.1%
(FPCore (x y) :precision binary64 (if (<= (sinh y) -6e-19) (sinh y) (if (<= (sinh y) 2e-32) (/ x (/ x y)) (sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -6e-19) {
tmp = sinh(y);
} else if (sinh(y) <= 2e-32) {
tmp = x / (x / y);
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= (-6d-19)) then
tmp = sinh(y)
else if (sinh(y) <= 2d-32) then
tmp = x / (x / y)
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -6e-19) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 2e-32) {
tmp = x / (x / y);
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -6e-19: tmp = math.sinh(y) elif math.sinh(y) <= 2e-32: tmp = x / (x / y) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= -6e-19) tmp = sinh(y); elseif (sinh(y) <= 2e-32) tmp = Float64(x / Float64(x / y)); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -6e-19) tmp = sinh(y); elseif (sinh(y) <= 2e-32) tmp = x / (x / y); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -6e-19], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 2e-32], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -6 \cdot 10^{-19}:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -5.99999999999999985e-19 or 2.00000000000000011e-32 < (sinh.f64 y) Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 72.8%
if -5.99999999999999985e-19 < (sinh.f64 y) < 2.00000000000000011e-32Initial program 76.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 76.8%
Taylor expanded in x around 0 26.3%
clear-num26.3%
associate-/r/26.2%
Applied egg-rr26.2%
associate-*l/26.3%
*-un-lft-identity26.3%
*-commutative26.3%
associate-/l*68.4%
Applied egg-rr68.4%
Final simplification70.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 89.8%
associate-*r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= y -4.5e+17) (* (+ 1.0 (* (* x x) -0.16666666666666666)) (sinh y)) (if (<= y 8.6e-11) (* (/ (sin x) x) y) (sinh y))))
double code(double x, double y) {
double tmp;
if (y <= -4.5e+17) {
tmp = (1.0 + ((x * x) * -0.16666666666666666)) * sinh(y);
} else if (y <= 8.6e-11) {
tmp = (sin(x) / x) * y;
} else {
tmp = sinh(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.5d+17)) then
tmp = (1.0d0 + ((x * x) * (-0.16666666666666666d0))) * sinh(y)
else if (y <= 8.6d-11) then
tmp = (sin(x) / x) * y
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -4.5e+17) {
tmp = (1.0 + ((x * x) * -0.16666666666666666)) * Math.sinh(y);
} else if (y <= 8.6e-11) {
tmp = (Math.sin(x) / x) * y;
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -4.5e+17: tmp = (1.0 + ((x * x) * -0.16666666666666666)) * math.sinh(y) elif y <= 8.6e-11: tmp = (math.sin(x) / x) * y else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (y <= -4.5e+17) tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * -0.16666666666666666)) * sinh(y)); elseif (y <= 8.6e-11) 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 (y <= -4.5e+17) tmp = (1.0 + ((x * x) * -0.16666666666666666)) * sinh(y); elseif (y <= 8.6e-11) tmp = (sin(x) / x) * y; else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -4.5e+17], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.6e-11], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+17}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot -0.16666666666666666\right) \cdot \sinh y\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-11}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if y < -4.5e17Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 80.5%
*-commutative80.5%
unpow280.5%
Simplified80.5%
if -4.5e17 < y < 8.60000000000000003e-11Initial program 78.3%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 77.2%
associate-/l*98.6%
Simplified98.6%
clear-num97.0%
associate-/r/98.6%
clear-num98.7%
Applied egg-rr98.7%
if 8.60000000000000003e-11 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 75.9%
Final simplification88.1%
(FPCore (x y) :precision binary64 (if (<= y -0.00081) (sinh y) (if (<= y 8.6e-11) (* (/ (sin x) x) y) (sinh y))))
double code(double x, double y) {
double tmp;
if (y <= -0.00081) {
tmp = sinh(y);
} else if (y <= 8.6e-11) {
tmp = (sin(x) / x) * y;
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-0.00081d0)) then
tmp = sinh(y)
else if (y <= 8.6d-11) then
tmp = (sin(x) / x) * y
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -0.00081) {
tmp = Math.sinh(y);
} else if (y <= 8.6e-11) {
tmp = (Math.sin(x) / x) * y;
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -0.00081: tmp = math.sinh(y) elif y <= 8.6e-11: tmp = (math.sin(x) / x) * y else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (y <= -0.00081) tmp = sinh(y); elseif (y <= 8.6e-11) 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 (y <= -0.00081) tmp = sinh(y); elseif (y <= 8.6e-11) tmp = (sin(x) / x) * y; else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -0.00081], N[Sinh[y], $MachinePrecision], If[LessEqual[y, 8.6e-11], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00081:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-11}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if y < -8.0999999999999996e-4 or 8.60000000000000003e-11 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 74.3%
if -8.0999999999999996e-4 < y < 8.60000000000000003e-11Initial program 78.2%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 77.8%
associate-/l*99.4%
Simplified99.4%
clear-num97.8%
associate-/r/99.4%
clear-num99.5%
Applied egg-rr99.5%
Final simplification86.1%
(FPCore (x y) :precision binary64 (if (<= x 18000.0) (* x (/ y x)) (sqrt (* y y))))
double code(double x, double y) {
double tmp;
if (x <= 18000.0) {
tmp = x * (y / x);
} 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 (x <= 18000.0d0) then
tmp = x * (y / x)
else
tmp = sqrt((y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 18000.0) {
tmp = x * (y / x);
} else {
tmp = Math.sqrt((y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 18000.0: tmp = x * (y / x) else: tmp = math.sqrt((y * y)) return tmp
function code(x, y) tmp = 0.0 if (x <= 18000.0) tmp = Float64(x * Float64(y / x)); else tmp = sqrt(Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 18000.0) tmp = x * (y / x); else tmp = sqrt((y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 18000.0], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(y * y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 18000:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot y}\\
\end{array}
\end{array}
if x < 18000Initial program 85.7%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 35.0%
Taylor expanded in x around 0 23.8%
associate-/l*34.4%
associate-/r/57.8%
Applied egg-rr57.8%
if 18000 < x Initial program 99.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 50.9%
Taylor expanded in x around 0 17.0%
associate-/l*4.2%
*-inverses4.2%
/-rgt-identity4.2%
add-sqr-sqrt2.0%
sqrt-unprod31.0%
Applied egg-rr31.0%
Final simplification50.2%
(FPCore (x y)
:precision binary64
(if (<= x 2.8e-50)
(* x (/ y x))
(if (<= x 6.8e+183)
(+ y (* -0.16666666666666666 (* y (* x x))))
(/ x (/ x y)))))
double code(double x, double y) {
double tmp;
if (x <= 2.8e-50) {
tmp = x * (y / x);
} else if (x <= 6.8e+183) {
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 (x <= 2.8d-50) then
tmp = x * (y / x)
else if (x <= 6.8d+183) 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 (x <= 2.8e-50) {
tmp = x * (y / x);
} else if (x <= 6.8e+183) {
tmp = y + (-0.16666666666666666 * (y * (x * x)));
} else {
tmp = x / (x / y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.8e-50: tmp = x * (y / x) elif x <= 6.8e+183: tmp = y + (-0.16666666666666666 * (y * (x * x))) else: tmp = x / (x / y) return tmp
function code(x, y) tmp = 0.0 if (x <= 2.8e-50) tmp = Float64(x * Float64(y / x)); elseif (x <= 6.8e+183) 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 (x <= 2.8e-50) tmp = x * (y / x); elseif (x <= 6.8e+183) tmp = y + (-0.16666666666666666 * (y * (x * x))); else tmp = x / (x / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.8e-50], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e+183], 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}\;x \leq 2.8 \cdot 10^{-50}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+183}:\\
\;\;\;\;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 x < 2.7999999999999998e-50Initial program 85.3%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 32.7%
Taylor expanded in x around 0 21.4%
associate-/l*32.2%
associate-/r/57.2%
Applied egg-rr57.2%
if 2.7999999999999998e-50 < x < 6.8e183Initial program 98.2%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 50.9%
associate-/l*52.4%
Simplified52.4%
Taylor expanded in x around 0 29.6%
unpow229.6%
Simplified29.6%
if 6.8e183 < x Initial program 100.0%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 59.4%
Taylor expanded in x around 0 28.6%
clear-num28.6%
associate-/r/28.6%
Applied egg-rr28.6%
associate-*l/28.6%
*-un-lft-identity28.6%
*-commutative28.6%
associate-/l*49.8%
Applied egg-rr49.8%
Final simplification49.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 89.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 39.5%
Taylor expanded in x around 0 21.9%
associate-/l*25.8%
associate-/r/47.3%
Applied egg-rr47.3%
Final simplification47.3%
(FPCore (x y) :precision binary64 (/ x (/ x y)))
double code(double x, double y) {
return x / (x / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / (x / y)
end function
public static double code(double x, double y) {
return x / (x / y);
}
def code(x, y): return x / (x / y)
function code(x, y) return Float64(x / Float64(x / y)) end
function tmp = code(x, y) tmp = x / (x / y); end
code[x_, y_] := N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{x}{y}}
\end{array}
Initial program 89.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 39.5%
Taylor expanded in x around 0 21.9%
clear-num21.8%
associate-/r/21.8%
Applied egg-rr21.8%
associate-*l/21.9%
*-un-lft-identity21.9%
*-commutative21.9%
associate-/l*47.3%
Applied egg-rr47.3%
Final simplification47.3%
(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 89.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 39.5%
associate-/l*49.6%
Simplified49.6%
Taylor expanded in x around 0 25.8%
Final simplification25.8%
(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 2023240
(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))