
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = cos(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos 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 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = cos(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = cos(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= y 1700.0)
(cos x)
(if (<= y 5.5e+81)
(/ (+ y (* -0.5 (* y (* x x)))) y)
(/ (+ y (* 0.16666666666666666 (pow y 3.0))) y))))
double code(double x, double y) {
double tmp;
if (y <= 1700.0) {
tmp = cos(x);
} else if (y <= 5.5e+81) {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
} else {
tmp = (y + (0.16666666666666666 * pow(y, 3.0))) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1700.0d0) then
tmp = cos(x)
else if (y <= 5.5d+81) then
tmp = (y + ((-0.5d0) * (y * (x * x)))) / y
else
tmp = (y + (0.16666666666666666d0 * (y ** 3.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1700.0) {
tmp = Math.cos(x);
} else if (y <= 5.5e+81) {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
} else {
tmp = (y + (0.16666666666666666 * Math.pow(y, 3.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1700.0: tmp = math.cos(x) elif y <= 5.5e+81: tmp = (y + (-0.5 * (y * (x * x)))) / y else: tmp = (y + (0.16666666666666666 * math.pow(y, 3.0))) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1700.0) tmp = cos(x); elseif (y <= 5.5e+81) tmp = Float64(Float64(y + Float64(-0.5 * Float64(y * Float64(x * x)))) / y); else tmp = Float64(Float64(y + Float64(0.16666666666666666 * (y ^ 3.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1700.0) tmp = cos(x); elseif (y <= 5.5e+81) tmp = (y + (-0.5 * (y * (x * x)))) / y; else tmp = (y + (0.16666666666666666 * (y ^ 3.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1700.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 5.5e+81], N[(N[(y + N[(-0.5 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(y + N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1700:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+81}:\\
\;\;\;\;\frac{y + -0.5 \cdot \left(y \cdot \left(x \cdot x\right)\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y + 0.16666666666666666 \cdot {y}^{3}}{y}\\
\end{array}
\end{array}
if y < 1700Initial program 100.0%
Taylor expanded in y around 0 65.3%
if 1700 < y < 5.5000000000000003e81Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 15.8%
unpow215.8%
Applied egg-rr15.8%
if 5.5000000000000003e81 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 88.9%
Taylor expanded in x around 0 65.7%
Final simplification62.7%
(FPCore (x y)
:precision binary64
(if (<= y 400.0)
(cos x)
(if (<= y 1.6e+155)
(/ (+ y (* -0.5 (* y (* x x)))) y)
(+ 1.0 (* 0.16666666666666666 (pow y 2.0))))))
double code(double x, double y) {
double tmp;
if (y <= 400.0) {
tmp = cos(x);
} else if (y <= 1.6e+155) {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
} else {
tmp = 1.0 + (0.16666666666666666 * pow(y, 2.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 400.0d0) then
tmp = cos(x)
else if (y <= 1.6d+155) then
tmp = (y + ((-0.5d0) * (y * (x * x)))) / y
else
tmp = 1.0d0 + (0.16666666666666666d0 * (y ** 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 400.0) {
tmp = Math.cos(x);
} else if (y <= 1.6e+155) {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
} else {
tmp = 1.0 + (0.16666666666666666 * Math.pow(y, 2.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 400.0: tmp = math.cos(x) elif y <= 1.6e+155: tmp = (y + (-0.5 * (y * (x * x)))) / y else: tmp = 1.0 + (0.16666666666666666 * math.pow(y, 2.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 400.0) tmp = cos(x); elseif (y <= 1.6e+155) tmp = Float64(Float64(y + Float64(-0.5 * Float64(y * Float64(x * x)))) / y); else tmp = Float64(1.0 + Float64(0.16666666666666666 * (y ^ 2.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 400.0) tmp = cos(x); elseif (y <= 1.6e+155) tmp = (y + (-0.5 * (y * (x * x)))) / y; else tmp = 1.0 + (0.16666666666666666 * (y ^ 2.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 400.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.6e+155], N[(N[(y + N[(-0.5 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(1.0 + N[(0.16666666666666666 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 400:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+155}:\\
\;\;\;\;\frac{y + -0.5 \cdot \left(y \cdot \left(x \cdot x\right)\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot {y}^{2}\\
\end{array}
\end{array}
if y < 400Initial program 100.0%
Taylor expanded in y around 0 65.3%
if 400 < y < 1.60000000000000006e155Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 20.9%
unpow217.3%
Applied egg-rr20.9%
if 1.60000000000000006e155 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 77.4%
Taylor expanded in y around 0 77.4%
Final simplification62.3%
(FPCore (x y)
:precision binary64
(if (<= y 420.0)
(cos x)
(if (<= y 5.6e+81)
(/ (+ y (* -0.5 (* y (* x x)))) y)
(/ (* 0.16666666666666666 (pow y 3.0)) y))))
double code(double x, double y) {
double tmp;
if (y <= 420.0) {
tmp = cos(x);
} else if (y <= 5.6e+81) {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
} else {
tmp = (0.16666666666666666 * pow(y, 3.0)) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 420.0d0) then
tmp = cos(x)
else if (y <= 5.6d+81) then
tmp = (y + ((-0.5d0) * (y * (x * x)))) / y
else
tmp = (0.16666666666666666d0 * (y ** 3.0d0)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 420.0) {
tmp = Math.cos(x);
} else if (y <= 5.6e+81) {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
} else {
tmp = (0.16666666666666666 * Math.pow(y, 3.0)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 420.0: tmp = math.cos(x) elif y <= 5.6e+81: tmp = (y + (-0.5 * (y * (x * x)))) / y else: tmp = (0.16666666666666666 * math.pow(y, 3.0)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 420.0) tmp = cos(x); elseif (y <= 5.6e+81) tmp = Float64(Float64(y + Float64(-0.5 * Float64(y * Float64(x * x)))) / y); else tmp = Float64(Float64(0.16666666666666666 * (y ^ 3.0)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 420.0) tmp = cos(x); elseif (y <= 5.6e+81) tmp = (y + (-0.5 * (y * (x * x)))) / y; else tmp = (0.16666666666666666 * (y ^ 3.0)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 420.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 5.6e+81], N[(N[(y + N[(-0.5 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 420:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+81}:\\
\;\;\;\;\frac{y + -0.5 \cdot \left(y \cdot \left(x \cdot x\right)\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.16666666666666666 \cdot {y}^{3}}{y}\\
\end{array}
\end{array}
if y < 420Initial program 100.0%
Taylor expanded in y around 0 65.3%
if 420 < y < 5.5999999999999999e81Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 15.8%
unpow215.8%
Applied egg-rr15.8%
if 5.5999999999999999e81 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 88.9%
Taylor expanded in x around 0 65.7%
Taylor expanded in y around inf 65.7%
Final simplification62.7%
(FPCore (x y)
:precision binary64
(if (<= y 1200.0)
(cos x)
(if (<= y 1.6e+155)
(/ (+ y (* -0.5 (* y (* x x)))) y)
(* 0.16666666666666666 (pow y 2.0)))))
double code(double x, double y) {
double tmp;
if (y <= 1200.0) {
tmp = cos(x);
} else if (y <= 1.6e+155) {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
} else {
tmp = 0.16666666666666666 * pow(y, 2.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1200.0d0) then
tmp = cos(x)
else if (y <= 1.6d+155) then
tmp = (y + ((-0.5d0) * (y * (x * x)))) / y
else
tmp = 0.16666666666666666d0 * (y ** 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1200.0) {
tmp = Math.cos(x);
} else if (y <= 1.6e+155) {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
} else {
tmp = 0.16666666666666666 * Math.pow(y, 2.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1200.0: tmp = math.cos(x) elif y <= 1.6e+155: tmp = (y + (-0.5 * (y * (x * x)))) / y else: tmp = 0.16666666666666666 * math.pow(y, 2.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 1200.0) tmp = cos(x); elseif (y <= 1.6e+155) tmp = Float64(Float64(y + Float64(-0.5 * Float64(y * Float64(x * x)))) / y); else tmp = Float64(0.16666666666666666 * (y ^ 2.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1200.0) tmp = cos(x); elseif (y <= 1.6e+155) tmp = (y + (-0.5 * (y * (x * x)))) / y; else tmp = 0.16666666666666666 * (y ^ 2.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1200.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.6e+155], N[(N[(y + N[(-0.5 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(0.16666666666666666 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1200:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+155}:\\
\;\;\;\;\frac{y + -0.5 \cdot \left(y \cdot \left(x \cdot x\right)\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot {y}^{2}\\
\end{array}
\end{array}
if y < 1200Initial program 100.0%
Taylor expanded in y around 0 65.3%
if 1200 < y < 1.60000000000000006e155Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 20.9%
unpow217.3%
Applied egg-rr20.9%
if 1.60000000000000006e155 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 77.4%
Taylor expanded in y around inf 77.4%
Final simplification62.3%
(FPCore (x y) :precision binary64 (if (<= y 1400.0) (cos x) (/ (+ y (* -0.5 (* y (* x x)))) y)))
double code(double x, double y) {
double tmp;
if (y <= 1400.0) {
tmp = cos(x);
} else {
tmp = (y + (-0.5 * (y * (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 <= 1400.0d0) then
tmp = cos(x)
else
tmp = (y + ((-0.5d0) * (y * (x * x)))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1400.0) {
tmp = Math.cos(x);
} else {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1400.0: tmp = math.cos(x) else: tmp = (y + (-0.5 * (y * (x * x)))) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1400.0) tmp = cos(x); else tmp = Float64(Float64(y + Float64(-0.5 * Float64(y * Float64(x * x)))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1400.0) tmp = cos(x); else tmp = (y + (-0.5 * (y * (x * x)))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1400.0], N[Cos[x], $MachinePrecision], N[(N[(y + N[(-0.5 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1400:\\
\;\;\;\;\cos x\\
\mathbf{else}:\\
\;\;\;\;\frac{y + -0.5 \cdot \left(y \cdot \left(x \cdot x\right)\right)}{y}\\
\end{array}
\end{array}
if y < 1400Initial program 100.0%
Taylor expanded in y around 0 65.3%
if 1400 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 17.7%
unpow211.1%
Applied egg-rr17.7%
Final simplification54.7%
(FPCore (x y) :precision binary64 (if (<= y 780.0) 1.0 (/ (+ y (* -0.5 (* y (* x x)))) y)))
double code(double x, double y) {
double tmp;
if (y <= 780.0) {
tmp = 1.0;
} else {
tmp = (y + (-0.5 * (y * (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 <= 780.0d0) then
tmp = 1.0d0
else
tmp = (y + ((-0.5d0) * (y * (x * x)))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 780.0) {
tmp = 1.0;
} else {
tmp = (y + (-0.5 * (y * (x * x)))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 780.0: tmp = 1.0 else: tmp = (y + (-0.5 * (y * (x * x)))) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 780.0) tmp = 1.0; else tmp = Float64(Float64(y + Float64(-0.5 * Float64(y * Float64(x * x)))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 780.0) tmp = 1.0; else tmp = (y + (-0.5 * (y * (x * x)))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 780.0], 1.0, N[(N[(y + N[(-0.5 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 780:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{y + -0.5 \cdot \left(y \cdot \left(x \cdot x\right)\right)}{y}\\
\end{array}
\end{array}
if y < 780Initial program 100.0%
*-commutative100.0%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 65.2%
Taylor expanded in x around 0 39.2%
if 780 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 17.7%
unpow211.1%
Applied egg-rr17.7%
Final simplification34.4%
(FPCore (x y) :precision binary64 (if (<= y 840.0) 1.0 (+ 1.0 (* -0.5 (* x x)))))
double code(double x, double y) {
double tmp;
if (y <= 840.0) {
tmp = 1.0;
} else {
tmp = 1.0 + (-0.5 * (x * x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 840.0d0) then
tmp = 1.0d0
else
tmp = 1.0d0 + ((-0.5d0) * (x * x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 840.0) {
tmp = 1.0;
} else {
tmp = 1.0 + (-0.5 * (x * x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 840.0: tmp = 1.0 else: tmp = 1.0 + (-0.5 * (x * x)) return tmp
function code(x, y) tmp = 0.0 if (y <= 840.0) tmp = 1.0; else tmp = Float64(1.0 + Float64(-0.5 * Float64(x * x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 840.0) tmp = 1.0; else tmp = 1.0 + (-0.5 * (x * x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 840.0], 1.0, N[(1.0 + N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 840:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + -0.5 \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if y < 840Initial program 100.0%
*-commutative100.0%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 65.2%
Taylor expanded in x around 0 39.2%
if 840 < y Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 3.1%
Taylor expanded in x around 0 11.1%
unpow211.1%
Applied egg-rr11.1%
Final simplification33.0%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 51.4%
Taylor expanded in x around 0 31.1%
Final simplification31.1%
herbie shell --seed 2024014
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))