
(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 12 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 (* (/ (sinh y) x) (sin x)))
double code(double x, double y) {
return (sinh(y) / x) * sin(x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sinh(y) / x) * sin(x)
end function
public static double code(double x, double y) {
return (Math.sinh(y) / x) * Math.sin(x);
}
def code(x, y): return (math.sinh(y) / x) * math.sin(x)
function code(x, y) return Float64(Float64(sinh(y) / x) * sin(x)) end
function tmp = code(x, y) tmp = (sinh(y) / x) * sin(x); end
code[x_, y_] := N[(N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sinh y}{x} \cdot \sin x
\end{array}
Initial program 86.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
(FPCore (x y)
:precision binary64
(*
(*
(/
(fma (fma (* y y) 0.008333333333333333 0.16666666666666666) (* y y) 1.0)
x)
y)
(sin x)))
double code(double x, double y) {
return ((fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0) / x) * y) * sin(x);
}
function code(x, y) return Float64(Float64(Float64(fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0) / x) * y) * sin(x)) end
code[x_, y_] := N[(N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right)}{x} \cdot y\right) \cdot \sin x
\end{array}
Initial program 86.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites94.6%
(FPCore (x y) :precision binary64 (* (* (/ (fma (* 0.008333333333333333 (* y y)) (* y y) 1.0) x) y) (sin x)))
double code(double x, double y) {
return ((fma((0.008333333333333333 * (y * y)), (y * y), 1.0) / x) * y) * sin(x);
}
function code(x, y) return Float64(Float64(Float64(fma(Float64(0.008333333333333333 * Float64(y * y)), Float64(y * y), 1.0) / x) * y) * sin(x)) end
code[x_, y_] := N[(N[(N[(N[(N[(0.008333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\mathsf{fma}\left(0.008333333333333333 \cdot \left(y \cdot y\right), y \cdot y, 1\right)}{x} \cdot y\right) \cdot \sin x
\end{array}
Initial program 86.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites94.6%
Taylor expanded in y around inf
Applied rewrites94.4%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* y y)
1.0))
(t_1 (* (* (* (fma -0.16666666666666666 t_0 (/ (/ t_0 x) x)) x) x) y))
(t_2 (/ (* (* t_0 x) y) x)))
(if (<= y -8.2e+60)
t_2
(if (<= y -250.0)
t_1
(if (<= y 520.0) (* (/ (sin x) x) y) (if (<= y 2e+61) t_1 t_2))))))
double code(double x, double y) {
double t_0 = fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0);
double t_1 = ((fma(-0.16666666666666666, t_0, ((t_0 / x) / x)) * x) * x) * y;
double t_2 = ((t_0 * x) * y) / x;
double tmp;
if (y <= -8.2e+60) {
tmp = t_2;
} else if (y <= -250.0) {
tmp = t_1;
} else if (y <= 520.0) {
tmp = (sin(x) / x) * y;
} else if (y <= 2e+61) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y) t_0 = fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0) t_1 = Float64(Float64(Float64(fma(-0.16666666666666666, t_0, Float64(Float64(t_0 / x) / x)) * x) * x) * y) t_2 = Float64(Float64(Float64(t_0 * x) * y) / x) tmp = 0.0 if (y <= -8.2e+60) tmp = t_2; elseif (y <= -250.0) tmp = t_1; elseif (y <= 520.0) tmp = Float64(Float64(sin(x) / x) * y); elseif (y <= 2e+61) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(-0.16666666666666666 * t$95$0 + N[(N[(t$95$0 / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 * x), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -8.2e+60], t$95$2, If[LessEqual[y, -250.0], t$95$1, If[LessEqual[y, 520.0], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 2e+61], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right)\\
t_1 := \left(\left(\mathsf{fma}\left(-0.16666666666666666, t\_0, \frac{\frac{t\_0}{x}}{x}\right) \cdot x\right) \cdot x\right) \cdot y\\
t_2 := \frac{\left(t\_0 \cdot x\right) \cdot y}{x}\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+60}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -250:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 520:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.2e60 or 1.9999999999999999e61 < y Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.0%
Taylor expanded in x around 0
Applied rewrites86.8%
if -8.2e60 < y < -250 or 520 < y < 1.9999999999999999e61Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites5.0%
Taylor expanded in x around 0
Applied rewrites27.7%
Taylor expanded in x around inf
Applied rewrites76.8%
if -250 < y < 520Initial program 75.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6499.0
Applied rewrites99.0%
(FPCore (x y) :precision binary64 (* (* (/ (fma 0.16666666666666666 (* y y) 1.0) x) y) (sin x)))
double code(double x, double y) {
return ((fma(0.16666666666666666, (y * y), 1.0) / x) * y) * sin(x);
}
function code(x, y) return Float64(Float64(Float64(fma(0.16666666666666666, Float64(y * y), 1.0) / x) * y) * sin(x)) end
code[x_, y_] := N[(N[(N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right)}{x} \cdot y\right) \cdot \sin x
\end{array}
Initial program 86.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites94.6%
Taylor expanded in y around 0
Applied rewrites89.7%
(FPCore (x y)
:precision binary64
(if (<= x 9.4e+64)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (fma (* 0.008333333333333333 y) y 0.16666666666666666) (* y y) 1.0))
y)
(if (<= x 1.3e+201)
(/
(*
(fma
(* y (fma 0.008333333333333333 (* x x) -0.16666666666666666))
(* x x)
y)
x)
x)
(/ 0.0 x))))
double code(double x, double y) {
double tmp;
if (x <= 9.4e+64) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma(fma((0.008333333333333333 * y), y, 0.16666666666666666), (y * y), 1.0)) * y;
} else if (x <= 1.3e+201) {
tmp = (fma((y * fma(0.008333333333333333, (x * x), -0.16666666666666666)), (x * x), y) * x) / x;
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 9.4e+64) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(fma(Float64(0.008333333333333333 * y), y, 0.16666666666666666), Float64(y * y), 1.0)) * y); elseif (x <= 1.3e+201) tmp = Float64(Float64(fma(Float64(y * fma(0.008333333333333333, Float64(x * x), -0.16666666666666666)), Float64(x * x), y) * x) / x); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 9.4e+64], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(0.008333333333333333 * y), $MachinePrecision] * y + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 1.3e+201], N[(N[(N[(N[(y * N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] / x), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.4 \cdot 10^{+64}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333 \cdot y, y, 0.16666666666666666\right), y \cdot y, 1\right)\right) \cdot y\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+201}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot \mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x \cdot x, y\right) \cdot x}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 9.40000000000000058e64Initial program 84.0%
Taylor expanded in y around 0
Applied rewrites91.8%
Taylor expanded in x around 0
Applied rewrites68.5%
Applied rewrites68.5%
if 9.40000000000000058e64 < x < 1.29999999999999993e201Initial program 99.7%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6457.6
Applied rewrites57.6%
Taylor expanded in x around 0
Applied rewrites35.9%
if 1.29999999999999993e201 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.0%
Applied rewrites64.0%
Taylor expanded in x around 0
Applied rewrites64.6%
(FPCore (x y)
:precision binary64
(if (<= x 9.4e+64)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (fma (* 0.008333333333333333 y) y 0.16666666666666666) (* y y) 1.0))
y)
(if (<= x 1.3e+201)
(fma
(* y (fma 0.008333333333333333 (* x x) -0.16666666666666666))
(* x x)
y)
(/ 0.0 x))))
double code(double x, double y) {
double tmp;
if (x <= 9.4e+64) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma(fma((0.008333333333333333 * y), y, 0.16666666666666666), (y * y), 1.0)) * y;
} else if (x <= 1.3e+201) {
tmp = fma((y * fma(0.008333333333333333, (x * x), -0.16666666666666666)), (x * x), y);
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 9.4e+64) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(fma(Float64(0.008333333333333333 * y), y, 0.16666666666666666), Float64(y * y), 1.0)) * y); elseif (x <= 1.3e+201) tmp = fma(Float64(y * fma(0.008333333333333333, Float64(x * x), -0.16666666666666666)), Float64(x * x), y); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 9.4e+64], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(0.008333333333333333 * y), $MachinePrecision] * y + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 1.3e+201], N[(N[(y * N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.4 \cdot 10^{+64}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333 \cdot y, y, 0.16666666666666666\right), y \cdot y, 1\right)\right) \cdot y\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+201}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x \cdot x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 9.40000000000000058e64Initial program 84.0%
Taylor expanded in y around 0
Applied rewrites91.8%
Taylor expanded in x around 0
Applied rewrites68.5%
Applied rewrites68.5%
if 9.40000000000000058e64 < x < 1.29999999999999993e201Initial program 99.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6457.7
Applied rewrites57.7%
Taylor expanded in x around 0
Applied rewrites35.9%
if 1.29999999999999993e201 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.0%
Applied rewrites64.0%
Taylor expanded in x around 0
Applied rewrites64.6%
(FPCore (x y)
:precision binary64
(if (<= x 5.3e+200)
(*
(fma (fma (* y y) 0.008333333333333333 0.16666666666666666) (* y y) 1.0)
y)
(/ 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 5.3e+200) {
tmp = fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0) * y;
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 5.3e+200) tmp = Float64(fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0) * y); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 5.3e+200], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.3 \cdot 10^{+200}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 5.29999999999999994e200Initial program 85.5%
Taylor expanded in y around 0
Applied rewrites91.4%
Taylor expanded in x around 0
Applied rewrites65.8%
if 5.29999999999999994e200 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.0%
Applied rewrites64.0%
Taylor expanded in x around 0
Applied rewrites64.6%
(FPCore (x y)
:precision binary64
(if (<= x 1.3e+201)
(fma
(* y (fma 0.008333333333333333 (* x x) -0.16666666666666666))
(* x x)
y)
(/ 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 1.3e+201) {
tmp = fma((y * fma(0.008333333333333333, (x * x), -0.16666666666666666)), (x * x), y);
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 1.3e+201) tmp = fma(Float64(y * fma(0.008333333333333333, Float64(x * x), -0.16666666666666666)), Float64(x * x), y); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 1.3e+201], N[(N[(y * N[(0.008333333333333333 * N[(x * x), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3 \cdot 10^{+201}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \mathsf{fma}\left(0.008333333333333333, x \cdot x, -0.16666666666666666\right), x \cdot x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 1.29999999999999993e201Initial program 85.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6456.9
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites43.9%
if 1.29999999999999993e201 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.0%
Applied rewrites64.0%
Taylor expanded in x around 0
Applied rewrites64.6%
(FPCore (x y) :precision binary64 (if (<= x 7e+62) (* (fma -0.16666666666666666 (* x x) 1.0) y) (/ 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 7e+62) {
tmp = fma(-0.16666666666666666, (x * x), 1.0) * y;
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 7e+62) tmp = Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * y); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 7e+62], N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 6.99999999999999967e62Initial program 84.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6456.6
Applied rewrites56.6%
Taylor expanded in x around 0
Applied rewrites42.1%
if 6.99999999999999967e62 < x Initial program 99.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites89.7%
Applied rewrites40.1%
Taylor expanded in x around 0
Applied rewrites41.0%
(FPCore (x y) :precision binary64 (if (<= x 1.1e+15) (* 1.0 y) (/ 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 1.1e+15) {
tmp = 1.0 * y;
} else {
tmp = 0.0 / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.1d+15) then
tmp = 1.0d0 * y
else
tmp = 0.0d0 / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.1e+15) {
tmp = 1.0 * y;
} else {
tmp = 0.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.1e+15: tmp = 1.0 * y else: tmp = 0.0 / x return tmp
function code(x, y) tmp = 0.0 if (x <= 1.1e+15) tmp = Float64(1.0 * y); else tmp = Float64(0.0 / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.1e+15) tmp = 1.0 * y; else tmp = 0.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.1e+15], N[(1.0 * y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.1 \cdot 10^{+15}:\\
\;\;\;\;1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 1.1e15Initial program 83.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6456.4
Applied rewrites56.4%
Taylor expanded in x around 0
Applied rewrites41.0%
if 1.1e15 < x Initial program 99.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.2%
Applied rewrites32.5%
Taylor expanded in x around 0
Applied rewrites33.5%
(FPCore (x y) :precision binary64 (* 1.0 y))
double code(double x, double y) {
return 1.0 * y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 * y
end function
public static double code(double x, double y) {
return 1.0 * y;
}
def code(x, y): return 1.0 * y
function code(x, y) return Float64(1.0 * y) end
function tmp = code(x, y) tmp = 1.0 * y; end
code[x_, y_] := N[(1.0 * y), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot y
\end{array}
Initial program 86.3%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6457.7
Applied rewrites57.7%
Taylor expanded in x around 0
Applied rewrites33.9%
(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 2024339
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (* (sin x) (/ (sinh y) x)))
(/ (* (sin x) (sinh y)) x))