
(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 12 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 90.0%
associate-/l*99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y) :precision binary64 (if (<= y 360.0) (* y (/ (sin x) x)) (log1p (expm1 y))))
double code(double x, double y) {
double tmp;
if (y <= 360.0) {
tmp = y * (sin(x) / x);
} else {
tmp = log1p(expm1(y));
}
return tmp;
}
public static double code(double x, double y) {
double tmp;
if (y <= 360.0) {
tmp = y * (Math.sin(x) / x);
} else {
tmp = Math.log1p(Math.expm1(y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 360.0: tmp = y * (math.sin(x) / x) else: tmp = math.log1p(math.expm1(y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 360.0) tmp = Float64(y * Float64(sin(x) / x)); else tmp = log1p(expm1(y)); end return tmp end
code[x_, y_] := If[LessEqual[y, 360.0], N[(y * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[y] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 360:\\
\;\;\;\;y \cdot \frac{\sin x}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\
\end{array}
\end{array}
if y < 360Initial program 86.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 50.4%
associate-/l*64.0%
Simplified64.0%
if 360 < y Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 3.7%
associate-/l*3.7%
Simplified3.7%
associate-*r/3.7%
*-commutative3.7%
clear-num3.7%
Applied egg-rr3.7%
Taylor expanded in x around 0 3.5%
remove-double-div3.5%
log1p-expm1-u65.7%
Applied egg-rr65.7%
Final simplification64.5%
(FPCore (x y)
:precision binary64
(if (<= y 4.6e+29)
(* y (/ (sin x) x))
(if (<= y 3.2e+101)
(/ (* x (+ y (* -0.16666666666666666 (* y (pow x 2.0))))) x)
(+ y (* 0.16666666666666666 (pow y 3.0))))))
double code(double x, double y) {
double tmp;
if (y <= 4.6e+29) {
tmp = y * (sin(x) / x);
} else if (y <= 3.2e+101) {
tmp = (x * (y + (-0.16666666666666666 * (y * pow(x, 2.0))))) / x;
} else {
tmp = y + (0.16666666666666666 * pow(y, 3.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.6d+29) then
tmp = y * (sin(x) / x)
else if (y <= 3.2d+101) then
tmp = (x * (y + ((-0.16666666666666666d0) * (y * (x ** 2.0d0))))) / x
else
tmp = y + (0.16666666666666666d0 * (y ** 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.6e+29) {
tmp = y * (Math.sin(x) / x);
} else if (y <= 3.2e+101) {
tmp = (x * (y + (-0.16666666666666666 * (y * Math.pow(x, 2.0))))) / x;
} else {
tmp = y + (0.16666666666666666 * Math.pow(y, 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.6e+29: tmp = y * (math.sin(x) / x) elif y <= 3.2e+101: tmp = (x * (y + (-0.16666666666666666 * (y * math.pow(x, 2.0))))) / x else: tmp = y + (0.16666666666666666 * math.pow(y, 3.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.6e+29) tmp = Float64(y * Float64(sin(x) / x)); elseif (y <= 3.2e+101) tmp = Float64(Float64(x * Float64(y + Float64(-0.16666666666666666 * Float64(y * (x ^ 2.0))))) / x); else tmp = Float64(y + Float64(0.16666666666666666 * (y ^ 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.6e+29) tmp = y * (sin(x) / x); elseif (y <= 3.2e+101) tmp = (x * (y + (-0.16666666666666666 * (y * (x ^ 2.0))))) / x; else tmp = y + (0.16666666666666666 * (y ^ 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.6e+29], N[(y * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+101], N[(N[(x * N[(y + N[(-0.16666666666666666 * N[(y * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(y + N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \frac{\sin x}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+101}:\\
\;\;\;\;\frac{x \cdot \left(y + -0.16666666666666666 \cdot \left(y \cdot {x}^{2}\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;y + 0.16666666666666666 \cdot {y}^{3}\\
\end{array}
\end{array}
if y < 4.6000000000000002e29Initial program 86.5%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 49.7%
associate-/l*63.0%
Simplified63.0%
if 4.6000000000000002e29 < y < 3.20000000000000005e101Initial program 100.0%
Taylor expanded in y around 0 2.7%
Taylor expanded in x around 0 48.9%
if 3.20000000000000005e101 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate-*l*100.0%
pow-plus100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 71.4%
Final simplification63.0%
(FPCore (x y)
:precision binary64
(if (<= y 4.4e+29)
(* y (/ (sin x) x))
(if (<= y 1.65e+102)
(* y (+ 1.0 (* -0.16666666666666666 (pow x 2.0))))
(+ y (* 0.16666666666666666 (pow y 3.0))))))
double code(double x, double y) {
double tmp;
if (y <= 4.4e+29) {
tmp = y * (sin(x) / x);
} else if (y <= 1.65e+102) {
tmp = y * (1.0 + (-0.16666666666666666 * pow(x, 2.0)));
} else {
tmp = y + (0.16666666666666666 * pow(y, 3.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.4d+29) then
tmp = y * (sin(x) / x)
else if (y <= 1.65d+102) then
tmp = y * (1.0d0 + ((-0.16666666666666666d0) * (x ** 2.0d0)))
else
tmp = y + (0.16666666666666666d0 * (y ** 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.4e+29) {
tmp = y * (Math.sin(x) / x);
} else if (y <= 1.65e+102) {
tmp = y * (1.0 + (-0.16666666666666666 * Math.pow(x, 2.0)));
} else {
tmp = y + (0.16666666666666666 * Math.pow(y, 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.4e+29: tmp = y * (math.sin(x) / x) elif y <= 1.65e+102: tmp = y * (1.0 + (-0.16666666666666666 * math.pow(x, 2.0))) else: tmp = y + (0.16666666666666666 * math.pow(y, 3.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.4e+29) tmp = Float64(y * Float64(sin(x) / x)); elseif (y <= 1.65e+102) tmp = Float64(y * Float64(1.0 + Float64(-0.16666666666666666 * (x ^ 2.0)))); else tmp = Float64(y + Float64(0.16666666666666666 * (y ^ 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.4e+29) tmp = y * (sin(x) / x); elseif (y <= 1.65e+102) tmp = y * (1.0 + (-0.16666666666666666 * (x ^ 2.0))); else tmp = y + (0.16666666666666666 * (y ^ 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.4e+29], N[(y * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+102], N[(y * N[(1.0 + N[(-0.16666666666666666 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.4 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \frac{\sin x}{x}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+102}:\\
\;\;\;\;y \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;y + 0.16666666666666666 \cdot {y}^{3}\\
\end{array}
\end{array}
if y < 4.4000000000000003e29Initial program 86.5%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 49.7%
associate-/l*63.0%
Simplified63.0%
if 4.4000000000000003e29 < y < 1.64999999999999999e102Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 2.7%
associate-/l*2.7%
Simplified2.7%
Taylor expanded in x around 0 27.2%
*-commutative27.2%
Simplified27.2%
if 1.64999999999999999e102 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate-*l*100.0%
pow-plus100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 71.4%
Final simplification60.9%
(FPCore (x y) :precision binary64 (if (<= y 8.5e-13) (* y (/ (sin x) x)) (/ (* x (+ y (* 0.16666666666666666 (pow y 3.0)))) x)))
double code(double x, double y) {
double tmp;
if (y <= 8.5e-13) {
tmp = y * (sin(x) / x);
} else {
tmp = (x * (y + (0.16666666666666666 * pow(y, 3.0)))) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 8.5d-13) then
tmp = y * (sin(x) / x)
else
tmp = (x * (y + (0.16666666666666666d0 * (y ** 3.0d0)))) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 8.5e-13) {
tmp = y * (Math.sin(x) / x);
} else {
tmp = (x * (y + (0.16666666666666666 * Math.pow(y, 3.0)))) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8.5e-13: tmp = y * (math.sin(x) / x) else: tmp = (x * (y + (0.16666666666666666 * math.pow(y, 3.0)))) / x return tmp
function code(x, y) tmp = 0.0 if (y <= 8.5e-13) tmp = Float64(y * Float64(sin(x) / x)); else tmp = Float64(Float64(x * Float64(y + Float64(0.16666666666666666 * (y ^ 3.0)))) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8.5e-13) tmp = y * (sin(x) / x); else tmp = (x * (y + (0.16666666666666666 * (y ^ 3.0)))) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8.5e-13], N[(y * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{-13}:\\
\;\;\;\;y \cdot \frac{\sin x}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + 0.16666666666666666 \cdot {y}^{3}\right)}{x}\\
\end{array}
\end{array}
if y < 8.5000000000000001e-13Initial program 86.2%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 50.6%
associate-/l*64.3%
Simplified64.3%
if 8.5000000000000001e-13 < y Initial program 100.0%
Taylor expanded in y around 0 60.8%
distribute-rgt-in60.8%
*-lft-identity60.8%
associate-*l*60.8%
pow-plus60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in x around 0 48.8%
Final simplification60.0%
(FPCore (x y) :precision binary64 (if (<= y 2.1e+102) (* (sin x) (/ y x)) (+ y (* 0.16666666666666666 (pow y 3.0)))))
double code(double x, double y) {
double tmp;
if (y <= 2.1e+102) {
tmp = sin(x) * (y / x);
} else {
tmp = y + (0.16666666666666666 * pow(y, 3.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.1d+102) then
tmp = sin(x) * (y / x)
else
tmp = y + (0.16666666666666666d0 * (y ** 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.1e+102) {
tmp = Math.sin(x) * (y / x);
} else {
tmp = y + (0.16666666666666666 * Math.pow(y, 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.1e+102: tmp = math.sin(x) * (y / x) else: tmp = y + (0.16666666666666666 * math.pow(y, 3.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.1e+102) tmp = Float64(sin(x) * Float64(y / x)); else tmp = Float64(y + Float64(0.16666666666666666 * (y ^ 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.1e+102) tmp = sin(x) * (y / x); else tmp = y + (0.16666666666666666 * (y ^ 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.1e+102], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(y + N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{+102}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;y + 0.16666666666666666 \cdot {y}^{3}\\
\end{array}
\end{array}
if y < 2.10000000000000001e102Initial program 88.1%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in y around 0 44.2%
*-commutative44.2%
associate-/l*66.9%
Simplified66.9%
if 2.10000000000000001e102 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate-*l*100.0%
pow-plus100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 71.4%
Final simplification67.6%
(FPCore (x y) :precision binary64 (if (<= y 380.0) (* y (/ (sin x) x)) (* 0.16666666666666666 (pow y 3.0))))
double code(double x, double y) {
double tmp;
if (y <= 380.0) {
tmp = y * (sin(x) / x);
} else {
tmp = 0.16666666666666666 * pow(y, 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 380.0d0) then
tmp = y * (sin(x) / x)
else
tmp = 0.16666666666666666d0 * (y ** 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 380.0) {
tmp = y * (Math.sin(x) / x);
} else {
tmp = 0.16666666666666666 * Math.pow(y, 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 380.0: tmp = y * (math.sin(x) / x) else: tmp = 0.16666666666666666 * math.pow(y, 3.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 380.0) tmp = Float64(y * Float64(sin(x) / x)); else tmp = Float64(0.16666666666666666 * (y ^ 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 380.0) tmp = y * (sin(x) / x); else tmp = 0.16666666666666666 * (y ^ 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 380.0], N[(y * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 380:\\
\;\;\;\;y \cdot \frac{\sin x}{x}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot {y}^{3}\\
\end{array}
\end{array}
if y < 380Initial program 86.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 50.4%
associate-/l*64.0%
Simplified64.0%
if 380 < y Initial program 100.0%
Taylor expanded in y around 0 61.5%
distribute-rgt-in61.5%
*-lft-identity61.5%
associate-*l*61.5%
pow-plus61.5%
metadata-eval61.5%
Simplified61.5%
Taylor expanded in x around 0 44.0%
Taylor expanded in y around inf 44.0%
Final simplification58.5%
(FPCore (x y) :precision binary64 (if (<= y 5.6e+102) (* (sin x) (/ y x)) (* 0.16666666666666666 (pow y 3.0))))
double code(double x, double y) {
double tmp;
if (y <= 5.6e+102) {
tmp = sin(x) * (y / x);
} else {
tmp = 0.16666666666666666 * pow(y, 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 5.6d+102) then
tmp = sin(x) * (y / x)
else
tmp = 0.16666666666666666d0 * (y ** 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5.6e+102) {
tmp = Math.sin(x) * (y / x);
} else {
tmp = 0.16666666666666666 * Math.pow(y, 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.6e+102: tmp = math.sin(x) * (y / x) else: tmp = 0.16666666666666666 * math.pow(y, 3.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 5.6e+102) tmp = Float64(sin(x) * Float64(y / x)); else tmp = Float64(0.16666666666666666 * (y ^ 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.6e+102) tmp = sin(x) * (y / x); else tmp = 0.16666666666666666 * (y ^ 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.6e+102], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.6 \cdot 10^{+102}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot {y}^{3}\\
\end{array}
\end{array}
if y < 5.60000000000000037e102Initial program 88.1%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in y around 0 44.2%
*-commutative44.2%
associate-/l*66.9%
Simplified66.9%
if 5.60000000000000037e102 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate-*l*100.0%
pow-plus100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 71.4%
Taylor expanded in y around inf 71.4%
Final simplification67.6%
(FPCore (x y) :precision binary64 (if (<= y 100.0) y (* 0.16666666666666666 (pow y 3.0))))
double code(double x, double y) {
double tmp;
if (y <= 100.0) {
tmp = y;
} else {
tmp = 0.16666666666666666 * pow(y, 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 100.0d0) then
tmp = y
else
tmp = 0.16666666666666666d0 * (y ** 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 100.0) {
tmp = y;
} else {
tmp = 0.16666666666666666 * Math.pow(y, 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 100.0: tmp = y else: tmp = 0.16666666666666666 * math.pow(y, 3.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 100.0) tmp = y; else tmp = Float64(0.16666666666666666 * (y ^ 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 100.0) tmp = y; else tmp = 0.16666666666666666 * (y ^ 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 100.0], y, N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 100:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot {y}^{3}\\
\end{array}
\end{array}
if y < 100Initial program 86.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 50.4%
associate-/l*64.0%
Simplified64.0%
Taylor expanded in x around 0 39.8%
if 100 < y Initial program 100.0%
Taylor expanded in y around 0 61.5%
distribute-rgt-in61.5%
*-lft-identity61.5%
associate-*l*61.5%
pow-plus61.5%
metadata-eval61.5%
Simplified61.5%
Taylor expanded in x around 0 44.0%
Taylor expanded in y around inf 44.0%
Final simplification40.9%
(FPCore (x y) :precision binary64 (if (<= y 5e+30) y (/ 1.0 (/ x (* x y)))))
double code(double x, double y) {
double tmp;
if (y <= 5e+30) {
tmp = y;
} else {
tmp = 1.0 / (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 <= 5d+30) then
tmp = y
else
tmp = 1.0d0 / (x / (x * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5e+30) {
tmp = y;
} else {
tmp = 1.0 / (x / (x * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5e+30: tmp = y else: tmp = 1.0 / (x / (x * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 5e+30) tmp = y; else tmp = Float64(1.0 / Float64(x / Float64(x * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5e+30) tmp = y; else tmp = 1.0 / (x / (x * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5e+30], y, N[(1.0 / N[(x / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5 \cdot 10^{+30}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{x \cdot y}}\\
\end{array}
\end{array}
if y < 4.9999999999999998e30Initial program 86.5%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 49.7%
associate-/l*63.0%
Simplified63.0%
Taylor expanded in x around 0 39.2%
if 4.9999999999999998e30 < y Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 3.8%
associate-/l*3.8%
Simplified3.8%
associate-*r/3.8%
*-commutative3.8%
clear-num3.8%
Applied egg-rr3.8%
Taylor expanded in x around 0 18.9%
*-commutative18.9%
Simplified18.9%
Final simplification33.9%
(FPCore (x y) :precision binary64 (if (<= y 3e+30) y (/ (* x y) x)))
double code(double x, double y) {
double tmp;
if (y <= 3e+30) {
tmp = y;
} 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 <= 3d+30) then
tmp = y
else
tmp = (x * y) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3e+30) {
tmp = y;
} else {
tmp = (x * y) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3e+30: tmp = y else: tmp = (x * y) / x return tmp
function code(x, y) tmp = 0.0 if (y <= 3e+30) tmp = y; else tmp = Float64(Float64(x * y) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3e+30) tmp = y; else tmp = (x * y) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3e+30], y, N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{+30}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\end{array}
\end{array}
if y < 2.99999999999999978e30Initial program 86.5%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 49.7%
associate-/l*63.0%
Simplified63.0%
Taylor expanded in x around 0 39.2%
if 2.99999999999999978e30 < y Initial program 100.0%
Taylor expanded in y around 0 3.8%
Taylor expanded in x around 0 18.9%
*-commutative18.9%
Simplified18.9%
Final simplification33.9%
(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-/l*99.5%
Simplified99.5%
Taylor expanded in y around 0 37.7%
associate-/l*47.5%
Simplified47.5%
Taylor expanded in x around 0 29.9%
Final simplification29.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}
herbie shell --seed 2024071
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
:alt
(* (sin x) (/ (sinh y) x))
(/ (* (sin x) (sinh y)) x))