
(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 18 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 90.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -0.005)
(/
(*
(fma
(* (* (fma (* y y) 0.008333333333333333 0.16666666666666666) y) y)
x
x)
y)
x)
(if (<= t_0 1e-80)
(* (/ (sin x) x) y)
(*
(fma
(fma (fabs (* 0.008333333333333333 y)) y 0.16666666666666666)
(* y y)
1.0)
y)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -0.005) {
tmp = (fma(((fma((y * y), 0.008333333333333333, 0.16666666666666666) * y) * y), x, x) * y) / x;
} else if (t_0 <= 1e-80) {
tmp = (sin(x) / x) * y;
} else {
tmp = fma(fma(fabs((0.008333333333333333 * y)), y, 0.16666666666666666), (y * y), 1.0) * y;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -0.005) tmp = Float64(Float64(fma(Float64(Float64(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666) * y) * y), x, x) * y) / x); elseif (t_0 <= 1e-80) tmp = Float64(Float64(sin(x) / x) * y); else tmp = Float64(fma(fma(abs(Float64(0.008333333333333333 * y)), y, 0.16666666666666666), Float64(y * y), 1.0) * y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, -0.005], N[(N[(N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision] * x + x), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 1e-80], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(N[Abs[N[(0.008333333333333333 * y), $MachinePrecision]], $MachinePrecision] * y + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -0.005:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right) \cdot y\right) \cdot y, x, x\right) \cdot y}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{-80}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left|0.008333333333333333 \cdot y\right|, y, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -0.0050000000000000001Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.1%
Taylor expanded in x around 0
Applied rewrites59.8%
Applied rewrites59.8%
if -0.0050000000000000001 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.99999999999999961e-81Initial program 77.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if 9.99999999999999961e-81 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.8%
Taylor expanded in y around 0
Applied rewrites76.3%
Taylor expanded in x around 0
Applied rewrites62.6%
Applied rewrites80.9%
Final simplification82.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (- (exp y) (exp (- y))) 0.5))
(t_1
(*
(sin x)
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* y y)
1.0)))
(t_2 (/ (* t_1 y) x)))
(if (<= y -1.35e+62)
t_2
(if (<= y -1.35)
t_0
(if (<= y 0.5) (* (/ t_1 x) y) (if (<= y 1.3e+52) t_0 t_2))))))
double code(double x, double y) {
double t_0 = (exp(y) - exp(-y)) * 0.5;
double t_1 = sin(x) * fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0);
double t_2 = (t_1 * y) / x;
double tmp;
if (y <= -1.35e+62) {
tmp = t_2;
} else if (y <= -1.35) {
tmp = t_0;
} else if (y <= 0.5) {
tmp = (t_1 / x) * y;
} else if (y <= 1.3e+52) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(exp(y) - exp(Float64(-y))) * 0.5) t_1 = Float64(sin(x) * fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0)) t_2 = Float64(Float64(t_1 * y) / x) tmp = 0.0 if (y <= -1.35e+62) tmp = t_2; elseif (y <= -1.35) tmp = t_0; elseif (y <= 0.5) tmp = Float64(Float64(t_1 / x) * y); elseif (y <= 1.3e+52) tmp = t_0; else tmp = t_2; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Exp[y], $MachinePrecision] - N[Exp[(-y)], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[x], $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * y), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -1.35e+62], t$95$2, If[LessEqual[y, -1.35], t$95$0, If[LessEqual[y, 0.5], N[(N[(t$95$1 / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 1.3e+52], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{y} - e^{-y}\right) \cdot 0.5\\
t_1 := \sin x \cdot \mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right)\\
t_2 := \frac{t\_1 \cdot y}{x}\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+62}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.35:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.5:\\
\;\;\;\;\frac{t\_1}{x} \cdot y\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+52}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.35e62 or 1.3e52 < y Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.2%
if -1.35e62 < y < -1.3500000000000001 or 0.5 < y < 1.3e52Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6493.1
Applied rewrites93.1%
if -1.3500000000000001 < y < 0.5Initial program 79.2%
Taylor expanded in y around 0
Applied rewrites99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0
(* (fma 0.008333333333333333 (* y y) 0.16666666666666666) (* y y)))
(t_1 (* (/ (* (fma (* y y) 0.16666666666666666 1.0) (sin x)) x) y))
(t_2 (* -0.008333333333333333 (* y y))))
(if (<= y -6.5e+152)
t_1
(if (<= y -1e+79)
(*
(fma
(/ (- 0.027777777777777776 (* t_2 t_2)) (+ 0.16666666666666666 t_2))
(* y y)
1.0)
y)
(if (<= y -0.0014)
(* (/ (- 1.0 (* t_0 t_0)) (- 1.0 t_0)) y)
(if (<= y 8.6e+49)
(* (/ y x) (sin x))
(if (<= y 7e+136)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* y y)
1.0))
y)
t_1)))))))
double code(double x, double y) {
double t_0 = fma(0.008333333333333333, (y * y), 0.16666666666666666) * (y * y);
double t_1 = ((fma((y * y), 0.16666666666666666, 1.0) * sin(x)) / x) * y;
double t_2 = -0.008333333333333333 * (y * y);
double tmp;
if (y <= -6.5e+152) {
tmp = t_1;
} else if (y <= -1e+79) {
tmp = fma(((0.027777777777777776 - (t_2 * t_2)) / (0.16666666666666666 + t_2)), (y * y), 1.0) * y;
} else if (y <= -0.0014) {
tmp = ((1.0 - (t_0 * t_0)) / (1.0 - t_0)) * y;
} else if (y <= 8.6e+49) {
tmp = (y / x) * sin(x);
} else if (y <= 7e+136) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(fma(0.008333333333333333, Float64(y * y), 0.16666666666666666) * Float64(y * y)) t_1 = Float64(Float64(Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * sin(x)) / x) * y) t_2 = Float64(-0.008333333333333333 * Float64(y * y)) tmp = 0.0 if (y <= -6.5e+152) tmp = t_1; elseif (y <= -1e+79) tmp = Float64(fma(Float64(Float64(0.027777777777777776 - Float64(t_2 * t_2)) / Float64(0.16666666666666666 + t_2)), Float64(y * y), 1.0) * y); elseif (y <= -0.0014) tmp = Float64(Float64(Float64(1.0 - Float64(t_0 * t_0)) / Float64(1.0 - t_0)) * y); elseif (y <= 8.6e+49) tmp = Float64(Float64(y / x) * sin(x)); elseif (y <= 7e+136) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0)) * y); else tmp = t_1; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(0.008333333333333333 * N[(y * y), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(-0.008333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.5e+152], t$95$1, If[LessEqual[y, -1e+79], N[(N[(N[(N[(0.027777777777777776 - N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision] / N[(0.16666666666666666 + t$95$2), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -0.0014], N[(N[(N[(1.0 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 8.6e+49], N[(N[(y / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+136], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.008333333333333333, y \cdot y, 0.16666666666666666\right) \cdot \left(y \cdot y\right)\\
t_1 := \frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \sin x}{x} \cdot y\\
t_2 := -0.008333333333333333 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(\frac{0.027777777777777776 - t\_2 \cdot t\_2}{0.16666666666666666 + t\_2}, y \cdot y, 1\right) \cdot y\\
\mathbf{elif}\;y \leq -0.0014:\\
\;\;\;\;\frac{1 - t\_0 \cdot t\_0}{1 - t\_0} \cdot y\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+49}:\\
\;\;\;\;\frac{y}{x} \cdot \sin x\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+136}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right)\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.4999999999999997e152 or 7.00000000000000002e136 < y Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in y around 0
Applied rewrites98.6%
if -6.4999999999999997e152 < y < -9.99999999999999967e78Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites94.7%
Applied rewrites94.7%
if -9.99999999999999967e78 < y < -0.00139999999999999999Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites10.2%
Taylor expanded in x around 0
Applied rewrites10.7%
Applied rewrites54.5%
if -0.00139999999999999999 < y < 8.5999999999999998e49Initial program 81.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
lower-/.f6491.5
Applied rewrites91.5%
if 8.5999999999999998e49 < y < 7.00000000000000002e136Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites65.1%
Taylor expanded in x around 0
Applied rewrites75.0%
Final simplification90.2%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* y y)
1.0)))
(if (<= x 2.02e-32)
(* (* (/ t_0 x) y) (sin x))
(/ (* (* (sin x) t_0) y) x))))
double code(double x, double y) {
double t_0 = fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0);
double tmp;
if (x <= 2.02e-32) {
tmp = ((t_0 / x) * y) * sin(x);
} else {
tmp = ((sin(x) * t_0) * y) / x;
}
return tmp;
}
function code(x, y) t_0 = fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0) tmp = 0.0 if (x <= 2.02e-32) tmp = Float64(Float64(Float64(t_0 / x) * y) * sin(x)); else tmp = Float64(Float64(Float64(sin(x) * t_0) * y) / x); 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]}, If[LessEqual[x, 2.02e-32], N[(N[(N[(t$95$0 / x), $MachinePrecision] * y), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]]]
\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)\\
\mathbf{if}\;x \leq 2.02 \cdot 10^{-32}:\\
\;\;\;\;\left(\frac{t\_0}{x} \cdot y\right) \cdot \sin x\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sin x \cdot t\_0\right) \cdot y}{x}\\
\end{array}
\end{array}
if x < 2.0200000000000001e-32Initial program 86.1%
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 rewrites89.8%
if 2.0200000000000001e-32 < x Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (fma (* y y) 0.16666666666666666 1.0)))
(if (<= y 7.2e+50)
(* (* (/ t_0 x) y) (sin x))
(if (<= y 7e+136)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma
(fma (* y y) 0.008333333333333333 0.16666666666666666)
(* y y)
1.0))
y)
(* (/ (* t_0 (sin x)) x) y)))))
double code(double x, double y) {
double t_0 = fma((y * y), 0.16666666666666666, 1.0);
double tmp;
if (y <= 7.2e+50) {
tmp = ((t_0 / x) * y) * sin(x);
} else if (y <= 7e+136) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0)) * y;
} else {
tmp = ((t_0 * sin(x)) / x) * y;
}
return tmp;
}
function code(x, y) t_0 = fma(Float64(y * y), 0.16666666666666666, 1.0) tmp = 0.0 if (y <= 7.2e+50) tmp = Float64(Float64(Float64(t_0 / x) * y) * sin(x)); elseif (y <= 7e+136) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0)) * y); else tmp = Float64(Float64(Float64(t_0 * sin(x)) / x) * y); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]}, If[LessEqual[y, 7.2e+50], N[(N[(N[(t$95$0 / x), $MachinePrecision] * y), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+136], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(t$95$0 * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\\
\mathbf{if}\;y \leq 7.2 \cdot 10^{+50}:\\
\;\;\;\;\left(\frac{t\_0}{x} \cdot y\right) \cdot \sin x\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+136}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right)\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot \sin x}{x} \cdot y\\
\end{array}
\end{array}
if y < 7.19999999999999972e50Initial program 87.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites90.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
Applied rewrites87.0%
if 7.19999999999999972e50 < y < 7.00000000000000002e136Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites65.1%
Taylor expanded in x around 0
Applied rewrites75.0%
if 7.00000000000000002e136 < y Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in y around 0
Applied rewrites97.2%
(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 90.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites90.4%
(FPCore (x y) :precision binary64 (* (* (/ (fma (* (* y y) 0.008333333333333333) (* y y) 1.0) x) y) (sin x)))
double code(double x, double y) {
return ((fma(((y * y) * 0.008333333333333333), (y * y), 1.0) / x) * y) * sin(x);
}
function code(x, y) return Float64(Float64(Float64(fma(Float64(Float64(y * y) * 0.008333333333333333), Float64(y * y), 1.0) / x) * y) * sin(x)) end
code[x_, y_] := N[(N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $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(\left(y \cdot y\right) \cdot 0.008333333333333333, y \cdot y, 1\right)}{x} \cdot y\right) \cdot \sin x
\end{array}
Initial program 90.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites90.4%
Taylor expanded in y around inf
Applied rewrites90.1%
(FPCore (x y)
:precision binary64
(if (<= x 4.5e+16)
(*
(*
(fma -0.16666666666666666 (* x x) 1.0)
(fma (fma (* y y) 0.008333333333333333 0.16666666666666666) (* y y) 1.0))
y)
(* (pow y 5.0) 0.008333333333333333)))
double code(double x, double y) {
double tmp;
if (x <= 4.5e+16) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0)) * y;
} else {
tmp = pow(y, 5.0) * 0.008333333333333333;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 4.5e+16) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0)) * y); else tmp = Float64((y ^ 5.0) * 0.008333333333333333); end return tmp end
code[x_, y_] := If[LessEqual[x, 4.5e+16], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[Power[y, 5.0], $MachinePrecision] * 0.008333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5 \cdot 10^{+16}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right)\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;{y}^{5} \cdot 0.008333333333333333\\
\end{array}
\end{array}
if x < 4.5e16Initial program 86.7%
Taylor expanded in y around 0
Applied rewrites84.5%
Taylor expanded in x around 0
Applied rewrites63.6%
if 4.5e16 < x Initial program 99.9%
Taylor expanded in y around 0
Applied rewrites92.6%
Taylor expanded in x around 0
Applied rewrites29.8%
Taylor expanded in y around inf
Applied rewrites47.0%
(FPCore (x y)
:precision binary64
(if (<= x 7.8e+84)
(fma (* (fma (* y y) 0.008333333333333333 0.16666666666666666) y) (* y y) y)
(if (<= x 5.8e+147)
(/ (* (* (fma (* -0.16666666666666666 x) x 1.0) x) y) x)
(if (<= x 4.47e+229)
(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 <= 7.8e+84) {
tmp = fma((fma((y * y), 0.008333333333333333, 0.16666666666666666) * y), (y * y), y);
} else if (x <= 5.8e+147) {
tmp = ((fma((-0.16666666666666666 * x), x, 1.0) * x) * y) / x;
} else if (x <= 4.47e+229) {
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 <= 7.8e+84) tmp = fma(Float64(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666) * y), Float64(y * y), y); elseif (x <= 5.8e+147) tmp = Float64(Float64(Float64(fma(Float64(-0.16666666666666666 * x), x, 1.0) * x) * y) / x); elseif (x <= 4.47e+229) 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, 7.8e+84], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision] * N[(y * y), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[x, 5.8e+147], N[(N[(N[(N[(N[(-0.16666666666666666 * x), $MachinePrecision] * x + 1.0), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 4.47e+229], 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 7.8 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right) \cdot y, y \cdot y, y\right)\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+147}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\right) \cdot y}{x}\\
\mathbf{elif}\;x \leq 4.47 \cdot 10^{+229}:\\
\;\;\;\;\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 < 7.80000000000000032e84Initial program 87.4%
Taylor expanded in y around 0
Applied rewrites85.2%
Taylor expanded in x around 0
Applied rewrites62.5%
Applied rewrites62.5%
if 7.80000000000000032e84 < x < 5.7999999999999997e147Initial program 99.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6451.5
Applied rewrites51.5%
Applied rewrites16.1%
Taylor expanded in x around 0
Applied rewrites36.0%
if 5.7999999999999997e147 < x < 4.46999999999999997e229Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6441.7
Applied rewrites41.7%
Taylor expanded in x around 0
Applied rewrites35.6%
if 4.46999999999999997e229 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6451.3
Applied rewrites51.3%
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites49.5%
(FPCore (x y)
:precision binary64
(if (<= x 9.2e+107)
(fma (* (fma (* y y) 0.008333333333333333 0.16666666666666666) y) (* y y) y)
(if (<= x 5.8e+147)
(fma (* y -0.16666666666666666) (* x x) y)
(if (<= x 4.47e+229)
(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.2e+107) {
tmp = fma((fma((y * y), 0.008333333333333333, 0.16666666666666666) * y), (y * y), y);
} else if (x <= 5.8e+147) {
tmp = fma((y * -0.16666666666666666), (x * x), y);
} else if (x <= 4.47e+229) {
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.2e+107) tmp = fma(Float64(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666) * y), Float64(y * y), y); elseif (x <= 5.8e+147) tmp = fma(Float64(y * -0.16666666666666666), Float64(x * x), y); elseif (x <= 4.47e+229) 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.2e+107], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision] * N[(y * y), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[x, 5.8e+147], N[(N[(y * -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[x, 4.47e+229], 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.2 \cdot 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right) \cdot y, y \cdot y, y\right)\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.16666666666666666, x \cdot x, y\right)\\
\mathbf{elif}\;x \leq 4.47 \cdot 10^{+229}:\\
\;\;\;\;\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.2000000000000001e107Initial program 87.9%
Taylor expanded in y around 0
Applied rewrites84.9%
Taylor expanded in x around 0
Applied rewrites60.9%
Applied rewrites60.9%
if 9.2000000000000001e107 < x < 5.7999999999999997e147Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6455.7
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
Applied rewrites10.0%
Taylor expanded in x around 0
Applied rewrites37.6%
if 5.7999999999999997e147 < x < 4.46999999999999997e229Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6441.7
Applied rewrites41.7%
Taylor expanded in x around 0
Applied rewrites35.6%
if 4.46999999999999997e229 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6451.3
Applied rewrites51.3%
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites49.5%
(FPCore (x y)
:precision binary64
(if (<= x 9.2e+107)
(* (fma (* (* y y) 0.008333333333333333) (* y y) 1.0) y)
(if (<= x 5.8e+147)
(fma (* y -0.16666666666666666) (* x x) y)
(if (<= x 4.47e+229)
(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.2e+107) {
tmp = fma(((y * y) * 0.008333333333333333), (y * y), 1.0) * y;
} else if (x <= 5.8e+147) {
tmp = fma((y * -0.16666666666666666), (x * x), y);
} else if (x <= 4.47e+229) {
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.2e+107) tmp = Float64(fma(Float64(Float64(y * y) * 0.008333333333333333), Float64(y * y), 1.0) * y); elseif (x <= 5.8e+147) tmp = fma(Float64(y * -0.16666666666666666), Float64(x * x), y); elseif (x <= 4.47e+229) 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.2e+107], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 5.8e+147], N[(N[(y * -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[x, 4.47e+229], 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.2 \cdot 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot 0.008333333333333333, y \cdot y, 1\right) \cdot y\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.16666666666666666, x \cdot x, y\right)\\
\mathbf{elif}\;x \leq 4.47 \cdot 10^{+229}:\\
\;\;\;\;\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.2000000000000001e107Initial program 87.9%
Taylor expanded in y around 0
Applied rewrites84.9%
Taylor expanded in x around 0
Applied rewrites60.8%
Taylor expanded in y around inf
Applied rewrites60.6%
if 9.2000000000000001e107 < x < 5.7999999999999997e147Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6455.7
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
Applied rewrites10.0%
Taylor expanded in x around 0
Applied rewrites37.6%
if 5.7999999999999997e147 < x < 4.46999999999999997e229Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6441.7
Applied rewrites41.7%
Taylor expanded in x around 0
Applied rewrites35.6%
if 4.46999999999999997e229 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6451.3
Applied rewrites51.3%
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites49.5%
(FPCore (x y)
:precision binary64
(if (<= x 9.2e+107)
(* (fma (* (* y y) 0.008333333333333333) (* y y) 1.0) y)
(if (<= x 5.8e+147)
(fma (* y -0.16666666666666666) (* x x) y)
(if (<= x 4.47e+229)
(fma (* y (* (* x x) 0.008333333333333333)) (* x x) y)
(/ 0.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= 9.2e+107) {
tmp = fma(((y * y) * 0.008333333333333333), (y * y), 1.0) * y;
} else if (x <= 5.8e+147) {
tmp = fma((y * -0.16666666666666666), (x * x), y);
} else if (x <= 4.47e+229) {
tmp = fma((y * ((x * x) * 0.008333333333333333)), (x * x), y);
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 9.2e+107) tmp = Float64(fma(Float64(Float64(y * y) * 0.008333333333333333), Float64(y * y), 1.0) * y); elseif (x <= 5.8e+147) tmp = fma(Float64(y * -0.16666666666666666), Float64(x * x), y); elseif (x <= 4.47e+229) tmp = fma(Float64(y * Float64(Float64(x * x) * 0.008333333333333333)), Float64(x * x), y); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 9.2e+107], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 5.8e+147], N[(N[(y * -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[x, 4.47e+229], N[(N[(y * N[(N[(x * x), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.2 \cdot 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot 0.008333333333333333, y \cdot y, 1\right) \cdot y\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.16666666666666666, x \cdot x, y\right)\\
\mathbf{elif}\;x \leq 4.47 \cdot 10^{+229}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(\left(x \cdot x\right) \cdot 0.008333333333333333\right), x \cdot x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 9.2000000000000001e107Initial program 87.9%
Taylor expanded in y around 0
Applied rewrites84.9%
Taylor expanded in x around 0
Applied rewrites60.8%
Taylor expanded in y around inf
Applied rewrites60.6%
if 9.2000000000000001e107 < x < 5.7999999999999997e147Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6455.7
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
Applied rewrites10.0%
Taylor expanded in x around 0
Applied rewrites37.6%
if 5.7999999999999997e147 < x < 4.46999999999999997e229Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6441.7
Applied rewrites41.7%
Taylor expanded in x around 0
Applied rewrites3.8%
Taylor expanded in x around 0
Applied rewrites35.6%
Taylor expanded in x around inf
Applied rewrites35.6%
if 4.46999999999999997e229 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6451.3
Applied rewrites51.3%
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites49.5%
(FPCore (x y)
:precision binary64
(if (<= x 9.2e+107)
(* (fma 0.16666666666666666 (* y y) 1.0) y)
(if (<= x 5.8e+147)
(fma (* y -0.16666666666666666) (* x x) y)
(if (<= x 4.47e+229)
(fma (* y (* (* x x) 0.008333333333333333)) (* x x) y)
(/ 0.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= 9.2e+107) {
tmp = fma(0.16666666666666666, (y * y), 1.0) * y;
} else if (x <= 5.8e+147) {
tmp = fma((y * -0.16666666666666666), (x * x), y);
} else if (x <= 4.47e+229) {
tmp = fma((y * ((x * x) * 0.008333333333333333)), (x * x), y);
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 9.2e+107) tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * y); elseif (x <= 5.8e+147) tmp = fma(Float64(y * -0.16666666666666666), Float64(x * x), y); elseif (x <= 4.47e+229) tmp = fma(Float64(y * Float64(Float64(x * x) * 0.008333333333333333)), Float64(x * x), y); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 9.2e+107], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 5.8e+147], N[(N[(y * -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[x, 4.47e+229], N[(N[(y * N[(N[(x * x), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.2 \cdot 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot y\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.16666666666666666, x \cdot x, y\right)\\
\mathbf{elif}\;x \leq 4.47 \cdot 10^{+229}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(\left(x \cdot x\right) \cdot 0.008333333333333333\right), x \cdot x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 9.2000000000000001e107Initial program 87.9%
Taylor expanded in y around 0
Applied rewrites84.9%
Taylor expanded in x around 0
Applied rewrites60.8%
Taylor expanded in y around 0
Applied rewrites57.5%
if 9.2000000000000001e107 < x < 5.7999999999999997e147Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6455.7
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
Applied rewrites10.0%
Taylor expanded in x around 0
Applied rewrites37.6%
if 5.7999999999999997e147 < x < 4.46999999999999997e229Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6441.7
Applied rewrites41.7%
Taylor expanded in x around 0
Applied rewrites3.8%
Taylor expanded in x around 0
Applied rewrites35.6%
Taylor expanded in x around inf
Applied rewrites35.6%
if 4.46999999999999997e229 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6451.3
Applied rewrites51.3%
Applied rewrites49.0%
Taylor expanded in x around 0
Applied rewrites49.5%
(FPCore (x y) :precision binary64 (if (<= x 9.2e+107) (* (fma 0.16666666666666666 (* y y) 1.0) y) (if (<= x 9e+228) (fma (* y -0.16666666666666666) (* x x) y) (/ 0.0 x))))
double code(double x, double y) {
double tmp;
if (x <= 9.2e+107) {
tmp = fma(0.16666666666666666, (y * y), 1.0) * y;
} else if (x <= 9e+228) {
tmp = fma((y * -0.16666666666666666), (x * x), y);
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 9.2e+107) tmp = Float64(fma(0.16666666666666666, Float64(y * y), 1.0) * y); elseif (x <= 9e+228) tmp = fma(Float64(y * -0.16666666666666666), Float64(x * x), y); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 9.2e+107], N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 9e+228], N[(N[(y * -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.2 \cdot 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, 1\right) \cdot y\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.16666666666666666, x \cdot x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 9.2000000000000001e107Initial program 87.9%
Taylor expanded in y around 0
Applied rewrites84.9%
Taylor expanded in x around 0
Applied rewrites60.8%
Taylor expanded in y around 0
Applied rewrites57.5%
if 9.2000000000000001e107 < x < 8.99999999999999966e228Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6448.1
Applied rewrites48.1%
Taylor expanded in x around 0
Applied rewrites3.5%
Taylor expanded in x around 0
Applied rewrites24.1%
Taylor expanded in x around 0
Applied rewrites30.9%
if 8.99999999999999966e228 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6448.5
Applied rewrites48.5%
Applied rewrites46.2%
Taylor expanded in x around 0
Applied rewrites46.7%
(FPCore (x y) :precision binary64 (if (<= x 9e+228) (fma (* y -0.16666666666666666) (* x x) y) (/ 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 9e+228) {
tmp = fma((y * -0.16666666666666666), (x * x), y);
} else {
tmp = 0.0 / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 9e+228) tmp = fma(Float64(y * -0.16666666666666666), Float64(x * x), y); else tmp = Float64(0.0 / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 9e+228], N[(N[(y * -0.16666666666666666), $MachinePrecision] * N[(x * x), $MachinePrecision] + y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.16666666666666666, x \cdot x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 8.99999999999999966e228Initial program 89.4%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6449.5
Applied rewrites49.5%
Taylor expanded in x around 0
Applied rewrites28.4%
Taylor expanded in x around 0
Applied rewrites39.7%
Taylor expanded in x around 0
Applied rewrites37.7%
if 8.99999999999999966e228 < x Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6448.5
Applied rewrites48.5%
Applied rewrites46.2%
Taylor expanded in x around 0
Applied rewrites46.7%
(FPCore (x y) :precision binary64 (if (<= x 7.4e+55) (* 1.0 y) (/ 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 7.4e+55) {
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 <= 7.4d+55) 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 <= 7.4e+55) {
tmp = 1.0 * y;
} else {
tmp = 0.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 7.4e+55: tmp = 1.0 * y else: tmp = 0.0 / x return tmp
function code(x, y) tmp = 0.0 if (x <= 7.4e+55) 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 <= 7.4e+55) tmp = 1.0 * y; else tmp = 0.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 7.4e+55], N[(1.0 * y), $MachinePrecision], N[(0.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.4 \cdot 10^{+55}:\\
\;\;\;\;1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{x}\\
\end{array}
\end{array}
if x < 7.4000000000000004e55Initial program 87.2%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6450.0
Applied rewrites50.0%
Taylor expanded in x around 0
Applied rewrites33.6%
if 7.4000000000000004e55 < x Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Applied rewrites22.9%
Taylor expanded in x around 0
Applied rewrites23.8%
(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 90.1%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6449.4
Applied rewrites49.4%
Taylor expanded in x around 0
Applied rewrites26.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 2024337
(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))