
(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 9 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 (* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))))
(if (<= y 125000000000.0)
t_0
(if (<= y 1.96e+65)
(log1p (expm1 (* x 1.0000214334705075)))
(if (<= y 1.35e+154)
(/
(* x (- 1.0 (* (pow y 4.0) 0.027777777777777776)))
(+ 1.0 (* (* y y) -0.16666666666666666)))
t_0)))))
double code(double x, double y) {
double t_0 = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
double tmp;
if (y <= 125000000000.0) {
tmp = t_0;
} else if (y <= 1.96e+65) {
tmp = log1p(expm1((x * 1.0000214334705075)));
} else if (y <= 1.35e+154) {
tmp = (x * (1.0 - (pow(y, 4.0) * 0.027777777777777776))) / (1.0 + ((y * y) * -0.16666666666666666));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
double tmp;
if (y <= 125000000000.0) {
tmp = t_0;
} else if (y <= 1.96e+65) {
tmp = Math.log1p(Math.expm1((x * 1.0000214334705075)));
} else if (y <= 1.35e+154) {
tmp = (x * (1.0 - (Math.pow(y, 4.0) * 0.027777777777777776))) / (1.0 + ((y * y) * -0.16666666666666666));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) tmp = 0 if y <= 125000000000.0: tmp = t_0 elif y <= 1.96e+65: tmp = math.log1p(math.expm1((x * 1.0000214334705075))) elif y <= 1.35e+154: tmp = (x * (1.0 - (math.pow(y, 4.0) * 0.027777777777777776))) / (1.0 + ((y * y) * -0.16666666666666666)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) tmp = 0.0 if (y <= 125000000000.0) tmp = t_0; elseif (y <= 1.96e+65) tmp = log1p(expm1(Float64(x * 1.0000214334705075))); elseif (y <= 1.35e+154) tmp = Float64(Float64(x * Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776))) / Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 125000000000.0], t$95$0, If[LessEqual[y, 1.96e+65], N[Log[1 + N[(Exp[N[(x * 1.0000214334705075), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(N[(x * N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{if}\;y \leq 125000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.96 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(x \cdot 1.0000214334705075\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x \cdot \left(1 - {y}^{4} \cdot 0.027777777777777776\right)}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < 1.25e11 or 1.35000000000000003e154 < y Initial program 100.0%
Taylor expanded in y around 0 84.1%
unpow284.1%
Simplified84.1%
if 1.25e11 < y < 1.9600000000000001e65Initial program 100.0%
Taylor expanded in y around 0 3.3%
unpow23.3%
Simplified3.3%
Applied egg-rr2.9%
Taylor expanded in x around 0 3.7%
log1p-expm1-u44.9%
*-commutative44.9%
Applied egg-rr44.9%
if 1.9600000000000001e65 < y < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in y around 0 4.8%
unpow24.8%
Simplified4.8%
Taylor expanded in x around 0 23.2%
flip-+63.3%
associate-*l/71.1%
metadata-eval71.1%
*-commutative71.1%
*-commutative71.1%
swap-sqr71.1%
pow-prod-up71.1%
metadata-eval71.1%
metadata-eval71.1%
cancel-sign-sub-inv71.1%
metadata-eval71.1%
unpow271.1%
Applied egg-rr71.1%
Final simplification81.5%
(FPCore (x y)
:precision binary64
(if (or (<= y 116000000000.0) (not (<= y 1.35e+154)))
(* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(/
(* x (- 1.0 (* (pow y 4.0) 0.027777777777777776)))
(+ 1.0 (* (* y y) -0.16666666666666666)))))
double code(double x, double y) {
double tmp;
if ((y <= 116000000000.0) || !(y <= 1.35e+154)) {
tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = (x * (1.0 - (pow(y, 4.0) * 0.027777777777777776))) / (1.0 + ((y * y) * -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 <= 116000000000.0d0) .or. (.not. (y <= 1.35d+154))) then
tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else
tmp = (x * (1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0))) / (1.0d0 + ((y * y) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 116000000000.0) || !(y <= 1.35e+154)) {
tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = (x * (1.0 - (Math.pow(y, 4.0) * 0.027777777777777776))) / (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 116000000000.0) or not (y <= 1.35e+154): tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) else: tmp = (x * (1.0 - (math.pow(y, 4.0) * 0.027777777777777776))) / (1.0 + ((y * y) * -0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if ((y <= 116000000000.0) || !(y <= 1.35e+154)) tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); else tmp = Float64(Float64(x * Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776))) / Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 116000000000.0) || ~((y <= 1.35e+154))) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); else tmp = (x * (1.0 - ((y ^ 4.0) * 0.027777777777777776))) / (1.0 + ((y * y) * -0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 116000000000.0], N[Not[LessEqual[y, 1.35e+154]], $MachinePrecision]], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 116000000000 \lor \neg \left(y \leq 1.35 \cdot 10^{+154}\right):\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(1 - {y}^{4} \cdot 0.027777777777777776\right)}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666}\\
\end{array}
\end{array}
if y < 1.16e11 or 1.35000000000000003e154 < y Initial program 100.0%
Taylor expanded in y around 0 84.5%
unpow284.5%
Simplified84.5%
if 1.16e11 < y < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in y around 0 4.3%
unpow24.3%
Simplified4.3%
Taylor expanded in x around 0 22.9%
flip-+51.1%
associate-*l/56.7%
metadata-eval56.7%
*-commutative56.7%
*-commutative56.7%
swap-sqr56.7%
pow-prod-up56.7%
metadata-eval56.7%
metadata-eval56.7%
cancel-sign-sub-inv56.7%
metadata-eval56.7%
unpow256.7%
Applied egg-rr56.7%
Final simplification80.8%
(FPCore (x y) :precision binary64 (if (or (<= y 1020.0) (not (<= y 1.35e+154))) (* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y)))) (pow x -3.0)))
double code(double x, double y) {
double tmp;
if ((y <= 1020.0) || !(y <= 1.35e+154)) {
tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = pow(x, -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 <= 1020.0d0) .or. (.not. (y <= 1.35d+154))) then
tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else
tmp = x ** (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 1020.0) || !(y <= 1.35e+154)) {
tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = Math.pow(x, -3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 1020.0) or not (y <= 1.35e+154): tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) else: tmp = math.pow(x, -3.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= 1020.0) || !(y <= 1.35e+154)) tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); else tmp = x ^ -3.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 1020.0) || ~((y <= 1.35e+154))) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); else tmp = x ^ -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 1020.0], N[Not[LessEqual[y, 1.35e+154]], $MachinePrecision]], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[x, -3.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1020 \lor \neg \left(y \leq 1.35 \cdot 10^{+154}\right):\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{-3}\\
\end{array}
\end{array}
if y < 1020 or 1.35000000000000003e154 < y Initial program 100.0%
Taylor expanded in y around 0 84.5%
unpow284.5%
Simplified84.5%
if 1020 < y < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in y around 0 4.3%
unpow24.3%
Simplified4.3%
Applied egg-rr32.0%
Taylor expanded in x around 0 31.1%
add-log-exp45.0%
*-un-lft-identity45.0%
log-prod45.0%
metadata-eval45.0%
add-log-exp31.1%
pow-flip31.1%
metadata-eval31.1%
Applied egg-rr31.1%
+-lft-identity31.1%
Simplified31.1%
Final simplification77.4%
(FPCore (x y)
:precision binary64
(if (<= y 760.0)
(sin x)
(if (<= y 1.2e+154)
(pow x -3.0)
(+ x (* x (* 0.16666666666666666 (* y y)))))))
double code(double x, double y) {
double tmp;
if (y <= 760.0) {
tmp = sin(x);
} else if (y <= 1.2e+154) {
tmp = pow(x, -3.0);
} 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 <= 760.0d0) then
tmp = sin(x)
else if (y <= 1.2d+154) then
tmp = x ** (-3.0d0)
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 <= 760.0) {
tmp = Math.sin(x);
} else if (y <= 1.2e+154) {
tmp = Math.pow(x, -3.0);
} else {
tmp = x + (x * (0.16666666666666666 * (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 760.0: tmp = math.sin(x) elif y <= 1.2e+154: tmp = math.pow(x, -3.0) else: tmp = x + (x * (0.16666666666666666 * (y * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 760.0) tmp = sin(x); elseif (y <= 1.2e+154) tmp = x ^ -3.0; 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 <= 760.0) tmp = sin(x); elseif (y <= 1.2e+154) tmp = x ^ -3.0; else tmp = x + (x * (0.16666666666666666 * (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 760.0], N[Sin[x], $MachinePrecision], If[LessEqual[y, 1.2e+154], N[Power[x, -3.0], $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 760:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+154}:\\
\;\;\;\;{x}^{-3}\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 760Initial program 100.0%
Taylor expanded in y around 0 82.3%
unpow282.3%
Simplified82.3%
Taylor expanded in y around 0 65.7%
if 760 < y < 1.20000000000000007e154Initial program 100.0%
Taylor expanded in y around 0 4.3%
unpow24.3%
Simplified4.3%
Applied egg-rr32.0%
Taylor expanded in x around 0 31.1%
add-log-exp45.0%
*-un-lft-identity45.0%
log-prod45.0%
metadata-eval45.0%
add-log-exp31.1%
pow-flip31.1%
metadata-eval31.1%
Applied egg-rr31.1%
+-lft-identity31.1%
Simplified31.1%
if 1.20000000000000007e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x around 0 77.8%
*-commutative77.8%
+-commutative77.8%
distribute-rgt-in77.8%
unpow277.8%
*-un-lft-identity77.8%
Applied egg-rr77.8%
Final simplification62.4%
(FPCore (x y) :precision binary64 (if (<= y 6.3e-9) (sin x) (+ x (* x (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 6.3e-9) {
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 <= 6.3d-9) 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 <= 6.3e-9) {
tmp = Math.sin(x);
} else {
tmp = x + (x * (0.16666666666666666 * (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.3e-9: tmp = math.sin(x) else: tmp = x + (x * (0.16666666666666666 * (y * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 6.3e-9) 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 <= 6.3e-9) tmp = sin(x); else tmp = x + (x * (0.16666666666666666 * (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.3e-9], 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 6.3 \cdot 10^{-9}:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 6.3000000000000002e-9Initial program 100.0%
Taylor expanded in y around 0 83.8%
unpow283.8%
Simplified83.8%
Taylor expanded in y around 0 67.0%
if 6.3000000000000002e-9 < y Initial program 99.9%
Taylor expanded in y around 0 45.9%
unpow245.9%
Simplified45.9%
Taylor expanded in x around 0 46.0%
*-commutative46.0%
+-commutative46.0%
distribute-rgt-in46.0%
unpow246.0%
*-un-lft-identity46.0%
Applied egg-rr46.0%
Final simplification61.5%
(FPCore (x y) :precision binary64 (if (<= y 1.3) x (* 0.16666666666666666 (* x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.3) {
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 <= 1.3d0) 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 <= 1.3) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.3: tmp = x else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.3) 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 <= 1.3) tmp = x; else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.3], x, N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.3:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.30000000000000004Initial program 100.0%
Taylor expanded in y around 0 83.4%
unpow283.4%
Simplified83.4%
Taylor expanded in x around 0 46.8%
Taylor expanded in y around 0 32.2%
if 1.30000000000000004 < y Initial program 100.0%
Taylor expanded in y around 0 45.1%
unpow245.1%
Simplified45.1%
Taylor expanded in x around 0 45.3%
Taylor expanded in y around inf 45.3%
unpow245.3%
*-commutative45.3%
Simplified45.3%
Final simplification35.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 73.8%
unpow273.8%
Simplified73.8%
Taylor expanded in x around 0 46.4%
*-commutative46.4%
+-commutative46.4%
distribute-rgt-in46.4%
unpow246.4%
*-un-lft-identity46.4%
Applied egg-rr46.4%
Final simplification46.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 73.8%
unpow273.8%
Simplified73.8%
Taylor expanded in x around 0 46.4%
Taylor expanded in y around 0 24.9%
Final simplification24.9%
herbie shell --seed 2023230
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))