
(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 22 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}
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (let* ((t_0 (/ (cosh x) x))) (* y_s (if (<= y_m 2.15e-24) (/ (* y_m t_0) z) (* t_0 (/ y_m z))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double t_0 = cosh(x) / x;
double tmp;
if (y_m <= 2.15e-24) {
tmp = (y_m * t_0) / z;
} else {
tmp = t_0 * (y_m / z);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cosh(x) / x
if (y_m <= 2.15d-24) then
tmp = (y_m * t_0) / z
else
tmp = t_0 * (y_m / z)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double t_0 = Math.cosh(x) / x;
double tmp;
if (y_m <= 2.15e-24) {
tmp = (y_m * t_0) / z;
} else {
tmp = t_0 * (y_m / z);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): t_0 = math.cosh(x) / x tmp = 0 if y_m <= 2.15e-24: tmp = (y_m * t_0) / z else: tmp = t_0 * (y_m / z) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) t_0 = Float64(cosh(x) / x) tmp = 0.0 if (y_m <= 2.15e-24) tmp = Float64(Float64(y_m * t_0) / z); else tmp = Float64(t_0 * Float64(y_m / z)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) t_0 = cosh(x) / x; tmp = 0.0; if (y_m <= 2.15e-24) tmp = (y_m * t_0) / z; else tmp = t_0 * (y_m / z); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 2.15e-24], N[(N[(y$95$m * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(t$95$0 * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := \frac{\cosh x}{x}\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 2.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y\_m \cdot t\_0}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{y\_m}{z}\\
\end{array}
\end{array}
\end{array}
if y < 2.1500000000000002e-24Initial program 78.8%
lift-cosh.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.8
Applied rewrites96.8%
if 2.1500000000000002e-24 < y Initial program 92.2%
lift-cosh.f64N/A
clear-numN/A
un-div-invN/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
times-fracN/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification97.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= (/ (* (cosh x) (/ y_m x)) z) 4e+175)
(/
(*
(/ y_m x)
(fma
x
(*
x
(fma
(* x x)
(fma (* x x) 0.001388888888888889 0.041666666666666664)
0.5))
1.0))
z)
(/
(/
(fma
(*
x
(fma
(* x x)
(fma x (* x 0.001388888888888889) 0.041666666666666664)
0.5))
(* y_m x)
y_m)
z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (((cosh(x) * (y_m / x)) / z) <= 4e+175) {
tmp = ((y_m / x) * fma(x, (x * fma((x * x), fma((x * x), 0.001388888888888889, 0.041666666666666664), 0.5)), 1.0)) / z;
} else {
tmp = (fma((x * fma((x * x), fma(x, (x * 0.001388888888888889), 0.041666666666666664), 0.5)), (y_m * x), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 4e+175) tmp = Float64(Float64(Float64(y_m / x) * fma(x, Float64(x * fma(Float64(x * x), fma(Float64(x * x), 0.001388888888888889, 0.041666666666666664), 0.5)), 1.0)) / z); else tmp = Float64(Float64(fma(Float64(x * fma(Float64(x * x), fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664), 0.5)), Float64(y_m * x), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 4e+175], N[(N[(N[(y$95$m / x), $MachinePrecision] * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(x * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] * N[(y$95$m * x), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 4 \cdot 10^{+175}:\\
\;\;\;\;\frac{\frac{y\_m}{x} \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), y\_m \cdot x, y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 3.9999999999999997e175Initial program 97.2%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.2
Applied rewrites92.2%
if 3.9999999999999997e175 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 64.4%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6460.2
Applied rewrites60.2%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-invN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites89.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
un-div-invN/A
associate-/l/N/A
Applied rewrites95.7%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites95.7%
Final simplification93.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= (/ (* (cosh x) (/ y_m x)) z) 1e+298)
(/
(*
(/ y_m x)
(fma
x
(*
x
(fma
(* x x)
(fma (* x x) 0.001388888888888889 0.041666666666666664)
0.5))
1.0))
z)
(/
(/
(fma
(fma (* x x) (* (* x x) 0.001388888888888889) 0.5)
(* y_m (* x x))
y_m)
z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (((cosh(x) * (y_m / x)) / z) <= 1e+298) {
tmp = ((y_m / x) * fma(x, (x * fma((x * x), fma((x * x), 0.001388888888888889, 0.041666666666666664), 0.5)), 1.0)) / z;
} else {
tmp = (fma(fma((x * x), ((x * x) * 0.001388888888888889), 0.5), (y_m * (x * x)), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 1e+298) tmp = Float64(Float64(Float64(y_m / x) * fma(x, Float64(x * fma(Float64(x * x), fma(Float64(x * x), 0.001388888888888889, 0.041666666666666664), 0.5)), 1.0)) / z); else tmp = Float64(Float64(fma(fma(Float64(x * x), Float64(Float64(x * x) * 0.001388888888888889), 0.5), Float64(y_m * Float64(x * x)), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 1e+298], N[(N[(N[(y$95$m / x), $MachinePrecision] * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.5), $MachinePrecision] * N[(y$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 10^{+298}:\\
\;\;\;\;\frac{\frac{y\_m}{x} \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, \left(x \cdot x\right) \cdot 0.001388888888888889, 0.5\right), y\_m \cdot \left(x \cdot x\right), y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 9.9999999999999996e297Initial program 97.4%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.8
Applied rewrites92.8%
if 9.9999999999999996e297 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 59.5%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-invN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites87.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
un-div-invN/A
associate-/l/N/A
Applied rewrites95.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6495.2
Applied rewrites95.2%
Final simplification93.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= (/ (* (cosh x) (/ y_m x)) z) 1e+14)
(/
(*
y_m
(fma
(* x x)
(fma
(* x x)
(fma x (* x 0.001388888888888889) 0.041666666666666664)
0.5)
1.0))
(* x z))
(/
(/ (* y_m (fma (* x x) (fma x (* x 0.041666666666666664) 0.5) 1.0)) z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (((cosh(x) * (y_m / x)) / z) <= 1e+14) {
tmp = (y_m * fma((x * x), fma((x * x), fma(x, (x * 0.001388888888888889), 0.041666666666666664), 0.5), 1.0)) / (x * z);
} else {
tmp = ((y_m * fma((x * x), fma(x, (x * 0.041666666666666664), 0.5), 1.0)) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 1e+14) tmp = Float64(Float64(y_m * fma(Float64(x * x), fma(Float64(x * x), fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664), 0.5), 1.0)) / Float64(x * z)); else tmp = Float64(Float64(Float64(y_m * fma(Float64(x * x), fma(x, Float64(x * 0.041666666666666664), 0.5), 1.0)) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 1e+14], N[(N[(y$95$m * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$95$m * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 10^{+14}:\\
\;\;\;\;\frac{y\_m \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y\_m \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)}{z}}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1e14Initial program 96.9%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6491.4
Applied rewrites91.4%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
Applied rewrites82.6%
if 1e14 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 68.1%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
div-invN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites95.2%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0 (fma (* x x) (fma x (* x 0.041666666666666664) 0.5) 1.0)))
(*
y_s
(if (<= (/ (* (cosh x) (/ y_m x)) z) 4e+175)
(/ (* (/ y_m x) t_0) z)
(/ (/ (* y_m t_0) z) x)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double t_0 = fma((x * x), fma(x, (x * 0.041666666666666664), 0.5), 1.0);
double tmp;
if (((cosh(x) * (y_m / x)) / z) <= 4e+175) {
tmp = ((y_m / x) * t_0) / z;
} else {
tmp = ((y_m * t_0) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) t_0 = fma(Float64(x * x), fma(x, Float64(x * 0.041666666666666664), 0.5), 1.0) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 4e+175) tmp = Float64(Float64(Float64(y_m / x) * t_0) / z); else tmp = Float64(Float64(Float64(y_m * t_0) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]}, N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 4e+175], N[(N[(N[(y$95$m / x), $MachinePrecision] * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(y$95$m * t$95$0), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 4 \cdot 10^{+175}:\\
\;\;\;\;\frac{\frac{y\_m}{x} \cdot t\_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y\_m \cdot t\_0}{z}}{x}\\
\end{array}
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 3.9999999999999997e175Initial program 97.2%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6488.6
Applied rewrites88.6%
if 3.9999999999999997e175 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 64.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6455.9
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
div-invN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites94.6%
Final simplification91.3%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0 (fma (* x x) (fma x (* x 0.041666666666666664) 0.5) 1.0)))
(*
y_s
(if (<= (/ (* (cosh x) (/ y_m x)) z) 2e+262)
(/ (* (/ y_m x) t_0) z)
(/ y_m (* x (/ z t_0)))))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double t_0 = fma((x * x), fma(x, (x * 0.041666666666666664), 0.5), 1.0);
double tmp;
if (((cosh(x) * (y_m / x)) / z) <= 2e+262) {
tmp = ((y_m / x) * t_0) / z;
} else {
tmp = y_m / (x * (z / t_0));
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) t_0 = fma(Float64(x * x), fma(x, Float64(x * 0.041666666666666664), 0.5), 1.0) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 2e+262) tmp = Float64(Float64(Float64(y_m / x) * t_0) / z); else tmp = Float64(y_m / Float64(x * Float64(z / t_0))); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]}, N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 2e+262], N[(N[(N[(y$95$m / x), $MachinePrecision] * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(y$95$m / N[(x * N[(z / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 2 \cdot 10^{+262}:\\
\;\;\;\;\frac{\frac{y\_m}{x} \cdot t\_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m}{x \cdot \frac{z}{t\_0}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 2e262Initial program 97.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6489.4
Applied rewrites89.4%
if 2e262 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 60.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6451.2
Applied rewrites51.2%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6453.1
Applied rewrites53.1%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6492.3
Applied rewrites92.3%
Final simplification90.6%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= (/ (* (cosh x) (/ y_m x)) z) 2e+262)
(/ (fma y_m (* x 0.5) (/ y_m x)) z)
(/
y_m
(* x (/ z (fma (* x x) (fma x (* x 0.041666666666666664) 0.5) 1.0)))))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (((cosh(x) * (y_m / x)) / z) <= 2e+262) {
tmp = fma(y_m, (x * 0.5), (y_m / x)) / z;
} else {
tmp = y_m / (x * (z / fma((x * x), fma(x, (x * 0.041666666666666664), 0.5), 1.0)));
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 2e+262) tmp = Float64(fma(y_m, Float64(x * 0.5), Float64(y_m / x)) / z); else tmp = Float64(y_m / Float64(x * Float64(z / fma(Float64(x * x), fma(x, Float64(x * 0.041666666666666664), 0.5), 1.0)))); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 2e+262], N[(N[(y$95$m * N[(x * 0.5), $MachinePrecision] + N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y$95$m / N[(x * N[(z / N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 2 \cdot 10^{+262}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y\_m, x \cdot 0.5, \frac{y\_m}{x}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m}{x \cdot \frac{z}{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 2e262Initial program 97.4%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6479.3
Applied rewrites79.3%
if 2e262 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 60.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6451.2
Applied rewrites51.2%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6453.1
Applied rewrites53.1%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6492.3
Applied rewrites92.3%
Final simplification84.6%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= (* (cosh x) (/ y_m x)) 5e+305)
(/
(* (/ y_m x) (fma (* x x) (fma x (* x 0.041666666666666664) 0.5) 1.0))
z)
(/
(/
(fma
(fma (* x x) (* (* x x) 0.001388888888888889) 0.5)
(* y_m (* x x))
y_m)
z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((cosh(x) * (y_m / x)) <= 5e+305) {
tmp = ((y_m / x) * fma((x * x), fma(x, (x * 0.041666666666666664), 0.5), 1.0)) / z;
} else {
tmp = (fma(fma((x * x), ((x * x) * 0.001388888888888889), 0.5), (y_m * (x * x)), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(cosh(x) * Float64(y_m / x)) <= 5e+305) tmp = Float64(Float64(Float64(y_m / x) * fma(Float64(x * x), fma(x, Float64(x * 0.041666666666666664), 0.5), 1.0)) / z); else tmp = Float64(Float64(fma(fma(Float64(x * x), Float64(Float64(x * x) * 0.001388888888888889), 0.5), Float64(y_m * Float64(x * x)), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision], 5e+305], N[(N[(N[(y$95$m / x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.5), $MachinePrecision] * N[(y$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{y\_m}{x} \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\frac{\frac{y\_m}{x} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(x \cdot x, \left(x \cdot x\right) \cdot 0.001388888888888889, 0.5\right), y\_m \cdot \left(x \cdot x\right), y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < 5.00000000000000009e305Initial program 97.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6490.9
Applied rewrites90.9%
if 5.00000000000000009e305 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 58.3%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-invN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites87.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
un-div-invN/A
associate-/l/N/A
Applied rewrites94.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6494.0
Applied rewrites94.0%
Final simplification92.1%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 4.5e-25)
(/
(*
(*
y_m
(fma
(* x x)
(fma
(* x x)
(fma x (* x 0.001388888888888889) 0.041666666666666664)
0.5)
1.0))
(/ 1.0 x))
z)
(* (/ (cosh x) x) (/ y_m z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 4.5e-25) {
tmp = ((y_m * fma((x * x), fma((x * x), fma(x, (x * 0.001388888888888889), 0.041666666666666664), 0.5), 1.0)) * (1.0 / x)) / z;
} else {
tmp = (cosh(x) / x) * (y_m / z);
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 4.5e-25) tmp = Float64(Float64(Float64(y_m * fma(Float64(x * x), fma(Float64(x * x), fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664), 0.5), 1.0)) * Float64(1.0 / x)) / z); else tmp = Float64(Float64(cosh(x) / x) * Float64(y_m / z)); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 4.5e-25], N[(N[(N[(y$95$m * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision] * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 4.5 \cdot 10^{-25}:\\
\;\;\;\;\frac{\left(y\_m \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right) \cdot \frac{1}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{x} \cdot \frac{y\_m}{z}\\
\end{array}
\end{array}
if y < 4.5000000000000001e-25Initial program 78.8%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6473.8
Applied rewrites73.8%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-invN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites91.8%
if 4.5000000000000001e-25 < y Initial program 92.2%
lift-cosh.f64N/A
clear-numN/A
un-div-invN/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
times-fracN/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification94.1%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0
(fma
(* x x)
(fma x (* x 0.001388888888888889) 0.041666666666666664)
0.5)))
(*
y_s
(if (<= y_m 2.8e-74)
(/ (* (* y_m (fma (* x x) t_0 1.0)) (/ 1.0 x)) z)
(/ (/ (fma (* x t_0) (* y_m x) y_m) z) x)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double t_0 = fma((x * x), fma(x, (x * 0.001388888888888889), 0.041666666666666664), 0.5);
double tmp;
if (y_m <= 2.8e-74) {
tmp = ((y_m * fma((x * x), t_0, 1.0)) * (1.0 / x)) / z;
} else {
tmp = (fma((x * t_0), (y_m * x), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) t_0 = fma(Float64(x * x), fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664), 0.5) tmp = 0.0 if (y_m <= 2.8e-74) tmp = Float64(Float64(Float64(y_m * fma(Float64(x * x), t_0, 1.0)) * Float64(1.0 / x)) / z); else tmp = Float64(Float64(fma(Float64(x * t_0), Float64(y_m * x), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 2.8e-74], N[(N[(N[(y$95$m * N[(N[(x * x), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(x * t$95$0), $MachinePrecision] * N[(y$95$m * x), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 2.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{\left(y\_m \cdot \mathsf{fma}\left(x \cdot x, t\_0, 1\right)\right) \cdot \frac{1}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot t\_0, y\_m \cdot x, y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
\end{array}
if y < 2.79999999999999988e-74Initial program 78.6%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6473.9
Applied rewrites73.9%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-invN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites91.9%
if 2.79999999999999988e-74 < y Initial program 90.8%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.3
Applied rewrites86.3%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-invN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites88.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
un-div-invN/A
associate-/l/N/A
Applied rewrites95.4%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites95.4%
Final simplification93.0%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 1.4e-217)
(/ (/ y_m z) x)
(if (<= x 5e+21)
(/
(* y_m (fma (* x x) (fma x (* x 0.041666666666666664) 0.5) 1.0))
(* x z))
(/ y_m (* x (/ z (* (* x x) (* (* x x) 0.041666666666666664)))))))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4e-217) {
tmp = (y_m / z) / x;
} else if (x <= 5e+21) {
tmp = (y_m * fma((x * x), fma(x, (x * 0.041666666666666664), 0.5), 1.0)) / (x * z);
} else {
tmp = y_m / (x * (z / ((x * x) * ((x * x) * 0.041666666666666664))));
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4e-217) tmp = Float64(Float64(y_m / z) / x); elseif (x <= 5e+21) tmp = Float64(Float64(y_m * fma(Float64(x * x), fma(x, Float64(x * 0.041666666666666664), 0.5), 1.0)) / Float64(x * z)); else tmp = Float64(y_m / Float64(x * Float64(z / Float64(Float64(x * x) * Float64(Float64(x * x) * 0.041666666666666664))))); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4e-217], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5e+21], N[(N[(y$95$m * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(y$95$m / N[(x * N[(z / N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+21}:\\
\;\;\;\;\frac{y\_m \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m}{x \cdot \frac{z}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)}}\\
\end{array}
\end{array}
if x < 1.4e-217Initial program 84.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
if 1.4e-217 < x < 5e21Initial program 94.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6490.2
Applied rewrites90.2%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-/r*N/A
lift-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.7
Applied rewrites89.7%
if 5e21 < x Initial program 68.2%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6456.5
Applied rewrites56.5%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6459.4
Applied rewrites59.4%
Taylor expanded in x around inf
associate-*r/N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6459.4
Applied rewrites59.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites91.2%
Final simplification74.4%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 1.4e-217)
(/ (/ y_m z) x)
(if (<= x 4.7e+93)
(/
(* y_m (fma (* x x) (fma x (* x 0.041666666666666664) 0.5) 1.0))
(* x z))
(/ (* 0.041666666666666664 (* y_m (* x (* x x)))) z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4e-217) {
tmp = (y_m / z) / x;
} else if (x <= 4.7e+93) {
tmp = (y_m * fma((x * x), fma(x, (x * 0.041666666666666664), 0.5), 1.0)) / (x * z);
} else {
tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4e-217) tmp = Float64(Float64(y_m / z) / x); elseif (x <= 4.7e+93) tmp = Float64(Float64(y_m * fma(Float64(x * x), fma(x, Float64(x * 0.041666666666666664), 0.5), 1.0)) / Float64(x * z)); else tmp = Float64(Float64(0.041666666666666664 * Float64(y_m * Float64(x * Float64(x * x)))) / z); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4e-217], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 4.7e+93], N[(N[(y$95$m * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(0.041666666666666664 * N[(y$95$m * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{+93}:\\
\;\;\;\;\frac{y\_m \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.041666666666666664 \cdot \left(y\_m \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}{z}\\
\end{array}
\end{array}
if x < 1.4e-217Initial program 84.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
if 1.4e-217 < x < 4.6999999999999998e93Initial program 95.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6480.4
Applied rewrites80.4%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-/r*N/A
lift-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6481.4
Applied rewrites81.4%
if 4.6999999999999998e93 < x Initial program 61.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6496.4
Applied rewrites96.4%
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
cube-unmultN/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f6498.2
Applied rewrites98.2%
Final simplification73.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.2)
(* (/ y_m z) (/ 1.0 x))
(/ (* 0.041666666666666664 (* y_m (* x (* x x)))) z))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z;
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.2d0) then
tmp = (y_m / z) * (1.0d0 / x)
else
tmp = (0.041666666666666664d0 * (y_m * (x * (x * x)))) / z
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z;
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 2.2: tmp = (y_m / z) * (1.0 / x) else: tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.2) tmp = Float64(Float64(y_m / z) * Float64(1.0 / x)); else tmp = Float64(Float64(0.041666666666666664 * Float64(y_m * Float64(x * Float64(x * x)))) / z); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 2.2) tmp = (y_m / z) * (1.0 / x); else tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z; end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.2], N[(N[(y$95$m / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.041666666666666664 * N[(y$95$m * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.2:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.041666666666666664 \cdot \left(y\_m \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}{z}\\
\end{array}
\end{array}
if x < 2.2000000000000002Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
*-commutativeN/A
associate-/r*N/A
div-invN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.9
Applied rewrites68.9%
if 2.2000000000000002 < x Initial program 69.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6455.6
Applied rewrites55.6%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6457.0
Applied rewrites57.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.8
Applied rewrites81.8%
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
cube-unmultN/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f6483.2
Applied rewrites83.2%
Final simplification72.8%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.2)
(* (/ y_m z) (/ 1.0 x))
(/ (* 0.041666666666666664 (* x (* y_m (* x x)))) z))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (0.041666666666666664 * (x * (y_m * (x * x)))) / z;
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.2d0) then
tmp = (y_m / z) * (1.0d0 / x)
else
tmp = (0.041666666666666664d0 * (x * (y_m * (x * x)))) / z
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (0.041666666666666664 * (x * (y_m * (x * x)))) / z;
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 2.2: tmp = (y_m / z) * (1.0 / x) else: tmp = (0.041666666666666664 * (x * (y_m * (x * x)))) / z return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.2) tmp = Float64(Float64(y_m / z) * Float64(1.0 / x)); else tmp = Float64(Float64(0.041666666666666664 * Float64(x * Float64(y_m * Float64(x * x)))) / z); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 2.2) tmp = (y_m / z) * (1.0 / x); else tmp = (0.041666666666666664 * (x * (y_m * (x * x)))) / z; end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.2], N[(N[(y$95$m / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.041666666666666664 * N[(x * N[(y$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.2:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.041666666666666664 \cdot \left(x \cdot \left(y\_m \cdot \left(x \cdot x\right)\right)\right)}{z}\\
\end{array}
\end{array}
if x < 2.2000000000000002Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
*-commutativeN/A
associate-/r*N/A
div-invN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.9
Applied rewrites68.9%
if 2.2000000000000002 < x Initial program 69.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6455.6
Applied rewrites55.6%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6457.0
Applied rewrites57.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.8
Applied rewrites81.8%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.2)
(* (/ y_m z) (/ 1.0 x))
(* (* x (* x (* y_m x))) (/ 0.041666666666666664 z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (x * (x * (y_m * x))) * (0.041666666666666664 / z);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.2d0) then
tmp = (y_m / z) * (1.0d0 / x)
else
tmp = (x * (x * (y_m * x))) * (0.041666666666666664d0 / z)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (x * (x * (y_m * x))) * (0.041666666666666664 / z);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 2.2: tmp = (y_m / z) * (1.0 / x) else: tmp = (x * (x * (y_m * x))) * (0.041666666666666664 / z) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.2) tmp = Float64(Float64(y_m / z) * Float64(1.0 / x)); else tmp = Float64(Float64(x * Float64(x * Float64(y_m * x))) * Float64(0.041666666666666664 / z)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 2.2) tmp = (y_m / z) * (1.0 / x); else tmp = (x * (x * (y_m * x))) * (0.041666666666666664 / z); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.2], N[(N[(y$95$m / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(x * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.2:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(x \cdot \left(y\_m \cdot x\right)\right)\right) \cdot \frac{0.041666666666666664}{z}\\
\end{array}
\end{array}
if x < 2.2000000000000002Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
*-commutativeN/A
associate-/r*N/A
div-invN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.9
Applied rewrites68.9%
if 2.2000000000000002 < x Initial program 69.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6455.6
Applied rewrites55.6%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6457.0
Applied rewrites57.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.8
Applied rewrites81.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6480.4
Applied rewrites80.4%
Final simplification72.0%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (* (/ y_m z) (/ 1.0 x)) (* y_m (/ (* x 0.5) z)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = y_m * ((x * 0.5) / z);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = (y_m / z) * (1.0d0 / x)
else
tmp = y_m * ((x * 0.5d0) / z)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = y_m * ((x * 0.5) / z);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = (y_m / z) * (1.0 / x) else: tmp = y_m * ((x * 0.5) / z) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(Float64(y_m / z) * Float64(1.0 / x)); else tmp = Float64(y_m * Float64(Float64(x * 0.5) / z)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = (y_m / z) * (1.0 / x); else tmp = y_m * ((x * 0.5) / z); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(N[(y$95$m / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(N[(x * 0.5), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \frac{x \cdot 0.5}{z}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
*-commutativeN/A
associate-/r*N/A
div-invN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.9
Applied rewrites68.9%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.0
Applied rewrites37.0%
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6438.3
Applied rewrites38.3%
Final simplification60.7%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (/ (/ y_m z) x) (* y_m (/ (* x 0.5) z)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / z) / x;
} else {
tmp = y_m * ((x * 0.5) / z);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = (y_m / z) / x
else
tmp = y_m * ((x * 0.5d0) / z)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / z) / x;
} else {
tmp = y_m * ((x * 0.5) / z);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = (y_m / z) / x else: tmp = y_m * ((x * 0.5) / z) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(Float64(y_m / z) / x); else tmp = Float64(y_m * Float64(Float64(x * 0.5) / z)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = (y_m / z) / x; else tmp = y_m * ((x * 0.5) / z); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], N[(y$95$m * N[(N[(x * 0.5), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \frac{x \cdot 0.5}{z}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6468.9
Applied rewrites68.9%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.0
Applied rewrites37.0%
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6438.3
Applied rewrites38.3%
Final simplification60.7%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (/ (/ y_m x) z) (* y_m (/ (* x 0.5) z)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / x) / z;
} else {
tmp = y_m * ((x * 0.5) / z);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = (y_m / x) / z
else
tmp = y_m * ((x * 0.5d0) / z)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / x) / z;
} else {
tmp = y_m * ((x * 0.5) / z);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = (y_m / x) / z else: tmp = y_m * ((x * 0.5) / z) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(Float64(y_m / x) / z); else tmp = Float64(y_m * Float64(Float64(x * 0.5) / z)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = (y_m / x) / z; else tmp = y_m * ((x * 0.5) / z); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(N[(y$95$m / x), $MachinePrecision] / z), $MachinePrecision], N[(y$95$m * N[(N[(x * 0.5), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{\frac{y\_m}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \frac{x \cdot 0.5}{z}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f6467.4
Applied rewrites67.4%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.0
Applied rewrites37.0%
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6438.3
Applied rewrites38.3%
Final simplification59.6%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (/ y_m (* x z)) (* y_m (/ (* x 0.5) z)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = y_m / (x * z);
} else {
tmp = y_m * ((x * 0.5) / z);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = y_m / (x * z)
else
tmp = y_m * ((x * 0.5d0) / z)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = y_m / (x * z);
} else {
tmp = y_m * ((x * 0.5) / z);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = y_m / (x * z) else: tmp = y_m * ((x * 0.5) / z) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(y_m / Float64(x * z)); else tmp = Float64(y_m * Float64(Float64(x * 0.5) / z)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = y_m / (x * z); else tmp = y_m * ((x * 0.5) / z); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(y$95$m / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(N[(x * 0.5), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{y\_m}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \frac{x \cdot 0.5}{z}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.0
Applied rewrites37.0%
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6438.3
Applied rewrites38.3%
Final simplification59.0%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (/ y_m (* x z)) (* (* y_m x) (/ 0.5 z)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = y_m / (x * z);
} else {
tmp = (y_m * x) * (0.5 / z);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = y_m / (x * z)
else
tmp = (y_m * x) * (0.5d0 / z)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = y_m / (x * z);
} else {
tmp = (y_m * x) * (0.5 / z);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = y_m / (x * z) else: tmp = (y_m * x) * (0.5 / z) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(y_m / Float64(x * z)); else tmp = Float64(Float64(y_m * x) * Float64(0.5 / z)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = y_m / (x * z); else tmp = (y_m * x) * (0.5 / z); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(y$95$m / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * x), $MachinePrecision] * N[(0.5 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{y\_m}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(y\_m \cdot x\right) \cdot \frac{0.5}{z}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.0
Applied rewrites37.0%
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Final simplification58.7%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (/ y_m (* x z)) (* (/ y_m z) (* x 0.5)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = y_m / (x * z);
} else {
tmp = (y_m / z) * (x * 0.5);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = y_m / (x * z)
else
tmp = (y_m / z) * (x * 0.5d0)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = y_m / (x * z);
} else {
tmp = (y_m / z) * (x * 0.5);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = y_m / (x * z) else: tmp = (y_m / z) * (x * 0.5) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(y_m / Float64(x * z)); else tmp = Float64(Float64(y_m / z) * Float64(x * 0.5)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = y_m / (x * z); else tmp = (y_m / z) * (x * 0.5); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(y$95$m / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{y\_m}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m}{z} \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.0
Applied rewrites37.0%
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6430.1
Applied rewrites30.1%
Final simplification56.8%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (/ y_m (* x z))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
return y_s * (y_m / (x * z));
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (y_m / (x * z))
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
return y_s * (y_m / (x * z));
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): return y_s * (y_m / (x * z))
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) return Float64(y_s * Float64(y_m / Float64(x * z))) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp = code(y_s, x, y_m, z) tmp = y_s * (y_m / (x * z)); end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(y$95$m / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \frac{y\_m}{x \cdot z}
\end{array}
Initial program 82.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6450.1
Applied rewrites50.1%
(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 2024219
(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))