
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
(FPCore (x y) :precision binary64 (/ (sin x) (/ y (sinh y))))
double code(double x, double y) {
return sin(x) / (y / sinh(y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) / (y / sinh(y))
end function
public static double code(double x, double y) {
return Math.sin(x) / (y / Math.sinh(y));
}
def code(x, y): return math.sin(x) / (y / math.sinh(y))
function code(x, y) return Float64(sin(x) / Float64(y / sinh(y))) end
function tmp = code(x, y) tmp = sin(x) / (y / sinh(y)); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] / N[(y / N[Sinh[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x}{\frac{y}{\sinh y}}
\end{array}
Initial program 100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (or (<= y 0.38) (not (<= y 3.6e+148))) (* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y)))) (* x (/ (sinh y) y))))
double code(double x, double y) {
double tmp;
if ((y <= 0.38) || !(y <= 3.6e+148)) {
tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = x * (sinh(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 <= 0.38d0) .or. (.not. (y <= 3.6d+148))) then
tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else
tmp = x * (sinh(y) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 0.38) || !(y <= 3.6e+148)) {
tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = x * (Math.sinh(y) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 0.38) or not (y <= 3.6e+148): tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) else: tmp = x * (math.sinh(y) / y) return tmp
function code(x, y) tmp = 0.0 if ((y <= 0.38) || !(y <= 3.6e+148)) tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); else tmp = Float64(x * Float64(sinh(y) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 0.38) || ~((y <= 3.6e+148))) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); else tmp = x * (sinh(y) / y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 0.38], N[Not[LessEqual[y, 3.6e+148]], $MachinePrecision]], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.38 \lor \neg \left(y \leq 3.6 \cdot 10^{+148}\right):\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{y}\\
\end{array}
\end{array}
if y < 0.38 or 3.60000000000000006e148 < y Initial program 100.0%
Taylor expanded in y around 0 87.2%
unpow287.2%
Simplified87.2%
if 0.38 < y < 3.60000000000000006e148Initial program 100.0%
Taylor expanded in x around 0 74.2%
Final simplification85.6%
(FPCore (x y)
:precision binary64
(if (<= y 0.192)
(sin x)
(if (<= y 2.45e+210)
(* x (/ (sinh y) y))
(* y (* y (* (sin x) 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (y <= 0.192) {
tmp = sin(x);
} else if (y <= 2.45e+210) {
tmp = x * (sinh(y) / y);
} else {
tmp = y * (y * (sin(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 <= 0.192d0) then
tmp = sin(x)
else if (y <= 2.45d+210) then
tmp = x * (sinh(y) / y)
else
tmp = y * (y * (sin(x) * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 0.192) {
tmp = Math.sin(x);
} else if (y <= 2.45e+210) {
tmp = x * (Math.sinh(y) / y);
} else {
tmp = y * (y * (Math.sin(x) * 0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.192: tmp = math.sin(x) elif y <= 2.45e+210: tmp = x * (math.sinh(y) / y) else: tmp = y * (y * (math.sin(x) * 0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.192) tmp = sin(x); elseif (y <= 2.45e+210) tmp = Float64(x * Float64(sinh(y) / y)); else tmp = Float64(y * Float64(y * Float64(sin(x) * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 0.192) tmp = sin(x); elseif (y <= 2.45e+210) tmp = x * (sinh(y) / y); else tmp = y * (y * (sin(x) * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.192], N[Sin[x], $MachinePrecision], If[LessEqual[y, 2.45e+210], N[(x * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(N[Sin[x], $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.192:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+210}:\\
\;\;\;\;x \cdot \frac{\sinh y}{y}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(\sin x \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if y < 0.192Initial program 99.9%
Taylor expanded in y around 0 68.8%
if 0.192 < y < 2.45000000000000003e210Initial program 100.0%
Taylor expanded in x around 0 76.2%
if 2.45000000000000003e210 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
unpow2100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*88.4%
*-commutative88.4%
Simplified88.4%
Final simplification71.8%
(FPCore (x y)
:precision binary64
(if (<= y 2.3e+17)
(sin x)
(if (<= y 2.15e+64)
(* (pow x 3.0) -0.16666666666666666)
(* x (+ 1.0 (* 0.16666666666666666 (* y y)))))))
double code(double x, double y) {
double tmp;
if (y <= 2.3e+17) {
tmp = sin(x);
} else if (y <= 2.15e+64) {
tmp = pow(x, 3.0) * -0.16666666666666666;
} else {
tmp = x * (1.0 + (0.16666666666666666 * (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 <= 2.3d+17) then
tmp = sin(x)
else if (y <= 2.15d+64) then
tmp = (x ** 3.0d0) * (-0.16666666666666666d0)
else
tmp = x * (1.0d0 + (0.16666666666666666d0 * (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.3e+17) {
tmp = Math.sin(x);
} else if (y <= 2.15e+64) {
tmp = Math.pow(x, 3.0) * -0.16666666666666666;
} else {
tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.3e+17: tmp = math.sin(x) elif y <= 2.15e+64: tmp = math.pow(x, 3.0) * -0.16666666666666666 else: tmp = x * (1.0 + (0.16666666666666666 * (y * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.3e+17) tmp = sin(x); elseif (y <= 2.15e+64) tmp = Float64((x ^ 3.0) * -0.16666666666666666); else tmp = Float64(x * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.3e+17) tmp = sin(x); elseif (y <= 2.15e+64) tmp = (x ^ 3.0) * -0.16666666666666666; else tmp = x * (1.0 + (0.16666666666666666 * (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.3e+17], N[Sin[x], $MachinePrecision], If[LessEqual[y, 2.15e+64], N[(N[Power[x, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision], N[(x * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{+17}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+64}:\\
\;\;\;\;{x}^{3} \cdot -0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 2.3e17Initial program 99.9%
Taylor expanded in y around 0 68.1%
if 2.3e17 < y < 2.1499999999999999e64Initial program 100.0%
Taylor expanded in y around 0 2.7%
Taylor expanded in x around 0 41.2%
Taylor expanded in x around inf 41.0%
*-commutative41.0%
Simplified41.0%
if 2.1499999999999999e64 < y Initial program 100.0%
Taylor expanded in y around 0 71.0%
unpow271.0%
Simplified71.0%
Taylor expanded in x around 0 68.1%
Final simplification66.5%
(FPCore (x y) :precision binary64 (if (<= y 0.162) (sin x) (* x (/ (sinh y) y))))
double code(double x, double y) {
double tmp;
if (y <= 0.162) {
tmp = sin(x);
} else {
tmp = x * (sinh(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 <= 0.162d0) then
tmp = sin(x)
else
tmp = x * (sinh(y) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 0.162) {
tmp = Math.sin(x);
} else {
tmp = x * (Math.sinh(y) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.162: tmp = math.sin(x) else: tmp = x * (math.sinh(y) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.162) tmp = sin(x); else tmp = Float64(x * Float64(sinh(y) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 0.162) tmp = sin(x); else tmp = x * (sinh(y) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.162], N[Sin[x], $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.162:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{y}\\
\end{array}
\end{array}
if y < 0.162000000000000005Initial program 99.9%
Taylor expanded in y around 0 68.8%
if 0.162000000000000005 < y Initial program 100.0%
Taylor expanded in x around 0 78.8%
Final simplification71.4%
(FPCore (x y) :precision binary64 (if (<= y 6.4e+50) (sin x) (* x (+ 1.0 (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 6.4e+50) {
tmp = sin(x);
} else {
tmp = x * (1.0 + (0.16666666666666666 * (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 <= 6.4d+50) then
tmp = sin(x)
else
tmp = x * (1.0d0 + (0.16666666666666666d0 * (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6.4e+50) {
tmp = Math.sin(x);
} else {
tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.4e+50: tmp = math.sin(x) else: tmp = x * (1.0 + (0.16666666666666666 * (y * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 6.4e+50) tmp = sin(x); else tmp = Float64(x * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6.4e+50) tmp = sin(x); else tmp = x * (1.0 + (0.16666666666666666 * (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.4e+50], N[Sin[x], $MachinePrecision], N[(x * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.4 \cdot 10^{+50}:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 6.39999999999999966e50Initial program 99.9%
Taylor expanded in y around 0 64.5%
if 6.39999999999999966e50 < y Initial program 100.0%
Taylor expanded in y around 0 65.9%
unpow265.9%
Simplified65.9%
Taylor expanded in x around 0 64.9%
Final simplification64.6%
(FPCore (x y) :precision binary64 (if (<= y 0.013) x (* 0.16666666666666666 (* x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 0.013) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (x * (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 <= 0.013d0) then
tmp = x
else
tmp = 0.16666666666666666d0 * (x * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 0.013) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.013: tmp = x else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.013) tmp = x; else tmp = Float64(0.16666666666666666 * Float64(x * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 0.013) tmp = x; else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.013], x, N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.013:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 0.0129999999999999994Initial program 100.0%
Taylor expanded in x around 0 52.8%
Taylor expanded in y around 0 28.9%
if 0.0129999999999999994 < y Initial program 100.0%
Taylor expanded in y around 0 53.4%
unpow253.4%
Simplified53.4%
Taylor expanded in x around 0 51.7%
Taylor expanded in y around inf 51.7%
associate-*r*51.7%
*-commutative51.7%
associate-*l*51.7%
unpow251.7%
Simplified51.7%
Taylor expanded in y around 0 51.7%
unpow251.7%
*-commutative51.7%
Simplified51.7%
Final simplification34.8%
(FPCore (x y) :precision binary64 (* x (+ 1.0 (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
return x * (1.0 + (0.16666666666666666 * (y * y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (1.0d0 + (0.16666666666666666d0 * (y * y)))
end function
public static double code(double x, double y) {
return x * (1.0 + (0.16666666666666666 * (y * y)));
}
def code(x, y): return x * (1.0 + (0.16666666666666666 * (y * y)))
function code(x, y) return Float64(x * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) end
function tmp = code(x, y) tmp = x * (1.0 + (0.16666666666666666 * (y * y))); end
code[x_, y_] := N[(x * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 77.1%
unpow277.1%
Simplified77.1%
Taylor expanded in x around 0 44.6%
Final simplification44.6%
(FPCore (x y) :precision binary64 (+ x (* x (* y (* y 0.16666666666666666)))))
double code(double x, double y) {
return x + (x * (y * (y * 0.16666666666666666)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (x * (y * (y * 0.16666666666666666d0)))
end function
public static double code(double x, double y) {
return x + (x * (y * (y * 0.16666666666666666)));
}
def code(x, y): return x + (x * (y * (y * 0.16666666666666666)))
function code(x, y) return Float64(x + Float64(x * Float64(y * Float64(y * 0.16666666666666666)))) end
function tmp = code(x, y) tmp = x + (x * (y * (y * 0.16666666666666666))); end
code[x_, y_] := N[(x + N[(x * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 77.1%
unpow277.1%
Simplified77.1%
Taylor expanded in x around 0 44.6%
+-commutative44.6%
distribute-lft-in44.6%
*-commutative44.6%
associate-*l*44.6%
*-rgt-identity44.6%
Applied egg-rr44.6%
Final simplification44.6%
(FPCore (x y) :precision binary64 (if (<= y 6.4e+50) x (/ (* x y) y)))
double code(double x, double y) {
double tmp;
if (y <= 6.4e+50) {
tmp = x;
} else {
tmp = (x * 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 <= 6.4d+50) then
tmp = x
else
tmp = (x * y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6.4e+50) {
tmp = x;
} else {
tmp = (x * y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.4e+50: tmp = x else: tmp = (x * y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 6.4e+50) tmp = x; else tmp = Float64(Float64(x * y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6.4e+50) tmp = x; else tmp = (x * y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.4e+50], x, N[(N[(x * y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.4 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{y}\\
\end{array}
\end{array}
if y < 6.39999999999999966e50Initial program 99.9%
Taylor expanded in x around 0 53.1%
Taylor expanded in y around 0 27.0%
if 6.39999999999999966e50 < y Initial program 100.0%
Taylor expanded in x around 0 83.0%
*-commutative83.0%
associate-*l/83.0%
Applied egg-rr83.0%
Taylor expanded in y around 0 18.8%
Final simplification25.3%
(FPCore (x y) :precision binary64 x)
double code(double x, double y) {
return x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x
end function
public static double code(double x, double y) {
return x;
}
def code(x, y): return x
function code(x, y) return x end
function tmp = code(x, y) tmp = x; end
code[x_, y_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in x around 0 59.3%
Taylor expanded in y around 0 22.0%
Final simplification22.0%
herbie shell --seed 2023224
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))