
(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) (/ (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 110.0) (not (<= y 7e+153))) (* (sin x) (+ (* 0.16666666666666666 (* y y)) 1.0)) (* x (/ (sinh y) y))))
double code(double x, double y) {
double tmp;
if ((y <= 110.0) || !(y <= 7e+153)) {
tmp = sin(x) * ((0.16666666666666666 * (y * y)) + 1.0);
} 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 <= 110.0d0) .or. (.not. (y <= 7d+153))) then
tmp = sin(x) * ((0.16666666666666666d0 * (y * y)) + 1.0d0)
else
tmp = x * (sinh(y) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 110.0) || !(y <= 7e+153)) {
tmp = Math.sin(x) * ((0.16666666666666666 * (y * y)) + 1.0);
} else {
tmp = x * (Math.sinh(y) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 110.0) or not (y <= 7e+153): tmp = math.sin(x) * ((0.16666666666666666 * (y * y)) + 1.0) else: tmp = x * (math.sinh(y) / y) return tmp
function code(x, y) tmp = 0.0 if ((y <= 110.0) || !(y <= 7e+153)) tmp = Float64(sin(x) * Float64(Float64(0.16666666666666666 * Float64(y * y)) + 1.0)); else tmp = Float64(x * Float64(sinh(y) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 110.0) || ~((y <= 7e+153))) tmp = sin(x) * ((0.16666666666666666 * (y * y)) + 1.0); else tmp = x * (sinh(y) / y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 110.0], N[Not[LessEqual[y, 7e+153]], $MachinePrecision]], N[(N[Sin[x], $MachinePrecision] * N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 110 \lor \neg \left(y \leq 7 \cdot 10^{+153}\right):\\
\;\;\;\;\sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{y}\\
\end{array}
\end{array}
if y < 110 or 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 85.6%
associate-*r*85.6%
distribute-rgt1-in85.6%
unpow285.6%
Simplified85.6%
if 110 < y < 6.9999999999999998e153Initial program 100.0%
*-commutative100.0%
associate-/r/84.4%
Simplified84.4%
Taylor expanded in x around 0 51.1%
associate-/r/66.7%
Applied egg-rr66.7%
Final simplification82.2%
(FPCore (x y)
:precision binary64
(if (<= y 8e-9)
(sin x)
(if (<= y 7e+153)
(* x (/ (sinh y) y))
(* 0.16666666666666666 (* (sin x) (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 8e-9) {
tmp = sin(x);
} else if (y <= 7e+153) {
tmp = x * (sinh(y) / y);
} else {
tmp = 0.16666666666666666 * (sin(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 <= 8d-9) then
tmp = sin(x)
else if (y <= 7d+153) then
tmp = x * (sinh(y) / y)
else
tmp = 0.16666666666666666d0 * (sin(x) * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 8e-9) {
tmp = Math.sin(x);
} else if (y <= 7e+153) {
tmp = x * (Math.sinh(y) / y);
} else {
tmp = 0.16666666666666666 * (Math.sin(x) * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8e-9: tmp = math.sin(x) elif y <= 7e+153: tmp = x * (math.sinh(y) / y) else: tmp = 0.16666666666666666 * (math.sin(x) * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 8e-9) tmp = sin(x); elseif (y <= 7e+153) tmp = Float64(x * Float64(sinh(y) / y)); else tmp = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8e-9) tmp = sin(x); elseif (y <= 7e+153) tmp = x * (sinh(y) / y); else tmp = 0.16666666666666666 * (sin(x) * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8e-9], N[Sin[x], $MachinePrecision], If[LessEqual[y, 7e+153], N[(x * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{-9}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+153}:\\
\;\;\;\;x \cdot \frac{\sinh y}{y}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 8.0000000000000005e-9Initial program 100.0%
Taylor expanded in y around 0 65.6%
if 8.0000000000000005e-9 < y < 6.9999999999999998e153Initial program 100.0%
*-commutative100.0%
associate-/r/84.8%
Simplified84.8%
Taylor expanded in x around 0 52.2%
associate-/r/67.4%
Applied egg-rr67.4%
if 6.9999999999999998e153 < y Initial program 100.0%
Taylor expanded in y around 0 97.4%
associate-*r*97.4%
distribute-rgt1-in97.4%
unpow297.4%
Simplified97.4%
Taylor expanded in y around inf 97.4%
unpow297.4%
*-commutative97.4%
Simplified97.4%
Final simplification69.9%
(FPCore (x y)
:precision binary64
(if (<= y 38000000000000.0)
(sin x)
(if (<= y 9.5e+153)
(* -0.16666666666666666 (pow x 3.0))
(* 0.16666666666666666 (* x (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 38000000000000.0) {
tmp = sin(x);
} else if (y <= 9.5e+153) {
tmp = -0.16666666666666666 * pow(x, 3.0);
} 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 <= 38000000000000.0d0) then
tmp = sin(x)
else if (y <= 9.5d+153) then
tmp = (-0.16666666666666666d0) * (x ** 3.0d0)
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 <= 38000000000000.0) {
tmp = Math.sin(x);
} else if (y <= 9.5e+153) {
tmp = -0.16666666666666666 * Math.pow(x, 3.0);
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 38000000000000.0: tmp = math.sin(x) elif y <= 9.5e+153: tmp = -0.16666666666666666 * math.pow(x, 3.0) else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 38000000000000.0) tmp = sin(x); elseif (y <= 9.5e+153) tmp = Float64(-0.16666666666666666 * (x ^ 3.0)); 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 <= 38000000000000.0) tmp = sin(x); elseif (y <= 9.5e+153) tmp = -0.16666666666666666 * (x ^ 3.0); else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 38000000000000.0], N[Sin[x], $MachinePrecision], If[LessEqual[y, 9.5e+153], N[(-0.16666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 38000000000000:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+153}:\\
\;\;\;\;-0.16666666666666666 \cdot {x}^{3}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 3.8e13Initial program 100.0%
Taylor expanded in y around 0 65.7%
if 3.8e13 < y < 9.4999999999999995e153Initial program 100.0%
*-commutative100.0%
associate-/r/84.8%
Simplified84.8%
Taylor expanded in y around 0 2.6%
Taylor expanded in x around 0 25.6%
Taylor expanded in x around inf 25.3%
if 9.4999999999999995e153 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
associate-*r*100.0%
distribute-rgt1-in100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 83.9%
*-commutative83.9%
unpow283.9%
Simplified83.9%
Final simplification60.6%
(FPCore (x y) :precision binary64 (if (<= y 6.2e+25) (sin x) (if (<= y 1.25e+47) (sqrt (* x x)) (* 0.16666666666666666 (* x (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 6.2e+25) {
tmp = sin(x);
} else if (y <= 1.25e+47) {
tmp = sqrt((x * 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 <= 6.2d+25) then
tmp = sin(x)
else if (y <= 1.25d+47) then
tmp = sqrt((x * 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 <= 6.2e+25) {
tmp = Math.sin(x);
} else if (y <= 1.25e+47) {
tmp = Math.sqrt((x * x));
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.2e+25: tmp = math.sin(x) elif y <= 1.25e+47: tmp = math.sqrt((x * x)) else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 6.2e+25) tmp = sin(x); elseif (y <= 1.25e+47) tmp = sqrt(Float64(x * 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 <= 6.2e+25) tmp = sin(x); elseif (y <= 1.25e+47) tmp = sqrt((x * x)); else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.2e+25], N[Sin[x], $MachinePrecision], If[LessEqual[y, 1.25e+47], N[Sqrt[N[(x * x), $MachinePrecision]], $MachinePrecision], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+25}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+47}:\\
\;\;\;\;\sqrt{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 6.1999999999999996e25Initial program 100.0%
Taylor expanded in y around 0 65.0%
if 6.1999999999999996e25 < y < 1.25000000000000005e47Initial program 100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around 0 2.6%
Taylor expanded in x around 0 2.1%
associate-/r/2.1%
*-inverses2.1%
*-un-lft-identity2.1%
add-sqr-sqrt1.8%
sqrt-unprod28.8%
Applied egg-rr28.8%
if 1.25000000000000005e47 < y Initial program 100.0%
Taylor expanded in y around 0 51.0%
associate-*r*51.0%
distribute-rgt1-in51.0%
unpow251.0%
Simplified51.0%
Taylor expanded in y around inf 51.0%
unpow251.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in x around 0 47.8%
*-commutative47.8%
unpow247.8%
Simplified47.8%
Final simplification59.1%
(FPCore (x y) :precision binary64 (if (<= y 8e-9) (sin x) (* x (/ (sinh y) y))))
double code(double x, double y) {
double tmp;
if (y <= 8e-9) {
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 <= 8d-9) 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 <= 8e-9) {
tmp = Math.sin(x);
} else {
tmp = x * (Math.sinh(y) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8e-9: tmp = math.sin(x) else: tmp = x * (math.sinh(y) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= 8e-9) 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 <= 8e-9) tmp = sin(x); else tmp = x * (sinh(y) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8e-9], N[Sin[x], $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{-9}:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{y}\\
\end{array}
\end{array}
if y < 8.0000000000000005e-9Initial program 100.0%
Taylor expanded in y around 0 65.6%
if 8.0000000000000005e-9 < y Initial program 100.0%
*-commutative100.0%
associate-/r/76.9%
Simplified76.9%
Taylor expanded in x around 0 50.0%
associate-/r/73.1%
Applied egg-rr73.1%
Final simplification67.9%
(FPCore (x y) :precision binary64 (if (<= y 1.5e+45) (sin x) (* 0.16666666666666666 (* x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.5e+45) {
tmp = sin(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 <= 1.5d+45) then
tmp = sin(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 <= 1.5e+45) {
tmp = Math.sin(x);
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.5e+45: tmp = math.sin(x) else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.5e+45) tmp = sin(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 <= 1.5e+45) tmp = sin(x); else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.5e+45], N[Sin[x], $MachinePrecision], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{+45}:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.50000000000000005e45Initial program 100.0%
Taylor expanded in y around 0 62.0%
if 1.50000000000000005e45 < y Initial program 100.0%
Taylor expanded in y around 0 49.6%
associate-*r*49.6%
distribute-rgt1-in49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in y around inf 49.6%
unpow249.6%
*-commutative49.6%
Simplified49.6%
Taylor expanded in x around 0 46.6%
*-commutative46.6%
unpow246.6%
Simplified46.6%
Final simplification58.1%
(FPCore (x y) :precision binary64 (if (<= y 160000000000.0) (/ y (+ (/ y x) (* 0.16666666666666666 (* x y)))) (* 0.16666666666666666 (* x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 160000000000.0) {
tmp = y / ((y / x) + (0.16666666666666666 * (x * y)));
} 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 <= 160000000000.0d0) then
tmp = y / ((y / x) + (0.16666666666666666d0 * (x * y)))
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 <= 160000000000.0) {
tmp = y / ((y / x) + (0.16666666666666666 * (x * y)));
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 160000000000.0: tmp = y / ((y / x) + (0.16666666666666666 * (x * y))) else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 160000000000.0) tmp = Float64(y / Float64(Float64(y / x) + Float64(0.16666666666666666 * Float64(x * y)))); 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 <= 160000000000.0) tmp = y / ((y / x) + (0.16666666666666666 * (x * y))); else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 160000000000.0], N[(y / N[(N[(y / x), $MachinePrecision] + N[(0.16666666666666666 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 160000000000:\\
\;\;\;\;\frac{y}{\frac{y}{x} + 0.16666666666666666 \cdot \left(x \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.6e11Initial program 100.0%
*-commutative100.0%
associate-/r/90.4%
Simplified90.4%
Taylor expanded in y around 0 65.5%
Taylor expanded in x around 0 33.3%
if 1.6e11 < y Initial program 100.0%
Taylor expanded in y around 0 42.9%
associate-*r*42.9%
distribute-rgt1-in42.9%
unpow242.9%
Simplified42.9%
Taylor expanded in y around inf 42.9%
unpow242.9%
*-commutative42.9%
Simplified42.9%
Taylor expanded in x around 0 40.2%
*-commutative40.2%
unpow240.2%
Simplified40.2%
Final simplification35.4%
(FPCore (x y) :precision binary64 (if (<= y 160000000000.0) (/ 1.0 (+ (* x 0.16666666666666666) (/ 1.0 x))) (* 0.16666666666666666 (* x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 160000000000.0) {
tmp = 1.0 / ((x * 0.16666666666666666) + (1.0 / 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 <= 160000000000.0d0) then
tmp = 1.0d0 / ((x * 0.16666666666666666d0) + (1.0d0 / 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 <= 160000000000.0) {
tmp = 1.0 / ((x * 0.16666666666666666) + (1.0 / x));
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 160000000000.0: tmp = 1.0 / ((x * 0.16666666666666666) + (1.0 / x)) else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 160000000000.0) tmp = Float64(1.0 / Float64(Float64(x * 0.16666666666666666) + Float64(1.0 / 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 <= 160000000000.0) tmp = 1.0 / ((x * 0.16666666666666666) + (1.0 / x)); else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 160000000000.0], N[(1.0 / N[(N[(x * 0.16666666666666666), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 160000000000:\\
\;\;\;\;\frac{1}{x \cdot 0.16666666666666666 + \frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.6e11Initial program 100.0%
*-commutative100.0%
associate-/r/90.4%
Simplified90.4%
Taylor expanded in y around 0 65.5%
Taylor expanded in x around 0 33.3%
Taylor expanded in y around 0 33.3%
if 1.6e11 < y Initial program 100.0%
Taylor expanded in y around 0 42.9%
associate-*r*42.9%
distribute-rgt1-in42.9%
unpow242.9%
Simplified42.9%
Taylor expanded in y around inf 42.9%
unpow242.9%
*-commutative42.9%
Simplified42.9%
Taylor expanded in x around 0 40.2%
*-commutative40.2%
unpow240.2%
Simplified40.2%
Final simplification35.4%
(FPCore (x y) :precision binary64 (if (<= y 110.0) x (* 0.16666666666666666 (* y (* x y)))))
double code(double x, double y) {
double tmp;
if (y <= 110.0) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (y * (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 <= 110.0d0) then
tmp = x
else
tmp = 0.16666666666666666d0 * (y * (x * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 110.0) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (y * (x * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 110.0: tmp = x else: tmp = 0.16666666666666666 * (y * (x * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 110.0) tmp = x; else tmp = Float64(0.16666666666666666 * Float64(y * Float64(x * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 110.0) tmp = x; else tmp = 0.16666666666666666 * (y * (x * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 110.0], x, N[(0.16666666666666666 * N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 110:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 110Initial program 100.0%
*-commutative100.0%
associate-/r/90.4%
Simplified90.4%
Taylor expanded in y around 0 65.5%
Taylor expanded in x around 0 32.8%
if 110 < y Initial program 100.0%
Taylor expanded in y around 0 42.9%
associate-*r*42.9%
distribute-rgt1-in42.9%
unpow242.9%
Simplified42.9%
Taylor expanded in y around inf 42.9%
unpow242.9%
*-commutative42.9%
Simplified42.9%
Taylor expanded in x around 0 40.2%
unpow240.2%
associate-*l*29.4%
Simplified29.4%
Final simplification31.8%
(FPCore (x y) :precision binary64 (if (<= y 110.0) x (* 0.16666666666666666 (* x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 110.0) {
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 <= 110.0d0) 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 <= 110.0) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 110.0: tmp = x else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 110.0) 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 <= 110.0) tmp = x; else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 110.0], x, N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 110:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 110Initial program 100.0%
*-commutative100.0%
associate-/r/90.4%
Simplified90.4%
Taylor expanded in y around 0 65.5%
Taylor expanded in x around 0 32.8%
if 110 < y Initial program 100.0%
Taylor expanded in y around 0 42.9%
associate-*r*42.9%
distribute-rgt1-in42.9%
unpow242.9%
Simplified42.9%
Taylor expanded in y around inf 42.9%
unpow242.9%
*-commutative42.9%
Simplified42.9%
Taylor expanded in x around 0 40.2%
*-commutative40.2%
unpow240.2%
Simplified40.2%
Final simplification35.0%
(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%
*-commutative100.0%
associate-/r/86.2%
Simplified86.2%
Taylor expanded in y around 0 46.6%
Taylor expanded in x around 0 23.6%
Final simplification23.6%
herbie shell --seed 2023274
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))