
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= z_m 1.12e+24)
(/ (* (cosh x) (/ y z_m)) x)
(* y (/ (/ (cosh x) x) z_m)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (z_m <= 1.12e+24) {
tmp = (cosh(x) * (y / z_m)) / x;
} else {
tmp = y * ((cosh(x) / x) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (z_m <= 1.12d+24) then
tmp = (cosh(x) * (y / z_m)) / x
else
tmp = y * ((cosh(x) / x) / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (z_m <= 1.12e+24) {
tmp = (Math.cosh(x) * (y / z_m)) / x;
} else {
tmp = y * ((Math.cosh(x) / x) / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if z_m <= 1.12e+24: tmp = (math.cosh(x) * (y / z_m)) / x else: tmp = y * ((math.cosh(x) / x) / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (z_m <= 1.12e+24) tmp = Float64(Float64(cosh(x) * Float64(y / z_m)) / x); else tmp = Float64(y * Float64(Float64(cosh(x) / x) / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (z_m <= 1.12e+24) tmp = (cosh(x) * (y / z_m)) / x; else tmp = y * ((cosh(x) / x) / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[z$95$m, 1.12e+24], N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / z$95$m), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 1.12 \cdot 10^{+24}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{z\_m}}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{x}}{z\_m}\\
\end{array}
\end{array}
if z < 1.12e24Initial program 83.1%
div-invN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
associate-*l*N/A
div-invN/A
*-lowering-*.f64N/A
cosh-lowering-cosh.f64N/A
/-lowering-/.f6493.5
Applied egg-rr93.5%
if 1.12e24 < z Initial program 87.6%
*-commutativeN/A
div-invN/A
associate-*l*N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f6499.8
Applied egg-rr99.8%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= (* (cosh x) (/ y x)) 2e+203)
(*
(/ y x)
(/
(fma (fma x x 0.0) (fma x (fma x 0.041666666666666664 0.0) 0.5) 1.0)
z_m))
(* y (/ (/ (cosh x) x) z_m)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if ((cosh(x) * (y / x)) <= 2e+203) {
tmp = (y / x) * (fma(fma(x, x, 0.0), fma(x, fma(x, 0.041666666666666664, 0.0), 0.5), 1.0) / z_m);
} else {
tmp = y * ((cosh(x) / x) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (Float64(cosh(x) * Float64(y / x)) <= 2e+203) tmp = Float64(Float64(y / x) * Float64(fma(fma(x, x, 0.0), fma(x, fma(x, 0.041666666666666664, 0.0), 0.5), 1.0) / z_m)); else tmp = Float64(y * Float64(Float64(cosh(x) / x) / z_m)); end return Float64(z_s * tmp) end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], 2e+203], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(x * x + 0.0), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664 + 0.0), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{y}{x} \leq 2 \cdot 10^{+203}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(x, x, 0\right), \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.041666666666666664, 0\right), 0.5\right), 1\right)}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{x}}{z\_m}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < 2e203Initial program 94.6%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6488.7
Simplified88.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr89.3%
if 2e203 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 65.1%
*-commutativeN/A
div-invN/A
associate-*l*N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f6499.9
Applied egg-rr99.9%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= (/ (* (cosh x) (/ y x)) z_m) 1e-98)
(/ y (* z_m x))
(/
(/
(*
y
(fma
(* x x)
(fma
(* x x)
(fma (* x x) 0.001388888888888889 0.041666666666666664)
0.5)
1.0))
z_m)
x))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (((cosh(x) * (y / x)) / z_m) <= 1e-98) {
tmp = y / (z_m * x);
} else {
tmp = ((y * fma((x * x), fma((x * x), fma((x * x), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0)) / z_m) / x;
}
return z_s * tmp;
}
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y / x)) / z_m) <= 1e-98) tmp = Float64(y / Float64(z_m * x)); else tmp = Float64(Float64(Float64(y * fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0)) / z_m) / x); end return Float64(z_s * tmp) end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], 1e-98], N[(y / N[(z$95$m * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z\_m} \leq 10^{-98}:\\
\;\;\;\;\frac{y}{z\_m \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{z\_m}}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 9.99999999999999939e-99Initial program 93.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6458.7
Simplified58.7%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6458.7
Applied egg-rr58.7%
if 9.99999999999999939e-99 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 73.9%
*-commutativeN/A
div-invN/A
associate-*l*N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f6493.8
Applied egg-rr93.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified89.0%
associate-/r*N/A
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr95.9%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6495.9
Simplified95.9%
Final simplification76.4%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= (/ (* (cosh x) (/ y x)) z_m) 2e+305)
(/
(/ (* y (fma x (* x (fma (* x x) 0.041666666666666664 0.5)) 1.0)) x)
z_m)
(*
y
(/
(/
(fma
(* x x)
(fma
x
(* x (fma (* x x) 0.001388888888888889 0.041666666666666664))
0.5)
1.0)
x)
z_m)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (((cosh(x) * (y / x)) / z_m) <= 2e+305) {
tmp = ((y * fma(x, (x * fma((x * x), 0.041666666666666664, 0.5)), 1.0)) / x) / z_m;
} else {
tmp = y * ((fma((x * x), fma(x, (x * fma((x * x), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0) / x) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y / x)) / z_m) <= 2e+305) tmp = Float64(Float64(Float64(y * fma(x, Float64(x * fma(Float64(x * x), 0.041666666666666664, 0.5)), 1.0)) / x) / z_m); else tmp = Float64(y * Float64(Float64(fma(Float64(x * x), fma(x, Float64(x * fma(Float64(x * x), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0) / x) / z_m)); end return Float64(z_s * tmp) end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], 2e+305], N[(N[(N[(y * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y * N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z\_m} \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\frac{\frac{y \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, 0.041666666666666664, 0.5\right), 1\right)}{x}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{x}}{z\_m}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1.9999999999999999e305Initial program 94.7%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6489.0
Simplified89.0%
Taylor expanded in x around 0
*-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-inN/A
/-lowering-/.f64N/A
Simplified89.0%
if 1.9999999999999999e305 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 63.5%
*-commutativeN/A
div-invN/A
associate-*l*N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified93.3%
Final simplification90.5%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= (* (cosh x) (/ y x)) 5e+204)
(*
(/ y x)
(/
(fma (fma x x 0.0) (fma x (fma x 0.041666666666666664 0.0) 0.5) 1.0)
z_m))
(*
y
(/
(/ (fma (* x x) (* x (* 0.001388888888888889 (* x (* x x)))) 1.0) x)
z_m)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if ((cosh(x) * (y / x)) <= 5e+204) {
tmp = (y / x) * (fma(fma(x, x, 0.0), fma(x, fma(x, 0.041666666666666664, 0.0), 0.5), 1.0) / z_m);
} else {
tmp = y * ((fma((x * x), (x * (0.001388888888888889 * (x * (x * x)))), 1.0) / x) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (Float64(cosh(x) * Float64(y / x)) <= 5e+204) tmp = Float64(Float64(y / x) * Float64(fma(fma(x, x, 0.0), fma(x, fma(x, 0.041666666666666664, 0.0), 0.5), 1.0) / z_m)); else tmp = Float64(y * Float64(Float64(fma(Float64(x * x), Float64(x * Float64(0.001388888888888889 * Float64(x * Float64(x * x)))), 1.0) / x) / z_m)); end return Float64(z_s * tmp) end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], 5e+204], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(x * x + 0.0), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664 + 0.0), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(0.001388888888888889 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{y}{x} \leq 5 \cdot 10^{+204}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(x, x, 0\right), \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.041666666666666664, 0\right), 0.5\right), 1\right)}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{\mathsf{fma}\left(x \cdot x, x \cdot \left(0.001388888888888889 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), 1\right)}{x}}{z\_m}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < 5.00000000000000008e204Initial program 94.6%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6488.8
Simplified88.8%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr89.4%
if 5.00000000000000008e204 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 64.8%
*-commutativeN/A
div-invN/A
associate-*l*N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified93.4%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6493.4
Simplified93.4%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= x 0.00028)
(/
(*
(/ y z_m)
(fma x (* x (fma x (fma x 0.041666666666666664 0.0) 0.5)) 1.0))
x)
(if (<= x 1.25e+48)
(* y (/ (cosh x) (* z_m x)))
(/
(/
(*
y
(fma
(* x x)
(fma
(* x x)
(fma (* x x) 0.001388888888888889 0.041666666666666664)
0.5)
1.0))
z_m)
x)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00028) {
tmp = ((y / z_m) * fma(x, (x * fma(x, fma(x, 0.041666666666666664, 0.0), 0.5)), 1.0)) / x;
} else if (x <= 1.25e+48) {
tmp = y * (cosh(x) / (z_m * x));
} else {
tmp = ((y * fma((x * x), fma((x * x), fma((x * x), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0)) / z_m) / x;
}
return z_s * tmp;
}
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 0.00028) tmp = Float64(Float64(Float64(y / z_m) * fma(x, Float64(x * fma(x, fma(x, 0.041666666666666664, 0.0), 0.5)), 1.0)) / x); elseif (x <= 1.25e+48) tmp = Float64(y * Float64(cosh(x) / Float64(z_m * x))); else tmp = Float64(Float64(Float64(y * fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0)) / z_m) / x); end return Float64(z_s * tmp) end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 0.00028], N[(N[(N[(y / z$95$m), $MachinePrecision] * N[(x * N[(x * N[(x * N[(x * 0.041666666666666664 + 0.0), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1.25e+48], N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(z$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / x), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00028:\\
\;\;\;\;\frac{\frac{y}{z\_m} \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.041666666666666664, 0\right), 0.5\right), 1\right)}{x}\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{\cosh x}{z\_m \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{z\_m}}{x}\\
\end{array}
\end{array}
if x < 2.7999999999999998e-4Initial program 85.8%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6479.9
Simplified79.9%
associate-/l*N/A
associate-/r*N/A
+-rgt-identityN/A
*-lowering-*.f64N/A
Applied egg-rr77.3%
+-rgt-identityN/A
associate-/l/N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr86.5%
if 2.7999999999999998e-4 < x < 1.24999999999999993e48Initial program 100.0%
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f64N/A
*-commutativeN/A
*-lowering-*.f6471.4
Applied egg-rr71.4%
if 1.24999999999999993e48 < x Initial program 75.9%
*-commutativeN/A
div-invN/A
associate-*l*N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f64100.0
Applied egg-rr100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified98.2%
associate-/r*N/A
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
Final simplification88.9%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= x 2.35e-39)
(/ (/ y z_m) x)
(if (<= x 8.2e+101)
(/
(* (/ y x) (fma (fma x x 0.0) (* x (* x 0.041666666666666664)) 1.0))
z_m)
(* y (/ (* 0.041666666666666664 (* x (* x x))) z_m))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 2.35e-39) {
tmp = (y / z_m) / x;
} else if (x <= 8.2e+101) {
tmp = ((y / x) * fma(fma(x, x, 0.0), (x * (x * 0.041666666666666664)), 1.0)) / z_m;
} else {
tmp = y * ((0.041666666666666664 * (x * (x * x))) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 2.35e-39) tmp = Float64(Float64(y / z_m) / x); elseif (x <= 8.2e+101) tmp = Float64(Float64(Float64(y / x) * fma(fma(x, x, 0.0), Float64(x * Float64(x * 0.041666666666666664)), 1.0)) / z_m); else tmp = Float64(y * Float64(Float64(0.041666666666666664 * Float64(x * Float64(x * x))) / z_m)); end return Float64(z_s * tmp) end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 2.35e-39], N[(N[(y / z$95$m), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 8.2e+101], N[(N[(N[(y / x), $MachinePrecision] * N[(N[(x * x + 0.0), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y * N[(N[(0.041666666666666664 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.35 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{y}{z\_m}}{x}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{y}{x} \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, x, 0\right), x \cdot \left(x \cdot 0.041666666666666664\right), 1\right)}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.041666666666666664 \cdot \left(x \cdot \left(x \cdot x\right)\right)}{z\_m}\\
\end{array}
\end{array}
if x < 2.3500000000000001e-39Initial program 85.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6463.4
Simplified63.4%
+-rgt-identityN/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6471.1
Applied egg-rr71.1%
if 2.3500000000000001e-39 < x < 8.1999999999999999e101Initial program 95.2%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6468.7
Simplified68.7%
Taylor expanded in x around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6468.2
Simplified68.2%
if 8.1999999999999999e101 < x Initial program 74.5%
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f64N/A
*-commutativeN/A
*-lowering-*.f6474.5
Applied egg-rr74.5%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6474.5
Simplified74.5%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
Final simplification76.1%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(let* ((t_0 (* 0.041666666666666664 (* x (* x x)))))
(*
z_s
(if (<= x 0.00031)
(/ (/ y z_m) x)
(if (<= x 5.5e+99) (/ (* (/ y x) (* x t_0)) z_m) (* y (/ t_0 z_m)))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double t_0 = 0.041666666666666664 * (x * (x * x));
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else if (x <= 5.5e+99) {
tmp = ((y / x) * (x * t_0)) / z_m;
} else {
tmp = y * (t_0 / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: t_0
real(8) :: tmp
t_0 = 0.041666666666666664d0 * (x * (x * x))
if (x <= 0.00031d0) then
tmp = (y / z_m) / x
else if (x <= 5.5d+99) then
tmp = ((y / x) * (x * t_0)) / z_m
else
tmp = y * (t_0 / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double t_0 = 0.041666666666666664 * (x * (x * x));
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else if (x <= 5.5e+99) {
tmp = ((y / x) * (x * t_0)) / z_m;
} else {
tmp = y * (t_0 / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): t_0 = 0.041666666666666664 * (x * (x * x)) tmp = 0 if x <= 0.00031: tmp = (y / z_m) / x elif x <= 5.5e+99: tmp = ((y / x) * (x * t_0)) / z_m else: tmp = y * (t_0 / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) t_0 = Float64(0.041666666666666664 * Float64(x * Float64(x * x))) tmp = 0.0 if (x <= 0.00031) tmp = Float64(Float64(y / z_m) / x); elseif (x <= 5.5e+99) tmp = Float64(Float64(Float64(y / x) * Float64(x * t_0)) / z_m); else tmp = Float64(y * Float64(t_0 / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) t_0 = 0.041666666666666664 * (x * (x * x)); tmp = 0.0; if (x <= 0.00031) tmp = (y / z_m) / x; elseif (x <= 5.5e+99) tmp = ((y / x) * (x * t_0)) / z_m; else tmp = y * (t_0 / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := Block[{t$95$0 = N[(0.041666666666666664 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[x, 0.00031], N[(N[(y / z$95$m), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5.5e+99], N[(N[(N[(y / x), $MachinePrecision] * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y * N[(t$95$0 / z$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_0 := 0.041666666666666664 \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{\frac{y}{z\_m}}{x}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+99}:\\
\;\;\;\;\frac{\frac{y}{x} \cdot \left(x \cdot t\_0\right)}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t\_0}{z\_m}\\
\end{array}
\end{array}
\end{array}
if x < 3.1e-4Initial program 85.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6464.8
Simplified64.8%
+-rgt-identityN/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.2
Applied egg-rr72.2%
if 3.1e-4 < x < 5.5000000000000002e99Initial program 92.9%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6451.3
Simplified51.3%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.3
Simplified51.3%
if 5.5000000000000002e99 < x Initial program 74.5%
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f64N/A
*-commutativeN/A
*-lowering-*.f6474.5
Applied egg-rr74.5%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6474.5
Simplified74.5%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
Final simplification76.1%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= y 6.7e-19)
(/
(/ (* y (fma x (* x (fma (* x x) 0.041666666666666664 0.5)) 1.0)) x)
z_m)
(/
(*
(/ y z_m)
(fma x (* x (fma x (fma x 0.041666666666666664 0.0) 0.5)) 1.0))
x))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 6.7e-19) {
tmp = ((y * fma(x, (x * fma((x * x), 0.041666666666666664, 0.5)), 1.0)) / x) / z_m;
} else {
tmp = ((y / z_m) * fma(x, (x * fma(x, fma(x, 0.041666666666666664, 0.0), 0.5)), 1.0)) / x;
}
return z_s * tmp;
}
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 6.7e-19) tmp = Float64(Float64(Float64(y * fma(x, Float64(x * fma(Float64(x * x), 0.041666666666666664, 0.5)), 1.0)) / x) / z_m); else tmp = Float64(Float64(Float64(y / z_m) * fma(x, Float64(x * fma(x, fma(x, 0.041666666666666664, 0.0), 0.5)), 1.0)) / x); end return Float64(z_s * tmp) end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 6.7e-19], N[(N[(N[(y * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / z$95$m), $MachinePrecision], N[(N[(N[(y / z$95$m), $MachinePrecision] * N[(x * N[(x * N[(x * N[(x * 0.041666666666666664 + 0.0), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 6.7 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{y \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, 0.041666666666666664, 0.5\right), 1\right)}{x}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z\_m} \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.041666666666666664, 0\right), 0.5\right), 1\right)}{x}\\
\end{array}
\end{array}
if y < 6.69999999999999998e-19Initial program 80.7%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6472.9
Simplified72.9%
Taylor expanded in x around 0
*-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-inN/A
/-lowering-/.f64N/A
Simplified86.8%
if 6.69999999999999998e-19 < y Initial program 93.2%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6489.1
Simplified89.1%
associate-/l*N/A
associate-/r*N/A
+-rgt-identityN/A
*-lowering-*.f64N/A
Applied egg-rr87.1%
+-rgt-identityN/A
associate-/l/N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr95.8%
Final simplification89.3%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= y 4e+99)
(/
(/ (* y (fma x (* x (fma (* x x) 0.041666666666666664 0.5)) 1.0)) x)
z_m)
(* y (/ (* (fma x (* x 0.5) 1.0) (/ 1.0 z_m)) x)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 4e+99) {
tmp = ((y * fma(x, (x * fma((x * x), 0.041666666666666664, 0.5)), 1.0)) / x) / z_m;
} else {
tmp = y * ((fma(x, (x * 0.5), 1.0) * (1.0 / z_m)) / x);
}
return z_s * tmp;
}
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 4e+99) tmp = Float64(Float64(Float64(y * fma(x, Float64(x * fma(Float64(x * x), 0.041666666666666664, 0.5)), 1.0)) / x) / z_m); else tmp = Float64(y * Float64(Float64(fma(x, Float64(x * 0.5), 1.0) * Float64(1.0 / z_m)) / x)); end return Float64(z_s * tmp) end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 4e+99], N[(N[(N[(y * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y * N[(N[(N[(x * N[(x * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 / z$95$m), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{+99}:\\
\;\;\;\;\frac{\frac{y \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, 0.041666666666666664, 0.5\right), 1\right)}{x}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\mathsf{fma}\left(x, x \cdot 0.5, 1\right) \cdot \frac{1}{z\_m}}{x}\\
\end{array}
\end{array}
if y < 3.9999999999999999e99Initial program 83.0%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6475.1
Simplified75.1%
Taylor expanded in x around 0
*-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-inN/A
/-lowering-/.f64N/A
Simplified87.5%
if 3.9999999999999999e99 < y Initial program 89.5%
*-commutativeN/A
div-invN/A
associate-*l*N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around 0
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6491.5
Simplified91.5%
Final simplification88.2%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= x 0.00031)
(/ (/ y z_m) x)
(/ (* y (* 0.041666666666666664 (* x (* x x)))) z_m))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else {
tmp = (y * (0.041666666666666664 * (x * (x * x)))) / z_m;
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (x <= 0.00031d0) then
tmp = (y / z_m) / x
else
tmp = (y * (0.041666666666666664d0 * (x * (x * x)))) / z_m
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else {
tmp = (y * (0.041666666666666664 * (x * (x * x)))) / z_m;
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if x <= 0.00031: tmp = (y / z_m) / x else: tmp = (y * (0.041666666666666664 * (x * (x * x)))) / z_m return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 0.00031) tmp = Float64(Float64(y / z_m) / x); else tmp = Float64(Float64(y * Float64(0.041666666666666664 * Float64(x * Float64(x * x)))) / z_m); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (x <= 0.00031) tmp = (y / z_m) / x; else tmp = (y * (0.041666666666666664 * (x * (x * x)))) / z_m; end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 0.00031], N[(N[(y / z$95$m), $MachinePrecision] / x), $MachinePrecision], N[(N[(y * N[(0.041666666666666664 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{\frac{y}{z\_m}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(0.041666666666666664 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}{z\_m}\\
\end{array}
\end{array}
if x < 3.1e-4Initial program 85.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6464.8
Simplified64.8%
+-rgt-identityN/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.2
Applied egg-rr72.2%
if 3.1e-4 < x Initial program 78.7%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6469.2
Simplified69.2%
Taylor expanded in x around inf
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6482.6
Simplified82.6%
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6482.6
Applied egg-rr82.6%
Taylor expanded in x around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6485.7
Simplified85.7%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= x 0.00031)
(/ (/ y z_m) x)
(* y (/ (* 0.041666666666666664 (* x (* x x))) z_m)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else {
tmp = y * ((0.041666666666666664 * (x * (x * x))) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (x <= 0.00031d0) then
tmp = (y / z_m) / x
else
tmp = y * ((0.041666666666666664d0 * (x * (x * x))) / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else {
tmp = y * ((0.041666666666666664 * (x * (x * x))) / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if x <= 0.00031: tmp = (y / z_m) / x else: tmp = y * ((0.041666666666666664 * (x * (x * x))) / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 0.00031) tmp = Float64(Float64(y / z_m) / x); else tmp = Float64(y * Float64(Float64(0.041666666666666664 * Float64(x * Float64(x * x))) / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (x <= 0.00031) tmp = (y / z_m) / x; else tmp = y * ((0.041666666666666664 * (x * (x * x))) / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 0.00031], N[(N[(y / z$95$m), $MachinePrecision] / x), $MachinePrecision], N[(y * N[(N[(0.041666666666666664 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{\frac{y}{z\_m}}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.041666666666666664 \cdot \left(x \cdot \left(x \cdot x\right)\right)}{z\_m}\\
\end{array}
\end{array}
if x < 3.1e-4Initial program 85.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6464.8
Simplified64.8%
+-rgt-identityN/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.2
Applied egg-rr72.2%
if 3.1e-4 < x Initial program 78.7%
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cosh-lowering-cosh.f64N/A
*-commutativeN/A
*-lowering-*.f6473.8
Applied egg-rr73.8%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6469.1
Simplified69.1%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6485.7
Simplified85.7%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= x 0.00031)
(/ (/ y z_m) x)
(* 0.041666666666666664 (/ (* x (* x (* x y))) z_m)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else {
tmp = 0.041666666666666664 * ((x * (x * (x * y))) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (x <= 0.00031d0) then
tmp = (y / z_m) / x
else
tmp = 0.041666666666666664d0 * ((x * (x * (x * y))) / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else {
tmp = 0.041666666666666664 * ((x * (x * (x * y))) / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if x <= 0.00031: tmp = (y / z_m) / x else: tmp = 0.041666666666666664 * ((x * (x * (x * y))) / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 0.00031) tmp = Float64(Float64(y / z_m) / x); else tmp = Float64(0.041666666666666664 * Float64(Float64(x * Float64(x * Float64(x * y))) / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (x <= 0.00031) tmp = (y / z_m) / x; else tmp = 0.041666666666666664 * ((x * (x * (x * y))) / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 0.00031], N[(N[(y / z$95$m), $MachinePrecision] / x), $MachinePrecision], N[(0.041666666666666664 * N[(N[(x * N[(x * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{\frac{y}{z\_m}}{x}\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \frac{x \cdot \left(x \cdot \left(x \cdot y\right)\right)}{z\_m}\\
\end{array}
\end{array}
if x < 3.1e-4Initial program 85.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6464.8
Simplified64.8%
+-rgt-identityN/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.2
Applied egg-rr72.2%
if 3.1e-4 < x Initial program 78.7%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6469.2
Simplified69.2%
Taylor expanded in x around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6482.6
Simplified82.6%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= x 0.00031) (/ (/ y z_m) x) (/ (* 0.5 (* x y)) z_m))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else {
tmp = (0.5 * (x * y)) / z_m;
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (x <= 0.00031d0) then
tmp = (y / z_m) / x
else
tmp = (0.5d0 * (x * y)) / z_m
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / z_m) / x;
} else {
tmp = (0.5 * (x * y)) / z_m;
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if x <= 0.00031: tmp = (y / z_m) / x else: tmp = (0.5 * (x * y)) / z_m return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 0.00031) tmp = Float64(Float64(y / z_m) / x); else tmp = Float64(Float64(0.5 * Float64(x * y)) / z_m); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (x <= 0.00031) tmp = (y / z_m) / x; else tmp = (0.5 * (x * y)) / z_m; end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 0.00031], N[(N[(y / z$95$m), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{\frac{y}{z\_m}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(x \cdot y\right)}{z\_m}\\
\end{array}
\end{array}
if x < 3.1e-4Initial program 85.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6464.8
Simplified64.8%
+-rgt-identityN/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.2
Applied egg-rr72.2%
if 3.1e-4 < x Initial program 78.7%
Taylor expanded in x around 0
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*l/N/A
times-fracN/A
+-commutativeN/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
Simplified53.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6435.8
Simplified35.8%
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6448.1
Applied egg-rr48.1%
Final simplification66.4%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= x 0.00031) (/ (/ y x) z_m) (/ (* 0.5 (* x y)) z_m))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / x) / z_m;
} else {
tmp = (0.5 * (x * y)) / z_m;
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (x <= 0.00031d0) then
tmp = (y / x) / z_m
else
tmp = (0.5d0 * (x * y)) / z_m
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = (y / x) / z_m;
} else {
tmp = (0.5 * (x * y)) / z_m;
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if x <= 0.00031: tmp = (y / x) / z_m else: tmp = (0.5 * (x * y)) / z_m return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 0.00031) tmp = Float64(Float64(y / x) / z_m); else tmp = Float64(Float64(0.5 * Float64(x * y)) / z_m); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (x <= 0.00031) tmp = (y / x) / z_m; else tmp = (0.5 * (x * y)) / z_m; end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 0.00031], N[(N[(y / x), $MachinePrecision] / z$95$m), $MachinePrecision], N[(N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{\frac{y}{x}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(x \cdot y\right)}{z\_m}\\
\end{array}
\end{array}
if x < 3.1e-4Initial program 85.8%
Taylor expanded in x around 0
/-lowering-/.f6464.8
Simplified64.8%
if 3.1e-4 < x Initial program 78.7%
Taylor expanded in x around 0
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*l/N/A
times-fracN/A
+-commutativeN/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
Simplified53.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6435.8
Simplified35.8%
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6448.1
Applied egg-rr48.1%
Final simplification60.8%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= x 0.00031) (/ y (* z_m x)) (/ (* 0.5 (* x y)) z_m))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = y / (z_m * x);
} else {
tmp = (0.5 * (x * y)) / z_m;
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (x <= 0.00031d0) then
tmp = y / (z_m * x)
else
tmp = (0.5d0 * (x * y)) / z_m
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = y / (z_m * x);
} else {
tmp = (0.5 * (x * y)) / z_m;
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if x <= 0.00031: tmp = y / (z_m * x) else: tmp = (0.5 * (x * y)) / z_m return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 0.00031) tmp = Float64(y / Float64(z_m * x)); else tmp = Float64(Float64(0.5 * Float64(x * y)) / z_m); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (x <= 0.00031) tmp = y / (z_m * x); else tmp = (0.5 * (x * y)) / z_m; end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 0.00031], N[(y / N[(z$95$m * x), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{y}{z\_m \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(x \cdot y\right)}{z\_m}\\
\end{array}
\end{array}
if x < 3.1e-4Initial program 85.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6464.8
Simplified64.8%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6464.8
Applied egg-rr64.8%
if 3.1e-4 < x Initial program 78.7%
Taylor expanded in x around 0
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*l/N/A
times-fracN/A
+-commutativeN/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
Simplified53.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6435.8
Simplified35.8%
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6448.1
Applied egg-rr48.1%
Final simplification60.8%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= x 0.00031) (/ y (* z_m x)) (* 0.5 (* x (/ y z_m))))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = y / (z_m * x);
} else {
tmp = 0.5 * (x * (y / z_m));
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (x <= 0.00031d0) then
tmp = y / (z_m * x)
else
tmp = 0.5d0 * (x * (y / z_m))
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (x <= 0.00031) {
tmp = y / (z_m * x);
} else {
tmp = 0.5 * (x * (y / z_m));
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if x <= 0.00031: tmp = y / (z_m * x) else: tmp = 0.5 * (x * (y / z_m)) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (x <= 0.00031) tmp = Float64(y / Float64(z_m * x)); else tmp = Float64(0.5 * Float64(x * Float64(y / z_m))); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (x <= 0.00031) tmp = y / (z_m * x); else tmp = 0.5 * (x * (y / z_m)); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[x, 0.00031], N[(y / N[(z$95$m * x), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * N[(y / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{y}{z\_m \cdot x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{z\_m}\right)\\
\end{array}
\end{array}
if x < 3.1e-4Initial program 85.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6464.8
Simplified64.8%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6464.8
Applied egg-rr64.8%
if 3.1e-4 < x Initial program 78.7%
Taylor expanded in x around 0
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*l/N/A
times-fracN/A
+-commutativeN/A
distribute-rgt1-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
Simplified53.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6435.8
Simplified35.8%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (/ y (* z_m x))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
return z_s * (y / (z_m * x));
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
code = z_s * (y / (z_m * x))
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
return z_s * (y / (z_m * x));
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): return z_s * (y / (z_m * x))
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m) return Float64(z_s * Float64(y / Float64(z_m * x))) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m) tmp = z_s * (y / (z_m * x)); end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * N[(y / N[(z$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \frac{y}{z\_m \cdot x}
\end{array}
Initial program 84.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6450.7
Simplified50.7%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6450.7
Applied egg-rr50.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (/ y z) x) (cosh x))))
(if (< y -4.618902267687042e-52)
t_0
(if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y / z) / x) * cosh(x)
if (y < (-4.618902267687042d-52)) then
tmp = t_0
else if (y < 1.038530535935153d-39) then
tmp = ((cosh(x) * y) / x) / z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * Math.cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((Math.cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y / z) / x) * math.cosh(x) tmp = 0 if y < -4.618902267687042e-52: tmp = t_0 elif y < 1.038530535935153e-39: tmp = ((math.cosh(x) * y) / x) / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y / z) / x) * cosh(x)) tmp = 0.0 if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = Float64(Float64(Float64(cosh(x) * y) / x) / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y / z) / x) * cosh(x); tmp = 0.0; if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = ((cosh(x) * y) / x) / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]}, If[Less[y, -4.618902267687042e-52], t$95$0, If[Less[y, 1.038530535935153e-39], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\
\mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024196
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (if (< y -2309451133843521/5000000000000000000000000000000000000000000000000000000000000000000) (* (/ (/ y z) x) (cosh x)) (if (< y 1038530535935153/1000000000000000000000000000000000000000000000000000000) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x)))))
(/ (* (cosh x) (/ y x)) z))