
(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 11 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
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y 36000000.0)
(* (sin x) (+ 1.0 t_0))
(if (<= y 1.32e+154)
(*
(* y y)
(+ (* x 0.16666666666666666) (* (pow x 3.0) -0.027777777777777776)))
(* (sin x) t_0)))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 36000000.0) {
tmp = sin(x) * (1.0 + t_0);
} else if (y <= 1.32e+154) {
tmp = (y * y) * ((x * 0.16666666666666666) + (pow(x, 3.0) * -0.027777777777777776));
} else {
tmp = sin(x) * t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (y * y)
if (y <= 36000000.0d0) then
tmp = sin(x) * (1.0d0 + t_0)
else if (y <= 1.32d+154) then
tmp = (y * y) * ((x * 0.16666666666666666d0) + ((x ** 3.0d0) * (-0.027777777777777776d0)))
else
tmp = sin(x) * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 36000000.0) {
tmp = Math.sin(x) * (1.0 + t_0);
} else if (y <= 1.32e+154) {
tmp = (y * y) * ((x * 0.16666666666666666) + (Math.pow(x, 3.0) * -0.027777777777777776));
} else {
tmp = Math.sin(x) * t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= 36000000.0: tmp = math.sin(x) * (1.0 + t_0) elif y <= 1.32e+154: tmp = (y * y) * ((x * 0.16666666666666666) + (math.pow(x, 3.0) * -0.027777777777777776)) else: tmp = math.sin(x) * t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= 36000000.0) tmp = Float64(sin(x) * Float64(1.0 + t_0)); elseif (y <= 1.32e+154) tmp = Float64(Float64(y * y) * Float64(Float64(x * 0.16666666666666666) + Float64((x ^ 3.0) * -0.027777777777777776))); else tmp = Float64(sin(x) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= 36000000.0) tmp = sin(x) * (1.0 + t_0); elseif (y <= 1.32e+154) tmp = (y * y) * ((x * 0.16666666666666666) + ((x ^ 3.0) * -0.027777777777777776)); else tmp = sin(x) * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 36000000.0], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.32e+154], N[(N[(y * y), $MachinePrecision] * N[(N[(x * 0.16666666666666666), $MachinePrecision] + N[(N[Power[x, 3.0], $MachinePrecision] * -0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 36000000:\\
\;\;\;\;\sin x \cdot \left(1 + t_0\right)\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(x \cdot 0.16666666666666666 + {x}^{3} \cdot -0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot t_0\\
\end{array}
\end{array}
if y < 3.6e7Initial program 100.0%
Taylor expanded in y around 0 84.4%
unpow284.4%
Simplified84.4%
if 3.6e7 < y < 1.31999999999999998e154Initial program 100.0%
Taylor expanded in y around 0 4.3%
unpow24.3%
Simplified4.3%
Taylor expanded in y around inf 4.3%
unpow24.3%
associate-*l*4.3%
Simplified4.3%
Taylor expanded in x around 0 17.3%
*-commutative17.3%
associate-*l*17.3%
*-commutative17.3%
associate-*l*17.3%
distribute-lft-out29.8%
unpow229.8%
*-commutative29.8%
Simplified29.8%
if 1.31999999999999998e154 < 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%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Final simplification79.4%
(FPCore (x y)
:precision binary64
(if (<= y 37000000000000.0)
(sin x)
(if (<= y 2.25e+204)
(+ x (* x (* 0.16666666666666666 (* y y))))
(* 0.16666666666666666 (* y (* (sin x) y))))))
double code(double x, double y) {
double tmp;
if (y <= 37000000000000.0) {
tmp = sin(x);
} else if (y <= 2.25e+204) {
tmp = x + (x * (0.16666666666666666 * (y * y)));
} else {
tmp = 0.16666666666666666 * (y * (sin(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 <= 37000000000000.0d0) then
tmp = sin(x)
else if (y <= 2.25d+204) then
tmp = x + (x * (0.16666666666666666d0 * (y * y)))
else
tmp = 0.16666666666666666d0 * (y * (sin(x) * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 37000000000000.0) {
tmp = Math.sin(x);
} else if (y <= 2.25e+204) {
tmp = x + (x * (0.16666666666666666 * (y * y)));
} else {
tmp = 0.16666666666666666 * (y * (Math.sin(x) * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 37000000000000.0: tmp = math.sin(x) elif y <= 2.25e+204: tmp = x + (x * (0.16666666666666666 * (y * y))) else: tmp = 0.16666666666666666 * (y * (math.sin(x) * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 37000000000000.0) tmp = sin(x); elseif (y <= 2.25e+204) tmp = Float64(x + Float64(x * Float64(0.16666666666666666 * Float64(y * y)))); else tmp = Float64(0.16666666666666666 * Float64(y * Float64(sin(x) * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 37000000000000.0) tmp = sin(x); elseif (y <= 2.25e+204) tmp = x + (x * (0.16666666666666666 * (y * y))); else tmp = 0.16666666666666666 * (y * (sin(x) * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 37000000000000.0], N[Sin[x], $MachinePrecision], If[LessEqual[y, 2.25e+204], N[(x + N[(x * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(y * N[(N[Sin[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 37000000000000:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+204}:\\
\;\;\;\;x + x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\sin x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 3.7e13Initial program 100.0%
Taylor expanded in y around 0 83.6%
unpow283.6%
Simplified83.6%
Taylor expanded in y around 0 65.1%
if 3.7e13 < y < 2.25000000000000001e204Initial program 100.0%
Taylor expanded in y around 0 30.0%
unpow230.0%
Simplified30.0%
Taylor expanded in x around 0 33.3%
+-commutative33.3%
unpow233.3%
fma-udef33.3%
Simplified33.3%
*-commutative33.3%
fma-udef33.3%
distribute-rgt-in33.3%
*-un-lft-identity33.3%
Applied egg-rr33.3%
if 2.25000000000000001e204 < 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%
associate-*l*89.8%
Simplified89.8%
Final simplification61.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y 8500000000000.0)
(sin x)
(if (<= y 9.6e+145) (+ x (* x t_0)) (* (sin x) t_0)))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 8500000000000.0) {
tmp = sin(x);
} else if (y <= 9.6e+145) {
tmp = x + (x * t_0);
} else {
tmp = sin(x) * t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (y * y)
if (y <= 8500000000000.0d0) then
tmp = sin(x)
else if (y <= 9.6d+145) then
tmp = x + (x * t_0)
else
tmp = sin(x) * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 8500000000000.0) {
tmp = Math.sin(x);
} else if (y <= 9.6e+145) {
tmp = x + (x * t_0);
} else {
tmp = Math.sin(x) * t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= 8500000000000.0: tmp = math.sin(x) elif y <= 9.6e+145: tmp = x + (x * t_0) else: tmp = math.sin(x) * t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= 8500000000000.0) tmp = sin(x); elseif (y <= 9.6e+145) tmp = Float64(x + Float64(x * t_0)); else tmp = Float64(sin(x) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= 8500000000000.0) tmp = sin(x); elseif (y <= 9.6e+145) tmp = x + (x * t_0); else tmp = sin(x) * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 8500000000000.0], N[Sin[x], $MachinePrecision], If[LessEqual[y, 9.6e+145], N[(x + N[(x * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 8500000000000:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{+145}:\\
\;\;\;\;x + x \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot t_0\\
\end{array}
\end{array}
if y < 8.5e12Initial program 100.0%
Taylor expanded in y around 0 83.6%
unpow283.6%
Simplified83.6%
Taylor expanded in y around 0 65.1%
if 8.5e12 < y < 9.59999999999999967e145Initial program 100.0%
Taylor expanded in y around 0 4.1%
unpow24.1%
Simplified4.1%
Taylor expanded in x around 0 16.5%
+-commutative16.5%
unpow216.5%
fma-udef16.5%
Simplified16.5%
*-commutative16.5%
fma-udef16.5%
distribute-rgt-in16.5%
*-un-lft-identity16.5%
Applied egg-rr16.5%
if 9.59999999999999967e145 < y Initial program 100.0%
Taylor expanded in y around 0 94.1%
unpow294.1%
Simplified94.1%
Taylor expanded in y around inf 94.1%
unpow294.1%
associate-*r*94.1%
*-commutative94.1%
Simplified94.1%
Final simplification63.3%
(FPCore (x y) :precision binary64 (* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
return sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
end function
public static double code(double x, double y) {
return Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
}
def code(x, y): return math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)))
function code(x, y) return Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) end
function tmp = code(x, y) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin 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 76.2%
unpow276.2%
Simplified76.2%
Final simplification76.2%
(FPCore (x y) :precision binary64 (if (<= y 55000000000000.0) (sin x) (+ x (* x (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 55000000000000.0) {
tmp = sin(x);
} else {
tmp = x + (x * (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 <= 55000000000000.0d0) then
tmp = sin(x)
else
tmp = x + (x * (0.16666666666666666d0 * (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 55000000000000.0) {
tmp = Math.sin(x);
} else {
tmp = x + (x * (0.16666666666666666 * (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 55000000000000.0: tmp = math.sin(x) else: tmp = x + (x * (0.16666666666666666 * (y * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 55000000000000.0) tmp = sin(x); else tmp = Float64(x + Float64(x * Float64(0.16666666666666666 * Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 55000000000000.0) tmp = sin(x); else tmp = x + (x * (0.16666666666666666 * (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 55000000000000.0], N[Sin[x], $MachinePrecision], N[(x + N[(x * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 55000000000000:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 5.5e13Initial program 100.0%
Taylor expanded in y around 0 83.6%
unpow283.6%
Simplified83.6%
Taylor expanded in y around 0 65.1%
if 5.5e13 < y Initial program 100.0%
Taylor expanded in y around 0 51.4%
unpow251.4%
Simplified51.4%
Taylor expanded in x around 0 43.5%
+-commutative43.5%
unpow243.5%
fma-udef43.5%
Simplified43.5%
*-commutative43.5%
fma-udef43.5%
distribute-rgt-in43.5%
*-un-lft-identity43.5%
Applied egg-rr43.5%
Final simplification60.1%
(FPCore (x y) :precision binary64 (if (<= y 0.0001) x (* 0.16666666666666666 (* y (* x y)))))
double code(double x, double y) {
double tmp;
if (y <= 0.0001) {
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 <= 0.0001d0) 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 <= 0.0001) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (y * (x * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.0001: tmp = x else: tmp = 0.16666666666666666 * (y * (x * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.0001) 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 <= 0.0001) tmp = x; else tmp = 0.16666666666666666 * (y * (x * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.0001], x, N[(0.16666666666666666 * N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0001:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.00000000000000005e-4Initial program 100.0%
Taylor expanded in y around 0 84.6%
unpow284.6%
Simplified84.6%
Taylor expanded in x around 0 45.5%
+-commutative45.5%
unpow245.5%
fma-udef45.5%
Simplified45.5%
Taylor expanded in y around 0 31.1%
if 1.00000000000000005e-4 < y Initial program 100.0%
Taylor expanded in y around 0 50.3%
unpow250.3%
Simplified50.3%
Taylor expanded in y around inf 48.6%
unpow248.6%
associate-*l*39.7%
Simplified39.7%
Taylor expanded in x around 0 40.8%
unpow240.8%
associate-*l*31.8%
Simplified31.8%
Final simplification31.3%
(FPCore (x y) :precision binary64 (if (<= y 0.0001) x (* 0.16666666666666666 (* x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 0.0001) {
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.0001d0) 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.0001) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.0001: tmp = x else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.0001) 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.0001) tmp = x; else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.0001], x, N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0001:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.00000000000000005e-4Initial program 100.0%
Taylor expanded in y around 0 84.6%
unpow284.6%
Simplified84.6%
Taylor expanded in x around 0 45.5%
+-commutative45.5%
unpow245.5%
fma-udef45.5%
Simplified45.5%
Taylor expanded in y around 0 31.1%
if 1.00000000000000005e-4 < y Initial program 100.0%
Taylor expanded in y around 0 50.3%
unpow250.3%
Simplified50.3%
Taylor expanded in y around inf 48.6%
unpow248.6%
associate-*l*39.7%
Simplified39.7%
Taylor expanded in x around 0 40.8%
unpow240.8%
Simplified40.8%
Final simplification33.5%
(FPCore (x y) :precision binary64 (if (<= y 0.0001) x (* x (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 0.0001) {
tmp = x;
} else {
tmp = x * (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 <= 0.0001d0) then
tmp = x
else
tmp = x * (0.16666666666666666d0 * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 0.0001) {
tmp = x;
} else {
tmp = x * (0.16666666666666666 * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.0001: tmp = x else: tmp = x * (0.16666666666666666 * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.0001) tmp = x; else tmp = Float64(x * Float64(0.16666666666666666 * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 0.0001) tmp = x; else tmp = x * (0.16666666666666666 * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.0001], x, N[(x * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0001:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.00000000000000005e-4Initial program 100.0%
Taylor expanded in y around 0 84.6%
unpow284.6%
Simplified84.6%
Taylor expanded in x around 0 45.5%
+-commutative45.5%
unpow245.5%
fma-udef45.5%
Simplified45.5%
Taylor expanded in y around 0 31.1%
if 1.00000000000000005e-4 < y Initial program 100.0%
Taylor expanded in y around 0 50.3%
unpow250.3%
Simplified50.3%
Taylor expanded in x around 0 40.8%
+-commutative40.8%
unpow240.8%
fma-udef40.8%
Simplified40.8%
Taylor expanded in y around inf 40.8%
unpow240.8%
Simplified40.8%
Final simplification33.5%
(FPCore (x y) :precision binary64 (+ x (* x (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
return x + (x * (0.16666666666666666 * (y * y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (x * (0.16666666666666666d0 * (y * y)))
end function
public static double code(double x, double y) {
return x + (x * (0.16666666666666666 * (y * y)));
}
def code(x, y): return x + (x * (0.16666666666666666 * (y * y)))
function code(x, y) return Float64(x + Float64(x * Float64(0.16666666666666666 * Float64(y * y)))) end
function tmp = code(x, y) tmp = x + (x * (0.16666666666666666 * (y * y))); end
code[x_, y_] := N[(x + N[(x * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 76.2%
unpow276.2%
Simplified76.2%
Taylor expanded in x around 0 44.4%
+-commutative44.4%
unpow244.4%
fma-udef44.4%
Simplified44.4%
*-commutative44.4%
fma-udef44.4%
distribute-rgt-in44.4%
*-un-lft-identity44.4%
Applied egg-rr44.4%
Final simplification44.4%
(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 y around 0 76.2%
unpow276.2%
Simplified76.2%
Taylor expanded in x around 0 44.4%
+-commutative44.4%
unpow244.4%
fma-udef44.4%
Simplified44.4%
Taylor expanded in y around 0 24.0%
Final simplification24.0%
herbie shell --seed 2023200
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))