
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
(FPCore (x y) :precision binary64 (* (/ (sin x) x) (sinh y)))
double code(double x, double y) {
return (sin(x) / x) * sinh(y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) / x) * sinh(y)
end function
public static double code(double x, double y) {
return (Math.sin(x) / x) * Math.sinh(y);
}
def code(x, y): return (math.sin(x) / x) * math.sinh(y)
function code(x, y) return Float64(Float64(sin(x) / x) * sinh(y)) end
function tmp = code(x, y) tmp = (sin(x) / x) * sinh(y); end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x}{x} \cdot \sinh y
\end{array}
Initial program 89.5%
associate-*l/100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= (sinh y) (- INFINITY))
(sinh y)
(if (<= (sinh y) 0.005)
(/ (/ (sin x) x) (+ (* y -0.16666666666666666) (/ 1.0 y)))
(sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -((double) INFINITY)) {
tmp = sinh(y);
} else if (sinh(y) <= 0.005) {
tmp = (sin(x) / x) / ((y * -0.16666666666666666) + (1.0 / y));
} else {
tmp = sinh(y);
}
return tmp;
}
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -Double.POSITIVE_INFINITY) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 0.005) {
tmp = (Math.sin(x) / x) / ((y * -0.16666666666666666) + (1.0 / y));
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -math.inf: tmp = math.sinh(y) elif math.sinh(y) <= 0.005: tmp = (math.sin(x) / x) / ((y * -0.16666666666666666) + (1.0 / y)) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= Float64(-Inf)) tmp = sinh(y); elseif (sinh(y) <= 0.005) tmp = Float64(Float64(sin(x) / x) / Float64(Float64(y * -0.16666666666666666) + Float64(1.0 / y))); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -Inf) tmp = sinh(y); elseif (sinh(y) <= 0.005) tmp = (sin(x) / x) / ((y * -0.16666666666666666) + (1.0 / y)); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], (-Infinity)], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 0.005], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] / N[(N[(y * -0.16666666666666666), $MachinePrecision] + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -\infty:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 0.005:\\
\;\;\;\;\frac{\frac{\sin x}{x}}{y \cdot -0.16666666666666666 + \frac{1}{y}}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -inf.0 or 0.0050000000000000001 < (sinh.f64 y) Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
associate-*r/100.0%
associate-/l*100.0%
div-inv100.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 81.4%
remove-double-div81.4%
expm1-log1p-u40.7%
expm1-udef40.7%
Applied egg-rr40.7%
expm1-def40.7%
expm1-log1p81.4%
Simplified81.4%
if -inf.0 < (sinh.f64 y) < 0.0050000000000000001Initial program 76.9%
associate-*r/99.7%
Simplified99.7%
associate-*r/76.9%
associate-/l*98.8%
div-inv98.6%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 99.6%
Final simplification89.6%
(FPCore (x y) :precision binary64 (if (<= (sinh y) -2e-6) (sinh y) (if (<= (sinh y) 0.005) (* (sin x) (/ y x)) (sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -2e-6) {
tmp = sinh(y);
} else if (sinh(y) <= 0.005) {
tmp = sin(x) * (y / x);
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= (-2d-6)) then
tmp = sinh(y)
else if (sinh(y) <= 0.005d0) then
tmp = sin(x) * (y / x)
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -2e-6) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 0.005) {
tmp = Math.sin(x) * (y / x);
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -2e-6: tmp = math.sinh(y) elif math.sinh(y) <= 0.005: tmp = math.sin(x) * (y / x) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= -2e-6) tmp = sinh(y); elseif (sinh(y) <= 0.005) tmp = Float64(sin(x) * Float64(y / x)); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -2e-6) tmp = sinh(y); elseif (sinh(y) <= 0.005) tmp = sin(x) * (y / x); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -2e-6], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 0.005], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -2 \cdot 10^{-6}:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 0.005:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -1.99999999999999991e-6 or 0.0050000000000000001 < (sinh.f64 y) Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
associate-*r/100.0%
associate-/l*100.0%
div-inv100.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 81.5%
remove-double-div81.5%
expm1-log1p-u41.1%
expm1-udef40.9%
Applied egg-rr40.9%
expm1-def41.1%
expm1-log1p81.5%
Simplified81.5%
if -1.99999999999999991e-6 < (sinh.f64 y) < 0.0050000000000000001Initial program 76.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 76.2%
associate-/l*99.4%
associate-/r/99.3%
Simplified99.3%
Final simplification89.5%
(FPCore (x y) :precision binary64 (if (<= (sinh y) -2e-6) (sinh y) (if (<= (sinh y) 0.005) (* (/ (sin x) x) y) (sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -2e-6) {
tmp = sinh(y);
} else if (sinh(y) <= 0.005) {
tmp = (sin(x) / x) * y;
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= (-2d-6)) then
tmp = sinh(y)
else if (sinh(y) <= 0.005d0) then
tmp = (sin(x) / x) * y
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -2e-6) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 0.005) {
tmp = (Math.sin(x) / x) * y;
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -2e-6: tmp = math.sinh(y) elif math.sinh(y) <= 0.005: tmp = (math.sin(x) / x) * y else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= -2e-6) tmp = sinh(y); elseif (sinh(y) <= 0.005) tmp = Float64(Float64(sin(x) / x) * y); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -2e-6) tmp = sinh(y); elseif (sinh(y) <= 0.005) tmp = (sin(x) / x) * y; else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -2e-6], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 0.005], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -2 \cdot 10^{-6}:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 0.005:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -1.99999999999999991e-6 or 0.0050000000000000001 < (sinh.f64 y) Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
associate-*r/100.0%
associate-/l*100.0%
div-inv100.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 81.5%
remove-double-div81.5%
expm1-log1p-u41.1%
expm1-udef40.9%
Applied egg-rr40.9%
expm1-def41.1%
expm1-log1p81.5%
Simplified81.5%
if -1.99999999999999991e-6 < (sinh.f64 y) < 0.0050000000000000001Initial program 76.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 99.5%
Final simplification89.6%
(FPCore (x y) :precision binary64 (if (<= (sinh y) -2e-6) (/ 1.0 (/ 1.0 (sinh y))) (if (<= (sinh y) 0.005) (* (/ (sin x) x) y) (sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -2e-6) {
tmp = 1.0 / (1.0 / sinh(y));
} else if (sinh(y) <= 0.005) {
tmp = (sin(x) / x) * y;
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= (-2d-6)) then
tmp = 1.0d0 / (1.0d0 / sinh(y))
else if (sinh(y) <= 0.005d0) then
tmp = (sin(x) / x) * y
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -2e-6) {
tmp = 1.0 / (1.0 / Math.sinh(y));
} else if (Math.sinh(y) <= 0.005) {
tmp = (Math.sin(x) / x) * y;
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -2e-6: tmp = 1.0 / (1.0 / math.sinh(y)) elif math.sinh(y) <= 0.005: tmp = (math.sin(x) / x) * y else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= -2e-6) tmp = Float64(1.0 / Float64(1.0 / sinh(y))); elseif (sinh(y) <= 0.005) tmp = Float64(Float64(sin(x) / x) * y); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -2e-6) tmp = 1.0 / (1.0 / sinh(y)); elseif (sinh(y) <= 0.005) tmp = (sin(x) / x) * y; else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -2e-6], N[(1.0 / N[(1.0 / N[Sinh[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 0.005], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -2 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{\frac{1}{\sinh y}}\\
\mathbf{elif}\;\sinh y \leq 0.005:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -1.99999999999999991e-6Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
associate-*r/100.0%
associate-/l*100.0%
div-inv100.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 86.6%
if -1.99999999999999991e-6 < (sinh.f64 y) < 0.0050000000000000001Initial program 76.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 99.5%
if 0.0050000000000000001 < (sinh.f64 y) Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
associate-*r/100.0%
associate-/l*100.0%
div-inv100.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 77.0%
remove-double-div77.0%
expm1-log1p-u76.9%
expm1-udef76.9%
Applied egg-rr76.9%
expm1-def76.9%
expm1-log1p77.0%
Simplified77.0%
Final simplification89.6%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
return sin(x) * (sinh(y) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / x)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / x); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{x}
\end{array}
Initial program 89.5%
associate-*r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= x 2.1e+129) (sinh y) (sqrt (* y y))))
double code(double x, double y) {
double tmp;
if (x <= 2.1e+129) {
tmp = sinh(y);
} else {
tmp = sqrt((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.1d+129) then
tmp = sinh(y)
else
tmp = sqrt((y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2.1e+129) {
tmp = Math.sinh(y);
} else {
tmp = Math.sqrt((y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.1e+129: tmp = math.sinh(y) else: tmp = math.sqrt((y * y)) return tmp
function code(x, y) tmp = 0.0 if (x <= 2.1e+129) tmp = sinh(y); else tmp = sqrt(Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.1e+129) tmp = sinh(y); else tmp = sqrt((y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.1e+129], N[Sinh[y], $MachinePrecision], N[Sqrt[N[(y * y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.1 \cdot 10^{+129}:\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot y}\\
\end{array}
\end{array}
if x < 2.09999999999999997e129Initial program 87.7%
associate-*r/99.9%
Simplified99.9%
associate-*r/87.7%
associate-/l*99.5%
div-inv99.4%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 76.2%
remove-double-div76.3%
expm1-log1p-u51.5%
expm1-udef31.4%
Applied egg-rr31.4%
expm1-def51.5%
expm1-log1p76.3%
Simplified76.3%
if 2.09999999999999997e129 < x Initial program 99.9%
associate-*r/100.0%
Simplified100.0%
associate-*r/99.9%
associate-/l*99.0%
div-inv99.1%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 29.3%
Taylor expanded in y around 0 4.4%
remove-double-div4.4%
add-sqr-sqrt2.7%
sqrt-unprod45.2%
Applied egg-rr45.2%
Final simplification71.7%
(FPCore (x y) :precision binary64 (sinh y))
double code(double x, double y) {
return sinh(y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sinh(y)
end function
public static double code(double x, double y) {
return Math.sinh(y);
}
def code(x, y): return math.sinh(y)
function code(x, y) return sinh(y) end
function tmp = code(x, y) tmp = sinh(y); end
code[x_, y_] := N[Sinh[y], $MachinePrecision]
\begin{array}{l}
\\
\sinh y
\end{array}
Initial program 89.5%
associate-*r/99.9%
Simplified99.9%
associate-*r/89.5%
associate-/l*99.4%
div-inv99.4%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 69.2%
remove-double-div69.3%
expm1-log1p-u47.0%
expm1-udef35.7%
Applied egg-rr35.7%
expm1-def47.0%
expm1-log1p69.3%
Simplified69.3%
Final simplification69.3%
(FPCore (x y)
:precision binary64
(if (<= x 1.52e+181)
(+ y (* -0.16666666666666666 (* y (* x x))))
(/
(+ 1.0 (* -0.16666666666666666 (* x x)))
(+ (* y -0.16666666666666666) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (x <= 1.52e+181) {
tmp = y + (-0.16666666666666666 * (y * (x * x)));
} else {
tmp = (1.0 + (-0.16666666666666666 * (x * x))) / ((y * -0.16666666666666666) + (1.0 / y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.52d+181) then
tmp = y + ((-0.16666666666666666d0) * (y * (x * x)))
else
tmp = (1.0d0 + ((-0.16666666666666666d0) * (x * x))) / ((y * (-0.16666666666666666d0)) + (1.0d0 / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.52e+181) {
tmp = y + (-0.16666666666666666 * (y * (x * x)));
} else {
tmp = (1.0 + (-0.16666666666666666 * (x * x))) / ((y * -0.16666666666666666) + (1.0 / y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.52e+181: tmp = y + (-0.16666666666666666 * (y * (x * x))) else: tmp = (1.0 + (-0.16666666666666666 * (x * x))) / ((y * -0.16666666666666666) + (1.0 / y)) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.52e+181) tmp = Float64(y + Float64(-0.16666666666666666 * Float64(y * Float64(x * x)))); else tmp = Float64(Float64(1.0 + Float64(-0.16666666666666666 * Float64(x * x))) / Float64(Float64(y * -0.16666666666666666) + Float64(1.0 / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.52e+181) tmp = y + (-0.16666666666666666 * (y * (x * x))); else tmp = (1.0 + (-0.16666666666666666 * (x * x))) / ((y * -0.16666666666666666) + (1.0 / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.52e+181], N[(y + N[(-0.16666666666666666 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y * -0.16666666666666666), $MachinePrecision] + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.52 \cdot 10^{+181}:\\
\;\;\;\;y + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + -0.16666666666666666 \cdot \left(x \cdot x\right)}{y \cdot -0.16666666666666666 + \frac{1}{y}}\\
\end{array}
\end{array}
if x < 1.52e181Initial program 88.2%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 36.0%
associate-/l*47.7%
associate-/r/65.7%
Simplified65.7%
Taylor expanded in x around 0 34.8%
*-commutative34.8%
unpow234.8%
Simplified34.8%
if 1.52e181 < x Initial program 99.9%
associate-*r/99.9%
Simplified99.9%
associate-*r/99.9%
associate-/l*99.9%
div-inv99.9%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 45.6%
Taylor expanded in x around 0 31.7%
*-commutative24.8%
unpow224.8%
Simplified31.7%
Final simplification34.4%
(FPCore (x y) :precision binary64 (if (<= x 2.4e+78) y (* -0.16666666666666666 (* x (* x y)))))
double code(double x, double y) {
double tmp;
if (x <= 2.4e+78) {
tmp = y;
} else {
tmp = -0.16666666666666666 * (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 (x <= 2.4d+78) then
tmp = y
else
tmp = (-0.16666666666666666d0) * (x * (x * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2.4e+78) {
tmp = y;
} else {
tmp = -0.16666666666666666 * (x * (x * y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.4e+78: tmp = y else: tmp = -0.16666666666666666 * (x * (x * y)) return tmp
function code(x, y) tmp = 0.0 if (x <= 2.4e+78) tmp = y; else tmp = Float64(-0.16666666666666666 * Float64(x * Float64(x * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.4e+78) tmp = y; else tmp = -0.16666666666666666 * (x * (x * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.4e+78], y, N[(-0.16666666666666666 * N[(x * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{+78}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(x \cdot \left(x \cdot y\right)\right)\\
\end{array}
\end{array}
if x < 2.3999999999999999e78Initial program 87.1%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 33.4%
associate-/l*46.2%
associate-/r/65.8%
Simplified65.8%
Taylor expanded in x around 0 32.6%
if 2.3999999999999999e78 < x Initial program 99.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 53.4%
Taylor expanded in x around 0 20.1%
*-commutative20.1%
unpow220.1%
Simplified20.1%
Taylor expanded in x around inf 20.1%
unpow220.1%
*-commutative20.1%
*-commutative20.1%
associate-*r*20.1%
associate-*r*20.1%
*-commutative20.1%
Simplified20.1%
Taylor expanded in y around 0 20.1%
unpow220.1%
associate-*l*20.1%
*-commutative20.1%
Simplified20.1%
Final simplification30.3%
(FPCore (x y) :precision binary64 (* y (+ 1.0 (* -0.16666666666666666 (* x x)))))
double code(double x, double y) {
return y * (1.0 + (-0.16666666666666666 * (x * x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y * (1.0d0 + ((-0.16666666666666666d0) * (x * x)))
end function
public static double code(double x, double y) {
return y * (1.0 + (-0.16666666666666666 * (x * x)));
}
def code(x, y): return y * (1.0 + (-0.16666666666666666 * (x * x)))
function code(x, y) return Float64(y * Float64(1.0 + Float64(-0.16666666666666666 * Float64(x * x)))) end
function tmp = code(x, y) tmp = y * (1.0 + (-0.16666666666666666 * (x * x))); end
code[x_, y_] := N[(y * N[(1.0 + N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 + -0.16666666666666666 \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 89.5%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 47.6%
Taylor expanded in x around 0 33.6%
*-commutative33.6%
unpow233.6%
Simplified33.6%
Final simplification33.6%
(FPCore (x y) :precision binary64 (+ y (* -0.16666666666666666 (* y (* x x)))))
double code(double x, double y) {
return y + (-0.16666666666666666 * (y * (x * x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y + ((-0.16666666666666666d0) * (y * (x * x)))
end function
public static double code(double x, double y) {
return y + (-0.16666666666666666 * (y * (x * x)));
}
def code(x, y): return y + (-0.16666666666666666 * (y * (x * x)))
function code(x, y) return Float64(y + Float64(-0.16666666666666666 * Float64(y * Float64(x * x)))) end
function tmp = code(x, y) tmp = y + (-0.16666666666666666 * (y * (x * x))); end
code[x_, y_] := N[(y + N[(-0.16666666666666666 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 89.5%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 37.2%
associate-/l*47.6%
associate-/r/63.5%
Simplified63.5%
Taylor expanded in x around 0 33.6%
*-commutative33.6%
unpow233.6%
Simplified33.6%
Final simplification33.6%
(FPCore (x y) :precision binary64 y)
double code(double x, double y) {
return y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y
end function
public static double code(double x, double y) {
return y;
}
def code(x, y): return y
function code(x, y) return y end
function tmp = code(x, y) tmp = y; end
code[x_, y_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 89.5%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 37.2%
associate-/l*47.6%
associate-/r/63.5%
Simplified63.5%
Taylor expanded in x around 0 27.3%
Final simplification27.3%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
return sin(x) * (sinh(y) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / x)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / x); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{x}
\end{array}
herbie shell --seed 2023287
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
:herbie-target
(* (sin x) (/ (sinh y) x))
(/ (* (sin x) (sinh y)) x))