
(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 15 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 (<= y 7200.0)
(* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 6.9e+102)
(pow x -3.0)
(if (<= y 1.35e+154)
(/ (* 0.5 (+ (* 0.3333333333333333 (pow y 3.0)) (* y 2.0))) (/ y x))
(* 0.16666666666666666 (* (sin x) (* y y)))))))
double code(double x, double y) {
double tmp;
if (y <= 7200.0) {
tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 6.9e+102) {
tmp = pow(x, -3.0);
} else if (y <= 1.35e+154) {
tmp = (0.5 * ((0.3333333333333333 * pow(y, 3.0)) + (y * 2.0))) / (y / x);
} 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 <= 7200.0d0) then
tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 6.9d+102) then
tmp = x ** (-3.0d0)
else if (y <= 1.35d+154) then
tmp = (0.5d0 * ((0.3333333333333333d0 * (y ** 3.0d0)) + (y * 2.0d0))) / (y / x)
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 <= 7200.0) {
tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 6.9e+102) {
tmp = Math.pow(x, -3.0);
} else if (y <= 1.35e+154) {
tmp = (0.5 * ((0.3333333333333333 * Math.pow(y, 3.0)) + (y * 2.0))) / (y / x);
} else {
tmp = 0.16666666666666666 * (Math.sin(x) * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7200.0: tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 6.9e+102: tmp = math.pow(x, -3.0) elif y <= 1.35e+154: tmp = (0.5 * ((0.3333333333333333 * math.pow(y, 3.0)) + (y * 2.0))) / (y / x) else: tmp = 0.16666666666666666 * (math.sin(x) * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 7200.0) tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 6.9e+102) tmp = x ^ -3.0; elseif (y <= 1.35e+154) tmp = Float64(Float64(0.5 * Float64(Float64(0.3333333333333333 * (y ^ 3.0)) + Float64(y * 2.0))) / Float64(y / x)); 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 <= 7200.0) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 6.9e+102) tmp = x ^ -3.0; elseif (y <= 1.35e+154) tmp = (0.5 * ((0.3333333333333333 * (y ^ 3.0)) + (y * 2.0))) / (y / x); else tmp = 0.16666666666666666 * (sin(x) * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7200.0], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.9e+102], N[Power[x, -3.0], $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(N[(0.5 * N[(N[(0.3333333333333333 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y / x), $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 7200:\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 6.9 \cdot 10^{+102}:\\
\;\;\;\;{x}^{-3}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{0.5 \cdot \left(0.3333333333333333 \cdot {y}^{3} + y \cdot 2\right)}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 7200Initial program 100.0%
Taylor expanded in y around 0 84.3%
unpow284.3%
Simplified84.3%
if 7200 < y < 6.89999999999999966e102Initial program 100.0%
Taylor expanded in x around 0 85.0%
associate-/l*80.0%
associate-*r/80.0%
rec-exp80.0%
Simplified80.0%
Applied egg-rr37.0%
if 6.89999999999999966e102 < y < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in x around 0 90.9%
associate-/l*72.7%
associate-*r/72.7%
rec-exp72.7%
Simplified72.7%
Taylor expanded in y around 0 72.7%
if 1.35000000000000003e154 < 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%
Simplified100.0%
Final simplification82.3%
(FPCore (x y)
:precision binary64
(if (<= y 7200.0)
(sin x)
(if (<= y 5.5e+102)
(pow x -3.0)
(if (<= y 1.35e+154)
(* (/ x y) (* 0.16666666666666666 (pow y 3.0)))
(* 0.16666666666666666 (* (sin x) (* y y)))))))
double code(double x, double y) {
double tmp;
if (y <= 7200.0) {
tmp = sin(x);
} else if (y <= 5.5e+102) {
tmp = pow(x, -3.0);
} else if (y <= 1.35e+154) {
tmp = (x / y) * (0.16666666666666666 * pow(y, 3.0));
} 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 <= 7200.0d0) then
tmp = sin(x)
else if (y <= 5.5d+102) then
tmp = x ** (-3.0d0)
else if (y <= 1.35d+154) then
tmp = (x / y) * (0.16666666666666666d0 * (y ** 3.0d0))
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 <= 7200.0) {
tmp = Math.sin(x);
} else if (y <= 5.5e+102) {
tmp = Math.pow(x, -3.0);
} else if (y <= 1.35e+154) {
tmp = (x / y) * (0.16666666666666666 * Math.pow(y, 3.0));
} else {
tmp = 0.16666666666666666 * (Math.sin(x) * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7200.0: tmp = math.sin(x) elif y <= 5.5e+102: tmp = math.pow(x, -3.0) elif y <= 1.35e+154: tmp = (x / y) * (0.16666666666666666 * math.pow(y, 3.0)) else: tmp = 0.16666666666666666 * (math.sin(x) * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 7200.0) tmp = sin(x); elseif (y <= 5.5e+102) tmp = x ^ -3.0; elseif (y <= 1.35e+154) tmp = Float64(Float64(x / y) * Float64(0.16666666666666666 * (y ^ 3.0))); 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 <= 7200.0) tmp = sin(x); elseif (y <= 5.5e+102) tmp = x ^ -3.0; elseif (y <= 1.35e+154) tmp = (x / y) * (0.16666666666666666 * (y ^ 3.0)); else tmp = 0.16666666666666666 * (sin(x) * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7200.0], N[Sin[x], $MachinePrecision], If[LessEqual[y, 5.5e+102], N[Power[x, -3.0], $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(N[(x / y), $MachinePrecision] * N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $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 7200:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;{x}^{-3}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{y} \cdot \left(0.16666666666666666 \cdot {y}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 7200Initial program 100.0%
Taylor expanded in y around 0 68.7%
if 7200 < y < 5.49999999999999981e102Initial program 100.0%
Taylor expanded in x around 0 85.0%
associate-/l*80.0%
associate-*r/80.0%
rec-exp80.0%
Simplified80.0%
Applied egg-rr37.0%
if 5.49999999999999981e102 < y < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in x around 0 90.9%
associate-/l*72.7%
associate-*r/72.7%
rec-exp72.7%
Simplified72.7%
Taylor expanded in y around 0 72.7%
Taylor expanded in y around inf 72.7%
clear-num72.7%
associate-/r/72.7%
clear-num72.7%
associate-*r*72.7%
metadata-eval72.7%
Applied egg-rr72.7%
if 1.35000000000000003e154 < 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%
Simplified100.0%
Final simplification70.8%
(FPCore (x y)
:precision binary64
(if (<= y 7200.0)
(* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 6.9e+102)
(pow x -3.0)
(if (<= y 1.35e+154)
(* (/ x y) (* 0.16666666666666666 (pow y 3.0)))
(* 0.16666666666666666 (* (sin x) (* y y)))))))
double code(double x, double y) {
double tmp;
if (y <= 7200.0) {
tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 6.9e+102) {
tmp = pow(x, -3.0);
} else if (y <= 1.35e+154) {
tmp = (x / y) * (0.16666666666666666 * pow(y, 3.0));
} 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 <= 7200.0d0) then
tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 6.9d+102) then
tmp = x ** (-3.0d0)
else if (y <= 1.35d+154) then
tmp = (x / y) * (0.16666666666666666d0 * (y ** 3.0d0))
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 <= 7200.0) {
tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 6.9e+102) {
tmp = Math.pow(x, -3.0);
} else if (y <= 1.35e+154) {
tmp = (x / y) * (0.16666666666666666 * Math.pow(y, 3.0));
} else {
tmp = 0.16666666666666666 * (Math.sin(x) * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7200.0: tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 6.9e+102: tmp = math.pow(x, -3.0) elif y <= 1.35e+154: tmp = (x / y) * (0.16666666666666666 * math.pow(y, 3.0)) else: tmp = 0.16666666666666666 * (math.sin(x) * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 7200.0) tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 6.9e+102) tmp = x ^ -3.0; elseif (y <= 1.35e+154) tmp = Float64(Float64(x / y) * Float64(0.16666666666666666 * (y ^ 3.0))); 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 <= 7200.0) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 6.9e+102) tmp = x ^ -3.0; elseif (y <= 1.35e+154) tmp = (x / y) * (0.16666666666666666 * (y ^ 3.0)); else tmp = 0.16666666666666666 * (sin(x) * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7200.0], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.9e+102], N[Power[x, -3.0], $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(N[(x / y), $MachinePrecision] * N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $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 7200:\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 6.9 \cdot 10^{+102}:\\
\;\;\;\;{x}^{-3}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{y} \cdot \left(0.16666666666666666 \cdot {y}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 7200Initial program 100.0%
Taylor expanded in y around 0 84.3%
unpow284.3%
Simplified84.3%
if 7200 < y < 6.89999999999999966e102Initial program 100.0%
Taylor expanded in x around 0 85.0%
associate-/l*80.0%
associate-*r/80.0%
rec-exp80.0%
Simplified80.0%
Applied egg-rr37.0%
if 6.89999999999999966e102 < y < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in x around 0 90.9%
associate-/l*72.7%
associate-*r/72.7%
rec-exp72.7%
Simplified72.7%
Taylor expanded in y around 0 72.7%
Taylor expanded in y around inf 72.7%
clear-num72.7%
associate-/r/72.7%
clear-num72.7%
associate-*r*72.7%
metadata-eval72.7%
Applied egg-rr72.7%
if 1.35000000000000003e154 < 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%
Simplified100.0%
Final simplification82.3%
(FPCore (x y)
:precision binary64
(if (<= y 7200.0)
(sin x)
(if (<= y 1.35e+154)
(pow x -3.0)
(* 0.16666666666666666 (* (sin x) (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 7200.0) {
tmp = sin(x);
} else if (y <= 1.35e+154) {
tmp = pow(x, -3.0);
} 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 <= 7200.0d0) then
tmp = sin(x)
else if (y <= 1.35d+154) then
tmp = x ** (-3.0d0)
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 <= 7200.0) {
tmp = Math.sin(x);
} else if (y <= 1.35e+154) {
tmp = Math.pow(x, -3.0);
} else {
tmp = 0.16666666666666666 * (Math.sin(x) * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7200.0: tmp = math.sin(x) elif y <= 1.35e+154: tmp = math.pow(x, -3.0) else: tmp = 0.16666666666666666 * (math.sin(x) * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 7200.0) tmp = sin(x); elseif (y <= 1.35e+154) tmp = x ^ -3.0; 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 <= 7200.0) tmp = sin(x); elseif (y <= 1.35e+154) tmp = x ^ -3.0; else tmp = 0.16666666666666666 * (sin(x) * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7200.0], N[Sin[x], $MachinePrecision], If[LessEqual[y, 1.35e+154], N[Power[x, -3.0], $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 7200:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;{x}^{-3}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 7200Initial program 100.0%
Taylor expanded in y around 0 68.7%
if 7200 < y < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in x around 0 87.1%
associate-/l*77.4%
associate-*r/77.4%
rec-exp77.4%
Simplified77.4%
Applied egg-rr34.3%
if 1.35000000000000003e154 < 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%
Simplified100.0%
Final simplification68.9%
(FPCore (x y)
:precision binary64
(if (<= y 7200.0)
(sin x)
(if (<= y 3.3e+154)
(pow x -3.0)
(* x (+ 1.0 (* y (* y 0.16666666666666666)))))))
double code(double x, double y) {
double tmp;
if (y <= 7200.0) {
tmp = sin(x);
} else if (y <= 3.3e+154) {
tmp = pow(x, -3.0);
} else {
tmp = x * (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 <= 7200.0d0) then
tmp = sin(x)
else if (y <= 3.3d+154) then
tmp = x ** (-3.0d0)
else
tmp = x * (1.0d0 + (y * (y * 0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 7200.0) {
tmp = Math.sin(x);
} else if (y <= 3.3e+154) {
tmp = Math.pow(x, -3.0);
} else {
tmp = x * (1.0 + (y * (y * 0.16666666666666666)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7200.0: tmp = math.sin(x) elif y <= 3.3e+154: tmp = math.pow(x, -3.0) else: tmp = x * (1.0 + (y * (y * 0.16666666666666666))) return tmp
function code(x, y) tmp = 0.0 if (y <= 7200.0) tmp = sin(x); elseif (y <= 3.3e+154) tmp = x ^ -3.0; else tmp = Float64(x * Float64(1.0 + Float64(y * Float64(y * 0.16666666666666666)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 7200.0) tmp = sin(x); elseif (y <= 3.3e+154) tmp = x ^ -3.0; else tmp = x * (1.0 + (y * (y * 0.16666666666666666))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7200.0], N[Sin[x], $MachinePrecision], If[LessEqual[y, 3.3e+154], N[Power[x, -3.0], $MachinePrecision], N[(x * N[(1.0 + N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7200:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+154}:\\
\;\;\;\;{x}^{-3}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + y \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if y < 7200Initial program 100.0%
Taylor expanded in y around 0 68.7%
if 7200 < y < 3.3e154Initial program 100.0%
Taylor expanded in x around 0 87.1%
associate-/l*77.4%
associate-*r/77.4%
rec-exp77.4%
Simplified77.4%
Applied egg-rr34.3%
if 3.3e154 < y Initial program 100.0%
Taylor expanded in x around 0 66.7%
associate-/l*30.6%
associate-*r/30.6%
rec-exp30.6%
Simplified30.6%
Taylor expanded in y around 0 66.7%
+-commutative66.7%
*-un-lft-identity66.7%
associate-*r*66.7%
distribute-rgt-out66.7%
unpow266.7%
associate-*r*66.7%
Applied egg-rr66.7%
Final simplification64.2%
(FPCore (x y) :precision binary64 (if (<= y 550.0) (sin x) (if (<= y 6.3e+75) (* x x) (+ x (* 0.16666666666666666 (* x (* y y)))))))
double code(double x, double y) {
double tmp;
if (y <= 550.0) {
tmp = sin(x);
} else if (y <= 6.3e+75) {
tmp = x * x;
} else {
tmp = x + (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 <= 550.0d0) then
tmp = sin(x)
else if (y <= 6.3d+75) then
tmp = x * x
else
tmp = x + (0.16666666666666666d0 * (x * (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 550.0) {
tmp = Math.sin(x);
} else if (y <= 6.3e+75) {
tmp = x * x;
} else {
tmp = x + (0.16666666666666666 * (x * (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 550.0: tmp = math.sin(x) elif y <= 6.3e+75: tmp = x * x else: tmp = x + (0.16666666666666666 * (x * (y * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 550.0) tmp = sin(x); elseif (y <= 6.3e+75) tmp = Float64(x * x); else tmp = Float64(x + Float64(0.16666666666666666 * Float64(x * Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 550.0) tmp = sin(x); elseif (y <= 6.3e+75) tmp = x * x; else tmp = x + (0.16666666666666666 * (x * (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 550.0], N[Sin[x], $MachinePrecision], If[LessEqual[y, 6.3e+75], N[(x * x), $MachinePrecision], N[(x + N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 550:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 6.3 \cdot 10^{+75}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;x + 0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 550Initial program 100.0%
Taylor expanded in y around 0 69.4%
if 550 < y < 6.30000000000000036e75Initial program 100.0%
Taylor expanded in x around 0 81.3%
associate-/l*75.0%
associate-*r/75.0%
rec-exp75.0%
Simplified75.0%
Applied egg-rr14.3%
if 6.30000000000000036e75 < y Initial program 100.0%
Taylor expanded in x around 0 73.6%
associate-/l*45.3%
associate-*r/45.3%
rec-exp45.3%
Simplified45.3%
Taylor expanded in y around 0 53.8%
expm1-log1p-u32.7%
expm1-udef32.7%
*-commutative32.7%
unpow232.7%
associate-*r*29.2%
Applied egg-rr29.2%
expm1-def29.2%
expm1-log1p41.5%
associate-*l*53.8%
Simplified53.8%
Final simplification62.7%
(FPCore (x y) :precision binary64 (if (<= y 490.0) x (if (<= y 9e+75) (* x x) (* 0.16666666666666666 (* x (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 490.0) {
tmp = x;
} else if (y <= 9e+75) {
tmp = 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 <= 490.0d0) then
tmp = x
else if (y <= 9d+75) then
tmp = 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 <= 490.0) {
tmp = x;
} else if (y <= 9e+75) {
tmp = x * x;
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 490.0: tmp = x elif y <= 9e+75: tmp = x * x else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 490.0) tmp = x; elseif (y <= 9e+75) tmp = 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 <= 490.0) tmp = x; elseif (y <= 9e+75) tmp = x * x; else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 490.0], x, If[LessEqual[y, 9e+75], N[(x * x), $MachinePrecision], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 490:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+75}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 490Initial program 100.0%
Taylor expanded in x around 0 26.1%
associate-/l*16.0%
associate-*r/16.0%
rec-exp16.0%
Simplified16.0%
Taylor expanded in y around 0 36.0%
if 490 < y < 9.0000000000000007e75Initial program 100.0%
Taylor expanded in x around 0 81.3%
associate-/l*75.0%
associate-*r/75.0%
rec-exp75.0%
Simplified75.0%
Applied egg-rr14.3%
if 9.0000000000000007e75 < y Initial program 100.0%
Taylor expanded in x around 0 73.6%
associate-/l*45.3%
associate-*r/45.3%
rec-exp45.3%
Simplified45.3%
Taylor expanded in y around 0 53.8%
Taylor expanded in y around inf 53.8%
unpow253.8%
*-commutative53.8%
Simplified53.8%
Final simplification38.3%
(FPCore (x y) :precision binary64 (if (<= x -2.9e+174) (* x x) (* x (+ 1.0 (* y (* y 0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (x <= -2.9e+174) {
tmp = x * x;
} else {
tmp = x * (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 (x <= (-2.9d+174)) then
tmp = x * x
else
tmp = x * (1.0d0 + (y * (y * 0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.9e+174) {
tmp = x * x;
} else {
tmp = x * (1.0 + (y * (y * 0.16666666666666666)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.9e+174: tmp = x * x else: tmp = x * (1.0 + (y * (y * 0.16666666666666666))) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.9e+174) tmp = Float64(x * x); else tmp = Float64(x * Float64(1.0 + Float64(y * Float64(y * 0.16666666666666666)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.9e+174) tmp = x * x; else tmp = x * (1.0 + (y * (y * 0.16666666666666666))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.9e+174], N[(x * x), $MachinePrecision], N[(x * N[(1.0 + N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+174}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + y \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if x < -2.9e174Initial program 100.0%
Taylor expanded in x around 0 15.1%
associate-/l*14.1%
associate-*r/14.1%
rec-exp14.1%
Simplified14.1%
Applied egg-rr42.4%
if -2.9e174 < x Initial program 100.0%
Taylor expanded in x around 0 42.5%
associate-/l*27.2%
associate-*r/27.2%
rec-exp27.2%
Simplified27.2%
Taylor expanded in y around 0 51.5%
+-commutative51.5%
*-un-lft-identity51.5%
associate-*r*51.5%
distribute-rgt-out51.5%
unpow251.5%
associate-*r*51.5%
Applied egg-rr51.5%
Final simplification50.5%
(FPCore (x y) :precision binary64 (if (<= x -2.9e+174) (* x x) (+ x (* 0.16666666666666666 (* x (* y y))))))
double code(double x, double y) {
double tmp;
if (x <= -2.9e+174) {
tmp = x * x;
} else {
tmp = x + (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 (x <= (-2.9d+174)) then
tmp = x * x
else
tmp = x + (0.16666666666666666d0 * (x * (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.9e+174) {
tmp = x * x;
} else {
tmp = x + (0.16666666666666666 * (x * (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.9e+174: tmp = x * x else: tmp = x + (0.16666666666666666 * (x * (y * y))) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.9e+174) tmp = Float64(x * x); else tmp = Float64(x + Float64(0.16666666666666666 * Float64(x * Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.9e+174) tmp = x * x; else tmp = x + (0.16666666666666666 * (x * (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.9e+174], N[(x * x), $MachinePrecision], N[(x + N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+174}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;x + 0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if x < -2.9e174Initial program 100.0%
Taylor expanded in x around 0 15.1%
associate-/l*14.1%
associate-*r/14.1%
rec-exp14.1%
Simplified14.1%
Applied egg-rr42.4%
if -2.9e174 < x Initial program 100.0%
Taylor expanded in x around 0 42.5%
associate-/l*27.2%
associate-*r/27.2%
rec-exp27.2%
Simplified27.2%
Taylor expanded in y around 0 51.5%
expm1-log1p-u41.5%
expm1-udef41.3%
*-commutative41.3%
unpow241.3%
associate-*r*38.4%
Applied egg-rr38.4%
expm1-def38.6%
expm1-log1p44.9%
associate-*l*51.5%
Simplified51.5%
Final simplification50.5%
(FPCore (x y) :precision binary64 (if (<= y 660.0) x (* x x)))
double code(double x, double y) {
double tmp;
if (y <= 660.0) {
tmp = x;
} else {
tmp = 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 <= 660.0d0) then
tmp = x
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 660.0) {
tmp = x;
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 660.0: tmp = x else: tmp = x * x return tmp
function code(x, y) tmp = 0.0 if (y <= 660.0) tmp = x; else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 660.0) tmp = x; else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 660.0], x, N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 660:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if y < 660Initial program 100.0%
Taylor expanded in x around 0 26.1%
associate-/l*16.0%
associate-*r/16.0%
rec-exp16.0%
Simplified16.0%
Taylor expanded in y around 0 36.0%
if 660 < y Initial program 100.0%
Taylor expanded in x around 0 75.4%
associate-/l*52.2%
associate-*r/52.2%
rec-exp52.2%
Simplified52.2%
Applied egg-rr19.0%
Final simplification31.4%
(FPCore (x y) :precision binary64 -3.0)
double code(double x, double y) {
return -3.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -3.0d0
end function
public static double code(double x, double y) {
return -3.0;
}
def code(x, y): return -3.0
function code(x, y) return -3.0 end
function tmp = code(x, y) tmp = -3.0; end
code[x_, y_] := -3.0
\begin{array}{l}
\\
-3
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 76.8%
unpow276.8%
Simplified76.8%
Applied egg-rr4.2%
Final simplification4.2%
(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%
Taylor expanded in y around 0 76.8%
unpow276.8%
Simplified76.8%
Applied egg-rr4.6%
Final simplification4.6%
(FPCore (x y) :precision binary64 -0.5)
double code(double x, double y) {
return -0.5;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -0.5d0
end function
public static double code(double x, double y) {
return -0.5;
}
def code(x, y): return -0.5
function code(x, y) return -0.5 end
function tmp = code(x, y) tmp = -0.5; end
code[x_, y_] := -0.5
\begin{array}{l}
\\
-0.5
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 76.8%
unpow276.8%
Simplified76.8%
Applied egg-rr4.6%
Final simplification4.6%
(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 39.4%
associate-/l*25.8%
associate-*r/25.8%
rec-exp25.8%
Simplified25.8%
Taylor expanded in y around 0 27.0%
Final simplification27.0%
herbie shell --seed 2023240
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))